Move MIB to MAC
The MasterInformationBlock is handled at the DU and sent to the CU in the F1 Setup Response. Hence, move it down to the MAC. Furthermore: - Change type because MIB_PDU_t is 4G type - Simplify schedule_nr_mib()
This commit is contained in:
@@ -74,13 +74,7 @@ uint16_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
// MIBCH
|
||||
if ((Srb_id & RAB_OFFSET) == MIBCH) {
|
||||
|
||||
int encode_size = 3;
|
||||
rrc_gNB_carrier_data_t *carrier = &RC.nrrrc[Mod_idP]->carrier;
|
||||
int encoded = encode_MIB_NR(carrier->mib, frameP, buffer_pP, encode_size);
|
||||
DevAssert(encoded == encode_size);
|
||||
LOG_D(NR_RRC, "MIB PDU buffer_pP[0]=%x , buffer_pP[1]=%x, buffer_pP[2]=%x\n", buffer_pP[0], buffer_pP[1],
|
||||
buffer_pP[2]);
|
||||
return encode_size;
|
||||
DevAssert(false);
|
||||
}
|
||||
|
||||
if ((Srb_id & RAB_OFFSET) == BCCH) {
|
||||
|
||||
@@ -331,7 +331,6 @@ typedef struct {
|
||||
uint8_t *SIB23;
|
||||
uint8_t sizeof_SIB23;
|
||||
|
||||
NR_BCCH_BCH_Message_t *mib;
|
||||
NR_SIB1_t *siblock1_DU;
|
||||
NR_SIB1_t *sib1;
|
||||
NR_SIB2_t *sib2;
|
||||
@@ -376,6 +375,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_rrc_du_container_t;
|
||||
|
||||
//---NR---(completely change)---------------------
|
||||
|
||||
+15
-14
@@ -237,11 +237,6 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration
|
||||
{
|
||||
const NR_ServingCellConfigCommon_t *scc = RC.nrmac[0]->common_channels[0].ServingCellConfigCommon;
|
||||
|
||||
LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__);
|
||||
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
|
||||
rrc->carrier.mib = get_new_MIB_NR(scc);
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -270,7 +265,6 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration
|
||||
rrc->configuration.pusch_AntennaPorts,
|
||||
rrc->configuration.sib1_tda,
|
||||
rrc->configuration.minRXTXTIME);
|
||||
nr_mac_config_mib(RC.nrmac[rrc->module_id], rrc->carrier.mib);
|
||||
}
|
||||
|
||||
if (get_softmodem_params()->phy_test > 0 || get_softmodem_params()->do_ra > 0) {
|
||||
@@ -1931,6 +1925,18 @@ static void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req)
|
||||
return;
|
||||
}
|
||||
|
||||
/* do we need the MIB? for the moment, just check it is valid, then drop it */
|
||||
NR_BCCH_BCH_Message_t *mib = NULL;
|
||||
asn_dec_rval_t dec_rval =
|
||||
uper_decode_complete(NULL, &asn_DEF_NR_BCCH_BCH_Message, (void **)&mib, sys_info->mib, sys_info->mib_length);
|
||||
if (dec_rval.code != RC_OK || mib->message.present != NR_BCCH_BCH_MessageType_PR_mib
|
||||
|| mib->message.choice.messageClassExtension == NULL) {
|
||||
LOG_E(RRC, "Failed to decode NR_BCCH_BCH_MESSAGE (%zu bits) of DU, rejecting DU\n", dec_rval.consumed);
|
||||
rrc->mac_rrc.f1_setup_failure(&fail);
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_BCCH_BCH_Message, mib);
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_I(RRC, "Accepting DU %ld (%s), sending F1 Setup Response\n", req->gNB_DU_id, req->gNB_DU_name);
|
||||
|
||||
// we accept the DU
|
||||
@@ -1943,14 +1949,9 @@ static void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req)
|
||||
rrc->du->setup_req = malloc(sizeof(*rrc->du->setup_req));
|
||||
AssertFatal(rrc->du->setup_req != NULL, "out of memory\n");
|
||||
*rrc->du->setup_req = *req;
|
||||
|
||||
if (rrc->carrier.mib != NULL) {
|
||||
LOG_E(NR_RRC, "CU MIB is already initialized: double F1 setup request?\n");
|
||||
} else {
|
||||
asn_dec_rval_t dec_rval =
|
||||
uper_decode_complete(NULL, &asn_DEF_NR_BCCH_BCH_Message, (void **)&rrc->carrier.mib, sys_info->mib, sys_info->mib_length);
|
||||
AssertFatal(dec_rval.code == RC_OK, "Failed to decode NR_BCCH_BCH_MESSAGE (%zu bits)\n", dec_rval.consumed);
|
||||
}
|
||||
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");
|
||||
|
||||
Reference in New Issue
Block a user