[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-423]Cleanup of hoUeCb[]
[o-du/l2.git] / src / 5gnrmac / mac_msg_hdl.c
index e59e9bb..16ade71 100644 (file)
@@ -186,14 +186,26 @@ uint8_t fapiMacCrcInd(Pst *pst, CrcInd *crcInd)
  * ****************************************************************/
 uint8_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd)
 {
-   uint16_t pduIdx;
+   uint8_t ueId = 0;
+   uint16_t pduIdx, cellIdx = 0;
    DU_LOG("\nDEBUG  -->  MAC : Received Rx Data indication");
    /* TODO : compare the handle received in RxDataInd with handle send in PUSCH
     * PDU, which is stored in raCb */
 
    for(pduIdx = 0; pduIdx < rxDataInd->numPdus; pduIdx++)
    {
-      unpackRxData(rxDataInd->cellId, rxDataInd->timingInfo, &rxDataInd->pdus[pduIdx]);
+     
+      GET_CELL_IDX(rxDataInd->cellId, cellIdx);
+      GET_UE_ID(rxDataInd->pdus[pduIdx].rnti, ueId);
+      
+      if(macCb.macCell[cellIdx] && macCb.macCell[cellIdx]->ueCb[ueId -1].transmissionAction == STOP_TRANSMISSION)
+      {
+         DU_LOG("\nINFO   -->  MAC : UL data transmission not allowed for UE %d", macCb.macCell[cellIdx]->ueCb[ueId -1].ueId);
+      }
+      else
+      {
+         unpackRxData(rxDataInd->cellId, rxDataInd->timingInfo, &rxDataInd->pdus[pduIdx]);
+      }
       MAC_FREE_SHRABL_BUF(pst->region, pst->pool, rxDataInd->pdus[pduIdx].pduData,\
          rxDataInd->pdus[pduIdx].pduLength);
    }
@@ -343,10 +355,11 @@ uint8_t lcId, uint16_t pduLen, uint8_t *pdu)
    ulData->slotInfo.cellId = cellId;
 
    /* Filling pdu info */
-   if(lcId == SRB1_LCID || lcId == SRB2_LCID)
-   {
+   if(lcId != SRB0_LCID)
+      ulData->pduInfo[ulData->numPdu].commCh = false;
+   else
       ulData->pduInfo[ulData->numPdu].commCh = true;
-   }
+
    ulData->pduInfo[ulData->numPdu].lcId = lcId;
    ulData->pduInfo[ulData->numPdu].pduBuf = pdu;
    ulData->pduInfo[ulData->numPdu].pduLen = pduLen;
@@ -771,10 +784,8 @@ uint8_t buildAndSendSrInd(UciInd *macUciInd, uint8_t crnti)
  * ****************************************************************/
 uint8_t FapiMacUciInd(Pst *pst, UciInd *macUciInd)
 {
-   uint8_t     pduIdx = 0;
-   uint8_t     ret = ROK;
-   uint16_t    nPdus;
-   uint16_t    crnti;
+   uint8_t     pduIdx = 0, ret = ROK;
+   uint16_t    nPdus = 0, crnti = 0;
 
    if(macUciInd)
    {
@@ -789,8 +800,8 @@ uint8_t FapiMacUciInd(Pst *pst, UciInd *macUciInd)
                if(macUciInd->pdus[pduIdx].uci.uciPucchF0F1.srInfo.srIndPres)
                {
                   DU_LOG("\nDEBUG  -->  MAC : Received SR UCI indication");
-                 crnti = macUciInd->pdus[pduIdx].uci.uciPucchF0F1.crnti; 
-                 ret = buildAndSendSrInd(macUciInd, crnti);
+                  crnti = macUciInd->pdus[pduIdx].uci.uciPucchF0F1.crnti; 
+                  ret = buildAndSendSrInd(macUciInd, crnti);
                }
                break;
             case UCI_IND_PUCCH_F2F3F4: