X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Frg_uim.c;h=9dccc593b29556048e54c7f11a0cd98188c77576;hb=dfe84998d9dba8389ee232aa184bc3b5ae383db3;hp=f0214293773be6288e25c7c6128d40dc256a1cee;hpb=87c35884595a3166121854c3ae6e6e856f004ff4;p=o-du%2Fl2.git diff --git a/src/5gnrmac/rg_uim.c b/src/5gnrmac/rg_uim.c index f02142937..9dccc593b 100755 --- a/src/5gnrmac/rg_uim.c +++ b/src/5gnrmac/rg_uim.c @@ -71,9 +71,6 @@ manages Pst and Sap related information for upper interface APIs. /* forward references */ -#if defined(SPLIT_RLC_DL_TASK) && defined(RLC_MAC_STA_RSP_RBUF) -S16 rgBatchProc(Void); -#endif uint8_t rgRguDlSap; uint8_t rgRguUlSap; /** @@ -260,310 +257,6 @@ S16 rgUIMRguBndCfm(Inst inst,SpId spId,uint8_t status) return (ret); } /* rgUIMRguBndCfm*/ - -/** - * @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); - MAC_FREE_SHRABL_BUF(pst->region, pst->pool, datReq,sizeof(RguDDatReqInfo)); - 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); - } - MAC_FREE_SHRABL_BUF(pst->region, pst->pool,datReq,sizeof(RguCDatReqInfo)); - 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); - } - - MAC_FREE_SHRABL_BUF(pst->region, pst->pool, staRsp,sizeof(RguCStaRspInfo)); - return (ret); -} /* RgUiRguCStaRsp */ - #ifdef LTE_L2_MEAS /** @@ -974,94 +667,6 @@ S16 rgUIMCrgBndCfm(Inst inst,SuId suId,uint8_t status) return ROK; } /* rgUIMCrgBndCfm*/ -/** - * @brief API for configuration request from RRC towards MAC. - * - * @details - * - * Function: RgUiCrgCfgReq - * - * This API is invoked by RRC towards MAC to configure MAC. - * These API validates the Pst, spId, suId and transfers the config request - * specific information to corresponding ownership module (COM) API. - * - * - * @param[in] Pst *pst - * @param[in] SpId spId - * @param[in] CrgCfgTransId transId - * @param[in] CrgCfgReqInfo *cfgReqInfo - * @return S16 - * -# ROK - * -# RFAILED - **/ -S16 RgUiCrgCfgReq -( -Pst *pst, -SpId spId, -CrgCfgTransId transId, -CrgCfgReqInfo *cfgReqInfo -) -{ - Inst inst; - S16 ret = ROK; - uint8_t cfmStatus = 0x00ff; - uint8_t prntTrans[CRG_CFG_TRANSID_SIZE+1]; - - RG_IS_INST_VALID(pst->dstInst); - inst = pst->dstInst - RG_INST_START; - /* Ensuring transId is always Null terminated. */ - memcpy(prntTrans, transId.trans, CRG_CFG_TRANSID_SIZE); - prntTrans[CRG_CFG_TRANSID_SIZE] = '\0'; - - - /* CrgCfgReqInfo Validation for NULLP */ - if (cfgReqInfo == NULLP) - { - DU_LOG("\nERROR --> MAC : Input Param crgReqInfo is NULL "); - rgUIMCrgCfgCfm(inst,transId, cfmStatus); - return RFAILED; - } - - /* Upper SAP Id and State validation */ - if (spId == rgCb[inst].crgSap.sapCfg.spId) - { - switch(rgCb[inst].crgSap.sapSta.sapState) - { - case LRG_BND: /* SAP is already 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 RgUiCrgCfgReq failed", - rgCb[inst].crgSap.sapSta.sapState); -#endif - MAC_FREE(cfgReqInfo, sizeof(CrgCfgReqInfo)); - - rgUIMCrgCfgCfm(inst,transId, cfmStatus); - return RFAILED; - } - } - else - { -#if (ERRCLASS & ERRCLS_ADD_RES) - DU_LOG("\nERROR --> MAC : Invalid SAP Id:%d RgUiCrgCfgReq failed", - rgCb[inst].crgSap.sapCfg.spId); -#endif - MAC_FREE(cfgReqInfo, sizeof(CrgCfgReqInfo)); - rgUIMCrgCfgCfm(inst,transId, cfmStatus); - return RFAILED; - } - ret = rgCOMCfgReq(inst,transId, cfgReqInfo); - MAC_FREE(cfgReqInfo, sizeof(CrgCfgReqInfo)); - if (ret != ROK) - { - DU_LOG("\nERROR --> MAC : Configuration Request Handling Failed "); - return RFAILED; - } - - return ROK; -} /* RgUiCrgCfgReq */ - /** * @brief API for sending configuration confirm from MAC to RRC * @@ -1103,51 +708,6 @@ uint8_t status return (ret); } /* rgUIMCrgCfgCfm */ -#if defined(SPLIT_RLC_DL_TASK) && defined(RLC_MAC_STA_RSP_RBUF) - -S16 rgBatchProc(Void) -{ -/* Read from Ring Buffer and process RLC BO Update */ - Pst pst = {0}; - SpId spId = 0; - RguDStaRspInfo *staRsp; - uint32_t elmIndx = 0; -#ifndef LTE_ADV -/* Fill pst */ - pst.srcProcId = 1; - pst.dstProcId = 1; - pst.dstEnt = ENTMAC; - pst.dstInst = 0; - pst.srcEnt = ENTRLC; - pst.srcInst = 1; - pst.prior = PRIOR0; - pst.route = RTESPEC; - pst.event = EVTRGUDSTARSP; - pst.region = 0; - pst.pool = 0; - pst.selector = 2; /*SM_SELECTOR_LC */ -#else -#endif - - elmIndx = (uint32_t)SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC); - while(NULLP != elmIndx) - { - staRsp = (RguDStaRspInfo *)elmIndx; -#ifdef LTE_ADV - pst = staRsp->post; -#endif - RgUiRguDStaRsp(&pst, spId, staRsp); - - elmIndx = NULLP; - staRsp = NULLP; - SRngIncrRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC); - - if((elmIndx = (uint32_t)SRngGetRIndx(SS_RNG_BUF_DLRLC_TO_DLMAC)) == NULLP) - break; - } - return ROK; -} -#endif /**********************************************************************