Commit d6c70f85 authored by francescomani's avatar francescomani

sib1 tda from config file

parent 4a00aa25
......@@ -408,6 +408,7 @@ typedef struct NRRrcConfigurationReq_s {
NR_ServingCellConfigCommon_t *scc;
NR_ServingCellConfig_t *scd;
int ssb_SubcarrierOffset;
int sib1_tda;
int pdsch_AntennaPorts;
int pusch_AntennaPorts;
int pusch_TargetSNRx10;
......
......@@ -1296,6 +1296,7 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
rrc->carrier.ssb_SubcarrierOffset,
rrc->carrier.pdsch_AntennaPorts,
rrc->carrier.pusch_AntennaPorts,
rrc->carrier.sib1_tda,
NULL,
0,
ue_context_p->ue_context.rnti,
......
......@@ -1009,6 +1009,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr;
printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr);
NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr;
NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr;
NRRRC_CONFIGURATION_REQ (msg_p).scc = scc;
NRRRC_CONFIGURATION_REQ (msg_p).scd = scd;
......@@ -1881,6 +1882,7 @@ void configure_gnb_du_mac(int inst) {
rrc->configuration.ssb_SubcarrierOffset,
rrc->configuration.pdsch_AntennaPorts,
rrc->configuration.pusch_AntennaPorts,
rrc->configuration.sib1_tda,
rrc->configuration.scc,
0,
0, // rnti
......
......@@ -116,6 +116,7 @@ typedef enum {
#define GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET "ssb_SubcarrierOffset"
#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS "pdsch_AntennaPorts"
#define GNB_CONFIG_STRING_PUSCHANTENNAPORTS "pusch_AntennaPorts"
#define GNB_CONFIG_STRING_SIB1TDA "sib1_tda"
#define GNB_CONFIG_STRING_NRCELLID "nr_cellid"
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
......@@ -140,6 +141,7 @@ typedef enum {
{GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET, NULL, 0, iptr:NULL, defintval:31, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_PDSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_PUSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_NRCELLID , NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \
}
......@@ -160,7 +162,8 @@ typedef enum {
#define GNB_SSB_SUBCARRIEROFFSET_IDX 14
#define GNB_PDSCH_ANTENNAPORTS_IDX 15
#define GNB_PUSCH_ANTENNAPORTS_IDX 16
#define GNB_NRCELLID_IDX 17
#define GNB_SIB1_TDA_IDX 17
#define GNB_NRCELLID_IDX 18
#define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD}
#define GNBPARAMS_CHECK { \
......
......@@ -338,6 +338,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int ssb_SubcarrierOffset,
int pdsch_AntennaPorts,
int pusch_AntennaPorts,
int sib1_tda,
NR_ServingCellConfigCommon_t *scc,
int add_ue,
uint32_t rnti,
......@@ -408,6 +409,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
if (get_softmodem_params()->sa > 0) {
NR_COMMON_channels_t *cc = &RC.nrmac[Mod_idP]->common_channels[0];
RC.nrmac[Mod_idP]->sib1_tda = sib1_tda;
for (int n=0;n<NR_NB_RA_PROC_MAX;n++ ) {
cc->ra[n].cfra = false;
cc->ra[n].rnti = 0;
......
......@@ -392,13 +392,13 @@ uint32_t schedule_control_sib1(module_id_t module_id,
gNB_mac->sched_ctrlCommon->rbSize = rbSize;
gNB_mac->sched_ctrlCommon->rbStart = 0;
LOG_I(MAC,"mcs = %i\n", gNB_mac->sched_ctrlCommon->mcs);
LOG_I(MAC,"startSymbolIndex = %i\n", startSymbolIndex);
LOG_I(MAC,"nrOfSymbols = %i\n", nrOfSymbols);
LOG_I(MAC,"rbSize = %i\n", gNB_mac->sched_ctrlCommon->rbSize);
LOG_I(MAC,"TBS = %i\n", TBS);
LOG_I(MAC,"dmrs_length %d\n",dmrs_length);
LOG_I(MAC,"N_PRB_DMRS = %d\n",N_PRB_DMRS);
LOG_D(MAC,"mcs = %i\n", gNB_mac->sched_ctrlCommon->mcs);
LOG_D(MAC,"startSymbolIndex = %i\n", startSymbolIndex);
LOG_D(MAC,"nrOfSymbols = %i\n", nrOfSymbols);
LOG_D(MAC,"rbSize = %i\n", gNB_mac->sched_ctrlCommon->rbSize);
LOG_D(MAC,"TBS = %i\n", TBS);
LOG_D(MAC,"dmrs_length %d\n",dmrs_length);
LOG_D(MAC,"N_PRB_DMRS = %d\n",N_PRB_DMRS);
// Mark the corresponding RBs as used
for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->rbSize; rb++) {
vrb_map[rb + rbStart] = 1;
......@@ -548,12 +548,13 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
// TODO: Get these values from RRC
const int CC_id = 0;
int time_domain_allocation = 0;
uint8_t candidate_idx = 0;
gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP];
NR_ServingCellConfigCommon_t *scc = gNB_mac->common_channels[CC_id].ServingCellConfigCommon;
int time_domain_allocation = gNB_mac->sib1_tda;
int L_max;
switch (scc->ssb_PositionsInBurst->present) {
case 1:
......
......@@ -51,6 +51,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int ssb_SubcarrierOffset,
int pdsch_AntennaPorts,
int pusch_AntennaPorts,
int sib1_tda,
NR_ServingCellConfigCommon_t *scc,
int nsa_flag,
uint32_t rnti,
......
......@@ -616,6 +616,8 @@ typedef struct gNB_MAC_INST_s {
int pucch_target_snrx10;
/// Subcarrier Offset
int ssb_SubcarrierOffset;
/// SIB1 Time domain allocation
int sib1_tda;
/// Common cell resources
NR_COMMON_channels_t common_channels[NFAPI_CC_MAX];
/// current PDU index (BCH,DLSCH)
......
......@@ -443,6 +443,7 @@ typedef struct {
NR_SIB3_t *sib3;
NR_BCCH_DL_SCH_Message_t systemInformation; // SIB23
int ssb_SubcarrierOffset;
int sib1_tda;
int pdsch_AntennaPorts;
int pusch_AntennaPorts;
int pusch_TargetSNRx10;
......
......@@ -239,6 +239,7 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration
rrc->carrier.ssb_SubcarrierOffset,
rrc->carrier.pdsch_AntennaPorts,
rrc->carrier.pusch_AntennaPorts,
rrc->carrier.sib1_tda,
(NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon,
0,
0, // WIP hardcoded rnti
......@@ -331,6 +332,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
rrc->carrier.ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset;
rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts;
rrc->carrier.pusch_AntennaPorts = configuration->pusch_AntennaPorts;
rrc->carrier.sib1_tda = configuration->sib1_tda;
/// System Information INIT
pthread_mutex_init(&rrc->cell_info_mutex,NULL);
rrc->cell_info_configured = 0;
......@@ -493,6 +495,7 @@ rrc_gNB_generate_RRCSetup(
rrc->carrier.ssb_SubcarrierOffset,
rrc->carrier.pdsch_AntennaPorts,
rrc->carrier.pusch_AntennaPorts,
rrc->carrier.sib1_tda,
NULL,
0,
ue_context_pP->ue_context.rnti,
......@@ -564,6 +567,7 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(
rrc_instance_p->carrier.ssb_SubcarrierOffset,
rrc_instance_p->carrier.pdsch_AntennaPorts,
rrc_instance_p->carrier.pusch_AntennaPorts,
rrc_instance_p->carrier.sib1_tda,
(NR_ServingCellConfigCommon_t *)rrc_instance_p->carrier.servingcellconfigcommon,
0,
ue_context_pP->ue_context.rnti,
......
......@@ -349,6 +349,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
rrc->carrier.ssb_SubcarrierOffset,
rrc->carrier.pdsch_AntennaPorts,
rrc->carrier.pusch_AntennaPorts,
rrc->carrier.sib1_tda,
rrc->carrier.servingcellconfigcommon,
1, // add_ue flag
ue_context_p->ue_id_rnti,
......@@ -358,6 +359,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
rrc->carrier.ssb_SubcarrierOffset,
rrc->carrier.pdsch_AntennaPorts,
rrc->carrier.pusch_AntennaPorts,
rrc->carrier.sib1_tda,
NULL,
1, // add_ue flag
ue_context_p->ue_id_rnti,
......
......@@ -34,6 +34,8 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
sib1_tda = 0;
servingCellConfigCommon = (
{
......
......@@ -26,6 +26,8 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
sib1_tda = 0;
servingCellConfigCommon = (
{
......
......@@ -38,7 +38,8 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
sib1_tda = 0;
servingCellConfigCommon = (
{
#spCellConfigCommon
......
......@@ -22,6 +22,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
sib1_tda = 0;
pdcch_ConfigSIB1 = (
{
......
......@@ -37,6 +37,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
sib1_tda = 0;
pdcch_ConfigSIB1 = (
{
......
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