[Bug-ID: ODUHIGH-629] SlotCfg correction as per TDD_PERIODICITY and NUMEROLOGY 68/13768/2
authorsvaidhya <svaidhya@radisys.com>
Fri, 22 Nov 2024 11:11:37 +0000 (16:41 +0530)
committersvaidhya <svaidhya@radisys.com>
Tue, 26 Nov 2024 06:04:07 +0000 (11:34 +0530)
Change-Id: Ie9b52b0a40680615e51568f22ed4df0bc8c32a79
Signed-off-by: svaidhya <svaidhya@radisys.com>
13 files changed:
build/config/tdd_odu_config.xml
src/5gnrmac/lwr_mac_fsm.c
src/5gnrmac/lwr_mac_util.c
src/5gnrmac/lwr_mac_utils.h
src/5gnrsch/sch.c
src/5gnrsch/sch.h
src/5gnrsch/sch_common.c
src/5gnrsch/sch_msg_router.c
src/5gnrsch/sch_rach.c
src/5gnrsch/sch_slot_ind.c
src/5gnrsch/sch_utils.c
src/5gnrsch/sch_utils.h
src/cm/common_def.h

index de19fde..66db107 100644 (file)
          <RA_RSP_WINDOW>10</RA_RSP_WINDOW>
       </PRACH_CFG>
       <TDD_CFG>
-         <TDD_PERIODICITY>6</TDD_PERIODICITY>
-         <NUM_DL_SLOTS>7</NUM_DL_SLOTS>
+         <TDD_PERIODICITY>7</TDD_PERIODICITY>
+         <NUM_DL_SLOTS>10</NUM_DL_SLOTS>
          <NUM_DL_SYMBOLS>12</NUM_DL_SYMBOLS>
-         <NUM_UL_SLOTS>2</NUM_UL_SLOTS>
+         <NUM_UL_SLOTS>9</NUM_UL_SLOTS>
          <NUM_UL_SYMBOLS>1</NUM_UL_SYMBOLS>
       </TDD_CFG>
       <PRE_CODE_CFG>
index c747827..6b08376 100644 (file)
@@ -2002,6 +2002,9 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg)
 #ifdef NR_TDD
    uint8_t slotIdx = 0; 
    uint8_t symbolIdx =0;
+   uint8_t numSlotsInMaxPeriodicity = 0; /*number of TDD Slots in MAX_PERIODICITY(10ms) as per numerology*/
+   uint8_t numSlotsInCurrPeriodicity = 0; /*number of TDD Slots in Configured_PERIODICITY(0.5ms to 10ms) as per numerology*/
+   uint8_t cntSlotCfg = 0; /*number of Slot Cfg repeatition*/
 #endif   
    uint16_t index = 0;
    uint16_t *cellId =NULLP;
@@ -2029,6 +2032,18 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg)
    lwrMacCb.cellCb[lwrMacCb.numCell].cellId = macCfgParams.cellId;
    lwrMacCb.cellCb[lwrMacCb.numCell].phyCellId = macCfgParams.cellCfg.phyCellId; 
    lwrMacCb.numCell++;
+#ifdef NR_TDD
+   numSlotsInMaxPeriodicity = MAX_TDD_PERIODICITY * pow(2, macCb.macCell[cellIdx]->numerology);
+   numSlotsInCurrPeriodicity = calcNumSlotsInCurrPeriodicity(macCfgParams.tddCfg.tddPeriod, macCb.macCell[cellIdx]->numerology);
+
+   if(numSlotsInCurrPeriodicity == 0)
+   {
+      DU_LOG("\nERROR  --> LWR_MAC: CONFIG_REQ: numSlotsInCurrPeriodicity is 0 thus exiting");
+      return RFAILED;
+   }
+   DU_LOG("\nINFO   --> LWR_MAC: CONFIG_REQ: numberofTDDSlot in MAX_PERIOICITY(10ms) = %d", numSlotsInMaxPeriodicity);
+   DU_LOG("\nINFO   --> LWR_MAC: CONFIG_REQ: numberofTDDSlot in CURRENT PERIOICITY(enumVal = %d) = %d\n", macCfgParams.tddCfg.tddPeriod, numSlotsInCurrPeriodicity);
+#endif
 
    /* Allocte And fill Vendor msg */
    LWR_MAC_ALLOC(vendorMsgQElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_vendor_msg_t)));  
@@ -2075,7 +2090,7 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg)
 #ifndef NR_TDD
    configReq->number_of_tlvs = 25;
 #else
-   configReq->number_of_tlvs = 25 + 1 + MAX_TDD_PERIODICITY_SLOTS * MAX_SYMB_PER_SLOT;
+   configReq->number_of_tlvs = 25 + 1 + numSlotsInMaxPeriodicity * MAX_SYMB_PER_SLOT;
 #endif
 
    msgLen = sizeof(configReq->number_of_tlvs);
@@ -2187,33 +2202,38 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg)
    fillTlvs(&configReq->tlvs[index++], FAPI_TDD_PERIOD_TAG,                \
          sizeof(uint8_t), macCfgParams.tddCfg.tddPeriod, &msgLen);
 
-   for(slotIdx =0 ;slotIdx < MAX_TDD_PERIODICITY_SLOTS; slotIdx++) 
+   cntSlotCfg = numSlotsInMaxPeriodicity/numSlotsInCurrPeriodicity;
+   while(cntSlotCfg)
    {
-      for(symbolIdx = 0; symbolIdx < MAX_SYMB_PER_SLOT; symbolIdx++)
+      for(slotIdx =0 ;slotIdx < numSlotsInCurrPeriodicity; slotIdx++) 
       {
-         /*Fill Full-DL Slots as well as DL symbols ini 1st Flexi Slo*/
-         if(slotIdx < macCfgParams.tddCfg.nrOfDlSlots || \
-               (slotIdx == macCfgParams.tddCfg.nrOfDlSlots && symbolIdx < macCfgParams.tddCfg.nrOfDlSymbols)) 
+         for(symbolIdx = 0; symbolIdx < MAX_SYMB_PER_SLOT; symbolIdx++)
          {
-            fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG,               \
-                  sizeof(uint8_t), DL_SYMBOL, &msgLen);
-         }
+            /*Fill Full-DL Slots as well as DL symbols ini 1st Flexi Slo*/
+            if(slotIdx < macCfgParams.tddCfg.nrOfDlSlots || \
+                  (slotIdx == macCfgParams.tddCfg.nrOfDlSlots && symbolIdx < macCfgParams.tddCfg.nrOfDlSymbols)) 
+            {
+               fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG,               \
+                    sizeof(uint8_t), DL_SYMBOL, &msgLen);
+            }
 
-         /*Fill Full-FLEXI SLOT and as well as Flexi Symbols in 1 slot preceding FULL-UL slot*/ 
-         else if(slotIdx < (MAX_TDD_PERIODICITY_SLOTS - macCfgParams.tddCfg.nrOfUlSlots -1) ||  \
-               (slotIdx == (MAX_TDD_PERIODICITY_SLOTS - macCfgParams.tddCfg.nrOfUlSlots -1) && \
-                symbolIdx < (MAX_SYMB_PER_SLOT - macCfgParams.tddCfg.nrOfUlSymbols)))
-         {
-            fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG,               \
-                  sizeof(uint8_t), FLEXI_SYMBOL, &msgLen);
-         }
-         /*Fill Partial UL symbols and Full-UL slot*/
-         else
-         {
-            fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG,               \
-                  sizeof(uint8_t), UL_SYMBOL, &msgLen);
+            /*Fill Full-FLEXI SLOT and as well as Flexi Symbols in 1 slot preceding FULL-UL slot*/ 
+            else if(slotIdx < (numSlotsInCurrPeriodicity - macCfgParams.tddCfg.nrOfUlSlots -1) ||  \
+                     (slotIdx == (numSlotsInCurrPeriodicity - macCfgParams.tddCfg.nrOfUlSlots -1) && \
+                     symbolIdx < (MAX_SYMB_PER_SLOT - macCfgParams.tddCfg.nrOfUlSymbols)))
+            {
+               fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG,               \
+                     sizeof(uint8_t), FLEXI_SYMBOL, &msgLen);
+            }
+            /*Fill Partial UL symbols and Full-UL slot*/
+            else
+            {
+               fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG,               \
+                     sizeof(uint8_t), UL_SYMBOL, &msgLen);
+            }
          }
       }
+      cntSlotCfg--;
    }
 #endif   
 
index 0fd3358..08ab8ac 100644 (file)
@@ -188,6 +188,97 @@ void convertFreqDomRsrcMapToIAPIFormat(uint8_t *sourceBitMap, uint8_t *destBitMa
    }
 }
 
+#ifdef NR_TDD
+/**
+ *@brief Returns Num of Slots in Current TDD periodicity
+ *
+ * @details
+ * 
+ * Function : calcNumSlotsInCurrPeriodicity 
+ * 
+ * This API returns numOfSlots In CurrPeriodicity as per numerology
+ * 
+ * @param[in] DlUlTxPeriodicity, numerology
+ * @return  numSlotsInCurrPeriodicity 
+ * **/
+
+uint8_t calcNumSlotsInCurrPeriodicity(DlUlTxPeriodicity tddPeriod, uint8_t numerology)
+{
+   float periodicityInMsec = 0;
+   
+   switch(tddPeriod)
+   {
+      case TX_PRDCTY_MS_0P5:
+      {
+        if(numerology <= 0)
+        {
+           DU_LOG("\nERROR  --> LWR_MAC_UTILS: numerology:%d cant be configured with 0.5ms periodicity",numerology);
+           return 0;
+        }
+        periodicityInMsec = 0.5;
+         break;
+      }
+      case TX_PRDCTY_MS_0P625:
+      {
+        if(numerology <= 2)
+        {
+           DU_LOG("\nERROR  --> LWR_MAC_UTILS: numerology:%d cant be configured with 0.625ms periodicity",numerology);
+           return 0;
+        }
+         periodicityInMsec = 0.625;
+         break;
+      }
+      case TX_PRDCTY_MS_1:
+      {
+         periodicityInMsec = 1;
+         break;
+      }
+      case TX_PRDCTY_MS_1P25:
+      {
+        if(numerology <= 1)
+        {
+           DU_LOG("\nERROR  --> LWR_MAC_UTILS: numerology:%d cant be configured with 1.25ms periodicity",numerology);
+           return 0;
+        }
+         periodicityInMsec = 1.25;
+         break;
+      }
+      case TX_PRDCTY_MS_2:
+      {
+         periodicityInMsec = 2;
+         break;
+      }
+      case TX_PRDCTY_MS_2P5:
+      {
+        if(numerology <= 0)
+        {
+           DU_LOG("\nERROR  --> LWR_MAC_UTILS: numerology:%d cant be configured with 2.5ms periodicity",numerology);
+           return 0;
+        }
+         periodicityInMsec = 2.5;
+         break;
+      }
+      case TX_PRDCTY_MS_5:
+      {
+         periodicityInMsec = 5;
+         break;
+      }
+      case TX_PRDCTY_MS_10:
+      {
+         periodicityInMsec = 10;
+         break;
+      }
+      default:
+      {
+        DU_LOG("\nERROR  -->  LWR_MAC_UTILS : Invalid DlUlTxPeriodicity:%d", tddPeriod);
+        return 0;
+      }
+   }
+
+   return (periodicityInMsec * pow(2,numerology));
+}
+#endif
+
 /**********************************************************************
   End of file
  **********************************************************************/
index 50f9a45..b56c8c5 100644 (file)
 }
  
 void convertFreqDomRsrcMapToIAPIFormat(uint8_t *sourceBitMap, uint8_t *destBitMap);
+#ifdef NR_TDD
+uint8_t calcNumSlotsInCurrPeriodicity(DlUlTxPeriodicity tddPeriod, uint8_t numerology);
+#endif
+
 /**********************************************************************
          End of file
 **********************************************************************/
index 40a745c..bd61e20 100644 (file)
@@ -294,13 +294,23 @@ uint16_t schGetPeriodicityInMsec(DlUlTxPeriodicity tddPeriod)
  * This API Fills the slotCfg from CellCfg
  * 
  * @param[in] SchCellCb *cell, TDDCfg tddCfg
- * @return  void
+ * @return ROK, RFAILED 
  * **/
-void schFillSlotConfig(SchCellCb *cell, TDDCfg tddCfg)
+uint8_t schFillSlotConfig(SchCellCb *cell, TDDCfg tddCfg)
 {
    uint8_t slotIdx = 0, symbolIdx = 0;
 
-   for(slotIdx =0 ;slotIdx < MAX_TDD_PERIODICITY_SLOTS; slotIdx++) 
+   for(symbolIdx = 0; symbolIdx < MAX_SYMB_PER_SLOT; symbolIdx++)
+   {
+      SCH_ALLOC(cell->slotCfg[symbolIdx], cell->numSlotsInPeriodicity * sizeof(SchSymbolConfig));
+      if(cell->slotCfg[symbolIdx] == NULLP)
+      {
+          DU_LOG("\nERROR  -->  SCH: Memory allocation issue in schFillSlotConfig()");
+          return RFAILED;
+      }
+   }
+   
+   for(slotIdx =0 ;slotIdx < cell->numSlotsInPeriodicity; slotIdx++) 
    {
       for(symbolIdx = 0; symbolIdx < MAX_SYMB_PER_SLOT; symbolIdx++)
       {
@@ -308,23 +318,24 @@ void schFillSlotConfig(SchCellCb *cell, TDDCfg tddCfg)
          if(slotIdx < tddCfg.nrOfDlSlots || \
                (slotIdx == tddCfg.nrOfDlSlots && symbolIdx < tddCfg.nrOfDlSymbols)) 
          {
-              cell->slotCfg[slotIdx][symbolIdx] = DL_SYMBOL; 
+              cell->slotCfg[symbolIdx][slotIdx] = DL_SYMBOL; 
          }
 
          /*Fill Full-FLEXI SLOT and as well as Flexi Symbols in 1 slot preceding FULL-UL slot*/ 
-         else if(slotIdx < (MAX_TDD_PERIODICITY_SLOTS - tddCfg.nrOfUlSlots -1) ||  \
-               (slotIdx == (MAX_TDD_PERIODICITY_SLOTS - tddCfg.nrOfUlSlots -1) && \
+         else if(slotIdx < (cell->numSlotsInPeriodicity - tddCfg.nrOfUlSlots -1) ||  \
+               (slotIdx == (cell->numSlotsInPeriodicity - tddCfg.nrOfUlSlots -1) && \
                 symbolIdx < (MAX_SYMB_PER_SLOT - tddCfg.nrOfUlSymbols)))
          {
-              cell->slotCfg[slotIdx][symbolIdx] = FLEXI_SYMBOL; 
+              cell->slotCfg[symbolIdx][slotIdx] = FLEXI_SYMBOL; 
          }
          /*Fill Partial UL symbols and Full-UL slot*/
          else
          {
-              cell->slotCfg[slotIdx][symbolIdx] = UL_SYMBOL; 
+              cell->slotCfg[symbolIdx][slotIdx] = UL_SYMBOL; 
          }
       }
    }
+   return ROK;
 }
 
 /**
@@ -340,34 +351,48 @@ void schFillSlotConfig(SchCellCb *cell, TDDCfg tddCfg)
  *  @param[in]  SchCellCfg *schCellCfg
  *  @return  void
  **/
-void schInitTddSlotCfg(SchCellCb *cell, SchCellCfg *schCellCfg)
+uint8_t schInitTddSlotCfg(SchCellCb *cell, SchCellCfg *schCellCfg)
 {
    uint16_t periodicityInMicroSec = 0;
    int8_t slotIdx, symbIdx;
-
+   uint8_t sizeSlotBitmap = 0, idxSlotBitmap = 0;
+   
    periodicityInMicroSec = schGetPeriodicityInMsec(schCellCfg->tddCfg.tddPeriod);
    cell->numSlotsInPeriodicity = (periodicityInMicroSec * pow(2, cell->numerology))/1000;
-   cell->slotFrmtBitMap = 0;
-   schFillSlotConfig(cell, schCellCfg->tddCfg);
+   if(schFillSlotConfig(cell, schCellCfg->tddCfg) != ROK)
+   {
+      DU_LOG("\nERROR  --> SCH: Slot Configuration failed in SCH");
+      return RFAILED;
+   }
+
+   sizeSlotBitmap = (cell->numSlotsInPeriodicity / 16) + 1;
+   SCH_ALLOC(cell->slotFrmtBitMap, sizeSlotBitmap * sizeof(uint32_t));
+
+   if(cell->slotFrmtBitMap == NULLP)
+   {
+      DU_LOG("\nERROR  --> SCH: Slot Format Bit Map memory allocation failed.");
+      return RFAILED;
+   }
    for(slotIdx = cell->numSlotsInPeriodicity-1; slotIdx >= 0; slotIdx--)
    {
+      idxSlotBitmap = (slotIdx /16);
       symbIdx = 0;
       /* If the first and last symbol are the same, the entire slot is the same type */
-      if((cell->slotCfg[slotIdx][symbIdx] == cell->slotCfg[slotIdx][MAX_SYMB_PER_SLOT-1]) &&
-              cell->slotCfg[slotIdx][symbIdx] != FLEXI_SYMBOL)
+      if((cell->slotCfg[symbIdx][slotIdx] == cell->slotCfg[MAX_SYMB_PER_SLOT-1][slotIdx]) &&
+              cell->slotCfg[symbIdx][slotIdx] != FLEXI_SYMBOL)
       {
-         switch(cell->slotCfg[slotIdx][symbIdx])
+         switch(cell->slotCfg[symbIdx][slotIdx])
          {
             case DL_SLOT:
             {
                /*BitMap to be set to 00 */
-               cell->slotFrmtBitMap = (cell->slotFrmtBitMap<<2);
+               cell->slotFrmtBitMap[idxSlotBitmap] = (cell->slotFrmtBitMap[idxSlotBitmap]<<2);
                break;
             }
             case UL_SLOT:
             {
                /*BitMap to be set to 01 */
-               cell->slotFrmtBitMap = ((cell->slotFrmtBitMap<<2) | (UL_SLOT));
+               cell->slotFrmtBitMap[idxSlotBitmap] = ((cell->slotFrmtBitMap[idxSlotBitmap]<<2) | (UL_SLOT));
                break;
             }
             default:
@@ -376,8 +401,9 @@ void schInitTddSlotCfg(SchCellCb *cell, SchCellCfg *schCellCfg)
          continue;
       }
       /* slot config is flexible. First set slotBitMap to 10 */
-      cell->slotFrmtBitMap = ((cell->slotFrmtBitMap<<2) | (FLEXI_SLOT));
+      cell->slotFrmtBitMap[idxSlotBitmap] = ((cell->slotFrmtBitMap[idxSlotBitmap]<<2) | (FLEXI_SLOT));
    }
+   return ROK;
 }
 #endif
 
@@ -507,7 +533,11 @@ uint8_t schInitCellCb(Inst inst, SchCellCfg *schCellCfg)
         DU_LOG("\nERROR  -->  SCH : Numerology %d not supported", cell->numerology);
    }
 #ifdef NR_TDD
-   schInitTddSlotCfg(cell, schCellCfg);   
+   if(schInitTddSlotCfg(cell, schCellCfg) != ROK)
+   {
+      DU_LOG("\nERROR  -->  SCH : Initialization of TDD Configuration failed");
+      return RFAILED;
+   }
 #endif
 
    SCH_ALLOC(cell->schDlSlotInfo, cell->numSlots * sizeof(SchDlSlotInfo*));
@@ -891,6 +921,10 @@ void deleteSchCellCb(SchCellCb *cellCb)
    CmLListCp *list=NULL;
    CmLList *node=NULL, *next=NULL;
    SchPageInfo *tempNode = NULLP;
+#ifdef NR_TDD
+    uint8_t sizeSlotBitmap = 0;
+    uint8_t symbolIdx = 0;
+#endif
 
    if(cellCb->schDlSlotInfo)
    {
@@ -968,6 +1002,14 @@ void deleteSchCellCb(SchCellCb *cellCb)
       }
    }
 
+#ifdef NR_TDD
+   for(symbolIdx = 0; symbolIdx < MAX_SYMB_PER_SLOT; symbolIdx++)
+   {
+      SCH_FREE(cellCb->slotCfg[symbolIdx], cellCb->numSlotsInPeriodicity * sizeof(SchSymbolConfig));
+   }
+   sizeSlotBitmap = (cellCb->numSlotsInPeriodicity / 16) + 1;
+   SCH_FREE(cellCb->slotFrmtBitMap, sizeSlotBitmap * sizeof(uint32_t));
+#endif
    cellCb->api->SchCellDeleteReq(cellCb);
 
    memset(cellCb, 0, sizeof(SchCellCb));
index 328b80f..b8b5d48 100644 (file)
@@ -691,8 +691,8 @@ typedef struct schCellCb
    SchPageCb     pageCb;                            /*!< Page Record at Schedular*/
 #ifdef NR_TDD
    uint8_t       numSlotsInPeriodicity;             /*!< number of slots in configured periodicity and SCS */
-   uint32_t      slotFrmtBitMap;                    /*!< 2 bits must be read together to determine D/U/S slots. 00-D, 01-U, 10-S */
-   SchSymbolConfig       slotCfg[MAX_TDD_PERIODICITY_SLOTS][MAX_SYMB_PER_SLOT];
+   uint32_t      *slotFrmtBitMap;                    /*!< 2 bits must be read together to determine D/U/S slots. 00-D, 01-U, 10-S */
+   SchSymbolConfig    *slotCfg[MAX_SYMB_PER_SLOT];  /*!< slotCfg is 2D array with Symbol as ROW and Slot as COLUMN */
 #endif
 #ifdef NR_DRX
    SchDrxCb      drxCb[MAX_DRX_SIZE];                           /*!< Drx cb*/
index c9967d8..fe6b86c 100644 (file)
@@ -1266,7 +1266,7 @@ SchPdschConfig pdschDedCfg, uint8_t ulAckListCount, uint8_t *UlAckTbl)
             {
                for(checkSymbol = startSymbol; checkSymbol<endSymbol; checkSymbol ++)
                {
-                  slotCfg = cell->slotCfg[tmpSlot][checkSymbol];
+                  slotCfg = cell->slotCfg[checkSymbol][tmpSlot];
                   if(slotCfg == UL_SLOT)
                   {
                      ulSlotPresent = true;
@@ -1301,7 +1301,7 @@ SchPdschConfig pdschDedCfg, uint8_t ulAckListCount, uint8_t *UlAckTbl)
                   {
                      for(checkSymbol = 0; checkSymbol< MAX_SYMB_PER_SLOT;checkSymbol++)
                      {
-                        if(cell->slotCfg[tmpSlot][checkSymbol] == UL_SYMBOL)
+                        if(cell->slotCfg[checkSymbol][tmpSlot] == UL_SYMBOL)
                         {
                            ulSlotPresent = true;
                            break;
@@ -1473,7 +1473,7 @@ SchK2TimingInfoTbl *msg3K2InfoTbl, SchK2TimingInfoTbl *k2InfoTbl)
                      dlSymbolPresent = false;
                      for(checkSymbol= startSymbol; checkSymbol<endSymbol; checkSymbol++)
                      {
-                        currentSymbol = cell->slotCfg[k2TmpVal][checkSymbol];
+                        currentSymbol = cell->slotCfg[checkSymbol][k2TmpVal];
                         if(currentSymbol == DL_SLOT || currentSymbol == FLEXI_SLOT)
                         {
                            dlSymbolPresent = true;
@@ -1509,7 +1509,7 @@ SchK2TimingInfoTbl *msg3K2InfoTbl, SchK2TimingInfoTbl *k2InfoTbl)
                         dlSymbolPresent = false;
                         for(checkSymbol= startSymbol; checkSymbol<endSymbol; checkSymbol++)
                         {
-                           currentSymbol = cell->slotCfg[msg3K2TmpVal][checkSymbol];
+                           currentSymbol = cell->slotCfg[checkSymbol][msg3K2TmpVal];
                            if(currentSymbol == DL_SLOT || currentSymbol == FLEXI_SLOT)
                            {
                               dlSymbolPresent = true;
@@ -2078,7 +2078,7 @@ bool schProcessSrOrBsrReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId
    /* Calculating time frame to send DCI for SR */
    ADD_DELTA_TO_TIME(currTime, dciTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
 #ifdef NR_TDD
-   if(schGetSlotSymbFrmt(dciTime.slot, cell->slotFrmtBitMap) == DL_SLOT)
+   if(schGetSlotSymbFrmt(dciTime.slot % cell->numSlotsInPeriodicity, cell->slotFrmtBitMap) == DL_SLOT)
 #endif
    {     
       if(ueCb->k2TblPrsnt)
index 4cbd958..48d3fa9 100755 (executable)
@@ -180,7 +180,7 @@ void callFlowSchMsgRouter(Pst *pst)
             strcpy(message,"EVENT_DL_CQI_TO_SCH");
             break;
          }
-      case EVENT_PHR_IND_TO_SCH
+      case EVENT_PHR_IND_TO_SCH:
          {
             strcpy(message,"EVENT_PHR_IND_TO_SCH");
          }
index 50b4281..683e924 100644 (file)
@@ -575,7 +575,7 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin
    dciSlot = dciTime.slot;
 #ifdef NR_TDD
    /* Consider this slot for sending DCI, only if it is a DL slot */
-   if(schGetSlotSymbFrmt(dciSlot, cell->slotFrmtBitMap) == DL_SLOT)
+   if(schGetSlotSymbFrmt(dciSlot % cell->numSlotsInPeriodicity, cell->slotFrmtBitMap) == DL_SLOT)
 #endif
    {
       /* If PDCCH is already scheduled on this slot, cannot schedule PDSCH for another UE here. */
@@ -619,7 +619,7 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin
 
                   ADD_DELTA_TO_TIME(rarTime, pucchTime, k1, cell->numSlots);
 #ifdef NR_TDD
-                  if(schGetSlotSymbFrmt(pucchTime.slot, cell->slotFrmtBitMap) == DL_SLOT)
+                  if(schGetSlotSymbFrmt(pucchTime.slot % totalCfgSlot, cell->slotFrmtBitMap) == DL_SLOT)
                      continue;
 #endif
                   /*In this pucchTime, this particular UE/CRNTI is already scheduled thus checking 
index 0efd930..1e319d3 100644 (file)
@@ -425,7 +425,7 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId,
 
    ADD_DELTA_TO_TIME(currTime, (*pdcchTime), gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
 #ifdef NR_TDD
-   if(schGetSlotSymbFrmt(pdcchTime->slot, cell->slotFrmtBitMap) != DL_SLOT)
+   if(schGetSlotSymbFrmt(pdcchTime->slot % cell->numSlotsInPeriodicity, cell->slotFrmtBitMap) != DL_SLOT)
    {
       /* If it is not a DL slot, cannot schedule PDCCH. Return from here. */
       return false;
@@ -476,7 +476,7 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId,
 
       ADD_DELTA_TO_TIME((*pdcchTime), (*pdschTime), k0Val, cell->numSlots);
 #ifdef NR_TDD
-      if(schGetSlotSymbFrmt(pdschTime->slot, cell->slotFrmtBitMap) != DL_SLOT)
+      if(schGetSlotSymbFrmt(pdschTime->slot % cell->numSlotsInPeriodicity, cell->slotFrmtBitMap) != DL_SLOT)
       {
          continue;
       }
@@ -503,7 +503,7 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId,
          }
          ADD_DELTA_TO_TIME((*pdschTime),(*pucchTime), k1Val, cell->numSlots);
 #ifdef NR_TDD
-         if(schGetSlotSymbFrmt(pucchTime->slot, cell->slotFrmtBitMap) == DL_SLOT)
+         if(schGetSlotSymbFrmt(pucchTime->slot % cell->numSlotsInPeriodicity, cell->slotFrmtBitMap) == DL_SLOT)
          {
             continue;
          }
index 3e8b23a..11d0ebb 100644 (file)
@@ -1736,10 +1736,16 @@ void printLcLL(CmLListCp *lcLL)
  *      -# UL    - 1
  *      -# FLEXI - 2
  **/
-SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t bitMap)
+SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t *bitMap)
 {
-   uint32_t offset = (slot)*2;
-   return (bitMap & 0x3<<offset)>>offset;
+   uint32_t offset = 0;
+   
+   if(slot > 16)
+      offset = ((slot - 16)%16) * 2;
+   else
+      offset = (slot)*2;
+
+   return (bitMap[slot/16] & 0x3<<offset)>>offset;
 #if 0
    SlotConfig slotFrmt;
    int mask1 = 0, mask2 = 0;
index c47a5ad..0358933 100644 (file)
@@ -126,7 +126,7 @@ uint8_t deleteNodeFromLList(CmLListCp *llist, CmLList *node);
 
 /* Functions declarations : Slot format handler */
 #ifdef NR_TDD
-SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t bitMap);
+SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t *bitMap);
 uint8_t calculateSlotPatternLength(uint8_t scs, uint8_t periodicity);
 #endif
 
index 673eaf0..f98c7e9 100644 (file)
  * However, aligning to fapi_interface.h, setting this macro to 160.
  * TODO : To support 160, FAPI_MAX_NUM_TLVS_CONFIG in fapi_interface.h
  * of Intel L1 must be incremented to a higher number */
-#define MAX_TDD_PERIODICITY_SLOTS 10 
+#define MAX_TDD_PERIODICITY 10 /*As per Spec SCF222v10.02, TDD Table 10ms is the MAX_PERIODICITY in milli-sec*/
 #endif
 
 #define GET_UE_ID( _crnti,_ueId)           \