Commit 88e6d9df authored by Robert Schmidt's avatar Robert Schmidt

Refactor SIB1 handling

parent 7cb50288
......@@ -38,7 +38,7 @@
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "RRC/NR/nr_rrc_extern.h"
#include "RRC/NR/nr_rrc_config.h"
#include "common/utils/nr/nr_common.h"
......
......@@ -86,7 +86,6 @@ uint16_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
return encode_size;
}
// TODO BCCH SIB1 SIBs
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;
......
This diff is collapsed.
......@@ -55,13 +55,6 @@
*/
int xer_sprint_NR(char *string, size_t string_size, struct asn_TYPE_descriptor_s *td, void *sptr);
/**
\brief Generate configuration for SIB1 (gNB).
@param carrier pointer to Carrier information
@param configuration Pointer Configuration Request structure
@return size of encoded bit stream in bytes*/
uint16_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, gNB_RrcConfigurationReq *configuration);
uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier,
gNB_RrcConfigurationReq *configuration);
......
This diff is collapsed.
......@@ -109,4 +109,10 @@ NR_BCCH_BCH_Message_t *get_new_MIB_NR(const NR_ServingCellConfigCommon_t *scc);
void free_MIB_NR(NR_BCCH_BCH_Message_t *mib);
int encode_MIB_NR(NR_BCCH_BCH_Message_t *mib, int frame, uint8_t *buf, int buf_size);
#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);
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);
#endif
......@@ -35,8 +35,6 @@
#include "LAYER2/RLC/rlc.h"
#include "openair2/RRC/common.h"
#define NR_MAX_SIB_LENGTH 2976 // 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.
extern UE_RRC_INST *UE_rrc_inst;
extern uint8_t DRB2LCHAN[8];
......
......@@ -181,7 +181,12 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration
rrc->carrier.mib = get_new_MIB_NR(rrc->carrier.servingcellconfigcommon);
if((get_softmodem_params()->sa) && ( (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)))) {
rrc->carrier.sizeof_SIB1 = do_SIB1_NR(&rrc->carrier,configuration);
NR_BCCH_DL_SCH_Message_t *sib1 = get_SIB1_NR(configuration);
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)) {
......@@ -203,8 +208,6 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration
rrc->configuration.minRXTXTIME,
rrc->carrier.servingcellconfigcommon);
nr_mac_config_mib(RC.nrmac[rrc->module_id], rrc->carrier.mib);
if (get_softmodem_params()->sa)
nr_mac_config_sib1(RC.nrmac[rrc->module_id], rrc->carrier.siblock1);
}
/* set flag to indicate that cell information is configured. This is required
......
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