diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index f97b2061c6..50acd69994 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1160,17 +1160,17 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { (NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l] == 3),"BAD MNC DIGIT LENGTH %d", NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l]); } - printf("SSB SCO %d\n",*GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr); + LOG_I(RRC,"SSB SCO %d\n",*GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).ssb_SubcarrierOffset = *GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr; - printf("pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr); + LOG_I(RRC,"pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr); 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); + LOG_I(RRC,"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; - printf("minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); + LOG_I(RRC,"minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIME = *GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr; - printf("SIB1 TDA %d\n",*GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr); + LOG_I(RRC,"SIB1 TDA %d\n",*GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; - printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); + LOG_I(RRC,"Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; NRRRC_CONFIGURATION_REQ (msg_p).scd = scd; diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 0c397187b5..e9fdcf1647 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -445,13 +445,12 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, RC.nrmac[Mod_idP]->UL_tti_req_ahead[0] = calloc(n, sizeof(nfapi_nr_ul_tti_request_t)); AssertFatal(RC.nrmac[Mod_idP]->UL_tti_req_ahead[0], "could not allocate memory for RC.nrmac[]->UL_tti_req_ahead[]\n"); - /* fill in slot/frame numbers: slot is fixed, frame will be updated by - * scheduler */ - uint16_t sf_ahead = (uint16_t) ceil((float)6/(0x01<<(*scc->ssbSubcarrierSpacing))); - uint16_t sl_ahead = sf_ahead * (0x01<<(*scc->ssbSubcarrierSpacing)); + /* fill in slot/frame numbers: slot is fixed, frame will be updated by scheduler + extern sf_ahead is initialized in ru_thread but that function is not executed yet here*/ + const uint16_t sf_ahead = (uint16_t) ceil((float)6/(0x01<<(*scc->ssbSubcarrierSpacing))); + const uint16_t sl_ahead = sf_ahead * (0x01<<(*scc->ssbSubcarrierSpacing)); /* consider that scheduler runs sl_ahead: the first sl_ahead slots are - * already "in the past" and thus we put frame 1 instead of 0! Note that - * extern variable sl_ahead is not initialized yet, so computing it above */ + * already "in the past" and thus we put frame 1 instead of 0!*/ for (int i = 0; i < n; ++i) { nfapi_nr_ul_tti_request_t *req = &RC.nrmac[Mod_idP]->UL_tti_req_ahead[0][i]; req->SFN = i < (sl_ahead-1); @@ -501,10 +500,9 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, nr_ulstart_slot = tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0); nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); } - else{ - if(RC.nrmac[Mod_idP]->common_channels[0].frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); - } + else + // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration + AssertFatal(RC.nrmac[Mod_idP]->common_channels[0].frame_type == FDD,"Dynamic TDD not handled yet\n"); for (int slot = 0; slot < n; ++slot) { /* FIXME: it seems there is a problem with slot 0/10/slots right after UL: diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 75b018c901..39fd4671cb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -487,10 +487,9 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, // go to previous slot if the current scheduled slot is beyond the response window // and if the slot is not among the PDCCH monitored ones (38.213 10.1) - while ((*msg2_frame>frame_limit) || - ((*msg2_frame==frame_limit) && - (*msg2_slot>slot_limit)) || - ((*msg2_frame*nr_slots_per_frame[mu]+*msg2_slot-monitoring_offset)%monitoring_slot_period !=0)) { + while (*msg2_frame > frame_limit + || (*msg2_frame == frame_limit && *msg2_slot > slot_limit) + || ((*msg2_frame * nr_slots_per_frame[mu] + *msg2_slot - monitoring_offset) % monitoring_slot_period != 0)) { if(!tdd || ((*msg2_slot%tdd_period_slot) > 0)) { if (*msg2_slot==0) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 7a495865d3..f11c1bf899 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -75,10 +75,9 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); } - else{ - if(frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); - } + else + // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration + AssertFatal(nrmac->common_channels->frame_type == FDD,"Dynamic TDD not handled yet\n"); int target_ss; if (bwp) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 231f505564..8066e79e2f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1200,10 +1200,9 @@ int nr_acknack_scheduling(int mod_id, first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period); first_ul_slot_period = tdd->nrofDownlinkSlots; } - else{ - if(RC.nrmac[mod_id]->common_channels[CC_id].frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); - } + else + // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration + AssertFatal(RC.nrmac[mod_id]->common_channels[CC_id].frame_type == FDD,"Dynamic TDD not handled yet\n"); NR_sched_pucch_t *csi_pucch; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 61fa42bbd9..3c600e69c9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -74,10 +74,9 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); } - else{ - if(frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); - } + else + // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration + AssertFatal(nrmac->common_channels->frame_type == FDD,"Dynamic TDD not handled yet\n"); const struct NR_PUCCH_Config__resourceToAddModList *resList = ubwp->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList; // for the moment, just block any symbol that might hold a PUCCH, regardless