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;
RlcSn mSn;
uint8_t fByte;
bool discFlg;
-#ifdef LTE_L2_MEAS_RLC
- MsgLen rlcSduSz; /*Holds length of Rlc Sdu*/
-#endif /* LTE_L2_MEAS */
+ RlcTptPerSnssai *snssaiTputNode = NULLP;
+ MsgLen pduSz = 0; /*Holds length of Rlc Sdu*/
amUl = &RLC_AMUL;
numPduToProcess = RLC_MIN(pduInfo->numPdu, RGU_MAX_PDU);
DU_LOG("\nDEBUG --> RLC_UL : rlcAmmProcessPdus: numPdu[%d],numPduToProcess[%d] UEID:%d CELLID:%d",
- numPdu, numPduToProcess, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+ numPdu, numPduToProcess, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
while (numPdu < numPduToProcess)
{
discFlg = FALSE;
pdu = pduInfo->mBuf[numPdu++];
-
+ snssaiTputNode = NULLP;
if (! pdu)
{
DU_LOG("\nERROR --> RLC_UL : rlcAmmProcessPdus: Null Pdu UEID:%d CELLID:%d",
- rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+ rbCb->rlcId.ueId, rbCb->rlcId.cellId);
gCb->genSts.errorPdusRecv++;
break;
}
if (rlcAmmExtractHdr(gCb, rbCb, pdu, &amHdr, &fByte) != ROK)
{
DU_LOG("\nERROR --> RLC_UL : rlcAmmProcessPdus: Header Extraction Failed UEID:%d CELLID:%d",
- rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+ rbCb->rlcId.ueId, rbCb->rlcId.cellId);
ODU_PUT_MSG_BUF(pdu);
gCb->genSts.errorPdusRecv++;
continue;
if((amHdr.si == RLC_SI_LAST_SEG) && (!amHdr.so))
{
DU_LOG("\nERROR --> RLC_UL : rlcAmmProcessPdus: Dropping PDU because SO can't be zero\
- for last segment sn:%u UEID:%d CELLID:%d", amHdr.sn, rbCb->rlcId.ueId,
- rbCb->rlcId.cellId);
+ for last segment sn:%u UEID:%d CELLID:%d", amHdr.sn, rbCb->rlcId.ueId,
+ rbCb->rlcId.cellId);
ODU_PUT_MSG_BUF(pdu);
continue;
}
#ifndef TENB_ACC
#ifndef TENB_T2K3K_SPECIFIC_CHANGES
#ifndef LTE_PAL_ENB
- /* Changed the condition to TRUE from ROK */
+ /* Changed the condition to TRUE from ROK */
if(isMemThreshReached(rlcCb[0]->init.region) == TRUE)
{
uint32_t rlculdrop;
- rlculdrop++;
- ODU_PUT_MSG_BUF(pdu);
- continue;
+ rlculdrop++;
+ ODU_PUT_MSG_BUF(pdu);
+ continue;
}
#endif
#else
rlcUtlCalUlIpThrPut(gCb, rbCb, pdu, ttiCnt);
#endif /* LTE_L2_MEAS */
+ if(rbCb->snssai)
+ {
+ snssaiTputNode = rlcHandleSnssaiTputlist(gCb, rbCb->snssai, SEARCH, DIR_UL);
+ if(snssaiTputNode != NULLP)
+ {
+ ODU_GET_MSG_LEN(pdu, &pduSz);
+ snssaiTputNode->dataVol += (uint64_t)pduSz;
+ DU_LOG("\nINFO --> RLC_UL: SNSSAI AMM_UL List PduLen:%d, lcId:%d, total :%ld",\
+ pduSz, rbCb->lch.lChId, snssaiTputNode->dataVol);
+ }
+ }
/* Update rxNextHighestRcvd */
MODAMR(sn, mSn, amUl->rxNext, amUl->snModMask);
MODAMR(amUl->rxNextHighestRcvd, mrxNextHighestRcvd, amUl->rxNext, amUl->snModMask);
amUl->rxNextHighestRcvd = ((sn + 1) & (amUl->snModMask));
DU_LOG("\nDEBUG --> RLC_UL : rlcAmmProcessPdus: Updated rxNextHighestRcvd = %d UEID:%d CELLID:%d",
- amUl->rxNextHighestRcvd, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+ amUl->rxNextHighestRcvd, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
}
-
+
recBuf = rlcUtlGetRecBuf(amUl->recBufLst, sn);
if ((NULLP != recBuf) && ( recBuf->allRcvd))
{
/* deliver the reassembled RLC SDU to upper layer,
- But not removed from the table */
+ But not removed from the table */
rlcAmmUlReassembleSdus(gCb, rbCb, recBuf);
recBuf->isDelvUpperLayer = TRUE;
MODAMR(amUl->vrMr, tVrMr, amUl->rxNext, amUl->snModMask);
-
+
/* Update rxHighestStatus */
if (sn == amUl->rxHighestStatus)
{
while (mSn <= tVrMr)
{
if ((NULLP != recBuf) && (recBuf->allRcvd) &&
- (TRUE == recBuf->isDelvUpperLayer))
- {
- /* RecBuf should remove from table
- since PDU is already sent to upper layer */
- recBuf->isDelvUpperLayer = FALSE;
- rlcUtlDelRecBuf(amUl->recBufLst, recBuf, gCb);
+ (TRUE == recBuf->isDelvUpperLayer))
+ {
+ /* RecBuf should remove from table
+ since PDU is already sent to upper layer */
+ recBuf->isDelvUpperLayer = FALSE;
+ rlcUtlDelRecBuf(amUl->recBufLst, recBuf, gCb);
}
else
{
Bool snInWin = RLC_AM_CHK_SN_WITHIN_RECV_WINDOW(amUl->rxNextStatusTrig, amUl);
/* spec 38.322v15.3.0 - 5.2.3.2.3 */
if((amUl->rxNextStatusTrig == amUl->rxNext) || ( (!snInWin) &&
- (amUl->rxNextStatusTrig != amUl->vrMr) )||
- (amUl->rxNextStatusTrig == amUl->rxNext && recBuf &&recBuf->noMissingSeg))
+ (amUl->rxNextStatusTrig != amUl->vrMr) )||
+ (amUl->rxNextStatusTrig == amUl->rxNext && recBuf &&recBuf->noMissingSeg))
{
rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR);
tmrRunning = FALSE;
DU_LOG("\nINFO --> RLC_UL: rlcAmmProcessPdus: Stopped ReAssembly Timer rxNextStatusTigger = %d"
- "rxNextReassembly = %d", amUl->rxNextStatusTrig, amUl->rxNext);
+ "rxNextReassembly = %d", amUl->rxNextStatusTrig, amUl->rxNext);
}
}
{
/* spec 38.322v15.3.0 - 5.2.3.2.3 */
if((amUl->rxNextHighestRcvd > amUl->rxNext) || ((amUl->rxNextHighestRcvd == amUl->rxNext) &&
- (recBuf && (!recBuf->noMissingSeg))))
+ (recBuf && (!recBuf->noMissingSeg))))
{
rlcStartTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR);
amUl->rxNextStatusTrig = amUl->rxNextHighestRcvd;
DU_LOG("\nDEBUG --> RLC_UL : rlcAmmProcessPdus: Updated rxNextStatusTrig = %d"
- "UEID:%d CELLID:%d", amUl->rxNextStatusTrig, rbCb->rlcId.ueId,
- rbCb->rlcId.cellId);
+ "UEID:%d CELLID:%d", amUl->rxNextStatusTrig, rbCb->rlcId.ueId,
+ rbCb->rlcId.cellId);
}
}
}
memcpy(rbCb->snssai, entCfg->snssai, sizeof(Snssai));
/*Create the entry of this SNSSAI if not exist in Snssai Tput list*/
- if(rlcHandleSnssaiTputlist(gCb, rbCb->snssai, CREATE) == NULLP)
+ if(rlcHandleSnssaiTputlist(gCb, rbCb->snssai, CREATE, DIR_DL) == NULLP)
{
DU_LOG("\nERROR --> RLC_DL : rlcCfgFillDlRbCb(): SNSSAI insertion in Tput list failed");
}
}
}
memcpy(rbCb->snssai, entCfg->snssai, sizeof(Snssai));
+
+ /*Create the entry of this SNSSAI if not exist in Snssai Tput list*/
+ if(rlcHandleSnssaiTputlist(gCb, rbCb->snssai, CREATE, DIR_UL) == NULLP)
+ {
+ DU_LOG("\nERROR --> RLC_UL : rlcCfgFillUlRbCb(): SNSSAI insertion in Tput list failed");
+ }
}
rbCb->mode = entCfg->entMode;
DU_LOG("\nINFO --> RLC_DL : Starting UE Throughput timer");
rlcStartTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_UE_THROUGHPUT_TMR);
}
+ }
/* Starting timer to print throughput */
if((rlcChkTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_SNSSAI_THROUGHPUT_TMR)) == FALSE)
{
DU_LOG("\nINFO --> RLC_DL : Starting SNSSAI Throughput timer");
rlcStartTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_SNSSAI_THROUGHPUT_TMR);
}
- }
return (LCM_REASON_NOT_APPL);
}
}
}
-
+
if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
{
rlcDbmDlShutdown(gCb);
+ rlcDelTputSnssaiList(gCb, DIR_DL);
}
else
{
rlcDbmUlShutdown(gCb);
+ rlcDelTputSnssaiList(gCb, DIR_UL);
}
- rlcDelTputSnssaiList(gCb);
rlcLmmCleanGblRsrcs(gCb);
RLC_MEM_SET (&(gCb->genSts), 0, sizeof (RlcGenSts));
return ret;
}
+/*******************************************************************
+*
+* @brief Send the Slice Metrics to DU APP
+*
+* @details
+*
+* Function : sendSlicePmToDu
+*
+* Functionality:
+* Handles the sending of Slice Metrics to DU APP
+*
+* @params[in] Post structure pointer
+* SlicePmList *sliceStats pointer
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t sendSlicePmToDu(SlicePmList *sliceStats)
+{
+ Pst pst;
+
+ FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_RLC_SLICE_PM_TO_DU);
+
+ if(!sliceStats)
+ {
+ DU_LOG("\nERROR --> RLC: sendSlicePmToDu(): Memory allocation failed ");
+ return RFAILED;
+ }
+ else
+ {
+ if(rlcSendSlicePmToDu(&pst, sliceStats) == ROK)
+ {
+ DU_LOG("\nDEBUG --> RLC: Slice PM send successfully");
+ }
+ else
+ {
+ DU_LOG("\nERROR --> RLC: sendSlicePmToDu():Failed to send Slice PM to DU");
+ RLC_FREE_SHRABL_BUF(pst.region, pst.pool, sliceStats, sizeof(SlicePmList));
+ return RFAILED;
+ }
+ }
+ return ROK;
+}
+
+/**
+ * @brief
+ * Handler for searching the Slice Entry in Slice Metrics structure
+ *
+ * @details
+ * This func finds the slice entry in the SliceMetric record structure and
+ * return the index of the slice sot hat Tput entries can be done
+ *
+ * @param[in] snssaiVal : Snssai Val to be searched
+ * *snssaiIdx : O/P : Index of the Slice in Slice Metrics record
+ * sliceStats : Pointer of Slice metrics record list
+ *
+ * @return bool: True: If slice found in the record
+ * False: If Slice not found; thus parent function will create the
+ * recpord of this snssai
+ *
+ */
+bool rlcFindSliceEntry(uint32_t snssaiVal, uint8_t *snssaiIdx, SlicePmList *sliceStats)
+{
+ uint8_t cntSlices = sliceStats->numSlice;
+
+ for(*snssaiIdx = 0;(*snssaiIdx) < cntSlices; (*snssaiIdx)++)
+ {
+ if(snssaiVal == sliceStats->sliceRecord[*snssaiIdx].networkSliceIdentifier)
+ {
+ return TRUE;
+ }
+ }
+ DU_LOG("\nERROR --> RLC: Total no of Slice exhausted!");
+ return FALSE;
+}
+
+
+/*******************************************************************
+*
+* @brief Builds the Slice Performance Metrics structure to be sent to DU
+*
+* @details
+*
+* Function : BuildSliceReportToDu
+*
+* Functionality:
+* Builds the Slice Performance Metrics structure to be sent to DU
+*
+* @params[in] uint8_t snssaiCnt
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t BuildSliceReportToDu(uint8_t snssaiCnt)
+{
+ CmLList *node = NULLP;
+ RlcTptPerSnssai *snssaiNode = NULLP;
+ Direction dir = DIR_UL;
+ SlicePmList *sliceStats = NULLP; /*Slice metric */
+ uint32_t snssaiVal = 0;
+ uint8_t snssaiIdx = 0;
+
+ if(snssaiCnt == 0)
+ {
+ DU_LOG("\nERROR --> RLC: No SNSSAI to send the SLice PM");
+ return RFAILED;
+ }
+
+ RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, sliceStats, sizeof(SlicePmList));
+ if(sliceStats == NULLP)
+ {
+ DU_LOG("\nERROR --> RLC: Memory Allocation Failed");
+ return RFAILED;
+ }
+ RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, sliceStats->sliceRecord, snssaiCnt * (sizeof(SlicePm)));
+
+ if(sliceStats->sliceRecord == NULLP)
+ {
+ DU_LOG("\nERROR --> RLC: Memory Allocation Failed");
+ RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, sliceStats, sizeof(SlicePmList));
+ return RFAILED;
+ }
+ while(dir < DIR_BOTH)
+ {
+ node = arrTputPerSnssai[dir]->first;
+ if(node == NULLP)
+ {
+ DU_LOG("\nERROR --> RLC: No SNSSAI in list");
+ RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, sliceStats, sizeof(SlicePmList));
+ RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, sliceStats->sliceRecord, (snssaiCnt * (sizeof(SlicePm))));
+ return RFAILED;
+ }
+
+ while(node)
+ {
+ snssaiVal = 0;
+ snssaiIdx = 0;
+ snssaiNode = (RlcTptPerSnssai *)node->node;
+
+ memcpy(&snssaiVal, snssaiNode->snssai, sizeof(Snssai));
+
+ if(rlcFindSliceEntry(snssaiVal, &snssaiIdx, sliceStats) == FALSE)
+ {
+ sliceStats->sliceRecord[snssaiIdx].networkSliceIdentifier = snssaiVal;
+ sliceStats->numSlice++;
+ }
+ if(dir == DIR_UL)
+ {
+ sliceStats->sliceRecord[snssaiIdx].ThpUl = snssaiNode->tpt;
+ }
+ else
+ {
+ sliceStats->sliceRecord[snssaiIdx].ThpDl = snssaiNode->tpt;
+ }
+ node = node->next;
+ }
+ dir++;
+ }
+
+ sendSlicePmToDu(sliceStats);
+ return ROK;
+}
/**********************************************************************
End of file
**********************************************************************/
/* private function declarations */
static Void rlcBndTmrExpiry(PTR cb);
+
/**
* @brief Handler to start timer
*
*/
void rlcSnssaiThptTmrExpiry(PTR cb)
{
- long double tpt;
RlcThpt *rlcThptCb = (RlcThpt*)cb;
+ static uint8_t snssaiCntDl = 0, snssaiCntUl = 0;
+ /*Bit map to keep record of reception of DL and UL Snssai Tput expiry*/
+ static uint8_t snssaiTputBitmap = DIR_NONE;
+
/* If cell is not up, throughput details cannot be printed */
if(gCellStatus != CELL_UP)
{
rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)(rlcThptCb), EVENT_RLC_SNSSAI_THROUGHPUT_TMR);
return;
}
-
- DU_LOG("\n==================================================================");
- if(rlcThptCb->snssaiTputInfo.tputPerSnssaiList != NULLP)
+
+ if(rlcThptCb->snssaiTputInfo.dlTputPerSnssaiList != NULLP)
{
- DU_LOG("\n===================== DL Throughput Per SNSSAI ==============================");
-
- rlcCalculateTputPerSnssai(rlcThptCb->snssaiTputInfo.tputPerSnssaiList);
- DU_LOG("\n==================================================================");
+ snssaiCntDl = rlcCalculateTputPerSnssai(rlcThptCb->snssaiTputInfo.dlTputPerSnssaiList, DIR_DL);
+ snssaiTputBitmap |= DIR_DL;
+ arrTputPerSnssai[DIR_DL] = rlcThptCb->snssaiTputInfo.dlTputPerSnssaiList;
+ }
+ if(rlcThptCb->snssaiTputInfo.ulTputPerSnssaiList != NULLP)
+ {
+ snssaiCntUl = rlcCalculateTputPerSnssai(rlcThptCb->snssaiTputInfo.ulTputPerSnssaiList, DIR_UL);
+ snssaiTputBitmap |= DIR_UL;
+ arrTputPerSnssai[DIR_UL] = rlcThptCb->snssaiTputInfo.ulTputPerSnssaiList;
+ }
+ if(snssaiTputBitmap == DIR_BOTH)
+ {
+ //call the function
+ BuildSliceReportToDu(MAX(snssaiCntUl, snssaiCntDl));
+ snssaiTputBitmap = DIR_NONE;
}
/* Restart timer */
rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)rlcThptCb, EVENT_RLC_SNSSAI_THROUGHPUT_TMR);
RlcSn tRxNextReassembly;
RlcSn tRxNextReassemblyNxt;
RlcSn tRxNextHighest;
+ RlcTptPerSnssai *snssaiTputNode = NULLP;
count = 0;
/* pduCount should be the min of RGU_MAX_PDU and pduInfo->numPdu */
pduCount = (pduInfo->numPdu < RGU_MAX_PDU)? pduInfo->numPdu : RGU_MAX_PDU;
-
+
vrUh = &(rbCb->m.umUl.vrUh);
vrUr = &(rbCb->m.umUl.vrUr);
vrUx = &(rbCb->m.umUl.vrUx);
RlcSn seqNum;
Buffer *pdu = pduInfo->mBuf[count];
+ pduSz = 0; /*re-intialize the size*/
+ snssaiTputNode = NULLP;
+
gCb->genSts.pdusRecv++;
#ifndef RGL_SPECIFIC_CHANGES
#ifndef TENB_ACC
#ifndef RGL_SPECIFIC_CHANGES
#ifndef TENB_ACC
#ifndef LTE_PAL_ENB
- /* Changed the condition to TRUE from ROK */
+ /* Changed the condition to TRUE from ROK */
#ifndef XEON_SPECIFIC_CHANGES
- if(isMemThreshReached(rlcCb[0]->init.region) == TRUE)
- {
- uint32_t rlculdrop;
- rlculdrop++;
- ODU_PUT_MSG_BUF(pdu);
- count++;
- continue;
- }
+ if(isMemThreshReached(rlcCb[0]->init.region) == TRUE)
+ {
+ uint32_t rlculdrop;
+ rlculdrop++;
+ ODU_PUT_MSG_BUF(pdu);
+ count++;
+ continue;
+ }
#endif
#endif
#endif
if (rlcUmmExtractHdr(gCb, rbCb, pdu, &umHdr))
{
DU_LOG("\nERROR --> RLC_UL: rlcUmmProcessPdus: Header Extraction Failed UEID:%d CELLID:%d",\
- rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+ rbCb->rlcId.ueId, rbCb->rlcId.cellId);
ODU_PUT_MSG_BUF(pdu);
count++;
gCb->genSts.errorPdusRecv++;
continue;
}
+ if(rbCb->snssai)
+ {
+ snssaiTputNode = rlcHandleSnssaiTputlist(gCb, rbCb->snssai, SEARCH, DIR_UL);
+ if(snssaiTputNode != NULLP)
+ {
+ ODU_GET_MSG_LEN(pdu, &pduSz);
+ snssaiTputNode->dataVol += (uint64_t)pduSz;
+ DU_LOG("\nINFO --> RLC_UL: UMM_UL SNSSAI List PduLen:%d, lcId:%d, total :%ld",\
+ pduSz, rbCb->lch.lChId, snssaiTputNode->dataVol);
+ }
+ }
+
/* Check if the PDU should be delivered to upper layer */
if(umHdr.si == 0)
{
rlcUtlSendUlDataToDu(gCb, rbCb, pdu);
- ODU_PUT_MSG_BUF(pdu);
- count++;
- continue;
+ ODU_PUT_MSG_BUF(pdu);
+ count++;
+ continue;
}
curSn = umHdr.sn;
{
/* PDU needs to be discarded */
DU_LOG("\nINFO --> RLC_UL: rlcUmmProcessPdus: Received an unexpected pdu with sn %d \
- UEID:%d CELLID:%d", curSn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+ UEID:%d CELLID:%d", curSn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
ODU_PUT_MSG_BUF(pdu);
count++;
if (recBuf == NULLP)
{
DU_LOG("\nERROR --> RLC_UL: rlcUmmProcessPdus: recBuf is NULLP UEID:%d CELLID:%d", \
- rbCb->rlcId.ueId, rbCb->rlcId.cellId);
- ODU_PUT_MSG_BUF(pdu);
- count++;
+ rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+ ODU_PUT_MSG_BUF(pdu);
+ count++;
continue;
}
{
rlcUmmReAssembleSdus(gCb, rbCb, recBuf);
DU_LOG("\nDEBUG --> RLC_UL: rlcUmmProcessPdus: Assembled the Sdus for sn = %d UEID:%d CELLID:%d",\
- umHdr.sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+ umHdr.sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
/* if curSn is same as the RX_NEXT_Reassembly */
if (seqNum == ur)
else if (!rlcUmmCheckSnInReassemblyWindow(curSn,&RLC_UMUL))
{
DU_LOG("\nDEBUG --> RLC_UL: rlcUmmProcessPdus: curent sn is outSide the re-Assembly window. \
- sn = %d UEID:%d CELLID:%d", umHdr.sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+ sn = %d UEID:%d CELLID:%d", umHdr.sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
- /* update RX_NEXT_Highest */
+ /* update RX_NEXT_Highest */
*vrUh = (curSn + 1) & RLC_UMUL.modBitMask;
/* Discard all pdus outside the modified re-assembly window */
RlcSn packetCount;
/* Set RX_NEXT_Reassembly to next SN >= (RX_NEXT_Highest - windowSize) that has not been reassembled yet */
- *vrUr = (*vrUh - RLC_UMUL.umWinSz) & RLC_UMUL.modBitMask;
- lowerEdge = *vrUr;
+ *vrUr = (*vrUh - RLC_UMUL.umWinSz) & RLC_UMUL.modBitMask;
+ lowerEdge = *vrUr;
packetCount = (lowerEdge - sn) & RLC_UMUL.modBitMask;
-
+
while (packetCount)
{
recBuf = rlcUtlGetUmRecBuf(RLC_UMUL.recBufLst, sn);
sn = (sn + 1) & RLC_UMUL.modBitMask;
packetCount--;
}
- recBuf = rlcUtlGetUmRecBuf(RLC_UMUL.recBufLst, *vrUr);
- if (recBuf != NULLP && recBuf->allSegRcvd)
- {
- /* set rxNextReassembly to next SN > current rxNextReassembly which is not received */
- RlcSn nextRxNextReassembly = (*vrUr + 1) & RLC_UMUL.modBitMask;
- rlcUmmFindRxNextReassembly(gCb ,&RLC_UMUL, nextRxNextReassembly);
- }
+ recBuf = rlcUtlGetUmRecBuf(RLC_UMUL.recBufLst, *vrUr);
+ if (recBuf != NULLP && recBuf->allSegRcvd)
+ {
+ /* set rxNextReassembly to next SN > current rxNextReassembly which is not received */
+ RlcSn nextRxNextReassembly = (*vrUr + 1) & RLC_UMUL.modBitMask;
+ rlcUmmFindRxNextReassembly(gCb ,&RLC_UMUL, nextRxNextReassembly);
+ }
}
}
- tmrRunning = rlcChkTmr(gCb,(PTR)rbCb, EVENT_RLC_UMUL_REASSEMBLE_TMR);
+ tmrRunning = rlcChkTmr(gCb,(PTR)rbCb, EVENT_RLC_UMUL_REASSEMBLE_TMR);
tRxNextReassembly = RLC_UM_GET_VALUE(*vrUr ,RLC_UMUL);
tRxNextReassemblyNxt = (*vrUr + 1) & rbCb->m.umUl.modBitMask;
tRxNextHighest = RLC_UM_GET_VALUE(*vrUh, RLC_UMUL);
tRxNextReassemblyNxt = RLC_UM_GET_VALUE(tRxNextReassemblyNxt ,RLC_UMUL);
- /* If reassemby timer is running */
- if (tmrRunning)
- {
- RlcSn tRxTimerTigger = RLC_UM_GET_VALUE(*vrUx, RLC_UMUL);
- uint8_t ret = rlcUmmCheckSnInReassemblyWindow(*vrUx, &RLC_UMUL);
- recBuf = rlcUtlGetUmRecBuf(RLC_UMUL.recBufLst,*vrUr);
+ /* If reassemby timer is running */
+ if (tmrRunning)
+ {
+ RlcSn tRxTimerTigger = RLC_UM_GET_VALUE(*vrUx, RLC_UMUL);
+ uint8_t ret = rlcUmmCheckSnInReassemblyWindow(*vrUx, &RLC_UMUL);
+ recBuf = rlcUtlGetUmRecBuf(RLC_UMUL.recBufLst,*vrUr);
if ((tRxTimerTigger <= tRxNextReassembly) || ((!ret) && (tRxTimerTigger != tRxNextHighest)) ||
- (tRxNextHighest == tRxNextReassemblyNxt && recBuf && recBuf->noMissingSeg))
+ (tRxNextHighest == tRxNextReassemblyNxt && recBuf && recBuf->noMissingSeg))
{
rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_UMUL_REASSEMBLE_TMR);
tmrRunning = FALSE;
DU_LOG("\nINFO --> RLC_UL: rlcUmmProcessPdus: Stopped ReAssembly Timer rxTimerTigger = %d \
- rxNextReassembly = %d rxNextHighest = %d ", tRxTimerTigger, tRxNextReassembly, tRxNextHighest);
+ rxNextReassembly = %d rxNextHighest = %d ", tRxTimerTigger, tRxNextReassembly, tRxNextHighest);
}
- }
+ }
- /* If Reassembly timer is not running */
- if (!tmrRunning)
- {
+ /* If Reassembly timer is not running */
+ if (!tmrRunning)
+ {
recBuf = rlcUtlGetUmRecBuf(RLC_UMUL.recBufLst, curSn);
if ((tRxNextHighest > tRxNextReassemblyNxt) || ((tRxNextHighest == tRxNextReassemblyNxt)
- && (recBuf && (!recBuf->noMissingSeg))))
+ && (recBuf && (!recBuf->noMissingSeg))))
{
- DU_LOG("\nDEBUG --> RLC_UL: rlcUmmProcessPdus: Start ReAssembly Timer tRxNextReassemblyNxt = %d \
- tRxNextHighest %d", tRxNextReassemblyNxt, tRxNextHighest);
- rlcStartTmr(gCb, (PTR)rbCb, EVENT_RLC_UMUL_REASSEMBLE_TMR);
- *vrUx = *vrUh;
+ DU_LOG("\nDEBUG --> RLC_UL: rlcUmmProcessPdus: Start ReAssembly Timer tRxNextReassemblyNxt = %d \
+ tRxNextHighest %d", tRxNextReassemblyNxt, tRxNextHighest);
+ rlcStartTmr(gCb, (PTR)rbCb, EVENT_RLC_UMUL_REASSEMBLE_TMR);
+ *vrUx = *vrUh;
}
- }
+ }
}
else
{
DU_LOG("\nERROR --> RLC_UL: rlcUmmProcessPdus:Failed to assemble the PDU for SN = %d UEID:%d CELLID:%d",\
- umHdr.sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+ umHdr.sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
}
count++;
packRlcDuUeDeleteRsp /* 2 - LWLC loosely coupled */
};
+RlcSlicePmToDuFunc rlcSlicePmOpts[] =
+{
+ packRlcDuSlicePm, /* 0 - loosely coupled */
+ DuProcRlcSliceMetrics, /* 1 - tightly coupled */
+ packRlcDuSlicePm /* 2 - LWLC loosely coupled */
+};
/*******************************************************************
*
* @brief Sends UL RRC Message Info to DU APP
return (*rlcUeDeleteRspOpts[pst->selector])(pst, ueDeleteRsp);
}
+/*******************************************************************
+ *
+ * @brief Sends Slice Performance Metrics to DU APP
+ *
+ * @details
+ *
+ * Function : rlcSendSlicePmToDu
+ *
+ * Functionality: Sends Performace Metrics per slice together to DU APP
+ *
+ * @params[in] Pst *pst, SlicePmList *sliceStats
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t rlcSendSlicePmToDu(Pst *pst, SlicePmList *sliceStats)
+{
+ return (*rlcSlicePmOpts[pst->selector])(pst, sliceStats);
+}
/**********************************************************************
End of file
**********************************************************************/
uint8_t rlcSendDlRrcMsgRspToDu(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsgRsp);
uint8_t rlcSendUlUserDataToDu(Pst *pst, RlcUlUserDatInfo *ulUserData);
uint8_t rlcSendUeDeleteRspToDu(Pst *pst, RlcUeDeleteRsp *ueDeleteRsp);
+uint8_t rlcSendSlicePmToDu(Pst *pst, SlicePmList *sliceStats);
/**********************************************************************
End of file
**********************************************************************/
* -# Snssai Node
*
*/
-RlcTptPerSnssai* rlcHandleSnssaiTputlist(RlcCb *gCb, Snssai *snssai, RlcSnssaiActionType action)
+RlcTptPerSnssai* rlcHandleSnssaiTputlist(RlcCb *gCb, Snssai *snssai, RlcSnssaiActionType action, Direction dir)
{
CmLListCp *snssaiList = NULLP;
CmLList *node = NULLP;
RlcTptPerSnssai *snssaiNode = NULLP;
bool found = FALSE;
- snssaiList = gCb->rlcThpt.snssaiTputInfo.tputPerSnssaiList;
- if(snssaiList == NULLP)
+ if(dir == DIR_DL)
+ {
+ snssaiList = gCb->rlcThpt.snssaiTputInfo.dlTputPerSnssaiList;
+ if(action == CREATE)
+ {
+ if(snssaiList == NULLP)
+ {
+ RLC_ALLOC(gCb, gCb->rlcThpt.snssaiTputInfo.dlTputPerSnssaiList, sizeof(CmLListCp));
+ snssaiList = gCb->rlcThpt.snssaiTputInfo.dlTputPerSnssaiList;
+ cmLListInit(snssaiList);
+ }
+ }
+ else
+ {
+ if(snssaiList == NULLP)
+ {
+ DU_LOG("\nERROR --> RLC: SNSSAI DL list doesnt exist!");
+ return NULLP;
+ }
+ }
+ }
+ else if(dir == DIR_UL)
{
+ snssaiList = gCb->rlcThpt.snssaiTputInfo.ulTputPerSnssaiList;
if(action == CREATE)
{
- RLC_ALLOC(gCb, gCb->rlcThpt.snssaiTputInfo.tputPerSnssaiList, sizeof(CmLListCp));
- snssaiList = gCb->rlcThpt.snssaiTputInfo.tputPerSnssaiList;
- cmLListInit(snssaiList);
- DU_LOG("\nINFO --> RLC: First SNSSAI to add in this List");
+ if(snssaiList == NULLP)
+ {
+ RLC_ALLOC(gCb, gCb->rlcThpt.snssaiTputInfo.ulTputPerSnssaiList, sizeof(CmLListCp));
+ snssaiList = gCb->rlcThpt.snssaiTputInfo.ulTputPerSnssaiList;
+ cmLListInit(snssaiList);
+ }
}
else
{
- DU_LOG("\nERROR --> RLC: SNSSAI list doesnt exist!");
- return NULLP;
+ if(snssaiList == NULLP)
+ {
+ DU_LOG("\nERROR --> RLC: SNSSAI UL list doesnt exist!");
+ return NULLP;
+ }
}
}
+ else
+ {
+ DU_LOG("\nERROR --> RLC : Direction:%d is invalid", dir);
+ return NULLP;
+ }
node = snssaiList->first;
*
* @param[in] gCb RlcCb
*
- * @return void
+ * @return uint_8 (ROK/RFAILED)
*
*/
-void rlcDelTputSnssaiList(RlcCb *gCb)
+uint8_t rlcDelTputSnssaiList(RlcCb *gCb, Direction dir)
{
CmLListCp *snssaiList = NULLP;
CmLList *node = NULLP, *next = NULLP;
RlcTptPerSnssai *snssaiNode = NULLP;
-
- snssaiList = gCb->rlcThpt.snssaiTputInfo.tputPerSnssaiList;
+ if(dir == DIR_DL)
+ {
+ snssaiList = gCb->rlcThpt.snssaiTputInfo.dlTputPerSnssaiList;
+ }
+ else if(dir == DIR_UL)
+ {
+ snssaiList = gCb->rlcThpt.snssaiTputInfo.ulTputPerSnssaiList;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> RLC: Invalid direction:%d",dir);
+ return RFAILED;
+ }
if(snssaiList == NULLP)
{
- DU_LOG("\nERROR --> RLC: SnssaiList not exist");
- return;
+ DU_LOG("\nERROR --> RLC: SnssaiList not exist");
+ return RFAILED;
}
node = snssaiList->first;
if(snssaiList->count == 0)
{
RLC_FREE(gCb, snssaiList, sizeof(CmLListCp));
- DU_LOG("\nINFO --> RLC : This SNSSAI was last in the list thus freeing the list also");
+ DU_LOG("\nDEBUG --> RLC : This SNSSAI was last in the list thus freeing the list also");
}
+ return ROK;
}
/**
* @return void
*
*/
-void rlcCalculateTputPerSnssai(CmLListCp *snssaiList)
+uint8_t rlcCalculateTputPerSnssai(CmLListCp *snssaiList, Direction dir)
{
CmLList *node = NULLP;
RlcTptPerSnssai *snssaiNode = NULLP;
- double long tpt = 0;
+ uint8_t snssaiCnt = 0;
node = snssaiList->first;
if(node == NULLP)
{
DU_LOG("\n No SNSSAI in list");
- return;
+ return(snssaiCnt);
}
/*Traversing the LC LinkList*/
while(node)
{
snssaiNode = (RlcTptPerSnssai *)node->node;
- tpt = (double)(snssaiNode->dataVol * 8)/(double)ODU_SNSSAI_THROUGHPUT_PRINT_TIME_INTERVAL;
- DU_LOG("\nSNSSAI(sst:%d,sd [%d,%d, %d]), DL Tpt : %.2Lf", snssaiNode->snssai->sst, snssaiNode->snssai->sd[0], \
- snssaiNode->snssai->sd[1],snssaiNode->snssai->sd[2] , tpt);
+ snssaiNode->tpt = (double)(snssaiNode->dataVol * 8)/(double)(ODU_SNSSAI_THROUGHPUT_PRINT_TIME_INTERVAL * 0.001);
+
+ if(dir == DIR_DL)
+ {
+ DU_LOG("\nDEBUG --> RLC_DL: SNSSAI(sst:%d,sd [%d,%d, %d]), DL Tpt : %.5lf", snssaiNode->snssai->sst,\
+ snssaiNode->snssai->sd[0], snssaiNode->snssai->sd[1],snssaiNode->snssai->sd[2] , snssaiNode->tpt);
+ }
+ if(dir == DIR_UL)
+ {
+ DU_LOG("\nDEBUG --> RLC_UL: SNSSAI(sst:%d,sd [%d,%d, %d]), UL Tpt : %.5lf", snssaiNode->snssai->sst,\
+ snssaiNode->snssai->sd[0], snssaiNode->snssai->sd[1],snssaiNode->snssai->sd[2] , snssaiNode->tpt);
+ }
+
snssaiNode->dataVol = 0;
node = node->next;
+ snssaiCnt++;
}
- return;
+ return(snssaiCnt);
}
+
/********************************************************************30**
End of file
**********************************************************************/
#endif /* __cplusplus */
#include "du_log.h"
+#include "du_app_rlc_inf.h"
\f
#define EKWxxx 1
{
Snssai *snssai;
uint64_t dataVol;
+ double tpt;
}RlcTptPerSnssai;
typedef struct rlcSnssaiTputInfo
{
CmTimer snssaiThptTmr; /* Throughput Timer */
- CmLListCp *tputPerSnssaiList;
+ CmLListCp *dlTputPerSnssaiList;
+ CmLListCp *ulTputPerSnssaiList;
}RlcSnssaiTputInfo;
typedef struct rlcUeTputInfo
RlcCb *rlcCb[MAX_RLC_INSTANCES]; /*!< RLC global control block */
+CmLListCp *arrTputPerSnssai[DIR_BOTH]; /*Stores the address of Througput LL*/
/****************************************************************************
* Declarations
***************************************************************************/
void rlcSnssaiThptTmrExpiry(PTR cb);
RlcTptPerSnssai* rlcHandleSnssaiTputlist(RlcCb *gCb, Snssai *snssai,\
- RlcSnssaiActionType action);
-void rlcCalculateTputPerSnssai(CmLListCp *snssaiList);
-void rlcDelTputSnssaiList(RlcCb *gCb);
+ RlcSnssaiActionType action, Direction dir);
+uint8_t rlcCalculateTputPerSnssai(CmLListCp *snssaiList, Direction dir);
+uint8_t rlcDelTputSnssaiList(RlcCb *gCb, Direction dir);
+uint8_t BuildSliceReportToDu(uint8_t snssaiCnt);
+bool rlcFindSliceEntry(uint32_t snssaiVal, uint8_t *snssaiIdx,\
+ SlicePmList *sliceStats);
#ifdef LTE_L2_MEAS
Void rlcLmmSendAlarm ARGS (( RlcCb *gCb,
if(rbCb->snssai)
{
- snssaiTputNode = rlcHandleSnssaiTputlist(gCb, rbCb->snssai, SEARCH);
+ snssaiTputNode = rlcHandleSnssaiTputlist(gCb, rbCb->snssai, SEARCH, DIR_DL);
if(snssaiTputNode != NULLP)
{
snssaiTputNode->dataVol += staIndTb->lchStaInd[count].totBufSize;
- DU_LOG("\nINFO -->SCH: SNSSAI List Grant:%d, lcId:%d, total :%d",\
+ DU_LOG("\nINFO -->SCH: SNSSAI List Grant:%d, lcId:%d, total :%ld",\
staIndTb->lchStaInd[count].totBufSize, staIndTb->lchStaInd[count].lcId,\
snssaiTputNode->dataVol);
}
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
**********************************************************************/
DELETE
}ActionTypeLcLL;
-typedef enum
-{
- DIR_UL,
- DIR_DL
-}Direction;
-
/**
* @brief
* Structure holding LTE MAC's General Configuration information.
#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 */
if(cell == NULLP)
{
DU_LOG("\nERROR --> SCH : schPrachResAlloc(): Received cellCb is null");
- return RFAILED;
+ return;
}
/* If this slot is not a PRACH occassion, return */
*
* ****************************************************************/
-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;
CELL_DOWN
}OduCellStatus;
+
+typedef enum
+{
+ DIR_NONE,
+ DIR_UL,
+ DIR_DL,
+ DIR_BOTH
+}Direction;
+
typedef struct slotTimingInfo
{
uint16_t cellId;
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 RFAILED;
}
+/*******************************************************************
+*
+* @brief Packs and Sends Slice PM from RLC to DUAPP
+*
+* @details
+*
+* Function : packRlcDuSlicePm
+*
+* Functionality:
+* Packs and Sends Slice Performance Metrics from RLC to DUAPP
+*
+*
+* @params[in] Post structure pointer
+* SlicePmList *sliceStats
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t packRlcDuSlicePm(Pst *pst, SlicePmList *sliceStats)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nERROR --> RLC : Memory allocation failed at packRlcDuSlicePm");
+ return RFAILED;
+ }
+ /* pack the address of the structure */
+ CMCHKPK(oduPackPointer,(PTR)sliceStats, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcDuSlicePm");
+ return RFAILED;
+ }
+
+ return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpacks Slice PM received from RLC
+*
+* @details
+*
+* Function : unpackRlcSlicePm
+*
+* Functionality:
+* Unpacks Slice Performance Metrics received from RLC
+*
+* @params[in] Pointer to Handler
+* Post structure pointer
+* Message Buffer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t unpackRlcSlicePm(RlcSlicePmToDuFunc func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ SlicePmList *sliceStats = NULLP;
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceStats, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, sliceStats);
+ }
+ else
+ {
+ /* Nothing to do for other selectors */
+ DU_LOG("\nERROR --> RLC: Only LWLC supported for Slice Metrics ");
+ ODU_PUT_MSG_BUF(mBuf);
+ }
+
+ return RFAILED;
+}
/**********************************************************************
End of file
***********************************************************************/
#define EVENT_UL_USER_DATA_TRANS_TO_DU 219
#define EVENT_RLC_UE_DELETE_REQ 220
#define EVENT_RLC_UE_DELETE_RSP 221
+#define EVENT_RLC_SLICE_PM_TO_DU 222
#define RB_ID_SRB 0
#define RB_ID_DRB 1
uint16_t triggeringMessage;
}RrcDeliveryStatus;
+/*Pm Metric for NW Slicing from RLC to DUAPP*/
+typedef struct slicePm
+{
+ uint32_t networkSliceIdentifier;
+ double ThpDl;
+ double ThpUl;
+}SlicePm;
+
+typedef struct slicePmList
+{
+ uint8_t numSlice;
+ SlicePm *sliceRecord;
+}SlicePmList;
+
typedef struct rrcDeliveryReportInfo
{
uint16_t cellId;
Pst *pst,
RlcDlUserDataInfo *dlDataMsg));
+/* Slice Metrics from RLC to DU APP */
+typedef uint8_t (*RlcSlicePmToDuFunc) ARGS((
+ Pst *pst,
+ SlicePmList *sliceStats));
+
/* Pack/Unpack function declarations */
uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf);
uint8_t unpackRlcUeDeleteReq(DuRlcUeDeleteReq func, Pst *pst, Buffer *mBuf);
uint8_t packRlcDuUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *ueDeleteRsp);
uint8_t unpackRlcUeDeleteRsp(RlcDuUeDeleteRsp func, Pst *pst, Buffer *mBuf);
+uint8_t packRlcDuSlicePm(Pst *pst, SlicePmList *sliceStats);
+uint8_t unpackRlcSlicePm(RlcSlicePmToDuFunc func, Pst *pst, Buffer *mBuf);
/* Event Handler function declarations */
uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
uint8_t RlcProcDlUserDataTransfer(Pst *pst, RlcDlUserDataInfo *dlDataMsgInfo);
uint8_t RlcProcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete);
uint8_t DuProcRlcUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *delRsp);
+uint8_t DuProcRlcSliceMetrics(Pst *pst, SlicePmList *sliceStats);
#endif /* RLC_INF_H */
/**********************************************************************
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 = unpackRlcUlUserDataToDu(DuProcRlcUlUserDataTrans, pst, mBuf);
break;
}
+ case EVENT_RLC_SLICE_PM_TO_DU:
+ {
+ ret = unpackRlcSlicePm(DuProcRlcSliceMetrics, pst, mBuf);
+ break;
+ }
default:
{
DU_LOG("\nERROR --> DU_APP : Invalid event %d received at duActvTsk from ENTRLC", \
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");
#include "AlarmInterface.h"
#include "ConfigInterface.h"
+/*TODO: Uncomment when PM O1 gerrit gets ready*/
+#if 0
+#include "PmInterface.h"
+#endif
+
#endif
uint8_t rlcDlCfg = 0;
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;
+}
+
+/*******************************************************************
+*
+* @brief Handles received Slice Metrics from RLC and forward it to O1
+*
+* @details
+*
+* Function : DuProcRlcSliceMetrics
+*
+* Functionality:
+* Handles received Slice Metrics from RLC and forward it to O1
+*
+* @params[in] Post structure pointer
+* SlicePmList *sliceStats
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t DuProcRlcSliceMetrics(Pst *pst, SlicePmList *sliceStats)
+{
+ uint8_t sliceRecord = 0;
+
+ DU_LOG("\nDEBUG --> DU APP : Received Slice Metrics");
+ if(sliceStats == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : Empty Metrics");
+ return RFAILED;
+ }
+
+ for(sliceRecord = 0; sliceRecord < sliceStats->numSlice; sliceRecord++)
+ {
+ DU_LOG("\nINFO --> DU_APP: SliceIndx:%d, DlTput %.5lf, UlTput:%.5lf", sliceStats->sliceRecord[sliceRecord].networkSliceIdentifier,\
+ sliceStats->sliceRecord[sliceRecord].ThpDl, sliceStats->sliceRecord[sliceRecord].ThpUl);
+ }
+/*TODO: Uncomment when PM O1 gerrit gets ready*/
+#if 0
+#ifdef O1_ENABLE
+ if(sliceStats)
+ {
+ sendSliceMetric(sliceStats);
+ }
+#endif
+#endif
+
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool,sliceStats->sliceRecord, (sliceStats->numSlice) * (sizeof(SlicePm)));
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool,sliceStats, sizeof(SlicePmList));
+
+ return ROK;
+}
+
/**********************************************************************
End of file
**********************************************************************/