X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Frg_lmm.c;h=aa68fd5977e90a0001f226e01cd39deac3a95bd5;hb=719cc82cbb3d21edc03cccdae046f5a2d5f3d427;hp=8e0c398f4da5cd57b6529f61bc326ceeb2afc253;hpb=829bbd114f1c3dc00c1da47bca0a8207c049df3f;p=o-du%2Fl2.git diff --git a/src/5gnrmac/rg_lmm.c b/src/5gnrmac/rg_lmm.c index 8e0c398f4..aa68fd597 100755 --- a/src/5gnrmac/rg_lmm.c +++ b/src/5gnrmac/rg_lmm.c @@ -52,8 +52,9 @@ static int RLOG_MODULE_ID=4096; #include "crg.h" /* CRG Interface defines */ #include "rgu.h" /* RGU Interface defines */ #include "tfu.h" /* RGU Interface defines */ -#include "rg_sch_inf.h" /* RGR Interface defines */ +#include "rg_sch_inf.h" /* RGR Interface defines */ #include "lrg.h" /* LRG Interface defines */ +#include "rgr.h" /* LRG Interface defines */ #include "rg.h" /* MAC defines */ #include "rg_err.h" /* MAC error defines */ @@ -73,6 +74,8 @@ static int RLOG_MODULE_ID=4096; #include "rg_sch_inf.x" /* SCH Interface includes */ #include "rg_prg.x" /* PRG Interface includes */ #include "lrg.x" /* LRG Interface includes */ +#include "rgr.x" /* LRG Interface includes */ +#include "mac_interface.h" #include "rg.x" /* MAC includes */ #ifdef SS_DIAG #include "ss_diag.h" /* Common log file */ @@ -127,6 +130,15 @@ RgMngmt *cfm, Pst *cfmPst )); +extern U16 cmPackLcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm); +extern U16 cmPackLwlcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm); + +packMacCellCfgCfm packMacCellCfmMt[] = +{ + cmPackLcMacCellCfgCfm, /* packing for loosely coupled */ + duHandleMacCellCfgCfm, /* packing for tightly coupled */ + cmPackLwlcMacCellCfgCfm, /* packing for light weight loosly coupled */ +}; /** * @brief Task Initiation callback function. @@ -222,6 +234,9 @@ Reason reason; /* reason */ RETVALUE(RFAILED); } + /* Initialize Scheduler as well */ + schActvInit(ENTRG, (DEFAULT_CELLS + SCH_INST_START), DFLT_REGION, PWR_UP); + RETVALUE(ROK); } /* rgActvInit */ @@ -293,8 +308,6 @@ RgMngmt *cfg; /* config structure */ case STTFUSAP: reason = rgLMMSapCfg(inst,&cfg->t.cfg, cfg->hdr.elmId.elmnt); break; - case STCLCELL: - reason = RgClCellCfgReq(&cfg->t.cfg.s.cellCfg); default: ret = LCM_PRIM_NOK; reason = LCM_REASON_INVALID_ELMNT; @@ -1941,6 +1954,196 @@ Inst inst; } /* end of rgActvTmr */ +/** + * @brief Layer Manager Configuration request handler for Scheduler + * + * @details + * + * Function : MacSchGenCfgReq + * + * This function receives general configurations for Scheduler + * from DU APP and forwards to Scheduler. + * + * @param[in] Pst *pst, the post structure + * @param[in] RgMngmt *cfg, the configuration parameter's structure + * @return S16 + * -# ROK + **/ +#ifdef ANSI +PUBLIC S16 MacSchGenCfgReq +( +Pst *pst, /* post structure */ +RgMngmt *cfg /* config structure */ +) +#else +PUBLIC S16 MacSchGenCfgReq(pst, cfg) +Pst *pst; /* post structure */ +RgMngmt *cfg; /* config structure */ +#endif +{ + printf("\nReceived Scheduler gen config at MAC"); + pst->dstInst = DEFAULT_CELLS + 1; + HandleSchGenCfgReq(pst, cfg); + + return ROK; +} + +/** + * @brief Layer Manager Configuration response from Scheduler + * + * @details + * + * Function : SchSendCfgCfm + * + * This function sends general configurations response from + * Scheduler to DU APP. + * + * @param[in] Pst *pst, the post structure + * @param[in] RgMngmt *cfm, the configuration confirm structure + * @return S16 + * -# ROK + **/ +#ifdef ANSI +PUBLIC S16 SchSendCfgCfm +( +Pst *pst, /* post structure */ +RgMngmt *cfm /* config confirm structure */ +) +#else +PUBLIC S16 SchSendCfgCfm(pst, cfm) +Pst *pst; /* post structure */ +RgMngmt *cfm; /* config confirm structure */ +#endif +{ + printf("\nSending Scheduler config confirm to DU APP"); + RgMiLrgSchCfgCfm(pst, cfm); + + RETVALUE(ROK); +} + +/** + * @brief Layer Manager Configuration request handler. + * + * @details + * + * Function : MacSchCfgReq + * + * This function handles the gNB and cell configuration + * request received from DU APP. + * This API unapcks and forwards the config towards SCH + * + * @param[in] Pst *pst + * @param[in] RgrCfgTransId transId + * @param[in] RgrCfgReqInfo *cfgReqInfo + * @return S16 + * -# ROK + **/ +#ifdef ANSI +PUBLIC S16 MacSchCfgReq +( + Pst *pst, + RgrCfgTransId transId, + RgrCfgReqInfo *cfgReqInfo +) +#else +PUBLIC S16 MacSchCfgReq(pst, transId, cfgReqInfo) + Pst *pst; + RgrCfgTransId transId; + RgrCfgReqInfo *cfgReqInfo; +#endif +{ + printf("\nReceived Scheduler config at MAC"); + pst->dstInst = DEFAULT_CELLS + 1; + HandleSchCfgReq(pst, transId, cfgReqInfo); + + RETVALUE(ROK); + +} /* end of MacSchCfgReq*/ + + +/*********************************************************** + * + * Func : macCellCfgFillCfmPst + * + * + * Desc : Fills the Confirmation Post Structure cfmPst + * + * Ret : Void + * + * Notes: + * + * File : rg_lmm.c + * + **********************************************************/ +Void macCellCfgFillCfmPst +( +Pst *reqPst, +Pst *cfmPst +) +{ + Inst inst; + inst = reqPst->dstInst; + + cfmPst->srcEnt = rgCb[inst].rgInit.ent; + cfmPst->srcInst = rgCb[inst].rgInit.inst; + cfmPst->srcProcId = rgCb[inst].rgInit.procId; + + cfmPst->srcEnt = reqPst->dstEnt; + cfmPst->dstEnt = reqPst->srcEnt; + cfmPst->srcInst = reqPst->dstInst; + cfmPst->dstInst = reqPst->srcInst; + cfmPst->srcProcId = reqPst->dstProcId; + cfmPst->dstProcId = reqPst->srcProcId; + + cfmPst->selector = LRG_SEL_LC; + cfmPst->prior = reqPst->prior; + cfmPst->route = reqPst->route; + cfmPst->region = reqPst->region; + cfmPst->pool = reqPst->pool; + cfmPst->event = EVENT_MAC_CELL_CONFIG_CFM; + + RETVOID; +} + +/** + * @brief Layer Manager Configuration request handler. + * + * @details + * + * Function : handleMacCellCfgReq + * + * This function handles the gNB and cell configuration + * request received from DU APP. + * This API unapcks and forwards the config towards SCH + * + * @param[in] Pst *pst + * @param[in] MacCellCfg *macCellCfg + * @return S16 + * -# ROK + **/ +S16 handleMacCellCfgReq +( + Pst *pst, + MacCellCfg *macCellCfg +) +{ + U16 ret = ROK; + MacCellCfgCfm macCellCfgCfm; + RgCellCb *cellCb; + Pst cnfPst; + Inst inst = pst->dstInst; + + cellCb = rgCb[inst].cell; + memcpy(&cellCb->macCellCfg,macCellCfg,sizeof(MacCellCfg)); + + macCellCfgFillCfmPst(pst,&cnfPst); + + macCellCfgCfm.transId = macCellCfg->transId; + //ret = cmPackLcMacCellCfgCfm(&cnfPst,&macCellCfgCfm); + ret = (*packMacCellCfmMt[cnfPst.selector])(&cnfPst,&macCellCfgCfm); + return ret; +} /* end of handleMacCellCfgReq */ + /**********************************************************************