/* This file contains message handling functionality for DU APP */
#include "du_cell_mgr.h"
-#include "du_cfg.h"
extern DuCfgParams duCfgParam;
* ****************************************************************/
S16 procCellsToBeActivated(Cells_to_be_Activated_List_t cellsToActivate)
{
- U16 idx;
- S16 ret;
+ U16 idx = 0;
+ S16 ret = ROK;
for(idx=0; idx<cellsToActivate.list.count; idx++)
{
- U16 nci;
- U16 pci;
+ U16 nci = 0;
+ U16 pci = 0;
DuCellCb *cellCb = NULLP;
Cells_to_be_Activated_List_Item_t cell = cellsToActivate.list.array[idx]->\
value.choice.Cells_to_be_Activated_List_Item;
bitStringToInt(&cell.nRCGI.nRCellIdentity, &nci);
- if(cell.nRPCI)
+ if(nci <= 0 || nci > DU_MAX_CELLS)
{
- pci = *cell.nRPCI;
+ DU_LOG("\nDU APP : Invalid NCI %d", nci);
+ return RFAILED;
}
- if(ROK != (cmHashListFind(&(duCb.cellLst), (U8*) &nci, sizeof(nci),
- 0, (PTR*)cellCb)))
+
+ if(cell.nRPCI)
{
- return RFAILED;
+ pci = *cell.nRPCI;
}
+
+ cellCb = duCb.cfgCellLst[nci-1];
+
if(!cellCb)
{
- DU_LOG("\nDU_APP : HashList Find failed for nci [%d]", nci);
+ DU_LOG("\nDU APP : No Cell found for NCI %d", nci);
return RFAILED;
}
cellCb->cellStatus = ACTIVATION_IN_PROGRESS;
cellCb->cellInfo.nrPci = pci;
/* Now remove this cell from configured list and move to active list */
- ret = cmHashListDelete(&(duCb.actvCellLst), (PTR)(cellCb));
- if(ret != ROK)
- {
- DU_LOG("\nDU_APP : HashListInsert into ActvCellLst failed for [%d]", nci);
- }
- ret = cmHashListInsert(&(duCb.actvCellLst), (PTR)(cellCb),
- (U8 *)&(nci), (U16) sizeof(nci));
+ duCb.cfgCellLst[nci-1] = NULLP;
+ duCb.actvCellLst[nci-1] = cellCb;
+ /* Build and send Mac Cell Cfg for the number of active cells */
+ ret = duBuildAndSendMacCellCfg();
if(ret != ROK)
{
- DU_LOG("\nDU_APP : HashListInsert into ActvCellLst failed for [%d]", nci);
- break;
- }
- else
- {
- DU_LOG("\nDU_APP : HashListInsert into ActvCellLst successful for [%d]", nci);
+ DU_LOG("\nDU APP : macCellCfg build and send failed");
+ return RFAILED;
}
}
- /* Start sending scheduler config */
- if(ret == ROK)
- {
- //TODO: uncomment later duSendSchGnbCfg();
- }
-
- return ROK;
+ return ret;
}
/******************************************************************
SPutSBuf(DU_APP_MEM_REGION, DU_POOL,(Data *)&f1apMsg,(Size)sizeof(F1AP_PDU_t));
#endif
- /* Build and send Mac Cell Cfg Paramaters */
- //ret = duBuildAndSendMacCellCfg();
- ret = BuildAndSendDUConfigUpdate();
-
return ret;
}