Commit 848f5767 authored by francescomani's avatar francescomani

unified handling of cellgroup config at MAC

parent df917624
......@@ -852,7 +852,7 @@ int main(int argc, char **argv)
//Configure UE
NR_BCCH_BCH_Message_t *mib = get_new_MIB_NR(scc);
nr_rrc_mac_config_req_mib(0, 0, mib->message.choice.mib, false);
nr_rrc_mac_config_req_scg(0, 0, secondaryCellGroup);
nr_rrc_mac_config_req_cg(0, 0, secondaryCellGroup);
UE_mac->state = UE_CONNECTED;
UE_mac->ra.ra_state = RA_SUCCEEDED;
......
......@@ -691,7 +691,6 @@ int main(int argc, char *argv[])
//Configure UE
NR_UE_RRC_INST_t rrcue = {0};
rrcue.scell_group_config = secondaryCellGroup;
nr_l2_init_ue(&rrcue);
NR_UE_MAC_INST_t* UE_mac = get_mac_inst(0);
......
......@@ -564,8 +564,11 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac,
}
if (mac->bwp_ulcommon->pucch_ConfigCommon)
UL_BWP->pucch_ConfigCommon = mac->bwp_ulcommon->pucch_ConfigCommon->choice.setup;
if (mac->bwp_ulcommon->rach_ConfigCommon)
if (mac->bwp_ulcommon->rach_ConfigCommon) {
UL_BWP->rach_ConfigCommon = mac->bwp_ulcommon->rach_ConfigCommon->choice.setup;
// Setup the SSB to Rach Occasions mapping according to the config
build_ssb_to_ro_map(mac);
}
if (mac->bwp_dlcommon->pdcch_ConfigCommon)
configure_ss_coreset(mac, mac->bwp_dlcommon->pdcch_ConfigCommon->choice.setup, NULL);
}
......@@ -641,8 +644,11 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac,
UL_BWP->configuredGrantConfig = bwp_uplink->bwp_Dedicated->configuredGrantConfig ? bwp_uplink->bwp_Dedicated->configuredGrantConfig->choice.setup : NULL;
if (bwp_uplink->bwp_Common->pucch_ConfigCommon)
UL_BWP->pucch_ConfigCommon = bwp_uplink->bwp_Common->pucch_ConfigCommon->choice.setup;
if (bwp_uplink->bwp_Common->rach_ConfigCommon)
if (bwp_uplink->bwp_Common->rach_ConfigCommon) {
UL_BWP->rach_ConfigCommon = bwp_uplink->bwp_Common->rach_ConfigCommon->choice.setup;
// Setup the SSB to Rach Occasions mapping according to the config
build_ssb_to_ro_map(mac);
}
}
else {
UL_BWP->tdaList_Common = mac->bwp_ulcommon->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
......@@ -726,8 +732,6 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id,
if(mac->state < UE_CONNECTED)
configure_current_BWP(mac, scc, NULL);
// Setup the SSB to Rach Occasionsif (cell_group_config->spCellConfig) { mapping according to the config
build_ssb_to_ro_map(mac);
if (!get_softmodem_params()->emulate_l1)
mac->if_module->phy_config_request(&mac->phy_config);
mac->phy_config_request_sent = true;
......@@ -768,7 +772,7 @@ void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac,
}
}
void nr_rrc_mac_config_req_mcg(module_id_t module_id,
void nr_rrc_mac_config_req_cg(module_id_t module_id,
int cc_idP,
NR_CellGroupConfig_t *cell_group_config)
{
......@@ -776,41 +780,18 @@ void nr_rrc_mac_config_req_mcg(module_id_t module_id,
AssertFatal(cell_group_config, "CellGroupConfig should not be NULL\n");
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
mac->cg = cell_group_config;
if (cell_group_config->spCellConfig)
mac->servCellIndex = cell_group_config->spCellConfig->servCellIndex ? *cell_group_config->spCellConfig->servCellIndex : 0;
else
mac->servCellIndex = 0;
mac->crossCarrierSchedulingConfig = cell_group_config->spCellConfig->spCellConfigDedicated->crossCarrierSchedulingConfig;
mac->scheduling_info.periodicBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING;
mac->scheduling_info.retxBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING;
mac->BSR_reporting_active = NR_BSR_TRIGGER_NONE;
LOG_D(MAC, "[UE %d]: periodic BSR %d (SF), retx BSR %d (SF)\n",
module_id,
mac->scheduling_info.periodicBSR_SF,
mac->scheduling_info.retxBSR_SF);
if (cell_group_config->spCellConfig && cell_group_config->spCellConfig->reconfigurationWithSync) {
LOG_A(NR_MAC, "Received the reconfigurationWithSync in %s\n", __FUNCTION__);
handle_reconfiguration_with_sync(mac, module_id, cc_idP, cell_group_config->spCellConfig->reconfigurationWithSync);
}
configure_current_BWP(mac, NULL, cell_group_config);
}
void nr_rrc_mac_config_req_scg(module_id_t module_id,
int cc_idP,
NR_CellGroupConfig_t *scell_group_config)
{
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
AssertFatal(scell_group_config, "scell_group_config cannot be NULL\n");
mac->cg = scell_group_config;
mac->servCellIndex = *scell_group_config->spCellConfig->servCellIndex;
mac->crossCarrierSchedulingConfig = scell_group_config->spCellConfig->spCellConfigDedicated->crossCarrierSchedulingConfig;
if (scell_group_config->spCellConfig->reconfigurationWithSync)
handle_reconfiguration_with_sync(mac, module_id, cc_idP, scell_group_config->spCellConfig->reconfigurationWithSync);
configure_current_BWP(mac, NULL, scell_group_config);
if (!mac->dl_config_request || !mac->ul_config_request)
ue_init_config_request(mac, mac->current_DL_BWP.scs);
// Setup the SSB to Rach Occasions mapping according to the config
build_ssb_to_ro_map(mac);
}
......@@ -67,13 +67,9 @@ void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_toadd_list,
struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_torelease_list);
void nr_rrc_mac_config_req_scg(module_id_t module_id,
void nr_rrc_mac_config_req_cg(module_id_t module_id,
int cc_idP,
NR_CellGroupConfig_t *scell_group_config);
void nr_rrc_mac_config_req_mcg(module_id_t module_id,
int cc_idP,
NR_CellGroupConfig_t *scell_group_config);
NR_CellGroupConfig_t *cell_group_config);
void nr_rrc_mac_config_req_mib(module_id_t module_id,
int cc_idP,
......
......@@ -229,7 +229,7 @@ static void nr_rrc_ue_process_rrcReconfiguration(const instance_t instance,
cellGroupConfig);
if (!get_softmodem_params()->sa)
nr_rrc_mac_config_req_scg(0, 0, cellGroupConfig);
nr_rrc_mac_config_req_cg(0, 0, cellGroupConfig);
}
if (ie->measConfig != NULL) {
LOG_I(NR_RRC, "Measurement Configuration is present\n");
......@@ -709,7 +709,6 @@ static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(instance_t instance,
// configure timers and constant
nr_rrc_set_sib1_timers_and_constants(&rrc->timers_and_constants, sib1);
// take ServingCellConfigCommon and configure L1/L2
rrc->servingCellConfigCommonSIB = sib1->servingCellConfigCommon;
nr_rrc_mac_config_req_sib1(instance, 0, sib1->si_SchedulingInfo, sib1->servingCellConfigCommon);
break;
case NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformation:
......@@ -773,13 +772,6 @@ void nr_rrc_cellgroup_configuration(rrcPerNB_t *rrcNB,
NR_CellGroupConfig_t *cellGroupConfig)
{
NR_UE_RRC_INST_t *rrc = &NR_UE_rrc_inst[instance];
if(rrc->cell_group_config == NULL)
rrc->cell_group_config = cellGroupConfig;
else {
ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, rrc->cell_group_config);
rrc->cell_group_config = cellGroupConfig;
}
NR_UE_Timers_Constants_t *tac = &rrc->timers_and_constants;
NR_SpCellConfig_t *spCellConfig = cellGroupConfig->spCellConfig;
......@@ -860,7 +852,7 @@ static void nr_rrc_ue_process_masterCellGroup(instance_t instance,
cellGroupConfig);
LOG_D(RRC,"Sending CellGroupConfig to MAC\n");
nr_rrc_mac_config_req_mcg(instance, 0, cellGroupConfig);
nr_rrc_mac_config_req_cg(instance, 0, cellGroupConfig);
}
static void rrc_ue_generate_RRCSetupComplete(instance_t instance, rnti_t rnti, const uint8_t Transaction_id, uint8_t sel_plmn_id)
......
......@@ -199,8 +199,6 @@ typedef struct rrcPerNB {
typedef struct NR_UE_RRC_INST_s {
NR_MeasConfig_t *meas_config;
NR_CellGroupConfig_t *cell_group_config;
NR_ServingCellConfigCommonSIB_t *servingCellConfigCommonSIB;
NR_RadioBearerConfig_t *radio_bearer_config;
rrcPerNB_t perNB[NB_CNX_UE];
......
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