-
-/**
- * @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
- **/
-#ifdef ANSI
-PUBLIC S16 RgUiRguDDatReq
-(
-Pst *pst,
-SpId spId,
-RguDDatReqInfo *datReq
-)
-#else
-PUBLIC S16 RgUiRguDDatReq(pst, spId, datReq)
-Pst *pst;
-SpId spId;
-RguDDatReqInfo *datReq;
-#endif
-{
- S16 ret = ROK;
- Inst inst;
-#ifndef NO_ERRCLS
- U32 id;
- U32 id1;
- U32 id2;
- U32 id3;
-#endif
-
- TRC3(RgUiRguDDatReq)
-
-
- RG_IS_INST_VALID(pst->dstInst);
- inst = pst->dstInst - RG_INST_START;
-#ifndef NO_ERRCLS
- if (datReq == NULLP)
- {
- RLOG0(L_ERROR,"Input Message Buffer is NULL");
- RETVALUE(RFAILED);
- }
-
- if(rgCb[inst].rguSap[spId].sapCfg.spId == spId)
- {
- switch (rgCb[inst].rguSap[spId].sapSta.sapState)
- {
- case LRG_BND: /* SAP is bound */
- RLOG0(L_DEBUG,"SAP is already bound");
- break;
- default: /* Should never reach here */
-#if (ERRCLASS & ERRCLS_ADD_RES)
- RLOG1(L_ERROR,"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
- RETVALUE(RFAILED);
- }
- }
- else
- {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- RGLOGERROR(inst,ERRCLS_INT_PAR, ERG013, (ErrVal)spId,
- "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
- RETVALUE(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;
- RETVALUE(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
- **/
-#ifdef ANSI
-PUBLIC S16 RgUiRguCDatReq
-(
-Pst *pst,
-SpId spId,
-RguCDatReqInfo *datReq
-)
-#else
-PUBLIC S16 RgUiRguCDatReq(pst, spId, datReq)
-Pst *pst;
-SpId spId;
-RguCDatReqInfo *datReq;
-#endif
-{
- Inst inst;
- S16 ret = ROK;
-
- TRC3(RgUiRguCDatReq)
-
-
- RG_IS_INST_VALID(pst->dstInst);
- inst = pst->dstInst - RG_INST_START;
-#ifndef NO_ERRCLS
- if (datReq == NULLP)
- {
- RLOG0(L_ERROR,"Input Message Buffer is NULL");
- RETVALUE(RFAILED);
- }
-
- if(rgCb[inst].rguSap[spId].sapCfg.spId == spId)
- {
- switch (rgCb[inst].rguSap[spId].sapSta.sapState)
- {
- case LRG_BND: /* SAP is bound */
- RLOG0(L_DEBUG,"SAP is already bound");
- break;
- default: /* Should never reach here */
-#if (ERRCLASS & ERRCLS_ADD_RES)
- RLOG1(L_ERROR,"Invalid SAP State:%d RgUiRguCDatReq failed",
- rgCb[inst].rguSap[spId].sapSta.sapState);
-#endif
- RETVALUE(RFAILED);
- }
- }
- else
- {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- RLOG1(L_ERROR,"Invalid SAP Id:%d RgUiRguCDatReq failed ",spId);
-#endif
- RETVALUE(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;
- RETVALUE(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
- **/
-#ifdef ANSI
-PUBLIC S16 RgUiRguDStaRsp
-(
-Pst *pst,
-SpId spId,
-RguDStaRspInfo *staRsp
-)
-#else
-PUBLIC S16 RgUiRguDStaRsp(pst, spId, staRsp)
-Pst *pst;
-SpId spId;
-RguDStaRspInfo *staRsp;
-#endif
-{
- Inst inst;
-
- S16 ret = ROK;
- VOLATILE U32 startTime = 0;
-
- TRC3(RgUiRguDStaRsp)
-
- 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)
- {
- RLOG_ARG0(L_ERROR,DBG_CELLID,staRsp->cellId,
- "Processing Of Status Response Failed");
- }
-
-
- /*stoping Task*/
- SStopTask(startTime, PID_MAC_STA_RSP);
- RETVALUE(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
- **/
-#ifdef ANSI
-PUBLIC S16 RgUiRguCStaRsp
-(
-Pst *pst,
-SpId spId,
-RguCStaRspInfo *staRsp
-)
-#else
-PUBLIC S16 RgUiRguCStaRsp(pst, spId, staRsp)
-Pst *pst;
-SpId spId;
-RguCStaRspInfo *staRsp;
-#endif
-{
- Inst inst;
- S16 ret = ROK;
-
- TRC3(RgUiRguCStaRsp)
-
-
- RG_IS_INST_VALID(pst->dstInst);
- inst = pst->dstInst - RG_INST_START;
-#ifndef NO_ERRCLS
- if (staRsp == NULLP)
- {
- RLOG0(L_ERROR,"Input Response Buffer is NULL");
- RETVALUE(RFAILED);
- }
-
- if (spId == rgCb[inst].rguSap[spId].sapCfg.spId)
- {
- switch (rgCb[inst].rguSap[spId].sapSta.sapState)
- {
- case LRG_BND: /* SAP is bound */
- RLOG0(L_DEBUG,"SAP is already bound");
- break;
- default: /* Should never reach here */
-#if (ERRCLASS & ERRCLS_ADD_RES)
- RLOG1(L_ERROR,"Invalid SAP State:%d RgUiRguCStaRsp failed",
- rgCb[inst].rguSap[spId].sapSta.sapState);
-#endif
- RETVALUE(RFAILED);
- }
- }
- else
- {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- RLOG1(L_ERROR,"Invalid SAP Id:%d RgUiRguCStaRsp failed",spId);
-#endif
- RETVALUE(RFAILED);
- }
-#endif
-
- ret = rgROMCmnStaRsp(inst,staRsp);
- if (ret != ROK)
- {
- RLOG_ARG0(L_ERROR,DBG_CELLID,staRsp->cellId,"Processing Of Status Response Failed");
- RETVALUE(ret);
- }
-
- ret = SPutStaticBuffer(pst->region, pst->pool, (Data *)staRsp,sizeof(RguCStaRspInfo) , SS_SHARABLE_MEMORY);
- staRsp = NULLP;
- RETVALUE(ret);
-} /* RgUiRguCStaRsp */
-