*******************************************************************************/
/* Utility definitions to be used in du app */
#include "common_def.h"
+#include "du_tmr.h"
#include "lrg.h"
#include "lrg.x"
#include "lkw.x"
#include "du_app_mac_inf.h"
-#include "du_utils.h"
#include "du_app_rlc_inf.h"
+#include "du_e2ap_mgr.h"
#include "du_cfg.h"
#include "du_mgr.h"
+#include "du_utils.h"
/* Spec Ref-38.214-Table 5.1.2.1-1 */
uint8_t slivCfgIdxTable[MAX_SLIV_CONFIG_IDX][3] = {
return ROK;
}
-/*Below function for printing will be used in future so disabling it for now*/
-#if 0
-/****************************************************************************
- *
- * @brief Print the LC in list for debugging purpose
+/*******************************************************************
+ * @brief Handle the PageUe List
*
* @details
*
- * Function : printLcLL
+ * Function : handlePageUeLL
+ *
+ * Functionality: Handling the (SEARCH,CREATE,DELETE) PageUeList
*
- * Functionality:
- * For debugging purpose, for printing the LC in the order and
- * parameters
+ * @params[in] DuPagingMsg *pagingParam, CmLListCp *pageUeLL, ActionTypeLL
+ * action
*
- * @params[in] LcList pointer
- *
- * @return void
- *
- *************************************************************************/
-void printPageInfoLL(CmLListCp *pageInfoLL)
+ * @return DuPagUeRecord
+ *
+ * ****************************************************************/
+DuPagUeRecord* handlePageUeLL(uint16_t pagUeId, uint64_t sTmsi, CmLListCp *pageUeLL, ActionTypeLL action)
{
- CmLList *node = NULLP;
- DuPagUeList *pageInfoNode = NULLP;
+ CmLList *node = NULLP;
+ DuPagUeRecord *ueRecord = NULLP;
+ bool found = FALSE;
- if(pageInfoLL == NULLP)
+ if((pageUeLL == NULLP) ||
+ ((pageUeLL->first == NULLP) && (action != CREATE)))
{
- DU_LOG("\nINFO --> DU APP: PageInfo List doesnt exist");
- return;
+ DU_LOG("\nERROR --> DU APP: UE Page Record LL is empty");
+ return NULLP;
}
- node = pageInfoLL->first;
+ node = pageUeLL->first;
+
while(node)
{
- pageInfoNode = (DuPagUeList *)node->node;
- if(pageInfoNode)
+ ueRecord = (DuPagUeRecord *)node->node;
+ if(action == PRINT)
{
- DU_LOG("\nINFO --> DU APP i_s:%d",pageInfoNode->i_s);
- printPageUeRecordLL(&(pageInfoNode->pagUeList));
+ DU_LOG("\n INFO --> DU APP ueId:%d, sTmsi:%lu",\
+ ueRecord->pagUeId, ueRecord->sTmsi);
+ }
+ else if(ueRecord && (ueRecord->pagUeId == pagUeId &&
+ ueRecord->sTmsi == sTmsi))
+ {
+ found = TRUE;
+ break;
}
-
node = node->next;
}
+
+ switch(action)
+ {
+ case SEARCH:
+ {
+ if(!found)
+ {
+ ueRecord = NULLP;
+ }
+ return ueRecord;
+ }
+
+ case CREATE:
+ {
+ if(node != NULLP)
+ return ueRecord;
+
+ /*Need to add a new node for this LC*/
+
+ /*List is empty; Initialize the LL ControlPointer*/
+ if(pageUeLL->count == 0)
+ {
+ cmLListInit(pageUeLL);
+ }
+
+ ueRecord = NULLP;
+ /*Allocate the List*/
+ DU_ALLOC(ueRecord, sizeof(DuPagUeRecord));
+ if(ueRecord)
+ {
+ ueRecord->pagUeId = pagUeId;
+ ueRecord->sTmsi = sTmsi;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : Allocation of UE Record failed,ueId:%d",pagUeId);
+ return NULLP;
+ }
+
+ if(duAddNodeToLList(pageUeLL, ueRecord, NULLP) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : failed to Add Ue Record Node,ueId:%d",pagUeId);
+ DU_FREE(ueRecord, sizeof(DuPagUeRecord));
+ return NULLP;
+ }
+ return ueRecord;
+ }
+ case DELETE:
+ {
+ if(!found || ueRecord == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: UeId:%d not found; thus Deletion unsuccessful",pagUeId);
+ }
+ else
+ {
+ if(duDelNodeFromLList(pageUeLL, node) == ROK)
+ DU_FREE(ueRecord, sizeof(DuPagUeRecord));
+ }
+ return NULLP;
+ }
+ case PRINT:
+ case TRAVERSE_ALL:
+ {
+ break;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> DU APP: Incorrect ActionType:%d on UeRecord",action);
+ }
+ }
+ return NULLP;
}
-/****************************************************************************
- *
- * @brief Print the Ue Record against Paging Frame for debugging purpose
+/*******************************************************************
+ * @brief Handle the PageInfo List
*
* @details
*
- * Function : printLcLL
+ * Function : handlePageInfoLL
*
- * Functionality:
- * For debugging purpose, for printing the UE Record in the order and
- * parameters
+ * Functionality: Handling the (SEARCH,CREATE,DELETE) PageInfoList
*
- * @params[in] ueList pointer
- *
- * @return void
- *
- *************************************************************************/
-void printPageUeRecordLL(CmLListCp *ueList)
+ * @params[in] uint8_t i_s, CmLListCp *pagInfoLL, ActionTypeLL action
+ *
+ * @return DuPagUeList
+ *
+ * ****************************************************************/
+DuPagUeList* handlePageInfoLL(uint16_t pf, uint8_t i_s, CmLListCp *pagInfoLL, ActionTypeLL action)
{
- CmLList *node = NULLP;
- DuPagUeRecord *ueRecord = NULLP;
-
- if(ueList == NULLP)
+ CmLList *node = NULLP, *next = NULLP;
+ DuPagUeList *pagInfo = NULLP;
+ bool found = FALSE;
+
+ if((pagInfoLL == NULLP) ||
+ ((pagInfoLL->first == NULLP) && (action != CREATE)))
{
- DU_LOG("\nINFO --> DU APP: PageUe List doesnt exist");
- return;
+ DU_LOG("\nERROR --> DU APP: PagInfo LL is empty");
+ return NULLP;
}
- node = ueList->first;
+ node = pagInfoLL->first;
+
while(node)
{
- ueRecord = (DuPagUeRecord *)node->node;
- if(ueRecord)
+ next = node->next;
+ pagInfo = (DuPagUeList *)node->node;
+ if(action == PRINT)
+ {
+ DU_LOG("\n INFO --> DU APP: Paging Index (i_s):%d",pagInfo->i_s);
+ handlePageUeLL(NULLD, NULLD, &(pagInfo->pagUeList), PRINT);
+ }
+ else if(action == TRAVERSE_ALL)
{
- DU_LOG("\nINFO --> DU APP ueId:%d, sTmsi:%lu, prio:%d",ueRecord->pagUeId, ueRecord->sTmsi, ueRecord->pagPriority);
+ return pagInfo;
}
+ else if(pagInfo->i_s == i_s)
+ {
+ found = TRUE;
+ break;
+ }
+ node = next;
+ }
- node = node->next;
+ switch(action)
+ {
+ case SEARCH:
+ {
+ if(!found)
+ {
+ pagInfo = NULLP;
+ }
+ return pagInfo;
+ }
+
+ case CREATE:
+ {
+ if(node != NULLP)
+ return pagInfo;
+
+ /*Need to add a new node for this LC*/
+
+ /*List is empty; Initialize the LL ControlPointer*/
+ if(pagInfoLL->count == 0)
+ {
+ cmLListInit(pagInfoLL);
+ }
+
+ pagInfo = NULLP;
+ /*Allocate the List*/
+ DU_ALLOC(pagInfo, sizeof(DuPagUeList));
+ if(pagInfo)
+ {
+ pagInfo->i_s = i_s;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : Allocation of List failed,i_s:%d",i_s);
+ return NULLP;
+ }
+
+ if(duAddNodeToLList(pagInfoLL, pagInfo, NULLP) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : failed to Add Node,i_s:%d",i_s);
+ DU_FREE(pagInfo, sizeof(DuPagUeList));
+ return NULLP;
+ }
+ return pagInfo;
+ }
+ case DELETE:
+ {
+ if(!found || pagInfo == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: i_s:%d not found; thus Deletion unsuccessful",i_s);
+ }
+ else
+ {
+ if(duDelNodeFromLList(pagInfoLL, node) == ROK)
+ DU_FREE(pagInfo, sizeof(DuPagUeList));
+ }
+ return NULLP;
+ }
+ case PRINT:
+ case TRAVERSE_ALL:
+ {
+ break;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> DU APP: Incorrect ActionType:%d on PageInfo List",action);
+ }
}
+ return NULLP;
+}
+
+/*******************************************************************
+ * @brief Find the PageInfo List from HashMap
+ *
+ * @details
+ *
+ * Function : findPagingInfoFromMap
+ *
+ * Functionality: Search for the PageInfoList for a PF from HashMap
+ *
+ * @params[in] uint16_t pf, CmHashListCp *pagingInfoMap
+ *
+ * @return DuPagInfoList
+ *
+ * ****************************************************************/
+DuPagInfoList* findPagingInfoFromMap(uint16_t pf, CmHashListCp *pagingInfoMap)
+{
+ DuPagInfoList *pagInfoLL = NULLP;
+ cmHashListFind(pagingInfoMap, (uint8_t *)&(pf), sizeof(uint16_t), 0, (PTR *)&pagInfoLL);
+
+ return pagInfoLL;
}
+/*Below function for printing will be used in future so disabling it for now*/
+#if 0
/*******************************************************************
* @brief Print the Page Info List and UE Records
*
ret = cmHashListGetNext(pagingInfoMap, (PTR)prevPageInfoLL, (PTR *)&pagInfoLLFromPF);
if(ret == ROK)
{
- DU_LOG("\nDEBUG --> DUAPP Page List for PF:%d",pagInfoLLFromPF->pf);
- printPageInfoLL(&(pagInfoLLFromPF->pagInfoList));
+ DU_LOG("\nDEBUG --> DUAPP: Page List for PF:%d",pagInfoLLFromPF->pf);
+ handlePageInfoLL(NULLD, NULLD, &(pagInfoLLFromPF->pagInfoList), PRINT);
prevPageInfoLL = pagInfoLLFromPF;
}
}while(ret == ROK);
}
#endif
+
/**********************************************************************
End of file
**********************************************************************/