From 2040a88bf92ac374a94512451e4edf80b5f35491 Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Fri, 10 Dec 2021 11:20:44 +0100 Subject: [PATCH] sched: add comments + rename variable Signed-off-by: Carlo Galiotto --- lib/include/srsran/phy/phch/ra_nr.h | 2 +- lib/src/phy/phch/ra_nr.c | 6 +++--- srsgnb/src/stack/mac/sched_nr_grant_allocator.cc | 2 ++ .../src/stack/mac/test/sched_nr_utilities_tests.cc | 14 +++++++++++--- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/include/srsran/phy/phch/ra_nr.h b/lib/include/srsran/phy/phch/ra_nr.h index 155e6b7d2..99fc624ec 100644 --- a/lib/include/srsran/phy/phch/ra_nr.h +++ b/lib/include/srsran/phy/phch/ra_nr.h @@ -155,7 +155,7 @@ SRSRAN_API uint32_t srsran_ra_nr_type1_riv(uint32_t N_rb, uint32_t start_rb, uin * * Mapping is performed as: return the MCS that has the closest spectral efficiency to that of the CQI * @param cqi CQI value - * @param srsran_csi_cqi_table_t CQI table index + * @param cqi_table_idx CQI table index * @param mcs_table MCS table parameter * @param dci_format DCI format * @param search_space_type Seach Space type diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index 81a9f3c66..f853aa7df 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -30,7 +30,7 @@ typedef struct { #define RA_NR_MCS_SIZE_TABLE2 28 #define RA_NR_MCS_SIZE_TABLE3 29 #define RA_NR_TBS_SIZE_TABLE 93 -#define RA_NR_CQI_SIZE_TABLE 16 +#define RA_NR_CQI_TABLE_SIZE 16 #define RA_NR_BETA_OFFSET_HARQACK_SIZE 32 #define RA_NR_BETA_OFFSET_CSI_SIZE 32 @@ -148,7 +148,7 @@ typedef enum { ra_nr_table_1 = 0, ra_nr_table_2, ra_nr_table_3 } ra_nr_table_t; * CQI_table_idx: 1 -> Table 5.1.3.1-1; 2 -> Table 5.1.3.1-2; 3 -> Table 5.1.3.1-3 */ -static int ra_nr_cqi_to_mcs_table[3][3][RA_NR_CQI_SIZE_TABLE] = { +static int ra_nr_cqi_to_mcs_table[3][3][RA_NR_CQI_TABLE_SIZE] = { /* ROW 1 - CQI Table 1 */ {/* MCS Table 1 */ {-1, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 20, 22, 24, 26, 28}, /* MCS Table 2 */ {-1, 0, 0, 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17, 19, 21}, @@ -1121,7 +1121,7 @@ int srsran_ra_nr_cqi_to_mcs(uint8_t cqi, srsran_search_space_type_t search_space_type, srsran_rnti_type_t rnti_type) { - if (cqi >= RA_NR_CQI_SIZE_TABLE) { + if (cqi >= RA_NR_CQI_TABLE_SIZE) { ERROR("Invalid CQI (%u)", cqi); return -1; } diff --git a/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc b/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc index 0bea82f28..b02978281 100644 --- a/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc +++ b/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc @@ -337,8 +337,10 @@ alloc_result bwp_slot_allocator::alloc_pdsch(slot_ue& ue, uint32_t ss_id, const srsran_assert(success, "Failed to allocate DL HARQ retx"); } + srsran_slot_cfg_t slot_cfg; slot_cfg.idx = ue.pdsch_slot.to_uint(); + // Value 0.95 is from TS 38.214 v15.14.00, Section 5.1.3, page 17 const static float max_R = 0.95; while (true) { // Generate PDSCH diff --git a/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc b/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc index 5b9efe731..fa6aef467 100644 --- a/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc +++ b/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc @@ -1,6 +1,14 @@ -// -// Created by carlo on 9/12/21. -// +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2021 Software Radio Systems Limited + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the distribution. + * + */ #include "srsran/common/test_common.h" extern "C" {