packSchCellCfg /* packing for light weight loosly coupled */
};
+MacSchCellDeleteReqFunc macSchCellDeleteReqOpts[]=
+{
+ packMacSchCellDeleteReq, /* packing for loosely coupled */
+ MacSchCellDeleteReq, /* packing for tightly coupled */
+ packMacSchCellDeleteReq /* packing for light weight loosely coupled */
+};
+
+MacDuCellDeleteRspFunc macDuCellDeleteRspOpts[] =
+{
+ packDuMacCellDeleteRsp, /* packing for loosely coupled */
+ DuProcMacCellDeleteRsp, /* packing for tightly coupled */
+ packDuMacCellDeleteRsp /* packing for light weight loosly coupled */
+};
/**
* @brief Layer Manager Configuration request handler for Scheduler
MacSendCellCfgCfm(cellId, RSP_OK);
}
+/*******************************************************************
+ *
+ * @brief Fill and Send Cell Delete response from MAC to DU APP
+ *
+ * @details
+ *
+ * Function : MacSendCellDeleteRsp
+ *
+ * Functionality: Fill and Send Cell Delete response from MAC to DUAPP
+ *
+ * @params[in] MAC Cell delete result
+ * SCH Cell delete response
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t MacSendCellDeleteRsp(CellDeleteStatus result, uint8_t cellId)
+{
+ MacCellDeleteRsp *deleteRsp=NULLP;
+ Pst rspPst;
+
+ MAC_ALLOC_SHRABL_BUF(deleteRsp, sizeof(MacCellDeleteRsp));
+ if(!deleteRsp)
+ {
+ DU_LOG("\nERROR --> MAC : MacSendCellDeleteRsp(): Memory allocation for Cell delete response failed");
+ return RFAILED;
+ }
+
+ /* Filling CELL delete response */
+
+ memset(deleteRsp, 0, sizeof(MacCellDeleteRsp));
+ deleteRsp->cellId = cellId;
+ deleteRsp->result = result;
+
+ /* Fill Post structure and send CELL delete response*/
+ memset(&rspPst, 0, sizeof(Pst));
+ FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_CELL_DELETE_RSP);
+ return (*macDuCellDeleteRspOpts[rspPst.selector])(&rspPst, deleteRsp);
+}
+
+/*******************************************************************
+ *
+ * @brief Processes CELL delete response from scheduler
+ *
+ * @details
+ *
+ * Function : MacProcSchCellDeleteRsp
+ *
+ * Functionality:
+ * Processes CELL delete from scheduler
+ *
+ * @params[in] Pst : Post structure
+ * schCellDelRsp : Scheduler CELL delete respons
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * * ****************************************************************/
+uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDelRsp)
+{
+ uint8_t ret = ROK;
+ uint16_t cellIdx=0;
+ CellDeleteStatus status;
+
+ if(schCellDelRsp)
+ {
+ if(schCellDelRsp->rsp == RSP_OK)
+ {
+ DU_LOG("\nINFO --> MAC : SCH CELL Delete response for cellId[%d] is successful ", \
+ schCellDelRsp->cellId);
+ GET_CELL_IDX(schCellDelRsp->cellId, cellIdx);
+ if(macCb.macCell[cellIdx])
+ {
+ if(macCb.macCell[cellIdx]->cellId == schCellDelRsp->cellId)
+ {
+ memset(macCb.macCell[cellIdx], 0, sizeof(MacCellCb));
+ status = SUCCESSFUL_RSP;
+ MAC_FREE(macCb.macCell[cellIdx], sizeof(MacCellCb));
+ }
+ else
+ {
+ DU_LOG("ERROR --> MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
+ status = CELL_ID_INVALID;
+ ret = RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("ERROR --> MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
+ status = CELL_ID_INVALID;
+ ret = RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("ERROR --> MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
+ status = CELL_ID_INVALID;
+ ret = RFAILED;
+ }
+ if(MacSendCellDeleteRsp(status, schCellDelRsp->cellId) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC: MacProcSchCellDeleteRsp(): Failed to send CELL delete response");
+ ret = RFAILED;
+ }
+
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC: MacProcSchCellDeleteRsp(): schCellDelRsp is NULL");
+ ret = RFAILED;
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Sends Cell delete req to Scheduler
+ *
+ * @details
+ *
+ * Function : sendCellDelReqToSch
+ *
+ * Functionality: sends Cell delete req to Scheduler
+ *
+ * @params[in] SchCellDelete *schCellDel
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t sendCellDelReqToSch(SchCellDelete *schCellDel)
+{
+ Pst schPst;
+ FILL_PST_MAC_TO_SCH(schPst, EVENT_CELL_DELETE_REQ_TO_SCH);
+ return(*macSchCellDeleteReqOpts[schPst.selector])(&schPst, schCellDel);
+}
+
+/*******************************************************************
+ *
+ * @brief Handles CELL Delete requst from DU APP
+ *
+ * @details
+ *
+ * Function : MacProcCellDeleteReq
+ *
+ * Functionality: Handles CELL Delete requst from DU APP
+ *
+ * @params[in] Pst *pst, MacCellDelete *cellDelete
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ *
+ * ****************************************************************/
+uint8_t MacProcCellDeleteReq(Pst *pst, MacCellDelete *cellDelete)
+{
+ uint8_t ret = ROK, cellIdx=0;
+ SchCellDelete schCellDelete;
+
+ DU_LOG("\nINFO --> MAC : Cell Delete Request received for cellId[%d]", cellDelete->cellId);
+
+ if(cellDelete)
+ {
+ GET_CELL_IDX(cellDelete->cellId, cellIdx);
+ if(macCb.macCell[cellIdx])
+ {
+ if(macCb.macCell[cellIdx]->cellId == cellDelete->cellId)
+ {
+ memset(&schCellDelete, 0, sizeof(SchCellDelete));
+ schCellDelete.cellId = cellDelete->cellId;
+ ret = sendCellDelReqToSch(&schCellDelete);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): Failed to send UE Delete Request to SCH");
+ ret = RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): Failed to find the MacUeCb of CellId = %d",\
+ cellDelete->cellId);
+ ret = RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): Failed to find the MacUeCb of CellId = %d",\
+ cellDelete->cellId);
+ ret = RFAILED;
+ }
+
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): Sending failure response to DU");
+ if(MacSendCellDeleteRsp(CELL_ID_INVALID, cellDelete->cellId) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): failed to send cell delete rsp for cellID[%d]",\
+ cellDelete->cellId);
+ }
+
+ }
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellDelete, sizeof(MacCellDelete));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): Received MacCellDelete is NULL");
+ ret = RFAILED;
+ }
+ return ret;
+}
+
/**********************************************************************
End of file
**********************************************************************/
packDuMacUeDeleteRsp /* packing for light weight loosly coupled */
};
-MacSchCellDeleteReqFunc macSchCellDeleteReqOpts[]=
-{
- packMacSchCellDeleteReq, /* packing for loosely coupled */
- MacSchCellDeleteReq, /* packing for tightly coupled */
- packMacSchCellDeleteReq /* packing for light weight loosely coupled */
-};
-
-MacDuCellDeleteRspFunc macDuCellDeleteRspOpts[] =
-{
- packDuMacCellDeleteRsp, /* packing for loosely coupled */
- DuProcMacCellDeleteRsp, /* packing for tightly coupled */
- packDuMacCellDeleteRsp /* packing for light weight loosly coupled */
-};
-
/*******************************************************************
*
* @brief Fills mac cell group config to be sent to scheduler
{
if(!schPdschCfg->maxMimoLayers)
{
- MAC_ALLOC_SHRABL_BUF(schPdschCfg->maxMimoLayers, sizeof(uint8_t));
+ MAC_ALLOC(schPdschCfg->maxMimoLayers, sizeof(uint8_t));
if(!schPdschCfg->maxMimoLayers)
{
DU_LOG("\nERROR --> MAC :Memory Alloc MimoLayers Failed at fillPdschServCellCfg()");
{
if(!schPdschCfg->maxCodeBlkGrpPerTb)
{
- MAC_ALLOC_SHRABL_BUF(schPdschCfg->maxCodeBlkGrpPerTb, sizeof(SchMaxCodeBlkGrpPerTB));
+ MAC_ALLOC(schPdschCfg->maxCodeBlkGrpPerTb, sizeof(SchMaxCodeBlkGrpPerTB));
if(!schPdschCfg->maxCodeBlkGrpPerTb)
{
DU_LOG("\nERROR --> MAC :Memory Alloc for code Block Failed at fillPdschServCellCfg()");
{
if(!schPdschCfg->codeBlkGrpFlushInd)
{
- MAC_ALLOC_SHRABL_BUF(schPdschCfg->codeBlkGrpFlushInd, sizeof(bool));
+ MAC_ALLOC(schPdschCfg->codeBlkGrpFlushInd, sizeof(bool));
if(!schPdschCfg->codeBlkGrpFlushInd)
{
DU_LOG("\nERROR --> MAC :Memory Alloc for Flush Ind Failed at fillPdschServCellCfg()");
{
if(!schPdschCfg->xOverhead)
{
- MAC_ALLOC_SHRABL_BUF(schPdschCfg->xOverhead, sizeof(SchPdschXOverhead));
+ MAC_ALLOC(schPdschCfg->xOverhead, sizeof(SchPdschXOverhead));
if(!schPdschCfg->xOverhead)
{
DU_LOG("\nERROR --> MAC :Memory Alloc for xOverHead Failed at fillPdschServCellCfg()");
}
-/*******************************************************************
-*
-* @brief Function to delete MAC Pdsch ServCellCfg
-*
-* @details
-*
-* Function : deleteMacPdschServCellCfg
-*
-* Functionality: Function to delete MAC Pdsch ServCellCfg
-*
-* @params[in] PdschServCellCfg *pdschServCellCfg
-* @return void
-*
-* ****************************************************************/
-
-void deleteMacPdschServCellCfg(PdschServCellCfg *pdschServCellCfg)
-{
- MAC_FREE(pdschServCellCfg->maxMimoLayers, sizeof(uint8_t));
- MAC_FREE(pdschServCellCfg->maxCodeBlkGrpPerTb, sizeof(MaxCodeBlkGrpPerTB));
- MAC_FREE(pdschServCellCfg->codeBlkGrpFlushInd, sizeof(bool));
- MAC_FREE(pdschServCellCfg->xOverhead, sizeof(PdschXOverhead));
-}
-
-/*******************************************************************
-*
-* @brief Handles UE Delete requst from DU APP
-*
-* @details
-*
-* Function : deleteMacUeCb
-*
-* Functionality: Handles UE Delete requst from DU APP
-*
-* @params[in] MacCellCb *cellCb,uint16_t ueIdx
-* @return ROK - success
-* RFAILED - failure
-*
-* ****************************************************************/
-
-void deleteMacUeCb(MacUeCb *ueCb)
-{
- MacUeCfg *ueCfg = NULLP;
- ServCellCfgInfo *servCellCfg;
-
- if(ueCb->cellCb)
- {
- MAC_FREE(ueCb->cellCb->macRaCb[ueCb->ueIdx-1].msg4Pdu, ueCb->cellCb->macRaCb[ueCb->ueIdx-1].msg4PduLen);
- MAC_FREE(ueCb->cellCb->macRaCb[ueCb->ueIdx-1].msg4TxPdu, ueCb->cellCb->macRaCb[ueCb->ueIdx-1].msg4TbSize);
-
- if(ueCb->cellCb->ueCfgTmpData[ueCb->ueIdx-1])
- {
- ueCfg =ueCb->cellCb->ueCfgTmpData[ueCb->ueIdx-1];
- MAC_FREE(ueCfg->ambrCfg, sizeof(AmbrCfg));
- if(ueCfg->spCellCfgPres)
- {
- servCellCfg = &ueCfg->spCellCfg.servCellCfg;
- MAC_FREE(servCellCfg->bwpInactivityTmr, sizeof(uint8_t));
-
- if(servCellCfg->initUlBwp.pucchPresent)
- {
- MAC_FREE(servCellCfg->initUlBwp.pucchCfg.resrcSet, sizeof(PucchResrcSetCfg));
-
- if(servCellCfg->initUlBwp.pucchCfg.resrc)
- {
- deletePucchResourcesCfg(servCellCfg->initUlBwp.pucchCfg.resrc);
- MAC_FREE(servCellCfg->initUlBwp.pucchCfg.resrc, sizeof(PucchResrcCfg));
- }
- MAC_FREE(servCellCfg->initUlBwp.pucchCfg.format1, sizeof(PucchFormatCfg));
- MAC_FREE(servCellCfg->initUlBwp.pucchCfg.format2, sizeof(PucchFormatCfg));
- MAC_FREE(servCellCfg->initUlBwp.pucchCfg.format3, sizeof(PucchFormatCfg));
- MAC_FREE(servCellCfg->initUlBwp.pucchCfg.format4, sizeof(PucchFormatCfg));
- MAC_FREE(servCellCfg->initUlBwp.pucchCfg.schedReq, sizeof(PucchSchedReqCfg));
- MAC_FREE(servCellCfg->initUlBwp.pucchCfg.multiCsiCfg, sizeof(PucchMultiCsiCfg));
- MAC_FREE(servCellCfg->initUlBwp.pucchCfg.spatialInfo, sizeof(PucchSpatialCfg));
- MAC_FREE(servCellCfg->initUlBwp.pucchCfg.dlDataToUlAck , sizeof(PucchDlDataToUlAck));
- MAC_FREE(servCellCfg->initUlBwp.pucchCfg.powerControl, sizeof(PucchPowerControl));
- deleteMacPdschServCellCfg(&servCellCfg->pdschServCellCfg);
- }
- }
- for(uint8_t idx=0 ;idx < ueCfg->numLcs; idx++)
- {
- MAC_FREE(ueCfg->lcCfgList[idx].drbQos, sizeof(DrbQosInfo));
- MAC_FREE(ueCfg->lcCfgList[idx].snssai, sizeof(Snssai));
- }
- MAC_FREE(ueCb->cellCb->ueCfgTmpData[ueCb->ueIdx-1],sizeof(MacUeCfg));
- }
- }
- memset(ueCb, 0, sizeof(MacUeCb));
-}
-
/*******************************************************************
*
* @brief Processes UE delete response from scheduler
GET_UE_IDX(schUeDelRsp->crnti, ueIdx);
if(macCb.macCell[cellIdx]->ueCb[ueIdx -1].crnti == schUeDelRsp->crnti)
{
- deleteMacUeCb(&macCb.macCell[cellIdx]->ueCb[ueIdx -1]);
+ memset(&macCb.macCell[cellIdx]->ueCb[ueIdx -1], 0, sizeof(MacUeCb));
macCb.macCell[cellIdx]->numActvUe--;
result = SUCCESS;
ret = ROK;
return ret;
}
-/*******************************************************************
- *
- * @brief Fill and Send Cell Delete response from MAC to DU APP
- *
- * @details
- *
- * Function : MacSendCellDeleteRsp
- *
- * Functionality: Fill and Send Cell Delete response from MAC to DUAPP
- *
- * @params[in] MAC Cell delete result
- * SCH Cell delete response
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-uint8_t MacSendCellDeleteRsp(CellDeleteStatus result, uint8_t cellId)
-{
- MacCellDeleteRsp *deleteRsp=NULLP;
- Pst rspPst;
-
- MAC_ALLOC_SHRABL_BUF(deleteRsp, sizeof(MacCellDeleteRsp));
- if(!deleteRsp)
- {
- DU_LOG("\nERROR --> MAC : MacSendCellDeleteRsp(): Memory allocation for Cell delete response failed");
- return RFAILED;
- }
-
- /* Filling CELL delete response */
- deleteRsp->cellId = cellId;
- deleteRsp->result = result;
-
- /* Fill Post structure and send CELL delete response*/
- memset(&rspPst, 0, sizeof(Pst));
- FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_CELL_DELETE_RSP);
- return (*macDuCellDeleteRspOpts[rspPst.selector])(&rspPst, deleteRsp);
-}
-
-/*******************************************************************
- *
- * @brief delete MAC CellCb information
- *
- * @details
- *
- * Function : deleteMacCellCb
- *
- * Functionality:
- * delete MAC CellCb information
- *
- * @params[in] MacCellCb * cellCb
- *
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-void deleteMacCellCb(MacCellCb * cellCb)
-{
- uint8_t idx;
- for(idx=0; idx<MAX_SLOTS; idx++)
- {
- MAC_FREE(cellCb->dlSlot[idx].dlInfo.rarAlloc, sizeof(RarAlloc));
- if(cellCb->dlSlot[idx].dlInfo.ulGrant)
- {
- MAC_FREE(cellCb->dlSlot[idx].dlInfo.ulGrant->dciInfo.pdschCfg, sizeof(PdschCfg));
- MAC_FREE(cellCb->dlSlot[idx].dlInfo.ulGrant, sizeof(DciInfo));
- }
- if(cellCb->dlSlot[idx].dlInfo.dlMsgAlloc)
- {
- MAC_FREE(cellCb->dlSlot[idx].dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu,\
- cellCb->dlSlot[idx].dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPduLen);
- MAC_FREE(cellCb->dlSlot[idx].dlInfo.dlMsgAlloc, sizeof(DlMsgAlloc));
- }
- }
-
- memset(cellCb, 0, sizeof(MacCellCb));
-}
-
-/*******************************************************************
- *
- * @brief Processes CELL delete response from scheduler
- *
- * @details
- *
- * Function : MacProcSchCellDeleteRsp
- *
- * Functionality:
- * Processes CELL delete from scheduler
- *
- * @params[in] Pst : Post structure
- * schCellDelRsp : Scheduler CELL delete respons
- * @return ROK - success
- * RFAILED - failure
- *
- * * ****************************************************************/
-uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDelRsp)
-{
- uint8_t ret = ROK;
- uint16_t cellIdx=0;
- CellDeleteStatus status;
-
- if(schCellDelRsp)
- {
- if(schCellDelRsp->rsp == RSP_OK)
- {
- DU_LOG("\nINFO --> MAC : SCH CELL Delete response for cellId[%d] is successful ", \
- schCellDelRsp->cellId);
- GET_CELL_IDX(schCellDelRsp->cellId, cellIdx);
- if(macCb.macCell[cellIdx])
- {
- if(macCb.macCell[cellIdx]->cellId == schCellDelRsp->cellId)
- {
- deleteMacCellCb(macCb.macCell[cellIdx]);
- status = SUCCESSFUL_RSP;
- MAC_FREE(macCb.macCell[cellIdx], sizeof(MacCellCb));
- }
- else
- {
- DU_LOG("ERROR --> MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
- status = CELL_ID_INVALID;
- ret = RFAILED;
- }
- }
- else
- {
- DU_LOG("ERROR --> MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
- status = CELL_ID_INVALID;
- ret = RFAILED;
- }
- }
- else
- {
- DU_LOG("ERROR --> MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
- status = CELL_ID_INVALID;
- ret = RFAILED;
- }
- if(MacSendCellDeleteRsp(status, schCellDelRsp->cellId) != ROK)
- {
- DU_LOG("\nERROR --> MAC: MacProcSchCellDeleteRsp(): Failed to send CELL delete response");
- ret = RFAILED;
- }
-
- }
- else
- {
- DU_LOG("\nERROR --> MAC: MacProcSchCellDeleteRsp(): schCellDelRsp is NULL");
- ret = RFAILED;
- }
- return ret;
-}
-
-/*******************************************************************
- *
- * @brief Sends Cell delete req to Scheduler
- *
- * @details
- *
- * Function : sendCellDelReqToSch
- *
- * Functionality: sends Cell delete req to Scheduler
- *
- * @params[in] SchCellDelete *schCellDel
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-
-uint8_t sendCellDelReqToSch(SchCellDelete *schCellDel)
-{
- Pst schPst;
- FILL_PST_MAC_TO_SCH(schPst, EVENT_CELL_DELETE_REQ_TO_SCH);
- return(*macSchCellDeleteReqOpts[schPst.selector])(&schPst, schCellDel);
-}
-
-/*******************************************************************
- *
- * @brief Handles CELL Delete requst from DU APP
- *
- * @details
- *
- * Function : MacProcCellDeleteReq
- *
- * Functionality: Handles CELL Delete requst from DU APP
- *
- * @params[in] Pst *pst, MacCellDelete *cellDelete
- * @return ROK - success
- * RFAILED - failure
- *
- *
- * ****************************************************************/
-uint8_t MacProcCellDeleteReq(Pst *pst, MacCellDelete *cellDelete)
-{
- uint8_t ret = ROK, cellIdx=0;
- SchCellDelete schCellDelete;
-
- DU_LOG("\nINFO --> MAC : Cell Delete Request received for cellId[%d]", cellDelete->cellId);
-
- if(cellDelete)
- {
- GET_CELL_IDX(cellDelete->cellId, cellIdx);
- if(macCb.macCell[cellIdx])
- {
- if(macCb.macCell[cellIdx]->cellId == cellDelete->cellId)
- {
- memset(&schCellDelete, 0, sizeof(SchCellDelete));
- schCellDelete.cellId = cellDelete->cellId;
- ret = sendCellDelReqToSch(&schCellDelete);
- if(ret != ROK)
- {
- DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): Failed to send UE Delete Request to SCH");
- ret = RFAILED;
- }
- }
- else
- {
- DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): Failed to find the MacUeCb of CellId = %d",\
- cellDelete->cellId);
- ret = RFAILED;
- }
- }
- else
- {
- DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): Failed to find the MacUeCb of CellId = %d",\
- cellDelete->cellId);
- ret = RFAILED;
- }
-
- if(ret == RFAILED)
- {
- DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): Sending failure response to DU");
- if(MacSendCellDeleteRsp(CELL_ID_INVALID, cellDelete->cellId) != ROK)
- {
- DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): failed to send cell delete rsp for cellID[%d]",\
- cellDelete->cellId);
- }
-
- }
- MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellDelete, sizeof(MacCellDelete));
- }
- else
- {
- DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): Received MacCellDelete is NULL");
- ret = RFAILED;
- }
- return ret;
-}
-
/**********************************************************************
End of file
**********************************************************************/
#define EVENT_RLC_UE_DELETE_TMR 8
/* Wait time for RLC Timers */
-#define RLC_UE_DELETE_WAIT_TIME 1 /*in milliseconds */
+#define RLC_UE_DELETE_WAIT_TIME 5 /*in milliseconds */
/*******************************************************************************
* DBM Defines
ueCb->ueCfg.spCellCfgPres = true;
}
ueCb->state = SCH_UE_STATE_ACTIVE;
- if(ueCfg->ambrCfg != NULLP)
- {
- SCH_ALLOC(ueCb->ueCfg.ambrCfg , sizeof(SchAmbrCfg));
- memcpy(&ueCb->ueCfg.ambrCfg->ulBr , &ueCfg->ambrCfg->ulBr, sizeof(SchAmbrCfg));
- }
+ ueCb->ueCfg.ambrCfg = ueCfg->ambrCfg;
memcpy(&ueCb->ueCfg.dlModInfo, &ueCfg->dlModInfo , sizeof(SchModulationInfo));
memcpy(&ueCb->ueCfg.ulModInfo, &ueCfg->ulModInfo , sizeof(SchModulationInfo));
{
if(cellCb->schDlSlotInfo[idx])
{
- SCH_FREE(cellCb->schDlSlotInfo[idx]->rarInfo, sizeof(RarInfo));
- if(cellCb->schDlSlotInfo[idx]->dlMsgInfo)
- {
- SCH_FREE(cellCb->schDlSlotInfo[idx]->dlMsgInfo->dlMsgPdu,\
- cellCb->schDlSlotInfo[idx]->dlMsgInfo->dlMsgPduLen);
- SCH_FREE(cellCb->schDlSlotInfo[idx]->dlMsgInfo, sizeof(DlMsgInfo));
- }
SCH_FREE(cellCb->schDlSlotInfo[idx], sizeof(SchDlSlotInfo));
}
}
- SCH_FREE(cellCb->schDlSlotInfo, sizeof(SchDlSlotInfo));
+ SCH_FREE(cellCb->schDlSlotInfo, cellCb->numSlots *sizeof(SchDlSlotInfo*));
}
if(cellCb->schUlSlotInfo)
{
{
if(cellCb->schUlSlotInfo[idx])
{
- SCH_FREE(cellCb->schUlSlotInfo[idx]->schPuschInfo,sizeof(SchPuschInfo));
SCH_FREE(cellCb->schUlSlotInfo[idx], sizeof(SchUlSlotInfo));
}
}
- SCH_FREE(cellCb->schUlSlotInfo, sizeof(SchUlSlotInfo));
+ SCH_FREE(cellCb->schUlSlotInfo, cellCb->numSlots * sizeof(SchUlSlotInfo*));
}
- SCH_FREE(cellCb->cellCfg.sib1SchCfg.sib1PdcchCfg.dci.pdschCfg, sizeof(PdschCfg));
memset(cellCb, 0, sizeof(SchCellCb));
+
}
/*******************************************************************
if(_datPtr) \
{ \
SPutSBuf(SCH_MEM_REGION, SCH_POOL, \
- (Data *)_datPtr, _size); \
+ (Data *)_datPtr,(Size) _size); \
_datPtr = NULLP; \
} \
}
{
if(pst->selector == ODU_SELECTOR_LWLC)
{
- OduCellId *cellId;
+ OduCellId *cellId=NULLP;
/* unpack the address of the structure */
CMCHKUNPK(oduUnpackPointer, (PTR *)&cellId, mBuf);
ODU_PUT_MSG_BUF(mBuf);
{
uint16_t cellId;
CellDeleteStatus result;
-}
-MacCellDeleteRsp;
+}MacCellDeleteRsp;
/* Functions for slot Ind from MAC to DU APP*/
typedef uint8_t (*DuMacCellUpInd) ARGS((
return RFAILED;
}
}
+ else
+ {
+ memset(&f1apMsgDb, 0, sizeof(F1apMsgDb));
+ }
return ROK;
}
* ****************************************************************/
S16 sctpSend(Buffer *mBuf)
{
- uint8_t ret;
- MsgLen len; /* number of actually sent octets */
+ uint8_t ret = ROK;
+ MsgLen len = 0; /* number of actually sent octets */
CmInetMemInfo memInfo;
-
+
+ memset(&memInfo , 0, sizeof(CmInetMemInfo));
memInfo.region = CU_APP_MEM_REG;
memInfo.pool = CU_POOL;
#endif
+DuMacCellDeleteReq packMacCellDeleteReqOpts[] =
+{
+ packDuMacCellDeleteReq, /* Loose coupling */
+ MacProcCellDeleteReq, /* TIght coupling */
+ packDuMacCellDeleteReq /* Light weight-loose coupling */
+};
+
/*******************************************************************
*
* @brief Processes cells to be activated
return ROK;
}
+/*******************************************************************
+ *
+ * @brief Handle Cell delete response from MAC
+ *
+ * @details
+ *
+ * Function : DuProcMacCellDeleteRsp
+ *
+ * Functionality: Handle Cell delete response from MAC
+ *
+ * @params[in] Pointer to MacCellDeleteRsp and Pst
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp)
+{
+ uint8_t ret = ROK;
+ uint16_t cellIdx=0;
+ if(deleteRsp)
+ {
+ if(deleteRsp->result == SUCCESSFUL_RSP)
+ {
+ GET_CELL_IDX(deleteRsp->cellId, cellIdx);
+ DU_LOG("\nINFO --> DU APP : MAC CELL Delete Response : SUCCESS [CELL IDX : %d]", deleteRsp->cellId);
+ if(duCb.actvCellLst[cellIdx]->cellId == deleteRsp->cellId)
+ {
+ memset(duCb.actvCellLst[cellIdx], 0, sizeof(DuCellCb));
+ gCellStatus = CELL_DOWN;
+
+#ifdef O1_ENABLE
+ DU_LOG("\nINFO --> DU APP : Raise cell down alarm for cell id=%d", deleteRsp->cellId);
+ raiseCellAlrm(CELL_DOWN_ALARM_ID, deleteRsp->cellId);
+ setCellOpState(deleteRsp->cellId, DISABLED, INACTIVE);
+#endif
+
+ duCb.numActvCells--;
+ duCb.numCfgCells--;
+ DU_FREE(duCb.actvCellLst[cellIdx], sizeof(DuCellCb));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacCellDeleteRsp(): CellId [%d] doesnot exist", deleteRsp->cellId);
+ ret = RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacCellDeleteRsp(): MAC CELL Delete Response : FAILED\
+ [CELL IDX : %d]", deleteRsp->cellId);
+ ret = RFAILED;
+ }
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool, deleteRsp, sizeof(MacCellDeleteRsp));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacCellDeleteRsp(): Received MAC cell delete response is NULL");
+ ret = RFAILED;
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Sending Cell Delete Req To Mac
+ *
+ * @details
+ *
+ * Function : sendCellDeleteReqToMac
+ *
+ * Functionality:
+ * sending Cell Delete Req To Mac
+ *
+ * @params[in] uint16_t cellId
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ *
+ *****************************************************************/
+
+uint8_t sendCellDeleteReqToMac(uint16_t cellId)
+{
+ Pst pst;
+ uint8_t ret=ROK;
+ MacCellDelete *cellDelete = NULLP;
+
+ DU_ALLOC_SHRABL_BUF(cellDelete, sizeof(MacCellDelete));
+ if(cellDelete)
+ {
+ cellDelete->cellId = cellId;
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_DELETE_REQ);
+
+ DU_LOG("\nINFO --> DU APP : Sending Cell Delete Request to MAC");
+ /* Processing one Cell at a time to MAC */
+ ret = (*packMacCellDeleteReqOpts[pst.selector])(&pst, cellDelete);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : sendCellDeleteReqToMac(): Failed to send Cell delete Req to MAC");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cellDelete, sizeof(MacCellDelete));
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : sendCellDeleteReqToMac(): Failed to allocate memory");
+ ret = RFAILED;
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief DU preocess Cell Delete Req to MAC
+ *
+ * @details
+ *
+ * Function : duSendCellDeletReq
+ *
+ * Functionality: DU process Cell Delete Req to MAC
+ *
+ * @params[in] uint16_t cellId
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t duSendCellDeletReq(uint16_t cellId)
+{
+ uint16_t cellIdx = 0;
+ DU_LOG("\nINFO --> DU APP : Processing Cell Delete Request ");
+ GET_CELL_IDX(cellId, cellIdx);
+
+ if(duCb.actvCellLst[cellIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): CellId[%d] is not found", cellId);
+ return RFAILED;
+ }
+
+ if(duCb.actvCellLst[cellIdx]->cellId != cellId)
+ {
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): CellId[%d] is not found", cellId);
+ return RFAILED;
+
+ }
+
+ if(duCb.actvCellLst[cellIdx]->cellStatus != DELETION_IN_PROGRESS)
+ {
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): CellStatus[%d] of cellId[%d] is not correct.\
+ Expected CellStatus is DELETION_IN_PROGRESS",duCb.actvCellLst[cellIdx]->cellStatus, cellId);
+ return RFAILED;
+ }
+
+ if(duCb.actvCellLst[cellIdx]->numActvUes)
+ {
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): Active UEs still present in cellId[%d].\
+ Failed to delete cell", cellId);
+ return RFAILED;
+ }
+
+ if(duBuildAndSendMacCellStop(cellId) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): Failed to build and send cell stop request to MAC for\
+ cellId[%d]",cellId);
+ return RFAILED;
+ }
+
+ return ROK;
+}
+
/**********************************************************************
End of file
**********************************************************************/
{
if(pdsch->xOverhead)
{
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->xOverhead, sizeof(uint8_t));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->xOverhead, sizeof(PdschXOverhead));
}
if(pdsch->codeBlkGrpFlushInd)
{
}
if(pdsch->maxCodeBlkGrpPerTb)
{
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->maxCodeBlkGrpPerTb, sizeof(uint8_t));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->maxCodeBlkGrpPerTb, sizeof(MaxCodeBlkGrpPerTB));
}
if(pdsch->maxMimoLayers)
{
}
else
{
- DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb, sizeof(uint8_t));
+ DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb, sizeof(MaxCodeBlkGrpPerTB));
if(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb)
{
*(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb) = \
}
else
{
- DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb, sizeof(bool));
+ DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->codeBlkGrpFlushInd , sizeof(bool));
if(macUePdschSrvCellCfg->codeBlkGrpFlushInd)
{
*(macUePdschSrvCellCfg->codeBlkGrpFlushInd) = \
}
else
{
- DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->xOverhead, sizeof(uint8_t));
+ DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->xOverhead, sizeof(PdschXOverhead));
if(macUePdschSrvCellCfg->xOverhead)
{
*(macUePdschSrvCellCfg->xOverhead) = *(cuPdschSrvCellCfg->xOverhead);
uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId)
{
- uint8_t ueId =0 , ueIdx =0, ieIdx=0,arrIdx=0;
- uint8_t cellId =0, cellIdx =0, crnti=0;
- CmLList *f1apPduNode;
- ReservedF1apPduInfo *f1apPduInfo;
+ uint8_t ieIdx=0, arrIdx=0;
+ uint8_t ueId =0 , ueIdx =0;
+ uint16_t cellId =0, cellIdx =0, crnti=0;
+ CmLList *f1apPduNode = NULLP;
+ ReservedF1apPduInfo *f1apPduInfo =NULLP;
F1AP_PDU_t *f1apMsgPdu = NULLP;
GNBDUConfigurationUpdate_t *gnbDuConfigUpdate = NULLP;
- BIT_STRING_t *cellIdentity;
- struct Served_Cells_To_Delete_ItemIEs *deleteItemIe;
- Served_Cells_To_Delete_List_t *cellsToDelete;
+ BIT_STRING_t *cellIdentity=NULLP;
+ struct Served_Cells_To_Delete_ItemIEs *deleteItemIe=NULLP;
+ Served_Cells_To_Delete_List_t *cellsToDelete=NULLP;
Served_Cells_To_Delete_Item_t *deleteItem=NULLP;
DU_LOG("\nINFO --> DU APP: GNB-DU config update Ack received ");
GET_CELL_IDX(cellId, cellIdx);
if(duCb.actvCellLst[cellIdx] != NULLP)
{
- for(ueIdx = 0; ueIdx < duCb.numUe; ueIdx++)
+ for(ueIdx = 0; ueIdx < duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++)
{
crnti = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].crnti;
GET_UE_IDX(crnti,ueId);
{
for(cellIdx = 0; cellIdx < duCb.numActvCells; cellIdx++)
{
- for(ueIdx = 0; ueIdx < duCb.numUe; ueIdx++)
+ for(ueIdx = 0; ueIdx < duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++)
{
if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
{
for(cellIdx = 0; cellIdx < duCb.numActvCells; cellIdx++)
{
- for(ueIdx = 0; ueIdx < duCb.numUe; ueIdx++)
+ for(ueIdx = 0; ueIdx < duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++)
{
if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
typedef enum
{
UE_INACTIVE,
- UE_ACTIVE
+ UE_ACTIVE,
+ UE_DELETION_IN_PROGRESS
}UeState;
typedef enum
typedef struct duCellCb
{
- uint16_t cellId; /* Internal cell Id */
- CellCfgParams cellInfo; /* Cell info */
+ uint16_t cellId; /* Internal cell Id */
+ CellCfgParams cellInfo; /* Cell info */
/* pointer to store the address of macCellCfg params used to send du-app to MAC */
- MacCellCfg *duMacCellCfg;
- CellStatus cellStatus; /* Cell status */
- uint32_t numActvUes; /* Total Active UEs */
- DuUeCb ueCb[MAX_NUM_UE]; /* UE CONTEXT */
+ MacCellCfg *duMacCellCfg;
+ CellStatus cellStatus; /* Cell status */
+ uint32_t gnbDuUeF1apIdGenerator; /* Generating Du Ue F1ap Id */
+ uint32_t numActvUes; /* Total Active UEs */
+ DuUeCb ueCb[MAX_NUM_UE]; /* UE CONTEXT */
}DuCellCb;
typedef struct duLSapCb
/* DU APP DB */
typedef struct duCb
{
- Mem mem; /* Memory configs */
- TskInit init; /* DU Init */
- //DuLSapCb **macSap; /* MAC SAP */
- bool f1Status; /* Status of F1 connection */
- bool e2Status; /* Status of E2 connection */
- uint8_t numCfgCells;
- DuCellCb* cfgCellLst[MAX_NUM_CELL]; /* List of cells at DU APP of type DuCellCb */
- uint8_t numActvCells;
- DuCellCb* actvCellLst[MAX_NUM_CELL]; /* List of cells activated/to be activated of type DuCellCb */
- uint32_t numUe; /* current number of UEs */
- UeCcchCtxt ueCcchCtxt[MAX_NUM_UE]; /* mapping of gnbDuUeF1apId to CRNTI required for CCCH processing*/
- 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 */
+ Mem mem; /* Memory configs */
+ TskInit init; /* DU Init */
+ bool f1Status; /* Status of F1 connection */
+ bool e2Status; /* Status of E2 connection */
+ uint8_t numCfgCells; /* number of configured cells */
+ DuCellCb* cfgCellLst[MAX_NUM_CELL]; /* List of cells at DU APP of type DuCellCb */
+ uint8_t numActvCells; /* Number of active cells */
+ DuCellCb* actvCellLst[MAX_NUM_CELL]; /* List of cells activated/to be activated of type DuCellCb */
+ uint32_t numUe; /* current number of UEs */
+ UeCcchCtxt ueCcchCtxt[MAX_NUM_UE]; /* mapping of gnbDuUeF1apId to CRNTI required for CCCH processing*/
+ 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 */
}DuCb;
uint8_t BuildAndSendDUConfigUpdate();
uint16_t getTransId();
uint8_t cmPkLrgSchCfgReq(Pst * pst,RgMngmt * cfg);
+uint8_t sendCellDeleteReqToMac(uint16_t cellId);
packMacCellCfgReq packMacCellCfgOpts[] =
{
uint8_t duProcCfgComplete()
{
uint8_t ret = ROK;
- static uint16_t cellId = 0;
+ uint16_t cellId = 0;
uint16_t idx;
for(idx=0; idx< DEFAULT_CELLS; idx++)
{
cell->cellInfo.nrEcgi.plmn.mcc[2] = PLMN_MCC2;
cell->cellInfo.nrEcgi.plmn.mnc[0] = PLMN_MNC0;
cell->cellInfo.nrEcgi.plmn.mnc[1] = PLMN_MNC1;
- cell->cellInfo.nrEcgi.cellId = NR_CELL_ID;
+ cell->cellInfo.nrEcgi.cellId = cell->cellId;
cell->cellInfo.nrPci = NR_PCI;
cell->cellInfo.fiveGsTac = DU_TAC;
memset(&cell->cellInfo.plmn[idx1], 0, sizeof(Plmn));
cell->cellInfo.maxUe = duCfgParam.maxUe;
cell->cellStatus = CELL_OUT_OF_SERVICE;
gCellStatus = CELL_DOWN;
-
+ cell->gnbDuUeF1apIdGenerator = 0;
duCb.cfgCellLst[duCb.numCfgCells] = cell;
duCb.numCfgCells++;
}
DU_LOG("\nERROR --> DU APP : duBuildAndSendMacCellStop(): Memory allocation failed ");
return RFAILED;
}
-
+ memset(oduCellId, 0, sizeof(OduCellId));
oduCellId->cellId = duCb.actvCellLst[cellIdx]->cellId;
/* Fill Pst */
if(duGetCellCb(cellId->cellId, &cellCb) != ROK)
return RFAILED;
- if((cellCb->cellStatus == ACTIVATED))
+ if((cellCb->cellStatus == ACTIVATED) || (cellCb->cellStatus == DELETION_IN_PROGRESS))
{
DU_LOG("\nINFO --> DU APP : 5G-NR Cell %d is DOWN", cellId->cellId);
- cellCb->cellStatus = DELETION_IN_PROGRESS;
+ if(sendCellDeleteReqToMac(cellId->cellId) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duHandleStopInd(): Failed to send Cell delete req to MAC for\
+ cellId[%d]", cellId->cellId);
+ return RFAILED;
+ }
+
#ifdef O1_ENABLE
DU_LOG("\nINFO --> DU APP : Raise cell down alarm for cell id=%d", cellId->cellId);
DU_LOG("\n\nDEBUG --> SCTP : Initializing");
ODU_SET_PROC_ID(DU_PROC);
connUp = FALSE;
+
+ memset(&f1Params, 0, sizeof(DuSctpDestCb));
f1Params.assocId = -1;
+ memset(&ricParams, 0, sizeof(DuSctpDestCb));
ricParams.assocId = -1;
nonblocking = FALSE;
return ROK;
#include "du_f1ap_msg_hdl.h"
#include "du_ue_mgr.h"
+#ifdef O1_ENABLE
+#include "AlarmInterface.h"
+#include "ConfigInterface.h"
+#endif
+
DuMacDlCcchInd packMacDlCcchIndOpts[] =
{
packMacDlCcchInd, /* Loose coupling */
packDuRlcUeDeleteReq /* Light weight-loose coupling */
};
-DuMacCellDeleteReq packMacCellDeleteReqOpts[] =
-{
- packDuMacCellDeleteReq, /* Loose coupling */
- MacProcCellDeleteReq, /* TIght coupling */
- packDuMacCellDeleteReq /* Light weight-loose coupling */
-};
-
/*******************************************************************
*
* @brief Function to fillDlUserDataInfo
* @return gnbDuF1apId
*
* ****************************************************************/
-uint32_t genGnbDuUeF1apId()
-{
- static uint32_t gnbDuUeF1apId = 0;
-
- return ++gnbDuUeF1apId;
+int32_t genGnbDuUeF1apId(uint8_t cellId)
+{
+ uint8_t cellIdx =0;
+
+ GET_CELL_IDX(cellId, cellIdx);
+ if(duCb.actvCellLst[cellIdx])
+ {
+ return ++duCb.actvCellLst[cellIdx]->gnbDuUeF1apIdGenerator;
+ }
+ else
+ {
+ DU_LOG("ERROR --> DU_APP : genGnbDuUeF1apId(): CellId[%d] does not exist", cellId);
+ }
+ return -1;
}
/******************************************************************
{
uint8_t ret = ROK;
- uint32_t gnbDuUeF1apId = 0;
+ int32_t gnbDuUeF1apId = 0;
- gnbDuUeF1apId = genGnbDuUeF1apId();
+ gnbDuUeF1apId = genGnbDuUeF1apId(ulCcchIndInfo->cellId);
+
+ if(gnbDuUeF1apId == -1)
+ {
+ DU_LOG("ERROR --> DU_APP : duProcUlCcchInd(): Received cellId[%d] does not exist", ulCcchIndInfo->cellId);
+ return RFAILED;
+ }
/* Store Ue mapping */
- duCb.ueCcchCtxt[duCb.numUe].gnbDuUeF1apId = gnbDuUeF1apId;
+ duCb.ueCcchCtxt[duCb.numUe].gnbDuUeF1apId = (uint32_t)gnbDuUeF1apId;
duCb.ueCcchCtxt[duCb.numUe].crnti = ulCcchIndInfo->crnti;
duCb.ueCcchCtxt[duCb.numUe].cellId = ulCcchIndInfo->cellId;
{
DU_ALLOC_SHRABL_BUF(lcCfg->drbQos, sizeof(DrbQosInfo));
if(!lcCfg->drbQos)
- {
+ {
DU_LOG("\nERROR --> DU APP : Memory Alloc failed at drQos at fillMacLcCfgToAddMod()");
return RFAILED;
}
duCb.actvCellLst[cellIdx]->numActvUes++;
memset(ueCcchCtxt, 0, sizeof(UeCcchCtxt));
+ duCb.numUe--;
}
}
return ret;
{
if(duSendEgtpTnlMgmtReq(EGTP_TNL_MGMT_DEL, duTnlCfg->tnlCfg1->teId, f1TnlCfg->tnlCfg1) == ROK)
{
- /* Free memory at drbIdx */
- DU_FREE(duTnlCfg->tnlCfg1, sizeof(GtpTnlCfg));
- DU_FREE(duTnlCfg, sizeof(UpTnlCfg));
- duCb.numDrb--;
- for(delIdx = ueCbIdx; delIdx < duCb.numDrb; delIdx++)
- {
- /* moving all elements one index ahead */
- ret = fillTnlCfgToAddMod(&duCb.upTnlCfg[delIdx], duCb.upTnlCfg[delIdx+1]);
- if(ret != ROK)
- {
- return ret;
- }
- }
+ /* Free memory at drbIdx */
+ DU_FREE(duTnlCfg->tnlCfg1, sizeof(GtpTnlCfg));
+ duCb.numDrb--;
+ for(delIdx = ueCbIdx; delIdx < duCb.numDrb; delIdx++)
+ {
+ /* moving all elements one index ahead */
+ ret = fillTnlCfgToAddMod(&duCb.upTnlCfg[delIdx], duCb.upTnlCfg[delIdx+1]);
+ if(ret != ROK)
+ {
+ return ret;
+ }
+ }
}
}
return ret;
if(duUpdateTunnelCfgDb(ueIdx, cellId, &ueCb->f1UeDb->duUeCfg) != ROK)
{
DU_LOG("\nERROR --> DU_APP : Failed to establish tunnel in duUpdateDuUeCbCfg()");
- return RFAILED;
+ return RFAILED;
}
}
}
if(ret == RFAILED)
DU_LOG("\nERROR --> DU APP : Failed to process UE Context Setup Request in DuProcRlcDlRrcMsgRsp()");
}
+
if(ueCb->f1UeDb->actionType == UE_CTXT_MOD)
{
ret = duBuildAndSendUeContextModReq(dlRrcMsg->cellId, dlRrcMsg->crnti, &ueCb->f1UeDb->duUeCfg);
if(ret == RFAILED)
DU_LOG("\nERROR --> DU APP : Failed to process UE Context Mod Request in DuProcRlcDlRrcMsgRsp()");
}
- if(ueCb->f1UeDb->actionType == UE_CTXT_RELEASE)
+
+ if(ueCb->f1UeDb->actionType == UE_CTXT_RELEASE && ueCb->ueState == UE_ACTIVE)
{
ret = duBuildAndSendUeDeleteReq(dlRrcMsg->cellId,dlRrcMsg->crnti);
if(ret == RFAILED)
{
DU_LOG("\nERROR --> DU APP : Failed to process UE Context Release Request in DuProcRlcDlRrcMsgRsp()");
}
-
}
}
}
void deleteMacUeCfg(MacUeCfg *ueCfg)
{
- uint8_t lcCfgIdx;
- uint8_t resrcIdx;
- ServCellCfgInfo *servCellCfg;
- PucchResrcInfo *resrcToAddModList;
-
- if(ueCfg)
+ uint8_t lcCfgIdx=0;
+
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,ueCfg->ambrCfg, sizeof(AmbrCfg));
+ if(ueCfg->spCellCfgPres)
{
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,ueCfg->ambrCfg, sizeof(AmbrCfg));
- if(ueCfg->spCellCfgPres)
- {
- servCellCfg = &ueCfg->spCellCfg.servCellCfg;
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->bwpInactivityTmr, sizeof(uint8_t));
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.resrcSet,\
- sizeof(PucchResrcSetCfg));
- if(servCellCfg->initUlBwp.pucchCfg.resrc)
- {
- /*freeing the PucchResrcCfg*/
- for(resrcIdx= 0; resrcIdx< servCellCfg->initUlBwp.pucchCfg.resrc->resrcToAddModListCount; resrcIdx++)
- {
- resrcToAddModList=&servCellCfg->initUlBwp.pucchCfg.resrc->resrcToAddModList[resrcIdx];
- switch(resrcToAddModList->pucchFormat)
- {
- case PUCCH_FORMAT_0:
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format0 ,\
- sizeof(PucchFormat0));
- break;
- }
- case PUCCH_FORMAT_1:
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format1 ,\
- sizeof(PucchFormat1));
- break;
- }
- case PUCCH_FORMAT_2:
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format2 ,\
- sizeof(PucchFormat2_3));
- break;
- }
- case PUCCH_FORMAT_3:
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format3 ,\
- sizeof(PucchFormat2_3));
- break;
- }
- case PUCCH_FORMAT_4:
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format4 ,\
- sizeof(PucchFormat4));
- break;
- }
- }
- }
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.resrc,\
- sizeof(PucchResrcCfg));
- }
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.format1,\
- sizeof(PucchFormatCfg));
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.format2,\
- sizeof(PucchFormatCfg));
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.format3,\
- sizeof(PucchFormatCfg));
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.format4,\
- sizeof(PucchFormatCfg));
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.schedReq,\
- sizeof(PucchSchedReqCfg));
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.multiCsiCfg,\
- sizeof(PucchMultiCsiCfg));
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.spatialInfo,\
- sizeof(PucchSpatialCfg));
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.dlDataToUlAck ,\
- sizeof(PucchDlDataToUlAck));
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.powerControl,\
- sizeof(PucchPowerControl));
- deletePdschServCellCfg(&servCellCfg->pdschServCellCfg);
- }
- for(lcCfgIdx=0; lcCfgIdx< ueCfg->numLcs; lcCfgIdx++)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,ueCfg->lcCfgList[lcCfgIdx].drbQos, sizeof(DrbQosInfo));
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,ueCfg->lcCfgList[lcCfgIdx].snssai, sizeof(Snssai));
- }
+ freeUeReCfgCellGrpInfo(ueCfg);
+ }
+ for(lcCfgIdx=0; lcCfgIdx< ueCfg->numLcs; lcCfgIdx++)
+ {
+ freeMacLcCfg(&ueCfg->lcCfgList[lcCfgIdx]);
}
memset(ueCfg, 0, sizeof(MacUeCfg));
}
* ****************************************************************/
uint8_t deleteUeCfg(uint16_t cellIdx, uint8_t ueIdx)
{
+ uint8_t tnlIdx = 0;
DuUeCb *ueCb = NULLP;
+
if(duCb.actvCellLst[cellIdx] != NULLP)
{
if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].macUeCfg.macUeCfgState == UE_DELETE_COMPLETE)\
{
freeF1UeDb(ueCb->f1UeDb);
}
+ for(tnlIdx = 0; tnlIdx < duCb.numDrb; )
+ {
+ if(duCb.upTnlCfg[tnlIdx]->ueIdx == ueIdx)
+ {
+ duCb.upTnlCfg[tnlIdx]->configType = CONFIG_DEL;
+ duProcEgtpTunnelCfg(tnlIdx, duCb.upTnlCfg[tnlIdx], duCb.upTnlCfg[tnlIdx]);
+ }
+ else
+ tnlIdx++;
+ }
duCb.actvCellLst[cellIdx]->numActvUes--;
memset(ueCb, 0, sizeof(DuUeCb));
}
uint8_t DuProcMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp)
{
- uint8_t ret =ROK;
+ uint8_t ret =ROK,ueId=0;
uint16_t cellIdx=0;
-
+ uint32_t gnbCuUeF1apId =0 , gnbDuUeF1apId =0;
+
if(deleteRsp)
{
if(deleteRsp->result == SUCCESS)
if(duCb.actvCellLst[cellIdx])
{
duCb.actvCellLst[cellIdx]->ueCb[deleteRsp->ueId -1].macUeCfg.macUeCfgState = UE_DELETE_COMPLETE;
- if(sendUeDeleteReqToRlc(deleteRsp->cellId, deleteRsp->ueId) == RFAILED)
+ ueId = deleteRsp->ueId;
+ gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueId-1].gnbDuUeF1apId;
+ gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueId-1].gnbCuUeF1apId;
+ if(deleteUeCfg(cellIdx, ueId) == ROK)
{
- DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp():Failed to build UE delete req for RLC ");
- ret = RFAILED;
+ ret = BuildAndSendUeContextReleaseComplete(deleteRsp->cellId, gnbCuUeF1apId, gnbDuUeF1apId);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp(): failed to send UE context release complete");
+ }
}
+
}
}
else
uint8_t DuProcRlcUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *delRsp)
{
uint8_t ueId = 0, ret = ROK;
- uint16_t cellIdx = 0;
- uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId =0;
+ uint16_t cellIdx = 0,crnti=0;
if(delRsp)
{
if(duCb.actvCellLst[cellIdx]!=NULLP)
{
duCb.actvCellLst[cellIdx]->ueCb[ueId-1].rlcUeCfg.rlcUeCfgState = UE_DELETE_COMPLETE;
- gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueId-1].gnbDuUeF1apId;
- gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueId-1].gnbCuUeF1apId;
- if(deleteUeCfg(cellIdx, ueId) == ROK)
+ GET_CRNTI(crnti, ueId);
+ if(sendUeDeleteReqToMac(delRsp->cellId, ueId, crnti) == RFAILED)
{
- ret = BuildAndSendUeContextReleaseComplete(delRsp->cellId, gnbCuUeF1apId, gnbDuUeF1apId);
- if(ret != ROK)
- {
- DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp(): failed to send UE context release complete");
- }
+ DU_LOG("\nERROR --> DU APP : duBuildAndSendUeDeleteReq(): Failed to build UE delete req for MAC ");
+ return RFAILED;
}
+
}
}
else
return RFAILED;
}
- if(sendUeDeleteReqToMac(cellId, ueId, crnti) == RFAILED)
+ duCb.actvCellLst[cellIdx]->ueCb[ueId - 1].ueState = UE_DELETION_IN_PROGRESS;
+ if(sendUeDeleteReqToRlc(cellId, ueId) == RFAILED)
{
- DU_LOG("\nERROR --> DU APP : duBuildAndSendUeDeleteReq(): Failed to build UE delete req for MAC ");
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp():Failed to build UE delete req for RLC ");
return RFAILED;
}
}
}
}
-/*******************************************************************
- *
- * @brief Delete DU CellCb information
- *
- * @details
- *
- * Function : deleteDuCellCb
- *
- * Functionality: Delete DU CellCb information
- *
- * @params[in] DuCellCb *cellCb
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-
-void deleteDuCellCb(DuCellCb *cellCb)
-{
-
- if(cellCb->duMacCellCfg)
- {
- if(cellCb->duMacCellCfg->prachCfg.fdm[0].unsuedRootSeq)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cellCb->duMacCellCfg->prachCfg.fdm[0].unsuedRootSeq,\
- cellCb->duMacCellCfg->prachCfg.fdm[0].numUnusedRootSeq);
- }
- if(cellCb->duMacCellCfg->sib1Cfg.sib1Pdu)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,cellCb->duMacCellCfg->sib1Cfg.sib1Pdu,\
- cellCb->duMacCellCfg->sib1Cfg.sib1PduLen);
- }
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cellCb->duMacCellCfg, sizeof(MacCellCfg));
- }
- memset(cellCb, 0, sizeof(DuCellCb));
-
-}
-
-/*******************************************************************
- *
- * @brief Handle Cell delete response from MAC
- *
- * @details
- *
- * Function : DuProcMacCellDeleteRsp
- *
- * Functionality: Handle Cell delete response from MAC
- *
- * @params[in] Pointer to MacCellDeleteRsp and Pst
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-
-uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp)
-{
- uint8_t ret = ROK;
- uint16_t cellIdx=0;
- if(deleteRsp)
- {
- if(deleteRsp->result == SUCCESSFUL_RSP)
- {
- GET_CELL_IDX(deleteRsp->cellId, cellIdx);
- DU_LOG("\nINFO --> DU APP : MAC CELL Delete Response : SUCCESS [CELL IDX : %d]", deleteRsp->cellId);
- if(duCb.actvCellLst[cellIdx]->cellId == deleteRsp->cellId)
- {
- deleteDuCellCb(duCb.actvCellLst[cellIdx]);
- gCellStatus = CELL_DOWN;
- duCb.numActvCells--;
- DU_FREE(duCb.actvCellLst[cellIdx], sizeof(DuCellCb));
- }
- else
- {
- DU_LOG("\nERROR --> DU APP : DuProcMacCellDeleteRsp(): CellId [%d] doesnot exist", deleteRsp->cellId);
- ret = RFAILED;
- }
- }
- else
- {
- DU_LOG("\nERROR --> DU APP : DuProcMacCellDeleteRsp(): MAC CELL Delete Response : FAILED\
- [CELL IDX : %d]", deleteRsp->cellId);
- ret = RFAILED;
- }
- DU_FREE_SHRABL_BUF(pst->region, pst->pool, deleteRsp, sizeof(MacCellDeleteRsp));
- }
- else
- {
- DU_LOG("\nERROR --> DU APP : DuProcMacCellDeleteRsp(): Received MAC cell delete response is NULL");
- ret = RFAILED;
- }
- return ret;
-}
-
-/*******************************************************************
- *
- * @brief Sending Cell Delete Req To Mac
- *
- * @details
- *
- * Function : sendCellDeleteReqToMac
- *
- * Functionality:
- * sending Cell Delete Req To Mac
- *
- * @params[in] uint16_t cellId
- * @return ROK - success
- * RFAILED - failure
- *
- *
- *****************************************************************/
-
-uint8_t sendCellDeleteReqToMac(uint16_t cellId)
-{
- Pst pst;
- uint8_t ret=ROK;
- MacCellDelete *cellDelete = NULLP;
-
- DU_ALLOC(cellDelete, sizeof(MacCellDelete));
- if(cellDelete)
- {
- cellDelete->cellId = cellId;
- FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_DELETE_REQ);
-
- DU_LOG("\nINFO --> DU APP : Sending Cell Delete Request to MAC");
- /* Processing one Cell at a time to MAC */
- ret = (*packMacCellDeleteReqOpts[pst.selector])(&pst, cellDelete);
- if(ret == RFAILED)
- {
- DU_LOG("\nERROR --> DU APP : sendCellDeleteReqToMac(): Failed to send Cell delete Req to MAC");
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cellDelete, sizeof(MacCellDelete));
- }
- }
- else
- {
- DU_LOG("\nERROR --> DU APP : sendCellDeleteReqToMac(): Failed to allocate memory");
- ret = RFAILED;
- }
- return ret;
-}
-
-/*******************************************************************
- *
- * @brief DU preocess Cell Delete Req to MAC
- *
- * @details
- *
- * Function : duSendCellDeletReq
- *
- * Functionality: DU process Cell Delete Req to MAC
- *
- * @params[in] uint16_t cellId
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-
-uint8_t duSendCellDeletReq(uint16_t cellId)
-{
- uint16_t cellIdx = 0;
- DU_LOG("\nINFO --> DU APP : Processing Cell Delete Request ");
- GET_CELL_IDX(cellId, cellIdx);
-
- if(duCb.actvCellLst[cellIdx] == NULLP)
- {
- DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): CellId[%d] is not found", cellId);
- return RFAILED;
- }
-
- if(duCb.actvCellLst[cellIdx]->cellId != cellId)
- {
- DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): CellId[%d] is not found", cellId);
- return RFAILED;
-
- }
-
- if(duCb.actvCellLst[cellIdx]->cellStatus != DELETION_IN_PROGRESS)
- {
- DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): CellStatus[%d] of cellId[%d] is not correct.\
- Expected CellStatus is DELETION_IN_PROGRESS",duCb.actvCellLst[cellIdx]->cellStatus, cellId);
- return RFAILED;
- }
-
- if(duCb.actvCellLst[cellIdx]->numActvUes)
- {
- DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): Active UEs still present in cellId[%d].\
- Failed to delete cell", cellId);
- return RFAILED;
- }
-
- if(duBuildAndSendMacCellStop(cellId) == RFAILED)
- {
- DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): Failed to build and send cell stop request to MAC for\
- cellId[%d]",cellId);
- return RFAILED;
- }
-
- if(sendCellDeleteReqToMac(cellId) == RFAILED)
- {
- DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): Failed to send Cell delete req to MAC for\
- cellId[%d]",cellId);
- return RFAILED;
- }
-
- return ROK;
-}
/*******************************************************************
*
* @brief Du process Ue Context Release Command
DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand(): Failed to build and send Ue Delete request");
}
}
+
return ret;
}
if(lwrMacCb.phyState == PHY_STATE_RUNNING)
{
l1HdlSlotIndicaion(TRUE);
+
+ /* Initialize all global variables */
+ sfnValue = 0;
+ slotValue = 0;
+ rachIndSent = false;
+ msg3Sent = false;
+ msg5ShortBsrSent = false;
+ msg5Sent = false;
+ dlDedMsg = false;
+ msgSecurityModeComp = false;
+ msgRrcReconfiguration = false;
+ msgRegistrationComp = false;
+
DU_LOG("\nINFO --> PHY_STUB: Slot Indication is stopped successfully");
MAC_FREE(msg, msgLen);
}
uint8_t l1SendUlUserData();
uint8_t l1SendStatusPdu();
uint16_t l1BuildAndSendSlotIndication();
+uint16_t l1BuildAndSendStopInd();
pthread_t thread = 0;
/*******************************************************************
void l1HdlSlotIndicaion(bool stopSlotInd)
{
Pst pst;
- int ret;
Buffer *mBuf = NULLP;
if(!stopSlotInd)