X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Fmac_cfg_hdl.c;h=c36c72ebd70b7355ab32a42cd66d7cd3cd14848f;hb=refs%2Fchanges%2F07%2F9007%2F5;hp=6205e5ba3bca9db09d1bf2c06f80e51ceb922604;hpb=49dc0e36836dc940ec40dea3a475ff067177819a;p=o-du%2Fl2.git diff --git a/src/5gnrmac/mac_cfg_hdl.c b/src/5gnrmac/mac_cfg_hdl.c index 6205e5ba3..c36c72ebd 100644 --- a/src/5gnrmac/mac_cfg_hdl.c +++ b/src/5gnrmac/mac_cfg_hdl.c @@ -77,6 +77,13 @@ 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 * @@ -94,9 +101,12 @@ MacDuSliceReCfgRspFunc macDuSliceReCfgRspOpts[] = **/ uint8_t MacSchGenCfgReq(Pst *pst, RgMngmt *cfg) { + Pst schPst; + printf("\nReceived Scheduler gen config at MAC"); - pst->dstInst = DEFAULT_CELLS + 1; - SchProcGenCfgReq(pst, cfg); + memset(&schPst, 0, sizeof(Pst)); + FILL_PST_MAC_TO_SCH(schPst, EVENT_SCH_GEN_CFG); + SchProcGenCfgReq(&schPst, cfg); return ROK; } @@ -289,9 +299,10 @@ uint8_t MacSchCellCfgReq(Pst *pst, MacCellCfg *macCellCfg) schCellCfg.schRachCfg.rootSeqIdx = macCellCfg->prachCfg.fdm[0].rootSeqIdx; schCellCfg.schRachCfg.numRootSeq = macCellCfg->prachCfg.fdm[0].numRootSeq; schCellCfg.schRachCfg.k1 = macCellCfg->prachCfg.fdm[0].k1; + schCellCfg.schRachCfg.totalNumRaPreamble = macCellCfg->prachCfg.totalNumRaPreamble; schCellCfg.schRachCfg.ssbPerRach = macCellCfg->prachCfg.ssbPerRach; - schCellCfg.schRachCfg.prachMultCarrBand = \ - macCellCfg->prachCfg.prachMultCarrBand; + schCellCfg.schRachCfg.numCbPreamblePerSsb = macCellCfg->prachCfg.numCbPreamblePerSsb; + schCellCfg.schRachCfg.prachMultCarrBand = macCellCfg->prachCfg.prachMultCarrBand; schCellCfg.schRachCfg.raContResTmr = macCellCfg->prachCfg.raContResTmr; schCellCfg.schRachCfg.rsrpThreshSsb = macCellCfg->prachCfg.rsrpThreshSsb; schCellCfg.schRachCfg.raRspWindow = macCellCfg->prachCfg.raRspWindow; @@ -376,6 +387,28 @@ uint8_t MacSchCellCfgReq(Pst *pst, MacCellCfg *macCellCfg) } } } +#ifdef NR_DRX + /* Drx configuration */ + + schCellCfg.drxInfo.drxOnDurationTimer.onDurationTimerValInMs = macCellCfg->drxInfo.drxOnDurationTimer.onDurationTimerValInMs; + if(!macCellCfg->drxInfo.drxOnDurationTimer.onDurationTimerValInMs) + schCellCfg.drxInfo.drxOnDurationTimer.onDurationtimerValue.subMilliSeconds = \ + macCellCfg->drxInfo.drxOnDurationTimer.onDurationtimerValue.subMilliSeconds; + else + schCellCfg.drxInfo.drxOnDurationTimer.onDurationtimerValue.milliSeconds = \ + macCellCfg->drxInfo.drxOnDurationTimer.onDurationtimerValue.milliSeconds; + schCellCfg.drxInfo.drxInactivityTimer = macCellCfg->drxInfo.drxInactivityTimer; + schCellCfg.drxInfo.drxHarqRttTimerDl = macCellCfg->drxInfo.drxHarqRttTimerDl; + schCellCfg.drxInfo.drxHarqRttTimerUl = macCellCfg->drxInfo.drxHarqRttTimerUl; + schCellCfg.drxInfo.drxRetransmissionTimerDl = macCellCfg->drxInfo.drxRetransmissionTimerDl; + schCellCfg.drxInfo.drxRetransmissionTimerUl = macCellCfg->drxInfo.drxRetransmissionTimerUl; + schCellCfg.drxInfo.drxLongCycleStartOffset.drxLongCycleStartOffsetChoice = macCellCfg->drxInfo.drxLongCycleStartOffset.\ + drxLongCycleStartOffsetChoice; + schCellCfg.drxInfo.drxLongCycleStartOffset.drxLongCycleStartOffsetVal = macCellCfg->drxInfo.drxLongCycleStartOffset.drxLongCycleStartOffsetVal; + schCellCfg.drxInfo.shortDrx.drxShortCycle = macCellCfg->drxInfo.shortDrx.drxShortCycle; + schCellCfg.drxInfo.shortDrx.drxShortCycleTimer = macCellCfg->drxInfo.shortDrx.drxShortCycleTimer; + schCellCfg.drxInfo.drxSlotOffset = macCellCfg->drxInfo.drxSlotOffset; +#endif #ifdef NR_TDD memcpy(&schCellCfg.tddCfg, &macCellCfg->tddCfg, sizeof(TDDCfg)); @@ -952,6 +985,86 @@ uint8_t MacProcSchSliceReCfgRsp(Pst *pst, SchSliceCfgRsp *schSliceRecfgRsp) } return ROK; } + +/** + * @brief Mac process the downlink pcch indication received from DUAPP + * + * @details + * + * Function : MacProcDlPcchInd + * + * This function process the downlink pcch indication received from DUAPP + * + * @param[in] Pst *pst + * @param[in] MacPcchInd *pcchInd + * @return int + * -# ROK + **/ +uint8_t MacProcDlPcchInd(Pst *pst, MacPcchInd *pcchInd) +{ + uint8_t ret = RFAILED; + uint16_t cellIdx = 0; + Pst schPst; + SchPageInd *schPageInd = NULLP; + + if(pcchInd) + { + DU_LOG("\nINFO --> MAC : Received DL PCCH IND from DU_APP for cellId[%d]", pcchInd->cellId); + + GET_CELL_IDX(pcchInd->cellId, cellIdx); + + if(macCb.macCell[cellIdx] == NULLP || macCb.macCell[cellIdx]->cellId != pcchInd->cellId) + { + DU_LOG("\nERROR --> MAC : MacProcDlPcchInd(): CellId[%d] does not exist", pcchInd->cellId); + } + else + { + if((pcchInd->pcchPdu == NULLP) || (pcchInd->pduLen <= 0)) + { + DU_LOG("\nERROR --> MAC : MacProcDlPcchInd(): Received Pcch pdu is null"); + } + else + { + MAC_ALLOC(schPageInd, sizeof(SchPageInd)); + if(schPageInd == NULLP) + { + DU_LOG("\nERROR --> MAC : MacProcDlPcchInd(): Failed to allocate memory"); + } + else + { + schPageInd->cellId = pcchInd->cellId; + schPageInd->pf = pcchInd->pf; + schPageInd->i_s = pcchInd->i_s; + schPageInd->pduLen = pcchInd->pduLen; + + MAC_ALLOC(schPageInd->pagePdu, pcchInd->pduLen); + if(schPageInd->pagePdu == NULLP) + { + DU_LOG("\nERROR --> MAC : MacProcDlPcchInd(): Failed to allocate memory"); + MAC_FREE(schPageInd, sizeof(SchPageInd)); + } + else + { + memcpy(schPageInd->pagePdu, pcchInd->pcchPdu, pcchInd->pduLen); + + FILL_PST_MAC_TO_SCH(schPst, EVENT_PAGING_IND_TO_SCH); + ret = (*macSchPagingIndOpts[schPst.selector])(&schPst, schPageInd); + } + } + } + } + if((pcchInd->pcchPdu) && (pcchInd->pduLen > 0)) + { + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, pcchInd->pcchPdu, pcchInd->pduLen); + } + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, pcchInd, sizeof(MacPcchInd)); + } + else + { + DU_LOG("\nERROR --> MAC : MacProcDlPcchInd(): Received Null pointer"); + } + return ret; +} /********************************************************************** End of file **********************************************************************/