-
-/**
- * @brief Handler for dedicated DatReq from RGU
- *
- * @details
- *
- * Function : RgUiRguDDatReq
- *
- * This function validates SAP and invokes ROM for further processing
- *
- * @param[in] Pst *pst
- * @param[in] SpId spId
- * @param[in] RguDDatReqInfo *datReq
- * @return S16
- * -# ROK
- * -# RFAILED
- **/
-S16 RgUiRguDDatReq(Pst *pst,SpId spId,RguDDatReqInfo *datReq)
-{
- S16 ret = ROK;
- Inst inst;
-#ifndef NO_ERRCLS
- uint32_t id;
- uint32_t id1;
- uint32_t id2;
- uint32_t id3;
-#endif
-
- RG_IS_INST_VALID(pst->dstInst);
- inst = pst->dstInst - RG_INST_START;
-#ifndef NO_ERRCLS
- if (datReq == NULLP)
- {
- DU_LOG("\nERROR --> MAC : Input Message Buffer is NULL");
- return RFAILED;
- }
-
- if(rgCb[inst].rguSap[spId].sapCfg.spId == spId)
- {
- switch (rgCb[inst].rguSap[spId].sapSta.sapState)
- {
- case LRG_BND: /* SAP is bound */
- DU_LOG("\nDEBUG --> MAC : SAP is already bound");
- break;
- default: /* Should never reach here */
-#if (ERRCLASS & ERRCLS_ADD_RES)
- DU_LOG("\nERROR --> MAC : Invalid SAP State:%d RgUiRguDDatReq failed",
- rgCb[inst].rguSap[spId].sapSta.sapState);
-#endif
-#ifndef L2_OPTMZ
- for(id3 = 0; id3 < datReq->nmbOfUeGrantPerTti; id3++)
- {
- RG_DROP_RGUDDATREQ_MBUF(datReq->datReq[id3]);
- }
-#endif
- return RFAILED;
- }
- }
- else
- {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- DU_LOG("\nERROR --> MAC : Invalid SAP Id:RgUiRguDDatReq failed\n");
-#endif
-#ifndef L2_OPTMZ
- for(id3 = 0; id3 < datReq->nmbOfUeGrantPerTti; id3++)
- {
- RG_DROP_RGUDDATREQ_MBUF(datReq->datReq[id3]);
- }
-#endif
- return RFAILED;
- }
-
- /* Update RGU SAP statistics for received sdu count */
- /*ccpu00118201 - ADD - Send trace only when its enabled*/
- if(rgCb[inst].rgInit.trc)
- {
- for(id3 = 0; id3 < datReq->nmbOfUeGrantPerTti; id3++)
- {
- RguDDatReqPerUe *datReqPerUe = &datReq->datReq[id3];
- for (id = 0; id < datReqPerUe->nmbOfTbs; id++)
- {
- for (id1 = 0; id1 < datReqPerUe->datReqTb[id].nmbLch; id1++)
- {
- /* rgCb.rguSap.sapSts.numPduRcvd is updated by
- * rgROMDedDatReq -> rgUpdtRguDedSts function
- * So numPduRcvd updation is commented here */
- /* rgCb.rguSap.sapSts.numPduRcvd +=
- datReq->datReqTb[id].lchData[id1].pdu.numPdu; */
- for (id2 = 0; id2 < datReqPerUe->datReqTb[id].lchData[id1].pdu.numPdu; id2++)
- {
- RG_SEND_TRC_IND(inst,datReqPerUe->datReqTb[id].
- lchData[id1].pdu.mBuf[id2], EVTRGUDDATREQ);
- }
- }
- }
- }
- }
-#endif
-
- /* Call Ownership module for further processing */
- ret = rgROMDedDatReq(inst,datReq);
- SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq,sizeof(RguDDatReqInfo), SS_SHARABLE_MEMORY);
- datReq = NULLP;
- return (ret);
-} /* RgUiRguDDatReq */
-
-
-/**
- * @brief Handler for common DatReq from RGU
- *
- * @details
- *
- * Function : RgUiRguCDatReq
- *
- * This function validates SAP invokes ROM for further processing
- *
- * @param[in] Pst *pst
- * @param[in] SpId spId
- * @param[in] RguCDatReqInfo *datReq
- * @return S16
- * -# ROK
- * -# RFAILED
- **/
-S16 RgUiRguCDatReq
-(
-Pst *pst,
-SpId spId,
-RguCDatReqInfo *datReq
-)
-{
- Inst inst;
- S16 ret = ROK;
-
- RG_IS_INST_VALID(pst->dstInst);
- inst = pst->dstInst - RG_INST_START;
-#ifndef NO_ERRCLS
- if (datReq == NULLP)
- {
- DU_LOG("\nERROR --> MAC : Input Message Buffer is NULL");
- return RFAILED;
- }
-
- if(rgCb[inst].rguSap[spId].sapCfg.spId == spId)
- {
- switch (rgCb[inst].rguSap[spId].sapSta.sapState)
- {
- case LRG_BND: /* SAP is bound */
- DU_LOG("\nERROR --> MAC : SAP is already bound");
- break;
- default: /* Should never reach here */
-#if (ERRCLASS & ERRCLS_ADD_RES)
- DU_LOG("\nERROR --> MAC : Invalid SAP State:%d RgUiRguCDatReq failed",
- rgCb[inst].rguSap[spId].sapSta.sapState);
-#endif
- return RFAILED;
- }
- }
- else
- {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- DU_LOG("\nERROR --> MAC : Invalid SAP Id:%d RgUiRguCDatReq failed ",spId);
-#endif
- return RFAILED;
- }
-#endif
-
- /* Update RGU SAP statistics for received sdu count */
- /* rgCb.rguSap.sapSts.numPduRcvd is updated by
- * rgROMCmnDatReq ->rgUpdtRguCmnSts function
- * So numPduRcvd updation is commented here */
- /* rgCb.rguSap.sapSts.numPduRcvd++; */
-
- ret = rgROMCmnDatReq(inst,datReq);
- /*ccpu00118201 - ADD - Send trace only when its enabled*/
- if(rgCb[inst].rgInit.trc)
- {
- RG_SEND_TRC_IND(inst,datReq->pdu, EVTRGUCDATREQ);
- }
- if (ret == RFAILED)
- {
- RG_DROP_RGUCDATREQ_MBUF(datReq);
- }
- ret = SPutStaticBuffer(pst->region, pst->pool,(Data *)datReq,sizeof(RguCDatReqInfo) , SS_SHARABLE_MEMORY);
- datReq = NULLP;
- return (ret);
-} /* RgUiRguCDatReq */
-
-
-/**
- * @brief Handler for dedicated StaRsp from RGU
- *
- * @details
- *
- * Function : RgUiRguDStaRsp
- *
- * This function validates SAP and invokes ROM for further processing
- *
- * @param[in] Pst *pst
- * @param[in] SpId spId
- * @param[in] RguDStaRspInfo *staRsp
- * @return S16
- * -# ROK
- * -# RFAILED
- **/
-S16 RgUiRguDStaRsp
-(
-Pst *pst,
-SpId spId,
-RguDStaRspInfo *staRsp
-)
-{
- Inst inst;
- S16 ret = ROK;
- volatile uint32_t startTime = 0;
-
-
- RG_IS_INST_VALID(pst->dstInst);
- inst = pst->dstInst - RG_INST_START;
- /*starting Task*/
- SStartTask(&startTime, PID_MAC_STA_RSP);
-
- ret = rgROMDedStaRsp(inst,staRsp);
- if (ret != ROK)
- {
- DU_LOG("\nERROR --> MAC : Processing Of Status Response Failed");
- }
-
-
- /*stoping Task*/
- SStopTask(startTime, PID_MAC_STA_RSP);
- return (ret);
-} /* RgUiRguDStaRsp */
-
-
-/**
- * @brief Handler for common StaRsp from RGU
- *
- * @details
- *
- * Function : RgUiRguCStaRsp
- *
- * This function validates SAP and invokes ROM
- * for further processing
- *
- *
- * @param[in] Pst *pst
- * @param[in] SpId spId
- * @param[in] RguCStaRspInfo *staRsp
- * @return S16
- * -# ROK
- * -# RFAILED
- **/
-S16 RgUiRguCStaRsp
-(
-Pst *pst,
-SpId spId,
-RguCStaRspInfo *staRsp
-)
-{
- Inst inst;
- S16 ret = ROK;
-
- RG_IS_INST_VALID(pst->dstInst);
- inst = pst->dstInst - RG_INST_START;
-#ifndef NO_ERRCLS
- if (staRsp == NULLP)
- {
- DU_LOG("\nERROR --> MAC : Input Response Buffer is NULL");
- return RFAILED;
- }
-
- if (spId == rgCb[inst].rguSap[spId].sapCfg.spId)
- {
- switch (rgCb[inst].rguSap[spId].sapSta.sapState)
- {
- case LRG_BND: /* SAP is bound */
- DU_LOG("\nDEBUG --> MAC : SAP is already bound");
- break;
- default: /* Should never reach here */
-#if (ERRCLASS & ERRCLS_ADD_RES)
- DU_LOG("\nERROR --> MAC : Invalid SAP State:%d RgUiRguCStaRsp failed",
- rgCb[inst].rguSap[spId].sapSta.sapState);
-#endif
- return RFAILED;
- }
- }
- else
- {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- DU_LOG("\nERROR --> MAC : Invalid SAP Id:%d RgUiRguCStaRsp failed",spId);
-#endif
- return RFAILED;
- }
-#endif
-
- ret = rgROMCmnStaRsp(inst,staRsp);
- if (ret != ROK)
- {
- DU_LOG("\nERROR --> MAC : Processing Of Status Response Failed");
- return (ret);
- }
-
- ret = SPutStaticBuffer(pst->region, pst->pool, (Data *)staRsp,sizeof(RguCStaRspInfo) , SS_SHARABLE_MEMORY);
- staRsp = NULLP;
- return (ret);
-} /* RgUiRguCStaRsp */
-