From f23c1dff00b5008f71eef715d7b57547ba7b2cdd Mon Sep 17 00:00:00 2001 From: Bartosz Podrygajlo Date: Wed, 3 Jul 2024 16:24:12 +0200 Subject: [PATCH] Correct gNB received PHR to headroom calculation according to 38.133. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index dce6d3b71b..b8f370be16 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -313,10 +313,13 @@ static int nr_process_mac_pdu(instance_t module_idP, int PH; const int PCMAX = phr->PCMAX; /* 38.133 Table10.1.17.1-1 */ - if (phr->PH < 55) + if (phr->PH < 55) { PH = phr->PH - 32; - else - PH = phr->PH - 32 + (phr->PH - 54); + } else if (phr->PH < 63) { + PH = 28 + (phr->PH - 55) * 2; + } else { + PH = 42; + } // in sched_ctrl we set normalized PH wrt MCS and PRBs long *deltaMCS = ul_bwp->pusch_Config ? ul_bwp->pusch_Config->pusch_PowerControl->deltaMCS : NULL; sched_ctrl->ph = PH