RUN cd build/odu && make clean_odu odu MACHINE=BIT64 MODE=FDD
-#CMD /opt/o-du-l2/bin/odu/odu -f ../config/ssi_mem
+#CMD /opt/o-du-l2/bin/odu/odu
RUN cd build/odu && make clean_cu cu_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
-#CMD /opt/o-du-l2/bin/cu_stub/cu_stub -f ../config/ssi_mem
+#CMD /opt/o-du-l2/bin/cu_stub/cu_stub
# The Jenkins job requires a tag to build the Docker image.
# Global-JJB script assumes this file is in the repo root.
---
-tag: 1.0.1
+tag: 1.0.2
schCellCfg.schRachCfg.raRspWindow = macCellCfg->prachCfg.raRspWindow;
/* fill initial DL BWP */
- schCellCfg.schInitialBwp.bwp.firstPrb = macCellCfg->initialBwp.bwp.firstPrb;
- schCellCfg.schInitialBwp.bwp.numPrb = macCellCfg->initialBwp.bwp.numPrb;
- schCellCfg.schInitialBwp.bwp.scs = macCellCfg->initialBwp.bwp.scs;
- schCellCfg.schInitialBwp.bwp.cyclicPrefix = macCellCfg->initialBwp.bwp.cyclicPrefix;
- schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.searchSpaceId = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.searchSpaceId;
- schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.coresetId = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.coresetId;
- schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.monitoringSlot = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.monitoringSlot;
- schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.duration = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.duration;
- schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.monitoringSymbol = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.monitoringSymbol;
- schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel1 = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel1;
- schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel2 = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel2;
- schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel4 = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel4;
- schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel8 = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel8;
- schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel16 = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel16;
+ schCellCfg.schInitialDlBwp.bwp.firstPrb = macCellCfg->initialDlBwp.bwp.firstPrb;
+ schCellCfg.schInitialDlBwp.bwp.numPrb = macCellCfg->initialDlBwp.bwp.numPrb;
+ schCellCfg.schInitialDlBwp.bwp.scs = macCellCfg->initialDlBwp.bwp.scs;
+ schCellCfg.schInitialDlBwp.bwp.cyclicPrefix = macCellCfg->initialDlBwp.bwp.cyclicPrefix;
+ schCellCfg.schInitialDlBwp.pdcchCommon.raSearchSpace.searchSpaceId =
+ macCellCfg->initialDlBwp.pdcchCommon.raSearchSpace.searchSpaceId;
+ schCellCfg.schInitialDlBwp.pdcchCommon.raSearchSpace.coresetId =
+ macCellCfg->initialDlBwp.pdcchCommon.raSearchSpace.coresetId;
+ schCellCfg.schInitialDlBwp.pdcchCommon.raSearchSpace.monitoringSlot =
+ macCellCfg->initialDlBwp.pdcchCommon.raSearchSpace.monitoringSlot;
+ schCellCfg.schInitialDlBwp.pdcchCommon.raSearchSpace.duration =
+ macCellCfg->initialDlBwp.pdcchCommon.raSearchSpace.duration;
+ schCellCfg.schInitialDlBwp.pdcchCommon.raSearchSpace.monitoringSymbol =
+ macCellCfg->initialDlBwp.pdcchCommon.raSearchSpace.monitoringSymbol;
+ schCellCfg.schInitialDlBwp.pdcchCommon.raSearchSpace.candidate.aggLevel1 =
+ macCellCfg->initialDlBwp.pdcchCommon.raSearchSpace.candidate.aggLevel1;
+ schCellCfg.schInitialDlBwp.pdcchCommon.raSearchSpace.candidate.aggLevel2 =
+ macCellCfg->initialDlBwp.pdcchCommon.raSearchSpace.candidate.aggLevel2;
+ schCellCfg.schInitialDlBwp.pdcchCommon.raSearchSpace.candidate.aggLevel4 =
+ macCellCfg->initialDlBwp.pdcchCommon.raSearchSpace.candidate.aggLevel4;
+ schCellCfg.schInitialDlBwp.pdcchCommon.raSearchSpace.candidate.aggLevel8 =
+ macCellCfg->initialDlBwp.pdcchCommon.raSearchSpace.candidate.aggLevel8;
+ schCellCfg.schInitialDlBwp.pdcchCommon.raSearchSpace.candidate.aggLevel16 =
+ macCellCfg->initialDlBwp.pdcchCommon.raSearchSpace.candidate.aggLevel16;
+ schCellCfg.schInitialDlBwp.pdschCommon.k0 = macCellCfg->initialDlBwp.pdschCommon.k0;
+ schCellCfg.schInitialDlBwp.pdschCommon.mappingType =
+ macCellCfg->initialDlBwp.pdschCommon.mappingType;
+ schCellCfg.schInitialDlBwp.pdschCommon.startSymbol =
+ macCellCfg->initialDlBwp.pdschCommon.startSymbol;
+ schCellCfg.schInitialDlBwp.pdschCommon.lengthSymbol =
+ macCellCfg->initialDlBwp.pdschCommon.lengthSymbol;
+
+ /* fill initial DL BWP */
+ schCellCfg.schInitialUlBwp.bwp.firstPrb = macCellCfg->initialUlBwp.bwp.firstPrb;
+ schCellCfg.schInitialUlBwp.bwp.numPrb = macCellCfg->initialUlBwp.bwp.numPrb;
+ schCellCfg.schInitialUlBwp.bwp.scs = macCellCfg->initialUlBwp.bwp.scs;
+ schCellCfg.schInitialUlBwp.bwp.cyclicPrefix = macCellCfg->initialUlBwp.bwp.cyclicPrefix;
+ schCellCfg.schInitialUlBwp.puschCommon.k2 = macCellCfg->initialUlBwp.puschCommon.k2;
+ schCellCfg.schInitialUlBwp.puschCommon.mappingType =
+ macCellCfg->initialUlBwp.puschCommon.mappingType;
+ schCellCfg.schInitialUlBwp.puschCommon.startSymbol =
+ macCellCfg->initialUlBwp.puschCommon.startSymbol;
+ schCellCfg.schInitialUlBwp.puschCommon.lengthSymbol =
+ macCellCfg->initialUlBwp.puschCommon.lengthSymbol;
+
cfgPst.srcProcId = pst->dstProcId;
cfgPst.dstProcId = pst->srcProcId;
schDlAlloc->assignedPrb[itr] = 0;
schUlAlloc->assignedPrb[itr] = 0;
}
+ schUlAlloc->schPuschInfo = NULLP;
for(uint8_t itr=0; itr<MAX_SSB_IDX; itr++)
{
#define SCHED_DELTA 1
#define RAR_DELAY 1
#define SCH_MAX_UE 1
+#define PUSCH_START_RB 15
#define SI_RNTI 0xFFFF
#define P_RNTI 0xFFFE
*/
typedef struct schUlAlloc
{
- uint16_t totalPrb; /*!< Number of RBs in the cell */
- uint16_t assignedPrb[SCH_SYMBOL_PER_SLOT]; /*!< Num RBs and corresponding symbols allocated */
- uint8_t prachStartSymb; /*!< Start symbol for PRACH */
+ uint16_t totalPrb; /*!< Number of RBs in the cell */
+ uint16_t assignedPrb[SCH_SYMBOL_PER_SLOT]; /*!< Num RBs and corresponding symbols allocated */
+ bool puschPres; /*!< PUSCH presence field */
+ SchPuschInfo *schPuschInfo; /*!< PUSCH info */
}SchUlAlloc;
/**
for(idx=0; idx<dlBrdcstAlloc->ssbIdxSupported; idx++)
{
ssbInfo.ssbIdx = idx;
- ssbInfo.fdAlloc.ssbStartPrbIdx = ssbStartPrb;
- ssbInfo.fdAlloc.ssbPrbDuration = SCH_SSB_PRB_DURATION;
- ssbInfo.tdAlloc.ssbStartSymbIdx = ssbStartSymb;
- ssbInfo.tdAlloc.ssbSymbolDuration = SCH_SSB_SYMB_DURATION;
+ ssbInfo.fdAlloc.startPrb = ssbStartPrb;
+ ssbInfo.fdAlloc.numPrb = SCH_SSB_PRB_DURATION;
+ ssbInfo.tdAlloc.startSymb = ssbStartSymb;
+ ssbInfo.tdAlloc.numSymb = SCH_SSB_SYMB_DURATION;
dlBrdcstAlloc->ssbInfo[idx] = ssbInfo;
dlAlloc->ssbInfo[idx] = ssbInfo;
{
int ret = ROK;
UlSchInfo ulSchInfo;
+ SchUlAlloc *ulAlloc;
+
/* Schedule resources for PRACH */
schPrachResAlloc(cell, &ulSchInfo);
+
+ ulAlloc = cell->ulAlloc[cell->slotInfo.slot];
+
+ if(ulAlloc->schPuschInfo)
+ {
+ ulSchInfo.dataType |= SCH_DATATYPE_PUSCH;
+ memcpy(&ulSchInfo.schPuschInfo, ulAlloc->schPuschInfo,
+ sizeof(SchPuschInfo));
+ SCH_FREE(ulAlloc->schPuschInfo, sizeof(SchPuschInfo));
+ }
+
//send msg to MAC
ret = sendUlSchInfoToMac(&ulSchInfo, schInst);
if(ret != ROK)
extern SchCb schCb[SCH_MAX_INST];
extern int8_t coresetIdxTable[MAX_CORESET_INDEX][4];
extern int8_t searchSpaceIdxTable[MAX_SEARCH_SPACE_INDEX][4];
+extern uint8_t puschDeltaTable[MAX_MU_PUSCH];
/**
* @brief calculate ra-rnti function.
schCb[schInst].cells[schInst]->raCb[0].tcrnti = tcrnti;
}
+/**
+ * @brief resource allocation for msg3 PUSCH
+ *
+ * @details
+ *
+ * Function : schAllocMsg3Pusch
+ *
+ * This function handles msg3 PUSCH allocation
+ *
+ * @param[in] Inst schInst, SCH instance
+ * @param[in] slot, current slot
+ * @param[out] msg3StartRb
+ * @param[out] msg3NumRb
+ * @return void
+ **/
+uint8_t schAllocMsg3Pusch(Inst schInst, uint16_t slot, uint16_t *msg3StartRb,
+uint8_t *msg3NumRb)
+{
+ SchCellCb *cell = NULLP;
+ SchUlAlloc *ulAlloc = NULLP;
+ uint8_t puschMu = 0;
+ uint8_t msg3SlotAlloc = 0;
+ uint8_t delta = 0;
+ uint8_t k2 = 0;
+ uint8_t startSymb = 0;
+ uint8_t symbLen = 0;
+ uint8_t startRb = 0;
+ uint8_t numRb = 0;
+ uint8_t idx = 0;
+
+
+ cell = schCb[schInst].cells[schInst];
+ puschMu = cell->cellCfg.puschMu;
+ delta = puschDeltaTable[puschMu];
+ k2 = cell->cellCfg.schInitialUlBwp.puschCommon.k2;
+ startSymb = cell->cellCfg.schInitialUlBwp.puschCommon.startSymbol;
+ symbLen = cell->cellCfg.schInitialUlBwp.puschCommon.lengthSymbol;
+
+ /* Slot allocation for msg3 based on 38.214 section 6.1.2.1 */
+ msg3SlotAlloc = slot + k2 + delta;
+ msg3SlotAlloc = msg3SlotAlloc % SCH_NUM_SLOTS;
+
+ startRb = PUSCH_START_RB;
+
+ /* formula used for calculation of rbSize, 38.214 section 6.1.4.2
+ * Ninfo = S.Nre.R.Qm.v
+ * Nre' = Nsc.NsymPdsch-NdmrsSymb-Noh
+ * Nre = min(156,Nre').nPrb */
+ numRb = 1; /* based on above calculation */
+
+ /* allocating 1 extra RB for now */
+ numRb++;
+
+ for(idx=startSymb; idx<symbLen; idx++)
+ {
+ cell->ulAlloc[msg3SlotAlloc]->assignedPrb[idx] = startRb + numRb;
+ }
+ ulAlloc = cell->ulAlloc[msg3SlotAlloc];
+
+ SCH_ALLOC(ulAlloc->schPuschInfo, sizeof(SchPuschInfo));
+ if(!ulAlloc->schPuschInfo)
+ {
+ DU_LOG("SCH: Memory allocation failed in schAllocMsg3Pusch");
+ return RFAILED;
+ }
+ ulAlloc->schPuschInfo->harqProcId = SCH_HARQ_PROC_ID;
+ ulAlloc->schPuschInfo->resAllocType = SCH_ALLOC_TYPE_1;
+ ulAlloc->schPuschInfo->fdAlloc.startPrb = startRb;
+ ulAlloc->schPuschInfo->fdAlloc.numPrb = numRb;
+ ulAlloc->schPuschInfo->tdAlloc.startSymb = startSymb;
+ ulAlloc->schPuschInfo->tdAlloc.numSymb = symbLen;
+ ulAlloc->schPuschInfo->tbInfo.mcs = 4;
+ ulAlloc->schPuschInfo->tbInfo.ndi = 1; /* new transmission */
+ ulAlloc->schPuschInfo->tbInfo.rv = 0;
+ ulAlloc->schPuschInfo->tbInfo.tbSize = 24; /*Considering 2 PRBs */
+
+ *msg3StartRb = startRb;
+ *msg3NumRb = numRb;
+
+ return ROK;
+}
+
+
+
/**
* @brief process rach indication function.
*
{
SchCellCb *cell = schCb[schInst].cells[schInst];
uint16_t raRnti = 0;
+ uint16_t slot;
+ uint16_t msg3StartRb;
+ uint8_t msg3NumRb;
+ uint8_t ret = ROK;
+ /* RAR will sent in the next slot */
+ slot = (rachInd->timingInfo.slot+SCHED_DELTA+RAR_DELAY)%SCH_NUM_SLOTS;
- SchDlAlloc *dlAlloc =
- cell->dlAlloc[(rachInd->timingInfo.slot+SCHED_DELTA+RAR_DELAY)%SCH_NUM_SLOTS]; /* RAR will sent in the next slot */
+ SchDlAlloc *dlAlloc = cell->dlAlloc[slot];
RarInfo *rarInfo = &(dlAlloc->rarInfo);
/* rar message presense in next slot ind and will be scheduled */
/* create raCb at SCH */
createSchRaCb(rachInd->crnti,schInst);
- /* fill RAR info */
- rarInfo->raRnti = raRnti;
- rarInfo->tcrnti = rachInd->crnti;
- rarInfo->RAPID = rachInd->preambleIdx;
- rarInfo->ta = rachInd->timingAdv;
- rarInfo->msg3StartRb = 0; /* will be set during implementation of msg3 */
- rarInfo->msg3NumRb = 0; /* will be set during implementation of msg3 */
+ /* allocate resources for msg3 */
+ ret = schAllocMsg3Pusch(schInst, slot, &msg3StartRb, &msg3NumRb);
+ if(ret == ROK)
+ {
- return ROK;
+ /* fill RAR info */
+ rarInfo->raRnti = raRnti;
+ rarInfo->tcrnti = rachInd->crnti;
+ rarInfo->RAPID = rachInd->preambleIdx;
+ rarInfo->ta = rachInd->timingAdv;
+ rarInfo->msg3StartRb = msg3StartRb;
+ rarInfo->msg3NumRb = msg3NumRb;
+ }
+ return ret;
}
/**
uint8_t numSymbols = 0;
uint8_t offset = 0;
uint8_t FreqDomainResource[6] = {0};
- SchBwpDlCfg *initialBwp = &schCb[inst].cells[inst]->cellCfg.schInitialBwp;
+ SchBwpDlCfg *initialBwp = &schCb[inst].cells[inst]->cellCfg.schInitialDlBwp;
PdcchCfg *pdcch = &rarAlloc->rarPdcchCfg;
PdschCfg *pdsch = &rarAlloc->rarPdschCfg;
* Nre = min(156,Nre') . nPrb */
pdsch->freqAlloc.rbSize = 1; /* This value is calculated from above formulae */
pdsch->freqAlloc.vrbPrbMapping = 0; /* non-interleaved */
- pdsch->timeAlloc.startSymbolIndex = 2; /* spec-38.214, Table 5.1.2.1-1 */
- pdsch->timeAlloc.numSymbols = 12;
+ pdsch->timeAlloc.startSymbolIndex = initialBwp->pdschCommon.startSymbol;
+ pdsch->timeAlloc.numSymbols = initialBwp->pdschCommon.lengthSymbol;
pdsch->beamPdschInfo.numPrgs = 1;
pdsch->beamPdschInfo.prgSize = 1;
pdsch->beamPdschInfo.digBfInterfaces = 0;
{10, 1, 0, 682, 0, 2, 2, 6 } /* index 255 */
};
+/* Defintion of delta value Table 6.1.2.1.1-5 spec 38.214 */
+uint8_t puschDeltaTable[MAX_MU_PUSCH] = { 2, 3, 4, 6 };
/**
* @brief frequency domain allocation function.
#define MAX_SEARCH_SPACE_INDEX 16
#define MAX_RACH_NUM_RB_IDX 16
#define MAX_PRACH_CONFIG_IDX 256
+#define MAX_MU_PUSCH 4
#define SET_BITS(_startBit, _numBits, _byte) \
{ \
#ifdef NTL_LIB
#include "ntl_lib.h"
#endif
+#include "du_log.h"
\f
/* local defines */
" sockFd->fd(%ld)\n", INET_ERR_CODE, port, sockFd->fd);
CMINETLOGERROR(ERRCLS_DEBUG, ECMINET010, 0, prntBuf);
#else
- /* cm_inet_c_001.main_62:Warning fix */
- snprintf(prntBuf, CMINET_PRNT_BUF_SIZE, "CmInetSctpConnectx() Failed : error(%d), port(0x%1x),"
- " sockFd->fd(%d)\n", INET_ERR_CODE, port, sockFd->fd);
- CMINETLOGERROR(ERRCLS_DEBUG, ECMINET010, 0, prntBuf);
+ DU_LOG("\nCmInetSctpConnectx() Failed : error(%d), port(0x%1x),\
+ sockFd->fd(%d)\n", INET_ERR_CODE, port, sockFd->fd);
#endif /*ALIGN_64BIT*/
#endif /* CMINETDBG */
" sockFd->fd(%ld)\n", INET_ERR_CODE, sockFd->fd);
CMINETLOGERROR(ERRCLS_DEBUG, ECMINET014, 0, prntBuf);
#else
- /* cm_inet_c_001.main_62:Warning fix */
- snprintf(prntBuf, CMINET_PRNT_BUF_SIZE, "cmInetSctpRecvMsg() Failed : error(%d),"
- " sockFd->fd(%d)\n", INET_ERR_CODE, sockFd->fd);
- CMINETLOGERROR(ERRCLS_DEBUG, ECMINET014, 0, prntBuf);
+ DU_LOG("\ncmInetSctpRecvMsg() Failed : error(%d), sockFd->fd(%d)", \
+ INET_ERR_CODE, sockFd->fd);
#endif /*ALIGN_64BIT*/
#endif /* CMINETDBG */
SearchSpaceCfg raSearchSpace;
}PdcchConfigCommon;
+typedef struct pdschConfigCommon
+{
+ uint8_t k0;
+ uint8_t mappingType;
+ uint8_t startSymbol;
+ uint8_t lengthSymbol;
+}PdschConfigCommon;
+
+typedef struct puschConfigCommon
+{
+ /* PUSCH-TimeDomainResourceAllocation info */
+ uint8_t k2;
+ uint8_t mappingType;
+ uint8_t startSymbol;
+ uint8_t lengthSymbol;
+}PuschConfigCommon;
+
typedef struct bwpDlConfig
{
BwpParams bwp;
PdcchConfigCommon pdcchCommon;
+ PdschConfigCommon pdschCommon;
}BwpDlConfig;
+typedef struct bwpUlConfig
+{
+ BwpParams bwp;
+ // rach config common sent in PrachCfg
+ // pucch info not required
+ PuschConfigCommon puschCommon;
+}BwpUlConfig;
+
typedef struct macCellCfg
{
U16 transId;
TDDCfg tddCfg; /* TDD periodicity and slot configuration */
RSSIMeasUnit rssiUnit; /* RSSI measurement unit */
Sib1CellCfg sib1Cfg;
- BwpDlConfig initialBwp;
+ BwpDlConfig initialDlBwp;
+ BwpUlConfig initialUlBwp;
}MacCellCfg;
typedef struct macCellCfgCfm
#define MAX_NUM_PRG 1 /* max value should be later 275 */
#define MAX_DIG_BF_INTERFACES 0 /* max value should be later 255 */
#define MAX_CODEWORDS 1 /* max should be 2 */
+#define SCH_HARQ_PROC_ID 1 /* harq proc id */
+#define SCH_ALLOC_TYPE_1 1 /*sch res alloc type */
/* Datatype in UL SCH Info */
#define SCH_DATATYPE_PUSCH 1
SchSearchSpaceCfg raSearchSpace;
}SchPdcchCfgCmn;
+typedef struct schPdschCfgCmn
+{
+ uint8_t k0;
+ uint8_t mappingType;
+ uint8_t startSymbol;
+ uint8_t lengthSymbol;
+}SchPdschCfgCmn;
+
+typedef struct schPuschCfgCmn
+{
+ uint8_t k2;
+ uint8_t mappingType;
+ uint8_t startSymbol;
+ uint8_t lengthSymbol;
+}SchPuschCfgCmn;
+
typedef struct schBwpDlCfg
{
SchBwpParams bwp;
SchPdcchCfgCmn pdcchCommon;
+ SchPdschCfgCmn pdschCommon;
}SchBwpDlCfg;
+typedef struct schBwpUlCfg
+{
+ SchBwpParams bwp;
+ SchPuschCfgCmn puschCommon;
+}SchBwpUlCfg;
+
typedef struct schCellCfg
{
uint16_t cellId; /* Cell Id */
SchSsbCfg ssbSchCfg; /* SSB config */
SchSib1Cfg sib1SchCfg; /* SIB1 config */
SchRachCfg schRachCfg; /* PRACH config */
- SchBwpDlCfg schInitialBwp;
+ SchBwpDlCfg schInitialDlBwp; /* Initial DL BWP */
+ SchBwpUlCfg schInitialUlBwp; /* Initial UL BWP */
+ uint8_t puschMu; /* PUSCH MU */
}SchCellCfg;
typedef struct schCellCfgCfm
typedef struct timeDomainAlloc
{
- uint16_t ssbStartSymbIdx;
- uint16_t ssbSymbolDuration;
+ uint16_t startSymb;
+ uint16_t numSymb;
}TimeDomainAlloc;
typedef struct freqDomainAlloc
{
- uint16_t ssbStartPrbIdx;
- uint16_t ssbPrbDuration;
+ uint16_t startPrb;
+ uint16_t numPrb;
}FreqDomainAlloc;
typedef struct ssbInfo
uint16_t msg3StartRb;
uint8_t msg3NumRb;
uint16_t tcrnti;
- uint8_t rarPdu[8];
- uint8_t rarPduLen;
+ uint8_t rarPdu[8];
+ uint8_t rarPduLen;
}RarInfo;
typedef struct rarAlloc
uint8_t isRarPres;
RarAlloc rarAlloc;
}DlAlloc;
+
+typedef struct tbInfo
+{
+ uint8_t mcs; /* MCS */
+ uint8_t ndi; /* NDI */
+ uint8_t rv; /* Redundancy Version */
+ uint16_t tbSize; /* TB Size */
+}TbInfo;
+
+typedef struct schPuschInfo
+{
+ uint8_t harqProcId; /* HARQ Process ID */
+ uint8_t resAllocType; /* Resource allocation type */
+ FreqDomainAlloc fdAlloc; /* Freq domain allocation */
+ TimeDomainAlloc tdAlloc; /* Time domain allocation */
+ TbInfo tbInfo; /* TB info */
+}SchPuschInfo;
+
+
typedef struct ulSchInfo
{
uint16_t cellId; /* Cell Id */
SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
uint8_t dataType; /* Type of info being scheduled */
PrachSchInfo prachSchInfo; /* Prach scheduling info */
+ SchPuschInfo schPuschInfo; /* Pusch scheduling info */
}UlSchInfo;
typedef struct rachIndInfo
/* fill Intial DL BWP */
- duCfgParam.macCellCfg.initialBwp.bwp.firstPrb = 0;
- duCfgParam.macCellCfg.initialBwp.bwp.numPrb = TOTAL_PRB_BW; /* configured to total BW */
- duCfgParam.macCellCfg.initialBwp.bwp.scs = SUBCARRIER_SPACING; /* numerology is 0, 15Khz */
- duCfgParam.macCellCfg.initialBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX;
- duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.searchSpaceId = SEARCHSPACE_1_INDEX;
- duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.coresetId = CORESET_0_INDEX;
- duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.monitoringSlot =
+ duCfgParam.macCellCfg.initialDlBwp.bwp.firstPrb = 0;
+ duCfgParam.macCellCfg.initialDlBwp.bwp.numPrb = TOTAL_PRB_BW; /* 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.raSearchSpace.searchSpaceId = SEARCHSPACE_1_INDEX;
+ duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.raSearchSpace.coresetId = CORESET_0_INDEX;
+ duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.raSearchSpace.monitoringSlot =
SS_MONITORING_SLOT_SL1; /* sl1 - all slots */
- duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.duration = 0;
- duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.monitoringSymbol =
+ duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.raSearchSpace.duration = 0;
+ duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.raSearchSpace.monitoringSymbol =
SS_MONITORING_SYMBOL;
- duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.
+ duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.raSearchSpace.
candidate.aggLevel1 = 8;
- duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.
+ duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.raSearchSpace.
candidate.aggLevel2 = 4;
- duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.
+ duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.raSearchSpace.
candidate.aggLevel4 = 2;
- duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.
+ duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.raSearchSpace.
candidate.aggLevel8 = 1;
- duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.
+ duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.raSearchSpace.
candidate.aggLevel16 = 0;
+ duCfgParam.macCellCfg.initialDlBwp.pdschCommon.k0 = PDSCH_K0;
+ duCfgParam.macCellCfg.initialDlBwp.pdschCommon.mappingType =
+ PDSCH_MAPPING_TYPE_A;
+ duCfgParam.macCellCfg.initialDlBwp.pdschCommon.startSymbol =
+ PDSCH_START_SYMBOL;
+ duCfgParam.macCellCfg.initialDlBwp.pdschCommon.lengthSymbol =
+ PDSCH_LENGTH_SYMBOL;
+
+ /* fill Intial DL BWP */
+ duCfgParam.macCellCfg.initialUlBwp.bwp.firstPrb = 0;
+ duCfgParam.macCellCfg.initialUlBwp.bwp.numPrb = TOTAL_PRB_BW; /* 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;
+ duCfgParam.macCellCfg.initialUlBwp.puschCommon.mappingType =
+ PUSCH_MAPPING_TYPE_A;
+ duCfgParam.macCellCfg.initialUlBwp.puschCommon.startSymbol =
+ PUSCH_START_SYMBOL;
+ duCfgParam.macCellCfg.initialUlBwp.puschCommon.lengthSymbol =
+ PUSCH_LENGTH_SYMBOL;
+
/* This should be calculated based on
(number of mandatory parameters) + (number of otional parameters being filled) */
RETVALUE(ROK);
}
+/*******************************************************************
+*
+* @brief Configures the DU Parameters
+*
+* @details
+*
+* Function : calcSliv
+*
+* Functionality:
+* - calculate SLIV value from start and length field
+*
+* @params[in] start symbol
+* @params[in] length of symbols
+* @return SLIV value
+*
+* ****************************************************************/
+uint16_t calcSliv(uint8_t startSymbol, uint8_t lengthSymbol)
+{
+ uint16_t sliv = 0;
+ if((lengthSymbol-1) <= 7)
+ {
+ sliv = 14 * (lengthSymbol-1) + startSymbol;
+ }
+ else
+ {
+ sliv = 14 * (14-lengthSymbol+1) + (14-1-startSymbol);
+ }
+ return sliv;
+}
/*******************************************************************
pdschCfg.k0 = PDSCH_K0;
pdschCfg.mapType = \
PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
- pdschCfg.startSymbAndLen = PDSCH_START_SYMB_AND_LEN;
+ pdschCfg.sliv = calcSliv(PDSCH_START_SYMBOL,PDSCH_LENGTH_SYMBOL);
srvCellCfgComm->dlCfg.pdschCfg = pdschCfg;
/* Configuring BCCH Config for SIB1 */
/* Configuring PUSCH Config Common for SIB1 */
puschCfg.present = BWP_UplinkCommon__pusch_ConfigCommon_PR_setup;
- puschCfg.k2 = PUSCH_K0;
+ puschCfg.k2 = PUSCH_K2;
puschCfg.mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
- puschCfg.startSymbAndLen = PUSCH_START_SYMB_AND_LEN;
+ puschCfg.sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL);
puschCfg.msg3DeltaPreamble = PUSCH_MSG3_DELTA_PREAMBLE;
puschCfg.p0NominalWithGrant = PUSCH_P0_NOMINAL_WITH_GRANT;
srvCellCfgComm->ulCfg.puschCfg = puschCfg;
#define PRACH_SUBCARRIER_SPACING 1
#define PRACH_RESTRICTED_SET_CFG 0
#define NUM_PRACH_FDM 1
-#define ROOT_SEQ_IDX 139
+#define ROOT_SEQ_IDX 24
#define NUM_ROOT_SEQ 1
#define ZERO_CORRELATION_ZONE_CFG 6
#define NUM_UNUSED_ROOT_SEQ 0
/* MACRCO Ddefine for PDSCH Configuration */
#define PDSCH_K0 0
-#define PDSCH_START_SYMB_AND_LEN 53
+#define PDSCH_START_SYMBOL 2
+#define PDSCH_LENGTH_SYMBOL 12
+
/* MACRO Define for PUSCH Configuration */
-#define PUSCH_K0 3
-#define PUSCH_START_SYMB_AND_LEN 55
+#define PUSCH_K2 3
+#define PUSCH_START_SYMBOL 0
+#define PUSCH_LENGTH_SYMBOL 14
+
#define PUSCH_MSG3_DELTA_PREAMBLE 0
#define PUSCH_P0_NOMINAL_WITH_GRANT -70
PERMIT_HIGH_PRIOR_SESSION_AND_MOBILE_TERM_SERVICE
}F1UacStandardAction;
+typedef enum
+{
+ PDSCH_MAPPING_TYPE_A,
+ PDSCH_MAPPING_TYPE_B,
+}pdschMappingType;
+
+typedef enum
+{
+ PUSCH_MAPPING_TYPE_A,
+ PUSCH_MAPPING_TYPE_B,
+}puschMappingType;
+
+
typedef struct f1RrcVersion
{
char rrcVer[30]; /* Latest RRC Version */
typedef struct pdschCfgCommon
{
uint8_t present;
- long k0;
- long mapType; /* Mapping Type */
- long startSymbAndLen; /* Start Symbol and Length */
+ long k0;
+ long mapType; /* Mapping Type */
+ uint16_t sliv;
}PdschCfgCommon;
typedef struct bcchCfg
typedef struct puschCfgCommon
{
- uint8_t present;
- long k2;
- long mapType;
- long startSymbAndLen;
- long msg3DeltaPreamble;
- long p0NominalWithGrant;
+ uint8_t present;
+ long k2;
+ long mapType;
+ uint16_t sliv;
+ long msg3DeltaPreamble;
+ long p0NominalWithGrant;
}PuschCfgCommon;
typedef struct pucchCfgCommon
* @return ROK - success
* RFAILED - failure
*
- * ****************************************************************/
+ ******************************************************************/
-S16 BuildGlobalgNB(GlobalE2node_gNB_ID_t *gNbId)
+S16 BuildGlobalgNBId(GlobalE2node_gNB_ID_t *gNbId)
{
- U8 unused = 0;
- U8 byteSize = 4;
- U8 val = 1;
- if(gNbId != NULLP)
+ uint8_t unused = 0;
+ uint8_t byteSize = 4;
+ uint8_t val = 1;
+ uint8_t ret = ROK;
+
+ /* Allocate Buffer size */
+ gNbId->global_gNB_ID.plmn_id.size = 3 * sizeof(U8);
+ gNbId->global_gNB_ID.plmn_id.buf = NULLP;
+ DU_ALLOC(gNbId->global_gNB_ID.plmn_id.buf , gNbId->global_gNB_ID.plmn_id.size);
+ if(gNbId->global_gNB_ID.plmn_id.buf == NULLP)
+ {
+ DU_LOG("\nE2AP: Memory allocation failed for Plmn buffer");
+ ret = RFAILED;
+ }
+ else
{
- /* Allocate Buffer size */
- gNbId->global_gNB_ID.plmn_id.size = 3 * sizeof(U8);
- DU_ALLOC(gNbId->global_gNB_ID.plmn_id.buf , gNbId->global_gNB_ID.plmn_id.size);
buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn, \
- &gNbId->global_gNB_ID.plmn_id);
-
+ &gNbId->global_gNB_ID.plmn_id);
/* fill gND Id */
gNbId->global_gNB_ID.gnb_id.present = GNB_ID_Choice_PR_gnb_ID;
- /* Allocate Buffer size */
+ /* Allocate Buffer size */
gNbId->global_gNB_ID.gnb_id.choice.gnb_ID.size = byteSize * sizeof(U8);
- DU_ALLOC(gNbId->global_gNB_ID.gnb_id.choice.gnb_ID.buf, gNbId->global_gNB_ID.gnb_id.choice.gnb_ID.size);
- fillBitString(&gNbId->global_gNB_ID.gnb_id.choice.gnb_ID, unused, byteSize, val);
+ gNbId->global_gNB_ID.gnb_id.choice.gnb_ID.buf = NULLP;
+ DU_ALLOC(gNbId->global_gNB_ID.gnb_id.choice.gnb_ID.buf, \
+ gNbId->global_gNB_ID.gnb_id.choice.gnb_ID.size);
+ if(gNbId->global_gNB_ID.gnb_id.choice.gnb_ID.buf == NULLP)
+ {
+ DU_LOG("\nE2AP: Memory allocation failed for gnb buffer");
+ ret = RFAILED;
+ }
+ else
+ {
+ fillBitString(&gNbId->global_gNB_ID.gnb_id.choice.gnb_ID, unused, byteSize, val);
+ }
}
- return ROK;
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills the initiating IE for E2 Setup Request
+ *
+ * @details
+ *
+ * Function : fillE2SetupReq
+ *
+ * Functionality:Fills the Initiating message for
+ * E2SetupRequest
+ *
+ * @params[in] E2setupRequest_t *e2SetupReq,
+ * uint8_t *idx
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ ******************************************************************/
+
+uint16_t fillE2SetupReq(E2setupRequest_t **e2SetupReq, uint8_t *idx)
+{
+ uint8_t elementCnt = 0;
+ uint8_t idx2 = 0;
+ uint8_t ret = ROK;
+
+ if(*e2SetupReq != NULLP)
+ {
+ elementCnt = 1;
+ (*e2SetupReq)->protocolIEs.list.count = elementCnt;
+ (*e2SetupReq)->protocolIEs.list.size = \
+ elementCnt * sizeof(E2setupRequestIEs_t);
+
+ /* Initialize the E2Setup members */
+ DU_ALLOC((*e2SetupReq)->protocolIEs.list.array, \
+ (*e2SetupReq)->protocolIEs.list.size);
+ if((*e2SetupReq)->protocolIEs.list.array == NULLP)
+ {
+ DU_LOG("\nE2AP : Memory allocation failed for array elements");
+ ret = RFAILED;
+ }
+ else
+ {
+ for(*idx = 0; *idx < elementCnt; (*idx)++)
+ {
+ DU_ALLOC((*e2SetupReq)->protocolIEs.list.array[*idx],\
+ sizeof(E2setupRequestIEs_t));
+ if((*e2SetupReq)->protocolIEs.list.array[*idx] == NULLP)
+ {
+ DU_LOG("\nE2AP : Memory allocation failed for arrayidx [%d]", *idx);
+ ret = RFAILED;
+ }
+ else
+ {
+ /* GlobalE2node_gNB_ID */
+ (*e2SetupReq)->protocolIEs.list.array[idx2]->id = \
+ ProtocolIE_IDE2_id_GlobalE2node_ID;
+ (*e2SetupReq)->protocolIEs.list.array[idx2]->criticality = \
+ CriticalityE2_reject;
+ (*e2SetupReq)->protocolIEs.list.array[idx2]->value.present =\
+ E2setupRequestIEs__value_PR_GlobalE2node_ID;
+ (*e2SetupReq)->protocolIEs.list.array[idx2]->value.choice.\
+ GlobalE2node_ID.present = GlobalE2node_ID_PR_gNB;
+
+ DU_ALLOC((*e2SetupReq)->protocolIEs.list.array[idx2]->value.choice.\
+ GlobalE2node_ID.choice.gNB, sizeof(GlobalE2node_gNB_ID_t));
+ if((*e2SetupReq)->protocolIEs.list.array[idx2]->value.choice.\
+ GlobalE2node_ID.choice.gNB == NULLP)
+ {
+ DU_LOG("\nE2AP : Memory allocation failed for gNbId");
+ ret = RFAILED;
+ }
+ else
+ {
+ ret = BuildGlobalgNBId((*e2SetupReq)->protocolIEs.list.array[idx2]->value.\
+ choice.GlobalE2node_ID.choice.gNB);
+ if(ret != ROK)
+ {
+ ret = RFAILED;
+ }
+ }
+
+ }
+ }
+ }
+ }
+ else
+ {
+ ret = RFAILED;
+ DU_LOG("\nE2AP : Passed e2SetupReq is NULL");
+ }
+ return ret;
}
/*******************************************************************
S16 BuildAndSendE2SetupReq()
{
- E2AP_PDU_t *e2apMsg = NULLP;
- E2setupRequest_t *e2SetupReq;
- U8 elementCnt;
- U8 idx;
- U8 ieId;
- asn_enc_rval_t encRetVal; /* Encoder return value */
+ uint8_t idx = 0;
+ uint8_t ret = ROK;
+ E2AP_PDU_t *e2apMsg = NULLP;
+ E2setupRequest_t *e2SetupReq = NULLP;
+ asn_enc_rval_t encRetVal; /* Encoder return value */
DU_LOG("\nE2AP : Building E2 Setup Request\n");
-
- DU_ALLOC(e2apMsg, sizeof(E2AP_PDU_t));
- if(e2apMsg == NULLP)
- {
- DU_LOG("\nE2AP : Memory allocation for E2AP-PDU failed");
- return RFAILED;
- }
-
- e2apMsg->present = E2AP_PDU_PR_initiatingMessage;
- DU_ALLOC(e2apMsg->choice.initiatingMessage, sizeof(InitiatingMessageE2_t));
- if(e2apMsg->choice.initiatingMessage == NULLP)
+ do
{
- DU_LOG("\nE2AP : Memory allocation for E2AP-PDU failed");
- DU_FREE(e2apMsg, sizeof(E2AP_PDU_t));
- return RFAILED;
- }
- e2apMsg->choice.initiatingMessage->criticality = CriticalityE2_reject;
- e2apMsg->choice.initiatingMessage->procedureCode = ProcedureCodeE2_id_E2setup;
- e2apMsg->choice.initiatingMessage->value.present = InitiatingMessageE2__value_PR_E2setupRequest;
-
- DU_ALLOC(e2SetupReq, sizeof(E2setupRequest_t));
- e2SetupReq = &e2apMsg->choice.initiatingMessage->value.choice.E2setupRequest;
-
- elementCnt = 1;
-
- e2SetupReq->protocolIEs.list.count = elementCnt;
- e2SetupReq->protocolIEs.list.size = elementCnt * sizeof(E2setupRequestIEs_t);
-
- /* Initialize the E2Setup members */
- DU_ALLOC(e2SetupReq->protocolIEs.list.array, \
- e2SetupReq->protocolIEs.list.size);
- if(e2SetupReq->protocolIEs.list.array == NULLP)
- {
- DU_LOG("\nE2AP : Memory allocation for E2RequestIEs failed");
- DU_FREE(e2apMsg->choice.initiatingMessage, sizeof(InitiatingMessageE2_t));
- DU_FREE(e2apMsg, (Size)sizeof(E2AP_PDU_t));
- return RFAILED;
- }
-
- for(idx=0; idx<elementCnt; idx++)
- {
- DU_ALLOC(e2SetupReq->protocolIEs.list.array[idx],\
- sizeof(E2setupRequestIEs_t));
- if(e2SetupReq->protocolIEs.list.array[idx] == NULLP)
+ DU_ALLOC(e2apMsg, sizeof(E2AP_PDU_t));
+ if(e2apMsg == NULLP)
{
- for(ieId=0; ieId<idx; ieId++)
- {
- DU_FREE(e2SetupReq->protocolIEs.list.array[ieId],\
- sizeof(E2setupRequestIEs_t));
- }
- DU_FREE(e2SetupReq->protocolIEs.list.array,\
- e2SetupReq->protocolIEs.list.size);
- DU_FREE(e2apMsg->choice.initiatingMessage, \
- sizeof(InitiatingMessageE2_t));
+ DU_LOG("\nE2AP : Memory allocation for E2AP-PDU failed");
+ break;
+ }
+ e2apMsg->present = E2AP_PDU_PR_initiatingMessage;
+ DU_ALLOC(e2apMsg->choice.initiatingMessage, sizeof(InitiatingMessageE2_t));
+ if(e2apMsg->choice.initiatingMessage == NULLP)
+ {
+ DU_LOG("\nE2AP : Memory allocation for E2AP-PDU failed");
DU_FREE(e2apMsg, sizeof(E2AP_PDU_t));
return RFAILED;
}
- }
-
- idx = 0;
- /* GlobalE2node_gNB_ID */
- e2SetupReq->protocolIEs.list.array[idx]->id = ProtocolIE_IDE2_id_GlobalE2node_ID;
- e2SetupReq->protocolIEs.list.array[idx]->criticality = CriticalityE2_reject;
- e2SetupReq->protocolIEs.list.array[idx]->value.present =\
- E2setupRequestIEs__value_PR_GlobalE2node_ID;
- e2SetupReq->protocolIEs.list.array[idx]->value.choice.GlobalE2node_ID.present = \
- GlobalE2node_ID_PR_gNB;
-
- GlobalE2node_gNB_ID_t *gNbId;
- DU_ALLOC(gNbId, sizeof(GlobalE2node_gNB_ID_t));
- BuildGlobalgNB(gNbId);
- e2SetupReq->protocolIEs.list.array[idx]->value.choice.GlobalE2node_ID.choice.gNB = gNbId;
+ e2apMsg->choice.initiatingMessage->criticality = CriticalityE2_reject;
+ e2apMsg->choice.initiatingMessage->procedureCode = ProcedureCodeE2_id_E2setup;
+ e2apMsg->choice.initiatingMessage->value.present = InitiatingMessageE2__value_PR_E2setupRequest;
+ e2SetupReq = &e2apMsg->choice.initiatingMessage->value.choice.E2setupRequest;
+
+ ret = fillE2SetupReq(&e2SetupReq, &idx);
+ if(ret != ROK)
+ {
+ DU_LOG("\nE2AP : fillE2SetupReq() failed");
+ break;
+ }
+ /* Prints the Msg formed */
+ xer_fprint(stdout, &asn_DEF_E2AP_PDU, e2apMsg);
+
+ cmMemset((U8 *)encBuf, 0, ENC_BUF_MAX_LEN);
+ encBufSize = 0;
+ encRetVal = aper_encode(&asn_DEF_E2AP_PDU, 0, e2apMsg, PrepFinalEncBuf,\
+ encBuf);
+ if(encRetVal.encoded == ENCODE_FAIL)
+ {
+ DU_LOG("\nE2AP : Could not encode E2SetupRequest structure (at %s)\n",\
+ encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+ break;
+ }
+ else
+ {
+ DU_LOG("\nE2AP : Created APER encoded buffer for E2SetupRequest\n");
+ for(int i=0; i< encBufSize; i++)
+ {
+ printf("%x",encBuf[i]);
+ }
+ }
+ if(SendE2APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+ {
+ DU_LOG("\nE2AP : Sending E2 Setup request failed");
+ }
- /* Prints the Msg formed */
- xer_fprint(stdout, &asn_DEF_E2AP_PDU, e2apMsg);
+ break;
+ }while(1);
+ deAllocateE2SetupReqMsg(e2apMsg, e2SetupReq, idx);
+ return ret;
+}/* End of BuildAndSendE2SetupReq */
- cmMemset((U8 *)encBuf, 0, ENC_BUF_MAX_LEN);
- encBufSize = 0;
- encRetVal = aper_encode(&asn_DEF_E2AP_PDU, 0, e2apMsg, PrepFinalEncBuf,\
- encBuf);
- if(encRetVal.encoded == ENCODE_FAIL)
- {
- DU_LOG("\nE2AP : Could not encode E2SetupRequest structure (at %s)\n",\
- encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
- return RFAILED;
- }
- else
- {
- DU_LOG("\nE2AP : Created APER encoded buffer for E2SetupRequest\n");
- for(int i=0; i< encBufSize; i++)
- {
- printf("%x",encBuf[i]);
- }
- }
+/*******************************************************************
+ *
+ * @brief De Allocate E2 Setup Request Message
+ *
+ * @details
+ *
+ * Function : deAllocateE2SetupReqMsg
+ *
+ * Functionality: De-Allocating E2 Setup request Message
+ *
+ * @params[in] E2AP_PDU_t *e2apMsg
+ * E2setupRequest_t *e2SetupReq
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
- if(SendE2APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+uint16_t deAllocateE2SetupReqMsg(E2AP_PDU_t *e2apMsg, \
+ E2setupRequest_t *e2SetupReq, uint8_t idx)
+{
+ uint8_t idx2;
+ uint8_t ret = ROK;
+ /* De-allocating Memory */
+ if(e2apMsg != NULLP)
{
- DU_LOG("\nE2AP : Sending E2 Setup request failed");
- return RFAILED;
+ if(e2apMsg->choice.initiatingMessage != NULLP)
+ {
+ if(e2SetupReq->protocolIEs.list.array != NULLP)
+ {
+ for(idx2 = 0; idx2 < idx; idx2++)
+ {
+ if(e2SetupReq->protocolIEs.list.array[idx2] != NULLP)
+ {
+ switch(e2SetupReq->protocolIEs.list.array[idx2]->id)
+ {
+ case ProtocolIE_IDE2_id_GlobalE2node_ID:
+ {
+ if(e2SetupReq->protocolIEs.list.array[idx2]->\
+ value.choice.GlobalE2node_ID.choice.gNB != NULLP)
+ {
+ GlobalE2node_gNB_ID_t *gNbId = NULLP;
+ gNbId = e2SetupReq->protocolIEs.list.array[idx2]->\
+ value.choice.GlobalE2node_ID.choice.gNB;
+ if(gNbId->global_gNB_ID.plmn_id.buf != NULLP)
+ {
+ if(gNbId->global_gNB_ID.gnb_id.choice.gnb_ID.buf != NULLP)
+ {
+ DU_FREE(gNbId->global_gNB_ID.gnb_id.choice.gnb_ID.buf,\
+ gNbId->global_gNB_ID.gnb_id.choice.gnb_ID.size);
+ }
+ DU_FREE(gNbId->global_gNB_ID.plmn_id.buf,\
+ gNbId->global_gNB_ID.plmn_id.size);
+ }
+ DU_FREE(e2SetupReq->protocolIEs.list.array[idx2]->value.\
+ choice.GlobalE2node_ID.choice.gNB, sizeof(GlobalE2node_gNB_ID_t));
+ }
+ DU_FREE(e2SetupReq->protocolIEs.list.array[idx2],\
+ sizeof(E2setupRequestIEs_t));
+ break;
+ }
+ default:
+ DU_LOG("\n E2AP: Invalid event at e2SetupRequet %ld ",\
+ (e2SetupReq->protocolIEs.list.array[idx2]->id));
+ break;
+ }
+ }
+ }
+ DU_FREE(e2SetupReq->protocolIEs.list.array, e2SetupReq->protocolIEs.list.size);
+ }
+ DU_FREE(e2apMsg->choice.initiatingMessage, sizeof(InitiatingMessageE2_t));
+ }
+ DU_FREE(e2apMsg, sizeof(E2AP_PDU_t));
}
-
- return ROK;
-}/* End of BuildAndSendE2SetupReq */
-
+ return ret;
+}
/*******************************************************************
*
* @brief Builds Ric Request Id
}E2apMsgDb;
S16 BuildAndSendE2SetupReq();
+uint16_t deAllocateE2SetupReqMsg(E2AP_PDU_t *e2apMsg, \
+ E2setupRequest_t *e2SetupReq, uint8_t idx);
S16 SendE2APMsg(Region , Pool );
void E2APMsgHdlr(Buffer *mBuf);
*timeDomRsrcAllocInfo->k0 = duPdschCfg.k0;
timeDomRsrcAllocInfo->mappingType = duPdschCfg.mapType;
- timeDomRsrcAllocInfo->startSymbolAndLength = duPdschCfg.startSymbAndLen;
+ timeDomRsrcAllocInfo->startSymbolAndLength = duPdschCfg.sliv;
break;
}
*timeDomRsrcAllocInfo->k2 = duPuschCfg.k2;
timeDomRsrcAllocInfo->mappingType = duPuschCfg.mapType;
- timeDomRsrcAllocInfo->startSymbolAndLength = duPuschCfg.startSymbAndLen;
+ timeDomRsrcAllocInfo->startSymbolAndLength = duPuschCfg.sliv;
/* Msg3 Delta Preamble */
DU_ALLOC(setup->msg3_DeltaPreamble, sizeof(long));