diff --git a/openair2/LAYER2/NR_MAC_UE/mac_extern.h b/openair2/LAYER2/NR_MAC_UE/mac_extern.h index 1bc1ad5d10..6de87bfbed 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_extern.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_extern.h @@ -47,8 +47,6 @@ extern const uint8_t table_7_3_1_1_2_21[19][4]; extern const uint8_t table_7_3_1_1_2_22[6][5]; extern const uint8_t table_7_3_1_1_2_23[5][6]; -extern const uint16_t table_7_2_1[16]; - extern void mac_rlc_data_ind(const module_id_t module_idP, const rnti_t rntiP, const eNB_index_t eNB_index, diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index f84bcd8756..ad6771b14c 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -207,7 +207,7 @@ void set_harq_status(NR_UE_MAC_INST_t *mac, bool get_downlink_ack(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, PUCCH_sched_t *pucch); initial_pucch_resource_t get_initial_pucch_resource(const int idx); void multiplex_pucch_resource(NR_UE_MAC_INST_t *mac, PUCCH_sched_t *pucch, int num_res); - +uint32_t get_backoff_indicator(int idx); int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac, int scs, NR_PUCCH_Config_t *pucch_Config, diff --git a/openair2/LAYER2/NR_MAC_UE/mac_vars.c b/openair2/LAYER2/NR_MAC_UE/mac_vars.c index 672d2a057d..4fb98a0ed9 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_vars.c +++ b/openair2/LAYER2/NR_MAC_UE/mac_vars.c @@ -413,7 +413,7 @@ const uint8_t table_7_3_2_3_3_4_twoCodeword[6][14] = { }; // table 7.2-1 TS 38.321 -const uint16_t table_7_2_1[16] = { +const uint32_t table_7_2_1[16] = { 5, // row index 0 10, // row index 1 20, // row index 2 @@ -430,6 +430,12 @@ const uint16_t table_7_2_1[16] = { 1920, // row index 13 }; +uint32_t get_backoff_indicator(int idx) +{ + AssertFatal(idx < 16, "Backoff indicator index %d exeeding table size\n", idx); + return table_7_2_1[idx]; +} + static inline uint16_t packBits(const uint8_t *toPack, const int nb) { int res = 0; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index c98cf37846..de808869aa 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -3915,7 +3915,7 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d n_subPDUs++; LOG_I(NR_MAC, "[UE %d][RAPROC][RA-RNTI %04x] Got RAPID RAR subPDU\n", mac->ue_id, rnti); } else { - ra->RA_backoff_indicator = table_7_2_1[((NR_RA_HEADER_BI *)rarh)->BI]; + ra->RA_backoff_indicator = get_backoff_indicator(((NR_RA_HEADER_BI *)rarh)->BI); ra->RA_BI_found = 1; LOG_I(NR_MAC, "[UE %d][RAPROC][RA-RNTI %04x] Got BI RAR subPDU %d ms\n", mac->ue_id, ra->RA_backoff_indicator, rnti); if ( ((NR_RA_HEADER_BI *)rarh)->E == 1) {