-/**
- * @brief Handler to process PDU received from MAC
- *
- * @details
- * This function receives the PDU from MAC.
- * seggregates common and dedicated logical channel
- * PDU and call respective handler.
- *
- * @param[in] pst Post structure
- * @param[in] suId Service User ID
- * @param[in] datInd Data Indication Information
- *
- * @return S16
- * -# ROK
- * -# RFAILED
- *
-*/
-
-uint8_t RlcProcUlData(Pst *pst, RlcMacData *ulData)
-{
- U8 idx;
- U8 lcId; /* Logical Channel */
- U8 numDLch = 0; /* Number of dedicated logical channel */
- Bool dLchPduPres; /* PDU received on dedicated logical channel */
- RguLchDatInd dLchData[RGU_MAX_LC]; /* PDU info on dedicated logical channel */
- RguDDatIndInfo *dLchUlDat; /* UL data on dedicated logical channel */
- RguCDatIndInfo *cLchUlDat; /* UL data on common logical channel */
- uint16_t copyLen;
-
- /* Initializing dedicated logical channel Database */
- for(idx = 0; idx < RGU_MAX_LC; idx++)
- {
- dLchData[idx].lcId = idx;
- dLchData[idx].pdu.numPdu = 0;
- }
-
- dLchPduPres = FALSE;
-
- /* Seggregate PDUs received on common and dedicated channels
- * and call common channel's handler */
- for(idx = 0; idx< ulData->numPdu; idx++)
- {
- if(ulData->pduInfo[idx].commCh)
- {
- RLC_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, cLchUlDat, sizeof(RguCDatIndInfo));
- cmMemset((U8*)cLchUlDat, (U8)0, sizeof(RguCDatIndInfo));
-
- cLchUlDat->cellId = ulData->cellId;
- GET_UE_IDX(ulData->rnti, cLchUlDat->rnti);
- cLchUlDat->lcId = ulData->pduInfo[idx].lcId;
-
- /* Copy fixed buffer to message */
- if(SGetMsg(RLC_MEM_REGION_UL, RLC_POOL, &cLchUlDat->pdu) != ROK)
- {
- DU_LOG("\nRLC : Memory allocation failed at RlcProcUlData");
- return RFAILED;
- }
- reverseFixBuf(ulData->pduInfo[idx].pduBuf, ulData->pduInfo[idx].pduLen);
- SCpyFixMsg(ulData->pduInfo[idx].pduBuf, cLchUlDat->pdu, 0, \
- ulData->pduInfo[idx].pduLen, (MsgLen *)©Len);
-
- RlcLiRguCDatInd(pst, 0, cLchUlDat);
- }
- else
- {
- if(!dLchPduPres)
- {
- RLC_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, dLchUlDat, sizeof(RguDDatIndInfo));
- dLchPduPres = TRUE;
- }
-
- lcId = ulData->pduInfo[idx].lcId;
- dLchData[lcId].pdu.mBuf[dLchData[lcId].pdu.numPdu] = ulData->pduInfo[idx].pduBuf;
- dLchData[lcId].pdu.numPdu++;
- }
- }
-
- /* If any PDU received on dedicated logical channel, copy into RguDDatIndInfo
- * and call its handler */
- if(dLchPduPres)
- {
- dLchUlDat->cellId = ulData->cellId;
- dLchUlDat->rnti = ulData->rnti;
-
- for(idx = 0; idx < RGU_MAX_LC; idx++)
- {
- if(dLchData[idx].pdu.numPdu)
- {
- cmMemcpy((U8 *)&dLchUlDat->lchData[numDLch], (U8 *)&dLchData[idx], sizeof(RguLchDatInd));
- numDLch++;
- }
- }
- dLchUlDat->numLch = numDLch;
- RlcLiRguDDatInd(pst, 0, dLchUlDat);
- }
-
-
- RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ulData, sizeof(RlcMacData));
- return ROK;
-
-}/* End of RlcProcUlData */
-