Commit 1d66b5c4 authored by francescomani's avatar francescomani

attempting to fix wrong implementation in NSA UE configuration

parent 09665eeb
...@@ -316,7 +316,7 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, ...@@ -316,7 +316,7 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
// carrier config // carrier config
LOG_D(MAC, "Entering UE Config Common\n"); LOG_D(MAC, "Entering UE Config Common\n");
AssertFatal(scc==NULL,"scc cannot be null\n"); AssertFatal(scc!=NULL,"scc cannot be null\n");
if (scc) { if (scc) {
cfg->carrier_config.dl_bandwidth = config_bandwidth(scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, cfg->carrier_config.dl_bandwidth = config_bandwidth(scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
...@@ -658,7 +658,7 @@ int nr_rrc_mac_config_req_ue( ...@@ -658,7 +658,7 @@ int nr_rrc_mac_config_req_ue(
ra->rach_ConfigDedicated = scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink; ra->rach_ConfigDedicated = scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink;
} }
mac->scc = scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon; mac->scc = scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon;
mac->physCellId = *mac->scc->physCellId; mac->physCellId = *mac->scc->physCellId;
config_common_ue(mac,module_id,cc_idP); config_common_ue(mac,module_id,cc_idP);
mac->crnti = scell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity; mac->crnti = scell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity;
LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti); LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti);
......
...@@ -201,42 +201,38 @@ extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * con ...@@ -201,42 +201,38 @@ extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * con
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded) // from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded)
int8_t nr_rrc_ue_decode_secondary_cellgroup_config( int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const module_id_t module_id,
const module_id_t module_id, const uint8_t *buffer,
const uint8_t *buffer, const uint32_t size){
const uint32_t size ){
NR_CellGroupConfig_t *cell_group_config = NULL; NR_CellGroupConfig_t *cell_group_config = NULL;
uint32_t i; uint32_t i;
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
&asn_DEF_NR_CellGroupConfig,
(void **)&cell_group_config,
(uint8_t *)buffer,
size );
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
printf("NR_CellGroupConfig decode error\n");
for (i=0; i<size; i++){
printf("%02x ",buffer[i]);
}
printf("\n");
// free the memory
SEQUENCE_free( &asn_DEF_NR_CellGroupConfig, (void *)cell_group_config, 1 );
return -1;
}
if(NR_UE_rrc_inst[module_id].scell_group_config == NULL){ asn_dec_rval_t dec_rval = uper_decode(NULL,
NR_UE_rrc_inst[module_id].scell_group_config = cell_group_config; &asn_DEF_NR_CellGroupConfig,
nr_rrc_ue_process_scg_config(module_id,cell_group_config); (void **)&cell_group_config,
}else{ (uint8_t *)buffer,
nr_rrc_ue_process_scg_config(module_id,cell_group_config); size, 0, 0);
SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)cell_group_config, 0);
} if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
printf("NR_CellGroupConfig decode error\n");
for (i=0; i<size; i++)
printf("%02x ",buffer[i]);
printf("\n");
// free the memory
SEQUENCE_free( &asn_DEF_NR_CellGroupConfig, (void *)cell_group_config, 1 );
return -1;
}
//nr_rrc_mac_config_req_ue( 0,0,0,NULL, cell_group_config->mac_CellGroupConfig, cell_group_config->physicalCellGroupConfig, cell_group_config->spCellConfig ); if(NR_UE_rrc_inst[module_id].scell_group_config == NULL){
NR_UE_rrc_inst[module_id].scell_group_config = cell_group_config;
nr_rrc_ue_process_scg_config(module_id,cell_group_config);
}else{
nr_rrc_ue_process_scg_config(module_id,cell_group_config);
SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)cell_group_config, 0);
}
return 0; return 0;
} }
int8_t nr_rrc_ue_process_RadioBearerConfig(NR_RadioBearerConfig_t *RadioBearerConfig){ int8_t nr_rrc_ue_process_RadioBearerConfig(NR_RadioBearerConfig_t *RadioBearerConfig){
...@@ -262,25 +258,33 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR ...@@ -262,25 +258,33 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
} }
} }
if(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup != NULL){ if(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup != NULL){
NR_CellGroupConfig_t *cellGroupConfig = NULL;
uper_decode(NULL, if(get_softmodem_params()->sa) {
&asn_DEF_NR_CellGroupConfig, //might be added prefix later
(void **)&cellGroupConfig, NR_CellGroupConfig_t *cellGroupConfig = NULL;
(uint8_t *)rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup->buf, uper_decode(NULL,
rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup->size, 0, 0); &asn_DEF_NR_CellGroupConfig, //might be added prefix later
(void **)&cellGroupConfig,
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)cellGroupConfig); (uint8_t *)rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup->buf,
rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup->size, 0, 0);
if(NR_UE_rrc_inst[module_id].cell_group_config == NULL){
// first time receive the configuration, just use the memory allocated from uper_decoder. TODO this is not good implementation, need to maintain RRC_INST own structure every time. xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)cellGroupConfig);
NR_UE_rrc_inst[module_id].cell_group_config = cellGroupConfig;
nr_rrc_ue_process_scg_config(module_id,cellGroupConfig); if(NR_UE_rrc_inst[module_id].cell_group_config == NULL){
}else{ // first time receive the configuration, just use the memory allocated from uper_decoder. TODO this is not good implementation, need to maintain RRC_INST own structure every time.
// after first time, update it and free the memory after. NR_UE_rrc_inst[module_id].cell_group_config = cellGroupConfig;
SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)NR_UE_rrc_inst[module_id].cell_group_config, 0); nr_rrc_ue_process_scg_config(module_id,cellGroupConfig);
NR_UE_rrc_inst[module_id].cell_group_config = cellGroupConfig; }else{
nr_rrc_ue_process_scg_config(module_id,cellGroupConfig); // after first time, update it and free the memory after.
SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)NR_UE_rrc_inst[module_id].cell_group_config, 0);
NR_UE_rrc_inst[module_id].cell_group_config = cellGroupConfig;
nr_rrc_ue_process_scg_config(module_id,cellGroupConfig);
}
} }
else
nr_rrc_ue_decode_secondary_cellgroup_config(module_id,
rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup->buf,
rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup->size);
} }
if(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->measConfig != NULL){ if(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->measConfig != NULL){
if(NR_UE_rrc_inst[module_id].meas_config == NULL){ if(NR_UE_rrc_inst[module_id].meas_config == NULL){
...@@ -317,7 +321,7 @@ int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){ ...@@ -317,7 +321,7 @@ int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){
int8_t nr_rrc_ue_process_scg_config(const module_id_t module_id, NR_CellGroupConfig_t *cell_group_config){ int8_t nr_rrc_ue_process_scg_config(const module_id_t module_id, NR_CellGroupConfig_t *cell_group_config){
int i; int i;
if(NR_UE_rrc_inst[module_id].cell_group_config==NULL){ if(cell_group_config==NULL){
// initial list // initial list
if(cell_group_config->spCellConfig != NULL){ if(cell_group_config->spCellConfig != NULL){
if(cell_group_config->spCellConfig->spCellConfigDedicated != NULL){ if(cell_group_config->spCellConfig->spCellConfigDedicated != NULL){
......
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