X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Fmac_cfg_hdl.c;h=23c1bf77afeaf959b303c9d54741b6ba667a3247;hb=531da47c7bfb6ce138a454f66eb184729860beef;hp=5c0e85e666124833d40e04d0fad3d387310989d6;hpb=b7a8e8fc6abc7fba2f580684da44413d481be825;p=o-du%2Fl2.git diff --git a/src/5gnrmac/mac_cfg_hdl.c b/src/5gnrmac/mac_cfg_hdl.c index 5c0e85e66..23c1bf77a 100644 --- a/src/5gnrmac/mac_cfg_hdl.c +++ b/src/5gnrmac/mac_cfg_hdl.c @@ -42,20 +42,6 @@ packMacCellCfgConfirm packMacCellCfmOpts[] = packMacCellCfgCfm, /* packing for light weight loosly coupled */ }; -SchCellCfgFunc SchCellCfgOpts[] = -{ - packSchCellCfg, /* packing for loosely coupled */ - SchHdlCellCfgReq, /* packing for tightly coupled */ - packSchCellCfg /* packing for light weight loosly coupled */ -}; - -MacSchCellDeleteReqFunc macSchCellDeleteReqOpts[]= -{ - packMacSchCellDeleteReq, /* packing for loosely coupled */ - MacSchCellDeleteReq, /* packing for tightly coupled */ - packMacSchCellDeleteReq /* packing for light weight loosely coupled */ -}; - MacDuCellDeleteRspFunc macDuCellDeleteRspOpts[] = { packDuMacCellDeleteRsp, /* packing for loosely coupled */ @@ -77,13 +63,6 @@ MacDuSliceRecfgRspFunc macDuSliceRecfgRspOpts[] = packDuMacSliceRecfgRsp /* packing for light weight loosly coupled */ }; -MacSchPagingIndFunc macSchPagingIndOpts[] = -{ - packMacSchPagingInd, /* packing for loosely coupled */ - MacSchPagingInd, /* packing for tightly coupled */ - packMacSchPagingInd /* packing for light weight loosely coupled */ -}; - /** * @brief Layer Manager Configuration request handler for Scheduler * @@ -103,12 +82,11 @@ uint8_t MacSchGenCfgReq(Pst *pst, RgMngmt *cfg) { Pst schPst; - printf("\nReceived Scheduler gen config at MAC"); + DU_LOG("\nINFO --> MAC : Received Scheduler gen config at MAC"); memset(&schPst, 0, sizeof(Pst)); FILL_PST_MAC_TO_SCH(schPst, EVENT_SCH_GEN_CFG); - SchProcGenCfgReq(&schPst, cfg); - - return ROK; + + return(SchMessageRouter(&schPst, (void *)cfg)); } /** @@ -128,7 +106,7 @@ uint8_t MacSchGenCfgReq(Pst *pst, RgMngmt *cfg) **/ uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm) { - DU_LOG("\nDEBUG --> Sending Scheduler config confirm to DU APP"); + DU_LOG("\nDEBUG --> MAC : Sending Scheduler config confirm to DU APP"); pst->dstEnt = ENTDUAPP; pst->dstInst = 0; pst->srcInst = 0; @@ -252,7 +230,7 @@ uint8_t MacSchCellCfgReq(Pst *pst, MacCellCfg *macCellCfg) { SchCellCfg schCellCfg; Pst cfgPst; - uint8_t ssbMaskIdx = 0, rsrcListIdx = 0, ret=0, sliceIdx=0; + uint8_t ssbMaskIdx = 0, rsrcListIdx = 0, sliceIdx=0; memset(&cfgPst, 0, sizeof(Pst)); memset(&schCellCfg, 0, sizeof(SchCellCfg)); @@ -395,8 +373,7 @@ uint8_t MacSchCellCfgReq(Pst *pst, MacCellCfg *macCellCfg) FILL_PST_MAC_TO_SCH(cfgPst, EVENT_SCH_CELL_CFG); - ret = (*SchCellCfgOpts[cfgPst.selector])(&cfgPst, &schCellCfg); - return ret; + return(SchMessageRouter(&cfgPst, (void *)&schCellCfg)); } /* end of MacSchCellCfgReq */ @@ -644,7 +621,7 @@ uint8_t sendCellDelReqToSch(SchCellDeleteReq *schCellDelReq) { Pst schPst; FILL_PST_MAC_TO_SCH(schPst, EVENT_CELL_DELETE_REQ_TO_SCH); - return(*macSchCellDeleteReqOpts[schPst.selector])(&schPst, schCellDelReq); + return(SchMessageRouter(&schPst, (void *)schCellDelReq)); } /******************************************************************* @@ -735,24 +712,35 @@ uint8_t MacProcCellDeleteReq(Pst *pst, MacCellDeleteReq *cellDelete) **/ void freeMacSliceCfgReq(MacSliceCfgReq *cfgReq,Pst *pst) { - uint8_t cfgIdx = 0; - - if(cfgReq) - { - if(cfgReq->numOfConfiguredSlice) - { - for(cfgIdx = 0; cfgIdxnumOfConfiguredSlice; cfgIdx++) - { - if(cfgReq->listOfSliceCfg[cfgIdx]) - { - MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq->listOfSliceCfg[cfgIdx]->rrmPolicyRatio, sizeof(RrmPolicyRatio)); - } - MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq->listOfSliceCfg[cfgIdx], sizeof(MacSliceRrmPolicy)); - } - MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq->listOfSliceCfg, cfgReq->numOfConfiguredSlice * sizeof(MacSliceRrmPolicy*)); - } - MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq, sizeof(MacSliceCfgReq)); - } + uint8_t policyIdx = 0, memberListIdx=0; + + if(cfgReq->numOfRrmPolicy) + { + if(cfgReq->listOfRrmPolicy) + { + for(policyIdx = 0; policyIdxnumOfRrmPolicy; policyIdx++) + { + if(cfgReq->listOfRrmPolicy[policyIdx]) + { + if(cfgReq->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem) + { + if(cfgReq->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList) + { + for(memberListIdx = 0; memberListIdxlistOfRrmPolicy[policyIdx]->numOfRrmPolicyMem; memberListIdx++) + { + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx], sizeof(RrmPolicyMemberList)); + } + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList,\ + cfgReq->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem * sizeof(RrmPolicyMemberList*)); + } + } + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq->listOfRrmPolicy[policyIdx], sizeof(MacSliceRrmPolicy)); + } + } + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq->listOfRrmPolicy, cfgReq->numOfRrmPolicy * sizeof(MacSliceRrmPolicy*)); + } + } + } /** * @brief fill Mac Slice Config Rsp @@ -1027,7 +1015,7 @@ uint8_t MacProcDlPcchInd(Pst *pst, DlPcchInd *pcchInd) memcpy(schPageInd->pagePdu, pcchInd->pcchPdu, pcchInd->pduLen); FILL_PST_MAC_TO_SCH(schPst, EVENT_PAGING_IND_TO_SCH); - ret = (*macSchPagingIndOpts[schPst.selector])(&schPst, schPageInd); + ret = SchMessageRouter(&schPst, (void *)schPageInd); } } }