Commit 47d604b4 authored by luis_pereira87's avatar luis_pereira87

Improve SIB1 length to support maximum value specified in 3GPP TS 38.331 section 5.2.1

The physical layer imposes a limit to the maximum size a SIB can take. The maximum SIB1 or SI message size is 2976 bits.
parent 7f38019f
...@@ -285,7 +285,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, ...@@ -285,7 +285,7 @@ uint32_t schedule_control_sib1(module_id_t module_id,
int nrOfSymbols, int nrOfSymbols,
uint16_t dlDmrsSymbPos, uint16_t dlDmrsSymbPos,
uint8_t candidate_idx, uint8_t candidate_idx,
int num_total_bytes) { uint16_t num_total_bytes) {
gNB_MAC_INST *gNB_mac = RC.nrmac[module_id]; gNB_MAC_INST *gNB_mac = RC.nrmac[module_id];
NR_COMMON_channels_t *cc = &gNB_mac->common_channels[CC_id]; NR_COMMON_channels_t *cc = &gNB_mac->common_channels[CC_id];
...@@ -570,7 +570,7 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) ...@@ -570,7 +570,7 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
// Get SIB1 // Get SIB1
uint8_t sib1_payload[NR_MAX_SIB_LENGTH/8]; uint8_t sib1_payload[NR_MAX_SIB_LENGTH/8];
uint8_t sib1_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, BCCH, SI_RNTI, 1, sib1_payload); uint16_t sib1_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, BCCH, SI_RNTI, 1, sib1_payload);
LOG_D(NR_MAC,"sib1_sdu_length = %i\n", sib1_sdu_length); LOG_D(NR_MAC,"sib1_sdu_length = %i\n", sib1_sdu_length);
LOG_D(NR_MAC,"SIB1: \n"); LOG_D(NR_MAC,"SIB1: \n");
for (int k=0;k<sib1_sdu_length;k++) for (int k=0;k<sib1_sdu_length;k++)
...@@ -598,7 +598,8 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) ...@@ -598,7 +598,8 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
startSymbolIndex, startSymbolIndex,
nrOfSymbols, nrOfSymbols,
dlDmrsSymbPos, dlDmrsSymbPos,
candidate_idx, sib1_sdu_length); candidate_idx,
sib1_sdu_length);
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body; nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body;
int pdu_index = gNB_mac->pdu_index[0]++; int pdu_index = gNB_mac->pdu_index[0]++;
......
...@@ -93,7 +93,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, ...@@ -93,7 +93,7 @@ uint32_t schedule_control_sib1(module_id_t module_id,
int nrOfSymbols, int nrOfSymbols,
uint16_t dlDmrsSymbPos, uint16_t dlDmrsSymbPos,
uint8_t candidate_idx, uint8_t candidate_idx,
int num_total_bytes); uint16_t num_total_bytes);
/* \brief default FR1 DL preprocessor init routine, returns preprocessor to call */ /* \brief default FR1 DL preprocessor init routine, returns preprocessor to call */
nr_pp_impl_dl nr_init_fr1_dlsch_preprocessor(module_id_t module_id, int CC_id); nr_pp_impl_dl nr_init_fr1_dlsch_preprocessor(module_id_t module_id, int CC_id);
......
...@@ -306,9 +306,8 @@ uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) { ...@@ -306,9 +306,8 @@ uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) {
return((enc_rval.encoded+7)/8); return((enc_rval.encoded+7)/8);
} }
uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, uint16_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, gNB_RrcConfigurationReq *configuration) {
gNB_RrcConfigurationReq *configuration
) {
asn_enc_rval_t enc_rval; asn_enc_rval_t enc_rval;
NR_BCCH_DL_SCH_Message_t *sib1_message = CALLOC(1,sizeof(NR_BCCH_DL_SCH_Message_t)); NR_BCCH_DL_SCH_Message_t *sib1_message = CALLOC(1,sizeof(NR_BCCH_DL_SCH_Message_t));
...@@ -661,12 +660,9 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, ...@@ -661,12 +660,9 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
(void *)sib1_message, (void *)sib1_message,
carrier->SIB1, carrier->SIB1,
NR_MAX_SIB_LENGTH/8); NR_MAX_SIB_LENGTH/8);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", AssertFatal(enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded); enc_rval.failed_type->name, enc_rval.encoded);
AssertFatal(enc_rval.encoded <= NR_MAX_SIB_LENGTH, "ASN1 encoded length %zd bits. 3GPP TS 38.331 section 5.2.1 - The physical layer imposes a limit to the maximum size a SIB can take. The maximum SIB1 or SI message size is 2976 bits.\n", enc_rval.encoded);
if (enc_rval.encoded==-1) {
return(-1);
}
return((enc_rval.encoded+7)/8); return((enc_rval.encoded+7)/8);
} }
......
...@@ -73,9 +73,7 @@ uint8_t do_MIB_NR(gNB_RRC_INST *rrc, ...@@ -73,9 +73,7 @@ uint8_t do_MIB_NR(gNB_RRC_INST *rrc,
@param carrier pointer to Carrier information @param carrier pointer to Carrier information
@param configuration Pointer Configuration Request structure @param configuration Pointer Configuration Request structure
@return size of encoded bit stream in bytes*/ @return size of encoded bit stream in bytes*/
uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, uint16_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, gNB_RrcConfigurationReq *configuration);
gNB_RrcConfigurationReq *configuration
);
uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier, uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier,
gNB_RrcConfigurationReq *configuration); gNB_RrcConfigurationReq *configuration);
......
...@@ -435,7 +435,7 @@ typedef struct { ...@@ -435,7 +435,7 @@ typedef struct {
uint8_t sizeof_MIB; uint8_t sizeof_MIB;
uint8_t *SIB1; uint8_t *SIB1;
uint8_t sizeof_SIB1; uint16_t sizeof_SIB1;
uint8_t *SIB23; uint8_t *SIB23;
uint8_t sizeof_SIB23; uint8_t sizeof_SIB23;
......
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