X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Frg_lmm.c;h=19bfcf04b90a594824957d1c6f8fec06f34477be;hb=d2d9dcbd92e8f1be15dd5891aaf9ada9bc071e1a;hp=7683a6d6bb08a226e8cf609b136359339475e7a3;hpb=f15bab416a36e421d42be3d2d1a42bf4c8c8b6c2;p=o-du%2Fl2.git diff --git a/src/5gnrmac/rg_lmm.c b/src/5gnrmac/rg_lmm.c index 7683a6d6b..19bfcf04b 100755 --- a/src/5gnrmac/rg_lmm.c +++ b/src/5gnrmac/rg_lmm.c @@ -96,6 +96,7 @@ EXTERN Void rgGetSId ARGS((SystemId *s)); /* Public variable declaration */ ClCb clGlobalCp; +MacCb macCb; /* forward references */ PRIVATE U16 rgLMMGenCfg ARGS(( @@ -936,6 +937,9 @@ RgCfg *cfg; /* Configuaration information */ rgCb[inst].rgInit.region = cfg->s.genCfg.mem.region; rgCb[inst].rgInit.pool = cfg->s.genCfg.mem.pool; rgCb[inst].genCfg.tmrRes = cfg->s.genCfg.tmrRes; + + macCb.macInst = rgCb[inst].rgInit.inst; + /* Initialize SAP States */ rgCb[inst].crgSap.sapSta.sapState = LRG_NOT_CFG; @@ -2124,6 +2128,7 @@ int MacHdlCellCfgReq return RFAILED; } macCb.macCell = macCellCb; + macCb.macCell->cellId = macCellCfg->cellId; /* Send cell cfg to scheduler */ ret = MacSchCellCfgReq(pst, macCellCfg); if(ret != ROK) @@ -2166,15 +2171,26 @@ int MacSchCellCfgReq schCellCfg.phyCellId = macCellCfg->phyCellId; schCellCfg.bandwidth = macCellCfg->dlCarrCfg.bw; schCellCfg.dupMode = macCellCfg->dupType; - schCellCfg.ssbPbchPwr = macCellCfg->ssbCfg.ssbPbchPwr; - schCellCfg.scsCommon = macCellCfg->ssbCfg.scsCmn; - schCellCfg.ssbOffsetPointA = macCellCfg->ssbCfg.ssbOffsetPointA; - schCellCfg.ssbPeriod = macCellCfg->ssbCfg.ssbPeriod; - schCellCfg.ssbSubcOffset = macCellCfg->ssbCfg.ssbScOffset; + + /* fill ssb scheduler parameters */ + schCellCfg.ssbSchCfg.ssbPbchPwr = macCellCfg->ssbCfg.ssbPbchPwr; + schCellCfg.ssbSchCfg.scsCommon = macCellCfg->ssbCfg.scsCmn; + schCellCfg.ssbSchCfg.ssbOffsetPointA = macCellCfg->ssbCfg.ssbOffsetPointA; + schCellCfg.ssbSchCfg.ssbPeriod = macCellCfg->ssbCfg.ssbPeriod; + schCellCfg.ssbSchCfg.ssbSubcOffset = macCellCfg->ssbCfg.ssbScOffset; for(uint8_t idx=0; idxssbCfg.ssbMask[idx]; + schCellCfg.ssbSchCfg.nSSBMask[idx] = macCellCfg->ssbCfg.ssbMask[idx]; } + + /* fill SIB1 scheduler parameters */ + schCellCfg.sib1SchCfg.sib1PduLen = macCellCfg->sib1Cfg.sib1PduLen; + schCellCfg.sib1SchCfg.sib1NewTxPeriod = macCellCfg->sib1Cfg.sib1NewTxPeriod; + schCellCfg.sib1SchCfg.sib1RepetitionPeriod = macCellCfg->sib1Cfg.sib1RepetitionPeriod; + schCellCfg.sib1SchCfg.coresetZeroIndex = macCellCfg->sib1Cfg.coresetZeroIndex; + schCellCfg.sib1SchCfg.searchSpaceZeroIndex = macCellCfg->sib1Cfg.searchSpaceZeroIndex; + schCellCfg.sib1SchCfg.sib1Mcs = macCellCfg->sib1Cfg.sib1Mcs; + cfgPst.srcProcId = pst->dstProcId; cfgPst.dstProcId = pst->srcProcId; cfgPst.srcEnt = ENTRG; @@ -2188,6 +2204,40 @@ int MacSchCellCfgReq return ret; } /* end of MacSchCellCfgReq */ + +/******************************************************************* + * + * @brief Sends Cell config confirm to DU APP + * + * @details + * + * Function : MacSendCellCfgCfm + * + * Functionality: + * Sends Cell config confirm to DU APP + * + * @params[in] Response status + * @return void + * + * ****************************************************************/ +void MacSendCellCfgCfm(uint8_t response) +{ + Pst pst; + RgCellCb *cellCb; + MacCellCfgCfm macCellCfgCfm; + + cmMemset((U8 *)&pst, 0, sizeof(Pst)); + cellCb = rgCb[macCb.macInst].cell; + + macCellCfgCfm.transId = cellCb->macCellCfg.transId; + macCellCfgCfm.rsp = response; + + memcpy((void *)&pst, (void *)&rgCb[macCb.macInst].rgInit.lmPst, sizeof(Pst)); + pst.event = EVENT_MAC_CELL_CONFIG_CFM; + (*packMacCellCfmOpts[pst.selector])(&pst,&macCellCfgCfm); +} + + /** * @brief Layer Manager Configuration response handler. * @@ -2208,26 +2258,17 @@ int MacProcSchCellCfgCfm SchCellCfgCfm *schCellCfgCfm ) { - Pst cfmPst; - int ret; - RgCellCb *cellCb; - MacCellCfgCfm macCellCfgCfm; - - cmMemset((U8 *)&cfmPst, 0, sizeof(Pst)); - cellCb = rgCb[pst->dstInst].cell; - macCellCfgCfm.transId = cellCb->macCellCfg.transId; if(schCellCfgCfm->rsp == RSP_OK) { - macCellCfgCfm.rsp = RSP_OK; + sendToLowerMac(PARAM_REQUEST, 0, (void *)NULL); } else { - macCellCfgCfm.rsp = RSP_NOK; + MacSendCellCfgCfm(RSP_NOK); } - macCellCfgFillCfmPst(pst,&cfmPst); - ret = (*packMacCellCfmOpts[cfmPst.selector])(&cfmPst,&macCellCfgCfm); - + return ROK; } + /********************************************************************** End of file