}
else
{
- for(uint8_t idx=0; idx<encBufSize; idx++)
- {
- duCfgParam.macCellCfg.ssbCfg.mibPdu[idx]=encBuf[idx];
- }
+ memcpy(&duCfgParam.macCellCfg.ssbCfg.mibPdu, encBuf,encBufSize);
}
duCfgParam.macCellCfg.ssbCfg.multCarrBand = SSB_MULT_CARRIER_BAND;
duCfgParam.macCellCfg.ssbCfg.multCellCarr = MULT_CELL_CARRIER;
uint8_t readCfg()
{
- uint8_t i,j,k;
+ uint8_t srvdCellIdx, bandIdx, sliceIdx, plmnIdx;
+ uint8_t brdcstPlmnIdx, freqBandIdx, srvdPlmnIdx;
uint32_t ipv4_du, ipv4_cu, ipv4_ric;
MibParams mib;
- Sib1Params sib1;
+ Sib1Params sib1;
+ F1TaiSliceSuppLst *taiSliceSuppLst;
+ RrmPolicy *rrmPolicy;
+
+ /* TODO Added these below variable for local testing, once we will receive the
+ * configuration from O1 we can remove these variable */
+ F1Snsaai snsaai[NUM_OF_SUPPORTED_SLICE] = {{1,{2,3,4}},{5,{6,7,8}}};
+ ResourceType rsrcType = PRB;
+ RrmPolicyRatio policyRatio= {10,20,30};
+ PolicyMemberList memberList;
+
+ memset(&memberList, 0, sizeof(PolicyMemberList));
+ memberList.snsaai = snsaai[DEDICATED_SLICE_INDEX];
#ifdef O1_ENABLE
if( getStartupConfig(&g_cfg) != ROK )
sib1.tac = DU_TAC;
sib1.ranac = DU_RANAC;
sib1.cellIdentity = CELL_IDENTITY;
- sib1.cellResvdForOpUse =\
- PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
+ sib1.cellResvdForOpUse = PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
sib1.connEstFailCnt = ConnEstFailureControl__connEstFailCount_n3;
- sib1.connEstFailOffValidity =\
- ConnEstFailureControl__connEstFailOffsetValidity_s120;
+ sib1.connEstFailOffValidity = ConnEstFailureControl__connEstFailOffsetValidity_s120;
sib1.siSchedInfo.winLen = SI_SchedulingInfo__si_WindowLength_s5;
- sib1.siSchedInfo.broadcastSta = \
- SchedulingInfo__si_BroadcastStatus_broadcasting;
+ sib1.siSchedInfo.broadcastSta = SchedulingInfo__si_BroadcastStatus_broadcasting;
sib1.siSchedInfo.preiodicity = SchedulingInfo__si_Periodicity_rf8;
sib1.siSchedInfo.sibType = SIB_TypeInfo__type_sibType2;
sib1.siSchedInfo.sibValTag = SIB1_VALUE_TAG;
duCfgParam.sib1Params = sib1;
- for(i=0; i<DEFAULT_CELLS; i++)
+ for(srvdCellIdx=0; srvdCellIdx<DEFAULT_CELLS; srvdCellIdx++)
{
- memset(&duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn, 0, sizeof(Plmn));
- 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;
+ 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 */
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.cellId = NR_CELL_ID;
- duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrPci = NR_PCI;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.cellId = NR_CELL_ID;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = NR_PCI;
/* List of Available PLMN */
- for(j=0;j<MAX_PLMN;j++)
+ for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
{
- memset(&duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j], 0, sizeof(Plmn));
- 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;
+ /* 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));
+ 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;
}
/* List of Extended PLMN */
- for(j=0;j<MAX_PLMN;j++)
+ for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
{
- memset(&duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j], 0, sizeof(Plmn));
- 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;
+ /* 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;
+
+ taiSliceSuppLst->pres = true;
+ taiSliceSuppLst->numSupportedSlices = NUM_OF_SUPPORTED_SLICE;
+
+ memset(&taiSliceSuppLst->snssai, 0, sizeof(F1Snsaai));
+ for(sliceIdx=0; sliceIdx<NUM_OF_SUPPORTED_SLICE; sliceIdx++)
+ {
+ DU_ALLOC(taiSliceSuppLst->snssai[sliceIdx], sizeof(F1Snsaai));
+ if(taiSliceSuppLst->snssai[sliceIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed");
+ return RFAILED;
+ }
+ memcpy(taiSliceSuppLst->snssai[sliceIdx], &snsaai[sliceIdx], sizeof(F1Snsaai));
+
+ /* Checking rrmPolicy Slice list available or not */
+ if(!memcmp(&snsaai[sliceIdx], &memberList.snsaai, sizeof(F1Snsaai)))
+ {
+ rrmPolicy = &duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].rrmPolicy;
+ rrmPolicy->present = true;
+ rrmPolicy->rsrcType = rsrcType;
+ rrmPolicy->memberList.snsaai = memberList.snsaai;
+ rrmPolicy->rrmPolicyRatio = policyRatio;
+ }
+ }
+ }
/* TAC and EPSTAC */
- duCfgParam.srvdCellLst[i].duCellInfo.tac = DU_TAC;
- duCfgParam.srvdCellLst[i].duCellInfo.epsTac = DU_TAC; //to check and fill
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = DU_TAC;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = DU_TAC; //to check and fill
/* NR Mode info */
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = NR_UL_ARFCN;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
+ 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.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
#if 0
/* NR Mode info */
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_ARFCN;
- 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_106;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_ARFCN;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
- for(j=0;j<MAXNRCELLBANDS;j++)
+ for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
{
- 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;
- }
+ 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;
+ }
}
#endif
- for(j=0;j<MAXNRCELLBANDS;j++)
+ for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
{
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[j].nrFreqBand = NR_FREQ_BAND;
- for(k=0;k<MAXNRCELLBANDS;k++)
- {
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[j].sulBand[k] = SUL_BAND;
- }
+ 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[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = NR_DL_ARFCN;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
- for(j=0;j<MAXNRCELLBANDS;j++)
+ 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 = SCS_15;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
+ for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
{
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[j].nrFreqBand = NR_FREQ_BAND;
- for(k=0;k<MAXNRCELLBANDS;k++)
- {
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[j].sulBand[k] = SUL_BAND;
- }
+ 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[i].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = SCS_15;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrb = NRB_106;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = SCS_15;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrb = NRB_106;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = SCS_15;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrb = NRB_106;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = SCS_15;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrb = NRB_106;
-#if 0
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrTxBw.nrScs = SCS_15;
- duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrTxBw.nrb = NRB_106;
-#endif
/*Measurement Config and Cell Config */
- duCfgParam.srvdCellLst[i].duCellInfo.measTimeCfg = TIME_CFG;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.measTimeCfg = TIME_CFG;
- duCfgParam.srvdCellLst[i].duCellInfo.cellDir = DL_UL;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellDir = DL_UL;
- duCfgParam.srvdCellLst[i].duCellInfo.cellType=CELL_TYPE;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellType=CELL_TYPE;
/* Broadcast PLMN Identity */
- for(j=0;j<MAXBPLMNNRMINUS1;j++)
+ for(brdcstPlmnIdx=0; brdcstPlmnIdx<MAX_BPLMN_NRCELL_MINUS_1; brdcstPlmnIdx++)
{
- for(k=0;k<MAX_PLMN;k++)
- {
- memset(&duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k], 0, sizeof(Plmn));
- 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;
- }
- /* Extended PLMN List */
- for(k=0;k<MAX_PLMN;k++)
- {
- memset(&duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k], 0, sizeof(Plmn));
- 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].tac = DU_TAC;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].nrCellId = NR_CELL_ID;
- duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].ranac = NR_RANAC;
+ 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;
+ }
+
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = DU_TAC;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = NR_CELL_ID;
+ duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].ranac = NR_RANAC;
}
/*gnb DU System Info mib msg*/
BuildMibMsg();
- DU_ALLOC(duCfgParam.srvdCellLst[i].duSysInfo.mibMsg, encBufSize);
- if(!(duCfgParam.srvdCellLst[i].duSysInfo.mibMsg))
+ 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;
+ DU_LOG("\nERROR --> DU APP : Memory allocation failure at readCfg");
+ return RFAILED;
}
- memcpy(duCfgParam.srvdCellLst[i].duSysInfo.mibMsg, encBuf, encBufSize);
- duCfgParam.srvdCellLst[i].duSysInfo.mibLen = encBufSize;
+ 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[i].duSysInfo.sib1Msg,\
- encBufSize);
- if(!(duCfgParam.srvdCellLst[i].duSysInfo.sib1Msg))
+ 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;
+ DU_LOG("\nERROR --> DU APP : Memory allocation failure at readCfg");
+ return RFAILED;
}
- memcpy(duCfgParam.srvdCellLst[i].duSysInfo.sib1Msg,\
- encBuf,encBufSize);
- duCfgParam.srvdCellLst[i].duSysInfo.sib1Len = encBufSize;
+ memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\
+ encBuf,encBufSize);
+ duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Len = encBufSize;
}
Buffer *mBuf;
memset(&duCfgParam, 0, sizeof(DuCfgParams));
+
//Read configs into duCfgParams
if(readCfg() != ROK)
{
* ****************************************************************/
uint8_t BuildExtensions(ProtocolExtensionContainer_4624P3_t **ieExtend)
{
- uint8_t idx;
- uint8_t plmnidx;
- uint8_t extensionCnt=1;
- uint8_t sliceId=0;
- uint8_t sdId;
+ uint8_t idx=0, plmnidx=0, sliceLstIdx=0;
+ uint8_t elementCnt=0, extensionCnt=0;
+
+ extensionCnt=IE_EXTENSION_LIST_COUNT;
DU_ALLOC(*ieExtend,sizeof(ProtocolExtensionContainer_4624P3_t));
if((*ieExtend) == NULLP)
{
+ DU_LOG("ERROR --> DU_APP : BuildExtensions(): Memory allocation failed");
return RFAILED;
}
(*ieExtend)->list.count = extensionCnt;
(*ieExtend)->list.size = \
- extensionCnt * sizeof(ServedPLMNs_ItemExtIEs_t *);
+ extensionCnt * sizeof(ServedPLMNs_ItemExtIEs_t *);
DU_ALLOC((*ieExtend)->list.array,(*ieExtend)->list.size);
if((*ieExtend)->list.array == NULLP)
{
+ DU_LOG("ERROR --> DU_APP : BuildExtensions(): Memory allocation failed");
return RFAILED;
}
for(plmnidx=0;plmnidx<extensionCnt;plmnidx++)
{
DU_ALLOC((*ieExtend)->list.array[plmnidx],\
- sizeof(ServedPLMNs_ItemExtIEs_t));
+ sizeof(ServedPLMNs_ItemExtIEs_t));
if((*ieExtend)->list.array[plmnidx] == NULLP)
{
- return RFAILED;
+ DU_LOG("ERROR --> DU_APP : BuildExtensions(): Memory allocation failed");
+ return RFAILED;
}
}
+
+ elementCnt = NUM_OF_SUPPORTED_SLICE;
idx = 0;
(*ieExtend)->list.array[idx]->id = ProtocolIE_ID_id_TAISliceSupportList;
(*ieExtend)->list.array[idx]->criticality = Criticality_ignore;
(*ieExtend)->list.array[idx]->extensionValue.present = \
- ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
+ ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
(*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.count = 1;
- (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.size = sizeof(SliceSupportItem_t *);
- DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array,sizeof(SliceSupportItem_t *));
- if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array == NULLP)
- {
- return RFAILED;
- }
- DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId],sizeof(SliceSupportItem_t));
- if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId] == NULLP)
- {
- return RFAILED;
- }
+ list.count = elementCnt;
(*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sST.size = sizeof(uint8_t);
- DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList\
- .list.array[sliceId]->sNSSAI.sST.buf,(*ieExtend)->list.array[idx]->\
- extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sST.size);
- if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList\
- .list.array[sliceId]->sNSSAI.sST.buf == NULLP)
- {
- return RFAILED;
- }
- (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sST.buf[0] = 3;
+ list.size = (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.count * sizeof(SliceSupportItem_t *);
+
DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD,sizeof(OCTET_STRING_t));
+ list.array, elementCnt * sizeof(SliceSupportItem_t *));
if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD == NULLP)
+ list.array == NULLP)
{
+ DU_LOG("ERROR --> DU_APP : BuildExtensions(): Memory allocation failed");
return RFAILED;
}
- (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD->size = 3*sizeof(uint8_t);
- DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD->buf,(*ieExtend)->list.array[idx]->extensionValue.choice.\
- SliceSupportList.list.array[sliceId]->sNSSAI.sD->size);
- if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD->buf == NULLP)
+
+ for(sliceLstIdx =0; sliceLstIdx<elementCnt; sliceLstIdx++)
{
- return RFAILED;
+ DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx],sizeof(SliceSupportItem_t));
+ if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx] == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : BuildExtensions(): Memory allocation failed");
+ return RFAILED;
+ }
+ (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.size = sizeof(uint8_t);
+ DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList\
+ .list.array[sliceLstIdx]->sNSSAI.sST.buf,(*ieExtend)->list.array[idx]->\
+ extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.size);
+ if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList\
+ .list.array[sliceLstIdx]->sNSSAI.sST.buf == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : BuildExtensions(): Memory allocation failed");
+ return RFAILED;
+ }
+ (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.buf[0] = duCfgParam.srvdCellLst[0].duCellInfo.\
+ cellInfo.srvdPlmn[0].taiSliceSuppLst.snssai[sliceLstIdx]->sst;
+
+ DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD,sizeof(OCTET_STRING_t));
+ if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : BuildExtensions(): Memory allocation failed");
+ return RFAILED;
+ }
+ (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->size = 3 * sizeof(uint8_t);
+ DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->buf, (*ieExtend)->list.array[idx]->extensionValue.choice.\
+ SliceSupportList.list.array[sliceLstIdx]->sNSSAI.sD->size);
+ if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->buf == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : BuildExtensions(): Memory allocation failed");
+ return RFAILED;
+ }
+ memcpy((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->buf, duCfgParam.srvdCellLst[0].duCellInfo.\
+ cellInfo.srvdPlmn[0].taiSliceSuppLst.snssai[sliceLstIdx]->sd, (*ieExtend)->list.array[idx]->\
+ extensionValue.choice.SliceSupportList.list.array[sliceLstIdx]->sNSSAI.sD->size);
}
- sdId = 0;
- (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD->buf[sdId] = 3;
- sdId++;
- (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD->buf[sdId] = 6;
- sdId++;
- (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD->buf[sdId] = 9;
return ROK;
}
/*******************************************************************
* ****************************************************************/
void FreeServedCellList( GNB_DU_Served_Cells_List_t *duServedCell)
{
- uint8_t plmnCnt=1;
- uint8_t sliceId=0;
- uint8_t extensionCnt=1;
- uint8_t plmnIdx=0;
+ uint8_t plmnCnt=MAX_PLMN;
+ uint8_t extensionCnt=IE_EXTENSION_LIST_COUNT;
+ uint8_t plmnIdx=0, sliceIdx=0;
GNB_DU_Served_Cells_Item_t *srvCellItem;
ServedPLMNs_Item_t *servedPlmnItem;
SliceSupportItem_t *sliceSupportItem;
if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[plmnIdx] != NULLP)
{
servedPlmnItem = srvCellItem->served_Cell_Information.servedPLMNs.list.array[plmnIdx];
- DU_FREE(servedPlmnItem->pLMN_Identity.buf, servedPlmnItem->pLMN_Identity.size * sizeof(uint8_t));
+ DU_FREE(servedPlmnItem->pLMN_Identity.buf, servedPlmnItem->pLMN_Identity.size);
if(servedPlmnItem->iE_Extensions != NULLP)
{
{
if(servedPlmnItem->iE_Extensions->list.array[0] != NULLP)
{
- if(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.\
- array != NULLP)
+ if(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
+ SliceSupportList.list.array != NULLP)
{
- if(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.\
- array[sliceId] != NULLP)
+ for(sliceIdx =0; sliceIdx<servedPlmnItem->iE_Extensions->list.array[0]->\
+ extensionValue.choice.SliceSupportList.list.count; sliceIdx++)
{
- sliceSupportItem = servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
- SliceSupportList.list.array[sliceId];
+ if(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
+ SliceSupportList.list.array[sliceIdx] != NULLP)
+ {
+ sliceSupportItem = servedPlmnItem->iE_Extensions->list.array[0]->\
+ extensionValue.choice.SliceSupportList.list.array[sliceIdx];
- DU_FREE(sliceSupportItem->sNSSAI.sST.buf, sizeof(uint8_t));
+ DU_FREE(sliceSupportItem->sNSSAI.sST.buf, sizeof(uint8_t));
- if(sliceSupportItem->sNSSAI.sD != NULLP)
- {
- DU_FREE(sliceSupportItem->sNSSAI.sD->buf, sliceSupportItem->sNSSAI.sD->size);
- DU_FREE(sliceSupportItem->sNSSAI.sD, sizeof(OCTET_STRING_t));
- }
+ if(sliceSupportItem->sNSSAI.sD != NULLP)
+ {
+ DU_FREE(sliceSupportItem->sNSSAI.sD->buf,\
+ sliceSupportItem->sNSSAI.sD->size);
+ DU_FREE(sliceSupportItem->sNSSAI.sD, sizeof(OCTET_STRING_t));
+ }
- DU_FREE(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId], sizeof(SliceSupportItem_t));
+ DU_FREE(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.\
+ choice.SliceSupportList.list.array[sliceIdx], sizeof(SliceSupportItem_t));
+ }
}
- DU_FREE(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array, sizeof(SliceSupportItem_t*));
+ DU_FREE(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
+ SliceSupportList.list.array, sizeof(SliceSupportItem_t*));
}
- DU_FREE(servedPlmnItem->iE_Extensions->list.array[0], sizeof(ServedPLMNs_ItemExtIEs_t));
+ DU_FREE(servedPlmnItem->iE_Extensions->list.array[0],\
+ sizeof(ServedPLMNs_ItemExtIEs_t));
}
- DU_FREE(servedPlmnItem->iE_Extensions->list.array, extensionCnt*sizeof(ServedPLMNs_ItemExtIEs_t*));
+ DU_FREE(servedPlmnItem->iE_Extensions->list.array,\
+ extensionCnt*sizeof(ServedPLMNs_ItemExtIEs_t*));
}
DU_FREE(servedPlmnItem->iE_Extensions, sizeof(ProtocolExtensionContainer_4624P3_t));
}
- DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[plmnIdx], sizeof(ServedPLMNs_Item_t));
+ DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[plmnIdx],\
+ sizeof(ServedPLMNs_Item_t));
}
- DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array, sizeof(ServedPLMNs_Item_t *));
+ DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array,\
+ sizeof(ServedPLMNs_Item_t *));
}
if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD != NULLP)
if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.\
freqBandListNr.list.array != NULLP)
{
- DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.\
- list.array[0],sizeof(FreqBandNrItem_t));
- DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.\
- list.array,sizeof(FreqBandNrItem_t*));
+ DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->\
+ uL_NRFreqInfo.freqBandListNr.list.array[0],sizeof(FreqBandNrItem_t));
+ DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->\
+ uL_NRFreqInfo.freqBandListNr.list.array,sizeof(FreqBandNrItem_t*));
}
if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
void freeCellsToModifyItem(Served_Cells_To_Modify_Item_t *modifyItem)
{
- uint8_t arrIdx=0,i=0;
+ uint8_t arrIdx=0, servedPlmnIdx=0, sliceLstIdx=0;
ServedPLMNs_Item_t *servedPlmnItem = NULLP;
SliceSupportItem_t *sliceSupportItem = NULLP;
{
if(servedPlmnItem->iE_Extensions->list.array[arrIdx] != NULLP)
{
- if(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.list.array != NULLP)
+ if(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+ list.array != NULLP)
{
- if(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.list.array[arrIdx] != NULLP)
+ for(sliceLstIdx =0; sliceLstIdx<servedPlmnItem->iE_Extensions->list.array[arrIdx]->\
+ extensionValue.choice.SliceSupportList.list.count; sliceLstIdx++)
{
- sliceSupportItem = modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->iE_Extensions->\
- list.array[arrIdx]->extensionValue.choice.SliceSupportList.list.array[arrIdx];
-
- DU_FREE(sliceSupportItem->sNSSAI.sST.buf, sliceSupportItem->sNSSAI.sST.size);
- if(sliceSupportItem->sNSSAI.sD != NULLP)
+ if(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx] != NULLP)
{
- DU_FREE(sliceSupportItem->sNSSAI.sD->buf, sliceSupportItem->sNSSAI.sD->size);
- DU_FREE(sliceSupportItem->sNSSAI.sD,sizeof(OCTET_STRING_t));
+
+ sliceSupportItem = servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
+ SliceSupportList.list.array[sliceLstIdx];
+
+ DU_FREE(sliceSupportItem->sNSSAI.sST.buf, sliceSupportItem->sNSSAI.sST.size);
+ if(sliceSupportItem->sNSSAI.sD != NULLP)
+ {
+ DU_FREE(sliceSupportItem->sNSSAI.sD->buf, sliceSupportItem->sNSSAI.sD->size);
+ DU_FREE(sliceSupportItem->sNSSAI.sD,sizeof(OCTET_STRING_t));
+ }
+ DU_FREE(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
+ SliceSupportList.list.array[sliceLstIdx], sizeof(SliceSupportItem_t));
}
- DU_FREE(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
- list.array[arrIdx], sizeof(SliceSupportItem_t));
}
- DU_FREE(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.list.array,
- servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.list.size);
+ DU_FREE(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.\
+ choice.SliceSupportList.list.array,\
+ servedPlmnItem->iE_Extensions->list.array[arrIdx]->\
+ extensionValue.choice.SliceSupportList.list.size);
}
}
- for(i=0; i < servedPlmnItem->iE_Extensions->list.count ; i++)
+ for(servedPlmnIdx=0; servedPlmnIdx< servedPlmnItem->iE_Extensions->list.count ; servedPlmnIdx++)
{
- DU_FREE(servedPlmnItem->iE_Extensions->list.array[i], sizeof(ServedPLMNs_ItemExtIEs_t ));
+ DU_FREE(servedPlmnItem->iE_Extensions->list.array[servedPlmnIdx], sizeof(ServedPLMNs_ItemExtIEs_t ));
}
DU_FREE(servedPlmnItem->iE_Extensions->list.array, servedPlmnItem->iE_Extensions->list.size);
}
DU_FREE(servedPlmnItem->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
}
}
- for(i=0;i<modifyItem->served_Cell_Information.servedPLMNs.list.count;i++)
+ for(servedPlmnIdx=0; servedPlmnIdx<modifyItem->served_Cell_Information.servedPLMNs.list.count; servedPlmnIdx++)
{
- DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[i], sizeof(ServedPLMNs_Item_t));
+ DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[servedPlmnIdx], sizeof(ServedPLMNs_Item_t));
}
DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array,\
- modifyItem->served_Cell_Information.servedPLMNs.list.size);
+ modifyItem->served_Cell_Information.servedPLMNs.list.size);
}
if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD != NULLP)
uint8_t fillServedPlmns(ServedPLMNs_List_t *servedPlmn)
{
- uint8_t ieIdx, ieListCnt;
+ uint8_t ieIdx=0, arrayIdx=0, ieListCnt=0, elementCnt=0, sliceLstIdx=0;
- servedPlmn->list.array[0]->pLMN_Identity.size = 3*sizeof(uint8_t);
- DU_ALLOC(servedPlmn->list.array[0]->pLMN_Identity.buf, servedPlmn->list.\
- array[0]->pLMN_Identity.size);
- if(servedPlmn->list.array[0]->pLMN_Identity.buf == NULLP)
+ servedPlmn->list.array[arrayIdx]->pLMN_Identity.size = 3*sizeof(uint8_t);
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->pLMN_Identity.buf, servedPlmn->list.\
+ array[arrayIdx]->pLMN_Identity.size);
+ if(servedPlmn->list.array[arrayIdx]->pLMN_Identity.buf == NULLP)
{
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
return RFAILED;
}
- buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.plmn[0],\
- servedPlmn->list.array[0]->pLMN_Identity.buf);
- DU_ALLOC(servedPlmn->list.array[0]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
- if(servedPlmn->list.array[0]->iE_Extensions == NULLP)
+ buildPlmnId(duCfgParam.srvdCellLst[arrayIdx].duCellInfo.cellInfo.srvdPlmn[arrayIdx].plmn,\
+ servedPlmn->list.array[arrayIdx]->pLMN_Identity.buf);
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
+ if(servedPlmn->list.array[arrayIdx]->iE_Extensions == NULLP)
{
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
return RFAILED;
}
ieListCnt=1;
- servedPlmn->list.array[0]->iE_Extensions->list.count = ieListCnt;
- servedPlmn->list.array[0]->iE_Extensions->list.size = ieListCnt *sizeof(ServedPLMNs_ItemExtIEs_t *);
- DU_ALLOC(servedPlmn->list.array[0]->iE_Extensions->list.array,servedPlmn->list.array[0]->\
- iE_Extensions->list.size);
- if(servedPlmn->list.array[0]->iE_Extensions->list.array == NULLP)
+ servedPlmn->list.array[arrayIdx]->iE_Extensions->list.count = ieListCnt;
+ servedPlmn->list.array[arrayIdx]->iE_Extensions->list.size = ieListCnt *sizeof(ServedPLMNs_ItemExtIEs_t *);
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array,servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.size);
+ if(servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array == NULLP)
{
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
return RFAILED;
}
- for(ieIdx=0;ieIdx<ieListCnt;ieIdx++)
+ for(ieIdx=arrayIdx;ieIdx<ieListCnt;ieIdx++)
{
- DU_ALLOC(servedPlmn->list.array[0]->iE_Extensions->list.array[ieIdx],\
- sizeof(ServedPLMNs_ItemExtIEs_t));
- if(servedPlmn->list.array[0]->iE_Extensions->list.array[ieIdx] == NULLP)
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx],\
+ sizeof(ServedPLMNs_ItemExtIEs_t));
+ if(servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx] == NULLP)
{
- return RFAILED;
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
+ return RFAILED;
+ }
+ }
+
+ ieIdx = 0;
+ elementCnt = NUM_OF_SUPPORTED_SLICE;
+ servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->id =ProtocolIE_ID_id_TAISliceSupportList;
+ servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->criticality = Criticality_ignore;
+ servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->extensionValue.present = \
+ ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
+ servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.count = elementCnt;
+ servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.size = elementCnt * sizeof(SliceSupportItem_t *);
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array,servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.list.size);
+ if(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
+ return RFAILED;
+ }
+
+ for(sliceLstIdx =0; sliceLstIdx< elementCnt; sliceLstIdx++)
+ {
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx],sizeof( SliceSupportItem_t));
+ if(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx] == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
+ return RFAILED;
+ }
+
+ servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.size = sizeof(uint8_t);
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.buf,servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.list.array[sliceLstIdx]->\
+ sNSSAI.sST.size);
+
+ if(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.buf == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
+ return RFAILED;
+ }
+ servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.buf[arrayIdx] = duCfgParam.srvdCellLst[arrayIdx].duCellInfo.\
+ cellInfo.srvdPlmn[arrayIdx].taiSliceSuppLst.snssai[sliceLstIdx]->sst;
+
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD,sizeof(OCTET_STRING_t));
+ if(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
+ return RFAILED;
+ }
+ servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->size = 3 * sizeof(uint8_t);
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->buf,servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->size);
+ if(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->buf == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
+ return RFAILED;
}
+ memcpy(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->buf, duCfgParam.srvdCellLst[arrayIdx].duCellInfo.\
+ cellInfo.srvdPlmn[arrayIdx].taiSliceSuppLst.snssai[sliceLstIdx]->sd,\
+ servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->size);
}
- //plmnIeExt = servedPlmn->list.array[0]->iE_Extensions;
- servedPlmn->list.array[0]->iE_Extensions->list.array[0]->id =ProtocolIE_ID_id_TAISliceSupportList;
- servedPlmn->list.array[0]->iE_Extensions->list.array[0]->criticality = Criticality_ignore;
- servedPlmn->list.array[0]->iE_Extensions->list.array[0]->extensionValue.present = \
- ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
- servedPlmn->list.array[0]->iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.count = 1;
- servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.size = sizeof(SliceSupportItem_t *);
- DU_ALLOC(servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array,servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.size);
- if(servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array == NULLP)
- {
- return RFAILED;
- }
-
- DU_ALLOC(servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0],sizeof( SliceSupportItem_t));
- if(servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0] == NULLP)
- {
- return RFAILED;
- }
- servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sST.size = sizeof(uint8_t);
- DU_ALLOC(servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sST.buf,servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.array[0]->sNSSAI.sST.size);
- if(servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sST.buf == NULLP)
- {
- return RFAILED;
- }
- servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sST.buf[0] = 3;
- DU_ALLOC(servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD,sizeof(OCTET_STRING_t));
- if(servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD == NULLP)
- {
- return RFAILED;
- }
- servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->size = 3*sizeof(uint8_t);
- DU_ALLOC(servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->buf,servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->size);
- if(servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->buf == NULLP)
- {
- return RFAILED;
- }
- servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->buf[0] = 3;
- servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->buf[1] = 6;
- servedPlmn->list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->buf[2] = 9;
return ROK;
}