From b7146c41b2b1265d8a25d6215f9e620fa01321d2 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 13 Apr 2021 16:07:38 +0200 Subject: [PATCH] nr: add NDI for PUSCH grant to sch cfg struct --- lib/include/srsran/interfaces/ue_nr_interfaces.h | 8 ++++++-- lib/include/srsran/phy/phch/sch_cfg_nr.h | 2 ++ lib/src/phy/phch/ra_nr.c | 2 ++ srsue/src/phy/nr/cc_worker.cc | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/include/srsran/interfaces/ue_nr_interfaces.h b/lib/include/srsran/interfaces/ue_nr_interfaces.h index b743fb986..0ba59cb61 100644 --- a/lib/include/srsran/interfaces/ue_nr_interfaces.h +++ b/lib/include/srsran/interfaces/ue_nr_interfaces.h @@ -40,11 +40,15 @@ public: uint32_t tti; } mac_nr_grant_dl_t; + // UL grant as conveyed between PHY and MAC typedef struct { - uint32_t pid; uint16_t rnti; uint32_t tti; - uint32_t tbs; // transport block size in Bytes + uint8_t pid; // HARQ process ID + uint32_t tbs; // transport block size in Bytes + uint8_t ndi; // Raw new data indicator extracted from DCI + uint8_t rv; // Redundancy Version + bool is_rar_grant; // True if grant comes from RAR } mac_nr_grant_ul_t; /// For UL, payload buffer remains in MAC diff --git a/lib/include/srsran/phy/phch/sch_cfg_nr.h b/lib/include/srsran/phy/phch/sch_cfg_nr.h index ac39594e2..178cd57f2 100644 --- a/lib/include/srsran/phy/phch/sch_cfg_nr.h +++ b/lib/include/srsran/phy/phch/sch_cfg_nr.h @@ -30,6 +30,8 @@ typedef struct SRSRAN_API { int tbs; ///< Payload size, TS 38.212 refers to it as A double R; ///< Target LDPC rate int rv; ///< Redundancy version + int ndi; ///< New Data Indicator + int pid; ///< HARQ Process ID uint32_t nof_re; ///< Number of available resource elements to send, known as N_RE uint32_t nof_bits; ///< Number of available bits to send, known as G uint32_t cw_idx; diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index 62bf5512b..9387df894 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -787,6 +787,8 @@ int srsran_ra_ul_dci_to_grant_nr(const srsran_carrier_nr_t* carrier, pusch_grant->rnti_type = dci_ul->ctx.rnti_type; pusch_grant->tb[0].rv = dci_ul->rv; pusch_grant->tb[0].mcs = dci_ul->mcs; + pusch_grant->tb[0].ndi = dci_ul->ndi; + pusch_grant->tb[0].pid = dci_ul->pid; // 5.1.6.2 DM-RS reception procedure if (ra_ul_dmrs(pusch_hl_cfg, pusch_grant, pusch_cfg) < SRSRAN_SUCCESS) { diff --git a/srsue/src/phy/nr/cc_worker.cc b/srsue/src/phy/nr/cc_worker.cc index 93c01512d..f3626173a 100644 --- a/srsue/src/phy/nr/cc_worker.cc +++ b/srsue/src/phy/nr/cc_worker.cc @@ -367,6 +367,8 @@ bool cc_worker::work_ul() mac_ul_grant.rnti = pusch_cfg.grant.rnti; mac_ul_grant.tti = ul_slot_cfg.idx; mac_ul_grant.tbs = pusch_cfg.grant.tb[0].tbs / 8; + mac_ul_grant.ndi = pusch_cfg.grant.tb[0].ndi; + mac_ul_grant.rv = pusch_cfg.grant.tb[0].rv; phy->stack->new_grant_ul(0, mac_ul_grant, &ul_action); // Set UCI configuration following procedures