JIRA ID: ODUHIGH-314 : Time domain allocation for SSB in TDD mode
[o-du/l2.git] / src / 5gnrmac / lwr_mac_fsm.c
index cbf14be..bbef58b 100644 (file)
@@ -1975,10 +1975,13 @@ uint8_t lwr_mac_procIqSamplesReqEvt(void *msg)
 uint8_t lwr_mac_procConfigReqEvt(void *msg)
 {
 #ifdef INTEL_FAPI
-   //uint8_t idx = 0;
+#ifdef NR_TDD
+   uint8_t slotIdx = 0; 
+   uint8_t symbolIdx =0;
+#endif   
    uint8_t index = 0;
-   uint16_t *cellId;
-   uint16_t cellIdx;
+   uint16_t *cellId =NULLP;
+   uint16_t cellIdx =0;
    uint32_t msgLen = 0;
    uint32_t mib = 0;
    MacCellCfg macCfgParams;
@@ -2140,12 +2143,20 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg)
    //fillTlvs(&configReq->tlvs[index++], FAPI_MULTIPLE_CELLS_SS_PBCH_IN_A_CARRIER_TAG, \
    sizeof(uint8_t), macCfgParams.ssbCfg.multCellCarr, &msgLen);
 
+#ifdef NR_TDD
    /* fill TDD table */
-   //fillTlvs(&configReq->tlvs[index++], FAPI_TDD_PERIOD_TAG,                \
+   fillTlvs(&configReq->tlvs[index++], FAPI_TDD_PERIOD_TAG,                \
    sizeof(uint8_t), macCfgParams.tddCfg.tddPeriod, &msgLen);
-   //fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG,               \
-   sizeof(uint8_t), macCfgParams.tddCfg.slotCfg[0][0], &msgLen);
-
+   for(slotIdx =0 ;slotIdx< MAX_TDD_PERIODICITY_SLOTS; slotIdx++) 
+   {
+      for(symbolIdx = 0; symbolIdx< MAX_SYMB_PER_SLOT; symbolIdx++)
+      {
+        fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG,               \
+              sizeof(uint8_t), macCfgParams.tddCfg.slotCfg[slotIdx][symbolIdx], &msgLen);
+      }
+   }
+#endif   
+   
    /* fill measurement config */
    //fillTlvs(&configReq->tlvs[index++], FAPI_RSSI_MEASUREMENT_TAG,          \
    sizeof(uint8_t), macCfgParams.rssiUnit, &msgLen);
@@ -3888,7 +3899,7 @@ uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo)
 
       /* add PHY delta */
       ADD_DELTA_TO_TIME(currTimingInfo,ulTtiReqTimingInfo,PHY_DELTA);
-      currUlSlot = &macCb.macCell[cellIdx]->ulSlot[ulTtiReqTimingInfo.slot % MAX_SLOT_SUPPORTED];
+      currUlSlot = &macCb.macCell[cellIdx]->ulSlot[ulTtiReqTimingInfo.slot % MAX_SLOTS];
 
       LWR_MAC_ALLOC(ulTtiElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_ul_tti_req_t)));
       if(ulTtiElem)
@@ -4190,7 +4201,7 @@ uint16_t fillUlDciReq(SlotIndInfo currTimingInfo)
    {
       GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
       memcpy(&ulDciReqTimingInfo, &currTimingInfo, sizeof(SlotIndInfo));
-      currDlSlot = &macCb.macCell[cellIdx]->dlSlot[ulDciReqTimingInfo.slot % MAX_SLOT_SUPPORTED];
+      currDlSlot = &macCb.macCell[cellIdx]->dlSlot[ulDciReqTimingInfo.slot % MAX_SLOTS];
 
       if(currDlSlot->dlInfo.ulGrant != NULLP)
       {