Commit e7479258 authored by Thomas Schlichter's avatar Thomas Schlichter

fix BWP switching

Co-authored-by: default avatarLuis Pereira <lpereira@allbesmart.pt>
parent 21722a9f
...@@ -3933,7 +3933,8 @@ void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, NR_UE_info_t *UE, ...@@ -3933,7 +3933,8 @@ void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, NR_UE_info_t *UE,
buf, buf,
sizeof(buf)); sizeof(buf));
AssertFatal(enc_rval.encoded > 0, "ASN1 encoding of CellGroupConfig failed, failed type %s\n", enc_rval.failed_type->name); AssertFatal(enc_rval.encoded > 0, "ASN1 encoding of CellGroupConfig failed, failed type %s\n", enc_rval.failed_type->name);
UE->reestablish_rlc = true; ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->reconfigCellGroup);
UE->reconfigCellGroup = cellGroup_for_UE;
du_to_cu_rrc_information_t du2cu = { du_to_cu_rrc_information_t du2cu = {
.cellGroupConfig = buf, .cellGroupConfig = buf,
.cellGroupConfig_length = (enc_rval.encoded + 7) >> 3, .cellGroupConfig_length = (enc_rval.encoded + 7) >> 3,
...@@ -3947,8 +3948,6 @@ void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, NR_UE_info_t *UE, ...@@ -3947,8 +3948,6 @@ void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, NR_UE_info_t *UE,
.cause_value = F1AP_CauseRadioNetwork_action_desirable_for_radio_reasons, .cause_value = F1AP_CauseRadioNetwork_action_desirable_for_radio_reasons,
}; };
nrmac->mac_rrc.ue_context_modification_required(&required); nrmac->mac_rrc.ue_context_modification_required(&required);
if (cellGroup_for_UE)
free_cellGroupConfig(cellGroup_for_UE);
} }
long get_lcid_from_drbid(int drb_id) long get_lcid_from_drbid(int drb_id)
......
...@@ -3813,14 +3813,12 @@ NR_CellGroupConfig_t *update_cellGroupConfig_for_BWP_switch(NR_CellGroupConfig_t ...@@ -3813,14 +3813,12 @@ NR_CellGroupConfig_t *update_cellGroupConfig_for_BWP_switch(NR_CellGroupConfig_t
// we temporarily need to keep both the old and the new BWP in the CG used by the gNB // we temporarily need to keep both the old and the new BWP in the CG used by the gNB
// while removing the old from the CG sent to the UE // while removing the old from the CG sent to the UE
if (old_bwp > 0) { NR_CellGroupConfig_t *clone_cg = NULL;
NR_CellGroupConfig_t *clone_cg = NULL; const int copy_result = asn_copy(&asn_DEF_NR_CellGroupConfig, (void **)&clone_cg, cellGroupConfig);
const int copy_result = asn_copy(&asn_DEF_NR_CellGroupConfig, (void **)&clone_cg, cellGroupConfig); AssertFatal(copy_result == 0, "unable to copy NR_CellGroupConfig for cloning\n");
AssertFatal(copy_result == 0, "unable to copy NR_CellGroupConfig for cloning\n"); if (old_bwp > 0)
clean_bwp_structures(clone_cg->spCellConfig); clean_bwp_structures(clone_cg->spCellConfig);
return clone_cg; return clone_cg;
}
return NULL;
} }
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
...@@ -3933,11 +3931,6 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, ...@@ -3933,11 +3931,6 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
} }
} }
void free_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig)
{
ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, cellGroupConfig);
}
int encode_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, uint8_t *buffer, int max_buffer_size) int encode_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, uint8_t *buffer, int max_buffer_size)
{ {
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, cellGroupConfig, buffer, max_buffer_size); asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, cellGroupConfig, buffer, max_buffer_size);
......
...@@ -96,7 +96,6 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, ...@@ -96,7 +96,6 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
const NR_UE_NR_Capability_t *uecap, const NR_UE_NR_Capability_t *uecap,
const nr_mac_config_t *configuration, const nr_mac_config_t *configuration,
const NR_ServingCellConfigCommon_t *scc); const NR_ServingCellConfigCommon_t *scc);
void free_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig);
int encode_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, uint8_t *buffer, int max_buffer_size); int encode_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, uint8_t *buffer, int max_buffer_size);
NR_CellGroupConfig_t *decode_cellGroupConfig(const uint8_t *buffer, int max_buffer_size); NR_CellGroupConfig_t *decode_cellGroupConfig(const uint8_t *buffer, int max_buffer_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment