From: lal.harshita Date: Thu, 22 Feb 2024 09:53:17 +0000 (+0530) Subject: Epic-ID: ODUHIGH-538][Issue-ID: ODUHIGH-568] Fixes to read DU Cell configuration... X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=89385f467706b5c560a4ca10d71a342d1dd91f40;p=o-du%2Fl2.git Epic-ID: ODUHIGH-538][Issue-ID: ODUHIGH-568] Fixes to read DU Cell configuration from XML file Change-Id: Iaea1dd86ed25ad66366c0fbef04519b22fbfca46 Signed-off-by: lal.harshita --- diff --git a/build/config/odu_config.xml b/build/config/odu_config.xml index a43b8a3a9..9e591ed5f 100644 --- a/build/config/odu_config.xml +++ b/build/config/odu_config.xml @@ -239,25 +239,22 @@ 2 - 2 - 1 - 2 - 3 - 4 + 2 + 3 + 4 5 - 6 - 7 - 8 + 6 + 7 + 8 - @@ -276,18 +273,14 @@ 14 + 2 - 2 - 1 - 2 - - @@ -299,18 +292,14 @@ 14 + 2 - 2 - 1 - 2 - - @@ -332,18 +321,14 @@ 28 + 2 - 2 - 78 - 2 - - diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index 800c7b5b3..be65741d0 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -102,284 +102,6 @@ uint16_t calcSliv(uint8_t startSymbol, uint8_t lengthSymbol) return sliv; } -/******************************************************************* - * - * @brief Configures the DU Parameters - * - * @details - * - * Function : readCfg - * - * Functionality: - * - Initializes the DuCfg members. - * - Calls readMacCfg() - * - * @params[in] system task ID - * @return ROK - success - * RFAILED - failure - * - * ****************************************************************/ - -uint8_t readCfg() -{ - uint8_t srvdCellIdx, bandIdx, sliceIdx, plmnIdx; - uint8_t brdcstPlmnIdx, freqBandIdx, srvdPlmnIdx; - Sib1Params sib1; - SupportedSliceList *taiSliceSuppLst; - -#ifndef O1_ENABLE - /* Note: Added these below variable for local testing*/ - Snssai snssai[NUM_OF_SUPPORTED_SLICE] = {{1,{2,3,4}},{5,{6,7,8}}}; -#endif - - for(srvdCellIdx=0; srvdCellIdxnumSupportedSlices = NUM_OF_SUPPORTED_SLICE; - if(taiSliceSuppLst->numSupportedSlices > MAX_NUM_OF_SLICE_ITEMS) - { - DU_LOG("\nERROR --> DU_APP: readCfg(): Number of supported slice [%d] is more than 1024",\ - taiSliceSuppLst->numSupportedSlices); - return RFAILED; - } - - DU_ALLOC(taiSliceSuppLst->snssai, taiSliceSuppLst->numSupportedSlices*sizeof(Snssai*)); - if(taiSliceSuppLst->snssai == NULLP) - { - DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed"); - return RFAILED; - } - - for(sliceIdx=0; sliceIdxnumSupportedSlices; sliceIdx++) - { - DU_ALLOC(taiSliceSuppLst->snssai[sliceIdx], sizeof(Snssai)); - if(taiSliceSuppLst->snssai[sliceIdx] == NULLP) - { - DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed"); - return RFAILED; - } -#ifdef O1_ENABLE - memcpy(taiSliceSuppLst->snssai[sliceIdx]->sd, cellParams.plmnList[sliceIdx].sd, \ - SD_SIZE*sizeof(uint8_t)); - taiSliceSuppLst->snssai[sliceIdx]->sst = cellParams.plmnList[sliceIdx].sst; -#else - memcpy(taiSliceSuppLst->snssai[sliceIdx], &snssai[sliceIdx], sizeof(Snssai)); -#endif - } - } - - /* NR Mode info */ -#ifdef NR_TDD - /* NR TDD Mode info */ -#ifdef O1_ENABLE - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = cellParams.arfcnUL; - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL; - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing); -#else - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_UL_ARFCN; - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN; - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS; -#endif - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb = NRB_273; - - for(freqBandIdx=0; freqBandIdx DU APP : Memory allocation failure at readCfg"); - return RFAILED; - } - memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBuf, encBufSize); - duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibLen = encBufSize; - - /*gnb DU System Info mib msg*/ - BuildSib1Msg(); - DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\ - encBufSize); - if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg)) - { - DU_LOG("\nERROR --> DU APP : Memory allocation failure at readCfg"); - return RFAILED; - } - memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\ - encBuf,encBufSize); - duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Len = encBufSize; - - } - - return ROK; -} - /******************************************************************* * * @brief Copy Slice Cfg in temp structre in duCfgParams @@ -883,7 +605,6 @@ uint8_t parseSupportedSliceList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Supp return ROK; } -#ifdef XML_BASED_CONFIG /******************************************************************* * * @brief Fill Served PLMN @@ -1018,7 +739,6 @@ uint8_t parseF1FreqBand(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1FreqBand * uint8_t sulIdx = 0; uint16_t sulValue = 0; xmlNodePtr child; - xmlNodePtr sulChild; memset(freqBand, 0, sizeof(F1FreqBand)); cur = cur->xmlChildrenNode; @@ -1034,27 +754,19 @@ uint8_t parseF1FreqBand(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1FreqBand * child = cur->xmlChildrenNode; while (child != NULL) { - if ((!xmlStrcmp(child->name, (const xmlChar *)"LIST")) && (child->ns == ns)) + sulIdx = 0; + if ((!xmlStrcmp(child->name, (const xmlChar *)"SUL_BAND")) && (child->ns == ns)) { - sulChild = child->xmlChildrenNode; - sulIdx = 0; - while (sulChild != NULL) + sulValue = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1)); + if (sulIdx < MAX_NRCELL_BANDS) { - if ((!xmlStrcmp(sulChild->name, (const xmlChar *)"SUL_BAND")) && (sulChild->ns == ns)) - { - sulValue = atoi((char *)xmlNodeListGetString(doc, sulChild->xmlChildrenNode, 1)); - if (sulIdx < MAX_NRCELL_BANDS) - { - freqBand->sulBand[sulIdx] = sulValue; - sulIdx++; - } - else - { - DU_LOG("ERROR --> DU_APP : %s : SUL_BAND array overflow\n", __func__); - return RFAILED; - } - } - sulChild = sulChild->next; + freqBand->sulBand[sulIdx] = sulValue; + sulIdx++; + } + else + { + DU_LOG("ERROR --> DU_APP : %s : SUL_BAND array overflow\n", __func__); + return RFAILED; } } child = child->next; @@ -1087,27 +799,17 @@ uint8_t parseF1FreqBandList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrFreq { uint8_t idx = 0; - xmlNodePtr child; cur = cur->xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_FREQ_BAND")) && (cur->ns == ns)) { - child = cur->xmlChildrenNode; - while(child != NULL) + if(parseF1FreqBand(doc, ns, cur, &nrFreqInfo->freqBand[idx]) != ROK) { - if ((!xmlStrcmp(child->name, (const xmlChar *)"F1_FREQ_BAND")) && (child->ns == ns)) - { - if(parseF1FreqBand(doc, ns, child, &nrFreqInfo->freqBand[idx]) != ROK) - { - return RFAILED; - } - idx++; - } - child = child -> next; + return RFAILED; } + idx++; } - cur = cur -> next; } return ROK; @@ -1137,10 +839,14 @@ uint8_t parseF1TxBw(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1TxBw *txBw) cur = cur->xmlChildrenNode; while(cur != NULL) { +#ifdef O1_ENABLE + txBw->nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing); +#else if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_SCS")) && (cur->ns == ns)) { txBw->nrScs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } +#endif if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NRB")) && (cur->ns == ns)) { @@ -1176,10 +882,14 @@ uint8_t parseF1SulInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1SulInfo *su cur = cur->xmlChildrenNode; while(cur != NULL) { +#ifdef O1_ENABLE + sulInfo->sulArfcn = cellParams.arfcnSUL; +#else if ((!xmlStrcmp(cur->name, (const xmlChar *)"SUL_ARFCN")) && (cur->ns == ns)) { sulInfo->sulArfcn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } +#endif if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_TX_BW")) && (cur->ns == ns)) { @@ -1218,10 +928,14 @@ uint8_t parseF1NrFreqInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrFreqIn cur = cur->xmlChildrenNode; while(cur != NULL) { +#if O1_ENABLE + nrFreqInfo->nrArfcn = cellParams.arfcnUL; +#else if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_ARFCN")) && (cur->ns == ns)) { nrFreqInfo->nrArfcn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } +#endif if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SUL_INFO")) && (cur->ns == ns)) { @@ -1305,6 +1019,7 @@ uint8_t parseF1NrFddInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrFddInfo return ROK; } +#ifdef NR_TDD /******************************************************************* * * @brief Fill NR TDD Info @@ -1349,6 +1064,7 @@ uint8_t parseF1NrTddInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrTddInfo } return ROK; } +#endif /******************************************************************* * @@ -1381,6 +1097,7 @@ uint8_t parseNrModeInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, NrModeInfo * strcpy((char*)modeCfg, (char*)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } +#ifndef NR_TDD if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_FDD_INFO")) && (cur->ns == ns)) { if(strcmp(modeCfg, "FDD") == 0) @@ -1391,7 +1108,7 @@ uint8_t parseNrModeInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, NrModeInfo * } } } - +#else if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_TDD_INFO")) && (cur->ns == ns)) { if(strcmp(modeCfg, "TDD") == 0) @@ -1403,6 +1120,7 @@ uint8_t parseNrModeInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, NrModeInfo * } } +#endif cur = cur -> next; } return ROK; @@ -1500,6 +1218,10 @@ uint8_t parseF1DuCellInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1DuCellIn } } +#ifdef O1_ENABLE + duCellInfo->tac = cellParams.nRTAC; + duCellInfo->epsTac = cellParams.nRTAC; +#else if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns)) { duCellInfo->tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); @@ -1509,6 +1231,7 @@ uint8_t parseF1DuCellInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1DuCellIn { duCellInfo->epsTac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } +#endif if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_MODE_INFO")) && (cur->ns == ns)) { @@ -1540,7 +1263,6 @@ uint8_t parseF1DuCellInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1DuCellIn return RFAILED; } } - cur = cur -> next; } return ROK; @@ -1629,7 +1351,7 @@ uint8_t fillDuSrvdCellSysInfo(F1DuSysInfo *sysInfo) return ROK; } -#ifdef O1_ENABLED +#ifdef O1_ENABLE /******************************************************************* * * @brief Fill PLMN received from O1 interface @@ -1658,7 +1380,6 @@ void fillPlmnFromO1(Plmn *PLMN, uint8_t srvdPlmnIdx) PLMN->mnc[2] = cellParams.plmnList[srvdPlmnIdx].mnc[2]; } #endif -#endif /******************************************************************* * @@ -2867,7 +2588,6 @@ uint8_t parsePdschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Pdsch { uint8_t idx = 0; xmlNodePtr child = NULLP; - xmlNodePtr pdschNode = NULLP; memset(pdschCfgCmn, 0, sizeof(PdschConfigCommon)); cur = cur -> xmlChildrenNode; @@ -3294,7 +3014,6 @@ uint8_t parsePuschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschCfgC { uint8_t rsrcIdx = 0; xmlNodePtr child = NULLP; - xmlNodePtr rsrcNode = NULLP; memset(puschCfgCmn, 0, sizeof(PuschCfgCommon)); cur = cur -> xmlChildrenNode; @@ -4287,7 +4006,7 @@ uint8_t parseSib1Params(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,Sib1Params *s #ifdef O1_ENABLE sib1Params-> tac = cellParams.nRTAC; sib1Params->cellIdentity = CELL_IDENTITY * cellParams.cellLocalId; - DU_LOG("\nDEBUG --> DU_APP: readCfg(): OAM CellLocalId=%d", sib1Params->cellIdentity); + DU_LOG("\nDEBUG --> DU_APP: parseSib1Params(): OAM CellLocalId=%d", sib1Params->cellIdentity); #else if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns)) { @@ -5360,7 +5079,6 @@ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) } } -#ifdef XML_BASED_CONFIG if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_DU_SRVD_CELL_INFO")) && (cur->ns == ns)) { if(parseF1DuServedCellInfo(doc, ns, cur, &duCfgParam.srvdCellLst[0]) != ROK) @@ -5368,7 +5086,6 @@ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) return RFAILED; } } -#endif if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_CELL_CFG")) && (cur->ns == ns)) { @@ -5437,7 +5154,10 @@ uint8_t duReadCfg() xmlDocPtr doc = NULLP; xmlNodePtr cur = NULLP; xmlNsPtr ns = NULLP; + Pst pst; + Buffer *mBuf; + /* Parse, store and print DU configurations from XML file */ doc = xmlParseFile(filename); if(doc == NULL) { @@ -5456,21 +5176,11 @@ uint8_t duReadCfg() } parseDuCfgParams(doc, ns, cur); + printDuConfig(); xmlFreeDoc(doc); xmlCleanupParser(); - Pst pst; - Buffer *mBuf; - - /* Read configs into duCfgParams */ - if(readCfg() != ROK) - { - DU_LOG("\nERROR --> DU_APP : Reading configuration failed"); - return RFAILED; - } - printDuConfig(); - /* Fill pst structure */ memset(&(pst), 0, sizeof(Pst)); pst.srcEnt = (Ent)ENTDUAPP; diff --git a/src/du_app/du_cfg.h b/src/du_app/du_cfg.h index 8453061fd..4b5865584 100644 --- a/src/du_app/du_cfg.h +++ b/src/du_app/du_cfg.h @@ -31,36 +31,9 @@ #define NR_PCI 1 #define NR_CELL_ID 1 -#define CELL_TYPE SMALL - -//TODO: while testing for TDD, Mu1 and 100 MHz, this flag must be enabled -#ifdef NR_TDD -#define NR_DL_ARFCN 623400 -#define NR_UL_ARFCN 623400 -#define NR_FREQ_BAND 78 -#define NR_SCS SCS_30KHZ -#else -#define NR_DL_ARFCN 428000 -#define NR_UL_ARFCN 390000 -#define NR_FREQ_BAND 1 -#define NR_SCS SCS_15KHZ -#endif - #define TRANS_ID 1 -#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 PLMN_SIZE 3 -/* Spec 38.104 Table 5.4.2.3-1:Applicable NR-ARFCN per operating band in FR1 */ -#define SUL_ARFCN 100 -#define SUL_BAND 2 - -#define TIME_CFG 4 #define MEAS_TIMING_ARFCN 630432 #define CARRIER_IDX 1 #define FREQ_SHIFT_7P5KHZ FALSE @@ -152,7 +125,6 @@ #define MAX_NUM_OF_UE_ID 65536 /* Max num of UEs served by DU */ #define MAXNUMOFUACPLMN 12 /* Maximum number of PLMN ids*/ #define MAXNUMOFUACPERPLMN 64 /* Maximum number of signalled categories per PLMN */ -#define NR_RANAC 150 /* RANAC */ #define DEFAULT_CELLS 1 /* Max num of broadcast PLMN ids */ #define IE_EXTENSION_LIST_COUNT 1 @@ -217,7 +189,6 @@ #define MAX_RATIO 30 #define MIN_RATIO 20 #define DEDICATED_RATIO 10 -#define NUM_OF_SUPPORTED_SLICE 2 #ifdef NR_DRX /* Macros for Drx configuration */