X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Frg_sch_lmm.c;fp=src%2F5gnrsch%2Frg_sch_lmm.c;h=34e10d0945d62f8308a3b1593227e35182ccc493;hb=5ea4c59cb4dd37164953218b0bd355284e11d22c;hp=b94a6f5264e8b281ac07cec84ad99f9085dc17a2;hpb=43f9a063a851c5318a609e9966cdc0b30f0abaf5;p=o-du%2Fl2.git diff --git a/src/5gnrsch/rg_sch_lmm.c b/src/5gnrsch/rg_sch_lmm.c index b94a6f526..34e10d094 100755 --- a/src/5gnrsch/rg_sch_lmm.c +++ b/src/5gnrsch/rg_sch_lmm.c @@ -117,76 +117,6 @@ PUBLIC void printSchCellInfo(void) } } - -/** - * @brief Task Initiation callback function. - * - * @details - * - * Function : schActvInit - * - * This function is supplied as one of parameters during MAC's - * task registration. SSI will invoke this function once, after - * it creates and attaches this TAPA Task to a system task. - * - * @param[in] Ent Entity, the entity ID of this task. - * @param[in] Inst Inst, the instance ID of this task. - * @param[in] Region Region, the region ID registered for memory - * usage of this task. - * @param[in] Reason Reason. - * @return S16 - * -# ROK - **/ -#ifdef ANSI -PUBLIC S16 schActvInit -( -Ent entity, /* entity */ -Inst instId, /* instance */ -Region region, /* region */ -Reason reason /* reason */ -) -#else -PUBLIC S16 schActvInit(entity, instId, region, reason) -Ent entity; /* entity */ -Inst instId; /* instance */ -Region region; /* region */ -Reason reason; /* reason */ -#endif -{ - Inst inst = (instId - SCH_INST_START); - - TRC2(schActvInit); - - /* Initialize the MAC TskInit structure to zero */ - cmMemset ((U8 *)&rgSchCb[inst], 0, sizeof(RgSchCb)); - - /* Initialize the MAC TskInit with received values */ - rgSchCb[inst].rgSchInit.ent = entity; - rgSchCb[inst].rgSchInit.inst = inst; - rgSchCb[inst].rgSchInit.region = region; - rgSchCb[inst].rgSchInit.pool = 0; - rgSchCb[inst].rgSchInit.reason = reason; - rgSchCb[inst].rgSchInit.cfgDone = FALSE; - rgSchCb[inst].rgSchInit.acnt = FALSE; - rgSchCb[inst].rgSchInit.usta = FALSE; - rgSchCb[inst].rgSchInit.trc = FALSE; -#ifdef DEBUGP -#ifdef RG_DEBUG - /* disabling debugs by default */ - /* rgSchCb[inst].rgSchInit.dbgMask = 0xffffffff; */ -#endif -#endif /* DEBUGP */ - rgSchCb[inst].rgSchInit.procId = SFndProcId(); - - rgSchCb[inst].rgrSap = NULLP; - rgSchCb[inst].tfuSap = NULLP; - rgSchCb[inst].rgmSap = NULLP; - rgSCHCmnInit(); - - RETVALUE(ROK); -} /* schActvInit */ - - /** * @brief SAP Configuration Handler. * @@ -346,166 +276,6 @@ Elmnt sapType; /* SAP Type */ } RETVALUE(ret); } - - -/** - * @brief Scheduler instance Configuration Handler. - * - * @details - * - * Function : SchInstCfg - * - * This function in called by HandleSchGenCfgReq(). It handles the - * general and SAP configurations of the scheduler instance. It initializes - * the hash lists of rgSchCb. Returns - * reason for success/failure of this function. - * - * @param[in] RgCfg *cfg, the Configuaration information - * @return U16 - * -# LCM_REASON_NOT_APPL - * -# LCM_REASON_INVALID_MSGTYPE - * -# LCM_REASON_MEM_NOAVAIL - **/ -#ifdef ANSI -PUBLIC U16 SchInstCfg -( -RgCfg *cfg, /* Configuaration information */ -Inst dInst -) -#else -PUBLIC U16 SchInstCfg(cfg,dInst) -RgCfg *cfg; /* Configuaration information */ -Inst dInst; -#endif -{ - U16 ret = LCM_REASON_NOT_APPL; - Inst inst = (dInst - SCH_INST_START); - - TRC2(SchInstCfg) - - printf("\nEntered SchInstCfg()"); - /* Check if Instance Configuration is done already */ - if (rgSchCb[inst].rgSchInit.cfgDone == TRUE) - { - RETVALUE(LCM_REASON_INVALID_MSGTYPE); - } - if ((cfg->s.schInstCfg.genCfg.lmPst.selector != LRG_SEL_TC) && - (cfg->s.schInstCfg.genCfg.lmPst.selector != LRG_SEL_LC)) - { - RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg(): unsupported " - "Selector value for lmPst."); - RETVALUE(LCM_REASON_INVALID_PAR_VAL); - } - /* Update the Pst structure for LM interface */ - cmMemcpy((U8 *)&rgSchCb[inst].rgSchInit.lmPst, - (U8 *)&cfg->s.schInstCfg.genCfg.lmPst, - sizeof(Pst)); - - rgSchCb[inst].rgSchInit.inst = inst; - rgSchCb[inst].rgSchInit.lmPst.srcProcId = rgSchCb[inst].rgSchInit.procId; - rgSchCb[inst].rgSchInit.lmPst.srcEnt = rgSchCb[inst].rgSchInit.ent; - rgSchCb[inst].rgSchInit.lmPst.srcInst = rgSchCb[inst].rgSchInit.inst + - SCH_INST_START; - rgSchCb[inst].rgSchInit.lmPst.event = EVTNONE; - - rgSchCb[inst].rgSchInit.region = cfg->s.schInstCfg.genCfg.mem.region; - rgSchCb[inst].rgSchInit.pool = cfg->s.schInstCfg.genCfg.mem.pool; - rgSchCb[inst].genCfg.tmrRes = cfg->s.schInstCfg.genCfg.tmrRes; -#ifdef LTE_ADV - rgSchCb[inst].genCfg.forceCntrlSrbBoOnPCel = cfg->s.schInstCfg.genCfg.forceCntrlSrbBoOnPCel; - rgSchCb[inst].genCfg.isSCellActDeactAlgoEnable = cfg->s.schInstCfg.genCfg.isSCellActDeactAlgoEnable; -#endif - rgSchCb[inst].genCfg.startCellId = cfg->s.schInstCfg.genCfg.startCellId; - -/* Not adding any SAPs towards SCH now */ -#if 0 - /* allocate RGR saps */ - if (SGetSBuf(rgSchCb[inst].rgSchInit.region, - rgSchCb[inst].rgSchInit.pool, - (Data **)&rgSchCb[inst].rgrSap, - (sizeof(RgSchUpSapCb) * cfg->s.schInstCfg.numSaps)) != ROK) - { - RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg: SGetSBuf for " - "RGR saps failed"); - RETVALUE(RFAILED); - } - /* allocate RGM saps */ - if (SGetSBuf(rgSchCb[inst].rgSchInit.region, - rgSchCb[inst].rgSchInit.pool, - (Data **)&rgSchCb[inst].rgmSap, - (sizeof(RgSchUpSapCb) * cfg->s.schInstCfg.numSaps)) != ROK) - { - RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg: SGetSBuf for " - "RGM saps failed"); - RETVALUE(RFAILED); - } - - - /* allocate TFU saps */ - if (SGetSBuf(rgSchCb[inst].rgSchInit.region, - rgSchCb[inst].rgSchInit.pool, - (Data **)&rgSchCb[inst].tfuSap, - (sizeof(RgSchLowSapCb) * cfg->s.schInstCfg.numSaps)) != ROK) - { - RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg: SGetSBuf for TFU " - "saps failed"); - RETVALUE(RFAILED); - } - - /* allocate for bndCfmResponses */ - if (SGetSBuf(rgSchCb[inst].rgSchInit.region, - rgSchCb[inst].rgSchInit.pool, - (Data **)&rgSchCb[inst].genCfg.bndCfmResp, - (sizeof(RgSchLmResponse) * cfg->s.schInstCfg.numSaps)) != ROK) - { - RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg: SGetSBuf for bind" - " confirm responses failed"); - RETVALUE(RFAILED); - } -#ifdef LTE_ADV - rgSCHLaaInitEnbCb(&rgSchCb[inst]); -#endif - rgSchCb[inst].numSaps = cfg->s.schInstCfg.numSaps; - for (idx = 0; idx < cfg->s.schInstCfg.numSaps; idx++) - { - /* Initialize SAP State and configure SAP */ - rgSchCb[inst].rgrSap[idx].sapSta.sapState = LRG_NOT_CFG; - rgSchCb[inst].rgrSap[idx].cell = NULLP; - rgSCHLmmSapCfg(dInst, cfg, idx, STRGRSAP); - - rgSchCb[inst].rgmSap[idx].sapSta.sapState = LRG_NOT_CFG; - rgSchCb[inst].rgmSap[idx].cell = NULLP; - rgSCHLmmSapCfg(dInst, cfg, idx, STRGMSAP); - - rgSchCb[inst].tfuSap[idx].sapSta.sapState = LRG_NOT_CFG; - rgSchCb[inst].tfuSap[idx].cell = NULLP; - rgSCHLmmSapCfg(dInst, cfg, idx, STTFUSAP); - rgSchCb[inst].tfuSap[idx].numBndRetries = 0; - } -#endif - /* Initialzie the timer queue */ - cmMemset((U8 *)&rgSchCb[inst].tmrTq, 0, sizeof(CmTqType)*RGSCH_TQ_SIZE); - /* Initialize the timer control point */ - cmMemset((U8 *)&rgSchCb[inst].tmrTqCp, 0, sizeof(CmTqCp)); - rgSchCb[inst].tmrTqCp.tmrLen = RGSCH_TQ_SIZE; - - /* SS_MT_TMR needs to be enabled as schActvTmr needs instance information */ - /* Timer Registration request to SSI */ - if (SRegTmrMt(rgSchCb[inst].rgSchInit.ent, dInst, - (S16)rgSchCb[inst].genCfg.tmrRes, schActvTmr) != ROK) - { - RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg(): Failed to " - "register timer."); - RETVALUE(LCM_REASON_MEM_NOAVAIL); - } - - /* Set Config done in TskInit */ - rgSchCb[inst].rgSchInit.cfgDone = TRUE; - printf("\nScheduler gen config done"); - - RETVALUE(ret); -} - /*********************************************************** * @@ -1026,16 +796,14 @@ RgMngmt *cfm; inst = (reqPst->dstInst - SCH_INST_START); - cfmPst->srcEnt = rgSchCb[inst].rgSchInit.ent; - cfmPst->srcInst = (Inst) 0; + cfmPst->srcEnt = ENTRG; + cfmPst->srcInst = (Inst) 1; cfmPst->srcProcId = rgSchCb[inst].rgSchInit.procId; - cfmPst->dstEnt = reqPst->srcEnt; + cfmPst->dstEnt = ENTRG; cfmPst->dstInst = (Inst) 0; cfmPst->dstProcId = reqPst->srcProcId; cfmPst->selector = cfm->hdr.response.selector; - cfmPst->prior = cfm->hdr.response.prior; - cfmPst->route = cfm->hdr.response.route; cfmPst->region = cfm->hdr.response.mem.region; cfmPst->pool = cfm->hdr.response.mem.pool;