Epic-ID: ODUHIGH-538][Issue-ID: ODUHIGH-568] Fixes to read DU Cell configuration... 61/12561/2
authorlal.harshita <Harshita.Lal@radisys.com>
Thu, 22 Feb 2024 09:53:17 +0000 (15:23 +0530)
committerlal.harshita <Harshita.Lal@radisys.com>
Thu, 22 Feb 2024 10:05:32 +0000 (15:35 +0530)
Change-Id: Iaea1dd86ed25ad66366c0fbef04519b22fbfca46
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
build/config/odu_config.xml
src/du_app/du_cfg.c
src/du_app/du_cfg.h

index a43b8a3..9e591ed 100644 (file)
                <F1_SLICE_SUPP_LST>
                   <NUM_SUPPORT_SLICE>2</NUM_SUPPORT_SLICE>
                   <SNSSAI_LIST>
-                     <NUM_NSSAI>2</NUM_NSSAI>
-                     <LIST>
                      <SNSSAI>
                         <SST>1</SST>
                         <SD_SIZE>
-                        <SD>2</SD>
-                        <SD>3</SD>
-                        <SD>4</SD>
+                           <SD>2</SD>
+                           <SD>3</SD>
+                           <SD>4</SD>
                         </SD_SIZE>
                      </SNSSAI>
                      <SNSSAI>
                         <SST>5</SST>
                         <SD_SIZE>
-                        <SD>6</SD>
-                        <SD>7</SD>
-                        <SD>8</SD>
+                           <SD>6</SD>
+                           <SD>7</SD>
+                           <SD>8</SD>
                         </SD_SIZE>
                      </SNSSAI>
-                     </LIST>
                   </SNSSAI_LIST>
                </F1_SLICE_SUPP_LST>
             </F1_SRVD_PLMN>
                         <F1_NRB>14</F1_NRB>
                      </F1_TX_BW>
                   </F1_SUL_INFO>
+                   <MAX_NRCELL_BANDS>2</MAX_NRCELL_BANDS>
                   <F1_FREQ_BAND_LIST>
-                     <MAX_NRCELL_BANDS>2</MAX_NRCELL_BANDS>
-                     <LIST>
                      <F1_FREQ_BAND>
                         <NR_FREQ_BAND>1</NR_FREQ_BAND>
                         <SUL_BAND_LIST>
-                        <LIST>
                            <SUL_BAND>2</SUL_BAND>
-                        </LIST>
                         </SUL_BAND_LIST>
                      </F1_FREQ_BAND>
-                     </LIST>
                   </F1_FREQ_BAND_LIST>
                </F1_NR_FREQ_INFO_UL>
                <F1_NR_FREQ_INFO_DL>
                         <F1_NRB>14</F1_NRB>
                      </F1_TX_BW>
                   </F1_SUL_INFO>
+                  <MAX_NRCELL_BANDS>2</MAX_NRCELL_BANDS>
                   <F1_FREQ_BAND_LIST>
-                     <MAX_NRCELL_BANDS>2</MAX_NRCELL_BANDS>
-                     <LIST>
                      <F1_FREQ_BAND>
                         <NR_FREQ_BAND>1</NR_FREQ_BAND>
                         <SUL_BAND_LIST>
-                        <LIST>
                            <SUL_BAND>2</SUL_BAND>
-                        </LIST>
                         </SUL_BAND_LIST>
                      </F1_FREQ_BAND>
-                     </LIST>
                   </F1_FREQ_BAND_LIST>
                </F1_NR_FREQ_INFO_DL>
                <F1_TX_BW_UL>
                         <F1_NRB>28</F1_NRB>
                      </F1_TX_BW>
                   </F1_SUL_INFO>
+                  <MAX_NRCELL_BANDS>2</MAX_NRCELL_BANDS>
                   <F1_FREQ_BAND_LIST>
-                     <MAX_NRCELL_BANDS>2</MAX_NRCELL_BANDS>
-                     <LIST>
                      <F1_FREQ_BAND>
                         <NR_FREQ_BAND>78</NR_FREQ_BAND>
                         <SUL_BAND_LIST>
-                        <LIST>
                               <SUL_BAND>2</SUL_BAND>
-                        </LIST>
                         </SUL_BAND_LIST>
                      </F1_FREQ_BAND>
-                     </LIST>
                   </F1_FREQ_BAND_LIST>
                </F1_NR_FREQ_INFO>
                <F1_TX_BW>
index 800c7b5..be65741 100644 (file)
@@ -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; srvdCellIdx<DEFAULT_CELLS; srvdCellIdx++)
-   { 
-      memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn, 0, sizeof(Plmn));
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[0] = PLMN_MCC0;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[1] = PLMN_MCC1;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[2] = PLMN_MCC2;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[0] = PLMN_MNC0;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[1] = PLMN_MNC1;
-
-      /*Cell ID */
- #ifdef O1_ENABLE
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = cellParams.nRPCI;
- #else
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = NR_PCI;
-#endif
-      /* List of Available PLMN */
-      for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
-      {
-         /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
-          * followed by either 2 digit or 3 digits of mnc */ 
-
-         memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn, 0,\
-         sizeof(Plmn));
- #ifdef O1_ENABLE
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = cellParams.plmnList[srvdPlmnIdx].mcc[0];
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = cellParams.plmnList[srvdPlmnIdx].mcc[1];
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = cellParams.plmnList[srvdPlmnIdx].mcc[2];
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = cellParams.plmnList[srvdPlmnIdx].mnc[0];
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = cellParams.plmnList[srvdPlmnIdx].mnc[1];
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[2] = cellParams.plmnList[srvdPlmnIdx].mnc[2];
- #else
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = PLMN_MCC0;
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = PLMN_MCC1;
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = PLMN_MCC2;
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = PLMN_MNC0;
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = PLMN_MNC1;
-#endif
-      }
-      /* List of Extended PLMN */
-      for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
-      {
-         /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
-          * followed by either 2 digit or 3 digits of mnc */ 
-
-         memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn, 0, sizeof(Plmn));
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[0] = PLMN_MCC0;
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[1] = PLMN_MCC1;
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[2] = PLMN_MCC2;
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[0] = PLMN_MNC0;
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[1] = PLMN_MNC1;
-      } 
-      /* List of Supporting Slices */
-      for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
-      {
-         taiSliceSuppLst = &duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].\
-         taiSliceSuppLst;
-         
-         /* TODO Calculte the exact number of supported slices once will get
-          * cell configuration from O1 */
-         taiSliceSuppLst->numSupportedSlices = 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; sliceIdx<taiSliceSuppLst->numSupportedSlices; 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<MAX_NRCELL_BANDS; freqBandIdx++)
-      {
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].nrFreqBand =\
-                                                                                                                     NR_FREQ_BAND;
-         for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
-         {
-            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].sulBand[bandIdx]\
-               = SUL_BAND;     
-         }
-      }
-#else
-      /* NR FDD Mode info */
-#ifdef O1_ENABLE
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = cellParams.arfcnUL;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = cellParams.arfcnDL;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
-#else
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = NR_UL_ARFCN;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = NR_SCS;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = NR_DL_ARFCN;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = NR_SCS;
-#endif
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
-      for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
-      {
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
-         nrFreqBand = NR_FREQ_BAND;
-         for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
-         {
-            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
-            sulBand[bandIdx] = SUL_BAND;
-         }
-      }
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
-      for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
-      {
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
-         nrFreqBand = NR_FREQ_BAND;
-         for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
-         {
-            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
-            sulBand[bandIdx] = SUL_BAND;
-         }
-      }
-
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrb = NRB_106;
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrb = NRB_106;
-#endif
-
-      /*Measurement Config and Cell Config */ 
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.measTimeCfgDuration = TIME_CFG; 
-
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellDir = DL_UL; 
-
-      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellType=CELL_TYPE;
-
-      /* Broadcast PLMN Identity */
-      for(brdcstPlmnIdx=0; brdcstPlmnIdx<MAX_BPLMN_NRCELL_MINUS_1; brdcstPlmnIdx++)
-      { 
-         for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
-         {
-            memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx],\
-            0, sizeof(Plmn));
-            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[0] =\
-            PLMN_MCC0;
-            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[1] =\
-            PLMN_MCC1;
-            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[2] =\
-            PLMN_MCC2;
-            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[0] =\
-            PLMN_MNC0;
-            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[1] =\
-            PLMN_MNC1;
-         }
-         /* Extended PLMN List */       
-         for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
-         {
-            memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
-            extPlmn[plmnIdx], 0, sizeof(Plmn));
-            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
-            extPlmn[plmnIdx].mcc[0] = PLMN_MCC0;
-            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
-            extPlmn[plmnIdx].mcc[1] = PLMN_MCC1;
-            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
-            extPlmn[plmnIdx].mcc[2] = PLMN_MCC2;
-            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
-            extPlmn[plmnIdx].mnc[0] = PLMN_MNC0;
-            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
-            extPlmn[plmnIdx].mnc[1] = PLMN_MNC1;
-         }
-#ifdef O1_ENABLE
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = cellParams.nRTAC; //TODO : to check and fill
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = cellParams.nRTAC;
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = cellParams.nRTAC;
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = cellParams.cellLocalId;
-#else       
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = DU_TAC; //TODO : to check and fill
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = DU_TAC;
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = DU_TAC;
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = NR_CELL_ID;
-#endif     
-         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].ranac = NR_RANAC;
-      }
-
-      /*gnb DU System Info mib msg*/
-      BuildMibMsg();
-      DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBufSize);
-      if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg))
-      {
-         DU_LOG("\nERROR  -->  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;
index 8453061..4b58655 100644 (file)
 #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
 #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
 
 #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 */