[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-447] PCCH Scheduling at SCH
[o-du/l2.git] / src / du_app / du_cell_mgr.c
index 926dc7c..bb1c8ea 100644 (file)
@@ -192,7 +192,7 @@ uint8_t duGetCellCb(uint16_t cellId, DuCellCb **cellCb)
 * 
 *  @params[in] DuCellCb *cellCb
 *
-*  @return void 
+*  @return ROK/RFAILURE (uint8_t return)
 * 
 * 
 ******************************************************************************/
@@ -225,9 +225,14 @@ uint8_t checkPagingRecord(DuCellCb *cellCb)
          }
          handlePageInfoLL(pf, pagInfo->i_s, &(pagInfoLLFromPF->pagInfoList), DELETE);
       }
+      if(pagInfoLLFromPF->pagInfoList.first == NULLP)
+      {
+         break;
+      }
    }while(pagInfo != NULLP);
    
    cmHashListDelete(&(cellCb->pagingInfoMap), (PTR)pagInfoLLFromPF);
+   DU_FREE(pagInfoLLFromPF, sizeof(DuPagInfoList));
    return ROK;
 }
 
@@ -257,7 +262,8 @@ uint8_t sendDlPcchIndToMac(MacPcchInd *pcchInd)
       /* Fill Pst */
       FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_DL_PCCH_IND);
       
-      DU_LOG("\nDEBUG   -->  DU_APP: Sending DL PCCH indication to MAC for cellId[%d]", pcchInd->cellId);
+      DU_LOG("\nDEBUG   -->  DU_APP: Sending DL PCCH indication to MAC for cellId[%d] at PF[%d]",\
+                         pcchInd->cellId, pcchInd->pf);
       ret = (*packMacDlPcchIndOpts[pst.selector])(&pst, pcchInd);
       if(ret == RFAILED)
       {
@@ -390,8 +396,9 @@ uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId)
 uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp)
 {
    uint8_t ret = ROK;
-   uint16_t cellIdx=0;
-   
+   uint16_t cellIdx=0, pfIdx=0;
+   DuPagInfoList *pagInfoLLFromPF=NULLP;
+
    if(deleteRsp)
    {
       if(deleteRsp->result == SUCCESSFUL_RSP)
@@ -400,6 +407,16 @@ uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp)
          DU_LOG("\nINFO   -->  DU APP : MAC CELL Delete Response : SUCCESS [CELL IDX : %d]", deleteRsp->cellId);
          if(duCb.actvCellLst[cellIdx] && (duCb.actvCellLst[cellIdx]->cellId == deleteRsp->cellId))
          {
+            for(pfIdx =0; pfIdx < MAX_SFN; pfIdx++)
+            {
+               pagInfoLLFromPF = findPagingInfoFromMap(pfIdx, &(duCb.actvCellLst[cellIdx]->pagingInfoMap));
+               if(pagInfoLLFromPF)
+               {   
+                  cmHashListDelete(&(duCb.actvCellLst[cellIdx]->pagingInfoMap), (PTR)pagInfoLLFromPF);
+                  DU_FREE(pagInfoLLFromPF, sizeof(DuPagInfoList));
+               }
+            }
+
             memset(duCb.actvCellLst[cellIdx], 0, sizeof(DuCellCb));
             gCellStatus = CELL_DOWN;
 
@@ -563,7 +580,7 @@ void freePcchPdu(PCCH_Message_t *pcchMsg)
          {
             if(pagingMsg->pagingRecordList)
             {
-               if(pagingMsg->pagingRecordList->list.array == NULLP)
+               if(pagingMsg->pagingRecordList->list.array != NULLP)
                {
                   for(recordIdx = 0; recordIdx <  pagingMsg->pagingRecordList->list.count; recordIdx++)
                   {
@@ -854,7 +871,7 @@ uint8_t insertPagingRecord(DuCellCb* cellCb, DuPagingMsg *rcvdF1apPagingParam, u
 #if 0
    printPageList(&(cellCb->pagingInfoMap));
 #endif
-   
+
    return ROK;