diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 40ad816d2c..454a23770e 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -198,16 +198,12 @@ void nr_dlsim_preprocessor(gNB_MAC_INST *nr_mac, post_process_pdsch_t *pp_pdsch) NR_UE_DL_BWP_t *current_BWP = &UE_info->current_DL_BWP; NR_ServingCellConfigCommon_t *scc = nr_mac->common_channels[0].ServingCellConfigCommon; - uint8_t nr_of_candidates = 0; + int nr_of_candidates = 0; if (g_mcsIndex < 4) { - find_aggregation_candidates(&sched_ctrl->aggregation_level, - &nr_of_candidates, - sched_ctrl->search_space,8); + find_aggregation_candidates(&sched_ctrl->aggregation_level, &nr_of_candidates, sched_ctrl->search_space, 8); } if (nr_of_candidates == 0) { - find_aggregation_candidates(&sched_ctrl->aggregation_level, - &nr_of_candidates, - sched_ctrl->search_space,4); + find_aggregation_candidates(&sched_ctrl->aggregation_level, &nr_of_candidates, sched_ctrl->search_space, 4); } uint32_t Y = get_Y(sched_ctrl->search_space, pp_pdsch->slot, UE_info->rnti); int CCEIndex = find_pdcch_candidate(nr_mac, diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 5f38693218..f111f571ba 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -1463,14 +1463,11 @@ int get_format0(uint8_t index, uint8_t unpaired, frequency_range_t frequency_ran return format; } -void find_aggregation_candidates(uint8_t *aggregation_level, - uint8_t *nr_of_candidates, - const NR_SearchSpace_t *ss, - int L) +void find_aggregation_candidates(int *aggregation_level, int *nr_of_candidates, const NR_SearchSpace_t *ss, int L) { - AssertFatal(L>=1 && L<=16,"L %d not ok\n", L); + AssertFatal(L >= 1 && L <= 16,"L %d not ok\n", L); *nr_of_candidates = 0; - switch(L) { + switch (L) { case 1: if (ss->nrofCandidates->aggregationLevel1 != NR_SearchSpace__nrofCandidates__aggregationLevel1_n0) { *aggregation_level = 1; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index 728ea74238..51bd9aa948 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -171,10 +171,7 @@ uint16_t get_rb_bwp_dci(nr_dci_format_t format, uint16_t initial_ul_bwp_size, uint16_t initial_dl_bwp_size); -void find_aggregation_candidates(uint8_t *aggregation_level, - uint8_t *nr_of_candidates, - const NR_SearchSpace_t *ss, - int maxL); +void find_aggregation_candidates(int *aggregation_level, int *nr_of_candidates, const NR_SearchSpace_t *ss, int L); bool get_nr_prach_sched_from_info(nr_prach_info_t info, int config_index, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c index dc82e5d308..0e8651a84d 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -44,11 +44,8 @@ static void fill_dci_search_candidates(const NR_SearchSpace_t *ss, fapi_nr_dl_co int i = 0; for (int maxL = 16; maxL > 0; maxL >>= 1) { - uint8_t aggregation, max_number_of_candidates; - find_aggregation_candidates(&aggregation, - &max_number_of_candidates, - ss, - maxL); + int aggregation, max_number_of_candidates; + find_aggregation_candidates(&aggregation, &max_number_of_candidates, ss, maxL); if (max_number_of_candidates == 0) continue; LOG_T(NR_MAC_DCI, "L %d, max number of candidates %d, aggregation %d\n", maxL, max_number_of_candidates, aggregation); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 5f80703c21..a5d35e68be 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -918,7 +918,7 @@ static void nr_generate_Msg3_retransmission(module_id_t module_idP, nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } - uint8_t aggregation_level; + int aggregation_level; int CCEIndex = get_cce_index(nr_mac, CC_id, slot, 0, &aggregation_level, @@ -1517,7 +1517,7 @@ static void nr_generate_Msg2(module_id_t module_idP, return; } - uint8_t aggregation_level; + int aggregation_level; int CCEIndex = get_cce_index(nr_mac, CC_id, slotP, 0, &aggregation_level, beam.idx, ss, coreset, &sched_ctrl->sched_pdcch, 0); if (CCEIndex < 0) { @@ -1716,7 +1716,7 @@ static void nr_generate_Msg4_MsgB(module_id_t module_idP, return; // get CCEindex, needed also for PUCCH and then later for PDCCH - uint8_t aggregation_level; + int aggregation_level; int CCEIndex = get_cce_index(nr_mac, CC_id, slotP, 0, &aggregation_level, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index d4f1d48601..01f349877a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -562,8 +562,7 @@ void schedule_nr_sib1(module_id_t module_idP, NULL, type0_PDCCH_CSS_config); - - uint8_t nr_of_candidates, aggregation_level; + int nr_of_candidates, aggregation_level; for (int c = 0; c < 3; c++) { find_aggregation_candidates(&aggregation_level, &nr_of_candidates, @@ -690,8 +689,8 @@ static void other_sib_sched_control(module_id_t module_idP, NR_pdsch_dmrs_t dmrs_parms = get_dl_dmrs_params(scc, NULL, &tda_info, 1); - uint8_t aggregation_level = 0; - uint8_t nr_of_candidates = 0; + int aggregation_level = 0; + int nr_of_candidates = 0; for (int i = 0; i < 5; i++) { find_aggregation_candidates(&aggregation_level, &nr_of_candidates, ss, 16 >> i); if (nr_of_candidates > 0) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 4a7213ab34..86fe6f06eb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -592,7 +592,7 @@ int get_cce_index(const gNB_MAC_INST *nrmac, const int CC_id, const int slot, const rnti_t rnti, - uint8_t *aggregation_level, + int *aggregation_level, int beam_idx, const NR_SearchSpace_t *ss, const NR_ControlResourceSet_t *coreset, @@ -600,11 +600,9 @@ int get_cce_index(const gNB_MAC_INST *nrmac, float pdcch_cl_adjust) { const uint32_t Y = get_Y(ss, slot, rnti); - uint8_t nr_of_candidates; - int agg_level_search_order[NUM_PDCCH_AGG_LEVELS]; determine_aggregation_level_search_order(agg_level_search_order, pdcch_cl_adjust); - + int nr_of_candidates; for (int i = 0; i < NUM_PDCCH_AGG_LEVELS; i++) { find_aggregation_candidates(aggregation_level, &nr_of_candidates, ss, 1 << agg_level_search_order[i]); if (nr_of_candidates > 0) diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index a8d4c76b31..279f8d01b9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -420,7 +420,7 @@ int get_cce_index(const gNB_MAC_INST *nrmac, const int CC_id, const int slot, const rnti_t rnti, - uint8_t *aggregation_level, + int *aggregation_level, int beam_idx, const NR_SearchSpace_t *ss, const NR_ControlResourceSet_t *coreset, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 5914c74a45..2971d76607 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -620,7 +620,7 @@ typedef struct { /// CCE index and Aggr. Level are shared for PUSCH/PDSCH allocation decisions /// corresponding to the sched_pusch/sched_pdsch structures below int cce_index; - uint8_t aggregation_level; + int aggregation_level; uint32_t dl_cce_fail, ul_cce_fail; /// Array of PUCCH scheduling information