From 166a8f69bbed0ebcc071d3e7a6c05d17a4c650a7 Mon Sep 17 00:00:00 2001
From: Raymond Knopp <raymond.knopp@eurecom.fr>
Date: Thu, 14 Oct 2021 01:35:01 +0200
Subject: [PATCH] prb_mask calculation for mixed slot (for blacklisted PRBs)

---
 openair2/GNB_APP/gnb_config.c                    | 1 +
 openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c
index 301d1f7adb2..b574cccf282 100644
--- a/openair2/GNB_APP/gnb_config.c
+++ b/openair2/GNB_APP/gnb_config.c
@@ -751,6 +751,7 @@ void RCconfig_nr_macrlc() {
       } 
       RC.nrmac[j]->ulsch_max_slots_inactivity = *(MacRLC_ParamList.paramarray[j][MACRLC_ULSCH_MAX_SLOTS_INACTIVITY].uptr);
       RC.nrmac[j]->num_ulprbbl = num_prbbl;
+      LOG_I(NR_MAC,"Blacklisted PRBS %d\n",num_prbbl);
       memcpy(RC.nrmac[j]->ulprbbl,prbbl,275*sizeof(prbbl[0]));
 
     }//  for (j=0;j<RC.nb_nr_macrlc_inst;j++)
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
index e6ad25ade54..afc292dbd25 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
@@ -1286,7 +1286,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
 
   int st = 0, e = 0, len = 0;
   for (int i = 0; i < bwpSize; i++) 
-    if (RC.nrmac[module_id]->ulprbbl[i] == 1) vrb_map_UL[i]=1;
+    if (RC.nrmac[module_id]->ulprbbl[i] == 1) vrb_map_UL[i]=symb;
 
   for (int i = 0; i < bwpSize; i++) {
     while ((vrb_map_UL[i] & symb) != 0 && i < bwpSize)
@@ -1301,6 +1301,8 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
   }
   st = e - len + 1;
 
+  LOG_I(NR_MAC,"UL %d.%d : start_prb %d, end PRB %d\n",frame,slot,st,e);
+  
   uint8_t rballoc_mask[bwpSize];
 
   /* Calculate mask: if any RB in vrb_map_UL is blocked (1), the current RB will be 0 */
-- 
GitLab