From a3bbbd0630f70697c27007d1a618385790a3b49d Mon Sep 17 00:00:00 2001
From: Robert Schmidt <robert.schmidt@eurecom.fr>
Date: Thu, 26 Mar 2020 19:13:14 +0100
Subject: [PATCH] Lock PRACH region through vrb_map_UL

---
 openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 35 +++++++----------------
 1 file changed, 10 insertions(+), 25 deletions(-)

diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
index 16127ad603d..ac7ab0cbfdc 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
@@ -1211,32 +1211,17 @@ schedule_ulsch(module_id_t module_idP,
 
   /* Note: RC.nb_mac_CC[module_idP] should be lower than or equal to NFAPI_CC_MAX */
   for (int CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++, cc++) {
-    /* From Louis-Adrien to François:
-     * The comment bloc below is to configure with a command line.
-     * I took it from the equivalent part in the fairRR scheduler (around line 2578 in eNB_scheduler_fairRR.c).
-     * As said in the meeting, it seems to work only for small TBS.
-     * The cause of false RA still present with this fix is to investigate.
-     *
-     * Note: in the get_prach_prb_offset() function below, the last argument is frameP in eNB_scheduler_fairRR.c
-     * I think it should be sched_frame instead. This parameter has only impacts in case TDD and preamble format 4.
-     * To confirm.
-     */
-    /* TODO: update vrb_map_UL here? */
-    /*
-    int start_rb = 0;
-    int nb_rb = 6;
-    LTE_DL_FRAME_PARMS *frame_parms = &(RC.eNB[module_idP][CC_id]->frame_parms);
-
-    if (is_prach_subframe(frame_parms, sched_frame, sched_subframe) == 1) {
-      start_rb = get_prach_prb_offset(frame_parms,
-                                      frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
-                                      frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset,
-                                      0, // tdd_mapindex
-                                      sched_frame); // Nf
-
-      first_rb[CC_id] = start_rb + nb_rb;
+    LTE_DL_FRAME_PARMS *frame_parms = &RC.eNB[module_idP][CC_id]->frame_parms;
+    if (is_prach_subframe(frame_parms, sched_frame, sched_subframe)) {
+      int start_rb = get_prach_prb_offset(
+          frame_parms,
+          frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
+          frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset,
+          0, // tdd_mapindex
+          sched_frame); // Nf
+      for (int i = 0; i < 6; i++)
+        cc[CC_id].vrb_map_UL[start_rb + i] = 1;
     }
-    */
 
     /* HACK: let's remove the PUCCH from available RBs
      * we suppose PUCCH size is:
-- 
GitLab