#include "du_f1ap_msg_hdl.h"
extern DuCfgParams duCfgParam;
-extern uint8_t duBuildAndSendMacCellCfg();
+uint8_t duBuildAndSendMacCellCfg(uint16_t cellId);
/*******************************************************************
*
duCb.actvCellLst[nci-1] = cellCb;
duCb.numActvCells++;
/* Build and send Mac Cell Cfg for the number of active cells */
- ret = duBuildAndSendMacCellCfg();
+ ret = duBuildAndSendMacCellCfg(cellCb->cellId);
if(ret != ROK)
{
DU_LOG("\nDU APP : macCellCfg build and send failed");
+ /* Move cellCb back to cfgCellList */
+ duCb.cfgCellLst[nci-1] = duCb.actvCellLst[nci-1];
+ duCb.actvCellLst[nci-1] = NULLP;
+ duCb.numActvCells--;
return RFAILED;
}
}
{
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;
bool firstSlotIndRcvd;
CellStatus cellStatus; /* Cell status */
uint32_t numActvUes; /* Total Active UEs */
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 */
- /* pointer to store the address of macCellCfg params used to send du-app to MAC */
- MacCellCfg *duMacCellCfg; /* pointer to store params while sending DU-APP to MAC */
uint32_t numUe; /* current number of UEs */
UeCcchCtxt ueCcchCtxt[MAX_NUM_UE]; /* mapping of gnbDuUeF1apId to CRNTI required for CCCH processing*/
}DuCb;
* Functionality:
* Initiates MAC Configs towards MAC
*
- * @param[in] void
+ * @param[in]cell id
* @return ROK - success
* RFAILED - failure
*
***************************************************************************/
-uint8_t duBuildAndSendMacCellCfg()
+uint8_t duBuildAndSendMacCellCfg(uint16_t cellId)
{
Pst pst;
- DU_SET_ZERO(&pst, sizeof(Pst));
MacCellCfg *duMacCellCfg = NULLP;
DU_ALLOC_SHRABL_BUF(duMacCellCfg, sizeof(MacCellCfg));
return RFAILED;
}
- /* store the address in the duCb so that we can free on confirm msg */
- duCb.duMacCellCfg = duMacCellCfg;
+ /* store the address in the duCellCb so that we can free on confirm msg */
+ duCb.actvCellLst[cellId-1]->duMacCellCfg = duMacCellCfg;
/* copy the mac config structure from duCfgParams */
memcpy(duMacCellCfg,&duCfgParam.macCellCfg,sizeof(MacCellCfg));
uint8_t actvCellIdx = 0;
uint8_t ret = ROK;
- if(macCellCfgCfm->rsp == ROK)
+ for(actvCellIdx = 0; actvCellIdx < MAX_NUM_CELL; actvCellIdx++)
{
- for(actvCellIdx = 0 ; actvCellIdx <duCb.numActvCells ; actvCellIdx++)
- {
- if(macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId)
- {
- duCb.duMacCellCfg = NULLP;
- /* Build and send GNB-DU config update */
- ret = BuildAndSendDUConfigUpdate();
-
- /* TODO: Trigger cell start req once cell up slot ind is received*/
- /* Build and Send Cell Start Req to MAC */
- ret = duBuildAndSendMacCellStartReq();
-
- }
- }
- }
- else
- {
- DU_LOG("\nMac cell cfg failed");
- ret = RFAILED;
- }
- return ret;
+ if(macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId)
+ {
+ duCb.actvCellLst[actvCellIdx]->duMacCellCfg = NULLP;
+ }
+ }
+ if(macCellCfgCfm->rsp == ROK)
+ {
+ /* Build and send GNB-DU config update */
+ ret = BuildAndSendDUConfigUpdate();
+
+ /* Build and Send Cell Start Req to MAC */
+ ret = duBuildAndSendMacCellStartReq();
+ }
+ else
+ {
+ /* TODO : Action to be taken if cell configuration fails.
+ * Should CU be informed? */
+
+ DU_LOG("\nMac cell cfg failed");
+ ret = RFAILED;
+ }
+ return ret;
}
/*******************************************************************