Merge "[Epic-ID: ODUHIGH-516][Task-ID: ODUHIGH-553] Transid fixes in E2AP procedures"
authorPriyanka Borla <pborla@radisys.com>
Fri, 22 Dec 2023 09:55:19 +0000 (09:55 +0000)
committerGerrit Code Review <gerrit@o-ran-sc.org>
Fri, 22 Dec 2023 09:55:19 +0000 (09:55 +0000)
src/5gnrmac/lwr_mac_fsm.c
src/5gnrmac/lwr_mac_phy.c
src/5gnrsch/sch_crc.c
src/5gnrsch/sch_fcfs.c
src/phy_stub/phy_stub_msg_hdl.c

index 4c2de0a..8591443 100644 (file)
@@ -125,7 +125,7 @@ uint8_t lwr_mac_procInvalidEvt(void *msg)
  * @return void
  *
  * ****************************************************************/
-void fillMsgHeader(fapi_msg_t *hdr, uint16_t msgType, uint16_t msgLen)
+void fillMsgHeader(fapi_msg_t *hdr, uint16_t msgType, uint32_t msgLen)
 {
    memset(hdr, 0, sizeof(fapi_msg_t));
    hdr->msg_id = msgType;
index 23571ae..546c48e 100644 (file)
@@ -271,7 +271,7 @@ uint8_t LwrMacSendToL1(void *msg)
 {
    uint8_t ret = ROK;
 #ifdef INTEL_FAPI
-   uint16_t msgLen =0;
+   uint32_t msgLen =0;
    p_fapi_api_queue_elem_t currMsg = NULLP;
 
 #ifdef CALL_FLOW_DEBUG_LOG   
index abd9f4d..442d552 100644 (file)
  **/
 uint8_t SchProcCrcInd(Pst *pst, CrcIndInfo *crcInd)
 {
-   uint16_t count=0;
+   uint16_t crcCnt=0;
    uint8_t  ueId=0;
    SchUlHqProcCb *hqP = NULLP;
    Inst  schInst = pst->dstInst - SCH_INST_START;
    SchCellCb *cell = schCb[schInst].cells[schInst];
    
-   while(count  <crcInd->numCrcInd)
+   while(crcCnt < crcInd->numCrcInd)
    {
       GET_UE_ID(crcInd->crnti, ueId);
       if (cell->raCb[ueId-1].raState == SCH_RA_STATE_MSG3_PENDING)
       {
-         if (crcInd->crcInd[count])
+         if (crcInd->crcInd[crcCnt])
          {
             /* failure case*/
             if (cell->raCb[ueId-1].msg3HqProc.tbInfo.txCntr < cell->maxMsg3Tx)
@@ -81,21 +81,24 @@ uint8_t SchProcCrcInd(Pst *pst, CrcIndInfo *crcInd)
          if (cell->ueCb[ueId-1].hqUlmap[crcInd->timingInfo.slot]->hqList.count == 0)
          {
             DU_LOG("\n ERROR no harq stored in ul hq map at slot %d ue id %d\n",crcInd->timingInfo.slot, ueId);
+            crcCnt++;
             continue;
          }
          if (cell->ueCb[ueId-1].hqUlmap[crcInd->timingInfo.slot]->hqList.first == 0)
          {
             DU_LOG("\n ERROR NULL harq stored in ul hq map at slot %d ue id %d\n",crcInd->timingInfo.slot, ueId);
+            crcCnt++;
             continue;
          }
          hqP = (SchUlHqProcCb*) cell->ueCb[ueId-1].hqUlmap[crcInd->timingInfo.slot]->hqList.first->node;
          if(hqP == NULLP)
          {
+            crcCnt++;
             continue;
          }
          else
          {
-            if (crcInd->crcInd[count])
+            if (crcInd->crcInd[crcCnt])
             {             
                /* failure case*/
                schUlHqProcessNack(hqP);
@@ -108,7 +111,7 @@ uint8_t SchProcCrcInd(Pst *pst, CrcIndInfo *crcInd)
          }
          cmLListDelFrm(&(cell->ueCb[ueId-1].hqUlmap[crcInd->timingInfo.slot]->hqList), &hqP->ulSlotLnk);
       }
-      count++;
+      crcCnt++;
    }
    return ROK;
 }
index 28cc528..e949f3b 100644 (file)
@@ -1153,19 +1153,25 @@ void schFcfsScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst schInst)
    SchUlHqProcCb  *ulHqP = NULLP;
    CmLList        *pendingUeNode;
    CmLList        *node;
-   uint8_t        ueId;
+   uint8_t        ueId, ueCount = 0;
    bool           isRarPending = false, isRarScheduled = false;
    bool           isMsg4Pending = false, isMsg4Scheduled = false;
    bool           isDlMsgPending = false, isDlMsgScheduled = false;
    bool           isUlGrantPending = false, isUlGrantScheduled = false;
-   bool           isNodeFreed = false;
 
    fcfsCell = (SchFcfsCellCb *)cell->schSpcCell;
-   
+
    /* Select first UE in the linked list to be scheduled next */
    pendingUeNode = fcfsCell->ueToBeScheduled.first;
-   while(pendingUeNode)
+   ueCount = fcfsCell->ueToBeScheduled.count;
+
+   while(pendingUeNode && ueCount > 0)
    {
+      /*Since Multi-UE perTTI is not supported, re-init following parameters.*/
+      isRarPending = false; isRarScheduled = false;
+      isMsg4Pending = false; isMsg4Scheduled = false;
+      isDlMsgPending = false; isDlMsgScheduled = false;
+      isUlGrantPending = false; isUlGrantScheduled = false;
       if(pendingUeNode->node)
       {
          ueId = *(uint8_t *)(pendingUeNode->node);
@@ -1216,7 +1222,6 @@ void schFcfsScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst schInst)
             if(isRarScheduled || isMsg4Scheduled)
             {
                schFcfsRemoveUeFrmScheduleLst(cell, pendingUeNode);
-               isNodeFreed = true;
             }
             /* If RAR/MSG4 is pending but couldnt be scheduled then,
              * put this UE at the end of linked list to be scheduled later */
@@ -1310,34 +1315,32 @@ void schFcfsScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst schInst)
                }
             }
 
-            if(!isUlGrantPending && !isDlMsgPending)
-            {
-               /* No action required */  
-            }
-            else if((isUlGrantPending && !isUlGrantScheduled) || (isDlMsgPending && !isDlMsgScheduled))
+            if(isUlGrantPending || isDlMsgPending)
             {
-               cmLListAdd2Tail(&fcfsCell->ueToBeScheduled, cmLListDelFrm(&fcfsCell->ueToBeScheduled, pendingUeNode));
-            }
-            else
-            {
-               schFcfsRemoveUeFrmScheduleLst(cell, pendingUeNode);
-               isNodeFreed = true;
+               if((isUlGrantPending && !isUlGrantScheduled) || (isDlMsgPending && !isDlMsgScheduled))
+               {
+                  cmLListAdd2Tail(&fcfsCell->ueToBeScheduled, cmLListDelFrm(&fcfsCell->ueToBeScheduled, pendingUeNode));
+               }
+               else
+               {
+                  schFcfsRemoveUeFrmScheduleLst(cell, pendingUeNode);
+               }
             }
          }
       }
-      if(cell->schDlSlotInfo[slotInd->slot]->prbAlloc.numPrbAlloc >= MAX_NUM_RB)
+      if(!isUlGrantPending && !isDlMsgPending && !isRarPending && !isMsg4Pending)
       {
-        DU_LOG("\nINFO   -->  SCH: No PRB available to proceed with next UE");
-        return;     
+         DU_LOG("\nERROR  -->  SCH: In SchFcfsScheduleSlot, UE:%d is wrongly queued\
+               in Pending UE List without any actions, Removing the UE from the list",ueId);
+         schFcfsRemoveUeFrmScheduleLst(cell, pendingUeNode);
       }
-      if(isNodeFreed == false)
-      {
-         pendingUeNode= pendingUeNode->next;
-      }
-      else
+      if(cell->schDlSlotInfo[slotInd->slot]->prbAlloc.numPrbAlloc >= MAX_NUM_RB)
       {
-        pendingUeNode = fcfsCell->ueToBeScheduled.first;
+         DU_LOG("\nINFO   -->  SCH: No PRB available to proceed with next UE");
+         return;     
       }
+      pendingUeNode = fcfsCell->ueToBeScheduled.first;
+      ueCount--;
    }
 }
 
index 2e8378d..bc9b51c 100644 (file)
@@ -930,7 +930,7 @@ S16 l1HdlStartReq(uint32_t msgLen, void *msg)
  *
  * ****************************************************************/
 
-S16 l1HdlDlTtiReq(uint16_t msgLen, void *msg)
+S16 l1HdlDlTtiReq(uint32_t msgLen, void *msg)
 {
 #ifdef INTEL_FAPI
    p_fapi_api_queue_elem_t dlTtiElem = (p_fapi_api_queue_elem_t)msg;
@@ -989,7 +989,7 @@ S16 l1HdlDlTtiReq(uint16_t msgLen, void *msg)
  *
  * ****************************************************************/
 
-S16 l1HdlTxDataReq(uint16_t msgLen, void *msg)
+S16 l1HdlTxDataReq(uint32_t msgLen, void *msg)
 {
 #ifdef INTEL_FAPI
    p_fapi_api_queue_elem_t txDataElem = (p_fapi_api_queue_elem_t)msg;
@@ -1206,7 +1206,7 @@ uint8_t l1BuildAndSendUciInd(uint16_t slot, uint16_t sfn, fapi_ul_pucch_pdu_t pu
  *
  * ****************************************************************/
 
-S16 l1HdlUlTtiReq(uint16_t msgLen, void *msg)
+S16 l1HdlUlTtiReq(uint32_t msgLen, void *msg)
 {
 #ifdef INTEL_FAPI
    p_fapi_api_queue_elem_t ulTtiElem = (p_fapi_api_queue_elem_t)msg;
@@ -1502,7 +1502,7 @@ uint8_t l1BuildAndSendMsg5(uint16_t sfn, uint16_t slot)
  *
  * ****************************************************************/
 
-S16 l1HdlUlDciReq(uint16_t msgLen, void *msg)
+S16 l1HdlUlDciReq(uint32_t msgLen, void *msg)
 {
 #ifdef INTEL_FAPI
    p_fapi_api_queue_elem_t ulDciElem = (p_fapi_api_queue_elem_t)msg;