X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_cfg.c;h=a0b3fdc0f0365f77bd539406ccdba63fe06e2f55;hb=65443172dd60a6ea312bd3a15959dbf54ad7f045;hp=607d6210437a5ffca883cbe15f2b8f6f3bdf32a1;hpb=5831bf6b3454aa200a92cd3e84209650734e4863;p=o-du%2Fl2.git diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index 607d62104..a0b3fdc0f 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -52,8 +52,8 @@ #include "BWP-DownlinkCommon.h" #include "BWP-UplinkCommon.h" -extern DuCfgParams duCfgParam; -extern char encBuf[ENC_BUF_MAX_LEN]; +DuCfgParams duCfgParam; +char encBuf[ENC_BUF_MAX_LEN]; /* Filling Slot configuration as : @@ -82,8 +82,8 @@ extern char encBuf[ENC_BUF_MAX_LEN]; * ****************************************************************/ void FillSlotConfig() { - U8 slot; - U8 symbol; + uint8_t slot; + uint8_t symbol; for(slot = 0; slot <= 3; slot++) { @@ -121,7 +121,7 @@ void FillSlotConfig() /* This function is used to fill up the cell configuration for CL */ -S16 readMacCfg() +uint8_t readMacCfg() { duCfgParam.macCellCfg.carrierId = CARRIER_IDX; @@ -133,7 +133,7 @@ S16 readMacCfg() /* DL carrier configuration */ duCfgParam.macCellCfg.dlCarrCfg.pres = TRUE; duCfgParam.macCellCfg.dlCarrCfg.bw = BANDWIDTH; - duCfgParam.macCellCfg.dlCarrCfg.freq = NR_ARFCN; + duCfgParam.macCellCfg.dlCarrCfg.freq = NR_DL_ARFCN; duCfgParam.macCellCfg.dlCarrCfg.k0[0] = 1; duCfgParam.macCellCfg.dlCarrCfg.k0[1] = 1; duCfgParam.macCellCfg.dlCarrCfg.k0[2] = 1; @@ -148,8 +148,8 @@ S16 readMacCfg() /* UL Carrier configuration */ duCfgParam.macCellCfg.ulCarrCfg.pres = TRUE; - duCfgParam.macCellCfg.ulCarrCfg.bw = SUL_ARFCN; - duCfgParam.macCellCfg.ulCarrCfg.freq = NR_ARFCN; + duCfgParam.macCellCfg.ulCarrCfg.bw = BANDWIDTH; + duCfgParam.macCellCfg.ulCarrCfg.freq = NR_UL_ARFCN; duCfgParam.macCellCfg.ulCarrCfg.k0[0] = 1; duCfgParam.macCellCfg.ulCarrCfg.k0[1] = 1; duCfgParam.macCellCfg.ulCarrCfg.k0[2] = 1; @@ -210,7 +210,7 @@ S16 readMacCfg() if(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq == NULLP) { DU_LOG("\nDU_APP : Memory allocation failed"); - RETVALUE(RFAILED); + return RFAILED; } *(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq) = UNUSED_ROOT_SEQ; } @@ -295,7 +295,7 @@ S16 readMacCfg() (number of mandatory parameters) + (number of otional parameters being filled) */ duCfgParam.macCellCfg.numTlv = 40; - RETVALUE(ROK); + return ROK; } /******************************************************************* @@ -314,12 +314,12 @@ S16 readMacCfg() * RFAILED - failure * * ****************************************************************/ -S16 fillDuPort(U16 *duPort) +uint8_t fillDuPort(uint16_t *duPort) { duPort[F1_INTERFACE] = DU_PORT; /* DU Port idx 0 38472 */ duPort[E2_INTERFACE] = RIC_PORT; /* RIC Port idx 1 38482 */ - RETVALUE(ROK); + return ROK; } /******************************************************************* @@ -370,7 +370,7 @@ uint16_t calcSliv(uint8_t startSymbol, uint8_t lengthSymbol) * RFAILED - failure * ** ****************************************************************/ -S16 fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm) +uint8_t fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm) { PdcchCfgCommon pdcchCfg; PdschCfgCommon pdschCfg; @@ -511,10 +511,10 @@ S16 fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm) * * ****************************************************************/ -S16 readCfg() +uint8_t readCfg() { - U8 i,j,k; - U32 ipv4_du, ipv4_cu, ipv4_ric; + uint8_t i,j,k; + uint32_t ipv4_du, ipv4_cu, ipv4_ric; MibParams mib; Sib1Params sib1; @@ -624,7 +624,7 @@ S16 readCfg() duCfgParam.srvdCellLst[i].duCellInfo.tac = DU_TAC; duCfgParam.srvdCellLst[i].duCellInfo.epsTac = DU_TAC; //to check and fill /* NR Mode info */ - duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = NR_ARFCN; + 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_120; duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_66; @@ -653,7 +653,7 @@ S16 readCfg() duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[j].sulBand[k] = SUL_BAND; } } - duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = NR_ARFCN; + 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_120; duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_66; @@ -741,10 +741,10 @@ S16 readCfg() if(readMacCfg() != ROK) { DU_LOG("\nDU_APP : Failed while reading MAC config"); - RETVALUE(RFAILED); + return RFAILED; } - RETVALUE(ROK); + return ROK; } /******************************************************************* @@ -764,21 +764,21 @@ S16 readCfg() * RFAILED - failure * * ****************************************************************/ -S16 duReadCfg() +uint8_t duReadCfg() { Pst pst; Buffer *mBuf; - cmMemset((U8 *)&duCfgParam, 0, sizeof(DuCfgParams)); + memset(&duCfgParam, 0, sizeof(DuCfgParams)); //Read configs into duCfgParams if(readCfg() != ROK) { DU_LOG("\nDU_APP : Reading configuration failed"); - RETVALUE(RFAILED); + return RFAILED; } //Fill pst structure - cmMemset((U8 *)&(pst), 0, sizeof(Pst)); + memset(&(pst), 0, sizeof(Pst)); pst.srcEnt = (Ent)ENTDUAPP; pst.srcInst = (Inst)DU_INST; pst.srcProcId = DU_PROC; @@ -790,15 +790,15 @@ S16 duReadCfg() pst.pool= DU_POOL; - if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK) + if(ODU_GET_MSG_BUF(DFLT_REGION, DU_POOL, &mBuf) != ROK) { DU_LOG("\nDU_APP : Memory allocation failed in duReadCfg"); return RFAILED; } - if (SPstTsk(&pst, mBuf) != ROK) + if (ODU_POST_TASK(&pst, mBuf) != ROK) { - DU_LOG("\nDU_APP : SPstTsk failed in duReadCfg"); + DU_LOG("\nDU_APP : ODU_POST_TASK failed in duReadCfg"); return RFAILED; }