X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_cfg.c;h=d2c758c15b9e50f737e6428f3cd560cbc26729ad;hb=refs%2Fchanges%2F77%2F5377%2F4;hp=72b60e9d3d531e9a1f045f79181a8df50b0e7489;hpb=e4e50f696285e2554d237169091026bf9f1b6257;p=o-du%2Fl2.git diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index 72b60e9d3..d2c758c15 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -22,8 +22,14 @@ #include "lrg.h" #include "lkw.x" #include "lrg.x" +#include "du_app_mac_inf.h" +#include "du_app_rlc_inf.h" #include "du_cfg.h" #include "du_mgr.h" +#include "du_utils.h" +#include "OCTET_STRING.h" +#include "BIT_STRING.h" +#include "odu_common_codec.h" #include "du_sys_info_hdl.h" #include "MIB.h" #include "SearchSpace.h" @@ -32,7 +38,6 @@ #include "SI-SchedulingInfo.h" #include "ConnEstFailureControl.h" #include "PLMN-IdentityInfo.h" -#include "odu_common_codec.h" #include "PDSCH-TimeDomainResourceAllocation.h" #include "BCCH-Config.h" #include "PagingCycle.h" @@ -47,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 : @@ -77,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++) { @@ -116,25 +121,26 @@ void FillSlotConfig() /* This function is used to fill up the cell configuration for CL */ -S16 readMacCfg() +uint8_t readMacCfg() { duCfgParam.macCellCfg.carrierId = CARRIER_IDX; /* Cell configuration */ duCfgParam.macCellCfg.cellId = NR_CELL_ID; duCfgParam.macCellCfg.phyCellId = NR_PCI; + duCfgParam.macCellCfg.numerology = NR_NUMEROLOGY; duCfgParam.macCellCfg.dupType = DUPLEX_MODE; /* DL carrier configuration */ duCfgParam.macCellCfg.dlCarrCfg.pres = TRUE; - duCfgParam.macCellCfg.dlCarrCfg.bw = BANDWIDTH; - duCfgParam.macCellCfg.dlCarrCfg.freq = NR_ARFCN; + duCfgParam.macCellCfg.dlCarrCfg.bw = BANDWIDTH_20MHZ; + 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; duCfgParam.macCellCfg.dlCarrCfg.k0[3] = 1; duCfgParam.macCellCfg.dlCarrCfg.k0[4] = 1; - duCfgParam.macCellCfg.dlCarrCfg.gridSize[0] = 1; + duCfgParam.macCellCfg.dlCarrCfg.gridSize[0] = 273; duCfgParam.macCellCfg.dlCarrCfg.gridSize[1] = 1; duCfgParam.macCellCfg.dlCarrCfg.gridSize[2] = 1; duCfgParam.macCellCfg.dlCarrCfg.gridSize[3] = 1; @@ -143,8 +149,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_20MHZ; + 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; @@ -165,7 +171,7 @@ S16 readMacCfg() duCfgParam.macCellCfg.ssbCfg.scsCmn = SUBCARRIER_SPACING; duCfgParam.macCellCfg.ssbCfg.ssbOffsetPointA = OFFSET_TO_POINT_A; duCfgParam.macCellCfg.ssbCfg.betaPss = BETA_PSS; - duCfgParam.macCellCfg.ssbCfg.ssbPeriod = SSB_PERIODICITY_20MS; + duCfgParam.macCellCfg.ssbCfg.ssbPeriod = SSB_PRDCTY_MS_20; duCfgParam.macCellCfg.ssbCfg.ssbScOffset = SSB_SUBCARRIER_OFFSET; duCfgParam.macCellCfg.ssbCfg.ssbMask[0] = 1; /* only one SSB is transmitted */ duCfgParam.macCellCfg.ssbCfg.ssbMask[1] = 0; @@ -195,20 +201,20 @@ S16 readMacCfg() duCfgParam.macCellCfg.prachCfg.rootSeqLen = ROOT_SEQ_LEN; duCfgParam.macCellCfg.prachCfg.fdm[0].rootSeqIdx = ROOT_SEQ_IDX; duCfgParam.macCellCfg.prachCfg.fdm[0].numRootSeq = NUM_ROOT_SEQ; - duCfgParam.macCellCfg.prachCfg.fdm[0].k1 = 1; + duCfgParam.macCellCfg.prachCfg.fdm[0].k1 = 0; duCfgParam.macCellCfg.prachCfg.fdm[0].zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG; duCfgParam.macCellCfg.prachCfg.fdm[0].numUnusedRootSeq = NUM_UNUSED_ROOT_SEQ; if(duCfgParam.macCellCfg.prachCfg.fdm[0].numUnusedRootSeq != 0) { - DU_ALLOC(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq, - NUM_UNUSED_ROOT_SEQ * sizeof(U8)); - if(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq == NULLP) - { - DU_LOG("\nDU_APP : Memory allocation failed"); - RETVALUE(RFAILED); - } - *(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq) = UNUSED_ROOT_SEQ; - } + DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq, + NUM_UNUSED_ROOT_SEQ * sizeof(uint8_t)); + if(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq == NULLP) + { + DU_LOG("\nDU_APP : Memory allocation failed"); + return RFAILED; + } + *(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq) = UNUSED_ROOT_SEQ; + } duCfgParam.macCellCfg.prachCfg.ssbPerRach = SSB_PER_RACH; duCfgParam.macCellCfg.prachCfg.prachMultCarrBand = PRACH_MULT_CARRIER_BAND; duCfgParam.macCellCfg.prachCfg.raContResTmr = RA_CONT_RES_TIMER; @@ -226,7 +232,7 @@ S16 readMacCfg() /* fill SIB1 configuration */ duCfgParam.macCellCfg.sib1Cfg.sib1PduLen = duCfgParam.srvdCellLst[0].duSysInfo.sib1Len; - DU_ALLOC(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu,duCfgParam.srvdCellLst[0].duSysInfo.sib1Len); + DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu,duCfgParam.srvdCellLst[0].duSysInfo.sib1Len); memcpy(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, \ duCfgParam.srvdCellLst[0].duSysInfo.sib1Len); duCfgParam.macCellCfg.sib1Cfg.sib1NewTxPeriod = SIB1_NEW_TX_PERIOD; @@ -238,7 +244,7 @@ S16 readMacCfg() /* fill Intial DL BWP */ duCfgParam.macCellCfg.initialDlBwp.bwp.firstPrb = 0; - duCfgParam.macCellCfg.initialDlBwp.bwp.numPrb = TOTAL_PRB_BW; /* configured to total BW */ + duCfgParam.macCellCfg.initialDlBwp.bwp.numPrb = TOTAL_PRB_20MHZ_MU0; /* configured to total BW */ duCfgParam.macCellCfg.initialDlBwp.bwp.scs = SUBCARRIER_SPACING; /* numerology is 0, 15Khz */ duCfgParam.macCellCfg.initialDlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX; duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.searchSpaceId = SEARCHSPACE_1_INDEX; @@ -270,7 +276,7 @@ S16 readMacCfg() /* fill Intial UL BWP */ duCfgParam.macCellCfg.initialUlBwp.bwp.firstPrb = 0; - duCfgParam.macCellCfg.initialUlBwp.bwp.numPrb = TOTAL_PRB_BW; /* configured to total BW */ + duCfgParam.macCellCfg.initialUlBwp.bwp.numPrb = TOTAL_PRB_20MHZ_MU0; /* configured to total BW */ duCfgParam.macCellCfg.initialUlBwp.bwp.scs = SUBCARRIER_SPACING; /* numerology is 0, 15Khz */ duCfgParam.macCellCfg.initialUlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX; duCfgParam.macCellCfg.initialUlBwp.puschCommon.k2 = PUSCH_K2; @@ -286,11 +292,7 @@ S16 readMacCfg() duCfgParam.macCellCfg.initialUlBwp.pucchCommon.pucchResourceCommon = PUCCH_RSRC_COMMON; duCfgParam.macCellCfg.initialUlBwp.pucchCommon.pucchGroupHopping = PUCCH_GROUP_HOPPING; - /* This should be calculated based on - (number of mandatory parameters) + (number of otional parameters being filled) */ - duCfgParam.macCellCfg.numTlv = 40; - - RETVALUE(ROK); + return ROK; } /******************************************************************* @@ -309,12 +311,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; } /******************************************************************* @@ -365,7 +367,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; @@ -380,7 +382,7 @@ S16 fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm) srvCellCfgComm->dlCfg.offsetToPointA = OFFSET_TO_POINT_A; srvCellCfgComm->dlCfg.dlScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET; srvCellCfgComm->dlCfg.dlScsCarrier.scs = SUBCARRIER_SPACING; - srvCellCfgComm->dlCfg.dlScsCarrier.scsBw = SCS_CARRIER_BANDWIDTH; + srvCellCfgComm->dlCfg.dlScsCarrier.scsBw = BANDWIDTH_20MHZ; srvCellCfgComm->dlCfg.locAndBw = FREQ_LOC_BW; /* Configuring PDCCH Config Common For SIB1 */ @@ -429,7 +431,7 @@ S16 fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm) /* Configuring UL Config Common */ srvCellCfgComm->ulCfg.ulScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET; srvCellCfgComm->ulCfg.ulScsCarrier.scs = SUBCARRIER_SPACING; - srvCellCfgComm->ulCfg.ulScsCarrier.scsBw = SCS_CARRIER_BANDWIDTH; + srvCellCfgComm->ulCfg.ulScsCarrier.scsBw = BANDWIDTH_20MHZ; srvCellCfgComm->ulCfg.pMax = UL_P_MAX; srvCellCfgComm->ulCfg.locAndBw = FREQ_LOC_BW; srvCellCfgComm->ulCfg.timeAlignTimerComm = TimeAlignmentTimer_infinity; @@ -506,10 +508,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; @@ -556,12 +558,12 @@ S16 readCfg() duCfgParam.mibParams = mib; /* SIB1 Params */ + memset(&sib1.plmn, 0, sizeof(Plmn)); sib1.plmn.mcc[0] = PLMN_MCC0; sib1.plmn.mcc[1] = PLMN_MCC1; sib1.plmn.mcc[2] = PLMN_MCC2; sib1.plmn.mnc[0] = PLMN_MNC0; sib1.plmn.mnc[1] = PLMN_MNC1; - sib1.plmn.mnc[2] = PLMN_MNC2; sib1.tac = DU_TAC; sib1.ranac = DU_RANAC; sib1.cellIdentity = CELL_IDENTITY; @@ -583,12 +585,12 @@ S16 readCfg() for(i=0; ibuf == NULL || bitString->size <= 0) - { - DU_LOG("\nDU_APP : Bit string is empty"); - return RFAILED; - } - - for(idx=0; idx< bitString->size-1; idx++) - { - *val |= bitString->buf[idx]; - *val <<= 8; - } - - *val |= bitString->buf[idx]; - *val >>= bitString->bits_unused; - - return ROK; -} - - /********************************************************************** End of file **********************************************************************/