Move SIB1 to MAC

The SystemInformationBlock 1 is handled at the DU and sent to the CU in
the F1 Setup Request. Hence, move it down to the MAC.
This commit is contained in:
Robert Schmidt
2023-09-22 08:22:15 +02:00
parent 5d0ae84ad2
commit a44a54f3d3
10 changed files with 44 additions and 117 deletions
-30
View File
@@ -60,36 +60,6 @@ void nr_rrc_mac_update_cellgroup(rnti_t rntiMaybeUEid, NR_CellGroupConfig_t *cgc
NR_SCHED_UNLOCK(&nrmac->sched_lock);
}
uint16_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
const int CC_id,
const frame_t frameP,
const rb_id_t Srb_id,
const rnti_t rnti,
const uint8_t Nb_tb,
uint8_t *const buffer_pP)
{
LOG_D(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%ld\n",Mod_idP,Srb_id);
// MIBCH
if ((Srb_id & RAB_OFFSET) == MIBCH) {
DevAssert(false);
}
if ((Srb_id & RAB_OFFSET) == BCCH) {
memcpy(&buffer_pP[0], RC.nrrrc[Mod_idP]->carrier.SIB1, RC.nrrrc[Mod_idP]->carrier.sizeof_SIB1);
return RC.nrrrc[Mod_idP]->carrier.sizeof_SIB1;
}
// CCCH
if ((Srb_id & RAB_OFFSET) == CCCH) {
AssertFatal(0, "CCCH is managed by rlc of srb 0, not anymore by mac_rrc_nr_data_req\n");
}
return 0;
}
int8_t nr_mac_rrc_bwp_switch_req(const module_id_t module_idP,
const frame_t frameP,
const sub_frame_t sub_frameP,
+1 -6
View File
@@ -325,18 +325,12 @@ typedef struct rrc_gNB_ue_context_s {
typedef struct {
uint8_t *SIB1;
uint16_t sizeof_SIB1;
uint8_t *SIB23;
uint8_t sizeof_SIB23;
NR_SIB1_t *siblock1_DU;
NR_SIB1_t *sib1;
NR_SIB2_t *sib2;
NR_SIB3_t *sib3;
NR_BCCH_DL_SCH_Message_t systemInformation; // SIB23
NR_BCCH_DL_SCH_Message_t *siblock1;
NR_CellGroupConfig_t *secondaryCellGroup[MAX_NR_RRC_UE_CONTEXTS];
} rrc_gNB_carrier_data_t;
@@ -376,6 +370,7 @@ typedef struct cucp_cuup_if_s {
typedef struct nr_rrc_du_container_t {
f1ap_setup_req_t *setup_req;
NR_MIB_t *mib;
NR_SIB1_t *sib1;
} nr_rrc_du_container_t;
//---NR---(completely change)---------------------
-8
View File
@@ -46,14 +46,6 @@
#define NR_MAX_SUPPORTED_DL_LAYERS 2
uint16_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
const int CC_id,
const frame_t frameP,
const rb_id_t Srb_id,
const rnti_t rnti,
const uint8_t Nb_tb,
uint8_t *const buffer_pP);
void rrc_gNB_process_SgNBAdditionRequest(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *ue_context_pP
+17 -24
View File
@@ -235,18 +235,6 @@ static int get_dl_arfcn(const f1ap_served_cell_info_t *cell_info)
static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration)
{
const NR_ServingCellConfigCommon_t *scc = RC.nrmac[0]->common_channels[0].ServingCellConfigCommon;
if((get_softmodem_params()->sa) && ( (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)))) {
NR_BCCH_DL_SCH_Message_t *sib1 = get_SIB1_NR(configuration, scc);
//xer_fprint(stdout, &asn_DEF_NR_BCCH_DL_SCH_Message, sib1);
rrc->carrier.SIB1 = calloc(NR_MAX_SIB_LENGTH / 8, sizeof(*rrc->carrier.SIB1));
AssertFatal(rrc->carrier.SIB1 != NULL, "out of memory\n");
rrc->carrier.sizeof_SIB1 = encode_SIB1_NR(sib1, rrc->carrier.SIB1, NR_MAX_SIB_LENGTH / 8);
rrc->carrier.siblock1 = sib1;
nr_mac_config_sib1(RC.nrmac[rrc->module_id], sib1);
}
if (!NODE_IS_DU(rrc->node_type)) {
rrc->carrier.SIB23 = (uint8_t *) malloc16(100);
AssertFatal(rrc->carrier.SIB23 != NULL, "cannot allocate memory for SIB");
@@ -1937,6 +1925,19 @@ static void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req)
return;
}
NR_SIB1_t *sib1 = NULL;
if (sys_info->sib1) {
dec_rval = uper_decode_complete(NULL, &asn_DEF_NR_SIB1, (void **)&sib1, sys_info->sib1, sys_info->sib1_length);
if (dec_rval.code != RC_OK) {
LOG_E(RRC, "Failed to decode NR_SIB1 (%zu bits) of DU, rejecting DU\n", dec_rval.consumed);
rrc->mac_rrc.f1_setup_failure(&fail);
ASN_STRUCT_FREE(asn_DEF_NR_SIB1, sib1);
return;
}
if (LOG_DEBUGFLAG(DEBUG_ASN1))
xer_fprint(stdout, &asn_DEF_NR_SIB1, sib1);
}
LOG_I(RRC, "Accepting DU %ld (%s), sending F1 Setup Response\n", req->gNB_DU_id, req->gNB_DU_name);
// we accept the DU
@@ -1952,17 +1953,7 @@ static void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req)
rrc->du->mib = mib->message.choice.mib;
mib->message.choice.mib = NULL;
ASN_STRUCT_FREE(asn_DEF_NR_BCCH_BCH_MessageType, mib);
if (rrc->carrier.sib1 != NULL) {
LOG_E(NR_RRC, "CU SIB1 is already initiaized: double F1 setup request?\n");
} else {
asn_dec_rval_t dec_rval =
uper_decode_complete(NULL, &asn_DEF_NR_SIB1, (void **)&rrc->carrier.sib1, sys_info->sib1, sys_info->sib1_length);
AssertFatal(dec_rval.code == RC_OK, "Failed to decode NR_BCCH_DLSCH_MESSAGE (%zu bits)\n", dec_rval.consumed);
if (LOG_DEBUGFLAG(DEBUG_ASN1))
xer_fprint(stdout, &asn_DEF_NR_SIB1, (void *)rrc->carrier.sib1);
}
rrc->du->sib1 = sib1;
served_cells_to_activate_t cell = {
.plmn = cell_info->plmn,
@@ -2894,7 +2885,9 @@ int rrc_gNB_generate_pcch_msg(uint32_t tmsi, uint8_t paging_drx, instance_t inst
uint32_t T; /* DRX cycle */
uint32_t length;
uint8_t buffer[RRC_BUF_SIZE];
struct NR_SIB1 *sib1 = RC.nrrrc[instance]->carrier.siblock1->message.choice.c1->choice.systemInformationBlockType1;
const nr_rrc_du_container_t *du = RC.nrrrc[0]->du;
DevAssert(du != NULL);
struct NR_SIB1 *sib1 = du->sib1;
/* get default DRX cycle from configuration */
Tc = sib1->servingCellConfigCommon->downlinkConfigCommon.pcch_Config.defaultPagingCycle;