Commit 0f897b40 authored by Robert Schmidt's avatar Robert Schmidt

Move ServingCellConfigDedicated to MAC

As with the ServingCellConfigCommon, the ServingCellConfigDedicated is a
radio-related structure to be handled at the DU.
parent 2b295315
...@@ -632,7 +632,7 @@ int main(int argc, char **argv) ...@@ -632,7 +632,7 @@ int main(int argc, char **argv)
RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int)); RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int));
for (i = 0; i < RC.nb_nr_macrlc_inst; i++) for (i = 0; i < RC.nb_nr_macrlc_inst; i++)
RC.nb_nr_mac_CC[i] = 1; RC.nb_nr_mac_CC[i] = 1;
mac_top_init_gNB(ngran_gNB, scc); mac_top_init_gNB(ngran_gNB, scc, NULL);
gNB_mac = RC.nrmac[0]; gNB_mac = RC.nrmac[0];
gNB_mac->dl_bler.harq_round_max = num_rounds; gNB_mac->dl_bler.harq_round_max = num_rounds;
......
...@@ -623,7 +623,7 @@ int main(int argc, char *argv[]) ...@@ -623,7 +623,7 @@ int main(int argc, char *argv[])
RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int)); RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int));
for (i = 0; i < RC.nb_nr_macrlc_inst; i++) for (i = 0; i < RC.nb_nr_macrlc_inst; i++)
RC.nb_nr_mac_CC[i] = 1; RC.nb_nr_mac_CC[i] = 1;
mac_top_init_gNB(ngran_gNB, scc); mac_top_init_gNB(ngran_gNB, scc, NULL /* scd will be updated further below */);
NR_ServingCellConfig_t *scd = calloc(1,sizeof(NR_ServingCellConfig_t)); NR_ServingCellConfig_t *scd = calloc(1,sizeof(NR_ServingCellConfig_t));
prepare_scd(scd); prepare_scd(scd);
......
...@@ -415,7 +415,6 @@ typedef struct NRRrcConfigurationReq_s { ...@@ -415,7 +415,6 @@ typedef struct NRRrcConfigurationReq_s {
uint16_t mnc[PLMN_LIST_MAX_SIZE]; uint16_t mnc[PLMN_LIST_MAX_SIZE];
uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE]; uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE];
uint8_t num_plmn; uint8_t num_plmn;
NR_ServingCellConfig_t *scd;
int sib1_tda; int sib1_tda;
rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts; rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts;
int pusch_AntennaPorts; int pusch_AntennaPorts;
......
...@@ -987,11 +987,12 @@ void RCconfig_nr_macrlc() { ...@@ -987,11 +987,12 @@ void RCconfig_nr_macrlc() {
NR_ServingCellConfigCommon_t *scc = get_scc_config(minRXTXTIME); NR_ServingCellConfigCommon_t *scc = get_scc_config(minRXTXTIME);
//xer_fprint(stdout, &asn_DEF_NR_ServingCellConfigCommon, scc); //xer_fprint(stdout, &asn_DEF_NR_ServingCellConfigCommon, scc);
NR_ServingCellConfig_t *scd = get_scd_config();
if (MacRLC_ParamList.numelt > 0) { if (MacRLC_ParamList.numelt > 0) {
RC.nb_nr_macrlc_inst = MacRLC_ParamList.numelt; RC.nb_nr_macrlc_inst = MacRLC_ParamList.numelt;
ngran_node_t node_type = get_node_type(); ngran_node_t node_type = get_node_type();
mac_top_init_gNB(node_type, scc); mac_top_init_gNB(node_type, scc, scd);
RC.nb_nr_mac_CC = (int *)malloc(RC.nb_nr_macrlc_inst * sizeof(int)); RC.nb_nr_mac_CC = (int *)malloc(RC.nb_nr_macrlc_inst * sizeof(int));
for (j = 0; j < RC.nb_nr_macrlc_inst; j++) { for (j = 0; j < RC.nb_nr_macrlc_inst; j++) {
...@@ -1261,8 +1262,6 @@ void RCconfig_NRRRC(gNB_RRC_INST *rrc) ...@@ -1261,8 +1262,6 @@ void RCconfig_NRRRC(gNB_RRC_INST *rrc)
paramdef_t GNBParams[] = GNBPARAMS_DESC; paramdef_t GNBParams[] = GNBPARAMS_DESC;
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0}; paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0};
NR_ServingCellConfig_t *scd = get_scd_config();
////////// Physical parameters ////////// Physical parameters
/* get global parameters, defined outside any section in the config file */ /* get global parameters, defined outside any section in the config file */
...@@ -1400,7 +1399,6 @@ void RCconfig_NRRRC(gNB_RRC_INST *rrc) ...@@ -1400,7 +1399,6 @@ void RCconfig_NRRRC(gNB_RRC_INST *rrc)
nrrrc_config.do_SRS = *GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr; nrrrc_config.do_SRS = *GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr;
nrrrc_config.force_256qam_off = *GNBParamList.paramarray[i][GNB_FORCE256QAMOFF_IDX].iptr; nrrrc_config.force_256qam_off = *GNBParamList.paramarray[i][GNB_FORCE256QAMOFF_IDX].iptr;
LOG_I(GNB_APP, "256 QAM: %s\n", nrrrc_config.force_256qam_off ? "force off" : "may be on"); LOG_I(GNB_APP, "256 QAM: %s\n", nrrrc_config.force_256qam_off ? "force off" : "may be on");
nrrrc_config.scd = scd;
nrrrc_config.enable_sdap = *GNBParamList.paramarray[i][GNB_ENABLE_SDAP_IDX].iptr; nrrrc_config.enable_sdap = *GNBParamList.paramarray[i][GNB_ENABLE_SDAP_IDX].iptr;
LOG_I(GNB_APP, "SDAP layer is %s\n", nrrrc_config.enable_sdap ? "enabled" : "disabled"); LOG_I(GNB_APP, "SDAP layer is %s\n", nrrrc_config.enable_sdap ? "enabled" : "disabled");
nrrrc_config.drbs = *GNBParamList.paramarray[i][GNB_DRBS].iptr; nrrrc_config.drbs = *GNBParamList.paramarray[i][GNB_DRBS].iptr;
......
...@@ -2890,7 +2890,7 @@ void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE) ...@@ -2890,7 +2890,7 @@ void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE)
int CC_id = 0; int CC_id = 0;
gNB_RRC_INST *rrc = RC.nrrrc[mod_id]; gNB_RRC_INST *rrc = RC.nrrrc[mod_id];
const NR_ServingCellConfigCommon_t *scc = mac->common_channels[CC_id].ServingCellConfigCommon; const NR_ServingCellConfigCommon_t *scc = mac->common_channels[CC_id].ServingCellConfigCommon;
const NR_ServingCellConfig_t *sccd = rrc->configuration.scd; const NR_ServingCellConfig_t *sccd = mac->common_channels[CC_id].pre_ServingCellConfig;
NR_CellGroupConfig_t *cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, sccd, &rrc->configuration); NR_CellGroupConfig_t *cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, sccd, &rrc->configuration);
UE->CellGroup = cellGroupConfig; UE->CellGroup = cellGroupConfig;
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
void set_cset_offset(uint16_t); void set_cset_offset(uint16_t);
void mac_top_init_gNB(ngran_node_t node_type, NR_ServingCellConfigCommon_t *scc); void mac_top_init_gNB(ngran_node_t node_type, NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfig_t *scd);
int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP, int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP,
rnti_t rnti, rnti_t rnti,
......
...@@ -205,7 +205,7 @@ static void mac_rrc_init(gNB_MAC_INST *mac, ngran_node_t node_type) ...@@ -205,7 +205,7 @@ static void mac_rrc_init(gNB_MAC_INST *mac, ngran_node_t node_type)
} }
} }
void mac_top_init_gNB(ngran_node_t node_type, NR_ServingCellConfigCommon_t *scc) void mac_top_init_gNB(ngran_node_t node_type, NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfig_t *scd)
{ {
module_id_t i; module_id_t i;
gNB_MAC_INST *nrmac; gNB_MAC_INST *nrmac;
...@@ -242,6 +242,7 @@ void mac_top_init_gNB(ngran_node_t node_type, NR_ServingCellConfigCommon_t *scc) ...@@ -242,6 +242,7 @@ void mac_top_init_gNB(ngran_node_t node_type, NR_ServingCellConfigCommon_t *scc)
RC.nrmac[i]->ul_handle = 0; RC.nrmac[i]->ul_handle = 0;
RC.nrmac[i]->common_channels[0].ServingCellConfigCommon = scc; RC.nrmac[i]->common_channels[0].ServingCellConfigCommon = scc;
RC.nrmac[i]->common_channels[0].pre_ServingCellConfig = scd;
RC.nrmac[i]->first_MIB = true; RC.nrmac[i]->first_MIB = true;
......
...@@ -220,6 +220,8 @@ typedef struct { ...@@ -220,6 +220,8 @@ typedef struct {
NR_BCCH_BCH_Message_t *mib; NR_BCCH_BCH_Message_t *mib;
NR_BCCH_DL_SCH_Message_t *sib1; NR_BCCH_DL_SCH_Message_t *sib1;
NR_ServingCellConfigCommon_t *ServingCellConfigCommon; NR_ServingCellConfigCommon_t *ServingCellConfigCommon;
/// pre-configured ServingCellConfig that is default for every UE
NR_ServingCellConfig_t *pre_ServingCellConfig;
NR_ARFCN_ValueEUTRA_t ul_CarrierFreq; NR_ARFCN_ValueEUTRA_t ul_CarrierFreq;
long ul_Bandwidth; long ul_Bandwidth;
/// Outgoing MIB PDU for PHY /// Outgoing MIB PDU for PHY
......
...@@ -274,10 +274,11 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration ...@@ -274,10 +274,11 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration
} }
if (get_softmodem_params()->phy_test > 0 || get_softmodem_params()->do_ra > 0) { if (get_softmodem_params()->phy_test > 0 || get_softmodem_params()->do_ra > 0) {
AssertFatal(NODE_IS_MONOLITHIC(rrc->node_type), "phy_test and do_ra only work in monolithic\n");
rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_allocate_new_ue_context(rrc); rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_allocate_new_ue_context(rrc);
gNB_RRC_UE_t *UE = &ue_context_p->ue_context; gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
UE->spCellConfig = calloc(1, sizeof(struct NR_SpCellConfig)); UE->spCellConfig = calloc(1, sizeof(struct NR_SpCellConfig));
UE->spCellConfig->spCellConfigDedicated = configuration->scd; UE->spCellConfig->spCellConfigDedicated = RC.nrmac[0]->common_channels[0].pre_ServingCellConfig;
LOG_I(NR_RRC,"Adding new user (%p)\n",ue_context_p); LOG_I(NR_RRC,"Adding new user (%p)\n",ue_context_p);
if (!NODE_IS_CU(RC.nrrrc[0]->node_type)) { if (!NODE_IS_CU(RC.nrrrc[0]->node_type)) {
rrc_add_nsa_user(rrc,ue_context_p,NULL); rrc_add_nsa_user(rrc,ue_context_p,NULL);
......
...@@ -105,8 +105,9 @@ void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, NR_UE_CapabilityRAT_ContainerL ...@@ -105,8 +105,9 @@ void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, NR_UE_CapabilityRAT_ContainerL
} }
LOG_A(NR_RRC, "Successfully decoded UE NR capabilities (NR and MRDC)\n"); LOG_A(NR_RRC, "Successfully decoded UE NR capabilities (NR and MRDC)\n");
AssertFatal(NODE_IS_MONOLITHIC(rrc->node_type), "phy_test and do_ra only work in monolithic\n");
UE->spCellConfig = calloc(1, sizeof(struct NR_SpCellConfig)); UE->spCellConfig = calloc(1, sizeof(struct NR_SpCellConfig));
UE->spCellConfig->spCellConfigDedicated = rrc->configuration.scd; UE->spCellConfig->spCellConfigDedicated = RC.nrmac[0]->common_channels[0].pre_ServingCellConfig;
LOG_I(NR_RRC,"Adding new NSA user (%p)\n",ue_context_p); LOG_I(NR_RRC,"Adding new NSA user (%p)\n",ue_context_p);
rrc_add_nsa_user(rrc,ue_context_p, m); rrc_add_nsa_user(rrc,ue_context_p, m);
} }
......
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