Move radio configuration parameters to MAC, SIB1 not initialized!

!SIB1 is not correctly filled! This commit does not work with COTS UEs!
The next commit fixes this.

- Move radio config (e.g., minRXTXTIME, SIB1 TDA, do_SRS, etc) down to
  MAC.
- Some parameters in MAC are redundant: delete them.
- Remove call to nr_mac_config_scc() from RRC and simulators, the MAC
  initialization routine calls it implicitly
This commit is contained in:
Robert Schmidt
2023-09-22 08:22:15 +02:00
parent 67d5f56a3c
commit c930563929
21 changed files with 155 additions and 172 deletions
+3 -4
View File
@@ -196,8 +196,8 @@ int xer_nr_sprint (char *string, size_t string_size, asn_TYPE_descriptor_t *td,
//------------------------------------------------------------------------------
uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier,
gNB_RrcConfigurationReq *configuration) {
uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier)
{
asn_enc_rval_t enc_rval;
SystemInformation_IEs__sib_TypeAndInfo__Member *sib2 = NULL;
SystemInformation_IEs__sib_TypeAndInfo__Member *sib3 = NULL;
@@ -689,7 +689,6 @@ int16_t do_RRCReconfiguration(
NR_MeasConfig_t *meas_config,
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList,
rrc_gNB_ue_context_t *const ue_context_pP,
const gNB_RrcConfigurationReq *configuration,
const NR_ServingCellConfigCommon_t *scc,
NR_CellGroupConfig_t *cellGroupConfig)
//------------------------------------------------------------------------------
@@ -747,7 +746,7 @@ int16_t do_RRCReconfiguration(
update_cellGroupConfig(cellGroupConfig,
ue_context_pP->ue_context.rrc_ue_id,
ue_context_pP ? ue_context_pP->ue_context.UE_Capability_nr : NULL,
configuration,
NULL,
scc);
} else {
LOG_W(RRC, "no scc, cannot update cellGroup\n");
+1 -4
View File
@@ -55,9 +55,7 @@
*/
int xer_sprint_NR(char *string, size_t string_size, struct asn_TYPE_descriptor_s *td, void *sptr);
uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier,
gNB_RrcConfigurationReq *configuration);
uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier);
int do_RRCReject(uint8_t Mod_id,
uint8_t *const buffer);
@@ -111,7 +109,6 @@ int16_t do_RRCReconfiguration(const protocol_ctxt_t *const ctxt_pP,
NR_MeasConfig_t *meas_config,
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList,
rrc_gNB_ue_context_t *const ue_context_pP,
const gNB_RrcConfigurationReq *configuration,
const NR_ServingCellConfigCommon_t *scc,
NR_CellGroupConfig_t *cellGroupConfig);
+16 -15
View File
@@ -30,6 +30,7 @@
#include "nr_rrc_config.h"
#include "common/utils/nr/nr_common.h"
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include "executables/softmodem-common.h"
#include "oai_asn1.h"
#include "SIMULATION/TOOLS/sim.h" // for taus();
@@ -1249,7 +1250,7 @@ static void config_uplinkBWP(NR_BWP_Uplink_t *ubwp,
long bwp_loop,
bool is_SA,
int uid,
const gNB_RrcConfigurationReq *configuration,
const nr_mac_config_t *configuration,
const NR_ServingCellConfig_t *servingcellconfigdedicated,
const NR_ServingCellConfigCommon_t *scc,
const NR_UE_NR_Capability_t *uecap)
@@ -1382,7 +1383,7 @@ static void set_csi_meas_periodicity(const NR_ServingCellConfigCommon_t *scc, NR
}
}
static void config_csi_codebook(const rrc_pdsch_AntennaPorts_t *antennaports,
static void config_csi_codebook(const nr_pdsch_AntennaPorts_t *antennaports,
const int max_layers,
struct NR_CodebookConfig *codebookConfig)
{
@@ -1487,7 +1488,7 @@ static void config_csi_meas_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
const NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_PUCCH_CSI_Resource_t *pucchcsires,
struct NR_SetupRelease_PDSCH_Config *pdsch_Config,
const rrc_pdsch_AntennaPorts_t *antennaports,
const nr_pdsch_AntennaPorts_t *antennaports,
const int max_layers,
int rep_id,
int uid)
@@ -1712,7 +1713,7 @@ int encode_MIB_NR(NR_BCCH_BCH_Message_t *mib, int frame, uint8_t *buf, int buf_s
return (enc_rval.encoded + 7) / 8;
}
NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const gNB_RrcConfigurationReq *configuration, const NR_ServingCellConfigCommon_t *scc)
NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const nr_mac_config_t *configuration, const NR_ServingCellConfigCommon_t *scc)
{
NR_BCCH_DL_SCH_Message_t *sib1_message = CALLOC(1,sizeof(NR_BCCH_DL_SCH_Message_t));
AssertFatal(sib1_message != NULL, "out of memory\n");
@@ -1740,17 +1741,17 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const gNB_RrcConfigurationReq *configurati
for (int i = 0; i < num_plmn; ++i) {
asn1cSequenceAdd(nr_plmn_info->plmn_IdentityList.list, struct NR_PLMN_Identity, nr_plmn);
asn1cCalloc(nr_plmn->mcc, mcc);
int confMcc = configuration->mcc[i];
int confMcc = 0;
asn1cSequenceAdd(mcc->list, NR_MCC_MNC_Digit_t, mcc0);
*mcc0 = (confMcc / 100) % 10;
asn1cSequenceAdd(mcc->list, NR_MCC_MNC_Digit_t, mcc1);
*mcc1 = (confMcc / 10) % 10;
asn1cSequenceAdd(mcc->list, NR_MCC_MNC_Digit_t, mcc2);
*mcc2 = confMcc % 10;
int mnc = configuration->mnc[i];
if (configuration->mnc_digit_length[i] == 3) {
int mnc = 0;
if (0 == 3) {
asn1cSequenceAdd(nr_plmn->mnc.list, NR_MCC_MNC_Digit_t, mnc0);
*mnc0 = (configuration->mnc[i] / 100) % 10;
*mnc0 = (0 / 100) % 10;
}
asn1cSequenceAdd(nr_plmn->mnc.list, NR_MCC_MNC_Digit_t, mnc1);
*mnc1 = (mnc / 10) % 10;
@@ -1762,13 +1763,13 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const gNB_RrcConfigurationReq *configurati
AssertFatal(nr_plmn_info->cellIdentity.buf != NULL, "out of memory\n");
nr_plmn_info->cellIdentity.size = 5;
nr_plmn_info->cellIdentity.bits_unused = 4;
uint64_t tmp = htobe64(configuration->cell_identity) << 4;
uint64_t tmp = htobe64(0) << 4;
memcpy(nr_plmn_info->cellIdentity.buf, ((char *)&tmp) + 3, 5);
nr_plmn_info->cellReservedForOperatorUse = NR_PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
nr_plmn_info->trackingAreaCode = CALLOC(1, sizeof(NR_TrackingAreaCode_t));
AssertFatal(nr_plmn_info->trackingAreaCode != NULL, "out of memory\n");
uint32_t tmp2 = htobe32(configuration->tac);
uint32_t tmp2 = htobe32(0);
nr_plmn_info->trackingAreaCode->buf = CALLOC(1, 3);
AssertFatal(nr_plmn_info->trackingAreaCode->buf != NULL, "out of memory\n");
memcpy(nr_plmn_info->trackingAreaCode->buf, ((char *)&tmp2) + 1, 3);
@@ -2067,7 +2068,7 @@ static NR_MAC_CellGroupConfig_t *configure_mac_cellgroup(void)
static NR_SpCellConfig_t *get_initial_SpCellConfig(int uid,
const NR_ServingCellConfigCommon_t *scc,
const NR_ServingCellConfig_t *servingcellconfigdedicated,
const gNB_RrcConfigurationReq *configuration)
const nr_mac_config_t *configuration)
{
const int pdsch_AntennaPorts =
configuration->pdsch_AntennaPorts.N1 * configuration->pdsch_AntennaPorts.N2 * configuration->pdsch_AntennaPorts.XP;
@@ -2314,7 +2315,7 @@ static NR_SpCellConfig_t *get_initial_SpCellConfig(int uid,
NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid,
const NR_ServingCellConfigCommon_t *scc,
const NR_ServingCellConfig_t *servingcellconfigdedicated,
const gNB_RrcConfigurationReq *configuration)
const nr_mac_config_t *configuration)
{
NR_CellGroupConfig_t *cellGroupConfig = calloc(1, sizeof(*cellGroupConfig));
cellGroupConfig->cellGroupId = 0;
@@ -2345,7 +2346,7 @@ NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid,
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
const int uid,
NR_UE_NR_Capability_t *uecap,
const gNB_RrcConfigurationReq *configuration,
const nr_mac_config_t *configuration,
const NR_ServingCellConfigCommon_t *scc)
{
DevAssert(cellGroupConfig != NULL);
@@ -2527,10 +2528,10 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
const NR_UE_NR_Capability_t *uecap,
int scg_id,
int servCellIndex,
const gNB_RrcConfigurationReq *configuration,
const nr_mac_config_t *configuration,
int uid)
{
const rrc_pdsch_AntennaPorts_t *pdschap = &configuration->pdsch_AntennaPorts;
const nr_pdsch_AntennaPorts_t *pdschap = &configuration->pdsch_AntennaPorts;
const int dl_antenna_ports = pdschap->N1 * pdschap->N2 * pdschap->XP;
const int do_csirs = configuration->do_CSIRS;
+8 -4
View File
@@ -34,6 +34,10 @@
#include "nr_rrc_defs.h"
#include "openair2/RRC/NR/MESSAGES/asn1_msg.h"
// forward declaration of MAC configuration parameters, definition is included in C file
struct nr_mac_config_t;
typedef struct nr_mac_config_t nr_mac_config_t;
void nr_rrc_config_dl_tda(struct NR_PDSCH_TimeDomainResourceAllocationList *pdsch_TimeDomainAllocationList,
frame_type_t frame_type,
NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,
@@ -53,18 +57,18 @@ int encode_MIB_NR(NR_BCCH_BCH_Message_t *mib, int frame, uint8_t *buf, int buf_s
#define NR_MAX_SIB_LENGTH 2976 // 3GPP TS 38.331 section 5.2.1
NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const gNB_RrcConfigurationReq *configuration, const NR_ServingCellConfigCommon_t *scc);
NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const nr_mac_config_t *configuration, const NR_ServingCellConfigCommon_t *scc);
void free_SIB1_NR(NR_BCCH_DL_SCH_Message_t *sib1);
int encode_SIB1_NR(NR_BCCH_DL_SCH_Message_t *sib1, uint8_t *buffer, int max_buffer_size);
NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid,
const NR_ServingCellConfigCommon_t *scc,
const NR_ServingCellConfig_t *servingcellconfigdedicated,
const gNB_RrcConfigurationReq *configuration);
const nr_mac_config_t *configuration);
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
const int uid,
NR_UE_NR_Capability_t *uecap,
const gNB_RrcConfigurationReq *configuration,
const nr_mac_config_t *configuration,
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);
@@ -78,7 +82,7 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
const NR_UE_NR_Capability_t *uecap,
int scg_id,
int servCellIndex,
const gNB_RrcConfigurationReq *configuration,
const nr_mac_config_t *configuration,
int uid);
#endif
-1
View File
@@ -69,7 +69,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
NR_RRCReconfiguration_IEs_t *reconfig,
NR_CellGroupConfig_t *secondaryCellGroup,
NR_UE_NR_Capability_t *uecap,
const gNB_RrcConfigurationReq *configuration,
int uid);
int generate_CG_Config(gNB_RRC_INST *rrc,
+3 -21
View File
@@ -278,28 +278,16 @@ static int get_ssb_arfcn(const f1ap_served_cell_info_t *cell_info, const NR_MIB_
///---------------------------------------------------------------------------------------------------------------///
///---------------------------------------------------------------------------------------------------------------///
static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration)
static void init_NR_SI(gNB_RRC_INST *rrc)
{
if (!NODE_IS_DU(rrc->node_type)) {
rrc->carrier.SIB23 = (uint8_t *) malloc16(100);
AssertFatal(rrc->carrier.SIB23 != NULL, "cannot allocate memory for SIB");
rrc->carrier.sizeof_SIB23 = do_SIB23_NR(&rrc->carrier, configuration);
rrc->carrier.sizeof_SIB23 = do_SIB23_NR(&rrc->carrier);
LOG_I(NR_RRC,"do_SIB23_NR, size %d \n ", rrc->carrier.sizeof_SIB23);
AssertFatal(rrc->carrier.sizeof_SIB23 != 255,"FATAL, RC.nrrrc[mod].carrier[CC_id].sizeof_SIB23 == 255");
}
LOG_I(NR_RRC,"Done init_NR_SI\n");
if (NODE_IS_MONOLITHIC(rrc->node_type) || NODE_IS_DU(rrc->node_type)){
// update SI info
/* 1. move this to MAC */
nr_mac_config_scc(RC.nrmac[rrc->module_id],
rrc->configuration.pdsch_AntennaPorts,
rrc->configuration.pusch_AntennaPorts,
rrc->configuration.sib1_tda,
rrc->configuration.minRXTXTIME);
}
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);
@@ -351,7 +339,7 @@ void openair_rrc_gNB_configuration(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *c
RB_INIT(&rrc->rrc_ue_head);
rrc->configuration = *configuration;
/// System Information INIT
init_NR_SI(rrc, configuration);
init_NR_SI(rrc);
return;
} // END openair_rrc_gNB_configuration
@@ -587,7 +575,6 @@ static void rrc_gNB_generate_defaultRRCReconfiguration(const protocol_ctxt_t *co
measconfig,
dedicatedNAS_MessageList,
ue_context_pP,
&rrc->configuration,
NULL,
ue_p->masterCellGroup);
AssertFatal(size > 0, "cannot encode RRCReconfiguration in %s()\n", __func__);
@@ -709,7 +696,6 @@ void rrc_gNB_generate_dedicatedRRCReconfiguration(const protocol_ctxt_t *const c
NULL,
dedicatedNAS_MessageList,
ue_context_pP,
&rrc->configuration,
NULL,
cellGroupConfig);
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Reconfiguration\n");
@@ -856,7 +842,6 @@ rrc_gNB_modify_dedicatedRRCReconfiguration(
dedicatedNAS_MessageList,
NULL,
NULL,
NULL,
NULL);
LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n");
@@ -942,7 +927,6 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
dedicatedNAS_MessageList,
NULL,
NULL,
NULL,
NULL);
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n");
@@ -1196,7 +1180,6 @@ static void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *co
NULL,
ue_context_pP,
NULL,
NULL,
cellGroupConfig);
freeSRBlist(SRBs);
freeDRBlist(DRBs);
@@ -1257,7 +1240,6 @@ int nr_rrc_reconfiguration_req(rrc_gNB_ue_context_t *const ue_context_pP
NULL,
ue_context_pP,
NULL,
NULL,
masterCellGroup);
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
+2 -2
View File
@@ -120,7 +120,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
{
AssertFatal(!get_softmodem_params()->sa, "%s() cannot be called in SA mode, it is intrinsically for NSA\n", __func__);
// generate nr-Config-r15 containers for LTE RRC : inside message for X2 EN-DC (CG-Config Message from 38.331)
const gNB_RrcConfigurationReq *configuration = &rrc->configuration;
const nr_mac_config_t *configuration = &RC.nrmac[0]->radio_config;
MessageDef *msg;
msg = itti_alloc_new_message(TASK_RRC_ENB, 0, X2AP_ENDC_SGNB_ADDITION_REQ_ACK);
gtpv1u_enb_create_tunnel_req_t create_tunnel_req;
@@ -257,7 +257,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
AssertFatal(UE->secondaryCellGroup != NULL, "out of memory\n");
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, UE->secondaryCellGroup);
fill_default_reconfig(sccc, scc, reconfig_ies, UE->secondaryCellGroup, UE->UE_Capability_nr, configuration, ue_context_p->ue_context.rrc_ue_id);
fill_default_reconfig(sccc, scc, reconfig_ies, UE->secondaryCellGroup, UE->UE_Capability_nr, ue_context_p->ue_context.rrc_ue_id);
UE->rnti = UE->secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity;
NR_CG_Config_t *CG_Config = calloc(1,sizeof(*CG_Config));
memset((void *)CG_Config,0,sizeof(*CG_Config));
-1
View File
@@ -54,7 +54,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
NR_RRCReconfiguration_IEs_t *reconfig,
NR_CellGroupConfig_t *secondaryCellGroup,
NR_UE_NR_Capability_t *uecap,
const gNB_RrcConfigurationReq *configuration,
int uid) {
AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n");
AssertFatal(reconfig!=NULL,"reconfig is null\n");