typedef struct macCb
{
- Inst macInst;
- ProcId procId;
- uint8_t tmrRes; /*!< Timer resolution */
- CmTqCp tmrTqCp; /*!< Timer Task Queue Cntrl Point */
- CmTqType tmrTq[MAC_TQ_SIZE]; /*!< Timer Task Queue */
- CmTimer tmrBlk[MAX_NUM_TIMER]; /*!< Timer Block */
- MacCellCb *macCell[MAX_NUM_CELL];
+ Inst macInst;
+ ProcId procId;
+ uint8_t tmrRes; /*!< Timer resolution */
+ CmTqCp tmrTqCp; /*!< Timer Task Queue Cntrl Point */
+ CmTqType tmrTq[MAC_TQ_SIZE]; /*!< Timer Task Queue */
+ CmTimer tmrBlk[MAX_NUM_TIMER]; /*!< Timer Block */
+ MacCellCb *macCell[MAX_NUM_CELL];
}MacCb;
/* global variable */
packDuMacCellDeleteRsp /* packing for light weight loosly coupled */
};
+MacDuSliceCfgRspFunc macDuSliceCfgRspOpts[] =
+{
+ packDuMacSliceCfgRsp, /* packing for loosely coupled */
+ DuProcMacSliceCfgRsp, /* packing for tightly coupled */
+ packDuMacSliceCfgRsp /* packing for light weight loosly coupled */
+};
+
+MacDuSliceReCfgRspFunc macDuSliceReCfgRspOpts[] =
+{
+ packDuMacSliceReCfgRsp, /* packing for loosely coupled */
+ DuProcMacSliceReCfgRsp, /* packing for tightly coupled */
+ packDuMacSliceReCfgRsp /* packing for light weight loosly coupled */
+};
+
/**
* @brief Layer Manager Configuration request handler for Scheduler
*
memcpy(macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1Pdu, macCellCfg->sib1Cfg.sib1Pdu, \
macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1PduLen);
- macCb.macCell[cellIdx]->macCellCfg.numSupportedSlice = macCellCfg->numSupportedSlice;
- MAC_ALLOC(macCb.macCell[cellIdx]->macCellCfg.snssai, macCb.macCell[cellIdx]->macCellCfg.numSupportedSlice\
+ macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.numSupportedSlice = macCellCfg->plmnInfoList.numSupportedSlice;
+ MAC_ALLOC(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai, macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.numSupportedSlice\
* sizeof(Snssai*));
- if(macCb.macCell[cellIdx]->macCellCfg.snssai == NULLP)
+ if(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai == NULLP)
{
DU_LOG("\nERROR --> MAC: Memory allocation failed at MacProcCellCfgReq");
return RFAILED;
}
- if(macCb.macCell[cellIdx]->macCellCfg.snssai)
+ if(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai)
{
- for(sliceIdx=0; sliceIdx<macCb.macCell[cellIdx]->macCellCfg.numSupportedSlice; sliceIdx++)
+ for(sliceIdx=0; sliceIdx<macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.numSupportedSlice; sliceIdx++)
{
- if(macCellCfg->snssai[sliceIdx])
+ if(macCellCfg->plmnInfoList.snssai[sliceIdx])
{
- MAC_ALLOC(macCb.macCell[cellIdx]->macCellCfg.snssai[sliceIdx], sizeof(Snssai));
- if(!macCb.macCell[cellIdx]->macCellCfg.snssai[sliceIdx])
+ MAC_ALLOC(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai[sliceIdx], sizeof(Snssai));
+ if(!macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai[sliceIdx])
{
DU_LOG("\nERROR --> MAC: Memory allocation failed at MacProcCellCfgReq");
return RFAILED;
}
- memcpy(macCb.macCell[cellIdx]->macCellCfg.snssai[sliceIdx], macCellCfg->snssai[sliceIdx], sizeof(Snssai));
+ memcpy(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai[sliceIdx], macCellCfg->plmnInfoList.snssai[sliceIdx],\
+ sizeof(Snssai));
}
}
}
macCellCfg->initialUlBwp.puschCommon.timeDomRsrcAllocList[rsrcListIdx].symbolLength;
}
- if(macCellCfg->snssai)
+ if(macCellCfg->plmnInfoList.snssai)
{
- schCellCfg.numSliceSupport = macCellCfg->numSupportedSlice;
- MAC_ALLOC(schCellCfg.snssai, schCellCfg.numSliceSupport * sizeof(Snssai*));
- if(!schCellCfg.snssai)
+ schCellCfg.plmnInfoList.numSliceSupport = macCellCfg->plmnInfoList.numSupportedSlice;
+ MAC_ALLOC(schCellCfg.plmnInfoList.snssai, schCellCfg.plmnInfoList.numSliceSupport * sizeof(Snssai*));
+ if(!schCellCfg.plmnInfoList.snssai)
{
DU_LOG("\nERROR --> MAC: Memory allocation failed at MacSchCellCfgReq");
return RFAILED;
}
- for(sliceIdx=0; sliceIdx<schCellCfg.numSliceSupport; sliceIdx++)
+ for(sliceIdx=0; sliceIdx<schCellCfg.plmnInfoList.numSliceSupport; sliceIdx++)
{
- if(macCellCfg->snssai[sliceIdx])
+ if(macCellCfg->plmnInfoList.snssai[sliceIdx])
{
- MAC_ALLOC(schCellCfg.snssai[sliceIdx], sizeof(Snssai));
- if(!schCellCfg.snssai[sliceIdx])
+ MAC_ALLOC(schCellCfg.plmnInfoList.snssai[sliceIdx], sizeof(Snssai));
+ if(!schCellCfg.plmnInfoList.snssai[sliceIdx])
{
DU_LOG("\nERROR --> MAC: Memory allocation failed at MacSchCellCfgReq");
return RFAILED;
}
- memcpy(schCellCfg.snssai[sliceIdx], macCellCfg->snssai[sliceIdx], sizeof(Snssai));
+ memcpy(schCellCfg.plmnInfoList.snssai[sliceIdx], macCellCfg->plmnInfoList.snssai[sliceIdx], sizeof(Snssai));
}
}
}
- if(macCellCfg->rrmPolicy)
- {
- MAC_ALLOC(schCellCfg.rrmPolicy, sizeof(SchRrmPolicy));
- if(!schCellCfg.rrmPolicy)
- {
- DU_LOG("\nERROR --> MAC: Memory allocation failed at MacProcCellCfgReq");
- return RFAILED;
- }
- memcpy(schCellCfg.rrmPolicy, macCellCfg->rrmPolicy, sizeof(SchRrmPolicy));
- }
#ifdef NR_TDD
memcpy(&schCellCfg.tddCfg, &macCellCfg->tddCfg, sizeof(TDDCfg));
if(macCb.macCell[cellIdx]->cellId == schCellDelRsp->cellId)
{
status = SUCCESSFUL_RSP;
- if(macCb.macCell[cellIdx]->macCellCfg.snssai)
+ if(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai)
{
- for(sliceIdx = 0; sliceIdx<macCb.macCell[cellIdx]->macCellCfg.numSupportedSlice; sliceIdx++)
+ for(sliceIdx = 0; sliceIdx<macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.numSupportedSlice; sliceIdx++)
{
- MAC_FREE(macCb.macCell[cellIdx]->macCellCfg.snssai[sliceIdx], sizeof(Snssai));
+ MAC_FREE(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai[sliceIdx], sizeof(Snssai));
}
- MAC_FREE(macCb.macCell[cellIdx]->macCellCfg.snssai, macCb.macCell[cellIdx]->macCellCfg.\
+ MAC_FREE(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai, macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.\
numSupportedSlice * sizeof(Snssai*));
}
MAC_FREE(macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1Pdu, \
return ret;
}
+/**
+ * @brief free the temporary slice cfg stored in macCb.
+ *
+ * @details
+ *
+ * Function : freeMacSliceCfgReq
+ *
+ * free the temporary slice cfg stored in macCb
+ *
+ * @param[in]
+ * @return int
+ * -# ROK
+ **/
+void freeMacSliceCfgReq(MacSliceCfgReq *cfgReq,Pst *pst)
+{
+ uint8_t cfgIdx = 0;
+
+ if(cfgReq)
+ {
+ if(cfgReq->numOfConfiguredSlice)
+ {
+ for(cfgIdx = 0; cfgIdx<cfgReq->numOfConfiguredSlice; 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));
+ }
+}
+/**
+ * @brief fill Mac Slice Config Rsp
+ *
+ * @details
+ *
+ * Function : fillMacSliceCfgRsp
+ *
+ * This function fill Mac Slice Config Rsp
+ *
+ * @param[in] SchSliceCfgRsp *sliceCfgRsp, MacSliceCfgRsp *macSliceCfgRsp,
+ * uint8_t *count
+ * @return int
+ * -# ROK
+ **/
+uint8_t fillMacSliceCfgRsp(SchSliceCfgRsp *schSliceCfgRsp, MacSliceCfgRsp *macSliceCfgRsp)
+{
+
+ bool sliceFound = false;
+ uint8_t cfgIdx = 0;
+
+ macSliceCfgRsp->numSliceCfgRsp = schSliceCfgRsp->numSliceCfgRsp;
+ MAC_ALLOC_SHRABL_BUF(macSliceCfgRsp->listOfSliceCfgRsp, macSliceCfgRsp->numSliceCfgRsp* sizeof(MacSliceRsp*));
+ if(macSliceCfgRsp->listOfSliceCfgRsp == NULLP)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failedi in fillMacSliceCfgRsp");
+ return RFAILED;
+ }
+
+ for(cfgIdx = 0; cfgIdx<schSliceCfgRsp->numSliceCfgRsp; cfgIdx++)
+ {
+ sliceFound = false;
+ if(schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp == RSP_OK)
+ {
+ sliceFound = true;
+ }
+
+ MAC_ALLOC_SHRABL_BUF(macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx], sizeof(SliceRsp));
+ if(macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failedi in fillMacSliceCfgRsp");
+ return RFAILED;
+ }
+
+ macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->snssai = schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->snssai;
+ if(sliceFound == true)
+ macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp = MAC_DU_APP_RSP_OK;
+ else
+ {
+ macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp = MAC_DU_APP_RSP_NOK;
+ macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->cause = SLICE_NOT_PRESENT;
+ }
+ }
+ return ROK;
+}
+
+/**
+ * @brief send slice cfg response to duapp.
+ *
+ * @details
+ *
+ * Function : MacSendSliceConfigRsp
+ *
+ * sends slice cfg response to duapp
+ *
+ * @param[in] MacSliceCfgRsp macSliceCfgRsp
+ * @return int
+ * -# ROK
+ **/
+uint8_t MacSendSliceConfigRsp(MacSliceCfgRsp *macSliceCfgRsp)
+{
+ Pst rspPst;
+
+ memset(&rspPst, 0, sizeof(Pst));
+ FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_SLICE_CFG_RSP);
+ return (*macDuSliceCfgRspOpts[rspPst.selector])(&rspPst, macSliceCfgRsp);
+
+}
+/**
+ * @brief free the slice cfg rsp received from sch.
+ *
+ * @details
+ *
+ * Function : freeSchSliceCfgRsp
+ *
+ * This free the slice cfg rsp received from sch
+ *
+ * @param[in] SchSliceCfgRsp *sliceCfgrsp
+ * @return int
+ * -# ROK
+ **/
+void freeSchSliceCfgRsp(SchSliceCfgRsp *schSliceCfgRsp)
+{
+ uint8_t cfgIdx = 0;
+
+ if(schSliceCfgRsp)
+ {
+ if(schSliceCfgRsp->numSliceCfgRsp)
+ {
+ for(cfgIdx = 0; cfgIdx< schSliceCfgRsp->numSliceCfgRsp; cfgIdx++)
+ {
+ MAC_FREE(schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx], sizeof(SliceRsp));
+ }
+ MAC_FREE(schSliceCfgRsp->listOfSliceCfgRsp, schSliceCfgRsp->numSliceCfgRsp * sizeof(SliceRsp*));
+ }
+ }
+}
+
+/**
+ * @brief Mac process the slice cfg rsp received from sch.
+ *
+ * @details
+ *
+ * Function : MacProcSchSliceCfgRsp
+ *
+ * This function process the slice cfg rsp received from sch
+ *
+ * @param[in] Pst *pst
+ * @param[in] SchSliceCfgRsp *sliceCfgrsp
+ * @return int
+ * -# ROK
+ **/
+uint8_t MacProcSchSliceCfgRsp(Pst *pst, SchSliceCfgRsp *schSliceCfgRsp)
+{
+ MacSliceCfgRsp *macSliceCfgRsp = NULLP;
+
+ if(schSliceCfgRsp)
+ {
+ MAC_ALLOC_SHRABL_BUF(macSliceCfgRsp, sizeof(MacSliceCfgRsp));
+ if(macSliceCfgRsp == NULLP)
+ {
+ DU_LOG("\nERROR --> MAC : Failed to allocate memory in MacProcSchSliceCfgRsp");
+ return RFAILED;
+ }
+ if(schSliceCfgRsp->listOfSliceCfgRsp)
+ {
+ if(fillMacSliceCfgRsp(schSliceCfgRsp, macSliceCfgRsp) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : Failed to fill the slice cfg response");
+ return RFAILED;
+ }
+ MacSendSliceConfigRsp(macSliceCfgRsp);
+ }
+ freeSchSliceCfgRsp(schSliceCfgRsp);
+ }
+ return ROK;
+}
+
+/**
+* @brief send slice cfg response to duapp.
+*
+* @details
+*
+* Function : MacSendSliceReconfigRsp
+*
+* sends slice cfg response to duapp
+*
+* @param[in] MacSliceCfgRsp macSliceRecfgRsp
+* @return int
+* -# ROK
+**/
+uint8_t MacSendSliceReconfigRsp(MacSliceCfgRsp *macSliceRecfgRsp)
+{
+ Pst rspPst;
+
+ memset(&rspPst, 0, sizeof(Pst));
+ FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_SLICE_RECFG_RSP);
+ return (*macDuSliceReCfgRspOpts[rspPst.selector])(&rspPst, macSliceRecfgRsp);
+
+}
+
+/**
+ * @brief Mac process the slice cfg rsp received from sch.
+ *
+ * @details
+ *
+ * Function : MacProcSchSliceReCfgRsp
+ *
+ * This function process the slice cfg rsp received from sch
+ *
+ * @param[in] Pst *pst
+ * @param[in] SchSliceCfgRsp *schSliceRecfgRsp
+ * @return int
+ * -# ROK
+ **/
+uint8_t MacProcSchSliceReCfgRsp(Pst *pst, SchSliceCfgRsp *schSliceRecfgRsp)
+{
+ MacSliceCfgRsp *macSliceReCfgRsp = NULLP;
+
+ if(schSliceRecfgRsp)
+ {
+ MAC_ALLOC_SHRABL_BUF(macSliceReCfgRsp, sizeof(MacSliceCfgRsp));
+ if(macSliceReCfgRsp == NULLP)
+ {
+ DU_LOG("\nERROR --> MAC : Failed to allocate memory in MacProcSchSliceReCfgRsp");
+ return RFAILED;
+ }
+
+ if(schSliceRecfgRsp->listOfSliceCfgRsp)
+ {
+ if(fillMacSliceCfgRsp(schSliceRecfgRsp, macSliceReCfgRsp) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : Failed to fill the slice Recfg response");
+ return RFAILED;
+ }
+ MacSendSliceReconfigRsp(macSliceReCfgRsp);
+ }
+ freeSchSliceCfgRsp(schSliceRecfgRsp);
+ }
+ return ROK;
+}
/**********************************************************************
End of file
**********************************************************************/
packMacSchSrUciInd
};
+/* Function pointer for sending Slice cfg ind from MAC to SCH */
+MacSchSliceCfgReqFunc macSchSliceCfgReqOpts[]=
+{
+ packMacSchSliceCfgReq,
+ MacSchSliceCfgReq,
+ packMacSchSliceCfgReq
+};
+
+/* Function pointer for sending Slice cfg ind from MAC to SCH */
+MacSchSliceReCfgReqFunc macSchSliceReCfgReqOpts[]=
+{
+ packMacSchSliceReCfgReq,
+ MacSchSliceReCfgReq,
+ packMacSchSliceReCfgReq
+};
/*******************************************************************
*
* @brief Sends DL BO Info to SCH
return ret;
}
+/*******************************************************************
+ *
+ * @brief fill Slice Cfg Request info in shared structre
+ *
+ * @details
+ *
+ * Function : fillSliceCfgInfo
+ *
+ * Functionality:
+ * fill Slice Cfg Request info in shared structre
+ *
+ * @params[in] SchSliceCfgReq *schSliceCfgReq
+ * MacSliceCfgReq *macSliceCfgReq;
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ **********************************************************************/
+ uint8_t fillSliceCfgInfo(SchSliceCfgReq *schSliceCfgReq, MacSliceCfgReq *macSliceCfgReq)
+ {
+ uint8_t cfgIdx = 0;
+
+ if(macSliceCfgReq->listOfSliceCfg)
+ {
+ schSliceCfgReq->numOfConfiguredSlice = macSliceCfgReq->numOfConfiguredSlice;
+ MAC_ALLOC(schSliceCfgReq->listOfConfirguration, schSliceCfgReq->numOfConfiguredSlice *sizeof(SchRrmPolicyOfSlice*));
+ if(schSliceCfgReq->listOfConfirguration == NULLP)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in fillSliceCfgInfo");
+ return RFAILED;
+ }
+ for(cfgIdx = 0; cfgIdx<schSliceCfgReq->numOfConfiguredSlice; cfgIdx++)
+ {
+ MAC_ALLOC(schSliceCfgReq->listOfConfirguration[cfgIdx], sizeof(SchRrmPolicyOfSlice));
+ if(schSliceCfgReq->listOfConfirguration[cfgIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in fillSliceCfgInfo");
+ return RFAILED;
+ }
+
+ memcpy(&schSliceCfgReq->listOfConfirguration[cfgIdx]->snssai, &macSliceCfgReq->listOfSliceCfg[cfgIdx]->snssai, sizeof(Snssai));
+
+ if(macSliceCfgReq->listOfSliceCfg[cfgIdx]->rrmPolicyRatio)
+ {
+ MAC_ALLOC(schSliceCfgReq->listOfConfirguration[cfgIdx]->rrmPolicyRatioInfo, sizeof(SchRrmPolicyRatio));
+ if(schSliceCfgReq->listOfConfirguration[cfgIdx]->rrmPolicyRatioInfo == NULLP)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in fillSliceCfgInfo");
+ return RFAILED;
+ }
+ schSliceCfgReq->listOfConfirguration[cfgIdx]->rrmPolicyRatioInfo->policyMaxRatio = macSliceCfgReq->listOfSliceCfg[cfgIdx]->rrmPolicyRatio->policyMaxRatio;
+ schSliceCfgReq->listOfConfirguration[cfgIdx]->rrmPolicyRatioInfo->policyMinRatio = macSliceCfgReq->listOfSliceCfg[cfgIdx]->rrmPolicyRatio->policyMinRatio;
+ schSliceCfgReq->listOfConfirguration[cfgIdx]->rrmPolicyRatioInfo->policyDedicatedRatio = macSliceCfgReq->listOfSliceCfg[cfgIdx]->rrmPolicyRatio->policyDedicatedRatio;
+ }
+ }
+ }
+ return ROK;
+ }
+/*******************************************************************
+ *
+ * @brief Processes Slice Cfg Request recived from DU
+ *
+ * @details
+ *
+ * Function : MacProcSliceCfgReq
+ *
+ * Functionality:
+ * Processes Processes Slice Cfg Request recived from DU
+ *
+ * @params[in] Post Structure Pointer
+ * MacSliceCfgReq *macSliceCfgReq;
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ **********************************************************************/
+uint8_t MacProcSliceCfgReq(Pst *pst, MacSliceCfgReq *macSliceCfgReq)
+{
+ uint8_t ret = ROK;
+ Pst schPst;
+ SchSliceCfgReq *schSliceCfgReq;
+
+ DU_LOG("\nINFO --> MAC : Received Slice Cfg request from DU APP");
+ if(macSliceCfgReq)
+ {
+ MAC_ALLOC(schSliceCfgReq, sizeof(SchSliceCfgReq));
+ if(schSliceCfgReq == NULLP)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcSliceCfgReq");
+ ret = RFAILED;
+ }
+ else
+ {
+ if(fillSliceCfgInfo(schSliceCfgReq, macSliceCfgReq) == ROK)
+ {
+ FILL_PST_MAC_TO_SCH(schPst, EVENT_SLICE_CFG_REQ_TO_SCH);
+ ret = (*macSchSliceCfgReqOpts[schPst.selector])(&schPst, schSliceCfgReq);
+ }
+ }
+ freeMacSliceCfgReq(macSliceCfgReq, pst);
+ }
+ else
+ {
+ DU_LOG("\nINFO --> MAC : Received MacSliceCfgReq is NULL");
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Processes Slice ReCfg Request recived from DU
+ *
+ * @details
+ *
+ * Function : MacProcSliceReCfgReq
+ *
+ * Functionality:
+ * Processes Processes Slice ReCfg Request recived from DU
+ *
+ * @params[in] Post Structure Pointer
+ * MacSliceCfgReq *macSliceReCfgReq;
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ **********************************************************************/
+uint8_t MacProcSliceReCfgReq(Pst *pst, MacSliceCfgReq *macSliceReCfgReq)
+{
+ uint8_t ret = ROK;
+ Pst schPst;
+ SchSliceCfgReq *schSliceReCfgReq;
+
+ DU_LOG("\nINFO --> MAC : Received Slice ReCfg request from DU APP");
+ if(macSliceReCfgReq)
+ {
+ MAC_ALLOC(schSliceReCfgReq, sizeof(SchSliceCfgReq));
+ if(schSliceReCfgReq == NULLP)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcSliceReCfgReq");
+ ret = RFAILED;
+ }
+ else
+ {
+ if(fillSliceCfgInfo(schSliceReCfgReq, macSliceReCfgReq) == ROK)
+ {
+ FILL_PST_MAC_TO_SCH(schPst, EVENT_SLICE_RECFG_REQ_TO_SCH);
+ ret = (*macSchSliceReCfgReqOpts[schPst.selector])(&schPst, schSliceReCfgReq);
+ }
+
+ }
+ freeMacSliceCfgReq(macSliceReCfgReq, pst);
+ }
+ else
+ {
+ DU_LOG("\nINFO --> MAC : Received MacSliceCfgReq is NULL");
+ }
+ return ret;
+}
/**********************************************************************
End of file
unpackMacCellDeleteReq(MacProcCellDeleteReq, pst, mBuf);
break;
}
+ case EVENT_MAC_SLICE_CFG_REQ:
+ {
+ unpackMacSliceCfgReq(MacProcSliceCfgReq, pst, mBuf);
+ break;
+ }
+ case EVENT_MAC_SLICE_RECFG_REQ:
+ {
+ unpackMacSliceCfgReq(MacProcSliceReCfgReq, pst, mBuf);
+ break;
+ }
default:
RG_FREE_MSG(mBuf);
break;
case EVENT_MAC_CELL_DELETE_REQ:
strcpy(message,"EVENT_MAC_CELL_DELETE_REQ");
break;
+ case EVENT_MAC_SLICE_CFG_REQ:
+ strcpy(message,"EVENT_MAC_SLICE_CFG_REQ");
+ break;
+ case EVENT_MAC_SLICE_RECFG_REQ:
+ strcpy(message,"EVENT_MAC_SLICE_CFG_REQ");
+ break;
default:
strcpy(message,"Invalid Event");
break;
packSchCellCfgCfm /* LWLC */
};
+SchSliceCfgRspFunc SchSliceCfgRspOpts[] =
+{
+ packSchSliceCfgRsp, /* LC */
+ MacProcSchSliceCfgRsp, /* TC */
+ packSchSliceCfgRsp /* LWLC */
+
+};
+SchSliceReCfgRspFunc SchSliceReCfgRspOpts[] =
+{
+ packSchSliceReCfgRsp, /* LC */
+ MacProcSchSliceReCfgRsp, /* TC */
+ packSchSliceReCfgRsp /* LWLC */
+};
/**
* @brief Task Initiation function.
*
}
return(maxFreePRB);
}
+
+/*******************************************************************************
+ *
+ * @brief This function is used to send Slice Cfg rsp to MAC
+ *
+ * @details
+ *
+ * Function : SchSendSliceCfgRspToMac
+ *
+ * Functionality:
+ * function is used to send Slice Cfg rsp to MAC
+ *
+ * @params[in] Pst *pst, SchSliceCfgRsp sliceCfgRsp
+ *
+ * @return- void
+ *
+ * ********************************************************************************/
+void SchSendSliceCfgRspToMac(Inst inst, SchSliceCfgRsp sliceCfgRsp)
+{
+ Pst rspPst;
+
+ memset(&rspPst, 0, sizeof(Pst));
+ FILL_PST_SCH_TO_MAC(rspPst, inst);
+ rspPst.event = EVENT_SLICE_CFG_RSP_TO_MAC;
+
+ SchSliceCfgRspOpts[rspPst.selector](&rspPst, &sliceCfgRsp);
+
+}
+/*******************************************************************************
+ *
+ * @brief fill slice configuration response
+ *
+ * @details
+ *
+ * Function : fillSliceCfgRsp
+ *
+ * Functionality:
+ * fill slice configuration response
+ *
+ * @params[in] SchCellCb, SchSliceCfgReq, SchSliceCfgRsp,uint8_t count
+ *
+ * @return
+ * ROK - Success
+ * RFAILED - Failure
+ *
+ * ********************************************************************************/
+uint8_t fillSliceCfgRsp(bool sliceReCfg, SchSliceCfg *storedSliceCfg, SchCellCb *cellCb, SchSliceCfgReq *schSliceCfgReq, SchSliceCfgRsp *schSliceCfgRsp, uint8_t *count)
+{
+ bool sliceFound = false;
+ uint8_t cfgIdx = 0, sliceIdx = 0;
+
+ schSliceCfgRsp->numSliceCfgRsp = schSliceCfgReq->numOfConfiguredSlice;
+ SCH_ALLOC(schSliceCfgRsp->listOfSliceCfgRsp, schSliceCfgRsp->numSliceCfgRsp * sizeof(SliceRsp*));
+ if(schSliceCfgRsp->listOfSliceCfgRsp == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : Memory allocation failed at fillSliceCfgRsp");
+ return RFAILED;
+ }
+
+ for(cfgIdx = 0; cfgIdx<schSliceCfgRsp->numSliceCfgRsp ; cfgIdx++)
+ {
+ sliceFound = false;
+ /* Here comparing the slice cfg request with the slice stored in cellCfg */
+ if(sliceReCfg != true)
+ {
+ for(sliceIdx = 0; sliceIdx<cellCb->cellCfg.plmnInfoList.numSliceSupport; sliceIdx++)
+ {
+ if(!memcmp(&schSliceCfgReq->listOfConfirguration[cfgIdx]->snssai, cellCb->cellCfg.plmnInfoList.snssai[sliceIdx], sizeof(Snssai)))
+ {
+ (*count)++;
+ sliceFound = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ /* Here comparing the slice cfg request with the slice stored in SchDb */
+ if(storedSliceCfg->listOfConfirguration)
+ {
+ for(sliceIdx = 0; sliceIdx<storedSliceCfg->numOfSliceConfigured; sliceIdx++)
+ {
+ if(!memcmp(&schSliceCfgReq->listOfConfirguration[cfgIdx]->snssai, &storedSliceCfg->listOfConfirguration[sliceIdx]->snssai,\
+ sizeof(Snssai)))
+ {
+ (*count)++;
+ sliceFound = true;
+ break;
+ }
+ }
+ }
+ }
+
+ SCH_ALLOC(schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx], sizeof(SliceRsp));
+ if(schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : Failed to allocate memory in fillSliceCfgRsp");
+ return RFAILED;
+ }
+
+
+ schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->snssai = schSliceCfgReq->listOfConfirguration[cfgIdx]->snssai;
+ if(sliceFound == true)
+ schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp = RSP_OK;
+ else
+ {
+ schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp = RSP_NOK;
+ schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->cause = SLICE_NOT_FOUND;
+ }
+ }
+ return ROK;
+}
+
+/*******************************************************************************
+ *
+ * @brief This function is used to store the slice configuration Sch DB
+ *
+ * @details
+ *
+ * Function : addSliceCfgInSchDb
+ *
+ * Functionality:
+ * function is used to store the slice configuration Sch DB
+ *
+ * @params[in] SchSliceCfg *storeSliceCfg, SchSliceCfgReq *cfgReq,
+ * SchSliceCfgRsp cfgRsp, uint8_t count
+ *
+ * @return
+ * ROK - Success
+ * RFAILED - Failure
+ *
+ * ********************************************************************************/
+uint8_t addSliceCfgInSchDb(SchSliceCfg *storeSliceCfg, SchSliceCfgReq *cfgReq, SchSliceCfgRsp cfgRsp, uint8_t count)
+{
+ uint8_t cfgIdx = 0, sliceIdx = 0;
+
+ if(count)
+ {
+ storeSliceCfg->numOfSliceConfigured = count;
+ SCH_ALLOC(storeSliceCfg->listOfConfirguration, storeSliceCfg->numOfSliceConfigured * sizeof(SchRrmPolicyOfSlice*));
+ if(storeSliceCfg->listOfConfirguration == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : Failed to allocate memory in addSliceCfgInSchDb");
+ return RFAILED;
+ }
+
+ for(cfgIdx = 0; cfgIdx<storeSliceCfg->numOfSliceConfigured; cfgIdx++)
+ {
+ if(cfgRsp.listOfSliceCfgRsp[cfgIdx]->rsp == RSP_OK)
+ {
+ SCH_ALLOC(storeSliceCfg->listOfConfirguration[sliceIdx], sizeof(SchRrmPolicyOfSlice));
+ if(storeSliceCfg->listOfConfirguration[sliceIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : Failed to allocate memory in addSliceCfgInSchDb");
+ return RFAILED;
+ }
+
+ SCH_ALLOC(storeSliceCfg->listOfConfirguration[sliceIdx]->rrmPolicyRatioInfo, sizeof(SchRrmPolicyRatio));
+ if(storeSliceCfg->listOfConfirguration[sliceIdx]->rrmPolicyRatioInfo == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : Failed to allocate memory in addSliceCfgInSchDb");
+ return RFAILED;
+ }
+
+ memcpy(storeSliceCfg->listOfConfirguration[sliceIdx], cfgReq->listOfConfirguration[sliceIdx], sizeof(SchRrmPolicyOfSlice));
+ sliceIdx++;
+ }
+ }
+ }
+ return ROK;
+}
+
+/*******************************************************************************
+ *
+ * @brief This function is used to free the slice cfg and re cfg request pointer
+ *
+ * @details
+ *
+ * Function : freeSchSliceCfgReq
+ *
+ * Functionality:
+ * function is used to free the slice cfg and re cfg request pointer
+ *
+ * @params[in] Pst *pst, SchSliceCfgReq *schSliceCfgReq
+ *
+ * @return
+ * ROK - Success
+ * RFAILED - Failure
+ * ********************************************************************************/
+void freeSchSliceCfgReq(SchSliceCfgReq *cfgReq)
+{
+ uint8_t cfgIdx = 0;
+
+ if(cfgReq)
+ {
+ if(cfgReq->numOfConfiguredSlice)
+ {
+ for(cfgIdx = 0; cfgIdx<cfgReq->numOfConfiguredSlice; cfgIdx++)
+ {
+ if(cfgReq->listOfConfirguration[cfgIdx])
+ {
+ SCH_FREE(cfgReq->listOfConfirguration[cfgIdx]->rrmPolicyRatioInfo, sizeof(SchRrmPolicyRatio));
+ SCH_FREE(cfgReq->listOfConfirguration[cfgIdx], sizeof(SchRrmPolicyOfSlice));
+ }
+ }
+ SCH_FREE(cfgReq->listOfConfirguration, cfgReq->numOfConfiguredSlice * sizeof(SchRrmPolicyOfSlice*));
+ }
+ SCH_FREE(cfgReq, sizeof(SchSliceCfgReq));
+ }
+}
+/*******************************************************************************
+ *
+ * @brief This function is used to store the slice configuration Sch DB
+ *
+ * @details
+ *
+ * Function : MacSchSliceCfgReq
+ *
+ * Functionality:
+ * function is used to store the slice configuration Sch DB
+ *
+ * @params[in] Pst *pst, SchSliceCfgReq *schSliceCfgReq
+ *
+ * @return
+ * ROK - Success
+ * RFAILED - Failure
+ *
+ * ********************************************************************************/
+uint8_t MacSchSliceCfgReq(Pst *pst, SchSliceCfgReq *schSliceCfgReq)
+{
+ uint8_t count = 0;
+ Inst inst = pst->dstInst - 1;
+ SchSliceCfgRsp sliceCfgRsp;
+
+ DU_LOG("\nINFO --> SCH : Received Slice Cfg request from MAC");
+ if(schSliceCfgReq)
+ {
+ if(schSliceCfgReq->listOfConfirguration)
+ {
+ /* filling the slice configuration response of each slice */
+ if(fillSliceCfgRsp(false, NULLP, schCb[inst].cells[0], schSliceCfgReq, &sliceCfgRsp, &count) != ROK)
+ {
+ DU_LOG("\nERROR --> SCH : Failed to fill the slice cfg rsp");
+ return RFAILED;
+ }
+
+ if(addSliceCfgInSchDb(&schCb[inst].sliceCfg, schSliceCfgReq, sliceCfgRsp, count) != ROK)
+ {
+ DU_LOG("\nERROR --> SCH : Failed to add slice cfg in sch database");
+ return RFAILED;
+ }
+ freeSchSliceCfgReq(schSliceCfgReq);
+ SchSendSliceCfgRspToMac(inst, sliceCfgRsp);
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> SCH : Received SchSliceCfgReq is NULL");
+ }
+ return ROK;
+}
+
+/*******************************************************************************
+ *
+ * @brief This function is used to store the slice reconfiguration Sch DB
+ *
+ * @details
+ *
+ * Function : modifySliceCfgInSchDb
+ *
+ * Functionality:
+ * function is used to store the slice re configuration Sch DB
+ *
+ * @params[in] Pst *pst, SchSliceCfgReq *schSliceCfgReq
+ *
+ * @return
+ * ROK - Success
+ * RFAILED - Failure
+ *
+ * ********************************************************************************/
+uint8_t modifySliceCfgInSchDb(SchSliceCfg *storeSliceCfg, SchSliceCfgReq *cfgReq, SchSliceCfgRsp cfgRsp, uint8_t count)
+{
+ uint8_t cfgIdx = 0, sliceIdx = 0;
+
+ if(count)
+ {
+ if(storeSliceCfg->listOfConfirguration == NULLP)
+ {
+ DU_LOG("\nINFO --> SCH : Memory allocation failed in modifySliceCfgInSchDb");
+ return RFAILED;
+ }
+
+ for(cfgIdx = 0; cfgIdx<cfgReq->numOfConfiguredSlice; cfgIdx++)
+ {
+ if(cfgRsp.listOfSliceCfgRsp[cfgIdx]->rsp == RSP_OK)
+ {
+ for(sliceIdx = 0; sliceIdx<storeSliceCfg->numOfSliceConfigured; sliceIdx++)
+ {
+ if(!memcmp(&storeSliceCfg->listOfConfirguration[sliceIdx]->snssai, &cfgReq->listOfConfirguration[cfgIdx]->snssai, sizeof(Snssai)))
+ {
+ storeSliceCfg->listOfConfirguration[sliceIdx]->rrmPolicyRatioInfo = cfgReq->listOfConfirguration[cfgIdx]->rrmPolicyRatioInfo;
+ break;
+ }
+ }
+ }
+ }
+ }
+ freeSchSliceCfgReq(cfgReq);
+ return ROK;
+}
+/*******************************************************************************
+ *
+ * @brief This function is used to send Slice re Cfg rsp to MAC
+ *
+ * @details
+ *
+ * Function : SchSendSliceCfgRspToMac
+ *
+ * Functionality:
+ * function is used to send Slice re Cfg rsp to MAC
+ *
+ * @params[in] Pst *pst, SchSliceCfgRsp schSliceReCfgRsp
+ *
+ * @return- void
+ *
+ * ********************************************************************************/
+void SchSendSliceReCfgRspToMac(Inst inst, SchSliceCfgRsp schSliceReCfgRsp)
+{
+ Pst rspPst;
+
+ memset(&rspPst, 0, sizeof(Pst));
+ FILL_PST_SCH_TO_MAC(rspPst, inst);
+ rspPst.event = EVENT_SLICE_RECFG_RSP_TO_MAC;
+
+ SchSliceReCfgRspOpts[rspPst.selector](&rspPst, &schSliceReCfgRsp);
+}
+/*******************************************************************************
+ *
+ * @brief This function is used to store the slice reconfiguration Sch DB
+ *
+ * @details
+ *
+ * Function : MacSchSliceReCfgReq
+ *
+ * Functionality:
+ * function is used to store the slice re configuration Sch DB
+ *
+ * @params[in] Pst *pst, SchSliceCfgReq *schSliceReCfgReq
+ *
+ * @return
+ * ROK - Success
+ * RFAILED - Failure
+ *
+ * ********************************************************************************/
+uint8_t MacSchSliceReCfgReq(Pst *pst, SchSliceCfgReq *schSliceReCfgReq)
+{
+ uint8_t count = 0;
+ Inst inst = pst->dstInst - 1;
+ SchSliceCfgRsp schSliceReCfgRsp;
+
+ DU_LOG("\nINFO --> SCH : Received Slice ReCfg request from MAC");
+ if(schSliceReCfgReq)
+ {
+ if(schSliceReCfgReq->listOfConfirguration)
+ {
+ /* filling the slice configuration response of each slice */
+ if(fillSliceCfgRsp(true, &schCb[inst].sliceCfg, NULLP, schSliceReCfgReq, &schSliceReCfgRsp, &count) != ROK)
+ {
+ DU_LOG("\nERROR --> SCH : Failed to fill sch slice cfg response");
+ return RFAILED;
+ }
+
+ /* Modify the slice configuration stored in schCb */
+ if(modifySliceCfgInSchDb(&schCb[inst].sliceCfg, schSliceReCfgReq, schSliceReCfgRsp, count) != ROK)
+ {
+ DU_LOG("\nERROR --> SCH : Failed to modify slice cfg of SchDb");
+ return RFAILED;
+ }
+ SchSendSliceReCfgRspToMac(inst, schSliceReCfgRsp);
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> SCH : Received SchSliceCfgReq is NULL");
+ }
+ return ROK;
+}
+
/**********************************************************************
End of file
**********************************************************************/
#endif
}SchCellCb;
+
+typedef struct schSliceCfg
+{
+ uint8_t numOfSliceConfigured;
+ SchRrmPolicyOfSlice **listOfConfirguration;
+}SchSliceCfg;
+
/**
* @brief
* Control block for sch
SchGenCb genCfg; /*!< General Config info */
CmTqCp tmrTqCp; /*!< Timer Task Queue Cntrl Point */
CmTqType tmrTq[SCH_TQ_SIZE]; /*!< Timer Task Queue */
- SchCellCb *cells[MAX_NUM_CELL]; /* Array to store cellCb ptr */
+ SchCellCb *cells[MAX_NUM_CELL]; /* Array to store cellCb ptr */
+ SchSliceCfg sliceCfg;
}SchCb;
/* Declaration for scheduler control blocks */
*
* ****************************************************************/
-uint8_t updateDedLcInfo(Snssai *snssai, SchRrmPolicy *rrmPolicy, SchLcPrbEstimate *lcPrbEst,\
+uint8_t updateDedLcInfo(Snssai *snssai, SchLcPrbEstimate *lcPrbEst,\
bool *isDedicated)
{
- if(memcmp(snssai, &(rrmPolicy->memberList.snssai), sizeof(Snssai)) == 0)
+ uint8_t sliceCfgIdx =0;
+ SchSliceCfg sliceCfg = schCb[0].sliceCfg;
+
+ if(sliceCfg.numOfSliceConfigured)
{
- if(lcPrbEst->dedLcInfo == NULLP)
+ for(sliceCfgIdx = 0; sliceCfgIdx<sliceCfg.numOfSliceConfigured; sliceCfgIdx++)
{
- SCH_ALLOC(lcPrbEst->dedLcInfo, sizeof(DedicatedLCInfo));
- if(lcPrbEst->dedLcInfo == NULLP)
+ if(memcmp(snssai, &(sliceCfg.listOfConfirguration[sliceCfgIdx]->snssai), sizeof(Snssai)) == 0)
{
- DU_LOG("\nINFO --> SCH : Memory Allocation Failed");
- return RFAILED;
+ if(lcPrbEst->dedLcInfo == NULLP)
+ {
+ SCH_ALLOC(lcPrbEst->dedLcInfo, sizeof(DedicatedLCInfo));
+ if(lcPrbEst->dedLcInfo == NULLP)
+ {
+ DU_LOG("\nINFO --> SCH : Memory Allocation Failed");
+ return RFAILED;
+ }
+ }
+ if(sliceCfg.listOfConfirguration[sliceCfgIdx]->rrmPolicyRatioInfo)
+ {
+ /*Updating latest RrmPolicy*/
+ lcPrbEst->dedLcInfo->rsvdDedicatedPRB = \
+ (uint16_t)(((sliceCfg.listOfConfirguration[sliceCfgIdx]->rrmPolicyRatioInfo->policyDedicatedRatio)*(MAX_NUM_RB))/100);
+ *isDedicated = TRUE;
+ DU_LOG("\nINFO --> SCH : Updated RRM policy, reservedPOOL:%d",lcPrbEst->dedLcInfo->rsvdDedicatedPRB);
+ }
}
}
- /*Updating latest RrmPolicy*/
- lcPrbEst->dedLcInfo->rsvdDedicatedPRB = \
- (uint16_t)(((rrmPolicy->policyDedicatedRatio)*(MAX_NUM_RB))/100);
- *isDedicated = TRUE;
- DU_LOG("\nINFO --> SCH : Updated RRM policy, reservedPOOL:%d",lcPrbEst->dedLcInfo->rsvdDedicatedPRB);
- }
- /*else case: This LcCtxt is either a Default LC or this LC is part of someother RRM_MemberList*/
- else
- {
- DU_LOG("\nINFO --> SCH : This SNSSAI is not a part of this RRMPolicy");
+ /*case: This LcCtxt is either a Default LC or this LC is part of someother RRM_MemberList*/
+ if(*isDedicated != TRUE)
+ {
+ DU_LOG("\nINFO --> SCH : This SNSSAI is not a part of this RRMPolicy");
+ }
}
return ROK;
}
* and Create the Dedicated LC List & Update the Reserve PRB number*/
if(ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai != NULLP)
{
- retDL = updateDedLcInfo(ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai, \
- ueCb->cellCb->cellCfg.rrmPolicy, &(ueCb->dlLcPrbEst),\
+ retDL = updateDedLcInfo(ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai, &(ueCb->dlLcPrbEst),\
&(ueCb->dlInfo.dlLcCtxt[ueLcIdx].isDedicated));
}
if(ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai != NULLP)
{
- retUL = updateDedLcInfo(ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai, \
- ueCb->cellCb->cellCfg.rrmPolicy, &(ueCb->ulLcPrbEst),\
+ retUL = updateDedLcInfo(ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai, &(ueCb->ulLcPrbEst),\
&(ueCb->ulInfo.ulLcCtxt[ueLcIdx].isDedicated));
}
/*Updating the RRM reserved pool PRB count*/
if(ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai != NULLP)
{
- retUL = updateDedLcInfo(ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai, \
- ueCb->cellCb->cellCfg.rrmPolicy, &(ueCb->ulLcPrbEst),\
+ retUL = updateDedLcInfo(ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai, &(ueCb->ulLcPrbEst),\
&(ueCb->ulInfo.ulLcCtxt[ueLcIdx].isDedicated));
}
if(retUL == RFAILED)
/*Updating the RRM policy*/
if(ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai != NULLP)
{
- retDL = updateDedLcInfo(ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai, \
- ueCb->cellCb->cellCfg.rrmPolicy, &(ueCb->dlLcPrbEst), \
+ retDL = updateDedLcInfo(ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai, &(ueCb->dlLcPrbEst), \
&(ueCb->dlInfo.dlLcCtxt[ueLcIdx].isDedicated));
}
if(retDL == RFAILED)
SCH_FREE(cellCb->schUlSlotInfo, cellCb->numSlots * sizeof(SchUlSlotInfo*));
}
- if(cellCb->cellCfg.snssai)
+ if(cellCb->cellCfg.plmnInfoList.snssai)
{
- for(sliceIdx=0; sliceIdx<cellCb->cellCfg.numSliceSupport; sliceIdx++)
+ for(sliceIdx=0; sliceIdx<cellCb->cellCfg.plmnInfoList.numSliceSupport; sliceIdx++)
{
- SCH_FREE(cellCb->cellCfg.snssai[sliceIdx], sizeof(Snssai));
+ SCH_FREE(cellCb->cellCfg.plmnInfoList.snssai[sliceIdx], sizeof(Snssai));
}
- SCH_FREE(cellCb->cellCfg.snssai, cellCb->cellCfg.numSliceSupport*sizeof(Snssai*));
+ SCH_FREE(cellCb->cellCfg.plmnInfoList.snssai, cellCb->cellCfg.plmnInfoList.numSliceSupport*sizeof(Snssai*));
}
- SCH_FREE(cellCb->cellCfg.rrmPolicy, sizeof(SchRrmPolicy));
/* Remove all UE from ueToBeScheduled list and deallocate */
node = cellCb->ueToBeScheduled.first;
return RFAILED;
}
+/*******************************************************************
+ *
+ * @brief Pack and send Slice Cfg request from MAC to DU APP
+ *
+ * @details
+ *
+ * Function : packDuMacSliceCfgReq
+ *
+ * Functionality:
+ * Pack and send Slice Cfg request from MAC to DU APP
+ *
+ * @params[in] Pst *pst, MacSliceCfgReq *sliceCfgReq
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t packDuMacSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in packDuMacSliceCfgReq");
+ return RFAILED;
+ }
+ CMCHKPK(oduPackPointer,(PTR)sliceCfgReq, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC: Only LWLC supported in packDuMacSliceCfgReq");
+ return RFAILED;
+ }
+
+ return ODU_POST_TASK(pst,mBuf);
+
+}
+/*******************************************************************
+*
+* @brief Unpacks Slice Cfg request received from DU APP
+*
+* @details
+*
+* Function : unpackMacSliceCfgReq
+*
+* Functionality:
+* Unpacks Slice Cfg Request received from DU APP
+*
+* @params[in] Pointer to Handler
+* Post structure pointer
+* Message Buffer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackMacSliceCfgReq(DuMacSliceCfgReq func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ MacSliceCfgReq *sliceCfgReq;
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceCfgReq, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, sliceCfgReq);
+ }
+ else
+ {
+ /* Nothing to do for other selectors */
+ DU_LOG("\nERROR --> DU APP : Only LWLC supported for Slice Cfg Request ");
+ ODU_PUT_MSG_BUF(mBuf);
+ }
+
+ return RFAILED;
+}
+
+/*******************************************************************
+ *
+ * @brief Pack and send Slice config response from MAC to DU APP
+ *
+ * @details
+ *
+ * Function : packDuMacSliceCfgRsp
+ *
+ * Functionality:
+ * Pack and send Slice config response from MAC to DU APP
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packDuMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacSliceCfgRsp");
+ return RFAILED;
+ }
+ /* pack the address of the structure */
+ CMCHKPK(oduPackPointer,(PTR)cfgRsp, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacSliceCfgRsp");
+ return RFAILED;
+ }
+
+ return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+ *
+ * @brief Unpack Slice Config Response from MAC to DU APP
+ *
+ * @details
+ *
+ * Function :unpackDuMacSliceCfgRsp
+ *
+ * Functionality: Unpack Slice Config Response from MAC to DU APP
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t unpackDuMacSliceCfgRsp(MacDuSliceCfgRspFunc func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ MacSliceCfgRsp *cfgRsp = NULLP;
+
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, cfgRsp);
+ }
+
+ ODU_PUT_MSG_BUF(mBuf);
+ return RFAILED;
+}
+
+
+/*******************************************************************
+ *
+ * @brief Pack and send Slice ReCfg request from MAC to DU APP
+ *
+ * @details
+ *
+ * Function : packDuMacSliceRecfgReq
+ *
+ * Functionality:
+ * Pack and send Slice ReCfg request from MAC to DU APP
+ *
+ * @params[in] Pst *pst, MacSliceCfgReq *sliceReCfgReq
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t packDuMacSliceRecfgReq(Pst *pst, MacSliceCfgReq *sliceReCfgReq)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in packDuMacSliceRecfgReq");
+ return RFAILED;
+ }
+ CMCHKPK(oduPackPointer,(PTR)sliceReCfgReq, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC: Only LWLC supported in packDuMacSliceRecfgReq");
+ return RFAILED;
+ }
+
+ return ODU_POST_TASK(pst,mBuf);
+
+}
+/*******************************************************************
+*
+* @brief Unpacks Slice ReCfg request received from DU APP
+*
+* @details
+*
+* Function : unpackMacSliceCfgReq
+*
+* Functionality:
+* Unpacks Slice ReCfg Request received from DU APP
+*
+* @params[in] Pointer to Handler
+* Post structure pointer
+* Message Buffer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackMacSliceReCfgReq(DuMacSliceRecfgReq func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ MacSliceCfgReq *sliceReCfgReq;
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceReCfgReq, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, sliceReCfgReq);
+ }
+ else
+ {
+ /* Nothing to do for other selectors */
+ DU_LOG("\nERROR --> DU APP : Only LWLC supported for Slice ReCfg Request ");
+ ODU_PUT_MSG_BUF(mBuf);
+ }
+
+ return RFAILED;
+}
+
+/*******************************************************************
+ *
+ * @brief Pack and send Slice config response from MAC to DU APP
+ *
+ * @details
+ *
+ * Function : packDuMacSliceReCfgRsp
+ *
+ * Functionality:
+ * Pack and send Slice config response from MAC to DU APP
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packDuMacSliceReCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacSliceReCfgRsp");
+ return RFAILED;
+ }
+ /* pack the address of the structure */
+ CMCHKPK(oduPackPointer,(PTR)cfgRsp, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacSliceReCfgRsp");
+ return RFAILED;
+ }
+
+ return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+ *
+ * @brief Unpack Slice ReConfig Response from MAC to DU APP
+ *
+ * @details
+ *
+ * Function :unpackDuMacSliceReCfgRsp
+ *
+ * Functionality: Unpack Slice ReConfig Response from MAC to DU APP
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t unpackDuMacSliceReCfgRsp(MacDuSliceReCfgRspFunc func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ MacSliceCfgRsp *cfgRsp = NULLP;
+
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, cfgRsp);
+ }
+
+ ODU_PUT_MSG_BUF(mBuf);
+ return RFAILED;
+}
/**********************************************************************
End of file
**********************************************************************/
#define EVENT_MAC_UE_DELETE_RSP 213
#define EVENT_MAC_CELL_DELETE_REQ 214
#define EVENT_MAC_CELL_DELETE_RSP 215
+#define EVENT_MAC_SLICE_CFG_REQ 216
+#define EVENT_MAC_SLICE_CFG_RSP 217
+#define EVENT_MAC_SLICE_RECFG_REQ 218
+#define EVENT_MAC_SLICE_RECFG_RSP 219
#define BSR_PERIODIC_TIMER_SF_10 10
#define BSR_RETX_TIMER_SF_320 320
MAC_DU_APP_RSP_OK
}MacRsp;
+typedef enum
+{
+ SLICE_PRESENT,
+ SLICE_NOT_PRESENT
+}RspReason;
+
typedef enum
{
SUCCESS,
PuschConfigCommon puschCommon;
}BwpUlConfig;
-/* Single Network Slice Selection assistance Info */
-
-typedef struct policyMemberList
+typedef struct plmnInfoList
{
- Plmn plmn;
- Snssai snssai;
-}PolicyMemberList;
-
-typedef struct rrmPolicy
-{
- ResourceType rsrcType;
- PolicyMemberList memberList;
- uint8_t policyMaxRatio;
- uint8_t policyMinRatio;
- uint8_t policyDedicatedRatio;
-}RrmPolicy;
+ Plmn plmn;
+ uint8_t numSupportedSlice; /* Total slice supporting */
+ Snssai **snssai; /* List of supporting snssai*/
+}PlmnInfoList;
typedef struct macCellCfg
{
BwpDlConfig initialDlBwp; /* Initial DL BWP */
BwpUlConfig initialUlBwp; /* Initial UL BWP */
uint8_t dmrsTypeAPos; /* DMRS Type A position */
- uint8_t numSupportedSlice; /* Total slice supporting */
- Snssai **snssai; /* List of supporting snssai*/
- RrmPolicy *rrmPolicy; /* RRM policy details */
+ PlmnInfoList plmnInfoList; /* Consits of PlmnId and Snssai list */
+ //RrmPolicy *rrmPolicy; /* RRM policy details */
}MacCellCfg;
typedef struct macCellCfgCfm
CellDeleteStatus result;
}MacCellDeleteRsp;
+typedef struct macSliceRsp
+{
+ Snssai snssai;
+ MacRsp rsp;
+ RspReason cause;
+}MacSliceRsp;
+
+typedef struct rrmPolicyRatio
+{
+ uint8_t policyMaxRatio;
+ uint8_t policyMinRatio;
+ uint8_t policyDedicatedRatio;
+}RrmPolicyRatio;
+
+typedef struct macSliceRrmPolicy
+{
+ Snssai snssai;
+ RrmPolicyRatio *rrmPolicyRatio;
+}MacSliceRrmPolicy;
+
+typedef struct macSliceCfgReq
+{
+ uint8_t numOfConfiguredSlice;
+ MacSliceRrmPolicy **listOfSliceCfg;
+}MacSliceCfgReq;
+
+typedef struct macSliceCfgRsp
+{
+ uint8_t numSliceCfgRsp;
+ MacSliceRsp **listOfSliceCfgRsp;
+}MacSliceCfgRsp;
+
/* Functions for slot Ind from MAC to DU APP*/
typedef uint8_t (*DuMacCellUpInd) ARGS((
Pst *pst,
Pst *pst,
MacCellDeleteRsp *cellDeleteRsp));
+/* Slice Cfg Request from DU APP to MAC*/
+typedef uint8_t (*DuMacSliceCfgReq) ARGS((
+ Pst *pst,
+ MacSliceCfgReq *CfgReq));
+
+/* Slice Cfg Response from MAC to DU APP */
+typedef uint8_t (*MacDuSliceCfgRspFunc) ARGS((
+ Pst *pst,
+ MacSliceCfgRsp *cfgRsp));
+
+/* Slice ReReCfg Request from DU APP to MAC*/
+typedef uint8_t (*DuMacSliceRecfgReq) ARGS((
+ Pst *pst,
+ MacSliceCfgReq *CfgReq));
+
+/* Slice ReReCfg Response from MAC to DU APP */
+typedef uint8_t (*MacDuSliceReCfgRspFunc) ARGS((
+ Pst *pst,
+ MacSliceCfgRsp *cfgRsp));
+
+
uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId);
uint8_t unpackMacCellUpInd(DuMacCellUpInd func, Pst *pst, Buffer *mBuf);
uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId);
uint8_t packDuMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp);
uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp);
uint8_t unpackDuMacCellDeleteRsp(MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf);
+uint8_t packDuMacSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq);
+uint8_t MacProcSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq);
+uint8_t unpackMacSliceCfgReq(DuMacSliceCfgReq func, Pst *pst, Buffer *mBuf);
+uint8_t DuProcMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp);
+uint8_t packDuMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp);
+uint8_t unpackDuMacSliceCfgRsp(MacDuSliceCfgRspFunc func, Pst *pst, Buffer *mBuf);
+uint8_t packDuMacSliceRecfgReq(Pst *pst, MacSliceCfgReq *sliceReCfgReq);
+uint8_t MacProcSliceReCfgReq(Pst *pst, MacSliceCfgReq *sliceReCfgReq);
+uint8_t unpackMacSliceReCfgReq(DuMacSliceRecfgReq func, Pst *pst, Buffer *mBuf);
+uint8_t DuProcMacSliceReCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp);
+uint8_t packDuMacSliceReCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp);
+uint8_t unpackDuMacSliceReCfgRsp(MacDuSliceReCfgRspFunc func, Pst *pst, Buffer *mBuf);
#endif
return ROK;
}
+/*******************************************************************
+ *
+ * @brief Pack and Send Slice Cfg request from MAC to SCH
+ *
+ * @details
+ *
+ * Function : packMacSchSliceCfgReq
+ *
+ * Functionality:
+ * Pack and Send Slice Cfg request from MAC to SCH
+ *
+ * @params[in] Pst *pst, SchSliceCfgReq *cfgReq
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packMacSchSliceCfgReq(Pst *pst, SchSliceCfgReq *cfgReq)
+{
+ if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
+ {
+ /* TODO */
+ }
+ else
+ {
+ return RFAILED;
+ }
+ return ROK;
+}
+
+/**
+ * @brief function to pack slice cfg rsp from SCH to MAC
+ *
+ * @details
+ *
+ * Function : packSchSliceCfgRsp
+ *
+ *
+ * @param[in] Pst *pst, SchSliceCfgRsp *cfgRsp
+ * @return S16 - ROK
+ **/
+uint8_t packSchSliceCfgRsp(Pst *pst, SchSliceCfgRsp *cfgRsp)
+{
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Pack and Send Slice ReCfg request from MAC to SCH
+ *
+ * @details
+ *
+ * Function : packMacSchSliceReCfgReq
+ *
+ * Functionality:
+ * Pack and Send Slice ReCfg request from MAC to SCH
+ *
+ * @params[in] Pst *pst, SchSliceCfgReq *cfgReq
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packMacSchSliceReCfgReq(Pst *pst, SchSliceCfgReq *cfgReq)
+{
+ if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
+ {
+ /* TODO */
+ }
+ else
+ {
+ return RFAILED;
+ }
+ return ROK;
+}
+
+/**
+ * @brief function to pack slice cfg rsp from SCH to MAC
+ *
+ * @details
+ *
+ * Function : packSchSliceReCfgRsp
+ *
+ *
+ * @param[in] Pst *pst, SchSliceCfgRsp *cfgRsp
+ * @return S16 - ROK
+ **/
+uint8_t packSchSliceReCfgRsp(Pst *pst, SchSliceCfgRsp *cfgRsp)
+{
+ return ROK;
+}
+
/**********************************************************************
End of file
**********************************************************************/
#define EVENT_CELL_DELETE_REQ_TO_SCH 17
#define EVENT_CELL_DELETE_RSP_TO_MAC 18
#define EVENT_LONG_BSR 19
-
+#define EVENT_SLICE_CFG_REQ_TO_SCH 20
+#define EVENT_SLICE_CFG_RSP_TO_MAC 21
+#define EVENT_SLICE_RECFG_REQ_TO_SCH 22
+#define EVENT_SLICE_RECFG_RSP_TO_MAC 23
/*macros*/
#define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
RRC_CONNECTED_USERS_RSRC
}SchResourceType;
+typedef enum
+{
+ SLICE_FOUND,
+ SLICE_NOT_FOUND
+}RspCause;
+
typedef enum
{
NO_TRANSMISSION,
SchK2TimingInfoTbl k2InfoTbl;
}SchBwpUlCfg;
-typedef struct schPolicyMemberList
+typedef struct schPlmnInfoList
{
- Plmn plmn;
- Snssai snssai;
-}SchPolicyMemberList;
-
-typedef struct schRrmPolicy
-{
- SchResourceType rsrcType;
- SchPolicyMemberList memberList;
- uint8_t policyMaxRatio;
- uint8_t policyMinRatio;
- uint8_t policyDedicatedRatio;
-}SchRrmPolicy;
+ Plmn plmn;
+ uint8_t numSliceSupport; /* Total slice supporting */
+ Snssai **snssai; /* List of supporting snssai*/
+}SchPlmnInfoList;
typedef struct schCellCfg
{
SchRachCfg schRachCfg; /* PRACH config */
SchBwpDlCfg schInitialDlBwp; /* Initial DL BWP */
SchBwpUlCfg schInitialUlBwp; /* Initial UL BWP */
- uint8_t numSliceSupport; /* Total num of slice support */
- Snssai **snssai; /* List of supporting snssai*/
- SchRrmPolicy *rrmPolicy; /* RRM policy */
+ SchPlmnInfoList plmnInfoList; /* Consits of PlmnId and Snssai list */
#ifdef NR_TDD
TDDCfg tddCfg; /* TDD Cfg */
#endif
uint8_t srPayload[MAX_SR_BITS_IN_BYTES];
}SrUciIndInfo;
-/* function pointers */
+typedef struct schRrmPolicyRatio
+{
+ uint8_t policyMaxRatio;
+ uint8_t policyMinRatio;
+ uint8_t policyDedicatedRatio;
+}SchRrmPolicyRatio;
+
+typedef struct schRrmPolicyOfSlice
+{
+ Snssai snssai;
+ SchRrmPolicyRatio *rrmPolicyRatioInfo;
+}SchRrmPolicyOfSlice;
+
+typedef struct schSliceCfgReq
+{
+ uint8_t numOfConfiguredSlice;
+ SchRrmPolicyOfSlice **listOfConfirguration;
+}SchSliceCfgReq;
+typedef struct sliceRsp
+{
+ Snssai snssai;
+ SchMacRsp rsp;
+ RspCause cause;
+}SliceRsp;
+
+typedef struct schSliceRsp
+{
+ uint8_t numSliceCfgRsp;
+ SliceRsp **listOfSliceCfgRsp;
+}SchSliceCfgRsp;
+
+/* function pointers */
typedef uint8_t (*SchCellCfgCfmFunc) ARGS((
Pst *pst, /* Post Structure */
SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
Pst *pst, /* Post structure */
SchCellDeleteRsp *schCellDeleteRsp)); /* Scheduler UE delete response */
+typedef uint8_t (*MacSchSliceCfgReqFunc) ARGS((
+ Pst *pst, /* Post structure */
+ SchSliceCfgReq *schSliceCfgReq)); /* Scheduler Slice Cfg Req */
+
+typedef uint8_t (*SchSliceCfgRspFunc) ARGS((
+ Pst *pst, /* Post Structure */
+ SchSliceCfgRsp *schSliceCfgRsp /* Cell Cfg Cfm */
+ ));
+
+typedef uint8_t (*MacSchSliceReCfgReqFunc) ARGS((
+ Pst *pst, /* Post structure */
+ SchSliceCfgReq *schSliceReCfgReq)); /* Scheduler Slice ReCfg Req */
+
+typedef uint8_t (*SchSliceReCfgRspFunc) ARGS((
+ Pst *pst, /* Post Structure */
+ SchSliceCfgRsp *schSliceReCfgRsp /* Cell ReCfg Cfm */
+ ));
/* function declarations */
uint8_t packMacSchSlotInd(Pst *pst, SlotTimingInfo *slotInd);
uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
uint8_t MacSchCellDeleteReq(Pst *pst, SchCellDelete *schCellDelete);
uint8_t packSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDeleteRsp);
uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDeleteRsp);
-
+uint8_t packMacSchSliceCfgReq(Pst *pst, SchSliceCfgReq *cfgReq);
+uint8_t MacSchSliceCfgReq(Pst *pst, SchSliceCfgReq *schSliceCfgReq);
+uint8_t packSchSliceCfgRsp(Pst *pst, SchSliceCfgRsp *cfgRsp);
+uint8_t MacProcSchSliceCfgRsp(Pst *pst, SchSliceCfgRsp *cfgRsp);
+uint8_t packMacSchSliceReCfgReq(Pst *pst, SchSliceCfgReq *cfgReq);
+uint8_t MacSchSliceReCfgReq(Pst *pst, SchSliceCfgReq *schSliceCfgReq);
+uint8_t packSchSliceReCfgRsp(Pst *pst, SchSliceCfgRsp *cfgRsp);
+uint8_t MacProcSchSliceReCfgRsp(Pst *pst, SchSliceCfgRsp *sliceReCfgrsp);
/**********************************************************************
End of file
**********************************************************************/
* ****************************************************************/
uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId)
{
- DuCellCb *cellCb = NULLP;
-
+ DuCellCb *cellCb = NULLP;
+
if(cellId->cellId <=0 || cellId->cellId > MAX_NUM_CELL)
{
DU_LOG("\nERROR --> DU APP : Invalid Cell Id %d in duHandleCellUpInd()", cellId->cellId);
DU_LOG("\nINFO --> DU APP : 5G-NR Cell %d is UP", cellId->cellId);
cellCb->cellStatus = ACTIVATED;
gCellStatus = CELL_UP;
-
+
+ if(duCfgParam.tempSliceCfg.rrmPolicy)
+ BuildAndSendSliceConfigReq(duCfgParam.tempSliceCfg.rrmPolicy, duCfgParam.tempSliceCfg.totalRrmPolicy, duCfgParam.tempSliceCfg.totalSliceCount);
#ifdef O1_ENABLE
DU_LOG("\nINFO --> DU APP : Raise cell UP alarm for cell id=%d", cellId->cellId);
raiseCellAlrm(CELL_UP_ALARM_ID, cellId->cellId);
uint8_t duProcCellsToBeActivated(uint8_t *plmnStr, uint16_t nci, uint16_t nRPci);
void duProcF1SetupRsp();
uint8_t duGetCellCb(uint16_t cellId, DuCellCb **cellCb);
+uint8_t BuildAndSendSliceConfigReq(RrmPolicy *rrmPolicy[], uint8_t totalRrrmPolicy, uint8_t totalSliceCfgReq);
+uint8_t BuildAndSendSliceReCfgReq(RrmPolicy *rrmPolicy[], uint8_t totalRrmPolicy, uint8_t totalSliceReCfg);
#endif
/**********************************************************************
End of file
extern StartupConfig g_cfg;
#endif
-DuCfgParams duCfgParam;
char encBuf[ENC_BUF_MAX_LEN];
duCfgParam.macCellCfg.initialUlBwp.pucchCommon.pucchResourceCommon = PUCCH_RSRC_COMMON;
duCfgParam.macCellCfg.initialUlBwp.pucchCommon.pucchGroupHopping = PUCCH_GROUP_HOPPING;
- /* SNSSAI And RRM policy Configuration */
+ /* Plmn And SNSSAI Configuration */
+ memset(&duCfgParam.macCellCfg.plmnInfoList.plmn, &duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn,\
+ sizeof(Plmn));
taiSliceSuppLst = &duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].taiSliceSuppLst;
- duCfgParam.macCellCfg.numSupportedSlice = taiSliceSuppLst->numSupportedSlices;
+ duCfgParam.macCellCfg.plmnInfoList.numSupportedSlice = taiSliceSuppLst->numSupportedSlices;
if(taiSliceSuppLst->snssai)
{
- DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.snssai, (duCfgParam.macCellCfg.numSupportedSlice) * sizeof(Snssai*));
- if(duCfgParam.macCellCfg.snssai == NULLP)
+ DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.plmnInfoList.snssai, (duCfgParam.macCellCfg.plmnInfoList.numSupportedSlice) * sizeof(Snssai*));
+ if(duCfgParam.macCellCfg.plmnInfoList.snssai == NULLP)
{
DU_LOG("\nERROR --> DU_APP: Memory allocation failed at readMacCfg");
return RFAILED;
{
if(taiSliceSuppLst->snssai[sliceIdx] != NULLP)
{
- DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.snssai[sliceIdx], sizeof(Snssai));
- if(duCfgParam.macCellCfg.snssai[sliceIdx] == NULLP)
+ DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.plmnInfoList.snssai[sliceIdx], sizeof(Snssai));
+ if(duCfgParam.macCellCfg.plmnInfoList.snssai[sliceIdx] == NULLP)
{
DU_LOG("\nERROR --> DU_APP: Memory allocation failed at readMacCfg");
return RFAILED;
}
- memcpy(duCfgParam.macCellCfg.snssai[sliceIdx], taiSliceSuppLst->snssai[sliceIdx], sizeof(Snssai));
+ memcpy(duCfgParam.macCellCfg.plmnInfoList.snssai[sliceIdx], taiSliceSuppLst->snssai[sliceIdx], sizeof(Snssai));
}
}
-
- DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.rrmPolicy, sizeof(RrmPolicy));
- if(duCfgParam.macCellCfg.rrmPolicy == NULLP)
- {
- DU_LOG("\nERROR --> DU_APP: Memory allocation failed at readMacCfg");
- return RFAILED;
- }
- memset(duCfgParam.macCellCfg.rrmPolicy, 0, sizeof(RrmPolicy));
- /* TODO Check the exact data type of resource type once will receive the
- * information from O1 interface */
- duCfgParam.macCellCfg.rrmPolicy->rsrcType = RSRC_PRB;
- memcpy(&duCfgParam.macCellCfg.rrmPolicy->memberList.snssai, duCfgParam.macCellCfg.snssai[DEDICATED_SLICE_INDEX],\
- sizeof(Snssai));
- duCfgParam.macCellCfg.rrmPolicy->policyMaxRatio = MAX_RATIO;
- duCfgParam.macCellCfg.rrmPolicy->policyMinRatio = MIN_RATIO;
- duCfgParam.macCellCfg.rrmPolicy->policyDedicatedRatio = DEDICATED_RATIO;
-
return ROK;
}
return ROK;
}
+/*******************************************************************
+ *
+ * @brief Copy Slice Cfg in temp structre in duCfgParams
+ *
+ * @details
+ *
+ * Function : cpyRrmPolicyInDuCfgParams
+ *
+ * Functionality:
+ * - Copy Slice Cfg in temp structre in duCfgParams
+ *
+ * @params[in] RrmPolicy rrmPolicy[], uint8_t policyNum, uint8_t memberList
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t cpyRrmPolicyInDuCfgParams(RrmPolicy rrmPolicy[], uint8_t policyNum, uint8_t memberList, CopyOfRecvdSliceCfg *tempSliceCfg)
+{
+ uint8_t policyIdx = 0, memberListIdx = 0, count = 0;
+
+ if(policyNum)
+ {
+ tempSliceCfg->totalRrmPolicy = policyNum;
+ DU_ALLOC(tempSliceCfg->rrmPolicy, tempSliceCfg->totalRrmPolicy * sizeof(RrmPolicy*));
+ if(tempSliceCfg->rrmPolicy == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
+ return RFAILED;
+ }
+
+ for(policyIdx = 0; policyIdx<tempSliceCfg->totalRrmPolicy; policyIdx++)
+ {
+ DU_ALLOC(tempSliceCfg->rrmPolicy[policyIdx], sizeof(RrmPolicy));
+ if(tempSliceCfg->rrmPolicy[policyIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
+ return RFAILED;
+ }
+
+ if(memberList)
+ {
+ tempSliceCfg->rrmPolicy[policyIdx]->numMemberList = rrmPolicy[policyIdx].numMemberList;
+ DU_ALLOC(tempSliceCfg->rrmPolicy[policyIdx]->memberList, tempSliceCfg->rrmPolicy[policyIdx]->numMemberList * sizeof(PolicyMemberList*))
+ if(tempSliceCfg->rrmPolicy[policyIdx]->memberList == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
+ return RFAILED;
+ }
+
+ for(memberListIdx = 0; memberListIdx<tempSliceCfg->rrmPolicy[policyIdx]->numMemberList; memberListIdx++)
+ {
+ DU_ALLOC(tempSliceCfg->rrmPolicy[policyIdx]->memberList[memberListIdx], sizeof(PolicyMemberList))
+ if(tempSliceCfg->rrmPolicy[policyIdx]->memberList[memberListIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
+ return RFAILED;
+ }
+ memcpy(&tempSliceCfg->rrmPolicy[policyIdx]->memberList[memberListIdx]->snssai, &rrmPolicy[policyIdx].memberList[memberListIdx]->snssai, sizeof(Snssai));
+ memcpy(&tempSliceCfg->rrmPolicy[policyIdx]->memberList[memberListIdx]->plmn, &rrmPolicy[policyIdx].memberList[memberListIdx]->plmn, sizeof(Plmn));
+ count++;
+ }
+ }
+
+ tempSliceCfg->rrmPolicy[policyIdx]->rsrcType = RSRC_PRB;
+ tempSliceCfg->rrmPolicy[policyIdx]->policyMaxRatio = rrmPolicy[policyIdx].policyMaxRatio;
+ tempSliceCfg->rrmPolicy[policyIdx]->policyMinRatio = rrmPolicy[policyIdx].policyMinRatio;
+ tempSliceCfg->rrmPolicy[policyIdx]->policyDedicatedRatio = rrmPolicy[policyIdx].policyDedicatedRatio;
+
+ }
+ tempSliceCfg->totalSliceCount = count;
+ }
+ return ROK;
+}
/*******************************************************************
*
* @brief Reads config and posts message to du_app on completion
SrvCellCfgCommSib srvCellCfgCommSib;
}Sib1Params;
+typedef struct policyMemberList
+{
+ Plmn plmn;
+ Snssai snssai;
+}PolicyMemberList;
+
+typedef struct rrmPolicy
+{
+ ResourceType rsrcType;
+ uint8_t numMemberList;
+ PolicyMemberList **memberList;
+ uint8_t policyMaxRatio;
+ uint8_t policyMinRatio;
+ uint8_t policyDedicatedRatio;
+}RrmPolicy;
+
+typedef struct copyOfRecvdSliceCfg
+{
+ RrmPolicy **rrmPolicy;
+ uint8_t totalRrmPolicy;
+ uint8_t totalSliceCount;
+}CopyOfRecvdSliceCfg;
+
typedef struct duCfgParams
{
SctpParams sctpParams; /* SCTP Params */
MacCellCfg macCellCfg; /* MAC cell configuration */
MibParams mibParams; /* MIB Params */
Sib1Params sib1Params; /* SIB1 Params */
+ CopyOfRecvdSliceCfg tempSliceCfg;
}DuCfgParams;
+DuCfgParams duCfgParam;
+
/*function declarations */
void FillSlotConfig();
uint8_t readClCfg();
uint8_t readCfg();
uint8_t duReadCfg();
uint16_t calcSliv(uint8_t startSymbol, uint8_t lengthSymbol);
+uint8_t cpyRrmPolicyInDuCfgParams(RrmPolicy rrmPolicy[], uint8_t policyNum, uint8_t memberList, CopyOfRecvdSliceCfg *tempSliceCfg);
#endif /* __DU_CONFIG_H__ */
#define DU_SET_ZERO(_buf, _size) \
memset((_buf), 0, _size);
+typedef enum
+{
+ SLICE_INFO_NOT_AVAILABLE,
+ SLICE_CONFIGURED,
+ SLICE_RECONFIGURED
+}SliceCfgState;
+
typedef enum
{
CELL_OUT_OF_SERVICE,
uint8_t numDrb; /* current number of DRbs*/
UpTnlCfg* upTnlCfg[MAX_NUM_DRB]; /* tunnel info for every Drb */
CmLListCp reservedF1apPduList; /*storing F1AP pdu infomation and transId */
+ SliceCfgState sliceState;
}DuCb;
}
#ifdef O1_ENABLE
+
+/*******************************************************************
+ *
+ * @brief update Rrm Policy at DU and process the slice cfg request
+ *
+ * @details
+ *
+ * Function : updateRrmPolicy
+ *
+ * Functionality:
+ * - update Rrm Policy at DU and process the slice cfg request
+ *
+ * @params[in] RrmPolicy rrmPolicy[], uint8_t policyNum, uint8_t memberList
+ * @return true - success
+ * false - failure
+ *
+ * ****************************************************************/
+uint8_t updateRrmPolicy(RrmPolicy rrmPolicy[], uint8_t policyNum, \
+ uint8_t memberList)
+{
+ DuCellCb *cellCb = NULLP;
+
+ cpyRrmPolicyInDuCfgParams(rrmPolicy, policyNum, memberList, &duCfgParam.tempSliceCfg);
+ cellCb = duCb.actvCellLst[0];
+
+ if(cellCb)
+ {
+ if(cellCb->cellStatus == ACTIVATED)
+ {
+ if(duCb.sliceState == SLICE_INFO_NOT_AVAILABLE)
+ {
+ BuildAndSendSliceConfigReq(duCfgParam.tempSliceCfg.rrmPolicy, duCfgParam.tempSliceCfg.totalRrmPolicy,\
+ duCfgParam.tempSliceCfg.totalSliceCount);
+ }
+ else
+ {
+ BuildAndSendSliceReCfgReq(duCfgParam.tempSliceCfg.rrmPolicy, duCfgParam.tempSliceCfg.totalRrmPolicy,\
+ duCfgParam.tempSliceCfg.totalSliceCount);
+ }
+ }
+ }
+}
+
/*******************************************************************
*
* @brief Bring the cell Up
DU_LOG("\nERROR --> DU_APP : System Task creation for DU APP failed");
return RFAILED;
}
- ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 16, 0);
+ //ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 16, 0);
/* system task for EGTP */
if(ODU_CREATE_TASK(PRIOR0, &egtp_stsk) != ROK)
DU_LOG("\nERROR --> DU_APP : System Task creation for EGTP failed");
return RFAILED;
}
- ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 17, 0);
+ //ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 17, 0);
/* system task for RLC_DL and MAC */
if(ODU_CREATE_TASK(PRIOR0, &rlc_mac_cl_stsk) != ROK)
}
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 18, 0);
+ //ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 18, 0);
/* system task for RLC UL */
if(ODU_CREATE_TASK(PRIOR1, &rlc_ul_stsk) != ROK)
DU_LOG("\nERROR --> DU_APP : System Task creation for RLC UL failed");
return RFAILED;
}
- ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 19, 0);
+ //ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 19, 0);
/* system task for SCTP receiver thread */
if(ODU_CREATE_TASK(PRIOR0, &sctp_stsk) != ROK)
DU_LOG("\nERROR --> DU_APP : System Task creation for SCTP failed");
return RFAILED;
}
- ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 20, 0);
+ //ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 20, 0);
/* system task for lower-mac receiver thread */
if(ODU_CREATE_TASK(PRIOR0, &lwr_mac_stsk) != ROK)
DU_LOG("\nERROR --> DU_APP : System Task creation for Lower MAC failed");
return RFAILED;
}
- ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0);
+ //ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0);
#ifndef INTEL_WLS_MEM
/* system task for phy stub's slot indication generator thread */
strcpy(message,"EVENT_MAC_CELL_DELETE_RSP");
break;
}
+ case EVENT_MAC_SLICE_CFG_RSP:
+ {
+ strcpy(message,"EVENT_MAC_SLICE_CFG_RSP");
+ break;
+ }
+ case EVENT_MAC_SLICE_RECFG_RSP:
+ {
+ strcpy(message,"EVENT_MAC_SLICE_RECFG_RSP");
+ break;
+ }
default:
{
strcpy(message,"Invalid Event");
ret = unpackDuMacCellDeleteRsp(DuProcMacCellDeleteRsp, pst, mBuf);
break;
}
+ case EVENT_MAC_SLICE_CFG_RSP:
+ {
+ ret = unpackDuMacSliceCfgRsp(DuProcMacSliceCfgRsp, pst, mBuf);
+ break;
+ }
+ case EVENT_MAC_SLICE_RECFG_RSP:
+ {
+ ret = unpackDuMacSliceReCfgRsp(DuProcMacSliceReCfgRsp, pst, mBuf);
+ break;
+ }
default:
{
DU_LOG("\nERROR --> DU_APP : Invalid event received at duActvTsk from ENTMAC");
packMacCellStop /* Light weight-loose coupling */
};
+DuMacSliceCfgReq packMacSliceCfgReqOpts[] =
+{
+ packDuMacSliceCfgReq, /* Loose coupling */
+ MacProcSliceCfgReq, /* TIght coupling */
+ packDuMacSliceCfgReq /* Light weight-loose coupling */
+};
+
+
+DuMacSliceRecfgReq packMacSliceReCfgReqOpts[] =
+{
+ packDuMacSliceRecfgReq, /* Loose coupling */
+ MacProcSliceReCfgReq, /* TIght coupling */
+ packDuMacSliceRecfgReq /* Light weight-loose coupling */
+};
/**************************************************************************
* @brief Function to fill configs required by RLC
*
return ROK;
}
+/*******************************************************************
+ *
+ * @brief Free tempSLiceCfg stored in duCfgParams
+ *
+ * @details
+ *
+ * Function : duFreeTempSliceCfg
+ *
+ * Functionality: Free tempSLiceCfg stored in duCfgParams
+ *
+ * @params[in] Post structure,
+ *
+ * @return Void
+ *
+ * ****************************************************************/
+
+void duFreeTempSliceCfg()
+{
+ uint8_t policyIdx = 0, memberListTdx =0;
+ CopyOfRecvdSliceCfg *tempSliceCfg = &duCfgParam.tempSliceCfg;
+
+ if(tempSliceCfg->totalRrmPolicy)
+ {
+ for(policyIdx = 0; policyIdx<tempSliceCfg->totalRrmPolicy; policyIdx++)
+ {
+ if(tempSliceCfg->rrmPolicy[policyIdx]->numMemberList)
+ {
+ for(memberListTdx = 0; memberListTdx<tempSliceCfg->rrmPolicy[policyIdx]->numMemberList; memberListTdx++)
+ {
+ DU_FREE(tempSliceCfg->rrmPolicy[policyIdx]->memberList[memberListTdx], sizeof(PolicyMemberList));
+ }
+ DU_FREE(tempSliceCfg->rrmPolicy[policyIdx]->memberList, (tempSliceCfg->rrmPolicy[policyIdx]->numMemberList) * sizeof(PolicyMemberList*));
+ }
+ DU_FREE(tempSliceCfg->rrmPolicy[policyIdx], sizeof(RrmPolicy));
+ }
+ DU_FREE(tempSliceCfg->rrmPolicy, tempSliceCfg->totalRrmPolicy* sizeof(RrmPolicy*));
+ }
+ memset(tempSliceCfg, 0, sizeof(CopyOfRecvdSliceCfg));
+}
+
+/*******************************************************************
+ *
+ * @brief free the slice cfg rsp
+ *
+ * @details
+ *
+ * Function : duFreeSliceCfgRsp
+ *
+ * Functionality: free the slice cfg rsp
+ *
+ * @params[in] Post structure, MacSliceCfgRsp *cfgRsp
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ **********************************************************************/
+void duFreeSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp)
+{
+ uint8_t cfgIdx;
+
+ if(cfgRsp)
+ {
+ if(cfgRsp->numSliceCfgRsp)
+ {
+ for(cfgIdx = 0; cfgIdx<cfgRsp->numSliceCfgRsp; cfgIdx++)
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp->listOfSliceCfgRsp[cfgIdx], sizeof(MacSliceRsp));
+ }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp->listOfSliceCfgRsp, cfgRsp->numSliceCfgRsp * sizeof(MacSliceRsp*));
+ }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(MacSliceCfgRsp));
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief process the slice cfg rsp received from MAC
+ *
+ * @details
+ *
+ * Function : DuProcMacSliceCfgRsp
+ *
+ * Functionality: process the slice cfg rsp received from MAC
+ *
+ * @params[in] Post structure, MacSliceCfgRsp *cfgRsp
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ **********************************************************************/
+uint8_t DuProcMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp)
+{
+ uint8_t cfgIdx = 0;
+
+ if(cfgRsp)
+ {
+ if(cfgRsp->listOfSliceCfgRsp)
+ {
+ for(cfgIdx = 0; cfgIdx<cfgRsp->numSliceCfgRsp; cfgIdx++)
+ {
+ if(cfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp == MAC_DU_APP_RSP_OK)
+ {
+ duCb.sliceState = SLICE_CONFIGURED;
+ }
+ }
+ DU_LOG("\nINFO --> DU_APP : Slice Configuration is done sucessfully ");
+ }
+ duFreeSliceCfgRsp(pst, cfgRsp);
+ }
+ duFreeTempSliceCfg();
+}
+
+/*******************************************************************
+ *
+ * @brief Fill the slice configration and rrm policy ratio
+ * information received form O1
+ *
+ * @details
+ *
+ * Function : fillSliceCfgReCfgInfo
+ *
+ * Functionality: Fill the slice configration and recfg info
+ *
+ * @params[in] Post structure
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t fillSliceCfgReCfgInfo(MacSliceCfgReq *sliceCfgReq, RrmPolicy *rrmPolicy[], uint8_t totalRrmPolicy, uint8_t totalSliceCount)
+{
+ uint8_t sliceIdx = 0, cfgIdx = 0, memberListIdx = 0;
+
+ if(totalRrmPolicy)
+ {
+ DU_ALLOC_SHRABL_BUF(sliceCfgReq->listOfSliceCfg, totalSliceCount*sizeof(MacSliceRrmPolicy*));
+ if(sliceCfgReq->listOfSliceCfg == NULLP)
+ {
+ DU_LOG("\nERROR --> DU_APP : Memory allocation failed in fillSliceCfgReCfgInfo");
+ return RFAILED;
+ }
+
+ for(sliceIdx = 0; sliceIdx<totalRrmPolicy; sliceIdx++)
+ {
+ for(memberListIdx = 0; memberListIdx<rrmPolicy[sliceIdx]->numMemberList; memberListIdx++)
+ {
+ DU_ALLOC_SHRABL_BUF(sliceCfgReq->listOfSliceCfg[cfgIdx], sizeof(MacSliceRrmPolicy));
+ if(sliceCfgReq->listOfSliceCfg[cfgIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> DU_APP : Memory allocation failed in fillSliceCfgReCfgInfo");
+ return RFAILED;
+ }
+
+
+ memcpy(&sliceCfgReq->listOfSliceCfg[cfgIdx]->snssai, &rrmPolicy[sliceIdx]->memberList[memberListIdx]->snssai, sizeof(Snssai));
+
+ DU_ALLOC_SHRABL_BUF(sliceCfgReq->listOfSliceCfg[cfgIdx]->rrmPolicyRatio, sizeof(RrmPolicyRatio));
+ if(sliceCfgReq->listOfSliceCfg[cfgIdx]->rrmPolicyRatio == NULLP)
+ {
+ DU_LOG("\nERROR --> DU_APP : Memory allocation failed in fillSliceCfgReCfgInfo");
+ return RFAILED;
+ }
+
+ sliceCfgReq->listOfSliceCfg[cfgIdx]->rrmPolicyRatio->policyMaxRatio = rrmPolicy[sliceIdx]->policyMaxRatio;
+ sliceCfgReq->listOfSliceCfg[cfgIdx]->rrmPolicyRatio->policyMinRatio = rrmPolicy[sliceIdx]->policyMinRatio;
+ sliceCfgReq->listOfSliceCfg[cfgIdx]->rrmPolicyRatio->policyDedicatedRatio = rrmPolicy[sliceIdx]->policyDedicatedRatio;
+ sliceCfgReq->numOfConfiguredSlice++;
+ cfgIdx++;
+ }
+ }
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fill the slice configration and rrm policy related
+ * information received form O1
+ *
+ * @details
+ *
+ * Function : BuildAndSendSliceConfigReq
+ *
+ * Functionality: Fill the slice configration and rrm policy related
+ *
+ * @params[in] RrmPolicy *rrmPolicy[], uint8_t totalRrmPolicy, uint8_t
+ * totalSliceCnt
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildAndSendSliceConfigReq(RrmPolicy *rrmPolicy[], uint8_t totalRrmPolicy, uint8_t totalSliceCnt)
+{
+ Pst pst;
+ MacSliceCfgReq *sliceCfgReq;
+
+ DU_ALLOC_SHRABL_BUF(sliceCfgReq, sizeof(MacSliceCfgReq));
+ if(sliceCfgReq == NULLP)
+ {
+ DU_LOG("\nERROR --> DU_APP : Memory allocation failed in BuildAndSendSliceConfigReq");
+ return RFAILED;
+ }
+ else
+ {
+ if(fillSliceCfgReCfgInfo(sliceCfgReq, rrmPolicy, totalRrmPolicy, totalSliceCnt) != ROK)
+ {
+ DU_LOG("\nERROR --> DU_APP : Failed to fill slice Configuration info in MacSliceCfgReq");
+ return RFAILED;
+ }
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_SLICE_CFG_REQ);
+
+ DU_LOG("\nDEBUG --> DU_APP : Sending Slice Cfg Request to MAC ");
+ if((*packMacSliceCfgReqOpts[pst.selector])(&pst, sliceCfgReq) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU_APP : Failed to send Slice Cfg Req to MAC");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, sliceCfgReq, sizeof(MacSliceCfgReq));
+ }
+ }
+ return ROK;
+}
+
+
+/*******************************************************************
+ *
+ * @brief Fill the slice configration and rrm policy related
+ * information received form O1
+ *
+ * @details
+ *
+ * Function : BuildAndSendSliceReCfgReq
+ *
+ * Functionality: Fill the slice configration and rrm policy related
+ *
+ * @params[in] RrmPolicy rrmPolicy[], uint8_t totalSliceCount
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildAndSendSliceReCfgReq(RrmPolicy *rrmPolicy[], uint8_t totalRrmPolicy, uint8_t totalSliceCount)
+{
+ Pst pst;
+ MacSliceCfgReq *sliceReCfgReq = NULLP;
+
+ DU_LOG("\nINFO --> DU_APP : Slice ReConfiguration Request received");
+
+ DU_ALLOC_SHRABL_BUF(sliceReCfgReq, sizeof(MacSliceCfgReq));
+ if(sliceReCfgReq == NULLP)
+ {
+ DU_LOG("\nERROR --> DU_APP : Memory allocation failed to BuildAndSendSliceReCfgReq");
+ return RFAILED;
+ }
+ else
+ {
+ if(fillSliceCfgReCfgInfo(sliceReCfgReq, rrmPolicy, totalRrmPolicy, totalSliceCount) != ROK)
+ {
+ DU_LOG("\nERROR --> DU_APP: Failed to fill slice cfg request info");
+ return RFAILED;
+ }
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_SLICE_RECFG_REQ);
+
+ DU_LOG("\nDEBUG --> DU_APP: Sending Slice ReCfg Request to MAC ");
+ if( (*packMacSliceReCfgReqOpts[pst.selector])(&pst, sliceReCfgReq) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU_APP: Failed to send Slice ReCfg Req to MAC");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, sliceReCfgReq, sizeof(MacSliceCfgReq));
+ }
+ }
+ return ROK;
+}
+/*******************************************************************
+ *
+ * @brief process the slice ReCfg rsp received from MAC
+ *
+ * @details
+ *
+ * Function : DuProcMacSliceReCfgRsp
+ *
+ * Functionality: process the slice ReCfg rsp received from MAC
+ *
+ * @params[in] Post structure, MacSliceCfgRsp *ReCfgRsp
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ **********************************************************************/
+uint8_t DuProcMacSliceReCfgRsp(Pst *pst, MacSliceCfgRsp *reCfgRsp)
+{
+ uint8_t cfgIdx = 0, sliceIdx =0;
+
+ if(reCfgRsp)
+ {
+ if(reCfgRsp->listOfSliceCfgRsp)
+ {
+ for(cfgIdx = 0; cfgIdx < reCfgRsp->numSliceCfgRsp; cfgIdx++)
+ {
+ if(reCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp == MAC_DU_APP_RSP_OK)
+ {
+ duCb.sliceState = SLICE_RECONFIGURED;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP : Slice not available");
+ }
+ }
+ DU_LOG("\nINFO --> DU_APP : Slice ReCOnfiguration response received");
+ }
+ duFreeSliceCfgRsp(pst, reCfgRsp);
+ }
+ duFreeTempSliceCfg();
+ return ROK;
+}
/**********************************************************************
End of file
**********************************************************************/