unified handling of cellgroup config at MAC
This commit is contained in:
@@ -852,7 +852,7 @@ int main(int argc, char **argv)
|
|||||||
//Configure UE
|
//Configure UE
|
||||||
NR_BCCH_BCH_Message_t *mib = get_new_MIB_NR(scc);
|
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_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->state = UE_CONNECTED;
|
||||||
UE_mac->ra.ra_state = RA_SUCCEEDED;
|
UE_mac->ra.ra_state = RA_SUCCEEDED;
|
||||||
|
|||||||
@@ -691,7 +691,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
//Configure UE
|
//Configure UE
|
||||||
NR_UE_RRC_INST_t rrcue = {0};
|
NR_UE_RRC_INST_t rrcue = {0};
|
||||||
rrcue.scell_group_config = secondaryCellGroup;
|
|
||||||
nr_l2_init_ue(&rrcue);
|
nr_l2_init_ue(&rrcue);
|
||||||
|
|
||||||
NR_UE_MAC_INST_t* UE_mac = get_mac_inst(0);
|
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)
|
if (mac->bwp_ulcommon->pucch_ConfigCommon)
|
||||||
UL_BWP->pucch_ConfigCommon = mac->bwp_ulcommon->pucch_ConfigCommon->choice.setup;
|
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;
|
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)
|
if (mac->bwp_dlcommon->pdcch_ConfigCommon)
|
||||||
configure_ss_coreset(mac, mac->bwp_dlcommon->pdcch_ConfigCommon->choice.setup, NULL);
|
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;
|
UL_BWP->configuredGrantConfig = bwp_uplink->bwp_Dedicated->configuredGrantConfig ? bwp_uplink->bwp_Dedicated->configuredGrantConfig->choice.setup : NULL;
|
||||||
if (bwp_uplink->bwp_Common->pucch_ConfigCommon)
|
if (bwp_uplink->bwp_Common->pucch_ConfigCommon)
|
||||||
UL_BWP->pucch_ConfigCommon = bwp_uplink->bwp_Common->pucch_ConfigCommon->choice.setup;
|
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;
|
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 {
|
else {
|
||||||
UL_BWP->tdaList_Common = mac->bwp_ulcommon->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
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)
|
if(mac->state < UE_CONNECTED)
|
||||||
configure_current_BWP(mac, scc, NULL);
|
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)
|
if (!get_softmodem_params()->emulate_l1)
|
||||||
mac->if_module->phy_config_request(&mac->phy_config);
|
mac->if_module->phy_config_request(&mac->phy_config);
|
||||||
mac->phy_config_request_sent = true;
|
mac->phy_config_request_sent = true;
|
||||||
@@ -768,49 +772,26 @@ 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,
|
int cc_idP,
|
||||||
NR_CellGroupConfig_t *cell_group_config)
|
NR_CellGroupConfig_t *cell_group_config)
|
||||||
{
|
{
|
||||||
LOG_I(MAC,"Applying CellGroupConfig from gNodeB\n");
|
LOG_I(MAC,"Applying CellGroupConfig from gNodeB\n");
|
||||||
AssertFatal(cell_group_config, "CellGroupConfig should not be NULL\n");
|
AssertFatal(cell_group_config, "CellGroupConfig should not be NULL\n");
|
||||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||||
mac->cg = cell_group_config;
|
mac->cg = cell_group_config;
|
||||||
|
|
||||||
if (cell_group_config->spCellConfig)
|
if (cell_group_config->spCellConfig)
|
||||||
mac->servCellIndex = cell_group_config->spCellConfig->servCellIndex ? *cell_group_config->spCellConfig->servCellIndex : 0;
|
mac->servCellIndex = cell_group_config->spCellConfig->servCellIndex ? *cell_group_config->spCellConfig->servCellIndex : 0;
|
||||||
else
|
else
|
||||||
mac->servCellIndex = 0;
|
mac->servCellIndex = 0;
|
||||||
mac->crossCarrierSchedulingConfig = cell_group_config->spCellConfig->spCellConfigDedicated->crossCarrierSchedulingConfig;
|
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) {
|
if (cell_group_config->spCellConfig && cell_group_config->spCellConfig->reconfigurationWithSync) {
|
||||||
LOG_A(NR_MAC, "Received the reconfigurationWithSync in %s\n", __FUNCTION__);
|
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);
|
handle_reconfiguration_with_sync(mac, module_id, cc_idP, cell_group_config->spCellConfig->reconfigurationWithSync);
|
||||||
}
|
}
|
||||||
configure_current_BWP(mac, NULL, cell_group_config);
|
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)
|
if (!mac->dl_config_request || !mac->ul_config_request)
|
||||||
ue_init_config_request(mac, mac->current_DL_BWP.scs);
|
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_BearerToAddModList *rlc_toadd_list,
|
||||||
struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_torelease_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,
|
int cc_idP,
|
||||||
NR_CellGroupConfig_t *scell_group_config);
|
NR_CellGroupConfig_t *cell_group_config);
|
||||||
|
|
||||||
void nr_rrc_mac_config_req_mcg(module_id_t module_id,
|
|
||||||
int cc_idP,
|
|
||||||
NR_CellGroupConfig_t *scell_group_config);
|
|
||||||
|
|
||||||
void nr_rrc_mac_config_req_mib(module_id_t module_id,
|
void nr_rrc_mac_config_req_mib(module_id_t module_id,
|
||||||
int cc_idP,
|
int cc_idP,
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ static void nr_rrc_ue_process_rrcReconfiguration(const instance_t instance,
|
|||||||
cellGroupConfig);
|
cellGroupConfig);
|
||||||
|
|
||||||
if (!get_softmodem_params()->sa)
|
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) {
|
if (ie->measConfig != NULL) {
|
||||||
LOG_I(NR_RRC, "Measurement Configuration is present\n");
|
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
|
// configure timers and constant
|
||||||
nr_rrc_set_sib1_timers_and_constants(&rrc->timers_and_constants, sib1);
|
nr_rrc_set_sib1_timers_and_constants(&rrc->timers_and_constants, sib1);
|
||||||
// take ServingCellConfigCommon and configure L1/L2
|
// take ServingCellConfigCommon and configure L1/L2
|
||||||
rrc->servingCellConfigCommonSIB = sib1->servingCellConfigCommon;
|
|
||||||
nr_rrc_mac_config_req_sib1(instance, 0, sib1->si_SchedulingInfo, sib1->servingCellConfigCommon);
|
nr_rrc_mac_config_req_sib1(instance, 0, sib1->si_SchedulingInfo, sib1->servingCellConfigCommon);
|
||||||
break;
|
break;
|
||||||
case NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformation:
|
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_CellGroupConfig_t *cellGroupConfig)
|
||||||
{
|
{
|
||||||
NR_UE_RRC_INST_t *rrc = &NR_UE_rrc_inst[instance];
|
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_UE_Timers_Constants_t *tac = &rrc->timers_and_constants;
|
||||||
|
|
||||||
NR_SpCellConfig_t *spCellConfig = cellGroupConfig->spCellConfig;
|
NR_SpCellConfig_t *spCellConfig = cellGroupConfig->spCellConfig;
|
||||||
@@ -860,7 +852,7 @@ static void nr_rrc_ue_process_masterCellGroup(instance_t instance,
|
|||||||
cellGroupConfig);
|
cellGroupConfig);
|
||||||
|
|
||||||
LOG_D(RRC,"Sending CellGroupConfig to MAC\n");
|
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)
|
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 {
|
typedef struct NR_UE_RRC_INST_s {
|
||||||
NR_MeasConfig_t *meas_config;
|
NR_MeasConfig_t *meas_config;
|
||||||
NR_CellGroupConfig_t *cell_group_config;
|
|
||||||
NR_ServingCellConfigCommonSIB_t *servingCellConfigCommonSIB;
|
|
||||||
NR_RadioBearerConfig_t *radio_bearer_config;
|
NR_RadioBearerConfig_t *radio_bearer_config;
|
||||||
|
|
||||||
rrcPerNB_t perNB[NB_CNX_UE];
|
rrcPerNB_t perNB[NB_CNX_UE];
|
||||||
|
|||||||
Reference in New Issue
Block a user