/*******************************************************************************
################################################################################
-# Copyright (c) [2017-2019] [Radisys] #
+# Copyright (c) [2020] [Radisys] #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
################################################################################
-*******************************************************************************/
-
-/* This file contains all utility functions */
-#if 0
-#include<stdbool.h>
-#include<netinet/in.h>
-#include<arpa/inet.h>
-#include<string.h>
-#include<stdlib.h>
-#endif
+ *******************************************************************************/
+/* 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_app_rlc_inf.h"
+#include "du_e2ap_mgr.h"
+#include "du_cfg.h"
#include "du_mgr.h"
-
-#define DU_INST 0
-#define DU_ID 1
-#define DU_IP_V4_ADDR "10.0.2.20"
-#define CU_IP_V4_ADDR "10.0.2.25"
-#define DU_IP_V6_ADDR "0000:0000:0000:0000:0000:0000:0000:0001"
-#define DU_PORT 38472
-#define CU_PORT 38472
-#define NR_PCI 1
-#define NR_CELL_ID 1
-#define DU_NAME "ORAN_OAM_DU"
-#define CELL_DIR UL_DL
-#define CELL_TYPE SMALL
-#define DUPLEX_MODE DUP_MODE_TDD
-#define DU_TAC 1
-#define PLMN_MCC0 3
-#define PLMN_MCC1 1
-#define PLMN_MCC2 1
-#define PLMN_MNC0 4
-#define PLMN_MNC1 8
-#define PLMN_MNC2 0
-#define NR_ARFCN 2079427
-#define SUL_ARFCN 100
-#define NR_FREQ_BAND 257
-#define SUL_BAND 2
-#define TIME_CFG 10
-#define NR_RANAC 150
-#define CARRIER_IDX 1
-#define NUM_TX_ANT 2
-#define NUM_RX_ANT 2
-#define FREQ_SHIFT_7P5KHZ FALSE
-#define SSB_PBCH_PWR 0
-#define BCH_PAYLOAD MAC_GEN_FULL_PBCH_PAYLD
-#define SUBCARRIER_SPACING 3
-#define PRB_OFFSET 0
-#define BETA_PSS BETA_PSS_0DB
-#define SSB_PERIODICITTY SSB_PRDCTY_MS_20
-#define SSB_SUBCARRIER_OFFSET 0
-#define SSB_MULT_CARRIER_BAND FALSE
-#define MULT_CELL_CARRIER FALSE
-
-#define PRACH_SEQ_LEN SHORT_SEQUENCE
-#define PRACH_SUBCARRIER_SPACING 3
-#define PRACH_RESTRICTED_SET_CFG UNRESTRICTED
-#define NUM_PRACH_FDM 1
-#define ROOT_SEQ_IDX 0
-#define NUM_ROOT_SEQ 1
-#define ZERO_CORRELATION_ZONE_CFG 2
-#define NUM_UNUSED_ROOT_SEQ 1
-#define UNUSED_ROOT_SEQ 1
-#define SSB_PER_RACH 3
-#define PRACH_MULT_CARRIER_BAND FALSE
-#define TDD_PERIODICITY TX_PRDCTY_MS_2P5
-#define RSS_MEASUREMENT_UNIT DONT_REPORT_RSSI
-
-/* Filling Slot configuration as :
- * Slot Sym 0 Sym 1 Sym 2 Sym 3 Sym 4 Sym 5 Sym 6 Sym 7 Sym 8 Sym 9 Sym10 Sym11 Sym12 Sym13
- * 0 DL DL DL DL DL DL DL DL DL DL DL DL DL DL
- * 1 DL DL DL DL DL DL DL DL DL DL DL DL DL DL
- * 2 DL DL DL DL DL DL DL DL DL DL DL DL DL DL
- * 3 DL DL DL DL DL DL DL DL DL DL GD GD GD UL
- * 4 UL UL UL UL UL UL UL UL UL UL UL UL UL UL
-*/
+#include "du_utils.h"
+
+/* Spec Ref-38.214-Table 5.1.2.1-1 */
+uint8_t slivCfgIdxTable[MAX_SLIV_CONFIG_IDX][3] = {
+/*S L SLIV*/
+{ 0, 1, 0 },/* index0 */
+{ 0, 2, 14 },/* index1 */
+{ 0, 3, 28 },/* index2 */
+{ 0, 4, 42 },/* index3 */
+{ 0, 5, 56 },/* index4 */
+{ 0, 6, 70 },/* index5 */
+{ 0, 7, 84 },/* index6 */
+{ 0, 8, 98 },/* index7 */
+{ 0, 9, 97 },/* index8 */
+{ 0, 10, 83 },/* index9 */
+{ 0, 11, 69 },/* index10 */
+{ 0, 12, 55 },/* index11 */
+{ 0, 13, 41 },/* index12 */
+{ 0, 14, 27 },/* index13 */
+{ 1, 1, 1 },/* index14 */
+{ 1, 2, 15 },/* index15 */
+{ 1, 3, 29 },/* index16 */
+{ 1, 4, 43 },/* index17 */
+{ 1, 5, 57 },/* index18 */
+{ 1, 6, 71 },/* index19 */
+{ 1, 7, 85 },/* index20 */
+{ 1, 8, 99 },/* index21 */
+{ 1, 9, 96 },/* index22 */
+{ 1, 10, 82 },/* index23 */
+{ 1, 11, 68 },/* index24 */
+{ 1, 12, 54 },/* index25 */
+{ 1, 13, 40 },/* index26 */
+{ 2, 1, 2 },/* index27 */
+{ 2, 2, 16 },/* index28 */
+{ 2, 3, 30 },/* index29 */
+{ 2, 4, 44 },/* index30 */
+{ 2, 5, 58 },/* index31 */
+{ 2, 6, 72 },/* index32 */
+{ 2, 7, 86 },/* index33 */
+{ 2, 8, 100},/* index34 */
+{ 2, 9, 95 },/* index35 */
+{ 2, 10, 81 },/* index36 */
+{ 2, 11, 67 },/* index37 */
+{ 2, 12, 53 },/* index38 */
+{ 3, 1, 3 },/* index39 */
+{ 3, 2, 17 },/* index40 */
+{ 3, 3, 31 },/* index41 */
+{ 3, 4, 45 },/* index42 */
+{ 3, 5, 59 },/* index43 */
+{ 3, 6, 73 },/* index44 */
+{ 3, 7, 87 },/* index45 */
+{ 3, 8, 101},/* index46 */
+{ 3, 9, 94 },/* index47 */
+{ 3, 10, 80 },/* index48 */
+{ 3, 11, 66 },/* index49 */
+{ 4, 1, 4 },/* index50 */
+{ 4, 2, 18 },/* index51 */
+{ 4, 3, 32 },/* index52 */
+{ 4, 4, 46 },/* index53 */
+{ 4, 5, 60 },/* index54 */
+{ 4, 6, 74 },/* index55 */
+{ 4, 7, 88 },/* index56 */
+{ 4, 8, 102},/* index57 */
+{ 4, 9, 93 },/* index58 */
+{ 4, 10, 79 },/* index59 */
+{ 5, 1, 5 },/* index60 */
+{ 5, 2, 19 },/* index61 */
+{ 5, 3, 33 },/* index62 */
+{ 5, 4, 47 },/* index63 */
+{ 5, 5, 61 },/* index64 */
+{ 5, 6, 75 },/* index65 */
+{ 5, 7, 89 },/* index66 */
+{ 5, 8, 103},/* index67 */
+{ 5, 9, 92 },/* index68 */
+{ 6, 1, 6 },/* index69 */
+{ 6, 2, 20 },/* index70 */
+{ 6, 3, 34 },/* index71 */
+{ 6, 4, 48 },/* index72 */
+{ 6, 5, 62 },/* index73 */
+{ 6, 6, 76 },/* index74 */
+{ 6, 7, 90 },/* index75 */
+{ 6, 8, 104},/* index76 */
+{ 7, 1, 7 },/* index77 */
+{ 7, 2, 21 },/* index78 */
+{ 7, 3, 35 },/* index79 */
+{ 7, 4, 49 },/* index80 */
+{ 7, 5, 63 },/* index81 */
+{ 7, 6, 77 },/* index82 */
+{ 7, 7, 91 },/* index83 */
+{ 8, 1, 8 },/* index84 */
+{ 8, 2, 22 },/* index85 */
+{ 8, 3, 36 },/* index86 */
+{ 8, 4, 50 },/* index87 */
+{ 8, 5, 64 },/* index88 */
+{ 8, 6, 78 },/* index89 */
+{ 9, 1, 9 },/* index90 */
+{ 9, 2, 23 },/* index91 */
+{ 9, 3, 37 },/* index92 */
+{ 9, 4, 51 },/* index93 */
+{ 9, 5, 65 },/* index94 */
+{ 10, 1, 10 },/* index95 */
+{ 10, 2, 24 },/* index96 */
+{ 10, 3, 38 },/* index97 */
+{ 10, 4, 52 },/* index98 */
+{ 11, 1, 11 },/* index99 */
+{ 11, 2, 25 },/* index100*/
+{ 11, 3, 39 },/* index101*/
+{ 12, 1, 12 },/* index102*/
+{ 12, 2, 26 },/* index103*/
+{ 13, 1, 13 } /* index104*/
+};
/*******************************************************************
*
- * @brief Fills the Slot configuration
+ * @brief Function to fill the start Symbol and Symbol Len from the
+ * sliv Config Idx Table
*
* @details
*
- * Function : fillSlotConfig
+ * Function : fillStartSymbolAndLen
*
- * Functionality:Fill the Slot configuration values
- *
- * @params[in] void
- * @return ROK - success
- * RFAILED - failure
+ * Functionality: Function to fill the start Symbol and Symbol Len
+ * from the sliv Config Idx Table
+ *
+ * @params[in] startSymbolIdx pointer,
+ * symbolLen pointer,
+ * sliv
+ * @return void
*
* ****************************************************************/
-void fillSlotConfig()
+void fillStartSymbolAndLen(uint8_t numRsrcAlloc, PdschConfig *pdschCfg, PuschCfg *puschCfg)
{
- U8 slot;
- U8 symbol;
+ uint8_t slivIdx, timeDomIdx;
- for(slot = 0; slot <= 3; slot++)
+ for(timeDomIdx = 0; timeDomIdx < numRsrcAlloc; timeDomIdx++)
{
- for(symbol = 0; symbol < MAX_SYMB_PER_SLOT; symbol++)
- duCfgParam.clCellCfg.tddCfg.slotCfg[slot][symbol] = DL_SLOT;
+ for(slivIdx = 0; slivIdx < MAX_SLIV_CONFIG_IDX; slivIdx++)
+ {
+ if(pdschCfg)/* PDSCH Config */
+ {
+ if(pdschCfg->timeDomRsrcAllociList[timeDomIdx].startSymbolAndLength ==\
+ slivCfgIdxTable[slivIdx][2])
+ {
+ pdschCfg->timeDomRsrcAllociList[timeDomIdx].startSymbol = slivCfgIdxTable[slivIdx][0];
+ pdschCfg->timeDomRsrcAllociList[timeDomIdx].symbolLength = slivCfgIdxTable[slivIdx][1];
+ break;
+ }
+ }
+ if(puschCfg)/* PUSCH Config */
+ {
+ if(puschCfg->timeDomRsrcAllocList[timeDomIdx].startSymbolAndLength ==\
+ slivCfgIdxTable[slivIdx][2])
+ {
+ puschCfg->timeDomRsrcAllocList[timeDomIdx].startSymbol = slivCfgIdxTable[slivIdx][0];
+ puschCfg->timeDomRsrcAllocList[timeDomIdx].symbolLength = slivCfgIdxTable[slivIdx][1];
+ break;
+ }
+
+ }
+ }
}
+}
- duCfgParam.clCellCfg.tddCfg.slotCfg[3][10] = GUARD_SLOT;
- duCfgParam.clCellCfg.tddCfg.slotCfg[3][11] = GUARD_SLOT;
- duCfgParam.clCellCfg.tddCfg.slotCfg[3][12] = GUARD_SLOT;
- duCfgParam.clCellCfg.tddCfg.slotCfg[3][13] = UL_SLOT;
-
- for(symbol = 0; symbol < MAX_SYMB_PER_SLOT; symbol++)
- duCfgParam.clCellCfg.tddCfg.slotCfg[4][symbol] = UL_SLOT;
+/*******************************************************************
+ * @brief Function to add a node to a linked list
+ *
+ * @details
+ *
+ * Function: duAddNodeToLList
+ *
+ * This function adds a new node to the linked list
+ *
+ * @param[in] Pointer to the list
+ * Pointer to node to be added
+ * Pointer to current node
+ * @return ROK
+ * RFAILED
+*******************************************************************/
+uint8_t duAddNodeToLList(CmLListCp *llist, void *blockToAdd, CmLList *currNode)
+{
+ CmLList *newNode = NULLP;
+ DU_ALLOC(newNode, sizeof(CmLList));
+ if(newNode)
+ {
+ newNode->node = (PTR)blockToAdd;
+
+ if(currNode == NULLP)
+ cmLListAdd2Tail(llist, newNode);
+ else
+ {
+ llist->crnt = currNode;
+ cmLListInsAfterCrnt(llist, newNode);
+ }
+ return ROK;
+ }
+ return RFAILED;
}
/*******************************************************************
+ * @brief Function to delete a node from linked list
+ *
+ * @details
+ *
+ * Function: duDelNodeFromLList
*
- * @brief Reads the CL Configuration.
+ * This function deletes a node from the linked list
+ *
+ * @param[in] Pointer to the list
+ * Pointer to node to be deleted
+ * @return Pointer to the deleted node
+*******************************************************************/
+
+uint8_t duDelNodeFromLList(CmLListCp *llist, CmLList *node)
+{
+ node = cmLListDelFrm(llist, node);
+ DU_FREE(node, sizeof(CmLList));
+
+ return ROK;
+}
+
+/*******************************************************************
+ * @brief Handle the PageUe List
*
* @details
*
- * Function : readClCfg
+ * Function : handlePageUeLL
*
- * Functionality:
- * - Fills up the cell configuration for CL.
- * - Calls fillSlotConfig()
+ * Functionality: Handling the (SEARCH,CREATE,DELETE) PageUeList
*
- * @params[in] void
- * @return ROK - success
- * RFAILED - failure
+ * @params[in] DuPagingMsg *pagingParam, CmLListCp *pageUeLL, ActionTypeLL
+ * action
+ *
+ * @return DuPagUeRecord
*
* ****************************************************************/
-
-
-/* This function is used to fill up the cell configuration for CL */
-S16 readClCfg()
+DuPagUeRecord* handlePageUeLL(uint16_t pagUeId, uint64_t sTmsi, CmLListCp *pageUeLL, ActionTypeLL action)
{
- duCfgParam.clCellCfg.carrierId = CARRIER_IDX;
-
- /* Cell configuration */
- duCfgParam.clCellCfg.cellId = NR_CELL_ID;
- duCfgParam.clCellCfg.phyCellId = NR_PCI;
- duCfgParam.clCellCfg.dupType = DUPLEX_MODE;
-
- /* DL carrier configuration */
- duCfgParam.clCellCfg.dlCarrCfg.pres = TRUE;
- duCfgParam.clCellCfg.dlCarrCfg.bw = SUL_ARFCN;
- duCfgParam.clCellCfg.dlCarrCfg.freq = NR_ARFCN;
- duCfgParam.clCellCfg.dlCarrCfg.k0[0] = 1;
- duCfgParam.clCellCfg.dlCarrCfg.k0[1] = 1;
- duCfgParam.clCellCfg.dlCarrCfg.k0[2] = 1;
- duCfgParam.clCellCfg.dlCarrCfg.k0[3] = 1;
- duCfgParam.clCellCfg.dlCarrCfg.k0[4] = 1;
- duCfgParam.clCellCfg.dlCarrCfg.gridSize[0] = 1;
- duCfgParam.clCellCfg.dlCarrCfg.gridSize[1] = 1;
- duCfgParam.clCellCfg.dlCarrCfg.gridSize[2] = 1;
- duCfgParam.clCellCfg.dlCarrCfg.gridSize[3] = 1;
- duCfgParam.clCellCfg.dlCarrCfg.gridSize[4] = 1;
- duCfgParam.clCellCfg.dlCarrCfg.numAnt = NUM_TX_ANT;
-
- /* UL Carrier configuration */
- duCfgParam.clCellCfg.ulCarrCfg.pres = TRUE;
- duCfgParam.clCellCfg.ulCarrCfg.bw = SUL_ARFCN;
- duCfgParam.clCellCfg.ulCarrCfg.freq = NR_ARFCN;
- duCfgParam.clCellCfg.ulCarrCfg.k0[0] = 1;
- duCfgParam.clCellCfg.ulCarrCfg.k0[1] = 1;
- duCfgParam.clCellCfg.ulCarrCfg.k0[2] = 1;
- duCfgParam.clCellCfg.ulCarrCfg.k0[3] = 1;
- duCfgParam.clCellCfg.ulCarrCfg.k0[4] = 1;
- duCfgParam.clCellCfg.ulCarrCfg.gridSize[0] = 1;
- duCfgParam.clCellCfg.ulCarrCfg.gridSize[1] = 1;
- duCfgParam.clCellCfg.ulCarrCfg.gridSize[2] = 1;
- duCfgParam.clCellCfg.ulCarrCfg.gridSize[3] = 1;
- duCfgParam.clCellCfg.ulCarrCfg.gridSize[4] = 1;
- duCfgParam.clCellCfg.ulCarrCfg.numAnt = NUM_RX_ANT;
-
- duCfgParam.clCellCfg.freqShft = FREQ_SHIFT_7P5KHZ;
-
- /* SSB configuration */
- duCfgParam.clCellCfg.ssbCfg.ssbPbchPwr = SSB_PBCH_PWR;
- duCfgParam.clCellCfg.ssbCfg.bchPayload = BCH_PAYLOAD;
- duCfgParam.clCellCfg.ssbCfg.scsCmn = SUBCARRIER_SPACING;
- duCfgParam.clCellCfg.ssbCfg.ssbPrbOffset = PRB_OFFSET;
- duCfgParam.clCellCfg.ssbCfg.betaPss = BETA_PSS;
- duCfgParam.clCellCfg.ssbCfg.ssbPeriod = SSB_PERIODICITTY;
- duCfgParam.clCellCfg.ssbCfg.ssbSubcOffset = SSB_SUBCARRIER_OFFSET;
- duCfgParam.clCellCfg.ssbCfg.mibPdu = 104;
- duCfgParam.clCellCfg.ssbCfg.nSSBMask[0] = 2162721;
- duCfgParam.clCellCfg.ssbCfg.nSSBMask[1] = 0;
- duCfgParam.clCellCfg.ssbCfg.multCarrBand = SSB_MULT_CARRIER_BAND;
- duCfgParam.clCellCfg.ssbCfg.multCellCarr = MULT_CELL_CARRIER;
-
- /* PRACH configuration */
- duCfgParam.clCellCfg.prachCfg.pres = TRUE;
- duCfgParam.clCellCfg.prachCfg.prachSeqLen = PRACH_SEQ_LEN;
- duCfgParam.clCellCfg.prachCfg.prachSubcSpacing = PRACH_SUBCARRIER_SPACING;
- duCfgParam.clCellCfg.prachCfg.prachRstSetCfg = PRACH_RESTRICTED_SET_CFG;
- duCfgParam.clCellCfg.prachCfg.prachFdm = NUM_PRACH_FDM;
- duCfgParam.clCellCfg.prachCfg.fdm[0].rootSeqIdx = ROOT_SEQ_IDX;
- duCfgParam.clCellCfg.prachCfg.fdm[0].numRootSeq = NUM_ROOT_SEQ;
- duCfgParam.clCellCfg.prachCfg.fdm[0].k1 = 1;
- duCfgParam.clCellCfg.prachCfg.fdm[0].zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
- duCfgParam.clCellCfg.prachCfg.fdm[0].numUnusedRootSeq = NUM_UNUSED_ROOT_SEQ;
- if(SGetSBuf(DU_APP_MEM_REGION, DU_POOL, (Data **)&(duCfgParam.clCellCfg.prachCfg.fdm[0].unsuedRootSeq), NUM_UNUSED_ROOT_SEQ * sizeof(U8)))
+ CmLList *node = NULLP;
+ DuPagUeRecord *ueRecord = NULLP;
+ bool found = FALSE;
+
+ if((pageUeLL == NULLP) ||
+ ((pageUeLL->first == NULLP) && (action != CREATE)))
{
- printf("\nMemory allocation failed");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> DU APP: UE Page Record LL is empty");
+ return NULLP;
}
- *(duCfgParam.clCellCfg.prachCfg.fdm[0].unsuedRootSeq) = UNUSED_ROOT_SEQ;
- duCfgParam.clCellCfg.prachCfg.ssbPerRach = SSB_PER_RACH;
- duCfgParam.clCellCfg.prachCfg.prachMultCarrBand = PRACH_MULT_CARRIER_BAND;
-
- /* TDD configuration */
- duCfgParam.clCellCfg.tddCfg.pres = TRUE;
- duCfgParam.clCellCfg.tddCfg.tddPeriod = TDD_PERIODICITY;
+ node = pageUeLL->first;
- fillSlotConfig();
-
- /* RSSI Measurement configuration */
- duCfgParam.clCellCfg.rssiUnit = RSS_MEASUREMENT_UNIT;
+ while(node)
+ {
+ ueRecord = (DuPagUeRecord *)node->node;
+ if(action == PRINT)
+ {
+ 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;
+ }
- /* This should be calculated based on
- (number of mandatory parameters) + (number of otional parameters being filled) */
- duCfgParam.clCellCfg.numTlv = 39;
+ switch(action)
+ {
+ case SEARCH:
+ {
+ if(!found)
+ {
+ ueRecord = NULLP;
+ }
+ return ueRecord;
+ }
- RETVALUE(ROK);
+ 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 Configures the DU Parameters
+ * @brief Handle the PageInfo List
*
* @details
*
- * Function : readCfg
+ * Function : handlePageInfoLL
+ *
+ * Functionality: Handling the (SEARCH,CREATE,DELETE) PageInfoList
*
- * Functionality:
- * - Initializes the DuCfg members.
- * - Calls readClCfg()
+ * @params[in] uint8_t i_s, CmLListCp *pagInfoLL, ActionTypeLL action
*
- * @params[in] system task ID
- * @return ROK - success
- * RFAILED - failure
+ * @return DuPagUeList
*
* ****************************************************************/
-
-S16 readCfg()
+DuPagUeList* handlePageInfoLL(uint16_t pf, uint8_t i_s, CmLListCp *pagInfoLL, ActionTypeLL action)
{
- U8 i,j,k;
- U32 ipv4_du, ipv4_cu;
-
- cmInetAddr((S8*)DU_IP_V4_ADDR, &ipv4_du);
- cmInetAddr((S8*)CU_IP_V4_ADDR, &ipv4_cu);
- //U32 ipv6_int = inet_addr(DU_IP_V6_ADDR);
-
- /* F1 DU IP Address and Port*/
- duCfgParam.sctpParams.duIpAddr.ipV4Pres = TRUE;
- duCfgParam.sctpParams.duIpAddr.ipV4Addr = ipv4_du;
- duCfgParam.sctpParams.duIpAddr.ipV6Pres = FALSE;
- //strcpy(duCfgParam.sctpParams.duIpAddr.ipV6Addr, (char*)DU_IP_V6_ADDR);
- duCfgParam.sctpParams.duPort = DU_PORT;
-
- /* F1 CU IP Address and Port*/
- duCfgParam.sctpParams.cuIpAddr.ipV4Pres = TRUE;
- duCfgParam.sctpParams.cuIpAddr.ipV4Addr = ipv4_cu;
- duCfgParam.sctpParams.cuIpAddr.ipV6Pres = FALSE;
- //strcpy(duCfgParam.sctpParams.cuIpAddr.ipV6Addr, DU_IP_V6_ADDR);
- duCfgParam.sctpParams.cuPort = CU_PORT;
-
- duCfgParam.maxUe = 32; //TODO: Check
- /* DU Info */
- duCfgParam.duId = DU_ID;
- strcpy((char*)duCfgParam.duName,DU_NAME);
-
- for(i=0;i<MAXCELLINGNBDU;i++)
- {
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mcc[0] = PLMN_MCC0;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mcc[1] = PLMN_MCC1;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mcc[2] = PLMN_MCC2;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mnc[0] = PLMN_MNC0;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mnc[1] = PLMN_MNC1;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mnc[2] = PLMN_MNC2;
-
- /*Cell ID */
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.cellId = NR_CELL_ID;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrPci = NR_PCI;
-
- /* List of Available PLMN */
- for(j=0;j<MAXNUMOFBPLMN;j++)
+ CmLList *node = NULLP, *next = NULLP;
+ DuPagUeList *pagInfo = NULLP;
+ bool found = FALSE;
+
+ if((pagInfoLL == NULLP) ||
+ ((pagInfoLL->first == NULLP) && (action != CREATE)))
+ {
+ DU_LOG("\nERROR --> DU APP: PagInfo LL is empty");
+ return NULLP;
+ }
+ node = pagInfoLL->first;
+
+ while(node)
+ {
+ next = node->next;
+ pagInfo = (DuPagUeList *)node->node;
+ if(action == PRINT)
{
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mcc[0] = PLMN_MCC0;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mcc[1] = PLMN_MCC1;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mcc[2] = PLMN_MCC2;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mnc[0] = PLMN_MNC0;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mnc[1] = PLMN_MNC1;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mnc[2] = PLMN_MNC2;
+ DU_LOG("\n INFO --> DU APP: Paging Index (i_s):%d",pagInfo->i_s);
+ handlePageUeLL(NULLD, NULLD, &(pagInfo->pagUeList), PRINT);
}
- /* List of Extended PLMN */
- for(j=0;j<MAXNUMOFBPLMN;j++)
+ else if(action == TRAVERSE_ALL)
{
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mcc[0] = PLMN_MCC0;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mcc[1] = PLMN_MCC1;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mcc[2] = PLMN_MCC2;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mnc[0] = PLMN_MNC0;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mnc[1] = PLMN_MNC1;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mnc[2] = PLMN_MNC2;
- }
-
- /* TAC and EPSTAC */
- duCfgParam.srvdCellLst[i].duCellInfo.tac.pres = TRUE;
- duCfgParam.srvdCellLst[i].duCellInfo.tac.tac = DU_TAC;
- duCfgParam.srvdCellLst[i].duCellInfo.epsTac.pres = TRUE; //to check and fill.
- duCfgParam.srvdCellLst[i].duCellInfo.epsTac.tac =DU_TAC; //to check and fill
-
- /* NR Mode info */
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_ARFCN;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.pres = TRUE;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb = NRB_160;
-
- for(j=0;j<MAXNRCELLBANDS;j++)
+ return pagInfo;
+ }
+ else if(pagInfo->i_s == i_s)
{
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[j].nrFreqBand = NR_FREQ_BAND;
- for(k=0;k<MAXNRCELLBANDS;k++)
- {
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[j].sulBand[k] = SUL_BAND;
- }
+ found = TRUE;
+ break;
}
+ node = next;
+ }
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrTxBw.nrScs = SCS_15;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrTxBw.nrb = NRB_160;
-
- /*Measurement Config and Cell Config */
- duCfgParam.srvdCellLst[i].duCellInfo.measTimeCfg = TIME_CFG;
-
- duCfgParam.srvdCellLst[i].duCellInfo.cellDir = CELL_DIR;
-
- duCfgParam.srvdCellLst[i].duCellInfo.cellType=CELL_TYPE;
+ switch(action)
+ {
+ case SEARCH:
+ {
+ if(!found)
+ {
+ pagInfo = NULLP;
+ }
+ return pagInfo;
+ }
- /* Broadcast PLMN Identity */
- for(j=0;j<MAXBPLMNNRMINUS1;j++)
- {
- for(k=0;k<MAXNUMOFBPLMN;k++)
+ case CREATE:
{
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mcc[0] = PLMN_MCC0;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mcc[1] = PLMN_MCC1;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mcc[2] = PLMN_MCC2;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mnc[0] = PLMN_MNC0;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mnc[1] = PLMN_MNC1;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mnc[2] = PLMN_MNC2;
+ 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;
}
- /* Extended PLMN List */
- for(k=0;k<MAXNUMOFBPLMN;k++)
+ case DELETE:
{
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mcc[0] = PLMN_MCC0;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mcc[1] = PLMN_MCC1;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mcc[2] = PLMN_MCC2;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mnc[0] = PLMN_MNC0;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mnc[1] = PLMN_MNC1;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mnc[2] = PLMN_MNC2;
+ 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);
}
-
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].tac.pres = TRUE;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].tac.tac = DU_TAC;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].nrCellId = NR_CELL_ID;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].ranac = NR_RANAC;
- }
-
- /*gnb DU System Info */
- //TODO: uncomment duCfgParam.srvdCellLst[i].duSysInfo.mibMsg; //to do
- //TODO: uncomment duCfgParam.srvdCellLst[i].duSysInfo.sib1Msg; //to do
- }
-
- /* RRC Version,Extended RRC Version */
- //TODO: uncomment duCfgParam.rrcVersion.rrcVer; //to do
- //TODO: uncomment duCfgParam.rrcVersion.extRrcVer; //to do
-
- if(readClCfg() != ROK)
- {
- printf("\nFailed while reading CL config");
- RETVALUE(RFAILED);
}
-
- RETVALUE(ROK);
+ return NULLP;
}
/*******************************************************************
- *
- * @brief Reads config and posts message to du_app on completion
+ * @brief Find the PageInfo List from HashMap
*
* @details
*
- * Function : main
+ * Function : findPagingInfoFromMap
+ *
+ * Functionality: Search for the PageInfoList for a PF from HashMap
*
- * Functionality:
- * - Calls readCfg()
- * - Post to du_app for further processing
+ * @params[in] uint16_t pf, CmHashListCp *pagingInfoMap
*
- * @params[in] void
- * @return ROK - success
- * RFAILED - failure
+ * @return DuPagInfoList
*
* ****************************************************************/
-S16 duReadCfg()
+DuPagInfoList* findPagingInfoFromMap(uint16_t pf, CmHashListCp *pagingInfoMap)
{
- Pst pst;
- Buffer *mBuf;
- //Read configs into duCfgParams
- if(readCfg() != ROK)
- {
- printf("\nReading configuration failed");
- RETVALUE(RFAILED);
- }
-
- //Fill pst structure
- cmMemset((U8 *)&(pst), 0, sizeof(Pst));
- pst.srcEnt = (Ent)ENTDUAPP;
- pst.srcInst = (Inst)DU_INST;
- pst.srcProcId = DU_PROC;
- pst.dstEnt = pst.srcEnt;
- pst.dstInst = pst.srcInst;
- pst.dstProcId = pst.srcProcId;
- pst.event = EVTCFG;
- pst.selector = DU_SELECTOR_TC;
- pst.pool= DU_POOL;
+ DuPagInfoList *pagInfoLL = NULLP;
+ cmHashListFind(pagingInfoMap, (uint8_t *)&(pf), sizeof(uint16_t), 0, (PTR *)&pagInfoLL);
+
+ return pagInfoLL;
+}
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
- {
- printf("\nMemory allocation failed in duReadCfg");
- return RFAILED;
- }
+/*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
+ *
+ * @details
+ *
+ * Function : printPageList
+ *
+ * Functionality: Print the Page Info List and UE Records
+ *
+ * @params[in] CmHashListCp *pagingInfoMap
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void printPageList(CmHashListCp *pagingInfoMap)
+{
+ uint8_t ret = ROK;
+ DuPagInfoList *pagInfoLLFromPF = NULLP, *prevPageInfoLL = NULLP;
- if (SPstTsk(&pst, mBuf) != ROK)
+ do
{
- printf("\nSPstTsk failed in duReadCfg");
- return RFAILED;
- }
-
- return ROK;
+ ret = cmHashListGetNext(pagingInfoMap, (PTR)prevPageInfoLL, (PTR *)&pagInfoLLFromPF);
+ if(ret == ROK)
+ {
+ 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
- **********************************************************************/
+End of file
+**********************************************************************/