cellCb->cellStatus = ACTIVATION_IN_PROGRESS;
cellCb->cellInfo.nrPci = nRPci;
- duCb.actvCellLst[duCb.numActvCells++] = cellCb;
+ duCb.actvCellLst[cellCb->cellId -1] = cellCb;
+ duCb.numActvCells++;
if(duBuildAndSendMacCellCfg(cellCb->cellId) != ROK)
{
DU_LOG("\nERROR --> DU APP : macCellCfg build and send failed");
/* Delete cell from actvCellList */
- duCb.actvCellLst[--(duCb.numActvCells)] = NULLP;
+ duCb.actvCellLst[cellCb->cellId -1] = NULLP;
+ --(duCb.numActvCells);
ret = RFAILED;
}
return ret;
uint8_t duGetCellCb(uint16_t cellId, DuCellCb **cellCb)
{
uint8_t cellIdx = 0;
- for(cellIdx=0; cellIdx<duCb.numActvCells; cellIdx++)
+
+ for(cellIdx=0; cellIdx < MAX_NUM_CELL; cellIdx++)
{
- if(duCb.actvCellLst[cellIdx]->cellId == cellId)
+ if(duCb.actvCellLst[cellIdx] && (duCb.actvCellLst[cellIdx]->cellId == cellId))
+ {
*cellCb = duCb.actvCellLst[cellIdx];
- break;
+ break;
+ }
}
if(!*cellCb)
return ROK;
}
+/*****************************************************************
+* @brief Handles slot indication from MAC
+*
+* @details
+*
+* Function : duHandleSlotInd
+*
+* Functionality:
+* Handles slot indication from MAC
+*
+* @params[in] Post structure pointer
+* SlotTimingInfo *slotIndInfo
+* @return ROK - success
+* RFAILED - failure
+*
+*
+*****************************************************************/
+uint8_t duHandleSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo)
+{
+ uint8_t cellIdx = 0, ret = ROK;
+ DuCellCb *duCellCb;
+
+ if(slotIndInfo)
+ {
+ GET_CELL_IDX(slotIndInfo->cellId, cellIdx);
+ duCellCb = duCb.actvCellLst[cellIdx];
+
+ if(duCellCb)
+ {
+ duCellCb->currSlotInfo.sfn = slotIndInfo->sfn;
+ duCellCb->currSlotInfo.slot = slotIndInfo->slot;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : CellId[%d] doesnot exist", slotIndInfo->cellId);
+ ret = RFAILED;
+ }
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool, slotIndInfo, sizeof(SlotTimingInfo));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : Recevied null pointer from MAC");
+ ret = RFAILED;
+ }
+ return(ret);
+}
/*******************************************************************
*
* @brief Handles cell up indication from MAC
{
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)
+ if(duCb.actvCellLst[cellIdx] && (duCb.actvCellLst[cellIdx]->cellId == deleteRsp->cellId))
{
memset(duCb.actvCellLst[cellIdx], 0, sizeof(DuCellCb));
gCellStatus = CELL_DOWN;