/* This file contains F1AP message handler functions */
#include "common_def.h"
+#include "du_tmr.h"
+#include "ckw.h"
+#include "ckw.x"
+#include "kwu.h"
+#include "kwu.x"
+#include "lkw.h"
#include "lrg.h"
#include "legtp.h"
#include "lkw.x"
#include "lrg.x"
#include "F1AP-PDU.h"
+#include "InitiatingMessage.h"
+#include "SuccessfulOutcome.h"
#include "du_app_mac_inf.h"
#include "du_cfg.h"
#include "du_app_rlc_inf.h"
+#include "du_e2ap_mgr.h"
+#include "du_e2ap_msg_hdl.h"
#include "du_mgr_main.h"
+#include "du_mgr.h"
#include "du_utils.h"
+#include "du_ue_mgr.h"
#include "RAT-Type.h"
+#include "NRFreqInfo.h"
+#include "NRCGI.h"
+#include "TDD-Info.h"
+#include "NR-Mode-Info.h"
+#include "ServedPLMNs-List.h"
+#include "GNB-DU-Served-Cells-List.h"
+#include "Served-Cell-Information.h"
+#include "ProtocolExtensionContainer.h"
+#include "RRC-Version.h"
+#include "FDD-Info.h"
+#include "FreqBandNrItem.h"
+#include "ServedPLMNs-Item.h"
+#include "GNB-DU-Served-Cells-Item.h"
+#include "SliceSupportItem.h"
#include "FeatureSetUplinkPerCC.h"
+#include "SliceSupportItem.h"
+#include "Served-Cells-To-Modify-Item.h"
+#include "Served-Cells-To-Delete-List.h"
+#include "Served-Cells-To-Delete-Item.h"
+#include "QoSInformation.h"
+#include "ULUPTNLInformation-ToBeSetup-List.h"
+#include "DRB-Information.h"
+#include "DRBs-ToBeSetup-Item.h"
+#include "DRBs-ToBeSetupMod-Item.h"
+#include "DRBs-ToBeModified-Item.h"
+#include "CUtoDURRCInformation.h"
+#include "SCell-ToBeSetup-List.h"
+#include "SRBs-ToBeSetup-List.h"
+#include "DRBs-ToBeSetup-List.h"
+#include "SRBs-ToBeSetup-Item.h"
+#include "DRBs-ToBeModified-List.h"
+#include "RRCContainer.h"
+#include "UE-CapabilityRAT-ContainerList.h"
+#include "DRBs-Setup-List.h"
+#include "CellGroupConfig.h"
+#include "ResetAll.h"
+#include "ResetType.h"
+#include "Cells-to-be-Activated-List.h"
+#include "GNB-CU-Name.h"
+#include "SRBs-SetupMod-List.h"
+#include "DRBs-SetupMod-List.h"
+#include "DRBs-ToBeSetupMod-List.h"
+#include "PagingCell-Item.h"
+#include "PagingCell-list.h"
+#include "QoS-Characteristics.h"
+#include "ULUPTNLInformation-ToBeSetup-Item.h"
+#include "Flows-Mapped-To-DRB-Item.h"
+#include "NonDynamic5QIDescriptor.h"
+#include "Dynamic5QIDescriptor.h"
#include "FeatureSetDownlinkPerCC.h"
#include "FeatureSets.h"
#include "UE-NR-Capability.h"
#include "DMRS-DownlinkConfig.h"
#include "PDSCH-Config.h"
#include "BWP-DownlinkDedicated.h"
+#include "BWP-Downlink.h"
#include "PUSCH-TimeDomainResourceAllocation.h"
#include "PUSCH-TimeDomainResourceAllocationList.h"
#include "DMRS-UplinkConfig.h"
#include "DLUPTNLInformation-ToBeSetup-Item.h"
#include "UPTransportLayerInformation.h"
#include "GTPTunnel.h"
+#include "SupportedSULFreqBandItem.h"
+#include "du_f1ap_conversions.h"
+#include "CNUEPagingIdentity.h"
+#include "PCCH-Config.h"
+#include "SCS-SpecificCarrier.h"
+#include "FrequencyInfoDL.h"
+#include "DownlinkConfigCommon.h"
+#include "FrequencyInfoUL.h"
+#include "UplinkConfigCommon.h"
+#include "TDD-UL-DL-ConfigCommon.h"
+#include "RACH-ConfigDedicated.h"
+#include "CFRA-SSB-Resource.h"
+#include "BWP-UplinkCommon.h"
+#include "ReconfigurationWithSync.h"
+#include "BCCH-DL-SCH-Message.h"
+#include "du_sys_info_hdl.h"
+#include "DRX-ConfigRrc.h"
+#include "MeasurementTimingConfigurationRrc.h"
+#include "MeasurementTimingConfigurationRrc-IEs.h"
+#include "MeasTimingList.h"
+#include "MeasTiming.h"
+#include "Cells-Status-List.h"
+#include "Cells-Status-Item.h"
#ifdef O1_ENABLE
-#include "ConfigInterface.h"
+#include "CmInterface.h"
extern StartupConfig g_cfg;
#endif
DuCfgParams duCfgParam;
-/************************************************************************
- *
- * @brief Converts enum values into actual value of Poll retransmit timer
- *
- * @details
- *
- * Function : getPollPdu
- *
- * Functionality: Converts enum values into actual value of poll
- * retransmit timer
- *
- * @params[in] Enum value of pollPdu
- * @return Actual value of pollPdu
- *
- * **********************************************************************/
-
-uint16_t getPollRetxTmr(uint8_t pollRetxTmrCfg)
-{
- uint16_t pollRetxTmr;
-
- /* All values of poll retx timer are at interval of 5ms.
- * This is valid upto 250ms
- * Hence converting the enum value to actual value by multiplying it to 5
- */
- if(pollRetxTmrCfg <= T_PollRetransmit_ms250)
- pollRetxTmr = (pollRetxTmrCfg + 1) * 5;
- else
- {
- switch(pollRetxTmrCfg)
- {
- case T_PollRetransmit_ms300:
- pollRetxTmr = 300;
- break;
- case T_PollRetransmit_ms350:
- pollRetxTmr = 350;
- break;
- case T_PollRetransmit_ms400:
- pollRetxTmr = 400;
- break;
- case T_PollRetransmit_ms450:
- pollRetxTmr = 450;
- break;
- case T_PollRetransmit_ms500:
- pollRetxTmr = 500;
- break;
- case T_PollRetransmit_ms800:
- pollRetxTmr = 800;
- break;
- default:
- DU_LOG("\nERROR --> F1AP: Invalid value of Poll Retransmit timer");
- pollRetxTmr = 0;
- }
- }
- return pollRetxTmr;
-}
-
-/*******************************************************************
- *
- * @brief Converts enum values into actual value of PollPdu
- *
- * @details
- *
- * Function : getPollPdu
- *
- * Functionality: Converts enum values into actual value of PollPdu
- *
- * @params[in] Enum value of pollPdu
- * @return Actual value of pollPdu
- *
- * ****************************************************************/
-int32_t getPollPdu(uint8_t pollPduCfg)
-{
- int32_t pollPdu;
- switch(pollPduCfg)
- {
- case PollPDU_p4:
- pollPdu = 4;
- break;
- case PollPDU_p8:
- pollPdu = 8;
- break;
- case PollPDU_p16:
- pollPdu = 16;
- break;
- case PollPDU_p32:
- pollPdu = 32;
- break;
- case PollPDU_p64:
- pollPdu = 64;
- break;
- case PollPDU_p128:
- pollPdu = 128;
- break;
- case PollPDU_p256:
- pollPdu = 256;
- break;
- case PollPDU_p512:
- pollPdu = 512;
- break;
- case PollPDU_p1024:
- pollPdu = 1024;
- break;
- case PollPDU_p2048:
- pollPdu = 2048;
- break;
- case PollPDU_p4096:
- pollPdu = 4096;
- break;
- case PollPDU_p6144:
- pollPdu = 6144;
- break;
- case PollPDU_p8192:
- pollPdu = 8192;
- break;
- case PollPDU_p12288:
- pollPdu = 12288;
- break;
- case PollPDU_p16384:
- pollPdu = 16384;
- break;
- case PollPDU_p20480:
- pollPdu = 20480;
- break;
- case PollPDU_p24576:
- pollPdu = 24576;
- break;
- case PollPDU_p28672:
- pollPdu = 28672;
- break;
- case PollPDU_p32768:
- pollPdu = 32768;
- break;
- case PollPDU_p40960:
- pollPdu = 40960;
- break;
- case PollPDU_p49152:
- pollPdu = 49152;
- break;
- case PollPDU_p57344:
- pollPdu = 57344;
- break;
- case PollPDU_p65536:
- pollPdu = 65536;
- break;
- case PollPDU_infinity:
- pollPdu = -1;
- break;
- default:
- DU_LOG("\nERROR --> F1AP: Invalid value of poll pdu");
- pollPdu = 0;
- break;
- }
- return pollPdu;
-}
-
-/*******************************************************************
- *
- * @brief Converts enum values into actual value of poll bytes
- *
- * @details
- *
- * Function : getPollByte
- *
- * Functionality: Converts enum values into actual value of pollBytes
- *
- * @params[in] Enum value
- * @return Actual value
- *
- * ****************************************************************/
-int32_t getPollByte(uint16_t pollBytesCfg)
-{
- int32_t pollBytes;
- switch(pollBytesCfg)
- {
- case PollByte_kB1:
- pollBytes = 1000;
- break;
- case PollByte_kB2:
- pollBytes = 2000;
- break;
- case PollByte_kB5:
- pollBytes = 5000;
- break;
- case PollByte_kB8:
- pollBytes = 8000;
- break;
- case PollByte_kB10:
- pollBytes = 10000;
- break;
- case PollByte_kB15:
- pollBytes = 15000;
- break;
- case PollByte_kB25:
- pollBytes = 25000;
- break;
- case PollByte_kB50:
- pollBytes = 50000;
- break;
- case PollByte_kB75:
- pollBytes = 75000;
- break;
- case PollByte_kB100:
- pollBytes = 100000;
- break;
- case PollByte_kB125:
- pollBytes = 125000;
- break;
- case PollByte_kB250:
- pollBytes = 250000;
- break;
- case PollByte_kB375:
- pollBytes = 375000;
- break;
- case PollByte_kB500:
- pollBytes = 500000;
- break;
- case PollByte_kB750:
- pollBytes = 750000;
- break;
- case PollByte_kB1000:
- pollBytes = 1000000;
- break;
- case PollByte_kB1250:
- pollBytes = 1250000;
- break;
- case PollByte_kB1500:
- pollBytes = 1500000;
- break;
- case PollByte_kB2000:
- pollBytes = 2000000;
- break;
- case PollByte_kB3000:
- pollBytes = 3000000;
- break;
- case PollByte_kB4000:
- pollBytes = 4000000;
- break;
- case PollByte_kB4500:
- pollBytes = 4500000;
- break;
- case PollByte_kB5000:
- pollBytes = 5000000;
- break;
- case PollByte_kB5500:
- pollBytes = 5500000;
- break;
- case PollByte_kB6000:
- pollBytes = 6000000;
- break;
- case PollByte_kB6500:
- pollBytes = 6500000;
- break;
- case PollByte_kB7000:
- pollBytes = 7000000;
- break;
- case PollByte_kB7500:
- pollBytes = 7500000;
- break;
- case PollByte_mB8:
- pollBytes = 8000000;
- break;
- case PollByte_mB9:
- pollBytes = 9000000;
- break;
- case PollByte_mB10:
- pollBytes = 10000000;
- break;
- case PollByte_mB11:
- pollBytes = 11000000;
- break;
- case PollByte_mB12:
- pollBytes = 12000000;
- break;
- case PollByte_mB13:
- pollBytes = 13000000;
- break;
- case PollByte_mB14:
- pollBytes = 14000000;
- break;
- case PollByte_mB15:
- pollBytes = 15000000;
- break;
- case PollByte_mB16:
- pollBytes = 16000000;
- break;
- case PollByte_mB17:
- pollBytes = 17000000;
- break;
- case PollByte_mB18:
- pollBytes = 18000000;
- break;
- case PollByte_mB20:
- pollBytes = 20000000;
- break;
- case PollByte_mB25:
- pollBytes = 25000000;
- break;
- case PollByte_mB30:
- pollBytes = 30000000;
- break;
- case PollByte_mB40:
- pollBytes = 40000000;
- break;
- case PollByte_infinity:
- pollBytes = -1;
- break;
- default:
- DU_LOG("\nERROR --> F1AP: Invalid value of poll bytes");
- pollBytes = 0;
- }
- return pollBytes;
-}
-
-/*******************************************************************
- *
- * @brief Converts enum values into actual value of maxRetx
- *
- * @details
- *
- * Function : getMaxRetx
- *
- * Functionality: Converts enum values into actual value of maxRetx
- *
- * @params[in] Enum value
- * @return Actual value
+/******************************************************************
*
- * ****************************************************************/
-uint8_t getMaxRetx(uint8_t maxRetxCfg)
-{
- uint8_t maxRetx;
- switch(maxRetxCfg)
- {
- case UL_AM_RLC__maxRetxThreshold_t1:
- maxRetx = 1;
- break;
- case UL_AM_RLC__maxRetxThreshold_t2:
- maxRetx = 2;
- break;
- case UL_AM_RLC__maxRetxThreshold_t3:
- maxRetx = 3;
- break;
- case UL_AM_RLC__maxRetxThreshold_t4:
- maxRetx = 4;
- break;
- case UL_AM_RLC__maxRetxThreshold_t6:
- maxRetx = 6;
- break;
- case UL_AM_RLC__maxRetxThreshold_t8:
- maxRetx = 8;
- break;
- case UL_AM_RLC__maxRetxThreshold_t16:
- maxRetx = 16;
- break;
- case UL_AM_RLC__maxRetxThreshold_t32:
- maxRetx = 32;
- break;
- default:
- DU_LOG("\nERROR --> F1AP: Invalid configuration for Max retransmission threshold");
- maxRetx = 0;
- }
- return maxRetx;
-}
-
-/*******************************************************************
- * @brief Converts enum values into actual value of reassembly timer
+ * @brief Function to fetch lcId based on DRB Id
*
* @details
*
- * Function : getReAsmblTmr
+ * Function : fetchLcId
*
- * Functionality: Converts enum values into actual value of reassembly
- * timer
+ * @params[in] drbId
*
- * @params[in] Enum value of reassembly timer
- * @return Actual value of reassembly timer
+ * Functionality: Function to fetch lcId based on DRB Id
*
- * **********************************************************************/
+ * Returns: lcId - SUCCESS
+ * RFAILED - FAILURE
+ *****************************************************************/
-int8_t getReAsmblTmr(uint8_t reAsmblTmrCfg)
+uint8_t fetchLcId(uint8_t drbId)
{
- int8_t reAsmblTmr = 0;
-
- if(reAsmblTmrCfg == T_Reassembly_ms0)
- {
- reAsmblTmr = 0;
- }
- else if(reAsmblTmrCfg >= T_Reassembly_ms5 || reAsmblTmrCfg <= T_Reassembly_ms100)
- {
- /* All values of re assembly timer are at interval of 5ms.
- * This is valid upto 100ms
- * Hence converting the enum value to actual value by multiplying it to 5
- */
- reAsmblTmr = reAsmblTmrCfg * 5;
- }
- else if(reAsmblTmrCfg >= T_Reassembly_ms110 || reAsmblTmrCfg <= T_Reassembly_ms200)
- {
- /* All values of re assembly timer are at interval of 10ms.
- * This is valid upto 200ms
- * since enum value starts from 20 for 100ms, subtracting 10 and
- * converting the enum value to actual value by multiplying it to 10
- */
- reAsmblTmr = ((reAsmblTmrCfg-10) * 10);
- }
- else
- {
- DU_LOG("\nERROR --> F1AP : Invalid value of Re Assembly timer %d", reAsmblTmrCfg);
- reAsmblTmr = -1;
- }
- return reAsmblTmr;
-}
-
-/************************************************************************
- *
- * @brief Converts enum values into actual value of status prohibit timer
- *
- * @details
- *
- * Function : getStatProhTmr
- *
- * Functionality: Converts enum values into actual value of status prohibit
- * timer
- *
- * @params[in] Enum value of status prohibit timer
- * @return Actual value of status prohibit timer
- *
- * **********************************************************************/
+ uint8_t cellIdx = 0, ueIdx = 0, lcIdx = 0, numLcs = 0, lcId = 0;
-int16_t getStatProhTmr(uint8_t statProhTmrCfg)
-{
- int16_t statProhTmr =0;
-
- if(statProhTmrCfg == T_StatusProhibit_ms0)
- {
- statProhTmr = 0;
- }
- else if(statProhTmrCfg >= T_StatusProhibit_ms5 || statProhTmrCfg <= T_StatusProhibit_ms250)
- {
- /* All values of re assembly timer are at interval of 5ms.
- * This is valid upto 250ms
- * Hence converting the enum value to actual value by multiplying it to 5
- */
- statProhTmr = statProhTmrCfg * 5;
- }
- else
+ for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++)
{
- switch(statProhTmrCfg)
+ for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
{
- case T_StatusProhibit_ms300:
- statProhTmr = 300;
- break;
- case T_StatusProhibit_ms350:
- statProhTmr = 350;
- break;
- case T_StatusProhibit_ms400:
- statProhTmr = 400;
- break;
- case T_StatusProhibit_ms450:
- statProhTmr = 450;
- break;
- case T_StatusProhibit_ms500:
- statProhTmr = 500;
- break;
- case T_StatusProhibit_ms800:
- statProhTmr = 800;
- break;
- case T_StatusProhibit_ms1000:
- statProhTmr = 1000;
- break;
- case T_StatusProhibit_ms1200:
- statProhTmr = 1200;
- break;
- case T_StatusProhibit_ms1600:
- statProhTmr = 1600;
- break;
- case T_StatusProhibit_ms2000:
- statProhTmr = 2000;
- break;
- case T_StatusProhibit_ms2400:
- statProhTmr = 2400;
- break;
- default:
- DU_LOG("\nInvalid value of Status Prohibit timer %d", statProhTmrCfg);
- statProhTmr = -1;
- break;
+ if(duCb.actvCellLst[cellIdx] != NULLP)
+ {
+ numLcs = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].duRlcUeCfg.numLcs;
+ for(lcIdx = 0; lcIdx < numLcs; lcIdx++)
+ {
+ if(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].duRlcUeCfg.rlcLcCfg[lcIdx].rlcBearerCfg.rbId == drbId && \
+ duCb.actvCellLst[cellIdx]->ueCb[ueIdx].duRlcUeCfg.rlcLcCfg[lcIdx].rlcBearerCfg.rbType == RB_TYPE_DRB)
+ {
+ lcId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].duRlcUeCfg.rlcLcCfg[lcIdx].rlcBearerCfg.lcId;
+ return lcId;
+ }
+ }
+ }
}
}
- return statProhTmr;
+ DU_LOG("\nERROR --> DU_APP: fetchLcId() failed for drbId %d", drbId);
+ return RFAILED;
}
/*******************************************************************
* RFAILED - failure
*
* ****************************************************************/
-
void addToReservedF1apPduList(uint8_t transId, F1AP_PDU_t *f1apPdu)
{
CmLList *node = NULLP;
return ROK;
}
-/*******************************************************************
- *
- * @brief Builds NRCell ID
- *
- * @details
- *
- * Function : BuildNrCellId
- *
- * Functionality: Building the NR Cell ID
- *
- * @params[in] BIT_STRING_t *nrcell
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-
-S16 BuildNrCellId(BIT_STRING_t *nrcell)
-{
- memset(nrcell->buf, 0, nrcell->size);
- nrcell->buf[4] = 16;
- nrcell->bits_unused = 4;
- return ROK;
-}
-
/*******************************************************************
*
* @brief Builds Nrcgi
{
return RFAILED;
}
- BuildNrCellId(&nrcgi->nRCellIdentity);
+ fillBitString(&nrcgi->nRCellIdentity, ODU_VALUE_FOUR, ODU_VALUE_FIVE, duCfgParam.sib1Params.cellIdentity);
return ROK;
}
servcell->fiveGS_TAC->buf[2] = duCfgParam.srvdCellLst[0].duCellInfo.tac;
return ROK;
}
+
/*******************************************************************
*
- * @brief Builds NR Mode
+ * @brief fill nr frequency information
*
* @details
*
- * Function : BuildNrMode
+ * Function : fillNrTddInfo
*
- * Functionality: Building the NR Mode
+ * Functionality: fill nr frequency information
*
- * @params[in] NR_Mode_Info_t *fdd
+ * @params[in] NRFreqInfo_t freqInfo
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildNrMode(NR_Mode_Info_t *mode)
+uint8_t fillNrTddInfo(TDD_Info_t *tddInfo)
{
- uint8_t BuildDLNRInforet=0;
- uint8_t BuildULNRInforet=0;
- /* FDD Mode */
- mode->present = NR_Mode_Info_PR_fDD;
- if(mode->present == NR_Mode_Info_PR_fDD)
+ uint8_t elementCnt = 1, freqBandListIdx = 0, supportedBandIdx = 0;
+ NRFreqInfo_t *freqInfo = NULLP;
+
+ if(tddInfo == NULLP)
{
- DU_ALLOC(mode->choice.fDD,sizeof(FDD_Info_t));
- if(mode->choice.fDD == NULLP)
+ DU_LOG("\nERROR --> DU APP : Null pointer received at fillNrTddInfo");
+ return RFAILED;
+ }
+
+ freqInfo = &tddInfo->nRFreqInfo;
+ freqInfo->nRARFCN = duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn;
+
+ freqInfo->freqBandListNr.list.count = elementCnt;
+ freqInfo->freqBandListNr.list.size = freqInfo->freqBandListNr.list.count * sizeof(FreqBandNrItem_t *);
+ DU_ALLOC(freqInfo->freqBandListNr.list.array, freqInfo->freqBandListNr.list.size );
+ if(!freqInfo->freqBandListNr.list.array)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed at fillNrTddInfo");
+ return RFAILED;
+ }
+
+ for(freqBandListIdx = 0; freqBandListIdx<freqInfo->freqBandListNr.list.count; freqBandListIdx++)
+ {
+ DU_ALLOC(freqInfo->freqBandListNr.list.array[freqBandListIdx], sizeof(FreqBandNrItem_t ));
+ if(!freqInfo->freqBandListNr.list.array[freqBandListIdx])
{
- return RFAILED;
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed at fillNrTddInfo");
+ return RFAILED;
}
- BuildULNRInforet = BuildULNRInfo(&mode->choice.fDD->uL_NRFreqInfo);
- if(BuildULNRInforet != ROK)
+
+ freqInfo->freqBandListNr.list.array[freqBandListIdx]->freqBandIndicatorNr = duCfgParam.srvdCellLst[0].duCellInfo.\
+ f1Mode.mode.tdd.nrFreqInfo.freqBand[0].nrFreqBand;
+
+ freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.count = elementCnt;
+ freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.size = freqInfo->freqBandListNr.list.array[freqBandListIdx]->\
+ supportedSULBandList.list.count * sizeof(SupportedSULFreqBandItem_t*);
+
+ DU_ALLOC(freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array,\
+ freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.size);
+ if(!freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array)
{
- return RFAILED;
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed at fillNrTddInfo");
+ return RFAILED;
}
- BuildDLNRInforet = BuildDLNRInfo(&mode->choice.fDD->dL_NRFreqInfo);
- if(BuildDLNRInforet != ROK)
+
+ for(supportedBandIdx = 0; supportedBandIdx<freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.count; supportedBandIdx++)
{
- return RFAILED;
+ DU_ALLOC(freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array[supportedBandIdx],\
+ sizeof(SupportedSULFreqBandItem_t));
+ if(!freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array[supportedBandIdx])
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed at fillNrTddInfo");
+ return RFAILED;
+ }
+
+ freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array[supportedBandIdx]->freqBandIndicatorNr =\
+ duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[0].sulBand[0];
}
}
- mode->choice.fDD->uL_Transmission_Bandwidth.nRSCS = \
- duCfgParam.srvdCellLst[0].duCellInfo.\
- f1Mode.mode.fdd.ulTxBw.nrScs;
- mode->choice.fDD->uL_Transmission_Bandwidth.nRNRB = \
- duCfgParam.srvdCellLst[0].duCellInfo.\
- f1Mode.mode.fdd.ulTxBw.nrb;
- mode->choice.fDD->dL_Transmission_Bandwidth.nRSCS = \
- duCfgParam.srvdCellLst[0].duCellInfo.\
- f1Mode.mode.fdd.dlTxBw.nrScs;
- mode->choice.fDD->dL_Transmission_Bandwidth.nRNRB = \
- duCfgParam.srvdCellLst[0].duCellInfo.\
- f1Mode.mode.fdd.dlTxBw.nrb;
+
+ tddInfo->transmission_Bandwidth.nRSCS = duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs;
+ tddInfo->transmission_Bandwidth.nRNRB = duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb;
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds NR Mode
+ *
+ * @details
+ *
+ * Function : BuildNrMode
+ *
+ * Functionality: Building the NR Mode
+ *
+ * @params[in] NR_Mode_Info_t *fdd
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildNrMode(NR_Mode_Info_t *mode)
+{
+ uint8_t BuildDLNRInforet=0;
+ uint8_t BuildULNRInforet=0;
+
+#ifdef NR_TDD
+ mode->present = NR_Mode_Info_PR_tDD;
+#else
+ mode->present = NR_Mode_Info_PR_fDD;
+#endif
+
+ if(mode->present == NR_Mode_Info_PR_fDD)
+ {
+ DU_ALLOC(mode->choice.fDD,sizeof(FDD_Info_t));
+ if(mode->choice.fDD == NULLP)
+ {
+ DU_LOG("\nERROR --> Memory allocation failed in BuildNrMode");
+ return RFAILED;
+ }
+ BuildULNRInforet = BuildULNRInfo(&mode->choice.fDD->uL_NRFreqInfo);
+ if(BuildULNRInforet != ROK)
+ {
+ DU_LOG("\nERROR --> Failed to build UlNrFreqInfo");
+ return RFAILED;
+ }
+ BuildDLNRInforet = BuildDLNRInfo(&mode->choice.fDD->dL_NRFreqInfo);
+ if(BuildDLNRInforet != ROK)
+ {
+ DU_LOG("\nERROR --> Failed to build DlNrFreqInfo");
+ return RFAILED;
+ }
+ mode->choice.fDD->uL_Transmission_Bandwidth.nRSCS = \
+ duCfgParam.srvdCellLst[0].duCellInfo.\
+ f1Mode.mode.fdd.ulTxBw.nrScs;
+ mode->choice.fDD->uL_Transmission_Bandwidth.nRNRB = \
+ duCfgParam.srvdCellLst[0].duCellInfo.\
+ f1Mode.mode.fdd.ulTxBw.nrb;
+ mode->choice.fDD->dL_Transmission_Bandwidth.nRSCS = \
+ duCfgParam.srvdCellLst[0].duCellInfo.\
+ f1Mode.mode.fdd.dlTxBw.nrScs;
+ mode->choice.fDD->dL_Transmission_Bandwidth.nRNRB = \
+ duCfgParam.srvdCellLst[0].duCellInfo.\
+ f1Mode.mode.fdd.dlTxBw.nrb;
+ }
+ else if(mode->present == NR_Mode_Info_PR_tDD)
+ {
+ DU_ALLOC(mode->choice.tDD,sizeof(TDD_Info_t));
+ if(mode->choice.tDD == NULLP)
+ {
+ DU_LOG("\nERROR --> Memory allocation failed in BuildNrMode");
+ return RFAILED;
+ }
+
+ if(fillNrTddInfo(mode->choice.tDD) != ROK)
+ {
+ DU_LOG("\nERROR --> Failed to fill Nr TDD information");
+ return RFAILED;
+ }
+
+ }
+
return ROK;
}
/*******************************************************************
}
return ROK;
}
+
+/*******************************************************************
+ *
+ * @brief Frees Measurement Timing configuration
+ *
+ * @details
+ *
+ * Function : FreeMeasTimingConf
+ *
+ * Functionality: Frees Timing Configuration
+ *
+ * @params[in] MeasurementTimingConfigurationRrc_t measTimingConfRrc
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+void FreeMeasTimingConf(MeasurementTimingConfigurationRrc_t measTimingConfRrc)
+{
+ uint8_t measIeIdx = 0;
+ MeasurementTimingConfigurationRrc_IEs_t *measTimingConfIEs = NULLP;
+
+ if(measTimingConfRrc.criticalExtensions.choice.c1)
+ {
+ if(measTimingConfRrc.criticalExtensions.choice.c1->choice.measTimingConf)
+ {
+ measTimingConfIEs = measTimingConfRrc.criticalExtensions.choice.c1->choice.measTimingConf;
+ if(measTimingConfIEs->measTiming)
+ {
+ if(measTimingConfIEs->measTiming->list.array)
+ {
+ for(measIeIdx = 0; measIeIdx < measTimingConfIEs->measTiming->list.count; measIeIdx++)
+ {
+ if(measTimingConfIEs->measTiming->list.array[measIeIdx])
+ {
+ DU_FREE(measTimingConfIEs->measTiming->list.array[measIeIdx]->frequencyAndTiming, sizeof(struct MeasTiming__frequencyAndTiming));
+ DU_FREE(measTimingConfIEs->measTiming->list.array[measIeIdx], sizeof(MeasTiming_t));
+ }
+ }
+ DU_FREE(measTimingConfIEs->measTiming->list.array, measTimingConfIEs->measTiming->list.size);
+ }
+ DU_FREE(measTimingConfIEs->measTiming, sizeof(MeasTimingList_t));
+ }
+ DU_FREE(measTimingConfRrc.criticalExtensions.choice.c1->choice.measTimingConf, sizeof(MeasurementTimingConfigurationRrc_IEs_t));
+ }
+ DU_FREE(measTimingConfRrc.criticalExtensions.choice.c1, sizeof(struct MeasurementTimingConfigurationRrc__criticalExtensions__c1));
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Builds MEasuerment Timing Configuration
+ *
+ * @details
+ *
+ * Function : BuildMeasTimingConf
+ *
+ * Functionality: Building Measurement Timing Configuration
+ *
+ * @params[in] Pointer to octet string to store Measurement timing
+ * Configuration
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildMeasTimingConf(OCTET_STRING_t *measTimingConf)
+{
+ uint8_t ret = RFAILED;
+ uint8_t elementCnt = 0;
+ uint8_t measIeIdx = 0;
+ asn_enc_rval_t encRetVal;
+ MeasurementTimingConfigurationRrc_t measTimingConfRrc;
+ MeasurementTimingConfigurationRrc_IEs_t *measTimingConfIEs = NULLP;
+ struct MeasTiming__frequencyAndTiming *freqAndTiming = NULLP;
+
+ while(true)
+ {
+ measTimingConfRrc.criticalExtensions.present = MeasurementTimingConfigurationRrc__criticalExtensions_PR_c1;
+ DU_ALLOC(measTimingConfRrc.criticalExtensions.choice.c1, sizeof(struct MeasurementTimingConfigurationRrc__criticalExtensions__c1));
+ if(!measTimingConfRrc.criticalExtensions.choice.c1)
+ {
+ DU_LOG("ERROR --> DU_APP : BuildMeasTimingConf(): Memory allocation failure for critical extension choice C1");
+ break;
+ }
+ measTimingConfRrc.criticalExtensions.choice.c1->present = MeasurementTimingConfigurationRrc__criticalExtensions__c1_PR_measTimingConf;
+
+ DU_ALLOC(measTimingConfRrc.criticalExtensions.choice.c1->choice.measTimingConf, sizeof(MeasurementTimingConfigurationRrc_IEs_t));
+ if(!measTimingConfRrc.criticalExtensions.choice.c1->choice.measTimingConf)
+ {
+ DU_LOG("ERROR --> DU_APP : BuildMeasTimingConf(): Memory allocation failure for measTimingConf");
+ break;
+ }
+ measTimingConfIEs = measTimingConfRrc.criticalExtensions.choice.c1->choice.measTimingConf;
+
+ DU_ALLOC(measTimingConfIEs->measTiming, sizeof(MeasTimingList_t));
+ if(!measTimingConfIEs->measTiming)
+ {
+ DU_LOG("ERROR --> DU_APP : BuildMeasTimingConf(): Memory allocation failure for MeasTimingList");
+ break;
+ }
+
+ elementCnt = 1;
+ measTimingConfIEs->measTiming->list.count = elementCnt;
+ measTimingConfIEs->measTiming->list.size = elementCnt * sizeof(MeasTiming_t *);
+ DU_ALLOC(measTimingConfIEs->measTiming->list.array, measTimingConfIEs->measTiming->list.size);
+ if(!measTimingConfIEs->measTiming->list.array)
+ {
+ DU_LOG("ERROR --> DU_APP : BuildMeasTimingConf(): Memory allocation failure for MeasTimingList array");
+ break;
+ }
+
+ for(measIeIdx = 0; measIeIdx < elementCnt; measIeIdx++)
+ {
+ DU_ALLOC(measTimingConfIEs->measTiming->list.array[measIeIdx], sizeof(MeasTiming_t));
+ if(!measTimingConfIEs->measTiming->list.array[measIeIdx])
+ {
+ DU_LOG("ERROR --> DU_APP : BuildMeasTimingConf(): Memory allocation failure for MeasTimingList array index %d", measIeIdx);
+ break;
+ }
+ }
+ if(measIeIdx < elementCnt)
+ {
+ break;
+ }
+
+ measIeIdx = 0;
+ DU_ALLOC(measTimingConfIEs->measTiming->list.array[measIeIdx]->frequencyAndTiming, sizeof(struct MeasTiming__frequencyAndTiming));
+ if(!measTimingConfIEs->measTiming->list.array[measIeIdx]->frequencyAndTiming)
+ {
+ DU_LOG("ERROR --> DU_APP : BuildMeasTimingConf(): Memory allocation failure for frequencyAndTiming");
+ break;
+ }
+ freqAndTiming = measTimingConfIEs->measTiming->list.array[measIeIdx]->frequencyAndTiming;
+ freqAndTiming->carrierFreq = MEAS_TIMING_ARFCN;
+ freqAndTiming->ssbSubcarrierSpacing = duCfgParam.macCellCfg.ssbCfg.scsCmn;
+ freqAndTiming->ssb_MeasurementTimingConfiguration.periodicityAndOffset.present = duCfgParam.macCellCfg.ssbCfg.ssbPeriod + 1;
+ freqAndTiming->ssb_MeasurementTimingConfiguration.periodicityAndOffset.choice.sf20 = duCfgParam.macCellCfg.ssbCfg.ssbScOffset;
+ freqAndTiming->ssb_MeasurementTimingConfiguration.duration = duCfgParam.srvdCellLst[0].duCellInfo.measTimeCfgDuration;
+
+ /* Encode the F1SetupRequest type as APER */
+ xer_fprint(stdout, &asn_DEF_MeasurementTimingConfigurationRrc, &measTimingConfRrc);
+
+ memset(encBuf, 0, ENC_BUF_MAX_LEN);
+ encBufSize = 0;
+ encRetVal = uper_encode(&asn_DEF_MeasurementTimingConfigurationRrc, 0, &measTimingConfRrc, PrepFinalEncBuf, encBuf);
+
+ /* Encode results */
+ if(encRetVal.encoded == ENCODE_FAIL)
+ {
+ DU_LOG("\nERROR --> F1AP : Could not encode Measurement Timing Configuration structure (at %s)\n",\
+ encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+ break;
+ }
+ else
+ {
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for Measurement Timing Configuration \n");
+#ifdef DEBUG_ASN_PRINT
+ for(measIeIdx=0; measIeIdx< encBufSize; measIeIdx++)
+ {
+ printf("%x",encBuf[measIeIdx]);
+ }
+#endif
+
+ measTimingConf->size = encBufSize;
+ DU_ALLOC(measTimingConf->buf, encBufSize);
+ if(measTimingConf->buf == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed for MeasurementTimingConfiguration buffer");
+ return RFAILED;
+ }
+ memcpy(measTimingConf->buf, &encBuf, encBufSize);
+
+ FreeMeasTimingConf(measTimingConfRrc);
+
+ ret = ROK;
+ break;
+ }
+ }
+ return ret;
+}
+
/*******************************************************************
*
* @brief Builds Served Cell List
for(plmnidx=0; plmnidx<plmnCnt; plmnidx++)
{
DU_ALLOC(duServedCell->list.array[plmnidx],\
- sizeof(GNB_DU_Served_Cells_ItemIEs_t));
+ sizeof(GNB_DU_Served_Cells_ItemIEs_t));
if(duServedCell->list.array[plmnidx] == NULLP)
{
- return RFAILED;
+ return RFAILED;
}
}
idx = 0;
duServedCell->list.array[idx]->id = ProtocolIE_ID_id_GNB_DU_Served_Cells_Item;
duServedCell->list.array[idx]->criticality = Criticality_reject;
duServedCell->list.array[idx]->value.present = \
- GNB_DU_Served_Cells_ItemIEs__value_PR_GNB_DU_Served_Cells_Item;
+ GNB_DU_Served_Cells_ItemIEs__value_PR_GNB_DU_Served_Cells_Item;
srvCellItem = \
- &duServedCell->list.array[idx]->value.choice.GNB_DU_Served_Cells_Item;
+ &duServedCell->list.array[idx]->value.choice.GNB_DU_Served_Cells_Item;
/*nRCGI*/
BuildNrcgiret = BuildNrcgi(&srvCellItem->served_Cell_Information.nRCGI);
if(BuildNrcgiret != ROK)
}
/*nRPCI*/
srvCellItem->served_Cell_Information.nRPCI = \
- duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrPci;
+ duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrPci;
- /*fiveGS_TAC*/
+ /* fiveGS_TAC */
BuildFiveGSTacret = BuildFiveGSTac(&srvCellItem->served_Cell_Information);
if(BuildFiveGSTacret != ROK)
{
return RFAILED;
}
- /*Served PLMNs*/
+
+ /* Served PLMNs */
BuildServedPlmnret = BuildServedPlmn(&srvCellItem->served_Cell_Information.servedPLMNs);
if(BuildServedPlmnret !=ROK)
{
return RFAILED;
}
- /*nR Mode Info with FDD*/
+
+ /* nR Mode Info with FDD/TDD */
BuildNrModeret = BuildNrMode(&srvCellItem->served_Cell_Information.nR_Mode_Info);
if(BuildNrModeret != ROK)
{
return RFAILED;
}
+
/*Measurement timing Config*/
- srvCellItem->served_Cell_Information.measurementTimingConfiguration.\
- size = sizeof(uint8_t);
- DU_ALLOC(srvCellItem->served_Cell_Information.\
- measurementTimingConfiguration.buf,srvCellItem->served_Cell_Information.measurementTimingConfiguration.size);
- if(srvCellItem->served_Cell_Information.\
- measurementTimingConfiguration.buf == NULLP)
- {
+ if(BuildMeasTimingConf(&srvCellItem->served_Cell_Information.measurementTimingConfiguration) != ROK)
return RFAILED;
- }
- srvCellItem->served_Cell_Information.measurementTimingConfiguration.buf[0] = \
- duCfgParam.srvdCellLst[0].duCellInfo.measTimeCfg;
/* GNB DU System Information */
DU_ALLOC(srvCellItem->gNB_DU_System_Information,
- sizeof(GNB_DU_System_Information_t));
+ sizeof(GNB_DU_System_Information_t));
if(!srvCellItem->gNB_DU_System_Information)
{
return RFAILED;
/* MIB */
srvCellItem->gNB_DU_System_Information->mIB_message.size = duCfgParam.srvdCellLst[0].duSysInfo.mibLen;
DU_ALLOC(srvCellItem->gNB_DU_System_Information->mIB_message.buf,
- srvCellItem->gNB_DU_System_Information->mIB_message.size);
+ srvCellItem->gNB_DU_System_Information->mIB_message.size);
if(!srvCellItem->gNB_DU_System_Information->mIB_message.buf)
{
return RFAILED;
}
memcpy(srvCellItem->gNB_DU_System_Information->mIB_message.buf, duCfgParam.srvdCellLst[0].duSysInfo.mibMsg, \
- srvCellItem->gNB_DU_System_Information->mIB_message.size);
+ srvCellItem->gNB_DU_System_Information->mIB_message.size);
/* SIB1 */
srvCellItem->gNB_DU_System_Information->sIB1_message.size =\
- duCfgParam.srvdCellLst[0].duSysInfo.sib1Len;
+ duCfgParam.srvdCellLst[0].duSysInfo.sib1Len;
DU_ALLOC(srvCellItem->gNB_DU_System_Information->sIB1_message.buf,
- srvCellItem->gNB_DU_System_Information->sIB1_message.size);
+ srvCellItem->gNB_DU_System_Information->sIB1_message.size);
if(!srvCellItem->gNB_DU_System_Information->sIB1_message.buf)
{
return RFAILED;
for(int x=0; x<srvCellItem->gNB_DU_System_Information->sIB1_message.size; x++)
{
srvCellItem->gNB_DU_System_Information->sIB1_message.buf[x]=\
- duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg[x];
+ duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg[x];
}
return ROK;
}
DU_FREE(rrcVer->latest_RRC_Version.buf,rrcVer->latest_RRC_Version.size);
}
}
+
+/*******************************************************************
+ *
+ * @brief Deallocating memory of TDD NrFreqInfo
+ *
+ * @details
+ *
+ * Function : freeTddNrFreqInfo
+ *
+ * Functionality: freeTddNrFreqInfo
+ *
+ * @params[in] F1AP_PDU_t *f1apDuCfg
+ *
+ * @return ROK - void
+ *
+ * ****************************************************************/
+void freeTddNrFreqInfo(NRFreqInfo_t *freqInfo)
+{
+ uint8_t freqBandListIdx = 0, supportedBandIdx = 0;
+
+ if(freqInfo->freqBandListNr.list.array)
+ {
+ for(freqBandListIdx = 0; freqBandListIdx<freqInfo->freqBandListNr.list.count; freqBandListIdx++)
+ {
+ if(freqInfo->freqBandListNr.list.array[freqBandListIdx])
+ {
+ if(freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array)
+ {
+ for(supportedBandIdx = 0; supportedBandIdx<freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.count; supportedBandIdx++)
+ {
+ DU_FREE(freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array[supportedBandIdx],\
+ sizeof(SupportedSULFreqBandItem_t));
+ }
+ DU_FREE(freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array,\
+ freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.size);
+
+ }
+ DU_FREE(freqInfo->freqBandListNr.list.array[freqBandListIdx], sizeof(FreqBandNrItem_t ));
+ }
+ }
+ DU_FREE(freqInfo->freqBandListNr.list.array, freqInfo->freqBandListNr.list.size );
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Deallocating memory allocated for Nr fdd frequencey mode
+ *
+ * @details
+ *
+ * Function : freeFddNrFreqInfo
+ *
+ * Functionality:Free memory allocated for Nr fdd frequencey mode
+ *
+ * @params[in]
+ *
+ * @return ROK - void
+ *
+ * ****************************************************************/
+void freeFddNrFreqInfo(FDD_Info_t *fDD)
+{
+ uint8_t arrIdx =0;
+
+ if(fDD != NULLP)
+ {
+ if(fDD->uL_NRFreqInfo.freqBandListNr.list.array != NULLP)
+ {
+ DU_FREE(fDD->uL_NRFreqInfo.freqBandListNr.list.\
+ array[arrIdx], sizeof(FreqBandNrItem_t));
+ DU_FREE(fDD->uL_NRFreqInfo.freqBandListNr.list.array, \
+ fDD->uL_NRFreqInfo.freqBandListNr.list.size);
+ }
+
+ if(fDD->dL_NRFreqInfo.freqBandListNr.list.array != NULLP)
+ {
+ DU_FREE(fDD->dL_NRFreqInfo.freqBandListNr.list.\
+ array[arrIdx], sizeof(FreqBandNrItem_t));
+ DU_FREE(fDD->dL_NRFreqInfo.freqBandListNr.list.array,\
+ fDD->dL_NRFreqInfo.freqBandListNr.list.size);
+ }
+ DU_FREE(fDD,sizeof(FDD_Info_t));
+ }
+}
+
/*******************************************************************
*
* @brief deallocating the memory of function BuildAndSendF1SetupReq()
* ****************************************************************/
void FreeServedCellList( GNB_DU_Served_Cells_List_t *duServedCell)
{
- uint8_t plmnCnt=MAX_PLMN;
+ uint8_t plmnCnt= 1;
uint8_t extensionCnt=IE_EXTENSION_LIST_COUNT;
uint8_t plmnIdx=0, sliceIdx=0;
GNB_DU_Served_Cells_Item_t *srvCellItem;
if(servedPlmnItem->iE_Extensions->list.array[0] != NULLP)
{
if(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
- SliceSupportList.list.array != NULLP)
+ SliceSupportList.list.array != NULLP)
{
for(sliceIdx =0; sliceIdx<servedPlmnItem->iE_Extensions->list.array[0]->\
- extensionValue.choice.SliceSupportList.list.count; sliceIdx++)
+ extensionValue.choice.SliceSupportList.list.count; sliceIdx++)
{
if(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
- SliceSupportList.list.array[sliceIdx] != NULLP)
+ SliceSupportList.list.array[sliceIdx] != NULLP)
{
sliceSupportItem = servedPlmnItem->iE_Extensions->list.array[0]->\
- extensionValue.choice.SliceSupportList.list.array[sliceIdx];
+ extensionValue.choice.SliceSupportList.list.array[sliceIdx];
DU_FREE(sliceSupportItem->sNSSAI.sST.buf, sizeof(uint8_t));
if(sliceSupportItem->sNSSAI.sD != NULLP)
{
DU_FREE(sliceSupportItem->sNSSAI.sD->buf,\
- sliceSupportItem->sNSSAI.sD->size);
+ 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[sliceIdx], sizeof(SliceSupportItem_t));
+ choice.SliceSupportList.list.array[sliceIdx], sizeof(SliceSupportItem_t));
}
}
DU_FREE(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
- SliceSupportList.list.array, servedPlmnItem->iE_Extensions->list.array[0]->\
- extensionValue.choice.SliceSupportList.list.size);
+ SliceSupportList.list.array, servedPlmnItem->iE_Extensions->list.array[0]->\
+ extensionValue.choice.SliceSupportList.list.size);
}
DU_FREE(servedPlmnItem->iE_Extensions->list.array[0],\
- sizeof(ServedPLMNs_ItemExtIEs_t));
+ sizeof(ServedPLMNs_ItemExtIEs_t));
}
DU_FREE(servedPlmnItem->iE_Extensions->list.array,\
- extensionCnt*sizeof(ServedPLMNs_ItemExtIEs_t*));
+ 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));
+ sizeof(ServedPLMNs_Item_t));
}
DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array,\
- sizeof(ServedPLMNs_Item_t *));
+ sizeof(ServedPLMNs_Item_t *));
}
- if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD != NULLP)
+ if(srvCellItem->served_Cell_Information.nR_Mode_Info.present == NR_Mode_Info_PR_fDD)
{
- 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*));
- }
-
- if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
- freqBandListNr.list.array)
+ freeFddNrFreqInfo(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD);
+ }
+ else
+ {
+ if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.tDD != NULLP)
{
- DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
- freqBandListNr.list.array[0],sizeof(FreqBandNrItem_t));
- DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
- freqBandListNr.list.array,sizeof(FreqBandNrItem_t *));
+ freeTddNrFreqInfo(&srvCellItem->served_Cell_Information.nR_Mode_Info.choice.tDD->nRFreqInfo);
+ DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.tDD, sizeof(TDD_Info_t));
}
- DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD, sizeof(FDD_Info_t));
}
-
+
DU_FREE(srvCellItem->served_Cell_Information.measurementTimingConfiguration.buf,\
srvCellItem->served_Cell_Information.measurementTimingConfiguration.size);
{
if(f1apMsg->choice.initiatingMessage != NULLP)
{
- f1SetupReq = &f1apMsg->choice.initiatingMessage->value.choice.F1SetupRequest;
- if(f1SetupReq->protocolIEs.list.array != NULLP)
- {
- for(ieIdx = 0; ieIdx < f1SetupReq->protocolIEs.list.count; ieIdx++)
- {
- if(f1SetupReq->protocolIEs.list.array[ieIdx] != NULLP)
- {
- switch(f1SetupReq->protocolIEs.list.array[ieIdx]->id)
- {
- case ProtocolIE_ID_id_TransactionID:
- break;
- case ProtocolIE_ID_id_gNB_DU_ID:
- DU_FREE(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf,\
- f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
- break;
- case ProtocolIE_ID_id_gNB_DU_Name:
- DU_FREE(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.buf,\
- strlen((char *)duCfgParam.duName));
- break;
- case ProtocolIE_ID_id_gNB_DU_Served_Cells_List:
- FreeServedCellList(&f1SetupReq->protocolIEs.list.\
- array[ieIdx]->value.choice.GNB_DU_Served_Cells_List);
- break;
- case ProtocolIE_ID_id_GNB_DU_RRC_Version:
- FreeRrcVer(&f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.RRC_Version);
- break;
- default:
- DU_LOG("\nERROR --> Invalid Event Type %ld", f1SetupReq->protocolIEs.list.array[ieIdx]->id);
- break;
- }
- }
- }
- for(ieIdx2=0; ieIdx2< ieIdx; ieIdx2++)
- {
- DU_FREE(f1SetupReq->protocolIEs.list.array[ieIdx2],sizeof(F1SetupRequestIEs_t));
- }
- DU_FREE(f1SetupReq->protocolIEs.list.array,\
- f1SetupReq->protocolIEs.list.size);
- }
- DU_FREE(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
+ f1SetupReq = &f1apMsg->choice.initiatingMessage->value.choice.F1SetupRequest;
+ if(f1SetupReq->protocolIEs.list.array != NULLP)
+ {
+ for(ieIdx = 0; ieIdx < f1SetupReq->protocolIEs.list.count; ieIdx++)
+ {
+ if(f1SetupReq->protocolIEs.list.array[ieIdx] != NULLP)
+ {
+ switch(f1SetupReq->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_ID_id_TransactionID:
+ break;
+ case ProtocolIE_ID_id_gNB_DU_ID:
+ DU_FREE(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf,\
+ f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
+ break;
+ case ProtocolIE_ID_id_gNB_DU_Name:
+ DU_FREE(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.buf,\
+ strlen((char *)duCfgParam.duName));
+ break;
+ case ProtocolIE_ID_id_gNB_DU_Served_Cells_List:
+ FreeServedCellList(&f1SetupReq->protocolIEs.list.\
+ array[ieIdx]->value.choice.GNB_DU_Served_Cells_List);
+ break;
+ case ProtocolIE_ID_id_GNB_DU_RRC_Version:
+ FreeRrcVer(&f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.RRC_Version);
+ break;
+ default:
+ DU_LOG("\nERROR --> Invalid Event Type %ld", f1SetupReq->protocolIEs.list.array[ieIdx]->id);
+ break;
+ }
+ }
+ }
+ for(ieIdx2=0; ieIdx2< ieIdx; ieIdx2++)
+ {
+ DU_FREE(f1SetupReq->protocolIEs.list.array[ieIdx2],sizeof(F1SetupRequestIEs_t));
+ }
+ DU_FREE(f1SetupReq->protocolIEs.list.array,\
+ f1SetupReq->protocolIEs.list.size);
+ }
+ DU_FREE(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
}
DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
}
}
+
/*******************************************************************
*
- * @brief Builds and Send the F1SetupRequest
+ * @brief add or modify E2NodeComponent list
*
* @details
*
- * Function : BuildAndSendF1SetupReq
+ * Function : addOrModifyE2NodeComponent
*
- * Functionality:Fills the F1SetupRequest
+ * Functionality: add or modify E2NodeComponent list
*
+ * @parameter uint8_t componentactiontype, bool reqPart, uint8_t bufSize, char *bufString
* @return ROK - success
* RFAILED - failure
*
******************************************************************/
-uint8_t BuildAndSendF1SetupReq()
+uint8_t addOrModifyE2NodeComponent(uint8_t action, bool reqPart, uint8_t bufSize, char *bufString)
{
- uint8_t ret, ieIdx, elementCnt;
- F1AP_PDU_t *f1apMsg = NULLP;
- F1SetupRequest_t *f1SetupReq=NULLP;
- GNB_DU_Served_Cells_List_t *duServedCell=NULLP;
- RRC_Version_t *rrcVer=NULLP;
+ E2NodeComponent *e2NodeComponentInfo;
+ CmLList *node = NULLP;
+
+ if(action == E2_NODE_COMPONENT_ADD)
+ {
+ if(reqPart == true)
+ {
+ DU_ALLOC(e2NodeComponentInfo, sizeof(E2NodeComponent));
+ if(!e2NodeComponentInfo)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed for e2NodeComponentInfo in %s",__func__);
+ return RFAILED;
+ }
+ e2NodeComponentInfo->interfaceType =F1;
+ e2NodeComponentInfo->componentId=duCfgParam.duId;
+ e2NodeComponentInfo->componentActionType = action;
+ e2NodeComponentInfo->reqBufSize = bufSize;
+
+ DU_ALLOC(e2NodeComponentInfo->componentRequestPart, bufSize);
+ if(e2NodeComponentInfo->componentRequestPart == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed for componentRequestPart");
+ DU_FREE(e2NodeComponentInfo, sizeof(E2NodeComponent));
+ return RFAILED;
+ }
+ memcpy(e2NodeComponentInfo->componentRequestPart, bufString, e2NodeComponentInfo->reqBufSize);
+ DU_ALLOC(node, sizeof(CmLList));
+ if(node)
+ {
+ node->node = (PTR) e2NodeComponentInfo;
+ cmLListAdd2Tail(&duCb.e2apDb.e2NodeComponentList, node);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed for e2NodeComponentList node");
+ DU_FREE(e2NodeComponentInfo->componentRequestPart, bufSize);
+ DU_FREE(e2NodeComponentInfo, sizeof(E2NodeComponent));
+ return RFAILED;
+ }
+ }
+ else
+ {
+ if(duCb.e2apDb.e2NodeComponentList.count)
+ {
+ CM_LLIST_FIRST_NODE(&duCb.e2apDb.e2NodeComponentList, node);
+ while(node)
+ {
+ e2NodeComponentInfo = (E2NodeComponent*)node->node;
+ if((e2NodeComponentInfo->interfaceType == F1) && (e2NodeComponentInfo->componentActionType == action))
+ {
+ e2NodeComponentInfo->rspBufSize = bufSize;
+
+ DU_ALLOC(e2NodeComponentInfo->componentResponsePart, bufSize);
+ if(e2NodeComponentInfo->componentResponsePart == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed to store the encoding of f1setup rsp");
+ return RFAILED;
+ }
+ memcpy(e2NodeComponentInfo->componentResponsePart, bufString, e2NodeComponentInfo->rspBufSize);
+ break;
+ }
+ node = node->next;
+ }
+ }
+ }
+ }
+ return ROK;
+}
+/*******************************************************************
+ *
+ * @brief Builds and Send the F1SetupRequest
+ *
+ * @details
+ *
+ * Function : BuildAndSendF1SetupReq
+ *
+ * Functionality:Fills the F1SetupRequest
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ ******************************************************************/
+uint8_t BuildAndSendF1SetupReq()
+{
+ uint8_t ret, ieIdx, elementCnt;
+ F1AP_PDU_t *f1apMsg = NULLP;
+ F1SetupRequest_t *f1SetupReq=NULLP;
+ GNB_DU_Served_Cells_List_t *duServedCell=NULLP;
+ RRC_Version_t *rrcVer=NULLP;
asn_enc_rval_t encRetVal; /* Encoder return value */
ret= RFAILED;
DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
if(f1apMsg == NULLP)
{
- break;
+ break;
}
f1apMsg->present = F1AP_PDU_PR_initiatingMessage;
DU_ALLOC(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
if(f1apMsg->choice.initiatingMessage == NULLP)
{
- break;
+ break;
}
f1apMsg->choice.initiatingMessage->procedureCode = ProcedureCode_id_F1Setup;
f1apMsg->choice.initiatingMessage->criticality = Criticality_reject;
f1apMsg->choice.initiatingMessage->value.present = \
- InitiatingMessage__value_PR_F1SetupRequest;
+ InitiatingMessage__value_PR_F1SetupRequest;
f1SetupReq = &f1apMsg->choice.initiatingMessage->value.choice.F1SetupRequest;
- elementCnt = (duCfgParam.duName != NULL) ? 5 : 4;
+ elementCnt = 5;
f1SetupReq->protocolIEs.list.count = elementCnt;
- f1SetupReq->protocolIEs.list.size = elementCnt * sizeof(F1SetupRequestIEs_t );
+ f1SetupReq->protocolIEs.list.size = elementCnt * sizeof(F1SetupRequestIEs_t *);
/* Initialize the F1Setup members */
DU_ALLOC(f1SetupReq->protocolIEs.list.array,f1SetupReq->protocolIEs.list.size);
if(f1SetupReq->protocolIEs.list.array == NULLP)
{
- break;
+ break;
}
for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
{
- DU_ALLOC(f1SetupReq->protocolIEs.list.array[ieIdx],\
- sizeof(F1SetupRequestIEs_t));
- if(f1SetupReq->protocolIEs.list.array[ieIdx] == NULLP)
- {
- break;
- }
+ DU_ALLOC(f1SetupReq->protocolIEs.list.array[ieIdx],\
+ sizeof(F1SetupRequestIEs_t));
+ if(f1SetupReq->protocolIEs.list.array[ieIdx] == NULLP)
+ {
+ break;
+ }
}
ieIdx = 0;
f1SetupReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_TransactionID;
f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
f1SetupReq->protocolIEs.list.array[ieIdx]->value.present =\
- F1SetupRequestIEs__value_PR_TransactionID;
+ F1SetupRequestIEs__value_PR_TransactionID;
f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.TransactionID = \
- TRANS_ID;
+ TRANS_ID;
/*DU ID*/
ieIdx++;
f1SetupReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_ID;
f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
f1SetupReq->protocolIEs.list.array[ieIdx]->value.present = \
- F1SetupRequestIEs__value_PR_GNB_DU_ID;
+ F1SetupRequestIEs__value_PR_GNB_DU_ID;
f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size =\
- sizeof(uint8_t);
+ sizeof(uint8_t);
DU_ALLOC(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf,\
- f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
+ f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
if(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf == \
- NULLP)
+ NULLP)
{
- break;
+ break;
}
f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf[0] =\
- duCfgParam.duId;
-
+ duCfgParam.duId;
+ /* DU name IE is of type printableString_t which wireshark is unable to decode.
+ * However this string is decoded successfully on online decoders.
+ * Since this is an optional IE and the value received in it are not
+ * used as of now, eliminating this IE for now to avoid wireshark error.
+ */
/*DU Name*/
if(duCfgParam.duName != NULL)
{
- ieIdx++;
- f1SetupReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_Name;
- f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_ignore;
- f1SetupReq->protocolIEs.list.array[ieIdx]->value.present = F1SetupRequestIEs__value_PR_GNB_DU_Name;
- f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.size =\
- strlen((char *)duCfgParam.duName);
- DU_ALLOC(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.\
- GNB_DU_Name.buf, strlen((char *)duCfgParam.duName));
- if(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.\
- buf == NULLP)
- {
- break;
- }
- strcpy((char*)f1SetupReq->protocolIEs.list.array[ieIdx]->value.\
- choice.GNB_DU_Name.buf,
- (char*)&duCfgParam.duName);
-
+ ieIdx++;
+ f1SetupReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_Name;
+ f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_ignore;
+ f1SetupReq->protocolIEs.list.array[ieIdx]->value.present = F1SetupRequestIEs__value_PR_GNB_DU_Name;
+ f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.size = strlen((char *)duCfgParam.duName);
+ DU_ALLOC(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.buf, \
+ f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.size);
+ if(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.buf == NULLP)
+ {
+ break;
+ }
+ strcpy((char*)f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.buf,
+ (char*)duCfgParam.duName);
}
/*Served Cell list */
ieIdx++;
f1SetupReq->protocolIEs.list.array[ieIdx]->id = \
- ProtocolIE_ID_id_gNB_DU_Served_Cells_List;
+ ProtocolIE_ID_id_gNB_DU_Served_Cells_List;
f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
f1SetupReq->protocolIEs.list.array[ieIdx]->value.present = \
- F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List;
+ F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List;
duServedCell = &f1SetupReq->protocolIEs.list.\
- array[ieIdx]->value.choice.GNB_DU_Served_Cells_List;
+ array[ieIdx]->value.choice.GNB_DU_Served_Cells_List;
if(BuildServedCellList(duServedCell))
{
- break;
+ break;
}
+
/*RRC Version*/
ieIdx++;
f1SetupReq->protocolIEs.list.array[ieIdx]->id = \
- ProtocolIE_ID_id_GNB_DU_RRC_Version ;
+ ProtocolIE_ID_id_GNB_DU_RRC_Version ;
f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
f1SetupReq->protocolIEs.list.array[ieIdx]->value.present = \
- F1SetupRequestIEs__value_PR_RRC_Version;
+ F1SetupRequestIEs__value_PR_RRC_Version;
rrcVer = &f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.RRC_Version;
if(BuildRrcVer(rrcVer))
{
- break;
+ break;
}
+
xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
/* Encode the F1SetupRequest type as APER */
memset(encBuf, 0, ENC_BUF_MAX_LEN);
encBufSize = 0;
encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf,\
- encBuf);
+ encBuf);
/* Encode results */
if(encRetVal.encoded == ENCODE_FAIL)
{
- DU_LOG("\nERROR --> F1AP : Could not encode F1SetupRequest structure (at %s)\n",\
- encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
- break;
+ DU_LOG("\nERROR --> F1AP : Could not encode F1SetupRequest structure (at %s)\n",\
+ encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+ break;
}
else
{
- DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for F1SetupRequest\n");
- for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
- {
- printf("%x",encBuf[ieIdx]);
- }
- }
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for F1SetupRequest\n");
+#ifdef DEBUG_ASN_PRINT
+ for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
+ {
+ printf("%x",encBuf[ieIdx]);
+ }
+#endif
+
+ }
+ addOrModifyE2NodeComponent(E2_NODE_COMPONENT_ADD, true, encBufSize, encBuf);
/* Sending msg */
if(sendF1APMsg() != ROK)
{
- DU_LOG("\nERROR --> F1AP : Sending F1 Setup request failed");
- break;
+ DU_LOG("\nERROR --> F1AP : Sending F1 Setup request failed");
+ break;
}
ret=ROK;
DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array,\
modifyItem->served_Cell_Information.servedPLMNs.list.size);
}
-
- if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD != NULLP)
+
+ if(modifyItem->served_Cell_Information.nR_Mode_Info.present == NR_Mode_Info_PR_fDD)
{
- if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array != NULLP)
- {
- DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.list.\
- array[arrIdx], sizeof(FreqBandNrItem_t));
- DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array, \
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.list.size);
- }
-
- if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array != NULLP)
+ freeFddNrFreqInfo(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD);
+ }
+ else
+ {
+ if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.tDD)
{
- DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.freqBandListNr.list.\
- array[arrIdx], sizeof(FreqBandNrItem_t));
- DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array,\
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.freqBandListNr.list.size);
+ freeTddNrFreqInfo(&modifyItem->served_Cell_Information.nR_Mode_Info.choice.tDD->nRFreqInfo);
+ DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.tDD, sizeof(TDD_Info_t));
}
- DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD,sizeof(FDD_Info_t));
}
-
DU_FREE(modifyItem->served_Cell_Information.measurementTimingConfiguration.buf,\
- modifyItem->served_Cell_Information.measurementTimingConfiguration.size);
+ modifyItem->served_Cell_Information.measurementTimingConfiguration.size);
}
/*******************************************************************
* ****************************************************************/
void FreeDUConfigUpdate(F1AP_PDU_t *f1apDuCfg)
{
- uint8_t ieIdx=0, cellModifyIdx=0, cellDeleteIdx=0;
+ uint8_t idx=0,ieIdx=0, cellModifyIdx=0, cellDeleteIdx=0;
GNBDUConfigurationUpdate_t *duCfgUpdate = NULLP;
Served_Cells_To_Modify_List_t *cellsToModify=NULLP;
Served_Cells_To_Delete_List_t *cellsToDelete=NULLP;
Served_Cells_To_Delete_Item_t *deleteItem = NULLP;
Served_Cells_To_Delete_ItemIEs_t *deleteItemIe = NULLP;
+ Cells_Status_ItemIEs_t *cellStatusItemIE;
if(f1apDuCfg != NULLP)
{
duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
break;
}
+ case ProtocolIE_ID_id_Cells_Status_List:
+ {
+ for(idx = 0; idx < duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.Cells_Status_List.list.count; idx++)
+ {
+ cellStatusItemIE = (Cells_Status_ItemIEs_t *)duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.Cells_Status_List.list.array[idx];
+ DU_FREE(cellStatusItemIE->value.choice.Cells_Status_Item.nRCGI.nRCellIdentity.buf, cellStatusItemIE->value.choice.Cells_Status_Item.nRCGI.nRCellIdentity.size);
+ DU_FREE(cellStatusItemIE->value.choice.Cells_Status_Item.nRCGI.pLMN_Identity.buf, cellStatusItemIE->value.choice.Cells_Status_Item.nRCGI.pLMN_Identity.size);
+ DU_FREE(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.Cells_Status_List.list.array[idx],sizeof(Cells_Status_ItemIEs_t));
+ }
+ DU_FREE(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.Cells_Status_List.list.array,\
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.Cells_Status_List.list.size);
+ }
}
DU_FREE(duCfgUpdate->protocolIEs.list.array[ieIdx],\
sizeof(GNBDUConfigurationUpdateIEs_t));
*
* Functionality: Fills Nr Fdd Info required in ServCellInfo IE
*
- * @params[in] Pointer to NR_Mode_Info_t *
+ * @params[in] FDD_Info_t *fDD
*
* @return ROK - success
* RFAILED - failure
*
*****************************************************************/
-uint8_t fillNrFddInfo(NR_Mode_Info_t *nrFdd)
+uint8_t fillNrFddInfo(FDD_Info_t *fDD)
{
- nrFdd->choice.fDD->uL_NRFreqInfo.nRARFCN = duCfgParam.srvdCellLst[0].duCellInfo.\
+ fDD->uL_NRFreqInfo.nRARFCN = duCfgParam.srvdCellLst[0].duCellInfo.\
f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn;
- nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.count = 1;
- nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.size = sizeof(FreqBandNrItem_t*);
- DU_ALLOC(nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.\
- array, nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.size);
- if(nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array == NULLP)
+ fDD->uL_NRFreqInfo.freqBandListNr.list.count = 1;
+ fDD->uL_NRFreqInfo.freqBandListNr.list.size = sizeof(FreqBandNrItem_t*);
+ DU_ALLOC(fDD->uL_NRFreqInfo.freqBandListNr.list.\
+ array, fDD->uL_NRFreqInfo.freqBandListNr.list.size);
+ if(fDD->uL_NRFreqInfo.freqBandListNr.list.array == NULLP)
{
+ DU_LOG("\nERROR --> Memory allocation failed in fillNrFddInfo");
return RFAILED;
}
- DU_ALLOC(nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array[0], \
+
+ DU_ALLOC(fDD->uL_NRFreqInfo.freqBandListNr.list.array[0], \
sizeof(FreqBandNrItem_t));
- if(nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array[0] == NULLP)
+ if(fDD->uL_NRFreqInfo.freqBandListNr.list.array[0] == NULLP)
{
+ DU_LOG("\nERROR --> Memory allocation failed in fillNrFddInfo");
return RFAILED;
}
- nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array[0]->freqBandIndicatorNr = \
+
+ fDD->uL_NRFreqInfo.freqBandListNr.list.array[0]->freqBandIndicatorNr = \
duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.\
freqBand[0].nrFreqBand;
- nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array[0]->supportedSULBandList.list.count=0;
- nrFdd->choice.fDD->dL_NRFreqInfo.nRARFCN = duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.fdd.\
+ fDD->uL_NRFreqInfo.freqBandListNr.list.array[0]->supportedSULBandList.list.count=0;
+ fDD->dL_NRFreqInfo.nRARFCN = duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.fdd.\
dlNrFreqInfo.nrArfcn;
- nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.count = 1;
- nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.size = sizeof(FreqBandNrItem_t *);
- DU_ALLOC(nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array,nrFdd->\
- choice.fDD->dL_NRFreqInfo.freqBandListNr.list.size);
- if(nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array == NULLP)
+ fDD->dL_NRFreqInfo.freqBandListNr.list.count = 1;
+ fDD->dL_NRFreqInfo.freqBandListNr.list.size = sizeof(FreqBandNrItem_t *);
+ DU_ALLOC(fDD->dL_NRFreqInfo.freqBandListNr.list.array, fDD->dL_NRFreqInfo.freqBandListNr.list.size);
+ if(fDD->dL_NRFreqInfo.freqBandListNr.list.array == NULLP)
{
+ DU_LOG("\nERROR --> Memory allocation failed in fillNrFddInfo");
return RFAILED;
}
- DU_ALLOC(nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array[0],\
- sizeof(FreqBandNrItem_t));
- if(nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array[0] == NULLP)
+
+ DU_ALLOC(fDD->dL_NRFreqInfo.freqBandListNr.list.array[0], sizeof(FreqBandNrItem_t));
+ if(fDD->dL_NRFreqInfo.freqBandListNr.list.array[0] == NULLP)
{
+ DU_LOG("\nERROR --> Memory allocation failed in fillNrFddInfo");
return RFAILED;
}
- nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array[0]->freqBandIndicatorNr = \
+
+ fDD->dL_NRFreqInfo.freqBandListNr.list.array[0]->freqBandIndicatorNr = \
duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.\
freqBand[0].nrFreqBand;
- nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array[0]->supportedSULBandList.list.count=0;
+ fDD->dL_NRFreqInfo.freqBandListNr.list.array[0]->supportedSULBandList.list.count=0;
/*Transmission Bandwidth*/
- nrFdd->choice.fDD->uL_Transmission_Bandwidth.nRSCS = duCfgParam.srvdCellLst[0].duCellInfo.\
+ fDD->uL_Transmission_Bandwidth.nRSCS = duCfgParam.srvdCellLst[0].duCellInfo.\
f1Mode.mode.fdd.ulTxBw.nrScs;
- nrFdd->choice.fDD->uL_Transmission_Bandwidth.nRNRB = duCfgParam.srvdCellLst[0].duCellInfo.\
+ fDD->uL_Transmission_Bandwidth.nRNRB = duCfgParam.srvdCellLst[0].duCellInfo.\
f1Mode.mode.fdd.ulTxBw.nrb;
- nrFdd->choice.fDD->dL_Transmission_Bandwidth.nRSCS = duCfgParam.srvdCellLst[0].duCellInfo.\
+ fDD->dL_Transmission_Bandwidth.nRSCS = duCfgParam.srvdCellLst[0].duCellInfo.\
f1Mode.mode.fdd.dlTxBw.nrScs;
- nrFdd->choice.fDD->dL_Transmission_Bandwidth.nRNRB = duCfgParam.srvdCellLst[0].duCellInfo.\
+ fDD->dL_Transmission_Bandwidth.nRNRB = duCfgParam.srvdCellLst[0].duCellInfo.\
f1Mode.mode.fdd.dlTxBw.nrb;
return ROK;
uint8_t fillServedCellInfo(Served_Cell_Information_t *srvCellInfo)
{
- uint8_t tmp, ieIdx, ieListCnt;
+ uint8_t ieIdx, ieListCnt;
/*nRCGI*/
srvCellInfo->nRCGI.pLMN_Identity.size =3*sizeof(uint8_t);
srvCellInfo->nRCGI.pLMN_Identity.size);
if(srvCellInfo->nRCGI.pLMN_Identity.buf == NULLP)
{
+ DU_LOG("\nERROR --> Memory allocation failed in fillServedCellInfo");
return RFAILED;
}
buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
DU_ALLOC(srvCellInfo->nRCGI.nRCellIdentity.buf,\
srvCellInfo->nRCGI.nRCellIdentity.size);
if(srvCellInfo->nRCGI.nRCellIdentity.buf == NULLP)
- {
+ {
+ DU_LOG("\nERROR --> Memory allocation failed in fillServedCellInfo");
return RFAILED;
}
- for (tmp = 0 ; tmp < srvCellInfo->\
- nRCGI.nRCellIdentity.size-1 ; tmp++)
- {
- srvCellInfo->nRCGI.nRCellIdentity.buf[tmp] = 0;
- }
- srvCellInfo->nRCGI.nRCellIdentity.buf[4] = 16;
- srvCellInfo->nRCGI.nRCellIdentity.bits_unused =4;
-
+
+ fillBitString(&srvCellInfo->nRCGI.nRCellIdentity, ODU_VALUE_FOUR, ODU_VALUE_FIVE, duCfgParam.sib1Params.cellIdentity);
/*nRPCI*/
srvCellInfo->nRPCI = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrPci;
ieListCnt = 1;
srvCellInfo->servedPLMNs.list.count = ieListCnt;
srvCellInfo->servedPLMNs.list.size = ieListCnt*sizeof(ServedPLMNs_Item_t *);
- DU_ALLOC(srvCellInfo->servedPLMNs.list.array,\
- srvCellInfo->servedPLMNs.list.size);
+ DU_ALLOC(srvCellInfo->servedPLMNs.list.array, srvCellInfo->servedPLMNs.list.size);
if(srvCellInfo->servedPLMNs.list.array == NULLP)
{
+ DU_LOG("\nERROR --> Memory allocation failed in fillServedCellInfo");
return RFAILED;
}
for(ieIdx=0; ieIdx < ieListCnt; ieIdx++)
{
- DU_ALLOC(srvCellInfo->servedPLMNs.list.array[ieIdx],\
- sizeof(ServedPLMNs_Item_t));
+ DU_ALLOC(srvCellInfo->servedPLMNs.list.array[ieIdx], sizeof(ServedPLMNs_Item_t));
if(srvCellInfo->servedPLMNs.list.array[ieIdx]== NULLP)
{
- return RFAILED;
+ DU_LOG("\nERROR --> Memory allocation failed in fillServedCellInfo");
+ return RFAILED;
}
}
if(fillServedPlmns(&srvCellInfo->servedPLMNs))
{
+ DU_LOG("\nERROR --> Failed to fill Served Plmn info");
return RFAILED;
}
+#ifndef NR_TDD
/*nR Mode Info with FDD*/
srvCellInfo->nR_Mode_Info.present = NR_Mode_Info_PR_fDD;
- DU_ALLOC(srvCellInfo->nR_Mode_Info.choice.fDD,\
- sizeof(FDD_Info_t));
+ DU_ALLOC(srvCellInfo->nR_Mode_Info.choice.fDD, sizeof(FDD_Info_t));
if(srvCellInfo->nR_Mode_Info.choice.fDD == NULLP)
{
+ DU_LOG("\nERROR --> Memory allocation failed in fillServedCellInfo");
return RFAILED;
}
- if(fillNrFddInfo(&srvCellInfo->nR_Mode_Info))
+ if(fillNrFddInfo(srvCellInfo->nR_Mode_Info.choice.fDD))
+ {
+ DU_LOG("\nERROR --> Failed to fill the Nr FDD information");
return RFAILED;
-
- /*Measurement timing Config*/
- srvCellInfo->measurementTimingConfiguration.size = sizeof(uint8_t);
- DU_ALLOC(srvCellInfo->measurementTimingConfiguration.\
- buf,srvCellInfo->measurementTimingConfiguration.size);
- if(srvCellInfo->measurementTimingConfiguration.buf == NULLP)
+ }
+#else
+ srvCellInfo->nR_Mode_Info.present = NR_Mode_Info_PR_tDD;
+ DU_ALLOC(srvCellInfo->nR_Mode_Info.choice.tDD, sizeof(TDD_Info_t));
+ if(srvCellInfo->nR_Mode_Info.choice.tDD == NULLP)
+ {
+ DU_LOG("\nERROR --> Memory allocation failed in fillServedCellInfo");
+ return RFAILED;
+ }
+ if(fillNrTddInfo(srvCellInfo->nR_Mode_Info.choice.tDD) != ROK)
{
+ DU_LOG("\nERROR --> Failed to fill the Nr TDD information");
return RFAILED;
}
- srvCellInfo->measurementTimingConfiguration.\
- buf[0] = duCfgParam.srvdCellLst[0].duCellInfo.measTimeCfg;
+#endif
+
+ /*Measurement timing Config*/
+ if(BuildMeasTimingConf(&srvCellInfo->measurementTimingConfiguration) != ROK)
+ return RFAILED;
return ROK;
}
uint8_t fillServCellToModItem(Served_Cells_To_Modify_Item_t *modifyItem)
{
- uint8_t ieIdx;
-
/*pLMN_Identity*/
modifyItem->oldNRCGI.pLMN_Identity.size = 3*sizeof(uint8_t);
DU_ALLOC(modifyItem->oldNRCGI.pLMN_Identity.buf,modifyItem->oldNRCGI.pLMN_Identity.size);
{
return RFAILED;
}
- for(ieIdx = 0; ieIdx < modifyItem->oldNRCGI.nRCellIdentity.size-1; ieIdx++)
- {
- modifyItem->oldNRCGI.nRCellIdentity.buf[ieIdx] = 0;
- }
- modifyItem->oldNRCGI.nRCellIdentity.buf[4] = 16;
- modifyItem->oldNRCGI.nRCellIdentity.bits_unused = 4;
+ fillBitString(&modifyItem->oldNRCGI.nRCellIdentity, ODU_VALUE_FOUR, ODU_VALUE_FIVE, duCfgParam.sib1Params.cellIdentity);
if(fillServedCellInfo(&modifyItem->served_Cell_Information))
return RFAILED;
*****************************************************************/
uint8_t fillCellToDeleteItem(struct Served_Cells_To_Delete_ItemIEs *deleteItemIe)
{
- uint8_t arrIdx;
Served_Cells_To_Delete_Item_t *deleteItem=NULLP;
deleteItemIe->id = ProtocolIE_ID_id_Served_Cells_To_Delete_Item;
DU_LOG("ERROR --> F1AP: fillCellToDeleteItem(): Failed to allocate the memory");
return RFAILED;
}
- for(arrIdx = 0; arrIdx < deleteItem->oldNRCGI.nRCellIdentity.size-1; arrIdx++)
- {
- deleteItem->oldNRCGI.nRCellIdentity.buf[arrIdx] = 0;
- }
- deleteItem->oldNRCGI.nRCellIdentity.buf[4] = 16;
- deleteItem->oldNRCGI.nRCellIdentity.bits_unused = 4;
+ fillBitString(&deleteItem->oldNRCGI.nRCellIdentity, ODU_VALUE_FOUR, ODU_VALUE_FIVE, duCfgParam.sib1Params.cellIdentity);
return ROK;
}
+
/*******************************************************************
*
* @brief Builds ServCellToDeleteList
return ROK;
}
+/*******************************************************************
+ *
+ * @brief Builds CellsStatusList
+ *
+ * @details
+ *
+ * Function : buildCellsStatusList
+ *
+ * Functionality: Builds the Cell Status List
+ *
+ * @params[in] Pointer to Cells_Status_List_t *
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ *****************************************************************/
+uint8_t buildCellsStatusList(Cells_Status_List_t *cellStatusList)
+{
+ uint8_t elementCnt = 0, idx = 0, ret = ROK;
+ Cells_Status_ItemIEs_t *cellStatusItemIE;
+
+ elementCnt = 1;
+ cellStatusList->list.count = elementCnt;
+ cellStatusList->list.size = elementCnt * sizeof(Cells_Status_ItemIEs_t *);
+ DU_ALLOC(cellStatusList->list.array, cellStatusList->list.size);
+
+ for(idx = 0; idx < elementCnt; idx++)
+ {
+ DU_ALLOC(cellStatusList->list.array[idx], sizeof(Cells_Status_ItemIEs_t));
+ if(!cellStatusList->list.array[idx])
+ {
+ DU_LOG("ERROR --> F1AP: buildCellsStatusList() memory allocation failure");
+ return RFAILED;
+ }
+ }
+ idx = 0;
+ cellStatusItemIE = (Cells_Status_ItemIEs_t *)cellStatusList->list.array[idx];
+ cellStatusItemIE->id = ProtocolIE_ID_id_Cells_Status_Item;
+ cellStatusItemIE->criticality = Criticality_reject;
+ cellStatusItemIE->value.present = Cells_Status_ItemIEs__value_PR_Cells_Status_Item;
+ ret = BuildNrcgi(&cellStatusItemIE->value.choice.Cells_Status_Item.nRCGI);
+ if(ret == RFAILED)
+ {
+ DU_LOG("ERROR --> F1AP: buildCellsStatusList() NRCGI failed");
+ return RFAILED;
+ }
+ cellStatusItemIE->value.choice.Cells_Status_Item.service_status.service_state = Service_State_in_service;
+ return ROK;
+}
+
/*******************************************************************
*
* @brief Builds and sends the DUConfigUpdate
InitiatingMessage__value_PR_GNBDUConfigurationUpdate;
duCfgUpdate = &f1apDuCfg->choice.initiatingMessage->value.\
choice.GNBDUConfigurationUpdate;
- elementCnt = 3;
+ elementCnt = 4;
duCfgUpdate->protocolIEs.list.count = elementCnt;
duCfgUpdate->protocolIEs.list.size = \
elementCnt * sizeof(GNBDUConfigurationUpdateIEs_t*);
}
}
- // NOTE :GNB DU SYS INFO:MIB AND SIB1 INFORMATION TO BE BUILT AND FILLED HERE
+ // TODO :GNB DU SYS INFO:MIB AND SIB1 INFORMATION TO BE BUILT AND FILLED HERE
+
+ /*Cell Status List*/
+ ieIdx++;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_Cells_Status_List;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
+ GNBDUConfigurationUpdateIEs__value_PR_Cells_Status_List;
+ ret = buildCellsStatusList(&duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.Cells_Status_List);
+ if(ret == RFAILED)
+ {
+ DU_LOG("ERROR --> DU APP : BuildAndSendDUConfigUpdate(): Cell Status List building failed");
+ break;
+ }
+
/*GNB DU ID */
ieIdx++;
duCfgUpdate->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_ID;
else
{
DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for DUConfigUpdate\n");
+#ifdef DEBUG_ASN_PRINT
for(ieIdx =0; ieIdx < encBufSize; ieIdx++)
{
printf("%x",encBuf[ieIdx]);
}
+#endif
}
/* Sending msg */
if(sendF1APMsg() != ROK)
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb ueCb, uint8_t lcId, \
+uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb *ueCb, uint8_t lcId, \
uint16_t msgLen, uint8_t *rrcMsg)
{
- uint8_t elementCnt =0;
- uint8_t idx1 =0;
- uint8_t idx =0;
- F1AP_PDU_t *f1apMsg = NULLP;
- ULRRCMessageTransfer_t *ulRRCMsg = NULLP;
- asn_enc_rval_t encRetVal; /* Encoder return value */
- uint8_t ret =RFAILED;
+ uint8_t elementCnt=0, idx1=0, idx=0;
+ uint8_t ret = RFAILED;
+ F1AP_PDU_t *f1apMsg = NULLP;
+ ULRRCMessageTransfer_t *ulRRCMsg = NULLP;
+ asn_enc_rval_t encRetVal; /* Encoder return value */
memset(&encRetVal, 0, sizeof(asn_enc_rval_t));
while(true)
{
- DU_LOG("\n INFO --> F1AP : Building UL RRC Message Transfer Message\n");
+ DU_LOG("\nINFO --> F1AP : Building UL RRC Message Transfer Message\n");
DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
if(f1apMsg == NULLP)
ulRRCMsg->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
ulRRCMsg->protocolIEs.list.array[idx1]->value.present = \
ULRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
- ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.GNB_CU_UE_F1AP_ID = ueCb.gnbCuUeF1apId;
+ ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.GNB_CU_UE_F1AP_ID = ueCb->gnbCuUeF1apId;
/*GNB DU UE F1AP ID*/
idx1++;
ulRRCMsg->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
ulRRCMsg->protocolIEs.list.array[idx1]->value.present = \
ULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
- ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.GNB_DU_UE_F1AP_ID = ueCb.gnbDuUeF1apId;
+ ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.GNB_DU_UE_F1AP_ID = ueCb->gnbDuUeF1apId;
/*SRBID*/
idx1++;
}
else
{
- DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for ULRRCMessageTransfer\n");
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for ULRRCMessageTransfer\n");
+#ifdef DEBUG_ASN_PRINT
for(int i=0; i< encBufSize; i++)
{
printf("%x",encBuf[i]);
}
+#endif
}
/* Sending msg */
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildTagConfig(struct TAG_Config *tagConfig)
+uint8_t BuildTagConfig(DuUeCb *ueCb, struct TAG_Config *tagConfig)
{
struct TAG_Config__tag_ToAddModList *tagList;
uint8_t idx, elementCnt;
return RFAILED;
}
- elementCnt = 1; //ODU_VALUE_ONE;
+ if(ueCb == NULLP)
+ elementCnt = ODU_VALUE_ONE;
+ else
+ elementCnt = ueCb->duMacUeCfg.macCellGrpCfg.tagCfg.addModListCount;
+
tagList = tagConfig->tag_ToAddModList;
tagList->list.count = elementCnt;
tagList->list.size = elementCnt * sizeof(struct TAG *);
DU_ALLOC(tagList->list.array[idx], sizeof(struct TAG));
if(!tagList->list.array[idx])
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildTagConfig");
- return RFAILED;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildTagConfig");
+ return RFAILED;
}
}
- idx = 0;
- tagList->list.array[idx]->tag_Id = TAG_ID;
- tagList->list.array[idx]->timeAlignmentTimer = TIME_ALIGNMENT_TMR;
+ if(ueCb == NULLP)
+ {
+ idx = 0;
+ tagList->list.array[idx]->tag_Id = TAG_ID;
+ tagList->list.array[idx]->timeAlignmentTimer = TIME_ALIGNMENT_TMR;
+ }
+ else
+ {
+ for(idx=0; idx<tagList->list.count; idx++)
+ {
+ tagList->list.array[idx]->tag_Id = ueCb->duMacUeCfg.macCellGrpCfg.tagCfg.addModList[idx].tagId;
+ tagList->list.array[idx]->timeAlignmentTimer = ueCb->duMacUeCfg.macCellGrpCfg.tagCfg.addModList[idx].timeAlignTimer;
+ }
+ }
return ROK;
}
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildPhrConfig(struct MAC_CellGroupConfig__phr_Config *phrConfig)
+uint8_t BuildPhrConfig(DuUeCb *ueCb, struct MAC_CellGroupConfig__phr_Config *phrConfig)
{
phrConfig->present = MAC_CellGroupConfig__phr_Config_PR_setup;
return RFAILED;
}
- phrConfig->choice.setup->phr_PeriodicTimer = PHR_PERIODIC_TMR;
- phrConfig->choice.setup->phr_ProhibitTimer = PHR_PROHIBHIT_TMR;
- phrConfig->choice.setup->phr_Tx_PowerFactorChange = PHR_PWR_FACTOR_CHANGE;
- phrConfig->choice.setup->multiplePHR = false;
- phrConfig->choice.setup->dummy = false;
- phrConfig->choice.setup->phr_Type2OtherCell = false;
- phrConfig->choice.setup->phr_ModeOtherCG = PHR_MODE_OTHER_CG;
+ if(ueCb == NULLP)
+ {
+ phrConfig->choice.setup->phr_PeriodicTimer = PHR_PERIODIC_TMR;
+ phrConfig->choice.setup->phr_ProhibitTimer = PHR_PROHIBHIT_TMR;
+ phrConfig->choice.setup->phr_Tx_PowerFactorChange = PHR_PWR_FACTOR_CHANGE;
+ phrConfig->choice.setup->multiplePHR = false;
+ phrConfig->choice.setup->dummy = false;
+ phrConfig->choice.setup->phr_Type2OtherCell = false;
+ phrConfig->choice.setup->phr_ModeOtherCG = PHR_MODE_OTHER_CG;
+ }
+ else
+ {
+ phrConfig->choice.setup->phr_PeriodicTimer = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.periodicTimer;
+ phrConfig->choice.setup->phr_ProhibitTimer = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.prohibitTimer;
+ phrConfig->choice.setup->phr_Tx_PowerFactorChange = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.txPowerFactor;
+ phrConfig->choice.setup->multiplePHR = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.multiplePHR;
+ phrConfig->choice.setup->dummy = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.dummy;
+ phrConfig->choice.setup->phr_Type2OtherCell = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.phrType2OtherCell;
+ phrConfig->choice.setup->phr_ModeOtherCG = ueCb->duMacUeCfg.macCellGrpCfg.phrCfg.phrOtherCG;
+ }
return ROK;
}
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildBsrConfig(struct BSR_Config *bsrConfig)
+uint8_t BuildBsrConfig(DuUeCb *ueCb, struct BSR_Config *bsrConfig)
{
- bsrConfig->periodicBSR_Timer = PERIODIC_BSR_TMR;
- bsrConfig->retxBSR_Timer = RETX_BSR_TMR;
- bsrConfig->logicalChannelSR_DelayTimer = NULLP;
+ if(ueCb == NULLP)
+ {
+ bsrConfig->periodicBSR_Timer = PERIODIC_BSR_TMR;
+ bsrConfig->retxBSR_Timer = RETX_BSR_TMR;
+ bsrConfig->logicalChannelSR_DelayTimer = NULLP;
+ }
+ else
+ {
+ bsrConfig->periodicBSR_Timer = convertBsrPeriodicTmrValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.bsrTmrCfg.periodicTimer);
+ bsrConfig->retxBSR_Timer = convertBsrRetxTmrValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.bsrTmrCfg.retxTimer);
+
+ bsrConfig->logicalChannelSR_DelayTimer = NULLP;
+ DU_ALLOC(bsrConfig->logicalChannelSR_DelayTimer, sizeof(long));
+ if(bsrConfig->logicalChannelSR_DelayTimer == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: Memory allocation failed in BuildBsrConfig");
+ return RFAILED;
+ }
+ *(bsrConfig->logicalChannelSR_DelayTimer) = convertLcSrDelayTmrValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.bsrTmrCfg.srDelayTimer);
+ }
return ROK;
}
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildSchedulingReqConfig(struct SchedulingRequestConfig *schedulingRequestConfig)
+uint8_t BuildSchedulingReqConfig(DuUeCb *ueCb, struct SchedulingRequestConfig *schedulingRequestConfig)
{
struct SchedulingRequestConfig__schedulingRequestToAddModList *schReqList;
uint8_t idx, elementCnt;
return RFAILED;
}
- elementCnt = 1; //ODU_VALUE_ONE;
+ if(ueCb == NULLP)
+ elementCnt = ODU_VALUE_ONE;
+ else
+ elementCnt = ueCb->duMacUeCfg.macCellGrpCfg.schReqCfg.addModListCount;
+
schReqList = schedulingRequestConfig->schedulingRequestToAddModList;
schReqList->list.count = elementCnt;
schReqList->list.size = elementCnt * sizeof(struct SchedulingRequestToAddMod *);
return RFAILED;
}
- for(idx=0;idx<schReqList->list.count; idx++)
+ for(idx=0; idx<schReqList->list.count; idx++)
{
schReqList->list.array[idx] = NULLP;
DU_ALLOC(schReqList->list.array[idx], sizeof(struct SchedulingRequestToAddMod));
if(!schReqList->list.array[idx])
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSchedulingReqConfig");
- return RFAILED;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSchedulingReqConfig");
+ return RFAILED;
}
}
- idx = 0;
- schReqList->list.array[idx]->schedulingRequestId = SCH_REQ_ID;
+ if(ueCb == NULLP)
+ {
+ idx = 0;
+ schReqList->list.array[idx]->schedulingRequestId = SCH_REQ_ID;
- schReqList->list.array[idx]->sr_ProhibitTimer = NULLP;
- DU_ALLOC(schReqList->list.array[idx]->sr_ProhibitTimer, sizeof(long));
- if(!schReqList->list.array[idx]->sr_ProhibitTimer)
+ schReqList->list.array[idx]->sr_ProhibitTimer = NULLP;
+ DU_ALLOC(schReqList->list.array[idx]->sr_ProhibitTimer, sizeof(long));
+ if(!schReqList->list.array[idx]->sr_ProhibitTimer)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSchedulingReqConfig");
+ return RFAILED;
+ }
+ *(schReqList->list.array[idx]->sr_ProhibitTimer) = SR_PROHIBIT_TMR;
+ schReqList->list.array[idx]->sr_TransMax = SR_TRANS_MAX;
+ }
+ else
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSchedulingReqConfig");
- return RFAILED;
+ for(idx=0; idx<schReqList->list.count; idx++)
+ {
+ schReqList->list.array[idx]->schedulingRequestId = ueCb->duMacUeCfg.macCellGrpCfg.schReqCfg.addModList[idx].schedReqId;
+
+ schReqList->list.array[idx]->sr_ProhibitTimer = NULLP;
+ DU_ALLOC(schReqList->list.array[idx]->sr_ProhibitTimer, sizeof(long));
+ if(!schReqList->list.array[idx]->sr_ProhibitTimer)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSchedulingReqConfig");
+ return RFAILED;
+ }
+ *(schReqList->list.array[idx]->sr_ProhibitTimer) = ueCb->duMacUeCfg.macCellGrpCfg.schReqCfg.addModList[idx].srProhibitTmr;
+ schReqList->list.array[idx]->sr_TransMax = ueCb->duMacUeCfg.macCellGrpCfg.schReqCfg.addModList[idx].srTransMax;
+ }
}
- *(schReqList->list.array[idx]->sr_ProhibitTimer) = SR_PROHIBIT_TMR;
- schReqList->list.array[idx]->sr_TransMax = SR_TRANS_MAX;
+
schedulingRequestConfig->schedulingRequestToReleaseList = NULLP;
return ROK;
/*******************************************************************
*
- * @brief Builds RLC Config
+ * @brief Builds RLC Configuration for AM mode
*
* @details
*
- * Function : BuildRlcConfig
+ * Function : BuildRlcConfigAm
*
- * Functionality: Builds RLC Config in BuildRlcBearerToAddModList
+ * Functionality:
+ * Builds AM mode RLC Config in BuildRlcBearerToAddModList
*
- * @params[in] RLC_Config *rlcConfig
+ * @params[in] AmBearerCfg *amCfg
+ * RLC_Config_t *rlcConfig
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildRlcConfig(struct RLC_Config *rlcConfig)
+uint8_t BuildRlcConfigAm(AmBearerCfg *amCfg, struct RLC_Config *rlcConfig)
{
-
- rlcConfig->present = RLC_Config_PR_am;
-
rlcConfig->choice.am = NULLP;
DU_ALLOC(rlcConfig->choice.am, sizeof(struct RLC_Config__am));
if(!rlcConfig->choice.am)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfig");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfigAm");
return RFAILED;
}
- /* UL */
+ /* Fill AM UL configuration */
rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength = NULLP;
DU_ALLOC(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t));
if(!rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfig");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfigAm");
return RFAILED;
}
- *(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength) = SN_FIELD_LEN;
- rlcConfig->choice.am->ul_AM_RLC.t_PollRetransmit = T_POLL_RETRANSMIT;
- rlcConfig->choice.am->ul_AM_RLC.pollPDU = POLL_PDU;
- rlcConfig->choice.am->ul_AM_RLC.pollByte = POLL_BYTE;
- rlcConfig->choice.am->ul_AM_RLC.maxRetxThreshold = MAX_RETX_THRESHOLD;
- /* DL */
+ /* Fill default AM UL configuration if input pointer to DU database is NULL */
+ if(amCfg == NULLP)
+ {
+
+ *(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength) = SN_FIELD_LEN_12BIT; /*As per Spec 38.331, "Network configures only value size12 in SN-FieldLengthAM for SRB"*/
+ rlcConfig->choice.am->ul_AM_RLC.t_PollRetransmit = T_POLL_RETRANSMIT;
+ rlcConfig->choice.am->ul_AM_RLC.pollPDU = POLL_PDU;
+ rlcConfig->choice.am->ul_AM_RLC.pollByte = POLL_BYTE;
+ rlcConfig->choice.am->ul_AM_RLC.maxRetxThreshold = MAX_RETX_THRESHOLD;
+ }
+ else
+ {
+ *(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength) = covertAmSnLenFromIntEnumToRrcEnum(amCfg->dlAmCfg.snLenDl);
+ rlcConfig->choice.am->ul_AM_RLC.t_PollRetransmit = covertPollRetxTmrValueToEnum(amCfg->dlAmCfg.pollRetxTmr);
+ rlcConfig->choice.am->ul_AM_RLC.pollPDU = covertPollPduValueToEnum(amCfg->dlAmCfg.pollPdu);
+ rlcConfig->choice.am->ul_AM_RLC.pollByte = covertPollByteValueToEnum(amCfg->dlAmCfg.pollByte);
+ rlcConfig->choice.am->ul_AM_RLC.maxRetxThreshold = covertMaxRetxValueToEnum(amCfg->dlAmCfg.maxRetxTh);
+ }
+
+ /* Fill AM DL configuraion */
rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength = NULLP;
DU_ALLOC(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t));
if(!rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfig");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfigAm");
return RFAILED;
}
- *(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength) = SN_FIELD_LEN;
- rlcConfig->choice.am->dl_AM_RLC.t_Reassembly = T_REASSEMBLY;
- rlcConfig->choice.am->dl_AM_RLC.t_StatusProhibit = T_STATUS_PROHIBHIT;
+ /* Fill default AM DL configuration if input pointer to DU database is NULL */
+ if(amCfg == NULLP)
+ {
+ *(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength) = SN_FIELD_LEN_12BIT; /*As per Spec 38.331, "Network configures only value size12 in SN-FieldLengthAM for SRB"*/
+ rlcConfig->choice.am->dl_AM_RLC.t_Reassembly = T_REASSEMBLY;
+ rlcConfig->choice.am->dl_AM_RLC.t_StatusProhibit = T_STATUS_PROHIBHIT;
+ }
+ else /* Fill AM configuration from DU database */
+ {
+ *(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength) = covertAmSnLenFromIntEnumToRrcEnum(amCfg->ulAmCfg.snLenUl);
+ rlcConfig->choice.am->dl_AM_RLC.t_Reassembly = convertReasmblTmrValueToEnum(amCfg->ulAmCfg.reAssemTmr);
+ rlcConfig->choice.am->dl_AM_RLC.t_StatusProhibit = convertProhibitTmrValueToEnum(amCfg->ulAmCfg.statProhTmr);
+ }
return ROK;
}
/*******************************************************************
*
- * @brief Builds MAC LC Config
+ * @brief Builds RLC Config for UM Bidirection
+ *
+ * @details
+ *
+ * Function : BuildRlcConfig UmBiDir
+ *
+ * Functionality:
+ * Builds RLC Config for UM Bidirection in BuildRlcBearerToAddModList
+ *
+ * @params[in] UmBiDirBearerCfg *umBiDirCfg
+ * RLC_Config_t *rlcConfig
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildRlcConfigUmBiDir(UmBiDirBearerCfg *umBiDirCfg, struct RLC_Config *rlcConfig)
+{
+ rlcConfig->choice.um_Bi_Directional = NULLP;
+ DU_ALLOC(rlcConfig->choice.um_Bi_Directional, sizeof(struct RLC_Config__um_Bi_Directional));
+ if(rlcConfig->choice.um_Bi_Directional == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfigUmBiDir");
+ return RFAILED;
+ }
+
+ /* Fill UM Bidirectional UL configuration */
+ rlcConfig->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength = NULLP;
+ DU_ALLOC(rlcConfig->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+ if(rlcConfig->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfigUmBiDir");
+ return RFAILED;
+ }
+
+ if(umBiDirCfg != NULLP)
+ {
+ *(rlcConfig->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength) = covertUmSnLenFromIntEnumToRrcEnum(umBiDirCfg->dlUmCfg.snLenDlUm);
+ }
+
+ /* Fill UM Bidirectional DL configuration */
+ rlcConfig->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength = NULLP;
+ DU_ALLOC(rlcConfig->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+ if(rlcConfig->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfigUmBiDir");
+ return RFAILED;
+ }
+
+ if(umBiDirCfg != NULLP)
+ {
+ *(rlcConfig->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength) = covertUmSnLenFromIntEnumToRrcEnum(umBiDirCfg->ulUmCfg.snLenUlUm);
+ rlcConfig->choice.um_Bi_Directional->dl_UM_RLC.t_Reassembly = convertReasmblTmrValueToEnum(umBiDirCfg->ulUmCfg.reAssemTmr);
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds RLC Config for UM Uni directional UL
+ *
+ * @details
+ *
+ * Function : BuildRlcConfigUmUniDirUl
+ *
+ * Functionality:
+ * Builds RLC Config for UM Unidirection UL in BuildRlcBearerToAddModList
+ *
+ * @params[in] UmUniDirDlBearerCfg *umUniDirDlCfg
+ * RLC_Config_t *rlcConfig
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildRlcConfigUmUniDirUl(UmUniDirDlBearerCfg *umUniDirDlCfg, RLC_Config_t *rlcConfig)
+{
+ rlcConfig->choice.um_Uni_Directional_UL = NULLP;
+ DU_ALLOC(rlcConfig->choice.um_Uni_Directional_UL , sizeof(struct RLC_Config__um_Uni_Directional_UL));
+ if(rlcConfig->choice.um_Uni_Directional_UL == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfigUmUniDirUl");
+ return RFAILED;
+ }
+
+ rlcConfig->choice.um_Uni_Directional_UL->ul_UM_RLC.sn_FieldLength = NULLP;
+ DU_ALLOC(rlcConfig->choice.um_Uni_Directional_UL->ul_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+ if(rlcConfig->choice.um_Uni_Directional_UL->ul_UM_RLC.sn_FieldLength == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfigUmUniDirUl");
+ return RFAILED;
+ }
+
+ if(umUniDirDlCfg != NULLP)
+ {
+ *(rlcConfig->choice.um_Uni_Directional_UL->ul_UM_RLC.sn_FieldLength) = covertUmSnLenFromIntEnumToRrcEnum(umUniDirDlCfg->dlUmCfg.snLenDlUm);
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds RLC Config for UM Uni directional DL
+ *
+ * @details
+ *
+ * Function : BuildRlcConfigUmUniDirDl
+ *
+ * Functionality:
+ * Builds RLC Config for UM Unidirection DL in BuildRlcBearerToAddModList
+ *
+ * @params[in] UmUniDirUlBearerCfg *umUniDirUlCfg
+ * RLC_Config_t *rlcConfig
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildRlcConfigUmUniDirDl(UmUniDirUlBearerCfg *umUniDirUlCfg, RLC_Config_t *rlcConfig)
+{
+ rlcConfig->choice.um_Uni_Directional_DL = NULLP;
+ DU_ALLOC(rlcConfig->choice.um_Uni_Directional_DL , sizeof(struct RLC_Config__um_Uni_Directional_DL));
+ if(rlcConfig->choice.um_Uni_Directional_DL == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfigUmUniDirDl");
+ return RFAILED;
+ }
+
+ rlcConfig->choice.um_Uni_Directional_DL->dl_UM_RLC.sn_FieldLength = NULLP;
+ DU_ALLOC(rlcConfig->choice.um_Uni_Directional_DL->dl_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+ if(rlcConfig->choice.um_Uni_Directional_DL->dl_UM_RLC.sn_FieldLength == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfigUmUniDirDl");
+ return RFAILED;
+ }
+
+ if(umUniDirUlCfg != NULLP)
+ {
+ *(rlcConfig->choice.um_Uni_Directional_DL->dl_UM_RLC.sn_FieldLength) = covertUmSnLenFromIntEnumToRrcEnum(umUniDirUlCfg->ulUmCfg.snLenUlUm);
+ rlcConfig->choice.um_Uni_Directional_DL->dl_UM_RLC.t_Reassembly = convertReasmblTmrValueToEnum(umUniDirUlCfg->ulUmCfg.reAssemTmr);
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds RLC Config
+ *
+ * @details
+ *
+ * Function : BuildRlcConfig
+ *
+ * Functionality: Builds RLC Config in BuildRlcBearerToAddModList
+ *
+ * @params[in] RLC_Config_t *rlcConfig
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildRlcConfig(RlcBearerCfg *rbCfg, struct RLC_Config *rlcConfig)
+{
+
+ /* Fill default values if rbCfg is NULL */
+ if(rbCfg == NULLP)
+ {
+ rlcConfig->present = RLC_Config_PR_am;
+ BuildRlcConfigAm(NULLP, rlcConfig);
+ }
+ /* If RbCfg is present, fill RLC configurations from DU Database */
+ else
+ {
+ rlcConfig->present = covertRlcModeFromIntEnumToRrcEnum(rbCfg->rlcMode);
+ switch(rlcConfig->present)
+ {
+ case RLC_Config_PR_am:
+ BuildRlcConfigAm(rbCfg->u.amCfg, rlcConfig);
+ break;
+ case RLC_Config_PR_um_Bi_Directional:
+ BuildRlcConfigUmBiDir(rbCfg->u.umBiDirCfg, rlcConfig);
+ break;
+ case RLC_Config_PR_um_Uni_Directional_UL:
+ BuildRlcConfigUmUniDirUl(rbCfg->u.umUniDirDlCfg, rlcConfig);
+ break;
+ case RLC_Config_PR_um_Uni_Directional_DL:
+ BuildRlcConfigUmUniDirDl(rbCfg->u.umUniDirUlCfg, rlcConfig);
+ break;
+ case RLC_Config_PR_NOTHING:
+ default:
+ break;
+ }
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds MAC LC Config
*
* @details
*
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildMacLCConfig(struct LogicalChannelConfig *macLcConfig)
+uint8_t BuildMacLCConfig(LcCfg *lcCfgDb, struct LogicalChannelConfig *macLcConfig)
{
-
macLcConfig->ul_SpecificParameters = NULLP;
DU_ALLOC(macLcConfig->ul_SpecificParameters, sizeof(struct LogicalChannelConfig__ul_SpecificParameters));
if(!macLcConfig->ul_SpecificParameters)
return RFAILED;
}
- macLcConfig->ul_SpecificParameters->priority = MAC_LC_PRIORITY;
- macLcConfig->ul_SpecificParameters->prioritisedBitRate = PRIORTISIED_BIT_RATE;
- macLcConfig->ul_SpecificParameters->bucketSizeDuration = BUCKET_SIZE_DURATION;
+ if(lcCfgDb == NULLP)
+ {
+ macLcConfig->ul_SpecificParameters->priority = MAC_LC_PRIORITY;
+ macLcConfig->ul_SpecificParameters->prioritisedBitRate = PRIORTISIED_BIT_RATE;
+ macLcConfig->ul_SpecificParameters->bucketSizeDuration = BUCKET_SIZE_DURATION;
+ }
+ else
+ {
+ macLcConfig->ul_SpecificParameters->priority = lcCfgDb->ulLcCfg.priority;
+ macLcConfig->ul_SpecificParameters->prioritisedBitRate = lcCfgDb->ulLcCfg.pbr;
+ macLcConfig->ul_SpecificParameters->bucketSizeDuration = lcCfgDb->ulLcCfg.bsd;
+ }
+
macLcConfig->ul_SpecificParameters->allowedServingCells = NULLP;
macLcConfig->ul_SpecificParameters->allowedSCS_List = NULLP;
macLcConfig->ul_SpecificParameters->maxPUSCH_Duration = NULLP;
DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacLCConfig");
return RFAILED;
}
- *(macLcConfig->ul_SpecificParameters->logicalChannelGroup) = LC_GRP;
+
+ if(lcCfgDb == NULLP)
+ *(macLcConfig->ul_SpecificParameters->logicalChannelGroup) = LC_GRP;
+ else
+ *(macLcConfig->ul_SpecificParameters->logicalChannelGroup) = lcCfgDb->ulLcCfg.lcGroup;
macLcConfig->ul_SpecificParameters->schedulingRequestID = NULLP;
DU_ALLOC(macLcConfig->ul_SpecificParameters->schedulingRequestID, sizeof(SchedulingRequestId_t));
DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacLCConfig");
return RFAILED;
}
- *(macLcConfig->ul_SpecificParameters->schedulingRequestID) = SCH_REQ_ID;
+
+ if(lcCfgDb == NULLP)
+ *(macLcConfig->ul_SpecificParameters->schedulingRequestID) = SCH_REQ_ID;
+ else
+ *(macLcConfig->ul_SpecificParameters->schedulingRequestID) = lcCfgDb->ulLcCfg.schReqId;
macLcConfig->ul_SpecificParameters->logicalChannelSR_Mask = false;
macLcConfig->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = false;
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildRlcBearerToAddModList(struct CellGroupConfigRrc__rlc_BearerToAddModList *rlcBearerList)
+uint8_t BuildRlcBearerToAddModList(DuUeCb *ueCb, struct CellGroupConfigRrc__rlc_BearerToAddModList *rlcBearerList)
{
- uint8_t idx, elementCnt;
+ uint8_t idx = 0, lcIdx=0, macLcIdx = 0, elementCnt = 0;
- elementCnt = 1;
+ if(ueCb == NULLP)
+ elementCnt = 1;
+ else if(ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY)
+ elementCnt = ueCb->duRlcUeCfg.numLcs;
+ else
+ {
+ for(lcIdx = 0; lcIdx<ueCb->duRlcUeCfg.numLcs; lcIdx++)
+ {
+ if(ueCb->duRlcUeCfg.rlcLcCfg[lcIdx].rlcBearerCfg.isLcAddModRspSent == false)
+ elementCnt++;
+ }
+ }
rlcBearerList->list.count = elementCnt;
rlcBearerList->list.size = elementCnt * sizeof(struct RLC_BearerConfig *);
DU_ALLOC(rlcBearerList->list.array[idx], sizeof(struct RLC_BearerConfig));
if(!rlcBearerList->list.array[idx])
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList");
- return RFAILED;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList");
+ return RFAILED;
}
}
- idx = 0;
- rlcBearerList->list.array[idx]->logicalChannelIdentity = SRB1_LCID;
-
- DU_ALLOC(rlcBearerList->list.array[idx]->servedRadioBearer, \
- sizeof(struct RLC_BearerConfig__servedRadioBearer));
- if(!rlcBearerList->list.array[idx]->servedRadioBearer)
+ if(ueCb == NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList");
- return RFAILED;
- }
+ idx=0;
+ rlcBearerList->list.array[idx]->logicalChannelIdentity = SRB1_LCID;
+ DU_ALLOC(rlcBearerList->list.array[idx]->servedRadioBearer, sizeof(struct RLC_BearerConfig__servedRadioBearer));
+ if(!rlcBearerList->list.array[idx]->servedRadioBearer)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList");
+ return RFAILED;
+ }
+ rlcBearerList->list.array[idx]->servedRadioBearer->present = RLC_BearerConfig__servedRadioBearer_PR_srb_Identity;
+ rlcBearerList->list.array[idx]->servedRadioBearer->choice.srb_Identity = SRB1_LCID;
+ rlcBearerList->list.array[idx]->reestablishRLC = NULLP;
- rlcBearerList->list.array[idx]->servedRadioBearer->present = \
- RLC_BearerConfig__servedRadioBearer_PR_srb_Identity;
- rlcBearerList->list.array[idx]->servedRadioBearer->choice.srb_Identity = \
- SRB1_LCID;
+ /* Fill RLC related Configurations for this Radio Bearer */
+ rlcBearerList->list.array[idx]->rlc_Config = NULLP;
+ DU_ALLOC(rlcBearerList->list.array[idx]->rlc_Config, sizeof(struct RLC_Config));
+ if(!rlcBearerList->list.array[idx]->rlc_Config)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList");
+ return RFAILED;
+ }
+ if(BuildRlcConfig(NULLP, rlcBearerList->list.array[idx]->rlc_Config) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildRlcConfig failed");
+ return RFAILED;
+ }
- rlcBearerList->list.array[idx]->reestablishRLC = NULLP;
- rlcBearerList->list.array[idx]->rlc_Config = NULLP;
- DU_ALLOC(rlcBearerList->list.array[idx]->rlc_Config, sizeof(struct RLC_Config));
- if(!rlcBearerList->list.array[idx]->rlc_Config)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList");
- return RFAILED;
+ /* Fill MAC related configurations for this Radio Bearer */
+ rlcBearerList->list.array[idx]->mac_LogicalChannelConfig = NULLP;
+ DU_ALLOC(rlcBearerList->list.array[idx]->mac_LogicalChannelConfig, sizeof(struct LogicalChannelConfig));
+ if(!rlcBearerList->list.array[idx]->mac_LogicalChannelConfig)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList");
+ return RFAILED;
+ }
+ if(BuildMacLCConfig(NULLP, rlcBearerList->list.array[idx]->mac_LogicalChannelConfig) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildMacLCConfig failed");
+ return RFAILED;
+ }
}
-
- if(BuildRlcConfig(rlcBearerList->list.array[idx]->rlc_Config) != ROK)
+ else
{
- DU_LOG("\nERROR --> F1AP : BuildRlcConfig failed");
- return RFAILED;
- }
+ idx=0;
+ for(lcIdx=0; lcIdx<ueCb->duRlcUeCfg.numLcs; lcIdx++)
+ {
+ if((ueCb->f1UeDb->actionType != UE_CTXT_CFG_QUERY) && (ueCb->duRlcUeCfg.rlcLcCfg[lcIdx].rlcBearerCfg.isLcAddModRspSent == true))
+ continue;
- rlcBearerList->list.array[idx]->mac_LogicalChannelConfig = NULLP;
- DU_ALLOC(rlcBearerList->list.array[idx]->mac_LogicalChannelConfig, \
- sizeof(struct LogicalChannelConfig));
- if(!rlcBearerList->list.array[idx]->mac_LogicalChannelConfig)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList");
- return RFAILED;
- }
+ /* Fill Logical channel identity */
+ rlcBearerList->list.array[idx]->logicalChannelIdentity = ueCb->duRlcUeCfg.rlcLcCfg[lcIdx].rlcBearerCfg.lcId;
- if(BuildMacLCConfig(rlcBearerList->list.array[idx]->mac_LogicalChannelConfig) != ROK)
- {
- DU_LOG("\nERROR --> F1AP : BuildMacLCConfig failed");
- return RFAILED;
- }
+ /* Fill Radio Bearer Id and type (DRB/SRB) for this logical channel */
+ DU_ALLOC(rlcBearerList->list.array[idx]->servedRadioBearer, sizeof(struct RLC_BearerConfig__servedRadioBearer));
+ if(!rlcBearerList->list.array[idx]->servedRadioBearer)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList");
+ return RFAILED;
+ }
+ rlcBearerList->list.array[idx]->servedRadioBearer->present = \
+ covertRbTypeFromIntEnumToRrcEnum(ueCb->duRlcUeCfg.rlcLcCfg[lcIdx].rlcBearerCfg.rbType);
+ switch(rlcBearerList->list.array[idx]->servedRadioBearer->present)
+ {
+ case RLC_BearerConfig__servedRadioBearer_PR_srb_Identity:
+ rlcBearerList->list.array[idx]->servedRadioBearer->choice.srb_Identity = ueCb->duRlcUeCfg.rlcLcCfg[lcIdx].rlcBearerCfg.rbId;
+ break;
+ case RLC_BearerConfig__servedRadioBearer_PR_drb_Identity:
+ rlcBearerList->list.array[idx]->servedRadioBearer->choice.drb_Identity = ueCb->duRlcUeCfg.rlcLcCfg[lcIdx].rlcBearerCfg.rbId;
+ break;
+ case RLC_BearerConfig__servedRadioBearer_PR_NOTHING:
+ default:
+ break;
+ }
+ ueCb->duRlcUeCfg.rlcLcCfg[lcIdx].rlcBearerCfg.isLcAddModRspSent = true;
+
+ rlcBearerList->list.array[idx]->reestablishRLC = NULLP;
+
+ /* Fill RLC related Configurations for this Radio Bearer */
+ rlcBearerList->list.array[idx]->rlc_Config = NULLP;
+ DU_ALLOC(rlcBearerList->list.array[idx]->rlc_Config, sizeof(struct RLC_Config));
+ if(!rlcBearerList->list.array[idx]->rlc_Config)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList");
+ return RFAILED;
+ }
+ if(BuildRlcConfig(&ueCb->duRlcUeCfg.rlcLcCfg[lcIdx].rlcBearerCfg, rlcBearerList->list.array[idx]->rlc_Config) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildRlcConfig failed");
+ return RFAILED;
+ }
+
+ /* Fill MAC related configurations for this Radio Bearer */
+ rlcBearerList->list.array[idx]->mac_LogicalChannelConfig = NULLP;
+ DU_ALLOC(rlcBearerList->list.array[idx]->mac_LogicalChannelConfig, sizeof(struct LogicalChannelConfig));
+ if(!rlcBearerList->list.array[idx]->mac_LogicalChannelConfig)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList");
+ return RFAILED;
+ }
+ for(macLcIdx = 0; macLcIdx < ueCb->duMacUeCfg.numLcs; macLcIdx++)
+ {
+ if(ueCb->duMacUeCfg.lcCfgList[macLcIdx].lcConfig.lcId == ueCb->duRlcUeCfg.rlcLcCfg[lcIdx].rlcBearerCfg.lcId)
+ {
+ if(BuildMacLCConfig(&ueCb->duMacUeCfg.lcCfgList[macLcIdx].lcConfig, rlcBearerList->list.array[idx]->mac_LogicalChannelConfig) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildMacLCConfig failed");
+ return RFAILED;
+ }
+ break;
+ }
+ }
+ idx++;
+ }
+ }
return ROK;
}
* RFAILED - failure
*
* ****************************************************************/
- uint8_t BuildControlRSetToAddModList
-(
- struct PDCCH_Config__controlResourceSetToAddModList *controlRSetList
- )
+uint8_t BuildControlRSetToAddModList(PdcchConfig *pdcchCfg, struct PDCCH_Config__controlResourceSetToAddModList *controlRSetList)
{
uint8_t idx;
uint8_t elementCnt;
uint8_t freqDomainResource[FREQ_DOM_RSRC_SIZE] = {0};
uint8_t coreset0EndPrb, coreset1StartPrb, coreset1NumPrb;
+ if(pdcchCfg == NULLP)
+ elementCnt = 1;
+ else
+ elementCnt = pdcchCfg->numCRsetToAddMod;
- elementCnt = 1;
controlRSetList->list.count = elementCnt;
- controlRSetList->list.size = \
- elementCnt * sizeof(struct ControlResourceSet *);
+ controlRSetList->list.size = elementCnt * sizeof(struct ControlResourceSet *);
controlRSetList->list.array = NULLP;
DU_ALLOC(controlRSetList->list.array, controlRSetList->list.size);
DU_ALLOC(controlRSetList->list.array[idx], sizeof(struct ControlResourceSet));
if(!controlRSetList->list.array[idx])
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
- return RFAILED;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ return RFAILED;
}
}
- idx=0;
- controlRSet = controlRSetList->list.array[idx];
+ for(idx = 0; idx < elementCnt; idx++)
+ {
+ controlRSet = controlRSetList->list.array[idx];
- controlRSet->controlResourceSetId = PDCCH_CTRL_RSRC_SET_ONE_ID;
+ if(pdcchCfg == NULLP)
+ controlRSet->controlResourceSetId = PDCCH_CTRL_RSRC_SET_ONE_ID;
+ else
+ controlRSet->controlResourceSetId = pdcchCfg->cRSetToAddModList[idx].cRSetId;
- /* size 6 bytes
- * 3 LSBs unsued
- * Bit string stored ff0000000000
- */
- numBytes = 6;
- bitsUnused = 3;
- controlRSet->frequencyDomainResources.size = numBytes * sizeof(uint8_t);
+ /* size 6 bytes
+ * 3 LSBs unsued
+ * Bit string stored ff0000000000
+ */
+ numBytes = 6;
+ bitsUnused = 3;
+ controlRSet->frequencyDomainResources.size = numBytes * sizeof(uint8_t);
- controlRSet->frequencyDomainResources.buf = NULLP;
- DU_ALLOC(controlRSet->frequencyDomainResources.buf, \
- controlRSet->frequencyDomainResources.size);
- if(!controlRSet->frequencyDomainResources.buf)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
- return RFAILED;
- }
+ controlRSet->frequencyDomainResources.buf = NULLP;
+ DU_ALLOC(controlRSet->frequencyDomainResources.buf, controlRSet->frequencyDomainResources.size);
+ if(!controlRSet->frequencyDomainResources.buf)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ return RFAILED;
+ }
- memset(controlRSet->frequencyDomainResources.buf, 0, FREQ_DOM_RSRC_SIZE);
- coreset0EndPrb = CORESET0_END_PRB;
- coreset1StartPrb = coreset0EndPrb + 6;
- coreset1NumPrb = CORESET1_NUM_PRB;
- /* calculate the PRBs */
- fillCoresetFeqDomAllocMap(((coreset1StartPrb)/6), (coreset1NumPrb/6), freqDomainResource);
- memcpy(controlRSet->frequencyDomainResources.buf, freqDomainResource, FREQ_DOM_RSRC_SIZE);
- controlRSet->frequencyDomainResources.bits_unused = bitsUnused;
+ memset(controlRSet->frequencyDomainResources.buf, 0, FREQ_DOM_RSRC_SIZE);
- controlRSet->duration = PDCCH_CTRL_RSRC_SET_ONE_DURATION;
- controlRSet->cce_REG_MappingType.present = \
- ControlResourceSet__cce_REG_MappingType_PR_nonInterleaved;
+ if(pdcchCfg == NULLP)
+ {
+ coreset0EndPrb = CORESET0_END_PRB;
+ coreset1StartPrb = coreset0EndPrb + 6;
+ coreset1NumPrb = CORESET1_NUM_PRB;
+ /* calculate the PRBs */
+ fillCoresetFeqDomAllocMap(((coreset1StartPrb)/6), (coreset1NumPrb/6), freqDomainResource);
+ memcpy(controlRSet->frequencyDomainResources.buf, freqDomainResource, FREQ_DOM_RSRC_SIZE);
+ controlRSet->frequencyDomainResources.bits_unused = bitsUnused;
- controlRSet->precoderGranularity = PDCCH_CTRL_RSRC_SET_ONE_PRECOD_GRANULARITY;
- controlRSet->tci_StatesPDCCH_ToAddList = NULLP;
- controlRSet->tci_StatesPDCCH_ToReleaseList = NULLP;
- controlRSet->tci_PresentInDCI = NULLP;
-#if 0
- uint8_t tciStateIdx;
+ controlRSet->duration = PDCCH_CTRL_RSRC_SET_ONE_DURATION;
+ controlRSet->cce_REG_MappingType.present = ControlResourceSet__cce_REG_MappingType_PR_nonInterleaved;
+ controlRSet->precoderGranularity = PDCCH_CTRL_RSRC_SET_ONE_PRECOD_GRANULARITY;
+ }
+ else
+ {
+ memcpy(controlRSet->frequencyDomainResources.buf, pdcchCfg->cRSetToAddModList[idx].freqDomainRsrc, FREQ_DOM_RSRC_SIZE);
+ controlRSet->frequencyDomainResources.bits_unused = bitsUnused;
+ controlRSet->duration = pdcchCfg->cRSetToAddModList[idx].duration;
+ controlRSet->cce_REG_MappingType.present = pdcchCfg->cRSetToAddModList[idx].cceRegMappingType;
+ controlRSet->precoderGranularity = pdcchCfg->cRSetToAddModList[idx].precoderGranularity;
+ }
+ controlRSet->tci_StatesPDCCH_ToAddList = NULLP;
+ controlRSet->tci_StatesPDCCH_ToReleaseList = NULLP;
+ controlRSet->tci_PresentInDCI = NULLP;
- DU_ALLOC(controlRset->tci_StatesPDCCH_ToAddList, \
- sizeof(struct ControlResourceSet__tci_StatesPDCCH_ToAddList));
- if(!controlRset->tci_StatesPDCCH_ToAddList)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
- return RFAILED;
- }
+#if 0
+ uint8_t tciStateIdx;
- elementCnt = 1;
- controlRset->tci_StatesPDCCH_ToAddList->list.count = elementCnt;
- controlRset->tci_StatesPDCCH_ToAddList->list.size = elementCnt * sizeof(TCI_StateId_t *);
- DU_ALLOC(controlRset->tci_StatesPDCCH_ToAddList->list.array, \
- controlRset->tci_StatesPDCCH_ToAddList->list.size)
- if(!controlRset->tci_StatesPDCCH_ToAddList->list.array)
+ DU_ALLOC(controlRset->tci_StatesPDCCH_ToAddList, \
+ sizeof(struct ControlResourceSet__tci_StatesPDCCH_ToAddList));
+ if(!controlRset->tci_StatesPDCCH_ToAddList)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
- return RFAILED;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ return RFAILED;
}
- for(tciStateIdx = 0; tciStateIdx <elementCntl; tciStateIdx++)
- {
- DU_ALLOC(controlRset->tci_StatesPDCCH_ToAddList->list.array[tciStateIdx], sizeof(TCI_StateId_t));
- if(!controlRset->tci_StatesPDCCH_ToAddList->list.array[tciStateIdx])
+ elementCnt = 1;
+ controlRset->tci_StatesPDCCH_ToAddList->list.count = elementCnt;
+ controlRset->tci_StatesPDCCH_ToAddList->list.size = elementCnt * sizeof(TCI_StateId_t *);
+ DU_ALLOC(controlRset->tci_StatesPDCCH_ToAddList->list.array, \
+ controlRset->tci_StatesPDCCH_ToAddList->list.size)
+ if(!controlRset->tci_StatesPDCCH_ToAddList->list.array)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ return RFAILED;
+ }
+
+ for(tciStateIdx = 0; tciStateIdx <elementCntl; tciStateIdx++)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
- return RFAILED;
+ DU_ALLOC(controlRset->tci_StatesPDCCH_ToAddList->list.array[tciStateIdx], sizeof(TCI_StateId_t));
+ if(!controlRset->tci_StatesPDCCH_ToAddList->list.array[tciStateIdx])
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ return RFAILED;
+ }
}
- }
- tciStateIdx = 0;
- /* TODO */
- *(controlRset->tci_StatesPDCCH_ToAddList->list.array[tciStateIdx]);
+ tciStateIdx = 0;
+ /* TODO */
+ *(controlRset->tci_StatesPDCCH_ToAddList->list.array[tciStateIdx]);
- DU_ALLOC(controlRset->tci_PresentInDCI, sizeof(long));
- if(!controlRset->tci_PresentInDCI)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
- return RFAILED;
- }
- /* TODO */
- *(controlRset->tci_PresentInDCI);
+ DU_ALLOC(controlRset->tci_PresentInDCI, sizeof(long));
+ if(!controlRset->tci_PresentInDCI)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ return RFAILED;
+ }
+ /* TODO */
+ *(controlRset->tci_PresentInDCI);
#endif
- controlRSet->pdcch_DMRS_ScramblingID = NULLP;
- DU_ALLOC(controlRSet->pdcch_DMRS_ScramblingID, sizeof(long));
- if(!controlRSet->pdcch_DMRS_ScramblingID)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
- return RFAILED;
+ controlRSet->pdcch_DMRS_ScramblingID = NULLP;
+ DU_ALLOC(controlRSet->pdcch_DMRS_ScramblingID, sizeof(long));
+ if(!controlRSet->pdcch_DMRS_ScramblingID)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ return RFAILED;
+ }
+ if(pdcchCfg == NULLP)
+ *(controlRSet->pdcch_DMRS_ScramblingID) = SCRAMBLING_ID;
+ else
+ *(controlRSet->pdcch_DMRS_ScramblingID) = pdcchCfg->cRSetToAddModList[idx].dmrsScramblingId;
}
- *(controlRSet->pdcch_DMRS_ScramblingID) = SCRAMBLING_ID;
-
return ROK;
} /* End BuildControlRSetToAddModList */
* RFAILED - failure
*
* ****************************************************************/
- uint8_t BuildSearchSpcToAddModList
-(
- struct PDCCH_Config__searchSpacesToAddModList *searchSpcList
- )
+uint8_t BuildSearchSpcToAddModList(PdcchConfig *pdcchCfg, struct PDCCH_Config__searchSpacesToAddModList *searchSpcList)
{
uint8_t idx;
uint8_t numBytes;
uint8_t elementCnt;
struct SearchSpace *searchSpc;
- elementCnt = 1;
+ if(pdcchCfg == NULLP)
+ elementCnt = 1;
+ else
+ elementCnt = pdcchCfg->numSearchSpcToAddMod;
+
searchSpcList->list.count = elementCnt;
searchSpcList->list.size = elementCnt * sizeof(struct SearchSpace *);
DU_ALLOC(searchSpcList->list.array[idx], sizeof(struct SearchSpace));
if(!searchSpcList->list.array[idx])
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
- return RFAILED;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ return RFAILED;
}
}
- idx = 0;
- searchSpc = searchSpcList->list.array[idx];
-
- searchSpc->searchSpaceId = PDCCH_SRCH_SPC_TWO_ID;
-
- searchSpc->controlResourceSetId = NULLP;
- DU_ALLOC(searchSpc->controlResourceSetId, sizeof(ControlResourceSetId_t));
- if(!searchSpc->controlResourceSetId)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
- return RFAILED;
- }
- *(searchSpc->controlResourceSetId) = PDCCH_CTRL_RSRC_SET_ONE_ID;
-
- searchSpc->monitoringSlotPeriodicityAndOffset = NULLP;
- DU_ALLOC(searchSpc->monitoringSlotPeriodicityAndOffset, \
- sizeof(struct SearchSpace__monitoringSlotPeriodicityAndOffset));
- if(!searchSpc->monitoringSlotPeriodicityAndOffset)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
- return RFAILED;
- }
- searchSpc->monitoringSlotPeriodicityAndOffset->present = \
- SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
-
- searchSpc->duration = NULLP;
- searchSpc->monitoringSymbolsWithinSlot = NULLP;
- DU_ALLOC(searchSpc->monitoringSymbolsWithinSlot, sizeof(BIT_STRING_t));
- if(!searchSpc->monitoringSymbolsWithinSlot)
+ for(idx = 0; idx < elementCnt; idx++)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
- return RFAILED;
- }
+ searchSpc = searchSpcList->list.array[idx];
- /* Values taken from reference logs :
- * size 2 bytes
- * 2 LSBs unsued
- * Bit string stores 8000
- */
- numBytes = 2;
- bitsUnused = 2;
+ if(pdcchCfg == NULLP)
+ searchSpc->searchSpaceId = PDCCH_SRCH_SPC_TWO_ID;
+ else
+ searchSpc->searchSpaceId = pdcchCfg->searchSpcToAddModList[idx].searchSpaceId;
- searchSpc->monitoringSymbolsWithinSlot->size = numBytes * sizeof(uint8_t);
- searchSpc->monitoringSymbolsWithinSlot->buf = NULLP;
- DU_ALLOC(searchSpc->monitoringSymbolsWithinSlot->buf, \
- searchSpc->monitoringSymbolsWithinSlot->size);
- if(!searchSpc->monitoringSymbolsWithinSlot->buf)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
- return RFAILED;
- }
+ searchSpc->controlResourceSetId = NULLP;
+ DU_ALLOC(searchSpc->controlResourceSetId, sizeof(ControlResourceSetId_t));
+ if(!searchSpc->controlResourceSetId)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ return RFAILED;
+ }
+ if(pdcchCfg == NULLP)
+ *(searchSpc->controlResourceSetId) = PDCCH_CTRL_RSRC_SET_ONE_ID;
+ else
+ *(searchSpc->controlResourceSetId) = pdcchCfg->searchSpcToAddModList[idx].cRSetId;
- byteIdx = 0;
- searchSpc->monitoringSymbolsWithinSlot->buf[byteIdx++] = \
- PDCCH_SYMBOL_WITHIN_SLOT /* setting MSB to 128 i.e. 0x80 */;
- searchSpc->monitoringSymbolsWithinSlot->buf[byteIdx++] = 0;
- searchSpc->monitoringSymbolsWithinSlot->bits_unused = bitsUnused;
+ searchSpc->monitoringSlotPeriodicityAndOffset = NULLP;
+ DU_ALLOC(searchSpc->monitoringSlotPeriodicityAndOffset, sizeof(struct SearchSpace__monitoringSlotPeriodicityAndOffset));
+ if(!searchSpc->monitoringSlotPeriodicityAndOffset)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ return RFAILED;
+ }
+ if(pdcchCfg == NULLP)
+ searchSpc->monitoringSlotPeriodicityAndOffset->present = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
+ else
+ searchSpc->monitoringSlotPeriodicityAndOffset->present = pdcchCfg->searchSpcToAddModList[idx].mSlotPeriodicityAndOffset;
- searchSpc->nrofCandidates = NULLP;
- DU_ALLOC(searchSpc->nrofCandidates, sizeof(struct SearchSpace__nrofCandidates));
- if(!searchSpc->nrofCandidates)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
- return RFAILED;
- }
+ searchSpc->duration = NULLP;
+ searchSpc->monitoringSymbolsWithinSlot = NULLP;
+ DU_ALLOC(searchSpc->monitoringSymbolsWithinSlot, sizeof(BIT_STRING_t));
+ if(!searchSpc->monitoringSymbolsWithinSlot)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ return RFAILED;
+ }
- searchSpc->nrofCandidates->aggregationLevel1 = \
- PDCCH_SRCH_SPC_TWO_AGG_LVL1_CANDIDATE;
- searchSpc->nrofCandidates->aggregationLevel2 = \
- PDCCH_SRCH_SPC_TWO_AGG_LVL2_CANDIDATE;
- searchSpc->nrofCandidates->aggregationLevel4 = \
- PDCCH_SRCH_SPC_TWO_AGG_LVL4_CANDIDATE;
- searchSpc->nrofCandidates->aggregationLevel8 = \
- PDCCH_SRCH_SPC_TWO_AGG_LVL8_CANDIDATE;
- searchSpc->nrofCandidates->aggregationLevel16 = \
- PDCCH_SRCH_SPC_TWO_AGG_LVL16_CANDIDATE;
+ /* Values taken from reference logs :
+ * size 2 bytes
+ * 2 LSBs unsued
+ * Bit string stores 8000
+ */
+ numBytes = 2;
+ bitsUnused = 2;
+ searchSpc->monitoringSymbolsWithinSlot->size = numBytes * sizeof(uint8_t);
+ searchSpc->monitoringSymbolsWithinSlot->buf = NULLP;
+ DU_ALLOC(searchSpc->monitoringSymbolsWithinSlot->buf, searchSpc->monitoringSymbolsWithinSlot->size);
+ if(!searchSpc->monitoringSymbolsWithinSlot->buf)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ return RFAILED;
+ }
+ if(pdcchCfg == NULLP)
+ {
+ byteIdx = 0;
+ searchSpc->monitoringSymbolsWithinSlot->buf[byteIdx++] = PDCCH_SYMBOL_WITHIN_SLOT /* setting MSB to 128 i.e. 0x80 */;
+ searchSpc->monitoringSymbolsWithinSlot->buf[byteIdx++] = 0;
+ }
+ else
+ memcpy(searchSpc->monitoringSymbolsWithinSlot->buf, pdcchCfg->searchSpcToAddModList[idx].mSymbolsWithinSlot, numBytes);
+ searchSpc->monitoringSymbolsWithinSlot->bits_unused = bitsUnused;
- searchSpc->searchSpaceType = NULLP;
- DU_ALLOC(searchSpc->searchSpaceType, sizeof(struct SearchSpace__searchSpaceType));
- if(!searchSpc->searchSpaceType)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
- return RFAILED;
- }
+ searchSpc->nrofCandidates = NULLP;
+ DU_ALLOC(searchSpc->nrofCandidates, sizeof(struct SearchSpace__nrofCandidates));
+ if(!searchSpc->nrofCandidates)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ return RFAILED;
+ }
- searchSpc->searchSpaceType->present = SearchSpace__searchSpaceType_PR_ue_Specific;
+ if(pdcchCfg == NULLP)
+ {
+ searchSpc->nrofCandidates->aggregationLevel1 = PDCCH_SRCH_SPC_TWO_AGG_LVL1_CANDIDATE;
+ searchSpc->nrofCandidates->aggregationLevel2 = PDCCH_SRCH_SPC_TWO_AGG_LVL2_CANDIDATE;
+ searchSpc->nrofCandidates->aggregationLevel4 = PDCCH_SRCH_SPC_TWO_AGG_LVL4_CANDIDATE;
+ searchSpc->nrofCandidates->aggregationLevel8 = PDCCH_SRCH_SPC_TWO_AGG_LVL8_CANDIDATE;
+ searchSpc->nrofCandidates->aggregationLevel16 = PDCCH_SRCH_SPC_TWO_AGG_LVL16_CANDIDATE;
+ }
+ else
+ {
+ searchSpc->nrofCandidates->aggregationLevel1 = pdcchCfg->searchSpcToAddModList[idx].numCandidatesAggLevel1;
+ searchSpc->nrofCandidates->aggregationLevel2 = pdcchCfg->searchSpcToAddModList[idx].numCandidatesAggLevel2;
+ searchSpc->nrofCandidates->aggregationLevel4 = pdcchCfg->searchSpcToAddModList[idx].numCandidatesAggLevel4;
+ searchSpc->nrofCandidates->aggregationLevel8 = pdcchCfg->searchSpcToAddModList[idx].numCandidatesAggLevel8;
+ searchSpc->nrofCandidates->aggregationLevel16 = pdcchCfg->searchSpcToAddModList[idx].numCandidatesAggLevel16;
+ }
- searchSpc->searchSpaceType->choice.ue_Specific = NULLP;
- DU_ALLOC(searchSpc->searchSpaceType->choice.ue_Specific, \
- sizeof(struct SearchSpace__searchSpaceType__ue_Specific));
- if(!searchSpc->searchSpaceType->choice.ue_Specific)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
- return RFAILED;
- }
- searchSpc->searchSpaceType->choice.ue_Specific->dci_Formats = \
- PDCCH_SRCH_SPC_TWO_UE_SPEC_DCI_FORMAT;
+ searchSpc->searchSpaceType = NULLP;
+ DU_ALLOC(searchSpc->searchSpaceType, sizeof(struct SearchSpace__searchSpaceType));
+ if(!searchSpc->searchSpaceType)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ return RFAILED;
+ }
+ if(pdcchCfg == NULLP)
+ searchSpc->searchSpaceType->present = SearchSpace__searchSpaceType_PR_ue_Specific;
+ else
+ searchSpc->searchSpaceType->present = pdcchCfg->searchSpcToAddModList[idx].searchSpaceType;
+ searchSpc->searchSpaceType->choice.ue_Specific = NULLP;
+ DU_ALLOC(searchSpc->searchSpaceType->choice.ue_Specific, sizeof(struct SearchSpace__searchSpaceType__ue_Specific));
+ if(!searchSpc->searchSpaceType->choice.ue_Specific)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ return RFAILED;
+ }
+ if(pdcchCfg == NULLP)
+ searchSpc->searchSpaceType->choice.ue_Specific->dci_Formats = PDCCH_SRCH_SPC_TWO_UE_SPEC_DCI_FORMAT;
+ else
+ searchSpc->searchSpaceType->choice.ue_Specific->dci_Formats = pdcchCfg->searchSpcToAddModList[idx].ueSpecificDciFormat;
+ }
return ROK;
}/* End BuildSearchSpcToAddModList */
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildBWPDlDedPdcchCfg(struct PDCCH_Config *pdcchCfg)
+uint8_t BuildBWPDlDedPdcchCfg(PdcchConfig *pdcchCfgDb, struct PDCCH_Config *pdcchCfg)
{
pdcchCfg->controlResourceSetToAddModList = NULLP;
- DU_ALLOC(pdcchCfg->controlResourceSetToAddModList, \
- sizeof(struct PDCCH_Config__controlResourceSetToAddModList));
+ DU_ALLOC(pdcchCfg->controlResourceSetToAddModList, sizeof(struct PDCCH_Config__controlResourceSetToAddModList));
if(!pdcchCfg->controlResourceSetToAddModList)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPDlDedPdcchCfg");
return RFAILED;
}
- if(BuildControlRSetToAddModList(pdcchCfg->controlResourceSetToAddModList) != ROK)
+ if(BuildControlRSetToAddModList(pdcchCfgDb, pdcchCfg->controlResourceSetToAddModList) != ROK)
{
+ DU_LOG("\nERROR --> F1AP : Failed in BuildControlRSetToAddModList()");
return RFAILED;
}
pdcchCfg->controlResourceSetToReleaseList = NULLP;
pdcchCfg->searchSpacesToAddModList = NULLP;
- DU_ALLOC(pdcchCfg->searchSpacesToAddModList, \
- sizeof(struct PDCCH_Config__searchSpacesToAddModList));
+ DU_ALLOC(pdcchCfg->searchSpacesToAddModList, sizeof(struct PDCCH_Config__searchSpacesToAddModList));
if(!pdcchCfg->searchSpacesToAddModList)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPDlDedPdcchCfg");
return RFAILED;
}
- if(BuildSearchSpcToAddModList(pdcchCfg->searchSpacesToAddModList) != ROK)
+ if(BuildSearchSpcToAddModList(pdcchCfgDb, pdcchCfg->searchSpacesToAddModList) != ROK)
{
+ DU_LOG("\nERROR --> F1AP : Failed in BuildSearchSpcToAddModList()");
return RFAILED;
}
* RFAILED - failure
*
* ****************************************************************/
- uint8_t BuildDMRSDLPdschMapTypeA
-(
- struct PDSCH_Config__dmrs_DownlinkForPDSCH_MappingTypeA *dmrsDlCfg
- )
+uint8_t BuildDMRSDLPdschMapTypeA(PdschConfig *pdschCfg, struct PDSCH_Config__dmrs_DownlinkForPDSCH_MappingTypeA *dmrsDlCfg)
{
dmrsDlCfg->present = PDSCH_Config__dmrs_DownlinkForPDSCH_MappingTypeA_PR_setup;
dmrsDlCfg->choice.setup = NULLP;
DU_ALLOC(dmrsDlCfg->choice.setup, sizeof(struct DMRS_DownlinkConfig));
if(!dmrsDlCfg->choice.setup)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDMRSDLPdschMapTypeA");
return RFAILED;
}
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDMRSDLPdschMapTypeA");
return RFAILED;
}
- *(dmrsDlCfg->choice.setup->dmrs_AdditionalPosition) = DMRS_ADDITIONAL_POS;
+ if(pdschCfg == NULLP)
+ *(dmrsDlCfg->choice.setup->dmrs_AdditionalPosition) = DMRS_ADDITIONAL_POS;
+ else
+ *(dmrsDlCfg->choice.setup->dmrs_AdditionalPosition) = pdschCfg->dmrsDlCfgForPdschMapTypeA.addPos;
dmrsDlCfg->choice.setup->maxLength = NULLP;
dmrsDlCfg->choice.setup->scramblingID0 = NULLP;
* RFAILED - failure
*
* ****************************************************************/
- uint8_t BuildPdschTimeDomAllocList
-(
- struct PDSCH_Config__pdsch_TimeDomainAllocationList *timeDomAllocList
- )
+uint8_t BuildPdschTimeDomAllocList(PdschConfig *pdschCfg, struct PDSCH_Config__pdsch_TimeDomainAllocationList *timeDomAllocList)
{
uint8_t idx;
uint8_t elementCnt;
struct PDSCH_TimeDomainResourceAllocation *timeDomAlloc;
- timeDomAllocList->present = \
- PDSCH_Config__pdsch_TimeDomainAllocationList_PR_setup;
+ timeDomAllocList->present = PDSCH_Config__pdsch_TimeDomainAllocationList_PR_setup;
timeDomAllocList->choice.setup = NULLP;
- DU_ALLOC(timeDomAllocList->choice.setup, \
- sizeof(struct PDSCH_TimeDomainResourceAllocationList));
+ DU_ALLOC(timeDomAllocList->choice.setup, sizeof(struct PDSCH_TimeDomainResourceAllocationList));
if(!timeDomAllocList->choice.setup)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
return RFAILED;
}
+if(pdschCfg == NULLP)
elementCnt = 2;
+else
+elementCnt = pdschCfg->numTimeDomRsrcAlloc;
timeDomAllocList->choice.setup->list.count = elementCnt;
- timeDomAllocList->choice.setup->list.size = \
- elementCnt * sizeof(struct PDSCH_TimeDomainResourceAllocation *);
+ timeDomAllocList->choice.setup->list.size = elementCnt * sizeof(struct PDSCH_TimeDomainResourceAllocation *);
timeDomAllocList->choice.setup->list.array = NULLP;
- DU_ALLOC(timeDomAllocList->choice.setup->list.array, \
- timeDomAllocList->choice.setup->list.size);
+ DU_ALLOC(timeDomAllocList->choice.setup->list.array, timeDomAllocList->choice.setup->list.size);
if(!timeDomAllocList->choice.setup->list.array)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
{
timeDomAllocList->choice.setup->list.array[idx] = NULLP;
DU_ALLOC(timeDomAllocList->choice.setup->list.array[idx], \
- sizeof(struct PDSCH_TimeDomainResourceAllocation));
+ sizeof(struct PDSCH_TimeDomainResourceAllocation));
if(!timeDomAllocList->choice.setup->list.array[idx])
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
- return RFAILED;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
+ return RFAILED;
}
}
- idx = 0;
- timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx];
- DU_ALLOC(timeDomAlloc->k0, sizeof(long));
- if(!timeDomAlloc->k0)
+ if(pdschCfg == NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
- return RFAILED;
- }
- *(timeDomAlloc->k0) = 0;
- timeDomAlloc->mappingType = PDSCH_MAPPING_TYPE_A;
- timeDomAlloc->startSymbolAndLength = \
- calcSliv(PDSCH_START_SYMBOL, PDSCH_LENGTH_SYMBOL);
+ idx = 0;
+ timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx];
+ DU_ALLOC(timeDomAlloc->k0, sizeof(long));
+ if(!timeDomAlloc->k0)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
+ return RFAILED;
+ }
+ *(timeDomAlloc->k0) = 0;
+ timeDomAlloc->mappingType = PDSCH_MAPPING_TYPE_A;
+ timeDomAlloc->startSymbolAndLength = \
+ calcSliv(PDSCH_START_SYMBOL, PDSCH_LENGTH_SYMBOL);
- idx++;
- timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx];
- DU_ALLOC(timeDomAlloc->k0, sizeof(long));
- if(!timeDomAlloc->k0)
+ idx++;
+ timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx];
+ DU_ALLOC(timeDomAlloc->k0, sizeof(long));
+ if(!timeDomAlloc->k0)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
+ return RFAILED;
+ }
+ *(timeDomAlloc->k0) = 1;
+ timeDomAlloc->mappingType = PDSCH_MAPPING_TYPE_A;
+ timeDomAlloc->startSymbolAndLength = calcSliv(PDSCH_START_SYMBOL, PDSCH_LENGTH_SYMBOL);
+ }
+ else
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
- return RFAILED;
+ for(idx = 0; idx < elementCnt; idx++)
+ {
+ timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx];
+ if(pdschCfg->timeDomRsrcAllociList[idx].k0)
+ {
+ DU_ALLOC(timeDomAlloc->k0, sizeof(long));
+ if(!timeDomAlloc->k0)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
+ return RFAILED;
+ }
+ *(timeDomAlloc->k0) = *(pdschCfg->timeDomRsrcAllociList[idx].k0);
+ }
+ timeDomAlloc->mappingType = pdschCfg->timeDomRsrcAllociList[idx].mappingType;
+ timeDomAlloc->startSymbolAndLength = pdschCfg->timeDomRsrcAllociList[idx].startSymbolAndLength;
+ }
}
- *(timeDomAlloc->k0) = 1;
- timeDomAlloc->mappingType = PDSCH_MAPPING_TYPE_A;
- timeDomAlloc->startSymbolAndLength = calcSliv(PDSCH_START_SYMBOL, PDSCH_LENGTH_SYMBOL);
return ROK;
}
* RFAILED - failure
*
* ****************************************************************/
- uint8_t BuildPdschPrbBundlingType
-(
- struct PDSCH_Config__prb_BundlingType *prbBndlType
- )
+uint8_t BuildPdschPrbBundlingType(PdschConfig *pdschCfg, struct PDSCH_Config__prb_BundlingType *prbBndlType)
{
- prbBndlType->present = PDSCH_Config__prb_BundlingType_PR_staticBundling;
+ if(pdschCfg == NULLP)
+ prbBndlType->present = PDSCH_Config__prb_BundlingType_PR_staticBundling;
+ else
+ prbBndlType->present = pdschCfg->bundlingType;
prbBndlType->choice.staticBundling = NULLP;
DU_ALLOC(prbBndlType->choice.staticBundling, \
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildBWPDlDedPdschCfg(struct PDSCH_Config *pdschCfg)
+uint8_t BuildBWPDlDedPdschCfg(PdschConfig *pdschCfgDb, struct PDSCH_Config *pdschCfg)
{
pdschCfg->dataScramblingIdentityPDSCH = NULLP;
pdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA = NULLP;
- DU_ALLOC(pdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA, \
- sizeof(struct PDSCH_Config__dmrs_DownlinkForPDSCH_MappingTypeA));
+ DU_ALLOC(pdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA, sizeof(struct PDSCH_Config__dmrs_DownlinkForPDSCH_MappingTypeA));
if(!pdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
return RFAILED;
}
- if(BuildDMRSDLPdschMapTypeA(pdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA) != ROK)
+ if(BuildDMRSDLPdschMapTypeA(pdschCfgDb, pdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA) != ROK)
{
return RFAILED;
}
}
#endif
+if(pdschCfgDb == NULLP)
pdschCfg->resourceAllocation = RES_ALLOC_TYPE;
+else
+pdschCfg->resourceAllocation = pdschCfgDb->resourceAllocType;
pdschCfg->pdsch_TimeDomainAllocationList = NULLP;
- DU_ALLOC(pdschCfg->pdsch_TimeDomainAllocationList, \
- sizeof(struct PDSCH_Config__pdsch_TimeDomainAllocationList));
+ DU_ALLOC(pdschCfg->pdsch_TimeDomainAllocationList, sizeof(struct PDSCH_Config__pdsch_TimeDomainAllocationList));
if(!pdschCfg->pdsch_TimeDomainAllocationList)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
return RFAILED;
}
-
- if(BuildPdschTimeDomAllocList(pdschCfg->pdsch_TimeDomainAllocationList) != ROK)
+ if(BuildPdschTimeDomAllocList(pdschCfgDb, pdschCfg->pdsch_TimeDomainAllocationList) != ROK)
{
return RFAILED;
}
pdschCfg->rateMatchPatternToReleaseList = NULLP;
pdschCfg->rateMatchPatternGroup1 = NULLP;
pdschCfg->rateMatchPatternGroup2 = NULLP;
- pdschCfg->rbg_Size = PDSCH_RBG_SIZE;
+ if(pdschCfgDb == NULLP)
+ pdschCfg->rbg_Size = PDSCH_RBG_SIZE;
+ else
+ pdschCfg->rbg_Size = pdschCfgDb->rbgSize;
pdschCfg->mcs_Table = NULLP;
pdschCfg->maxNrofCodeWordsScheduledByDCI = NULLP;
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
return RFAILED;
}
- *(pdschCfg->maxNrofCodeWordsScheduledByDCI) = PDSCH_MAX_CODEWORD_SCH_BY_DCI;
+ if(pdschCfgDb == NULLP)
+ *(pdschCfg->maxNrofCodeWordsScheduledByDCI) = PDSCH_MAX_CODEWORD_SCH_BY_DCI;
+ else
+ *(pdschCfg->maxNrofCodeWordsScheduledByDCI) = pdschCfgDb->numCodeWordsSchByDci;
- if(BuildPdschPrbBundlingType(&pdschCfg->prb_BundlingType) != ROK)
+ if(BuildPdschPrbBundlingType(pdschCfgDb, &pdschCfg->prb_BundlingType) != ROK)
{
return RFAILED;
}
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildInitialDlBWP(BWP_DownlinkDedicated_t *dlBwp)
+uint8_t BuildInitialDlBWP(InitialDlBwp *initiDlBwp, BWP_DownlinkDedicated_t *dlBwp)
{
+ PdcchConfig *pdcchCfg = NULLP;
+ PdschConfig *pdschCfg = NULLP;
+
+ if(initiDlBwp)
+ {
+ if(initiDlBwp->pdcchPresent)
+ pdcchCfg = &initiDlBwp->pdcchCfg;
+ if(initiDlBwp->pdschPresent)
+ pdschCfg = &initiDlBwp->pdschCfg;
+ }
+
dlBwp->pdcch_Config = NULLP;
DU_ALLOC(dlBwp->pdcch_Config, sizeof(struct BWP_DownlinkDedicated__pdcch_Config));
if(!dlBwp->pdcch_Config)
DU_LOG("\nERROR --> F1AP : Memory Allocation failure in BuildInitialDlBWP");
return RFAILED;
}
- if(BuildBWPDlDedPdcchCfg(dlBwp->pdcch_Config->choice.setup) != ROK)
+ if(BuildBWPDlDedPdcchCfg(pdcchCfg, dlBwp->pdcch_Config->choice.setup) != ROK)
{
return RFAILED;
}
return RFAILED;
}
- if(BuildBWPDlDedPdschCfg(dlBwp->pdsch_Config->choice.setup) != ROK)
+ if(BuildBWPDlDedPdschCfg(pdschCfg, dlBwp->pdsch_Config->choice.setup) != ROK)
{
return RFAILED;
}
* RFAILED - failure
*
* ****************************************************************/
- uint8_t BuildDMRSULPuschMapTypeA
-(
- struct PUSCH_Config__dmrs_UplinkForPUSCH_MappingTypeA *dmrsUlCfg
- )
+uint8_t BuildDMRSULPuschMapTypeA(DmrsUlCfg *ulDmrsCfgDb, struct PUSCH_Config__dmrs_UplinkForPUSCH_MappingTypeA *dmrsUlCfg)
{
dmrsUlCfg->present = PUSCH_Config__dmrs_UplinkForPUSCH_MappingTypeA_PR_setup;
dmrsUlCfg->choice.setup= NULLP;
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDMRSULPuschMapTypeA");
return RFAILED;
}
- *(dmrsUlCfg->choice.setup->dmrs_AdditionalPosition) = DMRS_ADDITIONAL_POS;
+ if(ulDmrsCfgDb == NULLP)
+ *(dmrsUlCfg->choice.setup->dmrs_AdditionalPosition) = DMRS_ADDITIONAL_POS;
+ else
+ *(dmrsUlCfg->choice.setup->dmrs_AdditionalPosition) = ulDmrsCfgDb->addPos;
dmrsUlCfg->choice.setup->phaseTrackingRS = NULLP;
dmrsUlCfg->choice.setup->maxLength = NULLP;
dmrsUlCfg->choice.setup->transformPrecodingDisabled = NULLP;
- DU_ALLOC(dmrsUlCfg->choice.setup->transformPrecodingDisabled, \
- sizeof(struct DMRS_UplinkConfig__transformPrecodingDisabled));
+ DU_ALLOC(dmrsUlCfg->choice.setup->transformPrecodingDisabled, sizeof(struct DMRS_UplinkConfig__transformPrecodingDisabled));
if(!dmrsUlCfg->choice.setup->transformPrecodingDisabled)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDMRSULPuschMapTypeA");
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDMRSULPuschMapTypeA");
return RFAILED;
}
- *(dmrsUlCfg->choice.setup->transformPrecodingDisabled->scramblingID0) = SCRAMBLING_ID;
+ if(ulDmrsCfgDb == NULLP)
+ *(dmrsUlCfg->choice.setup->transformPrecodingDisabled->scramblingID0) = SCRAMBLING_ID;
+ else
+ *(dmrsUlCfg->choice.setup->transformPrecodingDisabled->scramblingID0) = ulDmrsCfgDb->transPrecodDisabled.scramblingId0;
dmrsUlCfg->choice.setup->transformPrecodingDisabled->scramblingID1 = NULLP;
dmrsUlCfg->choice.setup->transformPrecodingEnabled = NULLP;
* RFAILED - failure
*
* ****************************************************************/
- uint8_t BuildPuschTimeDomAllocList
-(
- struct PUSCH_Config__pusch_TimeDomainAllocationList *timeDomAllocList
- )
+uint8_t BuildPuschTimeDomAllocList(PuschCfg *puschCfgDb, struct PUSCH_Config__pusch_TimeDomainAllocationList *timeDomAllocList)
{
uint8_t idx;
uint8_t elementCnt;
timeDomAllocList->present = PUSCH_Config__pusch_TimeDomainAllocationList_PR_setup;
timeDomAllocList->choice.setup = NULLP;
- DU_ALLOC(timeDomAllocList->choice.setup, \
- sizeof(struct PUSCH_TimeDomainResourceAllocationList));
+ DU_ALLOC(timeDomAllocList->choice.setup, sizeof(struct PUSCH_TimeDomainResourceAllocationList));
if(!timeDomAllocList->choice.setup)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
return RFAILED;
}
- elementCnt = 2;
+ if(puschCfgDb == NULLP)
+ elementCnt = 2;
+ else
+ elementCnt = puschCfgDb->numTimeDomRsrcAlloc;
+
timeDomAllocList->choice.setup->list.count = elementCnt;
- timeDomAllocList->choice.setup->list.size = \
- elementCnt * sizeof(PUSCH_TimeDomainResourceAllocation_t *);
+ timeDomAllocList->choice.setup->list.size = elementCnt * sizeof(PUSCH_TimeDomainResourceAllocation_t *);
timeDomAllocList->choice.setup->list.array = NULLP;
- DU_ALLOC(timeDomAllocList->choice.setup->list.array, \
- timeDomAllocList->choice.setup->list.size);
+ DU_ALLOC(timeDomAllocList->choice.setup->list.array, timeDomAllocList->choice.setup->list.size);
if(!timeDomAllocList->choice.setup->list.array)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
for(idx = 0; idx < elementCnt; idx++)
{
timeDomAllocList->choice.setup->list.array[idx] = NULLP;
- DU_ALLOC(timeDomAllocList->choice.setup->list.array[idx],\
- sizeof(PUSCH_TimeDomainResourceAllocation_t));
+ DU_ALLOC(timeDomAllocList->choice.setup->list.array[idx], sizeof(PUSCH_TimeDomainResourceAllocation_t));
if(!timeDomAllocList->choice.setup->list.array[idx])
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
- return RFAILED;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
+ return RFAILED;
}
}
- idx = 0;
- timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx];
- DU_ALLOC(timeDomAlloc->k2, sizeof(long));
- if(!timeDomAlloc->k2)
+ for(idx = 0; idx < elementCnt; idx++)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
- return RFAILED;
- }
- *(timeDomAlloc->k2) = PUSCH_K2_CFG1;
- timeDomAlloc->mappingType = PUSCH_MAPPING_TYPE_A;
- timeDomAlloc->startSymbolAndLength = calcSliv(PUSCH_START_SYMBOL, PUSCH_LENGTH_SYMBOL);
+ timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx];
+ DU_ALLOC(timeDomAlloc->k2, sizeof(long));
+ if(!timeDomAlloc->k2)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
+ return RFAILED;
+ }
+ if(puschCfgDb == NULLP)
+ {
+ if(idx == 0)
+ *(timeDomAlloc->k2) = PUSCH_K2_CFG1;
+ else if(idx == 1)
+ *(timeDomAlloc->k2) = PUSCH_K2_CFG2;
- idx++;
- timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx];
- DU_ALLOC(timeDomAlloc->k2, sizeof(long));
- if(!timeDomAlloc->k2)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
- return RFAILED;
+ timeDomAlloc->mappingType = PUSCH_MAPPING_TYPE_A;
+ timeDomAlloc->startSymbolAndLength = calcSliv(PUSCH_START_SYMBOL, PUSCH_LENGTH_SYMBOL);
+ }
+ else
+ {
+ *(timeDomAlloc->k2) = puschCfgDb->timeDomRsrcAllocList[idx].k2;
+ timeDomAlloc->mappingType = puschCfgDb->timeDomRsrcAllocList[idx].mappingType;
+ timeDomAlloc->startSymbolAndLength = puschCfgDb->timeDomRsrcAllocList[idx].startSymbolAndLength;
+ }
}
- *(timeDomAlloc->k2) = PUSCH_K2_CFG2;
- timeDomAlloc->mappingType = PUSCH_MAPPING_TYPE_A;
- timeDomAlloc->startSymbolAndLength = calcSliv(PUSCH_START_SYMBOL, PUSCH_LENGTH_SYMBOL);
return ROK;
}
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildBWPUlDedPuschCfg(PUSCH_Config_t *puschCfg)
+uint8_t BuildBWPUlDedPuschCfg(PuschCfg *puschCfgDb, PUSCH_Config_t *puschCfg)
{
+ DmrsUlCfg *ulDmrsCfg = NULLP;
+
+ if(puschCfgDb)
+ ulDmrsCfg = &puschCfgDb->dmrsUlCfgForPuschMapTypeA;
+
puschCfg->dataScramblingIdentityPUSCH = NULLP;
DU_ALLOC(puschCfg->dataScramblingIdentityPUSCH, sizeof(long));
if(!puschCfg->dataScramblingIdentityPUSCH)
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPuschCfg");
return RFAILED;
}
- *(puschCfg->dataScramblingIdentityPUSCH) = SCRAMBLING_ID;
+ if(puschCfgDb == NULLP)
+ *(puschCfg->dataScramblingIdentityPUSCH) = SCRAMBLING_ID;
+ else
+ *(puschCfg->dataScramblingIdentityPUSCH) = puschCfgDb->dataScramblingId;
puschCfg->txConfig = NULLP;
puschCfg->dmrs_UplinkForPUSCH_MappingTypeA = NULLP;
- DU_ALLOC(puschCfg->dmrs_UplinkForPUSCH_MappingTypeA, \
- sizeof(struct PUSCH_Config__dmrs_UplinkForPUSCH_MappingTypeA));
+ DU_ALLOC(puschCfg->dmrs_UplinkForPUSCH_MappingTypeA, sizeof(struct PUSCH_Config__dmrs_UplinkForPUSCH_MappingTypeA));
if(!puschCfg->dmrs_UplinkForPUSCH_MappingTypeA)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPuschCfg");
return RFAILED;
}
- if(BuildDMRSULPuschMapTypeA(puschCfg->dmrs_UplinkForPUSCH_MappingTypeA) != ROK)
+ if(BuildDMRSULPuschMapTypeA(ulDmrsCfg, puschCfg->dmrs_UplinkForPUSCH_MappingTypeA) != ROK)
{
return RFAILED;
}
puschCfg->pusch_PowerControl = NULLP;
puschCfg->frequencyHopping = NULLP;
puschCfg->frequencyHoppingOffsetLists = NULLP;
- puschCfg->resourceAllocation = RES_ALLOC_TYPE;
+
+ if(puschCfgDb == NULLP)
+ puschCfg->resourceAllocation = RES_ALLOC_TYPE;
+ else
+ puschCfg->resourceAllocation = puschCfgDb->resourceAllocType;
puschCfg->pusch_TimeDomainAllocationList = NULLP;
- DU_ALLOC(puschCfg->pusch_TimeDomainAllocationList, \
- sizeof(struct PUSCH_Config__pusch_TimeDomainAllocationList));
+ DU_ALLOC(puschCfg->pusch_TimeDomainAllocationList, sizeof(struct PUSCH_Config__pusch_TimeDomainAllocationList));
if(!puschCfg->pusch_TimeDomainAllocationList)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPuschCfg");
return RFAILED;
}
- if(BuildPuschTimeDomAllocList(puschCfg->pusch_TimeDomainAllocationList) != ROK)
+ if(BuildPuschTimeDomAllocList(puschCfgDb, puschCfg->pusch_TimeDomainAllocationList) != ROK)
{
return RFAILED;
}
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPuschCfg");
return RFAILED;
}
- *(puschCfg->transformPrecoder) = PUSCH_TRANSFORM_PRECODER;
+ if(puschCfgDb == NULLP)
+ *(puschCfg->transformPrecoder) = PUSCH_TRANSFORM_PRECODER;
+ else
+ *(puschCfg->transformPrecoder) = puschCfgDb->transformPrecoder;
puschCfg->codebookSubset = NULLP;
puschCfg->maxRank = NULLP;
/*******************************************************************
*
- * @brief Builds BWP UL dedicated PUCCH Config
+ * @brief Builds PUCCH resource set add/modify list
*
* @details
*
- * Function : BuildBWPUlDedPucchCfg
+ * Function : BuildPucchRsrcSetAddModList
*
* Functionality:
- * Builds BWP UL dedicated PUCCH Config
+ * Builds PUCCH resource set add/modify list
*
- * @params[in] : PUCCH_Config_t *pucchCfg
+ * @params[in] : PucchResrcSetCfg *rsrcSetCfgDb
+ * struct PUCCH_Config__resourceSetToAddModList *rsrcSetAddModList
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildBWPUlDedPucchCfg(PUCCH_Config_t *pucchCfg)
+uint8_t BuildPucchRsrcSetAddModList(PucchResrcSetCfg *rsrcSetCfgDb, \
+ struct PUCCH_Config__resourceSetToAddModList *resourceSetToAddModList)
{
- uint8_t arrIdx, elementCnt;
+ uint8_t elementCnt = 0, rsrcSetIdx = 0, rsrcIdx = 0;
+ PUCCH_ResourceSet_t *rsrcSet = NULLP;
- DU_ALLOC(pucchCfg->dl_DataToUL_ACK, sizeof(struct PUCCH_Config__dl_DataToUL_ACK));
- if(pucchCfg->dl_DataToUL_ACK == NULLP)
+ if(rsrcSetCfgDb == NULLP)
+ elementCnt = 1;
+ else
+ elementCnt = rsrcSetCfgDb->resrcSetToAddModListCount;
+
+ resourceSetToAddModList->list.count = elementCnt;
+ resourceSetToAddModList->list.size = elementCnt * sizeof(PUCCH_ResourceSet_t *);
+ DU_ALLOC(resourceSetToAddModList->list.array, resourceSetToAddModList->list.size);
+ if(resourceSetToAddModList->list.array == NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcSetAddModList");
return RFAILED;
}
-
- elementCnt = 2;
- pucchCfg->dl_DataToUL_ACK->list.count = elementCnt;
- pucchCfg->dl_DataToUL_ACK->list.size = elementCnt * sizeof(long *);
- DU_ALLOC(pucchCfg->dl_DataToUL_ACK->list.array, pucchCfg->dl_DataToUL_ACK->list.size);
- if(pucchCfg->dl_DataToUL_ACK->list.array == NULLP)
+ for(rsrcSetIdx=0; rsrcSetIdx < resourceSetToAddModList->list.count; rsrcSetIdx++)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
- return RFAILED;
- }
+ DU_ALLOC(resourceSetToAddModList->list.array[rsrcSetIdx], sizeof(PUCCH_ResourceSet_t));
+ if(resourceSetToAddModList->list.array[rsrcSetIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcSetAddModList");
+ return RFAILED;
+ }
+ }
- for(arrIdx = 0; arrIdx < pucchCfg->dl_DataToUL_ACK->list.count; arrIdx++)
+ for(rsrcSetIdx=0; rsrcSetIdx < resourceSetToAddModList->list.count; rsrcSetIdx++)
{
- DU_ALLOC(pucchCfg->dl_DataToUL_ACK->list.array[arrIdx], sizeof(long));
- if(pucchCfg->dl_DataToUL_ACK->list.array[arrIdx] == NULLP)
+ rsrcSet = resourceSetToAddModList->list.array[rsrcSetIdx];
+
+ /* Resource set Id */
+ if(rsrcSetCfgDb == NULLP)
+ rsrcSet->pucch_ResourceSetId = 1;
+ else
+ rsrcSet->pucch_ResourceSetId = rsrcSetCfgDb->resrcSetToAddModList[rsrcSetIdx].resrcSetId;
+
+ /* Resource list of a resource set */
+ if(rsrcSetCfgDb == NULLP)
+ elementCnt = 1;
+ else
+ elementCnt = rsrcSetCfgDb->resrcSetToAddModList[rsrcSetIdx].resrcListCount;
+ rsrcSet->resourceList.list.count = elementCnt;
+ rsrcSet->resourceList.list.size = elementCnt * sizeof(PUCCH_ResourceId_t *);
+ DU_ALLOC(rsrcSet->resourceList.list.array, rsrcSet->resourceList.list.size);
+ if(rsrcSet->resourceList.list.array == NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
- return RFAILED;
- }
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcSetAddModList");
+ return RFAILED;
+ }
+
+ for(rsrcIdx=0; rsrcIdx < rsrcSet->resourceList.list.count; rsrcIdx++)
+ {
+ DU_ALLOC(rsrcSet->resourceList.list.array[rsrcIdx], sizeof(PUCCH_ResourceId_t));
+ if(rsrcSet->resourceList.list.array[rsrcIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcSetAddModList");
+ return RFAILED;
+ }
+ }
+ for(rsrcIdx=0; rsrcIdx < rsrcSet->resourceList.list.count; rsrcIdx++)
+ {
+ if(rsrcSetCfgDb == NULLP)
+ *(rsrcSet->resourceList.list.array[rsrcIdx]) = 1;
+ else
+ *(rsrcSet->resourceList.list.array[rsrcIdx]) = rsrcSetCfgDb->resrcSetToAddModList[rsrcSetIdx].resrcList[rsrcIdx];
+ }
+
+ /* Max payload size (minus 1) in a Resource set */
+ rsrcSet->maxPayloadMinus1 = NULLP;
+ if(rsrcSetCfgDb && rsrcSetCfgDb->resrcSetToAddModList[rsrcSetIdx].maxPayLoadSize)
+ {
+ DU_ALLOC(rsrcSet->maxPayloadMinus1, sizeof(long));
+ if(rsrcSet->maxPayloadMinus1 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcSetAddModList");
+ return RFAILED;
+ }
+ *(rsrcSet->maxPayloadMinus1) = rsrcSetCfgDb->resrcSetToAddModList[rsrcSetIdx].maxPayLoadSize;
+ }
}
-
- arrIdx = 0;
- *(pucchCfg->dl_DataToUL_ACK->list.array[arrIdx++]) = 1;
- *(pucchCfg->dl_DataToUL_ACK->list.array[arrIdx]) = 2;
return ROK;
}
/*******************************************************************
*
- * @brief Fills SRS resource to add/modify list
+ * @brief Builds PUCCH resource add/modify list
*
* @details
*
- * Function : BuildSrsRsrcAddModList
+ * Function : BuildPucchRsrcAdddModList
*
- * Functionality: Fills SRS resource to add/modify list
+ * Functionality:
+ * Builds PUCCH resource add/modify list
+ *
+ * @params[in] : PucchResrcCfg *rsrcSetCfgDb
+ * struct PUCCH_Config__resourceSetToAddModList *rsrcSetAddModList
*
- * @params[in]
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildSrsRsrcAddModList(struct SRS_Config__srs_ResourceToAddModList *resourceList)
+uint8_t BuildPucchRsrcAddModList(PucchResrcCfg *rsrcCfgDb, struct PUCCH_Config__resourceToAddModList *resourceToAddModList)
{
- uint8_t elementCnt;
- uint8_t rsrcIdx;
+ uint8_t elementCnt = 0, rsrcIdx = 0;
+ PUCCH_Resource_t *rsrc = NULLP;
- elementCnt = 1;
- resourceList->list.count = elementCnt;
- resourceList->list.size = elementCnt * sizeof(SRS_Resource_t *);
- resourceList->list.array = NULLP;
- DU_ALLOC(resourceList->list.array, resourceList->list.size);
- if(!resourceList->list.array)
+ if(rsrcCfgDb == NULLP)
+ elementCnt = 1;
+ else
+ elementCnt = rsrcCfgDb->resrcToAddModListCount;
+ resourceToAddModList->list.count = elementCnt;
+ resourceToAddModList->list.size = elementCnt * sizeof(PUCCH_Resource_t *);
+ DU_ALLOC(resourceToAddModList->list.array, resourceToAddModList->list.size);
+ if(resourceToAddModList->list.array == NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcAddModList");
return RFAILED;
}
-
- for(rsrcIdx = 0; rsrcIdx < resourceList->list.count; rsrcIdx++)
+ for(rsrcIdx=0; rsrcIdx < resourceToAddModList->list.count; rsrcIdx++)
{
- DU_ALLOC(resourceList->list.array[rsrcIdx], sizeof(SRS_Resource_t));
- if(!resourceList->list.array[rsrcIdx])
+ DU_ALLOC(resourceToAddModList->list.array[rsrcIdx], sizeof(PUCCH_Resource_t));
+ if(resourceToAddModList->list.array[rsrcIdx] == NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcAddModList");
- return RFAILED;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcAddModList");
+ return RFAILED;
}
}
- rsrcIdx = 0;
- resourceList->list.array[rsrcIdx]->srs_ResourceId = SRS_RSRC_ID;
- resourceList->list.array[rsrcIdx]->nrofSRS_Ports = SRS_Resource__nrofSRS_Ports_port1;
- resourceList->list.array[rsrcIdx]->transmissionComb.present = SRS_Resource__transmissionComb_PR_n2;
-
- resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2 = NULLP;
- DU_ALLOC(resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2, \
- sizeof(struct SRS_Resource__transmissionComb__n2));
- if(!resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2)
+ for(rsrcIdx=0; rsrcIdx < resourceToAddModList->list.count; rsrcIdx++)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcAddModList");
- return RFAILED;
- }
- resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2->combOffset_n2\
- = SRS_COMB_OFFSET_N2;
- resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2->cyclicShift_n2\
- = SRS_CYCLIC_SHIFT_N2;
+ rsrc = resourceToAddModList->list.array[rsrcIdx];
- resourceList->list.array[rsrcIdx]->resourceMapping.startPosition = \
- PUSCH_START_SYMBOL;
- resourceList->list.array[rsrcIdx]->resourceMapping.nrofSymbols = \
- SRS_Resource__resourceMapping__nrofSymbols_n1;
- resourceList->list.array[rsrcIdx]->resourceMapping.repetitionFactor = \
- SRS_Resource__resourceMapping__repetitionFactor_n1;
+ if(rsrcCfgDb == NULLP)
+ {
+ rsrc->pucch_ResourceId = 1;
+ rsrc->startingPRB = 0;
+ rsrc->format.present = PUCCH_Resource__format_PR_format1;
+ DU_ALLOC(rsrc->format.choice.format1, sizeof(PUCCH_format1_t));
+ if(rsrc->format.choice.format1 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcAddModList");
+ return RFAILED;
+ }
+ rsrc->format.choice.format1->initialCyclicShift = 0;
+ rsrc->format.choice.format1->nrofSymbols = 4;
+ rsrc->format.choice.format1->startingSymbolIndex = 0;
+ rsrc->format.choice.format1->timeDomainOCC = 0;
+ }
+ else
+ {
+ rsrc->pucch_ResourceId = rsrcCfgDb->resrcToAddModList[rsrcIdx].resrcId;
+ rsrc->startingPRB = rsrcCfgDb->resrcToAddModList[rsrcIdx].startPrb;
+ if(rsrcCfgDb->resrcToAddModList[rsrcIdx].intraFreqHop)
+ {
+ DU_ALLOC(rsrc->intraSlotFrequencyHopping, sizeof(long));
+ if(rsrc->intraSlotFrequencyHopping == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcAddModList");
+ return RFAILED;
+ }
+ *(rsrc->intraSlotFrequencyHopping) = rsrcCfgDb->resrcToAddModList[rsrcIdx].intraFreqHop;
+ }
+ else
+ rsrc->intraSlotFrequencyHopping = NULLP;
+
+ if(rsrcCfgDb->resrcToAddModList[rsrcIdx].secondPrbHop)
+ {
+ DU_ALLOC(rsrc->secondHopPRB, sizeof(PRB_Id_t));
+ if(rsrc->secondHopPRB == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcAddModList");
+ return RFAILED;
+ }
+ *(rsrc->secondHopPRB) = rsrcCfgDb->resrcToAddModList[rsrcIdx].secondPrbHop;
+ }
+ else
+ rsrc->secondHopPRB = NULLP;
+ rsrc->format.present = covertPucchFormatIntEnumToRrcEnum(rsrcCfgDb->resrcToAddModList[rsrcIdx].pucchFormat);
+
+ switch(rsrc->format.present)
+ {
+ case PUCCH_Resource__format_PR_NOTHING:
+ break;
+ case PUCCH_Resource__format_PR_format0:
+ {
+ DU_ALLOC(rsrc->format.choice.format0, sizeof(PUCCH_format0_t));
+ if(rsrc->format.choice.format0 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcAddModList");
+ return RFAILED;
+ }
+ rsrc->format.choice.format0->initialCyclicShift = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format0->initialCyclicShift;
+ rsrc->format.choice.format0->nrofSymbols = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format0->numSymbols;
+ rsrc->format.choice.format0->startingSymbolIndex = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format0->startSymbolIdx;
+ break;
+ }
+
+ case PUCCH_Resource__format_PR_format1:
+ {
+ DU_ALLOC(rsrc->format.choice.format1, sizeof(PUCCH_format1_t));
+ if(rsrc->format.choice.format1 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcAddModList");
+ return RFAILED;
+ }
+ rsrc->format.choice.format1->initialCyclicShift = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format1->initialCyclicShift;
+ rsrc->format.choice.format1->nrofSymbols = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format1->numSymbols;
+ rsrc->format.choice.format1->startingSymbolIndex = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format1->startSymbolIdx;
+ rsrc->format.choice.format1->timeDomainOCC = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format1->timeDomOCC;
+ break;
+ }
+
+ case PUCCH_Resource__format_PR_format2:
+ {
+ DU_ALLOC(rsrc->format.choice.format2, sizeof(PUCCH_format2_t));
+ if(rsrc->format.choice.format2 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcAddModList");
+ return RFAILED;
+ }
+ rsrc->format.choice.format2->nrofPRBs = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format2->numPrbs;
+ rsrc->format.choice.format2->nrofSymbols = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format2->numSymbols;
+ rsrc->format.choice.format2->startingSymbolIndex = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format2->startSymbolIdx;
+ break;
+ }
+
+ case PUCCH_Resource__format_PR_format3:
+ {
+ DU_ALLOC(rsrc->format.choice.format3, sizeof(PUCCH_format3_t));
+ if(rsrc->format.choice.format3 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcAddModList");
+ return RFAILED;
+ }
+ rsrc->format.choice.format3->nrofPRBs = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format3->numPrbs;
+ rsrc->format.choice.format3->nrofSymbols = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format3->numSymbols;
+ rsrc->format.choice.format3->startingSymbolIndex = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format3->startSymbolIdx;
+ break;
+ }
+
+ case PUCCH_Resource__format_PR_format4:
+ {
+ DU_ALLOC(rsrc->format.choice.format4, sizeof(PUCCH_format4_t));
+ if(rsrc->format.choice.format4 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchRsrcAddModList");
+ return RFAILED;
+ }
+ rsrc->format.choice.format4->nrofSymbols = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format4->numSymbols;
+ rsrc->format.choice.format4->occ_Length = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format4->occLen;
+ rsrc->format.choice.format4->occ_Index = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format4->occIdx;
+ rsrc->format.choice.format4->startingSymbolIndex = rsrcCfgDb->resrcToAddModList[rsrcIdx].PucchFormat.format4->startSymbolIdx;
+ break;
+ }
+ }
+ }
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds PUCCH format config
+ *
+ * @details
+ *
+ * Function : BuildPucchFormat
+ *
+ * Functionality: Builds PUCCH format config
+ *
+ * @params[in] : PucchFormatCfg *formatDb
+ * PUCCH_FormatConfig_t *format
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildPucchFormat(PucchFormatCfg *formatDb, PUCCH_FormatConfig_t *format)
+{
+ /* Inter Slot Fequency hopping */
+ format->interslotFrequencyHopping = NULLP;
+ if((formatDb != NULLP) && (formatDb->interSlotFreqHop == true))
+ {
+ DU_ALLOC(format->interslotFrequencyHopping, sizeof(long));
+ if(format->interslotFrequencyHopping)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchFormat");
+ return RFAILED;
+ }
+ *(format->interslotFrequencyHopping) = PUCCH_FormatConfig__interslotFrequencyHopping_enabled;
+ }
+
+ /* Additional DMRS */
+ format->additionalDMRS = NULLP;
+ if((formatDb != NULLP) && (formatDb->addDmrs == true))
+ {
+ DU_ALLOC(format->additionalDMRS, sizeof(long));
+ if(format->additionalDMRS)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchFormat");
+ return RFAILED;
+ }
+ *(format->additionalDMRS) = PUCCH_FormatConfig__additionalDMRS_true;
+ }
+
+ /* Maximum code rate */
+ format->maxCodeRate = NULLP;
+ if((formatDb != NULLP) && (formatDb->maxCodeRate != 0))
+ {
+ DU_ALLOC(format->maxCodeRate, sizeof(long));
+ if(format->maxCodeRate)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchFormat");
+ return RFAILED;
+ }
+ *(format->maxCodeRate) = formatDb->maxCodeRate;
+ }
+
+ /* Number of slots */
+ format->nrofSlots = NULLP;
+ if((formatDb == NULLP) || ((formatDb != NULLP) && (formatDb->numSlots != 0)))
+ {
+ DU_ALLOC(format->nrofSlots, sizeof(long));
+ if(format->nrofSlots == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchFormat");
+ return RFAILED;
+ }
+ if(formatDb == NULLP)
+ *(format->nrofSlots) = PUCCH_FormatConfig__nrofSlots_n4;
+ else
+ *(format->nrofSlots) = formatDb->numSlots;
+ }
+
+ /* Pi2BPSK*/
+ format->pi2BPSK = NULLP;
+ if((formatDb != NULLP) && (formatDb->pi2BPSK == true))
+ {
+ DU_ALLOC(format->pi2BPSK, sizeof(long));
+ if(format->pi2BPSK)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchFormat");
+ return RFAILED;
+ }
+ *(format->pi2BPSK) = PUCCH_FormatConfig__pi2BPSK_enabled;
+ }
+
+ /* Simultaneous HARQ ACK and CSI */
+ format->simultaneousHARQ_ACK_CSI = NULLP;
+ if((formatDb != NULLP) && (formatDb->harqAckCSI == true))
+ {
+ DU_ALLOC(format->simultaneousHARQ_ACK_CSI, sizeof(long));
+ if(format->simultaneousHARQ_ACK_CSI)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPucchFormat");
+ return RFAILED;
+ }
+ *(format->simultaneousHARQ_ACK_CSI) = PUCCH_FormatConfig__simultaneousHARQ_ACK_CSI_true;
+ }
+
+ return ROK;
+}
+
+
+/*******************************************************************
+ *
+ * @brief Builds PUCCH scheduling request list
+ *
+ * @details
+ *
+ * Function : BuildPucchSchReqAddModList
+ *
+ * Functionality:
+ * Builds PUCCH scheduling request list
+ *
+ * @params[in] : PucchSchedReqCfg *schReqDb
+ * struct PUCCH_Config__schedulingRequestResourceToAddModList *schReqRsrcToAddModList
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildPucchSchReqAddModList(PucchSchedReqCfg *schReqDb, \
+ struct PUCCH_Config__schedulingRequestResourceToAddModList *schReqRsrcToAddModList)
+{
+ uint8_t elementCnt = 0, schReqIdx = 0;
+ SchedulingRequestResourceConfig_t *schReqRsrc;
+
+ elementCnt = schReqDb->schedAddModListCount;
+ schReqRsrcToAddModList->list.count = elementCnt;
+ schReqRsrcToAddModList->list.size = elementCnt *sizeof(struct SchedulingRequestResourceConfig *);
+
+ schReqRsrcToAddModList->list.array = NULLP;
+ DU_ALLOC(schReqRsrcToAddModList->list.array, schReqRsrcToAddModList->list.size);
+ if(schReqRsrcToAddModList->list.array == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: Memory allocation failed in BuildPucchSchReqAddModList");
+ return RFAILED;
+ }
+
+ for(schReqIdx = 0; schReqIdx < schReqRsrcToAddModList->list.count; schReqIdx++)
+ {
+ DU_ALLOC(schReqRsrcToAddModList->list.array[schReqIdx], schReqRsrcToAddModList->list.size);
+ if(schReqRsrcToAddModList->list.array[schReqIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: Memory allocation failed in BuildPucchSchReqAddModList");
+ return RFAILED;
+ }
+ }
+
+ for(schReqIdx = 0; schReqIdx < schReqRsrcToAddModList->list.count; schReqIdx++)
+ {
+ schReqRsrc = schReqRsrcToAddModList->list.array[schReqIdx];
+ schReqRsrc->schedulingRequestResourceId = schReqDb->schedAddModList[schReqIdx].resrcId;
+ schReqRsrc->schedulingRequestID = schReqDb->schedAddModList[schReqIdx].requestId;
+
+ if(schReqDb->schedAddModList[schReqIdx].periodicity)
+ {
+ schReqRsrc->periodicityAndOffset = NULLP;
+ DU_ALLOC(schReqRsrc->periodicityAndOffset, sizeof(struct SchedulingRequestResourceConfig__periodicityAndOffset));
+ if(schReqRsrc->periodicityAndOffset == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: Memory allocation failed in BuildPucchSchReqAddModList");
+ return RFAILED;
+ }
+
+ schReqRsrc->periodicityAndOffset->present = schReqDb->schedAddModList[schReqIdx].periodicity;
+ switch(schReqRsrc->periodicityAndOffset->present)
+ {
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_NOTHING:
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sym2:
+ schReqRsrc->periodicityAndOffset->choice.sym2 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sym6or7:
+ schReqRsrc->periodicityAndOffset->choice.sym6or7 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl1:
+ schReqRsrc->periodicityAndOffset->choice.sl1 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl2:
+ schReqRsrc->periodicityAndOffset->choice.sl2 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl4:
+ schReqRsrc->periodicityAndOffset->choice.sl4 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl5:
+ schReqRsrc->periodicityAndOffset->choice.sl5 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl8:
+ schReqRsrc->periodicityAndOffset->choice.sl8 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl10:
+ schReqRsrc->periodicityAndOffset->choice.sl10 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl16:
+ schReqRsrc->periodicityAndOffset->choice.sl16 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl20:
+ schReqRsrc->periodicityAndOffset->choice.sl20 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40:
+ schReqRsrc->periodicityAndOffset->choice.sl40 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl80:
+ schReqRsrc->periodicityAndOffset->choice.sl80 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl160:
+ schReqRsrc->periodicityAndOffset->choice.sl160 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl320:
+ schReqRsrc->periodicityAndOffset->choice.sl320 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl640:
+ schReqRsrc->periodicityAndOffset->choice.sl640 = schReqDb->schedAddModList[schReqIdx].offset;
+ break;
+ }
+ }
+
+ if(schReqDb->schedAddModList[schReqIdx].resrc)
+ {
+ schReqRsrc->resource = NULLP;
+ DU_ALLOC(schReqRsrc->resource, sizeof(PUCCH_ResourceId_t));
+ if(schReqRsrc->resource == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: Memory allocation failed in BuildPucchSchReqAddModList");
+ return RFAILED;
+ }
+ *(schReqRsrc->resource) = schReqDb->schedAddModList[schReqIdx].resrc;
+
+ }
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds PUCCH multi csi resource list
+ *
+ * @details
+ *
+ * Function : BuildPucchMultiCsiRsrcList
+ *
+ * Functionality:
+ * Builds PUCCH multi csi resource list
+ *
+ * @params[in] : PucchMultiCsiCfg *multiCsiDb
+ * struct PUCCH_Config__multi_CSI_PUCCH_ResourceList *multiCsiRsrcList
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildPucchMultiCsiRsrcList(PucchMultiCsiCfg *multiCsiDb, struct PUCCH_Config__multi_CSI_PUCCH_ResourceList *multiCsiRsrcList)
+{
+ uint8_t elementCnt = 0, rsrcIdx = 0;
+
+ elementCnt = multiCsiDb->multiCsiResrcListCount;
+ multiCsiRsrcList->list.count = elementCnt;
+ multiCsiRsrcList->list.size = elementCnt * sizeof(PUCCH_ResourceId_t *);
+ multiCsiRsrcList->list.array = NULLP;
+ DU_ALLOC(multiCsiRsrcList->list.array, multiCsiRsrcList->list.size);
+ if(multiCsiRsrcList->list.array == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: Memory allocation failed in BuildPucchMultiCsiRsrcList");
+ return RFAILED;
+ }
+
+ for(rsrcIdx = 0; rsrcIdx<multiCsiRsrcList->list.count; rsrcIdx++)
+ {
+ DU_ALLOC(multiCsiRsrcList->list.array[rsrcIdx], sizeof(PUCCH_ResourceId_t));
+ if(multiCsiRsrcList->list.array[rsrcIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: Memory allocation failed in BuildPucchMultiCsiRsrcList");
+ return RFAILED;
+ }
+ }
+
+ for(rsrcIdx = 0; rsrcIdx<multiCsiRsrcList->list.count; rsrcIdx++)
+ {
+ *(multiCsiRsrcList->list.array[rsrcIdx]) = multiCsiDb->multiCsiResrcList[rsrcIdx];
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds DL data -to- Ul Ack list
+ *
+ * @details
+ *
+ * Function : BuildDlDataToUlAckList
+ *
+ * Functionality: Builds DL data -to- Ul Ack list
+ *
+ * @params[in] : PucchDlDataToUlAck *dlDataToUlAckDb
+ * struct PUCCH_Config__dl_DataToUL_ACK * dlDataToUlACKList
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildDlDataToUlAckList(PucchDlDataToUlAck *dlDataToUlAckDb, struct PUCCH_Config__dl_DataToUL_ACK * dlDataToUlACKList)
+{
+ uint8_t elementCnt = 0, arrIdx = 0;
+
+ if(dlDataToUlAckDb == NULLP)
+ elementCnt = 2;
+ else
+ elementCnt = dlDataToUlAckDb->dlDataToUlAckListCount;
+
+ dlDataToUlACKList->list.count = elementCnt;
+ dlDataToUlACKList->list.size = elementCnt * sizeof(long *);
+ DU_ALLOC(dlDataToUlACKList->list.array, dlDataToUlACKList->list.size);
+ if(dlDataToUlACKList->list.array == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDlDataToUlAckList");
+ return RFAILED;
+ }
+
+ for(arrIdx = 0; arrIdx < dlDataToUlACKList->list.count; arrIdx++)
+ {
+ DU_ALLOC(dlDataToUlACKList->list.array[arrIdx], sizeof(long));
+ if(dlDataToUlACKList->list.array[arrIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDlDataToUlAckList");
+ return RFAILED;
+ }
+ }
+
+ if(dlDataToUlAckDb == NULLP)
+ {
+ arrIdx = 0;
+ *(dlDataToUlACKList->list.array[arrIdx++]) = 1;
+ *(dlDataToUlACKList->list.array[arrIdx]) = 2;
+ }
+ else
+ {
+ for(arrIdx = 0; arrIdx < dlDataToUlACKList->list.count; arrIdx++)
+ {
+ *(dlDataToUlACKList->list.array[arrIdx]) = dlDataToUlAckDb->dlDataToUlAckList[arrIdx];
+ }
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds BWP UL dedicated PUCCH Config
+ *
+ * @details
+ *
+ * Function : BuildBWPUlDedPucchCfg
+ *
+ * Functionality:
+ * Builds BWP UL dedicated PUCCH Config
+ *
+ * @params[in] : PUCCH_Config_t *pucchCfg
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildBWPUlDedPucchCfg(PucchCfg *pucchCfgDb, PUCCH_Config_t *pucchCfg)
+{
+ PucchResrcSetCfg *rsrcSetCfgDb = NULLP;
+ PucchResrcCfg *rsrcCfgDb = NULLP;
+ PucchFormatCfg *format1Db = NULLP;
+ PucchFormatCfg *format2Db = NULLP;
+ PucchFormatCfg *format3Db = NULLP;
+ PucchFormatCfg *format4Db = NULLP;
+ PucchSchedReqCfg *schReqDb = NULLP;
+ PucchMultiCsiCfg *multiCsiDb = NULLP;
+ PucchDlDataToUlAck *dlDataToUlAckDb = NULLP;
+
+ if(pucchCfgDb)
+ {
+ rsrcSetCfgDb = pucchCfgDb->resrcSet;
+ rsrcCfgDb = pucchCfgDb->resrc;
+ format1Db = pucchCfgDb->format1;
+ format2Db = pucchCfgDb->format2;
+ format3Db = pucchCfgDb->format3;
+ format4Db = pucchCfgDb->format4;
+ schReqDb = pucchCfgDb->schedReq;
+ multiCsiDb = pucchCfgDb->multiCsiCfg;
+ dlDataToUlAckDb = pucchCfgDb->dlDataToUlAck;
+ }
+
+ /* RESOURCE SET */
+ DU_ALLOC(pucchCfg->resourceSetToAddModList, sizeof(struct PUCCH_Config__resourceSetToAddModList));
+ if(pucchCfg->resourceSetToAddModList == NULL)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ if(BuildPucchRsrcSetAddModList(rsrcSetCfgDb, pucchCfg->resourceSetToAddModList) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ /* PUCCH RESOURCE */
+ DU_ALLOC(pucchCfg->resourceToAddModList, sizeof(struct PUCCH_Config__resourceToAddModList));
+ if(pucchCfg->resourceToAddModList == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ if(BuildPucchRsrcAddModList(rsrcCfgDb, pucchCfg->resourceToAddModList) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ /* PUCCH Format 1 */
+ DU_ALLOC(pucchCfg->format1, sizeof(struct PUCCH_Config__format1));
+ if(pucchCfg->format1 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ pucchCfg->format1->present = PUCCH_Config__format1_PR_setup;
+ DU_ALLOC(pucchCfg->format1->choice.setup, sizeof(PUCCH_FormatConfig_t));
+ if(pucchCfg->format1->choice.setup == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ if(BuildPucchFormat(format1Db, pucchCfg->format1->choice.setup) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ /* PUCCH Format 2 */
+ if(format2Db)
+ {
+ DU_ALLOC(pucchCfg->format2, sizeof(struct PUCCH_Config__format2));
+ if(pucchCfg->format2 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ pucchCfg->format2->present = PUCCH_Config__format2_PR_setup;
+ DU_ALLOC(pucchCfg->format2->choice.setup, sizeof(PUCCH_FormatConfig_t));
+ if(pucchCfg->format2->choice.setup == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ if(BuildPucchFormat(format2Db, pucchCfg->format2->choice.setup) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+ }
+
+ /* PUCCH Format 3 */
+ if(format3Db)
+ {
+ DU_ALLOC(pucchCfg->format3, sizeof(struct PUCCH_Config__format3));
+ if(pucchCfg->format3 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ pucchCfg->format3->present = PUCCH_Config__format3_PR_setup;
+ DU_ALLOC(pucchCfg->format3->choice.setup, sizeof(PUCCH_FormatConfig_t));
+ if(pucchCfg->format3->choice.setup == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ if(BuildPucchFormat(format3Db, pucchCfg->format3->choice.setup) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+ }
+
+ /* PUCCH Format 4 */
+ if(format4Db)
+ {
+ DU_ALLOC(pucchCfg->format4, sizeof(struct PUCCH_Config__format4));
+ if(pucchCfg->format4 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ pucchCfg->format4->present = PUCCH_Config__format4_PR_setup;
+ DU_ALLOC(pucchCfg->format4->choice.setup, sizeof(PUCCH_FormatConfig_t));
+ if(pucchCfg->format4->choice.setup == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ if(BuildPucchFormat(format4Db, pucchCfg->format4->choice.setup) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+ }
+
+ /* Scheduling Request */
+ if(schReqDb && (schReqDb->schedAddModListCount != 0))
+ {
+ pucchCfg->schedulingRequestResourceToAddModList = NULLP;
+ DU_ALLOC(pucchCfg->schedulingRequestResourceToAddModList, sizeof(struct PUCCH_Config__schedulingRequestResourceToAddModList));
+ if(pucchCfg->schedulingRequestResourceToAddModList == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ if(BuildPucchSchReqAddModList(schReqDb, pucchCfg->schedulingRequestResourceToAddModList) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+ }
+
+ /* Multi CSI */
+ if(multiCsiDb && (multiCsiDb->multiCsiResrcListCount != 0))
+ {
+ pucchCfg->multi_CSI_PUCCH_ResourceList = NULLP;
+ DU_ALLOC(pucchCfg->multi_CSI_PUCCH_ResourceList, sizeof(struct PUCCH_Config__multi_CSI_PUCCH_ResourceList));
+ if(pucchCfg->multi_CSI_PUCCH_ResourceList == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ if(BuildPucchMultiCsiRsrcList(multiCsiDb, pucchCfg->multi_CSI_PUCCH_ResourceList) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+ }
+
+ /* DL DATA TO UL ACK */
+ DU_ALLOC(pucchCfg->dl_DataToUL_ACK, sizeof(struct PUCCH_Config__dl_DataToUL_ACK));
+ if(pucchCfg->dl_DataToUL_ACK == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ if(BuildDlDataToUlAckList(dlDataToUlAckDb, pucchCfg->dl_DataToUL_ACK) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+ return RFAILED;
+ }
+
+ /* TODO : spatial relation info add/mod list and power control*/
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills SRS resource to add/modify list
+ *
+ * @details
+ *
+ * Function : BuildSrsRsrcAddModList
+ *
+ * Functionality: Fills SRS resource to add/modify list
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildSrsRsrcAddModList(struct SRS_Config__srs_ResourceToAddModList *resourceList)
+{
+ uint8_t elementCnt;
+ uint8_t rsrcIdx;
+
+ elementCnt = 1;
+ resourceList->list.count = elementCnt;
+ resourceList->list.size = elementCnt * sizeof(SRS_Resource_t *);
+ resourceList->list.array = NULLP;
+ DU_ALLOC(resourceList->list.array, resourceList->list.size);
+ if(!resourceList->list.array)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcAddModList");
+ return RFAILED;
+ }
+
+ for(rsrcIdx = 0; rsrcIdx < resourceList->list.count; rsrcIdx++)
+ {
+ DU_ALLOC(resourceList->list.array[rsrcIdx], sizeof(SRS_Resource_t));
+ if(!resourceList->list.array[rsrcIdx])
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcAddModList");
+ return RFAILED;
+ }
+ }
+
+ rsrcIdx = 0;
+ resourceList->list.array[rsrcIdx]->srs_ResourceId = SRS_RSRC_ID;
+ resourceList->list.array[rsrcIdx]->nrofSRS_Ports = SRS_Resource__nrofSRS_Ports_port1;
+ resourceList->list.array[rsrcIdx]->transmissionComb.present = SRS_Resource__transmissionComb_PR_n2;
+
+ resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2 = NULLP;
+ DU_ALLOC(resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2, \
+ sizeof(struct SRS_Resource__transmissionComb__n2));
+ if(!resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcAddModList");
+ return RFAILED;
+ }
+ resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2->combOffset_n2\
+ = SRS_COMB_OFFSET_N2;
+ resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2->cyclicShift_n2\
+ = SRS_CYCLIC_SHIFT_N2;
+
+ resourceList->list.array[rsrcIdx]->resourceMapping.startPosition = \
+ PUSCH_START_SYMBOL;
+ resourceList->list.array[rsrcIdx]->resourceMapping.nrofSymbols = \
+ SRS_Resource__resourceMapping__nrofSymbols_n1;
+ resourceList->list.array[rsrcIdx]->resourceMapping.repetitionFactor = \
+ SRS_Resource__resourceMapping__repetitionFactor_n1;
+
+ resourceList->list.array[rsrcIdx]->freqDomainPosition = SRS_FREQ_DOM_POS;
+ resourceList->list.array[rsrcIdx]->freqDomainShift = SRS_FREQ_DOM_SHIFT;
+ resourceList->list.array[rsrcIdx]->freqHopping.c_SRS = C_SRS;
+ resourceList->list.array[rsrcIdx]->freqHopping.b_SRS = B_SRS;
+ resourceList->list.array[rsrcIdx]->freqHopping.b_hop = B_HOP;
+ resourceList->list.array[rsrcIdx]->groupOrSequenceHopping = \
+ SRS_Resource__groupOrSequenceHopping_neither;
+
+ /* Setting resource type to aperiodic for intergration purposes */
+ resourceList->list.array[rsrcIdx]->resourceType.present = \
+ SRS_Resource__resourceType_PR_aperiodic;
+ resourceList->list.array[rsrcIdx]->resourceType.choice.aperiodic = NULLP;
+ DU_ALLOC(resourceList->list.array[rsrcIdx]->resourceType.choice.aperiodic,
+ sizeof(struct SRS_Resource__resourceType__aperiodic));
+ if(!resourceList->list.array[rsrcIdx]->resourceType.choice.aperiodic)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcAddModList");
+ return RFAILED;
+ }
+
+ resourceList->list.array[rsrcIdx]->sequenceId = SRS_SEQ_ID;
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Build SRS resource set Add/mod list
+ *
+ * @details
+ *
+ * Function : BuildSrsRsrcSetAddModList
+ *
+ * Functionality: Build SRS resource set Add/mod list
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+ uint8_t BuildSrsRsrcSetAddModList
+(
+ struct SRS_Config__srs_ResourceSetToAddModList *rsrcSetList
+ )
+{
+ uint8_t elementCnt;
+ uint8_t rSetIdx;
+ uint8_t rsrcIdx;
+ struct SRS_ResourceSet__srs_ResourceIdList *rsrcIdList;
+
+ elementCnt = 1;
+ rsrcSetList->list.count = elementCnt;
+ rsrcSetList->list.size = elementCnt * sizeof(SRS_ResourceSet_t *);
+ rsrcSetList->list.array = NULLP;
+ DU_ALLOC(rsrcSetList->list.array, rsrcSetList->list.size);
+ if(!rsrcSetList->list.array)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
+ return RFAILED;
+ }
+
+ for(rSetIdx = 0; rSetIdx < rsrcSetList->list.count; rSetIdx++)
+ {
+ DU_ALLOC(rsrcSetList->list.array[rSetIdx], sizeof(SRS_ResourceSet_t));
+ if(!rsrcSetList->list.array[rSetIdx])
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
+ return RFAILED;
+ }
+ }
+
+ rSetIdx = 0;
+ rsrcSetList->list.array[rSetIdx]->srs_ResourceSetId = SRS_RSET_ID;
+
+ /* Fill Resource Id list in resource set */
+ rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList = NULLP;
+ DU_ALLOC(rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList,\
+ sizeof(struct SRS_ResourceSet__srs_ResourceIdList));
+ if(!rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
+ return RFAILED;
+ }
+
+ elementCnt = 1;
+ rsrcIdList = rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList;
+ rsrcIdList->list.count = elementCnt;
+ rsrcIdList->list.size = elementCnt * sizeof(SRS_ResourceId_t *);
+ rsrcIdList->list.array = NULLP;
+ DU_ALLOC(rsrcIdList->list.array, rsrcIdList->list.size);
+ if(!rsrcIdList->list.array)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
+ return RFAILED;
+ }
+
+ for(rsrcIdx = 0; rsrcIdx < rsrcIdList->list.count; rsrcIdx++)
+ {
+ DU_ALLOC(rsrcIdList->list.array[rsrcIdx], sizeof(SRS_ResourceId_t));
+ if(!rsrcIdList->list.array[rsrcIdx])
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
+ return RFAILED;
+ }
+ }
+
+ rsrcIdx = 0;
+ *rsrcIdList->list.array[rsrcIdx] = SRS_RSRC_ID;
+
+ /* Fill resource type */
+ rsrcSetList->list.array[rSetIdx]->resourceType.present = \
+ SRS_ResourceSet__resourceType_PR_aperiodic;
+
+ rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic = NULLP;
+ DU_ALLOC(rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic, \
+ sizeof(struct SRS_ResourceSet__resourceType__aperiodic));
+ if(!rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
+ return RFAILED;
+ }
+ rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger \
+ = APERIODIC_SRS_RESRC_TRIGGER;
+
+ /* TODO : Fill values for below IEs as expected by Viavi */
+ rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic->csi_RS = NULLP;
+ rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic->slotOffset = NULLP;
+
+
+ rsrcSetList->list.array[rSetIdx]->usage = SRS_ResourceSet__usage_codebook;
+ rsrcSetList->list.array[rSetIdx]->alpha = NULLP;
+ rsrcSetList->list.array[rSetIdx]->p0 = NULLP;
+ rsrcSetList->list.array[rSetIdx]->pathlossReferenceRS = NULLP;
+ rsrcSetList->list.array[rSetIdx]->srs_PowerControlAdjustmentStates = NULLP;
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds BWP UL dedicated SRS Config
+ *
+ * @details
+ *
+ * Function : BuildBWPUlDedSrsCfg
+ *
+ * Functionality: Builds BWP UL dedicated SRS Config
+ *
+ * @params[in] SRS Config
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildBWPUlDedSrsCfg(SRS_Config_t *srsCfg)
+{
+ srsCfg->srs_ResourceSetToReleaseList = NULLP;
+ srsCfg->srs_ResourceSetToAddModList = NULLP;
+ DU_ALLOC(srsCfg->srs_ResourceSetToAddModList, \
+ sizeof(struct SRS_Config__srs_ResourceSetToAddModList));
+ if(!srsCfg->srs_ResourceSetToAddModList)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedSrsCfg");
+ return RFAILED;
+ }
+ if(BuildSrsRsrcSetAddModList(srsCfg->srs_ResourceSetToAddModList) != ROK)
+ {
+ return RFAILED;
+ }
+
+ srsCfg->srs_ResourceToReleaseList = NULLP;
+
+ /* Resource to Add/Modify list */
+ srsCfg->srs_ResourceToAddModList = NULLP;
+ DU_ALLOC(srsCfg->srs_ResourceToAddModList, \
+ sizeof(struct SRS_Config__srs_ResourceToAddModList));
+ if(!srsCfg->srs_ResourceToAddModList)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedSrsCfg");
+ return RFAILED;
+ }
+
+ if(BuildSrsRsrcAddModList(srsCfg->srs_ResourceToAddModList) != ROK)
+ {
+ return RFAILED;
+ }
+ srsCfg->tpc_Accumulation = NULLP;
+
+ return ROK;
+}
+
+
+
+/*******************************************************************
+ *
+ * @brief Builds Pusch Serving cell Config
+ *
+ * @details
+ *
+ * Function : BuildPuschSrvCellCfg
+ *
+ * Functionality: Builds Pusch Serving cell Config
+ *
+ * @params[in] struct UplinkConfig__pusch_ServingCellConfig *puschCfg
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildPuschSrvCellCfg(struct UplinkConfig__pusch_ServingCellConfig *puschCfg)
+{
+ puschCfg->present = UplinkConfig__pusch_ServingCellConfig_PR_setup;
+ puschCfg->choice.setup = NULLP;
+ DU_ALLOC(puschCfg->choice.setup, sizeof(struct PUSCH_ServingCellConfig));
+ if(!puschCfg->choice.setup)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschSrvCellCfg");
+ return RFAILED;
+ }
+
+ puschCfg->choice.setup->codeBlockGroupTransmission = NULLP;
+ puschCfg->choice.setup->rateMatching = NULLP;
+ puschCfg->choice.setup->xOverhead = NULLP;
+ puschCfg->choice.setup->ext1 = NULLP;
+
+ DU_ALLOC(puschCfg->choice.setup->ext1, sizeof(struct PUSCH_ServingCellConfig__ext1));
+ if(!puschCfg->choice.setup->ext1)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschSrvCellCfg");
+ return RFAILED;
+ }
+
+ puschCfg->choice.setup->ext1->maxMIMO_Layers = NULLP;
+ DU_ALLOC(puschCfg->choice.setup->ext1->maxMIMO_Layers, sizeof(long));
+ if(!puschCfg->choice.setup->ext1->maxMIMO_Layers)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschSrvCellCfg");
+ return RFAILED;
+ }
+ *(puschCfg->choice.setup->ext1->maxMIMO_Layers) = PUSCH_MAX_MIMO_LAYERS;
+
+ puschCfg->choice.setup->ext1->processingType2Enabled= NULLP;
+ DU_ALLOC(puschCfg->choice.setup->ext1->processingType2Enabled,sizeof(BOOLEAN_t));
+ if(!puschCfg->choice.setup->ext1->processingType2Enabled)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschSrvCellCfg");
+ return RFAILED;
+ }
+ *(puschCfg->choice.setup->ext1->processingType2Enabled) = PUSCH_PROCESS_TYPE2_ENABLED;
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds inital UL BWP
+ *
+ * @details
+ *
+ * Function : BuildInitialUlBWP
+ *
+ * Functionality: Builds initial UL BWP
+ *
+ * @params[in] BWP_UplinkDedicated_t *ulBwp
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildInitialUlBWP(InitialUlBwp *initUlBwp, BWP_UplinkDedicated_t *ulBwp)
+{
+ PucchCfg *pucchCfg = NULLP;
+ PuschCfg *puschCfg = NULLP;
+
+ if(initUlBwp)
+ {
+ if(initUlBwp->pucchPresent)
+ pucchCfg = &initUlBwp->pucchCfg;
+ if(initUlBwp->puschPresent)
+ puschCfg = &initUlBwp->puschCfg;
+ }
+
+ ulBwp->pucch_Config = NULLP;
+ DU_ALLOC(ulBwp->pucch_Config, sizeof(struct BWP_UplinkDedicated__pucch_Config));
+ if(!ulBwp->pucch_Config)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
+ return RFAILED;
+ }
+
+ ulBwp->pucch_Config->present = BWP_UplinkDedicated__pucch_Config_PR_setup;
+ ulBwp->pucch_Config->choice.setup = NULLP;
+ DU_ALLOC(ulBwp->pucch_Config->choice.setup, sizeof(PUCCH_Config_t));
+ if(!ulBwp->pucch_Config->choice.setup)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
+ return RFAILED;
+ }
+
+ if(BuildBWPUlDedPucchCfg(pucchCfg, ulBwp->pucch_Config->choice.setup) != ROK)
+ {
+ return RFAILED;
+ }
+
+ /* Fill BWP UL dedicated PUSCH config */
+ ulBwp->pusch_Config = NULLP;
+ DU_ALLOC(ulBwp->pusch_Config, sizeof(struct BWP_UplinkDedicated__pusch_Config));
+ if(!ulBwp->pusch_Config)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
+ return RFAILED;
+ }
+
+ ulBwp->pusch_Config->present = BWP_UplinkDedicated__pusch_Config_PR_setup;
+ ulBwp->pusch_Config->choice.setup = NULLP;
+ DU_ALLOC(ulBwp->pusch_Config->choice.setup, sizeof(PUSCH_Config_t));
+ if(!ulBwp->pusch_Config->choice.setup)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
+ return RFAILED;
+ }
+
+ if(BuildBWPUlDedPuschCfg(puschCfg, ulBwp->pusch_Config->choice.setup) != ROK)
+ {
+ return RFAILED;
+ }
+
+ ulBwp->configuredGrantConfig = NULLP;
+
+ /* Fill BPW UL dedicated SRS config */
+ ulBwp->srs_Config = NULLP;
+ DU_ALLOC(ulBwp->srs_Config, sizeof(struct BWP_UplinkDedicated__srs_Config));
+ if(!ulBwp->srs_Config)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
+ return RFAILED;
+ }
+
+ ulBwp->srs_Config->present = BWP_UplinkDedicated__srs_Config_PR_setup;
+ ulBwp->srs_Config->choice.setup = NULLP;
+ DU_ALLOC(ulBwp->srs_Config->choice.setup, sizeof(SRS_Config_t));
+ if(!ulBwp->srs_Config->choice.setup)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
+ return RFAILED;
+ }
+
+ if(BuildBWPUlDedSrsCfg(ulBwp->srs_Config->choice.setup) != ROK)
+ {
+ return RFAILED;
+ }
+
+ ulBwp->beamFailureRecoveryConfig = NULLP;
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds UL config
+ * @details
+ *
+ * Function : BuildUlCfg
+ *
+ * Functionality: Builds UL config in spCellCfgDed
+ *
+ * @params[in] UplinkConfig_t *ulCfg
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildUlCfg(ServCellRecfgInfo *servCellRecfg, UplinkConfig_t *ulCfg)
+{
+ InitialUlBwp *initUlBwp = NULLP;
+
+ if(servCellRecfg)
+ {
+ initUlBwp = &servCellRecfg->initUlBwp;
+ }
+
+ ulCfg->initialUplinkBWP = NULLP;
+ DU_ALLOC(ulCfg->initialUplinkBWP, sizeof(BWP_UplinkDedicated_t));
+ if(!ulCfg->initialUplinkBWP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory Allocation failed in BuildUlCfg");
+ return RFAILED;
+ }
+
+ if(BuildInitialUlBWP(initUlBwp, ulCfg->initialUplinkBWP) != ROK)
+ {
+ return RFAILED;
+ }
+
+ ulCfg->uplinkBWP_ToReleaseList = NULLP;
+ ulCfg->uplinkBWP_ToAddModList = NULLP;
+ ulCfg->firstActiveUplinkBWP_Id = NULLP;
+ DU_ALLOC(ulCfg->firstActiveUplinkBWP_Id, sizeof(BWP_Id_t));
+ if(!ulCfg->firstActiveUplinkBWP_Id)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory Allocation failed in BuildUlCfg");
+ return RFAILED;
+ }
+ if(servCellRecfg == NULLP)
+ *(ulCfg->firstActiveUplinkBWP_Id) = ACTIVE_UL_BWP_ID;
+ else
+ *(ulCfg->firstActiveUplinkBWP_Id) = servCellRecfg->firstActvUlBwpId;
+
+ ulCfg->pusch_ServingCellConfig = NULLP;
+ DU_ALLOC(ulCfg->pusch_ServingCellConfig, sizeof(struct UplinkConfig__pusch_ServingCellConfig));
+ if(!ulCfg->pusch_ServingCellConfig)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory Allocation failed in BuildUlCfg");
+ return RFAILED;
+ }
+
+ if(BuildPuschSrvCellCfg(ulCfg->pusch_ServingCellConfig) != ROK)
+ {
+ return RFAILED;
+ }
+
+ ulCfg->carrierSwitching = NULLP;
+ ulCfg->ext1 = NULLP;
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds PDSCH serving cell config
+ * @details
+ *
+ * Function : BuildPdschSrvCellCfg
+ *
+ * Functionality: Builds PDSCH serving cell config in spCellCfgDed
+ *
+ * @params[in] struct ServingCellConfig__pdsch_ServingCellConfig *pdschCfg
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildPdschSrvCellCfg(PdschServCellCfg *pdschServCellDb, struct ServingCellConfig__pdsch_ServingCellConfig *pdschCfg)
+{
+ pdschCfg->present = ServingCellConfig__pdsch_ServingCellConfig_PR_setup;
+ pdschCfg->choice.setup = NULLP;
+ DU_ALLOC(pdschCfg->choice.setup, sizeof( struct PDSCH_ServingCellConfig));
+ if(!pdschCfg->choice.setup)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschSrvCellCfg");
+ return RFAILED;
+ }
+
+ /* Code Block Group Transmission */
+ pdschCfg->choice.setup->codeBlockGroupTransmission = NULLP;
+ if(pdschServCellDb && (pdschServCellDb->maxCodeBlkGrpPerTb || pdschServCellDb->codeBlkGrpFlushInd))
+ {
+ DU_ALLOC(pdschCfg->choice.setup->codeBlockGroupTransmission, sizeof(struct PDSCH_ServingCellConfig__codeBlockGroupTransmission));
+ if(pdschCfg->choice.setup->codeBlockGroupTransmission == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschSrvCellCfg");
+ return RFAILED;
+ }
+
+ pdschCfg->choice.setup->codeBlockGroupTransmission->present = PDSCH_ServingCellConfig__codeBlockGroupTransmission_PR_setup;
+ pdschCfg->choice.setup->codeBlockGroupTransmission->choice.setup = NULLP;
+ DU_ALLOC(pdschCfg->choice.setup->codeBlockGroupTransmission->choice.setup, sizeof(struct PDSCH_CodeBlockGroupTransmission ));
+ if(pdschCfg->choice.setup->codeBlockGroupTransmission->choice.setup == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschSrvCellCfg");
+ return RFAILED;
+ }
- resourceList->list.array[rsrcIdx]->freqDomainPosition = SRS_FREQ_DOM_POS;
- resourceList->list.array[rsrcIdx]->freqDomainShift = SRS_FREQ_DOM_SHIFT;
- resourceList->list.array[rsrcIdx]->freqHopping.c_SRS = C_SRS;
- resourceList->list.array[rsrcIdx]->freqHopping.b_SRS = B_SRS;
- resourceList->list.array[rsrcIdx]->freqHopping.b_hop = B_HOP;
- resourceList->list.array[rsrcIdx]->groupOrSequenceHopping = \
- SRS_Resource__groupOrSequenceHopping_neither;
+ pdschCfg->choice.setup->codeBlockGroupTransmission->choice.setup->maxCodeBlockGroupsPerTransportBlock = \
+ *(pdschServCellDb->maxCodeBlkGrpPerTb);
+ pdschCfg->choice.setup->codeBlockGroupTransmission->choice.setup->codeBlockGroupFlushIndicator = \
+ *(pdschServCellDb->codeBlkGrpFlushInd);
+ }
- /* Setting resource type to aperiodic for intergration purposes */
- resourceList->list.array[rsrcIdx]->resourceType.present = \
- SRS_Resource__resourceType_PR_aperiodic;
- resourceList->list.array[rsrcIdx]->resourceType.choice.aperiodic = NULLP;
- DU_ALLOC(resourceList->list.array[rsrcIdx]->resourceType.choice.aperiodic,
- sizeof(struct SRS_Resource__resourceType__aperiodic));
- if(!resourceList->list.array[rsrcIdx]->resourceType.choice.aperiodic)
+ /* xOverhead */
+ pdschCfg->choice.setup->xOverhead = NULLP;
+ if(pdschServCellDb && pdschServCellDb->xOverhead)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcAddModList");
+ DU_ALLOC(pdschCfg->choice.setup->xOverhead, sizeof(long));
+ if(pdschCfg->choice.setup->xOverhead == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschSrvCellCfg");
+ return RFAILED;
+ }
+ *(pdschCfg->choice.setup->xOverhead) = *(pdschServCellDb->xOverhead);
+ }
+
+ /* Number of HARQ processes */
+ pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH = NULLP;
+ DU_ALLOC(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH, sizeof(long));
+ if(!pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschSrvCellCfg");
return RFAILED;
}
- resourceList->list.array[rsrcIdx]->sequenceId = SRS_SEQ_ID;
+
+ if(pdschServCellDb == NULLP)
+ *(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH) = PDSCH_NUM_HARQ_PROC;
+ else
+ *(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH) = pdschServCellDb->numHarqProcForPdsch;
+
+ pdschCfg->choice.setup->pucch_Cell = NULLP;
+
+ /* Extension */
+ pdschCfg->choice.setup->ext1 = NULLP;
+ if(pdschServCellDb && pdschServCellDb->maxMimoLayers)
+ {
+ DU_ALLOC(pdschCfg->choice.setup->ext1, sizeof(struct PDSCH_ServingCellConfig__ext1));
+ if(pdschCfg->choice.setup->ext1 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschSrvCellCfg");
+ return RFAILED;
+ }
+
+ DU_ALLOC(pdschCfg->choice.setup->ext1->maxMIMO_Layers, sizeof(long));
+ if(pdschCfg->choice.setup->ext1->maxMIMO_Layers == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschSrvCellCfg");
+ return RFAILED;
+ }
+ *(pdschCfg->choice.setup->ext1->maxMIMO_Layers) = *(pdschServCellDb->maxMimoLayers);
+ }
return ROK;
}
/*******************************************************************
*
- * @brief Build SRS resource set Add/mod list
+ * @brief Builds CSI Meas config
+ * @details
+ *
+ * Function : BuildCsiMeasCfg
+ *
+ * Functionality: Builds CSI Meas config in spCellCfgDed
+ *
+ * @params[in] struct ServingCellConfig__csi_MeasConfig *csiMeasCfg
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildCsiMeasCfg(struct ServingCellConfig__csi_MeasConfig *csiMeasCfg)
+{
+
+ return ROK;
+}
+
+/*******************************************************************
*
+ * @brief Builds DL BWP to add/modify list
* @details
*
- * Function : BuildSrsRsrcSetAddModList
+ * Function : BuildDlBwpToAddModList
*
- * Functionality: Build SRS resource set Add/mod list
+ * Functionality: Builds DL BWP to add/modify list
+ *
+ * @params[in] ServCellRecfgInfo *servCellRecfg,
+ * struct ServingCellConfig__downlinkBWP_ToAddModList *dlBwpAddModList
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildDlBwpToAddModList(ServCellRecfgInfo *servCellRecfg, struct ServingCellConfig__downlinkBWP_ToAddModList *dlBwpAddModList)
+{
+ uint8_t elementCnt, idx;
+
+ elementCnt = servCellRecfg->numDlBwpToAddOrMod;
+ dlBwpAddModList->list.count = elementCnt;
+ dlBwpAddModList->list.size = elementCnt * sizeof(struct BWP_Downlink *);
+ dlBwpAddModList->list.array = NULLP;
+ DU_ALLOC(dlBwpAddModList->list.array, dlBwpAddModList->list.size);
+ if(dlBwpAddModList->list.array == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: Memory allocation failure in BuildDlBwpToAddModList");
+ return RFAILED;
+ }
+
+ for(idx=0; idx<dlBwpAddModList->list.count; idx++)
+ {
+ DU_ALLOC(dlBwpAddModList->list.array[idx], sizeof(BWP_Downlink_t));
+ if(dlBwpAddModList->list.array[idx] == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: Memory allocation failure in BuildDlBwpToAddModList");
+ return RFAILED;
+ }
+ }
+
+ for(idx=0; idx<dlBwpAddModList->list.count; idx++)
+ {
+ dlBwpAddModList->list.array[idx]->bwp_Id = servCellRecfg->dlBwpToAddOrModList[idx].bwpId;
+ dlBwpAddModList->list.array[idx]->bwp_Common = NULLP;
+ dlBwpAddModList->list.array[idx]->bwp_Dedicated = NULLP;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds Spcell config dedicated
+ * @details
+ *
+ * Function : BuildSpCellCfgDed
+ *
+ * Functionality: Builds sp cell config dedicated in spCellCfg
+ *
+ * @params[in] ServingCellConfig_t srvCellCfg
*
- * @params[in]
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
- uint8_t BuildSrsRsrcSetAddModList
-(
- struct SRS_Config__srs_ResourceSetToAddModList *rsrcSetList
- )
+uint8_t BuildSpCellCfgDed(DuUeCb *ueCb, ServingCellConfig_t *srvCellCfg)
{
- uint8_t elementCnt;
- uint8_t rSetIdx;
- uint8_t rsrcIdx;
- struct SRS_ResourceSet__srs_ResourceIdList *rsrcIdList;
+ ServCellRecfgInfo *servCellRecfg = NULLP;
+ InitialDlBwp *initDlBwp = NULLP;
+ PdschServCellCfg *pdschServCellDb = NULLP;
- elementCnt = 1;
- rsrcSetList->list.count = elementCnt;
- rsrcSetList->list.size = elementCnt * sizeof(SRS_ResourceSet_t *);
- rsrcSetList->list.array = NULLP;
- DU_ALLOC(rsrcSetList->list.array, rsrcSetList->list.size);
- if(!rsrcSetList->list.array)
+ if(ueCb)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
+ servCellRecfg = &ueCb->duMacUeCfg.spCellCfg.servCellCfg;
+ initDlBwp = &servCellRecfg->initDlBwp;
+ pdschServCellDb = &servCellRecfg->pdschServCellCfg;
+ }
+
+ srvCellCfg->tdd_UL_DL_ConfigurationDedicated = NULLP;
+
+ srvCellCfg->initialDownlinkBWP = NULLP;
+ DU_ALLOC(srvCellCfg->initialDownlinkBWP, sizeof(BWP_DownlinkDedicated_t));
+ if(!srvCellCfg->initialDownlinkBWP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
+ return RFAILED;
+ }
+
+ if(BuildInitialDlBWP(initDlBwp, srvCellCfg->initialDownlinkBWP) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildInitialDlBWP failed");
+ return RFAILED;
+ }
+
+ srvCellCfg->downlinkBWP_ToReleaseList = NULLP;
+
+ srvCellCfg->downlinkBWP_ToAddModList = NULLP;
+ if(ueCb && ueCb->duMacUeCfg.spCellCfg.servCellCfg.numDlBwpToAddOrMod)
+ {
+ DU_ALLOC(srvCellCfg->downlinkBWP_ToAddModList, sizeof(struct ServingCellConfig__downlinkBWP_ToAddModList));
+ if(srvCellCfg->downlinkBWP_ToAddModList == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
+ return RFAILED;
+ }
+
+ if(BuildDlBwpToAddModList(&ueCb->duMacUeCfg.spCellCfg.servCellCfg, srvCellCfg->downlinkBWP_ToAddModList) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildInitialDlBWP failed");
+ return RFAILED;
+ }
+ }
+
+ srvCellCfg->firstActiveDownlinkBWP_Id = NULLP;
+ DU_ALLOC(srvCellCfg->firstActiveDownlinkBWP_Id, sizeof(long));
+ if(!srvCellCfg->firstActiveDownlinkBWP_Id)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
+ return RFAILED;
+ }
+ if(ueCb == NULLP)
+ *(srvCellCfg->firstActiveDownlinkBWP_Id) = ACTIVE_DL_BWP_ID;
+ else
+ *(srvCellCfg->firstActiveDownlinkBWP_Id) = ueCb->duMacUeCfg.spCellCfg.servCellCfg.firstActvDlBwpId;
+
+ srvCellCfg->bwp_InactivityTimer = NULLP;
+
+ srvCellCfg->defaultDownlinkBWP_Id = NULLP;
+ DU_ALLOC(srvCellCfg->defaultDownlinkBWP_Id, sizeof(long));
+ if(!srvCellCfg->defaultDownlinkBWP_Id)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
+ return RFAILED;
+ }
+ if(ueCb == NULLP)
+ *(srvCellCfg->defaultDownlinkBWP_Id) = ACTIVE_DL_BWP_ID;
+ else
+ *(srvCellCfg->defaultDownlinkBWP_Id) = ueCb->duMacUeCfg.spCellCfg.servCellCfg.defaultDlBwpId;
+
+ srvCellCfg->uplinkConfig = NULLP;
+ DU_ALLOC(srvCellCfg->uplinkConfig, sizeof(UplinkConfig_t));
+ if(!srvCellCfg->uplinkConfig)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
+ return RFAILED;
+ }
+
+ if(BuildUlCfg(servCellRecfg, srvCellCfg->uplinkConfig) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildUlCfg failed");
+ return RFAILED;
+ }
+ srvCellCfg->supplementaryUplink = NULLP;
+ srvCellCfg->pdcch_ServingCellConfig = NULLP;
+
+ srvCellCfg->pdsch_ServingCellConfig = NULLP;
+ DU_ALLOC(srvCellCfg->pdsch_ServingCellConfig, sizeof(struct ServingCellConfig__pdsch_ServingCellConfig));
+ if(!srvCellCfg->pdsch_ServingCellConfig)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
+ return RFAILED;
+ }
+
+ if(BuildPdschSrvCellCfg(pdschServCellDb, srvCellCfg->pdsch_ServingCellConfig) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildPdschSrvCellCfg failed");
+ return RFAILED;
+ }
+
+ srvCellCfg->csi_MeasConfig = NULLP;
+#if 0
+ DU_ALLOC(srvCellCfg->csi_MeasConfig, sizeof(struct ServingCellConfig__csi_MeasConfig))
+ if(!srvCellCfg->csi_MeasConfig)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
+ return RFAILED;
+ }
+
+ if(BuildCsiMeasCfg(srvCellCfg->csi_MeasConfig) != ROK)
+ {
+ DU_LOG("\nF1AP : BuildCsiMeasCfg failed");
+ return RFAILED;
+ }
+#endif
+ srvCellCfg->sCellDeactivationTimer = NULLP;
+ srvCellCfg->crossCarrierSchedulingConfig = NULLP;
+ srvCellCfg->tag_Id = TAG_ID;
+ srvCellCfg->dummy = NULLP;
+ srvCellCfg->pathlossReferenceLinking = NULLP;
+ srvCellCfg->servingCellMO = NULLP;
+ srvCellCfg->ext1 = NULLP;
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills SCS specific carrier list in DL frequency info
+ *
+ * @details
+ *
+ * Function : BuildScsSpecificCarrierListDl
+ *
+ * Functionality: Fills SCS specific carrier list in DL frequency info
+ *
+ * @params[in] Pointer to struct FrequencyInfoDL__scs_SpecificCarrierList
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildScsSpecificCarrierListDl(struct FrequencyInfoDL__scs_SpecificCarrierList *scsCarrierList)
+{
+ uint8_t elementCnt = 0, listIdx = 0;
+ ScsSpecCarrier duScsSpecCarrier = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.dlScsCarrier;
+
+ elementCnt = ODU_VALUE_ONE;
+ scsCarrierList->list.count = elementCnt;
+ scsCarrierList->list.size = elementCnt * sizeof(SCS_SpecificCarrier_t *);
+
+ DU_ALLOC(scsCarrierList->list.array, scsCarrierList->list.size);
+ if(!scsCarrierList->list.array)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for scs carrier list array \
+ in BuildScsSpecificCarrierListDl()");
return RFAILED;
}
- for(rSetIdx = 0; rSetIdx < rsrcSetList->list.count; rSetIdx++)
- {
- DU_ALLOC(rsrcSetList->list.array[rSetIdx], sizeof(SRS_ResourceSet_t));
- if(!rsrcSetList->list.array[rSetIdx])
+ for(listIdx = 0; listIdx < elementCnt; listIdx++)
+ {
+ DU_ALLOC(scsCarrierList->list.array[listIdx], sizeof(SCS_SpecificCarrier_t));
+ if(!scsCarrierList->list.array[listIdx])
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for SCS Specific Carrier list array \
+ element in BuildScsSpecificCarrierListDl()");
+ return RFAILED;
+ }
+ }
+
+ listIdx = 0;
+ scsCarrierList->list.array[listIdx]->offsetToCarrier = duScsSpecCarrier.scsOffset;
+ scsCarrierList->list.array[listIdx]->subcarrierSpacing = duScsSpecCarrier.scs;
+ scsCarrierList->list.array[listIdx]->carrierBandwidth = duScsSpecCarrier.scsBw;
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills DL frequency info in DL config common
+ *
+ * @details
+ *
+ * Function : BuildFreqInfoDl
+ *
+ * Functionality: Fills DL frequency info in DL config common
+ *
+ * @params[in] Pointer to DownlinkConfigCommon_t
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildFreqInfoDl(FrequencyInfoDL_t *frequencyInfoDL)
+{
+ uint8_t freqBandIdx = 0, elementCnt = 0;
+ DlCfgCommon dlCfg = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg;
+
+ /* TODO : Fill SSB Absolute Frequency */
+ /*
+ DU_ALLOC(frequencyInfoDL->absoluteFrequencySSB, sizeof(ARFCN_ValueNR_t));
+ if(!frequencyInfoDL->absoluteFrequencySSB)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
- return RFAILED;
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for SSB Absolute Frequency in BuildFreqInfoDl()");
+ return RFAILED;
}
- }
-
- rSetIdx = 0;
- rsrcSetList->list.array[rSetIdx]->srs_ResourceSetId = SRS_RSET_ID;
+ frequencyInfoDL->absoluteFrequencySSB = ?;
+ */
- /* Fill Resource Id list in resource set */
- rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList = NULLP;
- DU_ALLOC(rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList,\
- sizeof(struct SRS_ResourceSet__srs_ResourceIdList));
- if(!rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
- return RFAILED;
- }
+ /* NR Multi Frequency Band List */
+ elementCnt = ODU_VALUE_ONE;
+ frequencyInfoDL->frequencyBandList.list.count = elementCnt;
+ frequencyInfoDL->frequencyBandList.list.size = elementCnt * sizeof(FreqBandIndicatorNR_t *);
- elementCnt = 1;
- rsrcIdList = rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList;
- rsrcIdList->list.count = elementCnt;
- rsrcIdList->list.size = elementCnt * sizeof(SRS_ResourceId_t *);
- rsrcIdList->list.array = NULLP;
- DU_ALLOC(rsrcIdList->list.array, rsrcIdList->list.size);
- if(!rsrcIdList->list.array)
+ DU_ALLOC(frequencyInfoDL->frequencyBandList.list.array, frequencyInfoDL->frequencyBandList.list.size);
+ if(!frequencyInfoDL->frequencyBandList.list.array)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for Frequency Band List array in BuildFreqInfoDl()");
return RFAILED;
}
- for(rsrcIdx = 0; rsrcIdx < rsrcIdList->list.count; rsrcIdx++)
+ for(freqBandIdx = 0; freqBandIdx < elementCnt; freqBandIdx++)
{
- DU_ALLOC(rsrcIdList->list.array[rsrcIdx], sizeof(SRS_ResourceId_t));
- if(!rsrcIdList->list.array[rsrcIdx])
+ DU_ALLOC(frequencyInfoDL->frequencyBandList.list.array[freqBandIdx], sizeof(FreqBandIndicatorNR_t));
+ if(!frequencyInfoDL->frequencyBandList.list.array[freqBandIdx])
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
- return RFAILED;
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for frequency band array element in BuildFreqInfoDl()");
+ return RFAILED;
}
}
- rsrcIdx = 0;
- *rsrcIdList->list.array[rsrcIdx] = SRS_RSRC_ID;
+ freqBandIdx = 0;
+ *(frequencyInfoDL->frequencyBandList.list.array[freqBandIdx]) = dlCfg.freqBandInd;
- /* Fill resource type */
- rsrcSetList->list.array[rSetIdx]->resourceType.present = \
- SRS_ResourceSet__resourceType_PR_aperiodic;
+ /* TODO : Absolute Frequency to Point A */
+ //frequencyInfoDL->absoluteFrequencyPointA
- rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic = NULLP;
- DU_ALLOC(rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic, \
- sizeof(struct SRS_ResourceSet__resourceType__aperiodic));
- if(!rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic)
+ /* Subcarrier Spacing specifc carrier List */
+ if((BuildScsSpecificCarrierListDl(&frequencyInfoDL->scs_SpecificCarrierList)) != ROK)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
+ DU_LOG("\nERROR --> DU APP : Failed to fill SCS specific carrier list DL in BuildFreqInfoDl()");
return RFAILED;
}
- rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger \
- = APERIODIC_SRS_RESRC_TRIGGER;
-
- /* TODO : Fill values for below IEs as expected by Viavi */
- rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic->csi_RS = NULLP;
- rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic->slotOffset = NULLP;
-
-
- rsrcSetList->list.array[rSetIdx]->usage = SRS_ResourceSet__usage_codebook;
- rsrcSetList->list.array[rSetIdx]->alpha = NULLP;
- rsrcSetList->list.array[rSetIdx]->p0 = NULLP;
- rsrcSetList->list.array[rSetIdx]->pathlossReferenceRS = NULLP;
- rsrcSetList->list.array[rSetIdx]->srs_PowerControlAdjustmentStates = NULLP;
return ROK;
+
}
/*******************************************************************
*
- * @brief Builds BWP UL dedicated SRS Config
+ * @brief Fills DL config common in Serving cell config common
*
* @details
*
- * Function : BuildBWPUlDedSrsCfg
+ * Function : BuildDlConfigCommon
*
- * Functionality: Builds BWP UL dedicated SRS Config
+ * Functionality: Fills DL config common in Serving cell config common
+ *
+ * @params[in] Pointer to DownlinkConfigCommon_t
*
- * @params[in] SRS Config
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildBWPUlDedSrsCfg(SRS_Config_t *srsCfg)
+uint8_t BuildDlConfigCommon(DownlinkConfigCommon_t *dlCfgCommon)
{
- srsCfg->srs_ResourceSetToReleaseList = NULLP;
- srsCfg->srs_ResourceSetToAddModList = NULLP;
- DU_ALLOC(srsCfg->srs_ResourceSetToAddModList, \
- sizeof(struct SRS_Config__srs_ResourceSetToAddModList));
- if(!srsCfg->srs_ResourceSetToAddModList)
+ /* DL Frequency Info */
+ DU_ALLOC(dlCfgCommon->frequencyInfoDL, sizeof(FrequencyInfoDL_t));
+ if(!dlCfgCommon->frequencyInfoDL)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedSrsCfg");
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for DL frequency info in BuildDlConfigCommon()");
return RFAILED;
}
- if(BuildSrsRsrcSetAddModList(srsCfg->srs_ResourceSetToAddModList) != ROK)
+ if((BuildFreqInfoDl(dlCfgCommon->frequencyInfoDL))!= ROK)
{
+ DU_LOG("\nERROR --> DU APP : Failed to fill DL frequency info in BuildDlConfigCommon()");
return RFAILED;
}
- srsCfg->srs_ResourceToReleaseList = NULLP;
-
- /* Resource to Add/Modify list */
- srsCfg->srs_ResourceToAddModList = NULLP;
- DU_ALLOC(srsCfg->srs_ResourceToAddModList, \
- sizeof(struct SRS_Config__srs_ResourceToAddModList));
- if(!srsCfg->srs_ResourceToAddModList)
+ /* DL BWP config common */
+ DU_ALLOC(dlCfgCommon->initialDownlinkBWP, sizeof(BWP_DownlinkCommon_t));
+ if(!dlCfgCommon->initialDownlinkBWP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedSrsCfg");
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for DL BWP config common in BuildDlConfigCommon()");
return RFAILED;
}
-
- if(BuildSrsRsrcAddModList(srsCfg->srs_ResourceToAddModList) != ROK)
+ if((BuildBwpDlCommon(dlCfgCommon->initialDownlinkBWP)) != ROK)
{
+ DU_LOG("\nERROR --> DU APP : Failed to fill DL DWP config common in BuildDlConfigCommon()");
return RFAILED;
}
- srsCfg->tpc_Accumulation = NULLP;
-
return ROK;
}
-
-
/*******************************************************************
*
- * @brief Builds Pusch Serving cell Config
+ * @brief Fills SCS specific carrier list in UL frequency Info
*
* @details
*
- * Function : BuildPuschSrvCellCfg
+ * Function : BuildScsSpecificCarrierListUl
*
- * Functionality: Builds Pusch Serving cell Config
+ * Functionality: Fills SCS specific carrier list in UL frequency Info
*
- * @params[in] struct UplinkConfig__pusch_ServingCellConfig *puschCfg
+ * @params[in] Pointer to struct FrequencyInfoUL__scs_SpecificCarrierList
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildPuschSrvCellCfg(struct UplinkConfig__pusch_ServingCellConfig *puschCfg)
+uint8_t BuildScsSpecificCarrierListUl(struct FrequencyInfoUL__scs_SpecificCarrierList *scsCarrierList)
{
- puschCfg->present = UplinkConfig__pusch_ServingCellConfig_PR_setup;
- puschCfg->choice.setup = NULLP;
- DU_ALLOC(puschCfg->choice.setup, sizeof(struct PUSCH_ServingCellConfig));
- if(!puschCfg->choice.setup)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschSrvCellCfg");
- return RFAILED;
- }
+ uint8_t elementCnt = 0, listIdx = 0;
+ ScsSpecCarrier duScsSpecCarrier = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.ulScsCarrier;
- puschCfg->choice.setup->codeBlockGroupTransmission = NULLP;
- puschCfg->choice.setup->rateMatching = NULLP;
- puschCfg->choice.setup->xOverhead = NULLP;
- puschCfg->choice.setup->ext1 = NULLP;
- DU_ALLOC(puschCfg->choice.setup->ext1, sizeof(struct PUSCH_ServingCellConfig__ext1));
- if(!puschCfg->choice.setup->ext1)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschSrvCellCfg");
- return RFAILED;
- }
+ elementCnt = ODU_VALUE_ONE;
+ scsCarrierList->list.count = elementCnt;
+ scsCarrierList->list.size = elementCnt * sizeof(SCS_SpecificCarrier_t *);
- puschCfg->choice.setup->ext1->maxMIMO_Layers = NULLP;
- DU_ALLOC(puschCfg->choice.setup->ext1->maxMIMO_Layers, sizeof(long));
- if(!puschCfg->choice.setup->ext1->maxMIMO_Layers)
+ DU_ALLOC(scsCarrierList->list.array, scsCarrierList->list.size);
+ if(!scsCarrierList->list.array)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschSrvCellCfg");
+ DU_LOG("\nERROR --> DU APP : SCS Specific Carrier list memory allocation failed");
return RFAILED;
}
- *(puschCfg->choice.setup->ext1->maxMIMO_Layers) = PUSCH_MAX_MIMO_LAYERS;
- puschCfg->choice.setup->ext1->processingType2Enabled= NULLP;
- DU_ALLOC(puschCfg->choice.setup->ext1->processingType2Enabled,sizeof(BOOLEAN_t));
- if(!puschCfg->choice.setup->ext1->processingType2Enabled)
+ for(listIdx = 0; listIdx < scsCarrierList->list.count; listIdx++)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschSrvCellCfg");
- return RFAILED;
+ DU_ALLOC(scsCarrierList->list.array[listIdx], sizeof(SCS_SpecificCarrier_t));
+ if(!scsCarrierList->list.array[listIdx])
+ {
+ DU_LOG("\nERROR --> DU APP : SCS Specific Carrier list memory allocation failed");
+ return RFAILED;
+ }
}
- *(puschCfg->choice.setup->ext1->processingType2Enabled) = PUSCH_PROCESS_TYPE2_ENABLED;
+ listIdx = 0;
+ scsCarrierList->list.array[listIdx]->offsetToCarrier = duScsSpecCarrier.scsOffset;
+ scsCarrierList->list.array[listIdx]->subcarrierSpacing = duScsSpecCarrier.scs;
+ scsCarrierList->list.array[listIdx]->carrierBandwidth = duScsSpecCarrier.scsBw;
+
return ROK;
}
/*******************************************************************
*
- * @brief Builds inital UL BWP
+ * @brief Fills frequency info in UL config common
*
* @details
*
- * Function : BuildInitialUlBWP
+ * Function : BuildFreqInfoUl
*
- * Functionality: Builds initial UL BWP
+ * Functionality: Fills frequency info in UL config common
+ *
+ * @params[in] Pointer to FrequencyInfoUL_t
*
- * @params[in] BWP_UplinkDedicated_t *ulBwp
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildInitialUlBWP(BWP_UplinkDedicated_t *ulBwp)
+uint8_t BuildFreqInfoUl(FrequencyInfoUL_t *frequencyInfoUL)
{
- ulBwp->pucch_Config = NULLP;
- DU_ALLOC(ulBwp->pucch_Config, sizeof(struct BWP_UplinkDedicated__pucch_Config));
- if(!ulBwp->pucch_Config)
+ uint8_t elementCnt = 0, listIdx= 0;
+ UlCfgCommon ulCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg;
+
+ /* NR Multi Frequency Band List */
+ DU_ALLOC(frequencyInfoUL->frequencyBandList, sizeof(MultiFrequencyBandListNR_t));
+ if(!frequencyInfoUL->frequencyBandList)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for frequency band list in BuildFreqInfoUl()");
return RFAILED;
}
- ulBwp->pucch_Config->present = BWP_UplinkDedicated__pucch_Config_PR_setup;
- ulBwp->pucch_Config->choice.setup = NULLP;
- DU_ALLOC(ulBwp->pucch_Config->choice.setup, sizeof(PUCCH_Config_t));
- if(!ulBwp->pucch_Config->choice.setup)
+ elementCnt = ODU_VALUE_ONE;
+ frequencyInfoUL->frequencyBandList->list.count = elementCnt;
+ frequencyInfoUL->frequencyBandList->list.size = elementCnt * sizeof(FreqBandIndicatorNR_t *);
+
+ DU_ALLOC(frequencyInfoUL->frequencyBandList->list.array, frequencyInfoUL->frequencyBandList->list.size);
+ if(!frequencyInfoUL->frequencyBandList->list.array)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for frequency band array in BuildFreqInfoUl()");
return RFAILED;
}
- if(BuildBWPUlDedPucchCfg(ulBwp->pucch_Config->choice.setup) != ROK)
+ for(listIdx = 0; listIdx < elementCnt; listIdx++)
{
- return RFAILED;
+ DU_ALLOC(frequencyInfoUL->frequencyBandList->list.array[listIdx], sizeof(FreqBandIndicatorNR_t));
+ if(!frequencyInfoUL->frequencyBandList->list.array[listIdx])
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for frequency band array element in BuildFreqInfoUl()");
+ return RFAILED;
+ }
}
- /* Fill BWP UL dedicated PUSCH config */
- ulBwp->pusch_Config = NULLP;
- DU_ALLOC(ulBwp->pusch_Config, sizeof(struct BWP_UplinkDedicated__pusch_Config));
- if(!ulBwp->pusch_Config)
+ listIdx = 0;
+ *(frequencyInfoUL->frequencyBandList->list.array[listIdx]) = ulCfg.freqBandInd;
+
+ /* TODO : Fill Absolute frequency point A */
+ /*
+ DU_ALLOC(frequencyInfoUL->absoluteFrequencyPointA, sizeof(ARFCN_ValueNR_t));
+ if(!frequencyInfoUL->absoluteFrequencyPointA)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for absolute frequency point A in BuildFreqInfoUl()");
+ return RFAILED;
+ }
+ *(frequencyInfoUL->absoluteFrequencyPointA) = ?;
+ */
+
+ /* Subcarrier Spacing specifc carrier */
+ if((BuildScsSpecificCarrierListUl(&frequencyInfoUL->scs_SpecificCarrierList)) != ROK)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
+ DU_LOG("\nERROR --> DU APP : Failed to fill SCS Specific Carrier list UL in BuildFreqInfoUl()");
return RFAILED;
}
- ulBwp->pusch_Config->present = BWP_UplinkDedicated__pusch_Config_PR_setup;
- ulBwp->pusch_Config->choice.setup = NULLP;
- DU_ALLOC(ulBwp->pusch_Config->choice.setup, sizeof(PUSCH_Config_t));
- if(!ulBwp->pusch_Config->choice.setup)
+ /* P-MAX */
+ DU_ALLOC(frequencyInfoUL->p_Max, sizeof(P_Max_t));
+ if(!frequencyInfoUL->p_Max)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
+ DU_LOG("\nERROR --> DU APP : UL Frequency Infoo memory allocation failure");
return RFAILED;
}
+ *frequencyInfoUL->p_Max = ulCfg.pMax;
- if(BuildBWPUlDedPuschCfg(ulBwp->pusch_Config->choice.setup) != ROK)
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills UL config common in Serving cell config common
+ *
+ * @details
+ *
+ * Function : BuildUlConfigCommon
+ *
+ * Functionality: Fills UL config common in Serving cell config common
+ *
+ * @params[in] Pointer to UplinkConfigCommon_t
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildUlConfigCommon(UplinkConfigCommon_t *ulCfgCommon)
+{
+ /* UL Frequency Info */
+ DU_ALLOC(ulCfgCommon->frequencyInfoUL, sizeof(FrequencyInfoUL_t));
+ if(!ulCfgCommon->frequencyInfoUL)
{
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for UL frequency info in BuildUlConfigCommon()");
return RFAILED;
}
- ulBwp->configuredGrantConfig = NULLP;
-
- /* Fill BPW UL dedicated SRS config */
- ulBwp->srs_Config = NULLP;
- DU_ALLOC(ulBwp->srs_Config, sizeof(struct BWP_UplinkDedicated__srs_Config));
- if(!ulBwp->srs_Config)
+ if((BuildFreqInfoUl(ulCfgCommon->frequencyInfoUL)) != ROK)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
+ DU_LOG("\nERROR --> DU APP : Failed to fill frequency info UL in BuildUlConfigCommon()");
return RFAILED;
}
- ulBwp->srs_Config->present = BWP_UplinkDedicated__srs_Config_PR_setup;
- ulBwp->srs_Config->choice.setup = NULLP;
- DU_ALLOC(ulBwp->srs_Config->choice.setup, sizeof(SRS_Config_t));
- if(!ulBwp->srs_Config->choice.setup)
+ /* UL BWP common */
+ DU_ALLOC(ulCfgCommon->initialUplinkBWP, sizeof(BWP_UplinkCommon_t));
+ if(!ulCfgCommon->initialUplinkBWP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for initial UL BWP in BuildUlConfigCommon()");
return RFAILED;
}
- if(BuildBWPUlDedSrsCfg(ulBwp->srs_Config->choice.setup) != ROK)
+ if((BuildBwpUlCommon(ulCfgCommon->initialUplinkBWP)) != ROK)
{
- return RFAILED;
+ DU_LOG("\nERROR --> DU APP : Failed to fill BWP UL common in BuildUlConfigCommon()");
+ return RFAILED;
}
- ulBwp->beamFailureRecoveryConfig = NULLP;
+ /* Time Alignment timer */
+ ulCfgCommon->dummy = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.timeAlignTimerComm;
return ROK;
}
/*******************************************************************
*
- * @brief Builds UL config
+ * @brief Fills SSB position in burst in SP cell config common
+ *
* @details
*
- * Function : BuildUlCfg
+ * Function : BuildSsbPosInBurst
*
- * Functionality: Builds UL config in spCellCfgDed
+ * Functionality:
+ * Fills SSB position in burst in SP cell config common
*
- * @params[in] UplinkConfig_t *ulCfg
+ * @params[in] Pointer to struct ServingCellConfigCommon__ssb_PositionsInBurst
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildUlCfg(UplinkConfig_t *ulCfg)
+uint8_t BuildSsbPosInBurst(struct ServingCellConfigCommon__ssb_PositionsInBurst *ssbPosInBurst)
{
- ulCfg->initialUplinkBWP = NULLP;
- DU_ALLOC(ulCfg->initialUplinkBWP, sizeof(BWP_UplinkDedicated_t));
- if(!ulCfg->initialUplinkBWP)
- {
- DU_LOG("\nERROR --> F1AP : Memory Allocation failed in BuildUlCfg");
- return RFAILED;
- }
+ uint8_t bitStringSizeInBytes = 0;
- if(BuildInitialUlBWP(ulCfg->initialUplinkBWP) != ROK)
- {
- return RFAILED;
- }
+ ssbPosInBurst->present = ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap;
- ulCfg->uplinkBWP_ToReleaseList = NULLP;
- ulCfg->uplinkBWP_ToAddModList = NULLP;
- ulCfg->firstActiveUplinkBWP_Id = NULLP;
- DU_ALLOC(ulCfg->firstActiveUplinkBWP_Id, sizeof(BWP_Id_t));
- if(!ulCfg->firstActiveUplinkBWP_Id)
- {
- DU_LOG("\nERROR --> F1AP : Memory Allocation failed in BuildUlCfg");
- return RFAILED;
- }
- *(ulCfg->firstActiveUplinkBWP_Id) = ACTIVE_UL_BWP_ID;
+ /* As per spec 38.331,in the definition of ServingCellConfigCommon */
+ bitStringSizeInBytes = 1;
+ ssbPosInBurst->choice.mediumBitmap.size = bitStringSizeInBytes * sizeof(uint8_t);
- ulCfg->pusch_ServingCellConfig = NULLP;
- DU_ALLOC(ulCfg->pusch_ServingCellConfig, \
- sizeof(struct UplinkConfig__pusch_ServingCellConfig));
- if(!ulCfg->pusch_ServingCellConfig)
+ DU_ALLOC(ssbPosInBurst->choice.mediumBitmap.buf, ssbPosInBurst->choice.mediumBitmap.size);
+ if(!ssbPosInBurst->choice.mediumBitmap.buf)
{
- DU_LOG("\nERROR --> F1AP : Memory Allocation failed in BuildUlCfg");
+ DU_LOG("\nERROR --> DU APP : Memory Allocation failed for medium bit map buffer in BuildSsbPosInBurst()");
return RFAILED;
}
- if(BuildPuschSrvCellCfg(ulCfg->pusch_ServingCellConfig) != ROK)
+ if((fillBitString(&ssbPosInBurst->choice.mediumBitmap, 0, bitStringSizeInBytes, \
+ duCfgParam.sib1Params.srvCellCfgCommSib.ssbPosInBurst)) != ROK)
{
+ DU_LOG("\nERROR --> DU APP : Failed to fill medium bit map in BuildSsbPosInBurst()");
return RFAILED;
}
- ulCfg->carrierSwitching = NULLP;
- ulCfg->ext1 = NULLP;
return ROK;
}
/*******************************************************************
*
- * @brief Builds PDSCH serving cell config
+ * @brief Fills SP cell config common in Reconfig with Sync
+ *
* @details
*
- * Function : BuildPdschSrvCellCfg
+ * Function : BuildSpCellConfigCommon
*
- * Functionality: Builds PDSCH serving cell config in spCellCfgDed
+ * Functionality: Fills SP cell config common in Reconfig with Sync
*
- * @params[in] struct ServingCellConfig__pdsch_ServingCellConfig *pdschCfg
+ * @params[in] Pointer to ServingCellConfigCommon_t
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildPdschSrvCellCfg(struct ServingCellConfig__pdsch_ServingCellConfig *pdschCfg)
+uint8_t BuildSpCellConfigCommon(ServingCellConfigCommon_t *spCellConfigCommon)
{
- pdschCfg->present = ServingCellConfig__pdsch_ServingCellConfig_PR_setup;
- pdschCfg->choice.setup = NULLP;
- DU_ALLOC(pdschCfg->choice.setup, sizeof( struct PDSCH_ServingCellConfig));
- if(!pdschCfg->choice.setup)
+ /* Physical Cell Identity */
+ DU_ALLOC(spCellConfigCommon->physCellId, sizeof(PhysCellId_t));
+ if(!spCellConfigCommon->physCellId)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for physical cell id in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ *(spCellConfigCommon->physCellId) = NR_PCI;
+
+ /* Downlink Config Common */
+ DU_ALLOC(spCellConfigCommon->downlinkConfigCommon, sizeof(DownlinkConfigCommon_t));
+ if(!spCellConfigCommon->downlinkConfigCommon)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for DL Config Common in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ if((BuildDlConfigCommon(spCellConfigCommon->downlinkConfigCommon)) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to fill DL config commin in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+
+ /* Uplinlink Config Common */
+ DU_ALLOC(spCellConfigCommon->uplinkConfigCommon, sizeof(UplinkConfigCommon_t));
+ if(!spCellConfigCommon->uplinkConfigCommon)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for UL Config Common in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ if((BuildUlConfigCommon(spCellConfigCommon->uplinkConfigCommon)) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to fill UL config commin in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+
+ /* Timing Advance offset */
+ DU_ALLOC(spCellConfigCommon->n_TimingAdvanceOffset, sizeof(long));
+ if(!spCellConfigCommon->n_TimingAdvanceOffset)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for Timing Advance Offset in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ *(spCellConfigCommon->n_TimingAdvanceOffset) = ServingCellConfigCommon__n_TimingAdvanceOffset_n0;
+
+ /* SSB Position In Burst */
+ DU_ALLOC(spCellConfigCommon->ssb_PositionsInBurst, sizeof(struct ServingCellConfigCommon__ssb_PositionsInBurst));
+ if(!spCellConfigCommon->ssb_PositionsInBurst)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for SSB Position In Burst in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ if((BuildSsbPosInBurst(spCellConfigCommon->ssb_PositionsInBurst)) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to fill SSB Position In Burst in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+
+ /* SSB Periodicity in Serving cell */
+ DU_ALLOC(spCellConfigCommon->ssb_periodicityServingCell, sizeof(long));
+ if(!spCellConfigCommon->ssb_periodicityServingCell)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschSrvCellCfg");
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for SSB Periodicity serving cell in \
+ BuildSpCellConfigCommon()");
return RFAILED;
}
+ *(spCellConfigCommon->ssb_periodicityServingCell) = \
+ convertSsbPeriodicityValueToEnum(duCfgParam.sib1Params.srvCellCfgCommSib.ssbPrdServingCell);
- pdschCfg->choice.setup->codeBlockGroupTransmission = NULLP;
- pdschCfg->choice.setup->xOverhead = NULLP;
- pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH = NULLP;
- DU_ALLOC(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH, sizeof(long));
- if(!pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH)
+ /* DMRS Type A position */
+ spCellConfigCommon->dmrs_TypeA_Position = convertDmrsTypeAPosValueToEnum(duCfgParam.macCellCfg.ssbCfg.dmrsTypeAPos);
+
+ /* SSB subcarrier spacing */
+ DU_ALLOC(spCellConfigCommon->ssbSubcarrierSpacing, sizeof(SubcarrierSpacing_t));
+ if(!spCellConfigCommon->ssbSubcarrierSpacing)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschSrvCellCfg");
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for sub-carrier spacing in BuildSpCellConfigCommon()");
return RFAILED;
}
- *(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH)= PDSCH_NUM_HARQ_PROC;
- pdschCfg->choice.setup->pucch_Cell = NULLP;
- pdschCfg->choice.setup->ext1 = NULLP;
+ *(spCellConfigCommon->ssbSubcarrierSpacing) = duCfgParam.sib1Params.srvCellCfgCommSib.scs;
- return ROK;
-}
+ /* TDD UL-DL configuration common */
+ DU_ALLOC(spCellConfigCommon->tdd_UL_DL_ConfigurationCommon, sizeof(TDD_UL_DL_ConfigCommon_t));
+ if(!spCellConfigCommon->tdd_UL_DL_ConfigurationCommon)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for TDD UL-DL config common in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
+ if((BuildTddUlDlCfgComm(spCellConfigCommon->tdd_UL_DL_ConfigurationCommon)) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to fill TDD UL-DL config common in BuildSpCellConfigCommon()");
+ return RFAILED;
+ }
-/*******************************************************************
- *
- * @brief Builds CSI Meas config
- * @details
- *
- * Function : BuildCsiMeasCfg
- *
- * Functionality: Builds CSI Meas config in spCellCfgDed
- *
- * @params[in] struct ServingCellConfig__csi_MeasConfig *csiMeasCfg
- *
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-uint8_t BuildCsiMeasCfg(struct ServingCellConfig__csi_MeasConfig *csiMeasCfg)
-{
+ /* SS PBCH Block Power */
+ spCellConfigCommon->ss_PBCH_BlockPower = duCfgParam.sib1Params.srvCellCfgCommSib.ssPbchBlockPwr;
return ROK;
}
/*******************************************************************
*
- * @brief Builds Spcell config dedicated
+ * @brief Fills dedicated RACH configuration in Reconfiguration with sync
+ *
* @details
*
- * Function : BuildSpCellCfgDed
+ * Function : BuildRecfgWithSync
*
- * Functionality: Builds sp cell config dedicated in spCellCfg
+ * Functionality:
+ * Fills dedicated RACH configuration in Reconfiguration with sync
*
- * @params[in] ServingCellConfig_t srvCellCfg
+ * @params[in] DU UE CB
+ * Pointer to Rach config dedicated struct
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildSpCellCfgDed(ServingCellConfig_t *srvCellCfg)
+uint8_t BuildRachConfigDedicated(DuUeCb *ueCb, struct ReconfigurationWithSync__rach_ConfigDedicated *rachCfgDed)
{
- srvCellCfg->tdd_UL_DL_ConfigurationDedicated = NULLP;
- DU_ALLOC(srvCellCfg->tdd_UL_DL_ConfigurationDedicated, sizeof(TDD_UL_DL_ConfigDedicated_t));
- if(!srvCellCfg->tdd_UL_DL_ConfigurationDedicated)
+ uint8_t elementCnt = 0, listIdx = 0;
+ CFRA_t *cfra = NULLP;
+ struct CFRA__resources__ssb *ssbResource = NULLP;
+ RachCfgCommon duRachCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.rachCfg;
+
+ rachCfgDed->present = ReconfigurationWithSync__rach_ConfigDedicated_PR_uplink;
+
+ /* Uplink */
+ DU_ALLOC(rachCfgDed->choice.uplink, sizeof(RACH_ConfigDedicated_t));
+ if(!rachCfgDed->choice.uplink)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for RACH uplink configuration in BuildRachConfigDedicated()");
return RFAILED;
}
- srvCellCfg->initialDownlinkBWP = NULLP;
- DU_ALLOC(srvCellCfg->initialDownlinkBWP, sizeof(BWP_DownlinkDedicated_t));
- if(!srvCellCfg->initialDownlinkBWP)
+ /* CFRA : Contention free Random Access */
+ DU_ALLOC(rachCfgDed->choice.uplink->cfra, sizeof(CFRA_t));
+ if(!rachCfgDed->choice.uplink->cfra)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for CFRA in BuildRachConfigDedicated()");
return RFAILED;
}
+ cfra = rachCfgDed->choice.uplink->cfra;
- if(BuildInitialDlBWP(srvCellCfg->initialDownlinkBWP) != ROK)
+ /* CFRA occassions */
+ DU_ALLOC(cfra->occasions, sizeof(struct CFRA__occasions));
+ if(!cfra->occasions)
{
- DU_LOG("\nERROR --> F1AP : BuildInitialDlBWP failed");
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for CFRA occassion in BuildRachConfigDedicated()");
return RFAILED;
}
- srvCellCfg->downlinkBWP_ToReleaseList = NULLP;
- srvCellCfg->downlinkBWP_ToAddModList = NULLP;
- srvCellCfg->firstActiveDownlinkBWP_Id = NULLP;
- DU_ALLOC(srvCellCfg->firstActiveDownlinkBWP_Id, sizeof(long));
- if(!srvCellCfg->firstActiveDownlinkBWP_Id)
+ /* CFRA occassions : RACH generic configuration */
+ cfra->occasions->rach_ConfigGeneric.prach_ConfigurationIndex = duRachCfg.prachCfgIdx;
+ cfra->occasions->rach_ConfigGeneric.msg1_FDM = duRachCfg.msg1Fdm;
+ cfra->occasions->rach_ConfigGeneric.msg1_FrequencyStart = duRachCfg.msg1FreqStart;
+ cfra->occasions->rach_ConfigGeneric.zeroCorrelationZoneConfig = duRachCfg.zeroCorrZoneCfg;
+ cfra->occasions->rach_ConfigGeneric.preambleReceivedTargetPower = duRachCfg.preambleRcvdTgtPwr;
+ cfra->occasions->rach_ConfigGeneric.preambleTransMax = duRachCfg.preambleTransMax;
+ cfra->occasions->rach_ConfigGeneric.powerRampingStep = duRachCfg.pwrRampingStep;
+ cfra->occasions->rach_ConfigGeneric.ra_ResponseWindow = duRachCfg.raRspWindow;
+
+ /* CFRA occassions : SSB per RACH occasion */
+ DU_ALLOC(cfra->occasions->ssb_perRACH_Occasion, sizeof(long));
+ if(!cfra->occasions->ssb_perRACH_Occasion)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for SSB per RACH occassion in BuildRachConfigDedicated()");
return RFAILED;
}
- *(srvCellCfg->firstActiveDownlinkBWP_Id) = ACTIVE_DL_BWP_ID;
+ *(cfra->occasions->ssb_perRACH_Occasion) = convertCFRASsbPerRachOccasionValueToEnum(duCfgParam.macCellCfg.prachCfg.ssbPerRach);
- srvCellCfg->bwp_InactivityTimer = NULLP;
+ /* CFRA resource */
+ cfra->resources.present = CFRA__resources_PR_ssb;
- srvCellCfg->defaultDownlinkBWP_Id = NULLP;
- DU_ALLOC(srvCellCfg->defaultDownlinkBWP_Id, sizeof(long));
- if(!srvCellCfg->defaultDownlinkBWP_Id)
+ /* CFRA resource : SSB */
+ DU_ALLOC(cfra->resources.choice.ssb, sizeof(struct CFRA__resources__ssb));
+ if(!cfra->resources.choice.ssb)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for CFRA resource - SSB in BuildRachConfigDedicated()");
return RFAILED;
}
- *(srvCellCfg->defaultDownlinkBWP_Id) = ACTIVE_DL_BWP_ID;
+ ssbResource = cfra->resources.choice.ssb;
- srvCellCfg->uplinkConfig = NULLP;
- DU_ALLOC(srvCellCfg->uplinkConfig, sizeof(UplinkConfig_t));
- if(!srvCellCfg->uplinkConfig)
+ /* CFRA SSB resource list */
+ elementCnt = ueCb->cfraResource.numSsb;
+ ssbResource->ssb_ResourceList.list.count = elementCnt;
+ ssbResource->ssb_ResourceList.list.size = elementCnt * sizeof(CFRA_SSB_Resource_t *);
+
+ DU_ALLOC(ssbResource->ssb_ResourceList.list.array, ssbResource->ssb_ResourceList.list.size);
+ if(!ssbResource->ssb_ResourceList.list.array)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for SSB resource list in BuildRachConfigDedicated()");
return RFAILED;
}
- if(BuildUlCfg(srvCellCfg->uplinkConfig) != ROK)
+ for(listIdx = 0; listIdx < elementCnt; listIdx++)
{
- DU_LOG("\nERROR --> F1AP : BuildUlCfg failed");
- return RFAILED;
+ DU_ALLOC(ssbResource->ssb_ResourceList.list.array[listIdx], sizeof(CFRA_SSB_Resource_t));
+ if(!ssbResource->ssb_ResourceList.list.array[listIdx])
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for SSB resource list element in BuildRachConfigDedicated()");
+ return RFAILED;
+ }
+ ssbResource->ssb_ResourceList.list.array[listIdx]->ssb = ueCb->cfraResource.ssbResource[listIdx].ssbIdx;
+ ssbResource->ssb_ResourceList.list.array[listIdx]->ra_PreambleIndex = ueCb->cfraResource.ssbResource[listIdx].raPreambleIdx;
}
- srvCellCfg->supplementaryUplink = NULLP;
- srvCellCfg->pdcch_ServingCellConfig = NULLP;
- srvCellCfg->pdsch_ServingCellConfig = NULLP;
- DU_ALLOC(srvCellCfg->pdsch_ServingCellConfig, sizeof(struct ServingCellConfig__pdsch_ServingCellConfig));
- if(!srvCellCfg->pdsch_ServingCellConfig)
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills reconfiguration with sync in SP cell config
+ *
+ * @details
+ *
+ * Function : BuildRecfgWithSync
+ *
+ * Functionality: Fills reconfiguration with sync in SP cell config
+ *
+ * @params[in] DU UE CB
+ * Pointer to ReconfigurationWithSync_t
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildRecfgWithSync(DuUeCb *ueCb, ReconfigurationWithSync_t *recfgWithSync)
+{
+ /* SP Cell Config Common */
+ DU_ALLOC(recfgWithSync->spCellConfigCommon, sizeof(ServingCellConfigCommon_t));
+ if(!recfgWithSync->spCellConfigCommon)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for spCellConfigCommon in BuildRecfgWithSync()");
return RFAILED;
}
- if(BuildPdschSrvCellCfg(srvCellCfg->pdsch_ServingCellConfig) != ROK)
+ if((BuildSpCellConfigCommon(recfgWithSync->spCellConfigCommon)) != ROK)
{
- DU_LOG("\nERROR --> F1AP : BuildPdschSrvCellCfg failed");
+ DU_LOG("\nERROR --> DU APP : Failed to build SpCellConfigCommon in BuildRecfgWithSync()");
return RFAILED;
}
- srvCellCfg->csi_MeasConfig = NULLP;
-#if 0
- DU_ALLOC(srvCellCfg->csi_MeasConfig, sizeof(struct ServingCellConfig__csi_MeasConfig))
- if(!srvCellCfg->csi_MeasConfig)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
- return RFAILED;
- }
+ /* New UE Identity */
+ recfgWithSync->newUE_Identity = ueCb->crnti;
- if(BuildCsiMeasCfg(srvCellCfg->csi_MeasConfig) != ROK)
+ /* T304 timer */
+ recfgWithSync->t304 = ReconfigurationWithSync__t304_ms1000;
+
+ /* RACH configuration dedicated */
+ DU_ALLOC(recfgWithSync->rach_ConfigDedicated, sizeof(struct ReconfigurationWithSync__rach_ConfigDedicated));
+ if(!recfgWithSync->rach_ConfigDedicated)
{
- DU_LOG("\nF1AP : BuildCsiMeasCfg failed");
+ DU_LOG("\nERROR --> DU APP : Failed to allocate memory for RACH config dedicated in BuildRecfgWithSync()");
+ return RFAILED;
+ }
+
+ if((BuildRachConfigDedicated(ueCb, recfgWithSync->rach_ConfigDedicated)) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to build RACH config dedicated in BuildRecfgWithSync()");
return RFAILED;
}
-#endif
- srvCellCfg->sCellDeactivationTimer = NULLP;
- srvCellCfg->crossCarrierSchedulingConfig = NULLP;
- srvCellCfg->tag_Id = TAG_ID;
- srvCellCfg->dummy = NULLP;
- srvCellCfg->pathlossReferenceLinking = NULLP;
- srvCellCfg->servingCellMO = NULLP;
- srvCellCfg->ext1 = NULLP;
return ROK;
}
+
/*******************************************************************
*
* @brief Builds Spcell config
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildSpCellCfg(SpCellConfig_t *spCellCfg)
+uint8_t BuildSpCellCfg(DuUeCb *ueCb, SpCellConfig_t *spCellCfg)
{
-
spCellCfg->servCellIndex = NULLP;
DU_ALLOC(spCellCfg->servCellIndex, sizeof(long));
if(!spCellCfg->servCellIndex)
DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfg");
return RFAILED;
}
- *(spCellCfg->servCellIndex) = SERV_CELL_IDX;
+
+ if(ueCb == NULLP)
+ *(spCellCfg->servCellIndex) = SERV_CELL_IDX;
+ else
+ *(spCellCfg->servCellIndex) = ueCb->duMacUeCfg.spCellCfg.servCellIdx;
spCellCfg->reconfigurationWithSync = NULLP;
+ if(ueCb && (ueCb->ueState == UE_HANDIN_IN_PROGRESS))
+ {
+ DU_ALLOC(spCellCfg->reconfigurationWithSync, sizeof(ReconfigurationWithSync_t));
+ if(!spCellCfg->reconfigurationWithSync)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfg");
+ return RFAILED;
+ }
+
+ if((BuildRecfgWithSync(ueCb, spCellCfg->reconfigurationWithSync)) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Building of reconfiguration with sync failed at BuildSpCellCfg");
+ return RFAILED;
+ }
+ }
+
spCellCfg->rlf_TimersAndConstants = NULLP;
spCellCfg->rlmInSyncOutOfSyncThreshold = NULLP;
+
DU_ALLOC(spCellCfg->rlmInSyncOutOfSyncThreshold, sizeof(long));
if(!spCellCfg->rlmInSyncOutOfSyncThreshold)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfg");
return RFAILED;
}
- if(BuildSpCellCfgDed(spCellCfg->spCellConfigDedicated) != ROK)
+ if(BuildSpCellCfgDed(ueCb, spCellCfg->spCellConfigDedicated) != ROK)
{
DU_LOG("\nERROR --> F1AP : BuildSpCellCfgDed failed");
return RFAILED;
}
+
return ROK;
}
+
/*******************************************************************
*
* @brief Builds Phy cell group config
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildPhyCellGrpCfg(PhysicalCellGroupConfig_t *phyCellGrpCfg)
+uint8_t BuildPhyCellGrpCfg(DuUeCb *ueCb, PhysicalCellGroupConfig_t *phyCellGrpCfg)
{
phyCellGrpCfg->harq_ACK_SpatialBundlingPUCCH = NULLP;
phyCellGrpCfg->harq_ACK_SpatialBundlingPUSCH = NULLP;
DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildPhyCellGrpCfg");
return RFAILED;
}
- *(phyCellGrpCfg->p_NR_FR1) = P_NR_FR1;
- phyCellGrpCfg->pdsch_HARQ_ACK_Codebook = PDSCH_HARQ_ACK_CODEBOOK;
+
+ if(ueCb == NULLP)
+ {
+ *(phyCellGrpCfg->p_NR_FR1) = P_NR_FR1;
+ phyCellGrpCfg->pdsch_HARQ_ACK_Codebook = PDSCH_HARQ_ACK_CODEBOOK;
+ }
+ else
+ {
+ *(phyCellGrpCfg->p_NR_FR1) = ueCb->duMacUeCfg.phyCellGrpCfg.pNrFr1;
+ phyCellGrpCfg->pdsch_HARQ_ACK_Codebook = ueCb->duMacUeCfg.phyCellGrpCfg.pdschHarqAckCodebook;
+ }
+
phyCellGrpCfg->tpc_SRS_RNTI = NULLP;
phyCellGrpCfg->tpc_PUCCH_RNTI = NULLP;
phyCellGrpCfg->tpc_PUSCH_RNTI = NULLP;
return ROK;
}
+#ifdef NR_DRX
+/*******************************************************************
+ *
+ * @brief fill long cycle offset value of drx
+ *
+ * @details
+ *
+ * Function : fillLongCycleOffsetValFromDuCb
+ *
+ * Functionality: fill long cycle offset value of drx
+ *
+ * @params[in] DrxLongCycleStartOffset drxLongCycleStartOffset,
+ * struct DRX_ConfigRrc__drx_LongCycleStartOffset drx_LongCycleStartOffset
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+void fillLongCycleOffsetValFromDuCb(DrxLongCycleStartOffset drxLongCycleStartOffset,\
+struct DRX_ConfigRrc__drx_LongCycleStartOffset *drx_LongCycleStartOffset)
+{
+
+ drx_LongCycleStartOffset->present = convertLongDrxCycleLengthValueToEnum(drxLongCycleStartOffset.drxLongCycleStartOffsetChoice);
+ switch(drx_LongCycleStartOffset->present)
+ {
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms10:
+ {
+ drx_LongCycleStartOffset->choice.ms10 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms20:
+ {
+ drx_LongCycleStartOffset->choice.ms20 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms32:
+ {
+ drx_LongCycleStartOffset->choice.ms32 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms40:
+ {
+ drx_LongCycleStartOffset->choice.ms40 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms60:
+ {
+ drx_LongCycleStartOffset->choice.ms60 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms64:
+ {
+ drx_LongCycleStartOffset->choice.ms64 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms70:
+ {
+ drx_LongCycleStartOffset->choice.ms70 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms80:
+ {
+ drx_LongCycleStartOffset->choice.ms80 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms128:
+ {
+ drx_LongCycleStartOffset->choice.ms128 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms160:
+ {
+ drx_LongCycleStartOffset->choice.ms160 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms256:
+ {
+ drx_LongCycleStartOffset->choice.ms256 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms320:
+ {
+ drx_LongCycleStartOffset->choice.ms320 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms512:
+ {
+ drx_LongCycleStartOffset->choice.ms512 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms640:
+ {
+ drx_LongCycleStartOffset->choice.ms640 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms1024:
+ {
+ drx_LongCycleStartOffset->choice.ms1024 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms1280:
+ {
+ drx_LongCycleStartOffset->choice.ms1280 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms2048:
+ {
+ drx_LongCycleStartOffset->choice.ms2048 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms2560:
+ {
+ drx_LongCycleStartOffset->choice.ms2560 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms5120:
+ {
+ drx_LongCycleStartOffset->choice.ms5120 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms10240:
+ {
+ drx_LongCycleStartOffset->choice.ms10240 = drxLongCycleStartOffset.drxLongCycleStartOffsetVal;
+ break;
+ }
+ default :
+ break;
+ }
+}
+/*******************************************************************
+ *
+ * @brief Builds drx config IE
+ *
+ * @details
+ *
+ * Function : BuildDrxConfigRrc
+ *
+ * Functionality: Build drx config in MacCellGrpCfg
+ *
+ * @params[in] struct MAC_CellGroupConfig__drx_ConfigRrc
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildDrxConfigRrc(DuUeCb *ueCb, struct MAC_CellGroupConfig__drx_ConfigRrc *drxCfg)
+{
+ drxCfg->present = MAC_CellGroupConfig__drx_ConfigRrc_PR_setup;
+ DU_ALLOC(drxCfg->choice.setup, sizeof(struct DRX_ConfigRrc));
+ if(!drxCfg->choice.setup)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDrxConfigRrc");
+ return RFAILED;
+ }
+ if(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.drxOnDurationTimer.onDurationTimerValInMs)
+ {
+ drxCfg->choice.setup->drx_onDurationTimer.present = DRX_ConfigRrc__drx_onDurationTimer_PR_milliSeconds;
+ drxCfg->choice.setup->drx_onDurationTimer.choice.milliSeconds = convertOnDurationTimerMilliSecondsValueToEnum(ueCb->duMacUeCfg.\
+ macCellGrpCfg.drxCfg.drxOnDurationTimer.onDurationtimerValue.milliSeconds);
+ }
+ else
+ {
+ drxCfg->choice.setup->drx_onDurationTimer.present = DRX_ConfigRrc__drx_onDurationTimer_PR_subMilliSeconds;
+ drxCfg->choice.setup->drx_onDurationTimer.choice.subMilliSeconds = ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.\
+ drxOnDurationTimer.onDurationtimerValue.subMilliSeconds;
+ }
+ drxCfg->choice.setup->drx_InactivityTimer = convertDrxInactivityTimerValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.drxInactivityTimer);
+ drxCfg->choice.setup->drx_HARQ_RTT_TimerDL = ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.drxHarqRttTimerDl;
+ drxCfg->choice.setup->drx_HARQ_RTT_TimerUL = ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.drxHarqRttTimerUl;
+ drxCfg->choice.setup->drx_RetransmissionTimerDL = convertDrxRetransmissionTimerDlValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.\
+ drxRetransmissionTimerDl);
+ drxCfg->choice.setup->drx_RetransmissionTimerUL = convertDrxRetransmissionTimerUlValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.\
+ drxRetransmissionTimerUl);
+ drxCfg->choice.setup->drx_SlotOffset = ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.drxSlotOffset;
+ fillLongCycleOffsetValFromDuCb(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.drxLongCycleStartOffset, &drxCfg->choice.setup->drx_LongCycleStartOffset);
+
+ if(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.shortDrxPres)
+ {
+ DU_ALLOC(drxCfg->choice.setup->shortDRX, sizeof(struct DRX_ConfigRrc__shortDRX));
+ if(drxCfg->choice.setup->shortDRX)
+ {
+ drxCfg->choice.setup->shortDRX->drx_ShortCycle = convertShortDrxCycleLengthValueToEnum(ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.\
+ shortDrx.drxShortCycle);
+ drxCfg->choice.setup->shortDRX->drx_ShortCycleTimer = ueCb->duMacUeCfg.macCellGrpCfg.drxCfg.shortDrx.drxShortCycleTimer;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDrxConfigRrc");
+ return RFAILED;
+ }
+ }
+ return ROK;
+}
+#endif
/*******************************************************************
*
* @brief Builds Mac cell group config
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildMacCellGrpCfg(MAC_CellGroupConfig_t *macCellGrpCfg)
+uint8_t BuildMacCellGrpCfg(DuUeCb *ueCb, MAC_CellGroupConfig_t *macCellGrpCfg)
{
- macCellGrpCfg->drx_Config = NULLP;
+ macCellGrpCfg->drx_ConfigRrc = NULLP;
+#ifdef NR_DRX
+ if(ueCb)
+ {
+ DU_ALLOC(macCellGrpCfg->drx_ConfigRrc, sizeof(struct MAC_CellGroupConfig__drx_ConfigRrc));
+ if(!macCellGrpCfg->drx_ConfigRrc)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacCellGrpCfg");
+ return RFAILED;
+ }
+ if(BuildDrxConfigRrc(ueCb, macCellGrpCfg->drx_ConfigRrc) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : failed to build drx config");
+ return RFAILED;
+ }
+ }
+#endif
macCellGrpCfg->schedulingRequestConfig = NULLP;
DU_ALLOC(macCellGrpCfg->schedulingRequestConfig, sizeof(struct SchedulingRequestConfig));
if(!macCellGrpCfg->schedulingRequestConfig)
return RFAILED;
}
- if(BuildSchedulingReqConfig(macCellGrpCfg->schedulingRequestConfig) != ROK)
+ if(BuildSchedulingReqConfig(ueCb, macCellGrpCfg->schedulingRequestConfig) != ROK)
{
DU_LOG("\nERROR --> F1AP : BuildSchedulingReqConfig failed");
return RFAILED;
return RFAILED;
}
- if(BuildBsrConfig(macCellGrpCfg->bsr_Config) != ROK)
+ if(BuildBsrConfig(ueCb, macCellGrpCfg->bsr_Config) != ROK)
{
DU_LOG("\nERROR --> F1AP : BuildBsrConfig failed");
return RFAILED;
return RFAILED;
}
- if(BuildTagConfig(macCellGrpCfg->tag_Config) != ROK)
+ if(BuildTagConfig(ueCb, macCellGrpCfg->tag_Config) != ROK)
{
DU_LOG("\nERROR --> F1AP : BuildTagConfig failed");
return RFAILED;
return RFAILED;
}
- if(BuildPhrConfig(macCellGrpCfg->phr_Config) != ROK)
+ if(BuildPhrConfig(ueCb, macCellGrpCfg->phr_Config) != ROK)
{
DU_LOG("\nERROR --> F1AP : BuildPhrConfig failed");
return RFAILED;
}
}
+
+/*******************************************************************
+ *
+ * @brief Frees memory allocated for Dedicated PUCCH config
+ *
+ * @details
+ *
+ * Function : FreeBWPUlDedPucchCfg
+ *
+ * Functionality: Deallocating memory of Dedicated PUCCH cfg
+ *
+ * @params[in] BWP_UplinkDedicated__pucch_Config *ulBwpPucchCfg
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void FreeBWPUlDedPucchCfg(struct BWP_UplinkDedicated__pucch_Config *ulBwpPucchCfg)
+{
+ uint8_t k1Idx, rsrcIdx, rsrcSetIdx;
+ PUCCH_Config_t *pucchCfg = NULLP;
+ PUCCH_ResourceSet_t *rsrcSet = NULLP;
+ PUCCH_Resource_t *rsrc = NULLP;
+
+ if(ulBwpPucchCfg)
+ {
+ if(ulBwpPucchCfg->choice.setup)
+ {
+ pucchCfg = ulBwpPucchCfg->choice.setup;
+
+ //Free resource set list
+ if(pucchCfg->resourceSetToAddModList)
+ {
+ if(pucchCfg->resourceSetToAddModList->list.array)
+ {
+ for(rsrcSetIdx=0; rsrcSetIdx < pucchCfg->resourceSetToAddModList->list.count; rsrcSetIdx++)
+ {
+ rsrcSet = pucchCfg->resourceSetToAddModList->list.array[rsrcSetIdx];
+ if(rsrcSet->resourceList.list.array)
+ {
+ for(rsrcIdx=0; rsrcIdx < rsrcSet->resourceList.list.count; rsrcIdx++)
+ {
+ DU_FREE(rsrcSet->resourceList.list.array[rsrcIdx], sizeof(PUCCH_ResourceId_t));
+ }
+ DU_FREE(rsrcSet->resourceList.list.array, rsrcSet->resourceList.list.size);
+ }
+ DU_FREE(pucchCfg->resourceSetToAddModList->list.array[rsrcSetIdx], sizeof(PUCCH_ResourceSet_t));
+ }
+ DU_FREE(pucchCfg->resourceSetToAddModList->list.array, pucchCfg->resourceSetToAddModList->list.size);
+ }
+ DU_FREE(pucchCfg->resourceSetToAddModList, sizeof(struct PUCCH_Config__resourceSetToAddModList));
+ }
+
+ //Free resource list
+ if(pucchCfg->resourceToAddModList)
+ {
+ if(pucchCfg->resourceToAddModList->list.array)
+ {
+ for(rsrcIdx=0; rsrcIdx < pucchCfg->resourceToAddModList->list.count; rsrcIdx++)
+ {
+ rsrc = pucchCfg->resourceToAddModList->list.array[rsrcIdx];
+ DU_FREE(rsrc->format.choice.format1, sizeof(PUCCH_format1_t));
+ DU_FREE(pucchCfg->resourceToAddModList->list.array[rsrcIdx], sizeof(PUCCH_Resource_t));
+ }
+ DU_FREE(pucchCfg->resourceToAddModList->list.array, pucchCfg->resourceToAddModList->list.size);
+ }
+ DU_FREE(pucchCfg->resourceToAddModList, sizeof(struct PUCCH_Config__resourceToAddModList));
+ }
+
+ //PUCCH Format 1
+ if(pucchCfg->format1)
+ {
+ if(pucchCfg->format1->choice.setup)
+ {
+ DU_FREE(pucchCfg->format1->choice.setup->nrofSlots, sizeof(long));
+ DU_FREE(pucchCfg->format1->choice.setup, sizeof(PUCCH_FormatConfig_t));
+ }
+ DU_FREE(pucchCfg->format1, sizeof(struct PUCCH_Config__format1));
+ }
+
+ //DL DATA TO UL ACK
+ if(pucchCfg->dl_DataToUL_ACK)
+ {
+ if(pucchCfg->dl_DataToUL_ACK->list.array)
+ {
+ for(k1Idx = 0; k1Idx < pucchCfg->dl_DataToUL_ACK->list.count; k1Idx++)
+ {
+ DU_FREE(pucchCfg->dl_DataToUL_ACK->list.array[k1Idx], sizeof(long));
+ }
+ DU_FREE(pucchCfg->dl_DataToUL_ACK->list.array, pucchCfg->dl_DataToUL_ACK->list.size);
+ }
+ DU_FREE(pucchCfg->dl_DataToUL_ACK, sizeof(struct PUCCH_Config__dl_DataToUL_ACK));
+ }
+
+ DU_FREE(ulBwpPucchCfg->choice.setup, sizeof(PUCCH_Config_t));
+ }
+ DU_FREE(ulBwpPucchCfg, sizeof(struct BWP_UplinkDedicated__pucch_Config));
+ }
+}
+
/*******************************************************************
*
* @brief Frees memory allocated for InitialUlBWP
* ****************************************************************/
void FreeInitialUlBWP(BWP_UplinkDedicated_t *ulBwp)
{
- uint8_t rSetIdx, rsrcIdx, k1Idx;
+ uint8_t rSetIdx, rsrcIdx;
SRS_Config_t *srsCfg = NULLP;
PUSCH_Config_t *puschCfg = NULLP;
- PUCCH_Config_t *pucchCfg = NULLP;
struct PUSCH_Config__dmrs_UplinkForPUSCH_MappingTypeA *dmrsUlCfg = NULLP;
struct SRS_Config__srs_ResourceSetToAddModList *rsrcSetList = NULLP;
struct SRS_ResourceSet__srs_ResourceIdList *rsrcIdList = NULLP;
struct SRS_Config__srs_ResourceToAddModList *resourceList = NULLP;
- if(ulBwp->pucch_Config)
- {
- if(ulBwp->pucch_Config->choice.setup)
- {
- pucchCfg = ulBwp->pucch_Config->choice.setup;
- if(pucchCfg->dl_DataToUL_ACK)
- {
- if(pucchCfg->dl_DataToUL_ACK->list.array)
- {
- for(k1Idx = 0; k1Idx < pucchCfg->dl_DataToUL_ACK->list.count; k1Idx++)
- {
- DU_FREE(pucchCfg->dl_DataToUL_ACK->list.array[k1Idx], sizeof(long));
- }
- DU_FREE(pucchCfg->dl_DataToUL_ACK->list.array, pucchCfg->dl_DataToUL_ACK->list.size);
- }
- DU_FREE(pucchCfg->dl_DataToUL_ACK, sizeof(struct PUCCH_Config__dl_DataToUL_ACK));
- }
- DU_FREE(ulBwp->pucch_Config->choice.setup, sizeof(PUCCH_Config_t));
- }
- DU_FREE(ulBwp->pucch_Config, sizeof(struct BWP_UplinkDedicated__pucch_Config));
- }
+ FreeBWPUlDedPucchCfg(ulBwp->pucch_Config);
if(ulBwp->pusch_Config)
{
}
DU_FREE(dlBwp->pdcch_Config->choice.setup, sizeof(struct PDCCH_Config));
}
-}
+}
+
+/*******************************************************************
+ *
+ * @brief Free SCS specific carrier list in DL frequency info
+ *
+ * @details
+ *
+ * Function : FreeScsSpecificCarrierListDl
+ *
+ * Functionality: Free SCS specific carrier list in DL frequency info
+ *
+ * @params[in] Pointer to struct FrequencyInfoDL__scs_SpecificCarrierList
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void FreeScsSpecificCarrierListDl(struct FrequencyInfoDL__scs_SpecificCarrierList *scsCarrierList)
+{
+ uint8_t listIdx = 0;
+
+ if(!scsCarrierList->list.array)
+ {
+ for(listIdx = 0; listIdx < scsCarrierList->list.count; listIdx++)
+ {
+ DU_FREE(scsCarrierList->list.array[listIdx], sizeof(SCS_SpecificCarrier_t));
+ }
+ DU_FREE(scsCarrierList->list.array, scsCarrierList->list.size);
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Free DL frequency info in DL config common
+ *
+ * @details
+ *
+ * Function : FreeFreqInfoDl
+ *
+ * Functionality: Free DL frequency info in DL config common
+ *
+ * @params[in] Pointer to DownlinkConfigCommon_t
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void FreeFreqInfoDl(FrequencyInfoDL_t *frequencyInfoDL)
+{
+ uint8_t freqBandIdx = 0;
+
+ /* SSB Absolute Frequency */
+ DU_FREE(frequencyInfoDL->absoluteFrequencySSB, sizeof(ARFCN_ValueNR_t));
+
+ /* NR Multi Frequency Band List */
+ if(frequencyInfoDL->frequencyBandList.list.array)
+ {
+ for(freqBandIdx = 0; freqBandIdx < frequencyInfoDL->frequencyBandList.list.count; freqBandIdx++)
+ {
+ DU_FREE(frequencyInfoDL->frequencyBandList.list.array[freqBandIdx], sizeof(FreqBandIndicatorNR_t));
+ }
+ DU_FREE(frequencyInfoDL->frequencyBandList.list.array, frequencyInfoDL->frequencyBandList.list.size);
+ }
+
+ /* Subcarrier Spacing specifc carrier List */
+ FreeScsSpecificCarrierListDl(&frequencyInfoDL->scs_SpecificCarrierList);
+}
+
+/*******************************************************************
+ *
+ * @brief Free DL config common in Serving cell config common
+ *
+ * @details
+ *
+ * Function : FreeDlConfigCommon
+ *
+ * Functionality: Free DL config common in Serving cell config common
+ *
+ * @params[in] Pointer to DownlinkConfigCommon_t
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void FreeDlConfigCommon(DownlinkConfigCommon_t *dlCfgCommon)
+{
+ /* DL Frequency Info */
+ if(dlCfgCommon->frequencyInfoDL)
+ {
+ FreeFreqInfoDl(dlCfgCommon->frequencyInfoDL);
+ DU_FREE(dlCfgCommon->frequencyInfoDL, sizeof(FrequencyInfoDL_t));
+ }
+
+ /* DL BWP config common */
+ if(dlCfgCommon->initialDownlinkBWP)
+ {
+ FreeBwpDlCommon(dlCfgCommon->initialDownlinkBWP);
+ DU_FREE(dlCfgCommon->initialDownlinkBWP, sizeof(BWP_DownlinkCommon_t));
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Free SCS specific carrier list in UL frequency Info
+ *
+ * @details
+ *
+ * Function : FreeScsSpecificCarrierListUl
+ *
+ * Functionality: Free SCS specific carrier list in UL frequency Info
+ *
+ * @params[in] Pointer to struct FrequencyInfoUL__scs_SpecificCarrierList
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void FreeScsSpecificCarrierListUl(struct FrequencyInfoUL__scs_SpecificCarrierList *scsCarrierList)
+{
+ uint8_t listIdx = 0;
+
+ if(scsCarrierList->list.array)
+ {
+ for(listIdx = 0; listIdx < scsCarrierList->list.count; listIdx++)
+ {
+ DU_FREE(scsCarrierList->list.array[listIdx], sizeof(SCS_SpecificCarrier_t));
+ }
+ DU_FREE(scsCarrierList->list.array, scsCarrierList->list.size);
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Free frequency info in UL config common
+ *
+ * @details
+ *
+ * Function : FreeFreqInfoUl
+ *
+ * Functionality: Free frequency info in UL config common
+ *
+ * @params[in] Pointer to FrequencyInfoUL_t
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void FreeFreqInfoUl(FrequencyInfoUL_t *frequencyInfoUL)
+{
+ uint8_t listIdx= 0;
+
+ /* NR Multi Frequency Band List */
+ if(!frequencyInfoUL->frequencyBandList)
+ {
+ if(frequencyInfoUL->frequencyBandList->list.array)
+ {
+ for(listIdx = 0; listIdx < frequencyInfoUL->frequencyBandList->list.count; listIdx++)
+ {
+ DU_FREE(frequencyInfoUL->frequencyBandList->list.array[listIdx], sizeof(FreqBandIndicatorNR_t));
+ }
+ DU_FREE(frequencyInfoUL->frequencyBandList->list.array, frequencyInfoUL->frequencyBandList->list.size);
+ }
+ DU_FREE(frequencyInfoUL->frequencyBandList, sizeof(MultiFrequencyBandListNR_t));
+ }
+
+ /* Absolute frequency point A */
+ DU_FREE(frequencyInfoUL->absoluteFrequencyPointA, sizeof(ARFCN_ValueNR_t));
+
+ /* Subcarrier Spacing specifc carrier */
+ FreeScsSpecificCarrierListUl(&frequencyInfoUL->scs_SpecificCarrierList);
+
+ /* P-MAX */
+ DU_FREE(frequencyInfoUL->p_Max, sizeof(P_Max_t));
+}
+
+/*******************************************************************
+ *
+ * @brief Free UL config common in Serving cell config common
+ *
+ * @details
+ *
+ * Function : FreeUlConfigCommon
+ *
+ * Functionality: Free UL config common in Serving cell config common
+ *
+ * @params[in] Pointer to UplinkConfigCommon_t
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void FreeUlConfigCommon(UplinkConfigCommon_t *ulCfgCommon)
+{
+ /* UL Frequency Info */
+ if(ulCfgCommon->frequencyInfoUL)
+ {
+ FreeFreqInfoUl(ulCfgCommon->frequencyInfoUL);
+ DU_FREE(ulCfgCommon->frequencyInfoUL, sizeof(FrequencyInfoUL_t));
+ }
+
+ /* UL BWP common */
+ if(ulCfgCommon->initialUplinkBWP)
+ {
+ FreeBwpUlCommon(ulCfgCommon->initialUplinkBWP);
+ DU_FREE(ulCfgCommon->initialUplinkBWP, sizeof(BWP_UplinkCommon_t));
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Free SP cell config common in Reconfig with Sync
+ *
+ * @details
+ *
+ * Function : FreeSpCellConfigCommon
+ *
+ * Functionality: Free SP cell config common in Reconfig with Sync
+ *
+ * @params[in] Pointer to ServingCellConfigCommon_t
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void FreeSpCellConfigCommon(ServingCellConfigCommon_t *spCellConfigCommon)
+{
+ /* Free Physical cell identity */
+ DU_FREE(spCellConfigCommon->physCellId, sizeof(PhysCellId_t));
+
+ /* Free Downlink Config common */
+ if(spCellConfigCommon->downlinkConfigCommon)
+ {
+ FreeDlConfigCommon(spCellConfigCommon->downlinkConfigCommon);
+ DU_FREE(spCellConfigCommon->downlinkConfigCommon, sizeof(DownlinkConfigCommon_t));
+ }
+
+ /* Free Uplink Config common */
+ if(spCellConfigCommon->uplinkConfigCommon)
+ {
+ FreeUlConfigCommon(spCellConfigCommon->uplinkConfigCommon);
+ DU_FREE(spCellConfigCommon->uplinkConfigCommon, sizeof(UplinkConfigCommon_t));
+ }
+
+ /* Free Timing Advance offset */
+ DU_FREE(spCellConfigCommon->n_TimingAdvanceOffset, sizeof(long));
+
+ /* Free SSB Position in Burst */
+ if(spCellConfigCommon->ssb_PositionsInBurst)
+ {
+ DU_FREE(spCellConfigCommon->ssb_PositionsInBurst->choice.mediumBitmap.buf, \
+ spCellConfigCommon->ssb_PositionsInBurst->choice.mediumBitmap.size);
+ DU_FREE(spCellConfigCommon->ssb_PositionsInBurst, sizeof(struct ServingCellConfigCommon__ssb_PositionsInBurst));
+ }
+
+ /* Free SSB Periodicity in Serving cell */
+ DU_FREE(spCellConfigCommon->ssb_periodicityServingCell, sizeof(long));
+
+ /* Free SSB subcarrier spacing */
+ DU_FREE(spCellConfigCommon->ssbSubcarrierSpacing, sizeof(SubcarrierSpacing_t));
+
+ /* TDD UL-DL configuration common */
+ DU_FREE(spCellConfigCommon->tdd_UL_DL_ConfigurationCommon, sizeof(TDD_UL_DL_ConfigCommon_t));
+}
+
+/*******************************************************************
+ *
+ * @brief Free dedicated RACH configuration in Reconfiguration with sync
+ *
+ * @details
+ *
+ * Function : FreeRecfgWithSync
+ *
+ * Functionality:
+ * Free dedicated RACH configuration in Reconfiguration with sync
+ *
+ * @params[in] Pinter to Rach config dedicated struct
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void FreeRachConfigDedicated(struct ReconfigurationWithSync__rach_ConfigDedicated *rachCfgDed)
+{
+ uint8_t listIdx = 0;
+ CFRA_t *cfra = NULLP;
+ struct CFRA__resources__ssb *ssbResource = NULLP;
+
+ /* Uplink */
+ if(rachCfgDed->choice.uplink)
+ {
+ /* CFRA : Contention free Random Access */
+ if(rachCfgDed->choice.uplink->cfra)
+ {
+ cfra = rachCfgDed->choice.uplink->cfra;
+
+ /* CFRA occassions */
+ if(cfra->occasions)
+ {
+ /* CFRA occassions : SSB per RACH occasion */
+ DU_FREE(cfra->occasions->ssb_perRACH_Occasion, sizeof(long));
+ DU_FREE(cfra->occasions, sizeof(struct CFRA__occasions));
+ }
+
+ /* CFRA resource */
+ cfra->resources.present = CFRA__resources_PR_ssb;
+
+ /* CFRA resource : SSB */
+ if(cfra->resources.choice.ssb)
+ {
+ ssbResource = cfra->resources.choice.ssb;
+
+ /* CFRA SSB resource list */
+ if(ssbResource->ssb_ResourceList.list.array)
+ {
+ for(listIdx = 0; listIdx < ssbResource->ssb_ResourceList.list.count; listIdx++)
+ {
+ DU_FREE(ssbResource->ssb_ResourceList.list.array[listIdx], sizeof(CFRA_SSB_Resource_t));
+ }
+ DU_FREE(ssbResource->ssb_ResourceList.list.array, ssbResource->ssb_ResourceList.list.size);
+ }
+ DU_FREE(cfra->resources.choice.ssb, sizeof(struct CFRA__resources__ssb));
+ }
+ DU_FREE(rachCfgDed->choice.uplink->cfra, sizeof(CFRA_t));
+ }
+ DU_FREE(rachCfgDed->choice.uplink, sizeof(RACH_ConfigDedicated_t));
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Frees reconfiguration with sync in SP cell config
+ *
+ * @details
+ *
+ * Function : FreeRecfgWithSync
+ *
+ * Functionality: Fress reconfiguration with sync in SP cell config
+ *
+ * @params[in] Pointer to ReconfigurationWithSync_t
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void FreeRecfgWithSync(ReconfigurationWithSync_t *recfgWithSync)
+{
+ /* Free SP Cell config common */
+ if(recfgWithSync->spCellConfigCommon)
+ {
+ FreeSpCellConfigCommon(recfgWithSync->spCellConfigCommon);
+ DU_FREE(recfgWithSync->spCellConfigCommon, sizeof(ServingCellConfigCommon_t));
+ }
+
+ /* Free Dedicated RACH configuration */
+ if(recfgWithSync->rach_ConfigDedicated)
+ {
+ FreeRachConfigDedicated(recfgWithSync->rach_ConfigDedicated);
+ DU_FREE(recfgWithSync->rach_ConfigDedicated, sizeof(struct ReconfigurationWithSync__rach_ConfigDedicated));
+ }
+}
/*******************************************************************
*
struct CellGroupConfigRrc__rlc_BearerToAddModList *rlcBearerList=NULLP;
struct RLC_Config *rlcConfig=NULLP;
struct LogicalChannelConfig *macLcConfig=NULLP;
+ struct MAC_CellGroupConfig__drx_ConfigRrc *drxCfg=NULLP;
struct SchedulingRequestConfig *schedulingRequestConfig=NULLP;
struct SchedulingRequestConfig__schedulingRequestToAddModList *schReqList=NULLP;
struct TAG_Config *tagConfig=NULLP;
macLcConfig = rlcBearerList->list.array[idx]->mac_LogicalChannelConfig;
if(rlcConfig)
{
- if(rlcConfig->choice.am)
+ switch(rlcConfig->present)
{
- DU_FREE(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t));
- DU_FREE(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t));
- DU_FREE(rlcConfig->choice.am, sizeof(struct RLC_Config__am));
+ case RLC_Config_PR_NOTHING:
+ break;
+
+ case RLC_Config_PR_am:
+ {
+ if(rlcConfig->choice.am)
+ {
+ DU_FREE(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t));
+ DU_FREE(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t));
+ DU_FREE(rlcConfig->choice.am, sizeof(struct RLC_Config__am));
+ }
+ break;
+ }
+ case RLC_Config_PR_um_Bi_Directional:
+ {
+ if(rlcConfig->choice.um_Bi_Directional)
+ {
+ DU_FREE(rlcConfig->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+ DU_FREE(rlcConfig->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+ DU_FREE(rlcConfig->choice.um_Bi_Directional, sizeof(struct RLC_Config__um_Bi_Directional));
+ }
+ break;
+ }
+ case RLC_Config_PR_um_Uni_Directional_UL:
+ {
+ if(rlcConfig->choice.um_Uni_Directional_UL)
+ {
+ DU_FREE(rlcConfig->choice.um_Uni_Directional_UL->ul_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+ DU_FREE(rlcConfig->choice.um_Uni_Directional_UL , sizeof(struct RLC_Config__um_Uni_Directional_UL));
+ }
+ break;
+ }
+ case RLC_Config_PR_um_Uni_Directional_DL:
+ {
+ if(rlcConfig->choice.um_Uni_Directional_DL )
+ {
+ DU_FREE(rlcConfig->choice.um_Uni_Directional_DL->dl_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+ DU_FREE(rlcConfig->choice.um_Uni_Directional_DL , sizeof(struct RLC_Config__um_Uni_Directional_DL));
+ }
+ break;
+ }
}
DU_FREE(rlcConfig, sizeof(struct RLC_Config));
}
macCellGrpCfg = cellGrpCfg->mac_CellGroupConfig;
if(macCellGrpCfg)
{
+ drxCfg = macCellGrpCfg->drx_ConfigRrc;
+
+ if(drxCfg)
+ {
+ switch(drxCfg->present)
+ {
+ case MAC_CellGroupConfig__drx_ConfigRrc_PR_NOTHING:
+ break;
+ case MAC_CellGroupConfig__drx_ConfigRrc_PR_setup:
+ {
+ if(drxCfg->choice.setup)
+ {
+ DU_FREE(drxCfg->choice.setup->shortDRX, sizeof(struct DRX_ConfigRrc__shortDRX));
+ DU_FREE(drxCfg->choice.setup, sizeof(struct DRX_ConfigRrc));
+ }
+ }
+ case MAC_CellGroupConfig__drx_ConfigRrc_PR_release:
+ break;
+ }
+ DU_FREE(drxCfg, sizeof(struct MAC_CellGroupConfig__drx_ConfigRrc));
+ }
schedulingRequestConfig = macCellGrpCfg->schedulingRequestConfig;
if(schedulingRequestConfig)
{
}
if(macCellGrpCfg->bsr_Config)
{
+ DU_FREE(macCellGrpCfg->bsr_Config->logicalChannelSR_DelayTimer, sizeof(long));
DU_FREE(macCellGrpCfg->bsr_Config, sizeof(struct BSR_Config));
}
tagConfig = macCellGrpCfg->tag_Config;
spCellCfg = cellGrpCfg->spCellConfig;
if(spCellCfg)
{
- if(spCellCfg->servCellIndex)
+ /* Free serving cell index */
+ DU_FREE(spCellCfg->servCellIndex, sizeof(long));
+
+ /* Free Reconfiguration with sync */
+ if(spCellCfg->reconfigurationWithSync)
{
- if(spCellCfg->rlmInSyncOutOfSyncThreshold)
+ FreeRecfgWithSync(spCellCfg->reconfigurationWithSync);
+ DU_FREE(spCellCfg->reconfigurationWithSync, sizeof(ReconfigurationWithSync_t));
+ }
+
+ /* Free rlmInSyncOutOfSyncThreshold */
+ DU_FREE(spCellCfg->rlmInSyncOutOfSyncThreshold, sizeof(long));
+
+ /* Free SP Cell config dedicated */
+ if(spCellCfg->spCellConfigDedicated)
+ {
+ srvCellCfg = spCellCfg->spCellConfigDedicated;
+
+ /* Free TDD UL-DL config dedicated */
+ DU_FREE(srvCellCfg->tdd_UL_DL_ConfigurationDedicated, sizeof(TDD_UL_DL_ConfigDedicated_t));
+
+ /* Free Initial Downlink BWP */
+ if(srvCellCfg->initialDownlinkBWP)
{
- if(spCellCfg->spCellConfigDedicated)
+ dlBwp = srvCellCfg->initialDownlinkBWP;
+
+ /* Free DL BWP PDCCH Config */
+ if(dlBwp->pdcch_Config)
{
- srvCellCfg = spCellCfg->spCellConfigDedicated;
- if(srvCellCfg->tdd_UL_DL_ConfigurationDedicated)
- {
- if(srvCellCfg->initialDownlinkBWP)
- {
- dlBwp = srvCellCfg->initialDownlinkBWP;
- if(srvCellCfg->firstActiveDownlinkBWP_Id)
- {
- if(srvCellCfg->defaultDownlinkBWP_Id)
- {
- if(srvCellCfg->uplinkConfig)
- {
- if(srvCellCfg->pdsch_ServingCellConfig)
- {
- pdschCfg= srvCellCfg->pdsch_ServingCellConfig;
- if(pdschCfg->choice.setup)
- {
- DU_FREE(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH,sizeof(long));
- DU_FREE(pdschCfg->choice.setup, sizeof( struct PDSCH_ServingCellConfig));
- }
- DU_FREE(srvCellCfg->pdsch_ServingCellConfig, sizeof(struct
- ServingCellConfig__pdsch_ServingCellConfig));
- }
- FreeinitialUplinkBWP(srvCellCfg->uplinkConfig);
- DU_FREE(srvCellCfg->uplinkConfig, sizeof(UplinkConfig_t));
- }
- DU_FREE(srvCellCfg->defaultDownlinkBWP_Id, sizeof(long));
- }
- DU_FREE(srvCellCfg->firstActiveDownlinkBWP_Id, sizeof(long));
- }
- if(dlBwp->pdcch_Config)
- {
- if(dlBwp->pdsch_Config)
- {
- FreeBWPDlDedPdschCfg(dlBwp);
- DU_FREE(dlBwp->pdsch_Config, sizeof(struct BWP_DownlinkDedicated__pdsch_Config));
- }
- FreeBWPDlDedPdcchCfg(dlBwp);
- DU_FREE(dlBwp->pdcch_Config, sizeof(struct BWP_DownlinkDedicated__pdcch_Config));
- }
- DU_FREE(srvCellCfg->initialDownlinkBWP, sizeof(BWP_DownlinkDedicated_t));
- }
- DU_FREE(srvCellCfg->tdd_UL_DL_ConfigurationDedicated, sizeof(TDD_UL_DL_ConfigDedicated_t));
- }
- DU_FREE(spCellCfg->spCellConfigDedicated, sizeof(ServingCellConfig_t));
+ FreeBWPDlDedPdcchCfg(dlBwp);
+ DU_FREE(dlBwp->pdcch_Config, sizeof(struct BWP_DownlinkDedicated__pdcch_Config));
+ }
+
+ /* Free DL BWP PDSCH config */
+ if(dlBwp->pdsch_Config)
+ {
+ FreeBWPDlDedPdschCfg(dlBwp);
+ DU_FREE(dlBwp->pdsch_Config, sizeof(struct BWP_DownlinkDedicated__pdsch_Config));
+ }
+ DU_FREE(srvCellCfg->initialDownlinkBWP, sizeof(BWP_DownlinkDedicated_t));
+ }
+
+ /* Free First Active Downlink BWP */
+ DU_FREE(srvCellCfg->firstActiveDownlinkBWP_Id, sizeof(long));
+
+ /* Free Default downlink BWP */
+ DU_FREE(srvCellCfg->defaultDownlinkBWP_Id, sizeof(long));
+
+ /* Free Uplink config */
+ if(srvCellCfg->uplinkConfig)
+ {
+ FreeinitialUplinkBWP(srvCellCfg->uplinkConfig);
+ DU_FREE(srvCellCfg->uplinkConfig, sizeof(UplinkConfig_t));
+ }
+
+ /* Free PDSCH serving cell config */
+ if(srvCellCfg->pdsch_ServingCellConfig)
+ {
+ pdschCfg= srvCellCfg->pdsch_ServingCellConfig;
+ if(pdschCfg->choice.setup)
+ {
+ DU_FREE(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH,sizeof(long));
+ DU_FREE(pdschCfg->choice.setup, sizeof(struct PDSCH_ServingCellConfig));
}
- DU_FREE(spCellCfg->rlmInSyncOutOfSyncThreshold, sizeof(long));
+ DU_FREE(srvCellCfg->pdsch_ServingCellConfig, sizeof(struct ServingCellConfig__pdsch_ServingCellConfig));
}
- DU_FREE(spCellCfg->servCellIndex, sizeof(long));
+
+ DU_FREE(spCellCfg->spCellConfigDedicated, sizeof(ServingCellConfig_t));
}
DU_FREE(spCellCfg,sizeof(SpCellConfig_t));
}
return ROK;
}
+
/*******************************************************************
*
- * @brief Builds DU To CU RRC Container
+ * @brief Builds CellGroupConfigRrc for DU To CU RRC Container
*
* @details
*
- * Function : BuildDuToCuRrcContainer
+ * Function : BuildCellGroupConfigRrc
*
- * Functionality: Builds DuToCuRrcContainer
+ * Functionality: Builds and copied Cell group config buffer into
+ * DuToCuRrcContainer
*
* @params[in] idx, index in F1AP msg
* DuToCuRRCContainer, DuToCuRRCContainer
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildDuToCuRrcContainer(DUtoCURRCContainer_t *duToCuRrcContainer)
+uint8_t BuildCellGroupConfigRrc(DuUeCb *ueCb, OCTET_STRING_t *duToCuRrcContainer)
{
uint8_t ret = ROK;
CellGroupConfigRrc_t cellGrpCfg;
DU_ALLOC(cellGrpCfg.rlc_BearerToAddModList, sizeof(struct CellGroupConfigRrc__rlc_BearerToAddModList));
if(!cellGrpCfg.rlc_BearerToAddModList)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDuToCuRrcContainer");
- ret = RFAILED;
- break;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDuToCuRrcContainer");
+ ret = RFAILED;
+ break;
}
- if(BuildRlcBearerToAddModList(cellGrpCfg.rlc_BearerToAddModList) != ROK)
+ if(BuildRlcBearerToAddModList(ueCb, cellGrpCfg.rlc_BearerToAddModList) != ROK)
{
- DU_LOG("\nERROR --> F1AP : BuildRlcBearerToAddModList failed");
- ret = RFAILED;
- break;
+ DU_LOG("\nERROR --> F1AP : BuildRlcBearerToAddModList failed");
+ ret = RFAILED;
+ break;
}
cellGrpCfg.rlc_BearerToReleaseList = NULLP;
DU_ALLOC(cellGrpCfg.mac_CellGroupConfig, sizeof(MAC_CellGroupConfig_t));
if(!cellGrpCfg.mac_CellGroupConfig)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDuToCuRrcContainer");
- ret = RFAILED;
- break;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDuToCuRrcContainer");
+ ret = RFAILED;
+ break;
}
- if(BuildMacCellGrpCfg(cellGrpCfg.mac_CellGroupConfig) != ROK)
+ if(BuildMacCellGrpCfg(ueCb, cellGrpCfg.mac_CellGroupConfig) != ROK)
{
- DU_LOG("\nERROR --> F1AP : BuildMacCellGrpCfg failed");
- ret = RFAILED;
- break;
+ DU_LOG("\nERROR --> F1AP : BuildMacCellGrpCfg failed");
+ ret = RFAILED;
+ break;
}
cellGrpCfg.physicalCellGroupConfig = NULLP;
DU_ALLOC(cellGrpCfg.physicalCellGroupConfig, sizeof(PhysicalCellGroupConfig_t));
if(!cellGrpCfg.physicalCellGroupConfig)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDuToCuRrcContainer");
- ret = RFAILED;
- break;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDuToCuRrcContainer");
+ ret = RFAILED;
+ break;
}
- if(BuildPhyCellGrpCfg(cellGrpCfg.physicalCellGroupConfig) != ROK)
+ if(BuildPhyCellGrpCfg(ueCb, cellGrpCfg.physicalCellGroupConfig) != ROK)
{
- DU_LOG("\nERROR --> F1AP : BuildPhyCellGrpCfg failed");
- ret = RFAILED;
- break;
+ DU_LOG("\nERROR --> F1AP : BuildPhyCellGrpCfg failed");
+ ret = RFAILED;
+ break;
}
cellGrpCfg.spCellConfig = NULLP;
DU_ALLOC(cellGrpCfg.spCellConfig, sizeof(SpCellConfig_t));
if(!cellGrpCfg.spCellConfig)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDuToCuRrcContainer");
- ret = RFAILED;
- break;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDuToCuRrcContainer");
+ ret = RFAILED;
+ break;
}
- if(BuildSpCellCfg(cellGrpCfg.spCellConfig) != ROK)
+ if(BuildSpCellCfg(ueCb, cellGrpCfg.spCellConfig) != ROK)
{
- DU_LOG("\nERROR --> F1AP : BuildSpCellCfg failed");
- ret = RFAILED;
- break;
+ DU_LOG("\nERROR --> F1AP : BuildSpCellCfg failed");
+ ret = RFAILED;
+ break;
}
cellGrpCfg.sCellToAddModList = NULLP;
xer_fprint(stdout, &asn_DEF_CellGroupConfigRrc, &cellGrpCfg);
memset(encBuf, 0, ENC_BUF_MAX_LEN);
encBufSize = 0;
- encRetVal = aper_encode(&asn_DEF_CellGroupConfigRrc, 0, &cellGrpCfg, PrepFinalEncBuf, encBuf);
+ encRetVal = uper_encode(&asn_DEF_CellGroupConfigRrc, 0, &cellGrpCfg, PrepFinalEncBuf, encBuf);
/* Encode results */
if(encRetVal.encoded == ENCODE_FAIL)
{
- DU_LOG( "\nERROR --> F1AP : Could not encode DuToCuRrcContainer (at %s)\n",\
- encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
- ret = RFAILED;
- break;
+ DU_LOG( "\nERROR --> F1AP : Could not encode DuToCuRrcContainer (at %s)\n",\
+ encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+ ret = RFAILED;
+ break;
}
else
{
- DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for DuToCuRrcContainer\n");
- for(int i=0; i< encBufSize; i++)
- {
- printf("%x",encBuf[i]);
- }
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for DuToCuRrcContainer\n");
+#ifdef DEBUG_ASN_PRINT
+ for(int i=0; i< encBufSize; i++)
+ {
+ printf("%x",encBuf[i]);
+ }
+#endif
}
duToCuRrcContainer->size = encBufSize;
DU_ALLOC(duToCuRrcContainer->buf, duToCuRrcContainer->size);
if(!duToCuRrcContainer->buf)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDuToCuRrcContainer");
- ret = RFAILED;
- break;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDuToCuRrcContainer");
+ ret = RFAILED;
+ break;
}
if(ret == ROK)
{
{
uint8_t ret;
uint8_t elementCnt;
- uint8_t ieIdx;
+ uint8_t ieIdx, cellIdx, ueIdx;
+ DuUeCb *duUeCb = NULLP;
asn_enc_rval_t encRetVal;
F1AP_PDU_t *f1apMsg = NULLP;
InitialULRRCMessageTransfer_t *initULRRCMsg = NULLP;
initULRRCMsg->protocolIEs.list.array[ieIdx]->value.present =\
InitialULRRCMessageTransferIEs__value_PR_DUtoCURRCContainer;
- ret = BuildDuToCuRrcContainer(&initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.DUtoCURRCContainer);
+ for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++)
+ {
+ for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
+ {
+ if(duCb.actvCellLst[cellIdx] && (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
+ (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].crnti == crnti))
+ {
+ duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
+ }
+ }
+ }
+
+ ret = BuildCellGroupConfigRrc(duUeCb, &initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.DUtoCURRCContainer);
if(ret != ROK)
{
break;
xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
- /* Encode the F1SetupRequest type as APER */
+ /* Encode the Intial UL RRC Message transfer as APER */
memset(encBuf, 0, ENC_BUF_MAX_LEN);
encBufSize = 0;
encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf, encBuf);
DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for Initial UL RRC\
Message transfer\n");
+#ifdef DEBUG_ASN_PRINT
for(int i=0; i< encBufSize; i++)
{
printf("%x",encBuf[i]);
}
+#endif
}
/* Sending msg */
if(sendF1APMsg() != ROK)
/***** UE SETUP REQUEST *****/
-/*******************************************************************
- *
- * @brief Free Qos And Snssai Drb Info
- *
- * @details
- *
- * Function : freeDrbQosAndSnssaiInfo
- *
- * Functionality: Free Qos And Snssai Drb Info
- *
- * @params[in] LcCfg *lcCfg,
- * @return void
- *
- * ****************************************************************/
-void freeDrbQosAndSnssaiInfo(LcCfg *lcCfg)
-{
- if(lcCfg->snssai)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->snssai, sizeof(Snssai));
- }
- if(lcCfg->drbQos)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->drbQos, sizeof(DrbQosInfo));
- }
-}
-
/******************************************************************
*
* @brief Function to delete the RLC Lc cfg from UE APP DB
{
case RLC_AM :
{
- if(lcCfg->u.amCfg)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.amCfg, sizeof(AmBearerCfg));
- }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.amCfg, sizeof(AmBearerCfg));
break;
}
case RLC_UM_BI_DIRECTIONAL :
{
- if(lcCfg->u.umBiDirCfg)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
- }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
break;
}
case RLC_UM_UNI_DIRECTIONAL_UL :
{
- if(lcCfg->u.umUniDirUlCfg)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
- }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
break;
-
}
case RLC_UM_UNI_DIRECTIONAL_DL :
{
- if(lcCfg->u.umUniDirDlCfg)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
- }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
break;
}
default:
*
* ****************************************************************/
-void freeMacLcCfg(LcCfg *lcCfg)
+void freeMacLcCfg(LcCfg *lcCfg)
{
/* Deleting DRBQOS */
if(lcCfg->drbQos)
* @return void
*
* ****************************************************************/
-void freeDuUeCfg(DuUeCfg *ueCfg)
+void freeDuUeCfg(UeCtxtActionType actionType, DuUeCfg *ueCfg)
{
uint8_t lcIdx = 0;
uint8_t arrIdx = 0;
if(ueCfg->cellGrpCfg)
{
-
rlcBearerList = cellGrpCfg->rlc_BearerToAddModList;
if(rlcBearerList)
{
- if(rlcBearerList->list.array)
- {
- for(arrIdx=0; arrIdx<rlcBearerList->list.count; arrIdx++)
- {
- if(rlcBearerList->list.array[arrIdx])
- {
- rlcConfig = rlcBearerList->list.array[arrIdx]->rlc_Config;
- macLcConfig = rlcBearerList->list.array[arrIdx]->mac_LogicalChannelConfig;
-
- if(rlcBearerList->list.array[arrIdx]->servedRadioBearer)
- {
- free(rlcBearerList->list.array[arrIdx]->servedRadioBearer);
- }
- if(rlcConfig)
- {
- if(rlcConfig->choice.am)
- {
- free(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength);
- free(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength);
- free(rlcConfig->choice.am);
- }
- free(rlcBearerList->list.array[arrIdx]->rlc_Config);
- }
- if(macLcConfig)
- {
- if(macLcConfig->ul_SpecificParameters)
- {
- free(macLcConfig->ul_SpecificParameters->schedulingRequestID);
- free(macLcConfig->ul_SpecificParameters->logicalChannelGroup);
- free(macLcConfig->ul_SpecificParameters);
- }
- free(rlcBearerList->list.array[arrIdx]->mac_LogicalChannelConfig);
- }
- free(rlcBearerList->list.array[arrIdx]);
- }
- }
- free(rlcBearerList->list.array);
- }
- free(cellGrpCfg->rlc_BearerToAddModList);
+ if(rlcBearerList->list.array)
+ {
+ for(arrIdx=0; arrIdx<rlcBearerList->list.count; arrIdx++)
+ {
+ if(rlcBearerList->list.array[arrIdx])
+ {
+ rlcConfig = rlcBearerList->list.array[arrIdx]->rlc_Config;
+ macLcConfig = rlcBearerList->list.array[arrIdx]->mac_LogicalChannelConfig;
+
+ if(rlcBearerList->list.array[arrIdx]->servedRadioBearer)
+ {
+ free(rlcBearerList->list.array[arrIdx]->servedRadioBearer);
+ }
+ if(rlcConfig)
+ {
+ if(rlcConfig->choice.am)
+ {
+ free(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength);
+ free(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength);
+ free(rlcConfig->choice.am);
+ }
+ free(rlcBearerList->list.array[arrIdx]->rlc_Config);
+ }
+ if(macLcConfig)
+ {
+ if(macLcConfig->ul_SpecificParameters)
+ {
+ free(macLcConfig->ul_SpecificParameters->schedulingRequestID);
+ free(macLcConfig->ul_SpecificParameters->logicalChannelGroup);
+ free(macLcConfig->ul_SpecificParameters);
+ }
+ free(rlcBearerList->list.array[arrIdx]->mac_LogicalChannelConfig);
+ }
+ free(rlcBearerList->list.array[arrIdx]);
+ }
+ }
+ free(rlcBearerList->list.array);
+ }
+ free(cellGrpCfg->rlc_BearerToAddModList);
}
macCellGrpCfg = cellGrpCfg->mac_CellGroupConfig;
if(macCellGrpCfg)
{
- schedulingRequestConfig = macCellGrpCfg->schedulingRequestConfig;
- if(schedulingRequestConfig)
- {
- schReqList = schedulingRequestConfig->schedulingRequestToAddModList;
- if(schReqList)
- {
- if(schReqList->list.array)
- {
- for(arrIdx=0;arrIdx<schReqList->list.count; arrIdx++)
- {
- if(schReqList->list.array[arrIdx])
- {
- free(schReqList->list.array[arrIdx]->sr_ProhibitTimer);
- free(schReqList->list.array[arrIdx]);
- }
- }
- free(schReqList->list.array);
- }
- free(schedulingRequestConfig->schedulingRequestToAddModList);
- }
- free(macCellGrpCfg->schedulingRequestConfig);
- }
- if(macCellGrpCfg->bsr_Config)
- {
- free(macCellGrpCfg->bsr_Config);
- }
- tagConfig = macCellGrpCfg->tag_Config;
- if(tagConfig)
- {
- tagList = tagConfig->tag_ToAddModList;
- if(tagList)
- {
- if(tagList->list.array)
- {
- for(arrIdx=0; arrIdx<tagList->list.count; arrIdx++)
- {
- free(tagList->list.array[arrIdx]);
- }
- free(tagList->list.array);
- }
- free(tagConfig->tag_ToAddModList);
- }
- free(tagConfig);
- }
+ schedulingRequestConfig = macCellGrpCfg->schedulingRequestConfig;
+ if(schedulingRequestConfig)
+ {
+ schReqList = schedulingRequestConfig->schedulingRequestToAddModList;
+ if(schReqList)
+ {
+ if(schReqList->list.array)
+ {
+ for(arrIdx=0;arrIdx<schReqList->list.count; arrIdx++)
+ {
+ if(schReqList->list.array[arrIdx])
+ {
+ free(schReqList->list.array[arrIdx]->sr_ProhibitTimer);
+ free(schReqList->list.array[arrIdx]);
+ }
+ }
+ free(schReqList->list.array);
+ }
+ free(schedulingRequestConfig->schedulingRequestToAddModList);
+ }
+ free(macCellGrpCfg->schedulingRequestConfig);
+ }
+ if(macCellGrpCfg->bsr_Config)
+ {
+ free(macCellGrpCfg->bsr_Config);
+ }
+ tagConfig = macCellGrpCfg->tag_Config;
+ if(tagConfig)
+ {
+ tagList = tagConfig->tag_ToAddModList;
+ if(tagList)
+ {
+ if(tagList->list.array)
+ {
+ for(arrIdx=0; arrIdx<tagList->list.count; arrIdx++)
+ {
+ free(tagList->list.array[arrIdx]);
+ }
+ free(tagList->list.array);
+ }
+ free(tagConfig->tag_ToAddModList);
+ }
+ free(tagConfig);
+ }
- phrConfig = macCellGrpCfg->phr_Config;
- if(phrConfig)
- {
- free(phrConfig->choice.setup);
- free(phrConfig);
- }
+ phrConfig = macCellGrpCfg->phr_Config;
+ if(phrConfig)
+ {
+ free(phrConfig->choice.setup);
+ free(phrConfig);
+ }
- free(macCellGrpCfg);
+ free(macCellGrpCfg);
}
phyCellGrpCfg = cellGrpCfg->physicalCellGroupConfig;
if(phyCellGrpCfg)
{
- free(phyCellGrpCfg->p_NR_FR1);
- free(phyCellGrpCfg);
+ free(phyCellGrpCfg->p_NR_FR1);
+ free(phyCellGrpCfg);
}
spCellCfg = cellGrpCfg->spCellConfig;
if(spCellCfg)
{
- if(spCellCfg->servCellIndex)
- {
- if(spCellCfg->rlmInSyncOutOfSyncThreshold)
- {
- if(spCellCfg->spCellConfigDedicated)
- {
- srvCellCfg = spCellCfg->spCellConfigDedicated;
- if(srvCellCfg->initialDownlinkBWP)
- {
- dlBwp = srvCellCfg->initialDownlinkBWP;
- if(srvCellCfg->firstActiveDownlinkBWP_Id)
- {
- if(srvCellCfg->defaultDownlinkBWP_Id)
- {
- if(srvCellCfg->uplinkConfig)
- {
+ if(spCellCfg->servCellIndex)
+ {
+ if(spCellCfg->rlmInSyncOutOfSyncThreshold)
+ {
+ if(spCellCfg->spCellConfigDedicated)
+ {
+ srvCellCfg = spCellCfg->spCellConfigDedicated;
+ if(srvCellCfg->initialDownlinkBWP)
+ {
+ dlBwp = srvCellCfg->initialDownlinkBWP;
+ if(srvCellCfg->firstActiveDownlinkBWP_Id)
+ {
+ if(srvCellCfg->defaultDownlinkBWP_Id)
+ {
+ if(srvCellCfg->uplinkConfig)
+ {
- if(srvCellCfg->pdsch_ServingCellConfig)
- {
- pdschCfg=
- srvCellCfg->pdsch_ServingCellConfig;
- if(pdschCfg->choice.setup)
- {
+ if(srvCellCfg->pdsch_ServingCellConfig)
+ {
+ pdschCfg=
+ srvCellCfg->pdsch_ServingCellConfig;
+ if(pdschCfg->choice.setup)
+ {
- free(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH);
- free(pdschCfg->choice.setup);
- }
+ free(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH);
+ free(pdschCfg->choice.setup);
+ }
- free(srvCellCfg->pdsch_ServingCellConfig);
- }
+ free(srvCellCfg->pdsch_ServingCellConfig);
+ }
- freeAperDecodeinitialUplinkBWPConfig(srvCellCfg->uplinkConfig);
- free(srvCellCfg->uplinkConfig);
- }
- free(srvCellCfg->defaultDownlinkBWP_Id);
- }
+ freeAperDecodeinitialUplinkBWPConfig(srvCellCfg->uplinkConfig);
+ free(srvCellCfg->uplinkConfig);
+ }
+ free(srvCellCfg->defaultDownlinkBWP_Id);
+ }
- free(srvCellCfg->firstActiveDownlinkBWP_Id);
- }
- if(dlBwp->pdcch_Config)
- {
- if(dlBwp->pdsch_Config)
- {
- freeAperDecodeBWPDlDedPdschConfig(dlBwp);
- free(dlBwp->pdsch_Config);
- }
- freeAperDecodeBWPDlDedPdcchConfig(dlBwp);
- free(dlBwp->pdcch_Config);
- }
- free(srvCellCfg->initialDownlinkBWP);
- }
+ free(srvCellCfg->firstActiveDownlinkBWP_Id);
+ }
+ if(dlBwp->pdcch_Config)
+ {
+ if(dlBwp->pdsch_Config)
+ {
+ freeAperDecodeBWPDlDedPdschConfig(dlBwp);
+ free(dlBwp->pdsch_Config);
+ }
+ freeAperDecodeBWPDlDedPdcchConfig(dlBwp);
+ free(dlBwp->pdcch_Config);
+ }
+ free(srvCellCfg->initialDownlinkBWP);
+ }
- free(spCellCfg->spCellConfigDedicated);
- }
- free(spCellCfg->rlmInSyncOutOfSyncThreshold);
- }
- free(spCellCfg->servCellIndex);
- }
- free(spCellCfg);
+ free(spCellCfg->spCellConfigDedicated);
+ }
+ free(spCellCfg->rlmInSyncOutOfSyncThreshold);
+ }
+ free(spCellCfg->servCellIndex);
+ }
+ free(spCellCfg);
}
DU_FREE(ueCfg->cellGrpCfg, sizeof(CellGroupConfigRrc_t));
ueCfg->cellGrpCfg = NULLP;
}
+
if(ueCfg->ambrCfg)
{
DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCfg->ambrCfg, sizeof(AmbrCfg));
}
- for(lcIdx = 0; lcIdx < ueCfg->numRlcLcs; lcIdx++)
+
+ if(actionType != UE_CTXT_CFG_QUERY)
{
- freeRlcLcCfg(&ueCfg->rlcLcCfg[lcIdx]);
+ for(lcIdx = 0; lcIdx < ueCfg->numRlcLcs; lcIdx++)
+ {
+ freeRlcLcCfg(&ueCfg->rlcLcCfg[lcIdx].rlcBearerCfg);
+ }
}
+
for(lcIdx = 0; lcIdx < ueCfg->numMacLcs; lcIdx++)
{
- freeMacLcCfg(&ueCfg->macLcCfg[lcIdx]);
+ freeMacLcCfg(&ueCfg->macLcCfg[lcIdx].lcConfig);
}
+
for(lcIdx = 0; lcIdx < ueCfg->numDrb; lcIdx++)
{
DU_FREE(ueCfg->upTnlInfo[lcIdx].tnlCfg1, sizeof(GtpTnlCfg));
}
DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
}
- freeDuUeCfg(&f1UeDb->duUeCfg);
+ freeDuUeCfg(f1UeDb->actionType, &f1UeDb->duUeCfg);
memset(f1UeDb, 0, sizeof(F1UeContextSetupDb));
DU_FREE(f1UeDb, sizeof(F1UeContextSetupDb));
}
/* UL AM */
if(rlcAmCfg->dl_AM_RLC.sn_FieldLength)
{
- amCfgToSet->ulAmCfg.snLenUl = *(rlcAmCfg->dl_AM_RLC.sn_FieldLength);
+ amCfgToSet->ulAmCfg.snLenUl = covertAmSnLenFromRrcEnumToIntEnum(*(rlcAmCfg->dl_AM_RLC.sn_FieldLength));
/*TODO: Check the timer value when sent by real CU */
- amCfgToSet->ulAmCfg.reAssemTmr = rlcAmCfg->dl_AM_RLC.t_Reassembly;
- amCfgToSet->ulAmCfg.statProhTmr = rlcAmCfg->dl_AM_RLC.t_StatusProhibit;
+ amCfgToSet->ulAmCfg.reAssemTmr = convertReasmblTmrEnumToValue(rlcAmCfg->dl_AM_RLC.t_Reassembly);
+ amCfgToSet->ulAmCfg.statProhTmr = convertProhibitTmrEnumToValue(rlcAmCfg->dl_AM_RLC.t_StatusProhibit);
}
/* DL AM */
if(rlcAmCfg->ul_AM_RLC.sn_FieldLength)
{
- amCfgToSet->dlAmCfg.snLenDl = *(rlcAmCfg->ul_AM_RLC.sn_FieldLength);
- amCfgToSet->dlAmCfg.pollRetxTmr = rlcAmCfg->ul_AM_RLC.t_PollRetransmit;
- amCfgToSet->dlAmCfg.pollPdu = rlcAmCfg->ul_AM_RLC.pollPDU;
- amCfgToSet->dlAmCfg.pollByte = rlcAmCfg->ul_AM_RLC.pollByte;
- amCfgToSet->dlAmCfg.maxRetxTh = rlcAmCfg->ul_AM_RLC.maxRetxThreshold;
+ amCfgToSet->dlAmCfg.snLenDl = covertAmSnLenFromRrcEnumToIntEnum(*(rlcAmCfg->ul_AM_RLC.sn_FieldLength));
+ amCfgToSet->dlAmCfg.pollRetxTmr = covertPollRetxTmrEnumToValue(rlcAmCfg->ul_AM_RLC.t_PollRetransmit);
+ amCfgToSet->dlAmCfg.pollPdu = covertPollPduEnumToValue(rlcAmCfg->ul_AM_RLC.pollPDU);
+ amCfgToSet->dlAmCfg.pollByte = covertPollByteEnumToValue(rlcAmCfg->ul_AM_RLC.pollByte);
+ amCfgToSet->dlAmCfg.maxRetxTh = covertMaxRetxEnumToValue(rlcAmCfg->ul_AM_RLC.maxRetxThreshold);
}
}
}
/* UL UM BI DIR Cfg */
if(rlcBiCfg->dl_UM_RLC.sn_FieldLength)
{
- umBiCfgToSet->ulUmCfg.snLenUlUm = *(rlcBiCfg->dl_UM_RLC.sn_FieldLength);
- umBiCfgToSet->ulUmCfg.reAssemTmr = rlcBiCfg->dl_UM_RLC.t_Reassembly;
+ umBiCfgToSet->ulUmCfg.snLenUlUm = covertUmSnLenFromRrcEnumToIntEnum(*(rlcBiCfg->dl_UM_RLC.sn_FieldLength));
+ umBiCfgToSet->ulUmCfg.reAssemTmr = convertReasmblTmrEnumToValue(rlcBiCfg->dl_UM_RLC.t_Reassembly);
}
/* DL UM BI DIR Cfg */
if(rlcBiCfg->ul_UM_RLC.sn_FieldLength)
- umBiCfgToSet->dlUmCfg.snLenDlUm = *(rlcBiCfg->ul_UM_RLC.sn_FieldLength);
+ umBiCfgToSet->dlUmCfg.snLenDlUm = covertUmSnLenFromRrcEnumToIntEnum(*(rlcBiCfg->ul_UM_RLC.sn_FieldLength));
}
}
{
if(umUlCfg->dl_UM_RLC.sn_FieldLength)
{
- umUlCfgToSet->ulUmCfg.snLenUlUm = *(umUlCfg->dl_UM_RLC.sn_FieldLength);
- umUlCfgToSet->ulUmCfg.reAssemTmr = umUlCfg->dl_UM_RLC.t_Reassembly;
+ umUlCfgToSet->ulUmCfg.snLenUlUm = covertUmSnLenFromRrcEnumToIntEnum(*(umUlCfg->dl_UM_RLC.sn_FieldLength));
+ umUlCfgToSet->ulUmCfg.reAssemTmr = convertReasmblTmrEnumToValue(umUlCfg->dl_UM_RLC.t_Reassembly);
}
}
}
if(umDlCfg)
{
if(umDlCfg->ul_UM_RLC.sn_FieldLength)
- umDlCfgToSet->dlUmCfg.snLenDlUm = *(umDlCfg->ul_UM_RLC.sn_FieldLength);
+ umDlCfgToSet->dlUmCfg.snLenDlUm = covertUmSnLenFromRrcEnumToIntEnum(*(umDlCfg->ul_UM_RLC.sn_FieldLength));
}
}
* ****************************************************************/
void procRlcLcCfg(uint8_t rbId, uint8_t lcId, uint8_t rbType, uint8_t rlcMode,\
- uint8_t configType, RLC_Config_t *f1RlcCfg, RlcBearerCfg *lcCfg, QoSInformation_t *qoSInformation)
+ uint8_t configType, RLC_Config_t *f1RlcCfg, DuRlcBearerCfg *lcCfg, QoSInformation_t *qoSInformation)
{
DRB_Information_t *drbInfo;
- lcCfg->rbId = rbId;
+ lcCfg->rlcBearerCfg.rbId = rbId;
lcCfg->configType = configType;
if(rbType == RB_TYPE_SRB)
{
- lcCfg->rbType = RB_TYPE_SRB;
- lcCfg->lcId = rbId;
- lcCfg->lcType = LCH_DCCH;
- lcCfg->rlcMode = RLC_AM;
+ lcCfg->rlcBearerCfg.rbType = RB_TYPE_SRB;
+ lcCfg->rlcBearerCfg.lcId = rbId;
+ lcCfg->rlcBearerCfg.lcType = LCH_DCCH;
+ lcCfg->rlcBearerCfg.rlcMode = RLC_AM;
}
else if(rbType == RB_TYPE_DRB)
{
- lcCfg->rbType = RB_TYPE_DRB;
- lcCfg->lcId = lcId;
- lcCfg->lcType = LCH_DTCH;
- lcCfg->rlcMode = rlcMode;
+ lcCfg->rlcBearerCfg.rbType = RB_TYPE_DRB;
+ lcCfg->rlcBearerCfg.lcId = lcId;
+ lcCfg->rlcBearerCfg.lcType = LCH_DTCH;
+ lcCfg->rlcBearerCfg.rlcMode = rlcMode;
}
if(f1RlcCfg) /* rlc mode config recived */
{
- extractRlcModeCfg(lcCfg->rlcMode, lcCfg, f1RlcCfg);
+ extractRlcModeCfg(lcCfg->rlcBearerCfg.rlcMode, &lcCfg->rlcBearerCfg, f1RlcCfg);
}
if(qoSInformation != NULLP)
{
QoSInformation_ExtIEs__value_PR_DRB_Information)
{
drbInfo = &qoSInformation->choice.choice_extension->value.choice.DRB_Information;
- if(extractDrbSnssaiCfg(&drbInfo->sNSSAI, &lcCfg->snssai) != ROK)
+ if(extractDrbSnssaiCfg(&drbInfo->sNSSAI, &lcCfg->rlcBearerCfg.snssai) != ROK)
{
DU_LOG("\nERROR --> DUAPP: Unable to extract Snssai information at procRlcLcCfg()");
- return RFAILED;
+ return;
}
}
}
qosToAdd->u.nonDyn5Qi.avgWindow = \
*(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow);
}
- qosToAdd->u.nonDyn5Qi.maxDataBurstVol = \
- *(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume);
+
+ if(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume)
+ {
+ qosToAdd->u.nonDyn5Qi.maxDataBurstVol = \
+ *(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume);
+ }
+
if(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel)
{
qosToAdd->u.nonDyn5Qi.priorLevel = \
*
* ****************************************************************/
uint8_t extractDrbCfg(DRBs_ToBeSetup_Item_t *drbItem, DRBs_ToBeSetupMod_Item_t *drbSetupModItem,\
-DRBs_ToBeModified_Item_t *drbModItem, LcCfg *macLcToAdd, UpTnlCfg *upTnlInfo)
+DRBs_ToBeModified_Item_t *drbModItem, DuLcCfg *lcCfgToAdd, UpTnlCfg *upTnlInfo)
{
DRB_Information_t *drbInfo = NULLP;
if(drbItem->qoSInformation.choice.choice_extension->value.present == QoSInformation_ExtIEs__value_PR_DRB_Information)
{
drbInfo = &drbItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information;
- if(extractDrbQosCfg(drbInfo , macLcToAdd) != ROK)
+ if(extractDrbQosCfg(drbInfo , &lcCfgToAdd->lcConfig) != ROK)
{
DU_LOG("\nERROR --> DUAPP : Failed to extract qos Cfg at extractDrbCfg()");
return RFAILED;
QoSInformation_ExtIEs__value_PR_DRB_Information)
{
drbInfo = &drbSetupModItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information;
- if(extractDrbQosCfg(drbInfo , macLcToAdd) != ROK)
+ if(extractDrbQosCfg(drbInfo , &lcCfgToAdd->lcConfig) != ROK)
{
DU_LOG("\nERROR --> DUAPP : Failed to extract qos Cfg at extractDrbCfg()");
return RFAILED;
QoSInformation_ExtIEs__value_PR_DRB_Information)
{
drbInfo = &drbModItem->qoSInformation->choice.choice_extension->value.choice.DRB_Information;
- if(extractDrbQosCfg(drbInfo , macLcToAdd) != ROK)
+ if(extractDrbQosCfg(drbInfo , &lcCfgToAdd->lcConfig) != ROK)
{
DU_LOG("\nERROR --> DUAPP : Failed to extract qos Cfg at extractDrbCfg()");
return RFAILED;
* ****************************************************************/
uint8_t extractMacRbCfg(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbCfg,\
-DRBs_ToBeSetupMod_Item_t *drbSetupModCfg, DRBs_ToBeModified_Item_t *drbModCfg, LogicalChannelConfig_t *ulLcCfg, LcCfg *lcCfg, UpTnlCfg *upTnlInfo)
+DRBs_ToBeSetupMod_Item_t *drbSetupModCfg, DRBs_ToBeModified_Item_t *drbModCfg, LogicalChannelConfig_t *ulLcCfg, DuLcCfg *lcCfg, UpTnlCfg *upTnlInfo)
{
if(drbCfg != NULLP)
{
}
else
{
- lcCfg->drbQos = NULLP;
- lcCfg->snssai = NULLP;
- if(lcCfg->lcId == SRB2_LCID)
- lcCfg->dlLcCfg.lcp = LC_PRIORITY_3;
+ lcCfg->lcConfig.drbQos = NULLP;
+ lcCfg->lcConfig.snssai = NULLP;
+ if(lcCfg->lcConfig.lcId == SRB2_LCID)
+ lcCfg->lcConfig.dlLcCfg.lcp = LC_PRIORITY_3;
else
- lcCfg->dlLcCfg.lcp = LC_PRIORITY_1;
+ lcCfg->lcConfig.dlLcCfg.lcp = LC_PRIORITY_1;
+
}
if(ulLcCfg)
{
- lcCfg->ulLcCfgPres = true;
- extractUlLcCfg(&lcCfg->ulLcCfg, ulLcCfg);
+ lcCfg->lcConfig.ulLcCfgPres = true;
+ extractUlLcCfg(&lcCfg->lcConfig.ulLcCfg, ulLcCfg);
}
else
- lcCfg->ulLcCfgPres = false;
+ lcCfg->lcConfig.ulLcCfgPres = false;
return ROK;
}
uint8_t procMacLcCfg(uint8_t lcId, uint8_t rbType, uint8_t configType, DRBs_ToBeSetup_Item_t *drbItem,\
DRBs_ToBeSetupMod_Item_t *drbSetupModItem, DRBs_ToBeModified_Item_t *drbModItem, LogicalChannelConfig_t *ulLcCfg,\
-LcCfg *lcCfg, UpTnlCfg *upTnlInfo)
+DuLcCfg *lcCfg, UpTnlCfg *upTnlInfo)
{
uint8_t ret = ROK;
- lcCfg->lcId = lcId;
+ lcCfg->lcConfig.lcId = lcId;
lcCfg->configType = configType;
if(rbType == RB_TYPE_SRB)
{
ret = extractMacRbCfg(lcId, NULL, NULL, NULL, ulLcCfg, lcCfg, NULL);
}
- else if(rbType == RB_TYPE_DRB)
+ else if(rbType == RB_TYPE_DRB && upTnlInfo != NULLP)
{
if(drbItem != NULL)
ret = extractMacRbCfg(lcId, drbItem, NULL, NULL, ulLcCfg, lcCfg, upTnlInfo);
}
/* Filling RLC/MAC Config*/
- memset(&ueCfgDb->macLcCfg[idx], 0, sizeof(LcCfg));
- memset(&ueCfgDb->rlcLcCfg[idx], 0, sizeof(RlcBearerCfg));
+ memset(&ueCfgDb->macLcCfg[idx], 0, sizeof(DuLcCfg));
+ memset(&ueCfgDb->rlcLcCfg[idx], 0, sizeof(DuRlcBearerCfg));
procRlcLcCfg(rbId, lcId, rbType, rlcMode, CONFIG_UNKNOWN, f1RlcCfg, &(ueCfgDb->rlcLcCfg[idx]), NULLP);
if(procMacLcCfg(lcId, rbType, CONFIG_UNKNOWN, NULL, NULL, NULL, macUlLcCfg, &ueCfgDb->macLcCfg[idx], NULL) != ROK)
{
}
(ueCfgDb->numRlcLcs)++;
(ueCfgDb->numMacLcs)++;
- DU_LOG("\nDEBUG -> DUAPP: extractRlcCfgToAddMod:RBType:%d, DrbID: %d,lcId:%d, [RLC,MAC,NumDrb]:[%x,%x,%x]",\
- rbType, rbId, lcId, ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs, ueCfgDb->numDrb);
+ DU_LOG("\nDEBUG -> DUAPP: extractRlcCfgToAddMod:RBType:%d, DrbID: %d,lcId:%d, [RLC,MAC,NumDrb]:[%x,%x,%x]",\
+ rbType, rbId, lcId, ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs, ueCfgDb->numDrb);
}
//TODO: To send the failure cause in UeContextSetupRsp
return ROK;
* @return void
*
* ****************************************************************/
-void freeMacServingCellInfo(ServCellCfgInfo *srvCellCfg)
+void freeMacServingCellInfo(ServCellRecfgInfo *srvCellCfg)
{
uint8_t timeDomRsrcIdx;
*
* @details
*
- * Function : freeUeReCfgCellGrpInfo
+ * Function : freeUeRecfgCellGrpInfo
*
* Functionality: Free cell Grp Cfg Info
*
- * @params[in] MacUeCfg* duUeCfg
+ * @params[in] DuMacUeCfg* duUeCfg
* @return void
*
* ****************************************************************/
-void freeUeReCfgCellGrpInfo(MacUeCfg *macUeCfg)
+void freeUeRecfgCellGrpInfo(DuMacUeCfg *macUeCfg)
{
freeMacServingCellInfo(&macUeCfg->spCellCfg.servCellCfg);
}
if(!macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0)
{
DU_LOG("\nERROR --> DU APP : Memory allocation failed for k0 at extractPdschCfg()");
- return RFAILED;
+ return;
}
}
*(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0) = \
macRsrcSetList->resrcSetToAddModList[arrIdx].resrcList[rsrcListIdx] =\
*cuRsrcSetList->list.array[arrIdx]->resourceList.list.array[rsrcListIdx];
}
- macRsrcSetList->resrcSetToAddModList[arrIdx].maxPayLoadSize =\
- *cuRsrcSetList->list.array[arrIdx]->maxPayloadMinus1;
+
+ if(cuRsrcSetList->list.array[arrIdx]->maxPayloadMinus1)
+ {
+ macRsrcSetList->resrcSetToAddModList[arrIdx].maxPayLoadSize =\
+ *cuRsrcSetList->list.array[arrIdx]->maxPayloadMinus1;
+ }
+ else
+ {
+ macRsrcSetList->resrcSetToAddModList[arrIdx].maxPayLoadSize = 0;
+ }
}
}/* End of extractResrcSetToAddModList */
* @return ROK/RFAILD
*
* ****************************************************************/
-uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfgInfo *macSrvCellCfg,\
-ServCellCfgInfo *storedSrvCellCfg)
+uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellRecfgInfo *macSrvCellCfg,\
+ServCellRecfgInfo *storedSrvCellCfg)
{
uint8_t ret = ROK;
BWP_DownlinkDedicated_t *dlBwp = NULLP;
}
return ret;
}
+
+#ifdef NR_DRX
+
+/*******************************************************************
+ *
+ * @brief fill long cycle offset value of drx in UE structure
+ *
+ * @details
+ *
+ * Function : fillLongCycleOffsetValueInUeDb
+ *
+ * Functionality: fill long cycle offset value of drx in UE structure
+ *
+ * @params[in] DrxLongCycleStartOffset drxLongCycleStartOffset,
+ * struct DRX_ConfigRrc__drx_LongCycleStartOffset drx_LongCycleStartOffset
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+void fillLongCycleOffsetValueInUeDb(DrxLongCycleStartOffset *drxLongCycleStartOffset, struct DRX_ConfigRrc__drx_LongCycleStartOffset *drx_LongCycleStartOffset)
+{
+
+ drxLongCycleStartOffset->drxLongCycleStartOffsetChoice = convertLongDrxCycleLengthEnumToValue(drx_LongCycleStartOffset->present);
+ switch(drx_LongCycleStartOffset->present)
+ {
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms10:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms10;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms20:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms20;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms32:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms32;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms40:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms40;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms60:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms60;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms64:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms64;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms70:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms70;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms80:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms80;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms128:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms128;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms160:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms160;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms256:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms256;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms320:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms320;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms512:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms512;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms640:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms640;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms1024:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms1024;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms1280:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms1280;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms2048:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms2048;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms2560:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms2560;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms5120:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms5120;
+ break;
+ }
+ case DRX_ConfigRrc__drx_LongCycleStartOffset_PR_ms10240:
+ {
+ drxLongCycleStartOffset->drxLongCycleStartOffsetVal = drx_LongCycleStartOffset->choice.ms10240;
+ break;
+ }
+ default :
+ break;
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Fills drx configuration structure with the help of drx_ConfigRrc
+ *which recive from CU or storedDrxCfg which is already stored
+ *
+ * @details
+ *
+ * Function : extractDrxConfiguration
+ *
+ * Functionality: Fills Reconfig Cell group Info received by CU
+ *
+ * @params[in] cuMacCellGrpDrxConfig = MAC_CellGroupConfig__drx_ConfigRrc information which
+ * is send by CU, which we have stored in F1UeContextSetupDb
+ * DrxCfg * drxCfg = Used to Store the information,
+ * which needs to send in other layer, as well as this can be
+ * the variable which stores the information in DuCb,
+ * DrxCfg *storedDrxCfg = Null in case of sending the
+ * information to other layer else it will have the drx information
+ * stored in the copyOfmacUeCfg which we have stored in F1UeContextSetupDb.
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void extractDrxConfiguration(struct MAC_CellGroupConfig__drx_ConfigRrc *cuMacCellGrpDrxConfig, DrxCfg * drxCfg, DrxCfg *storedDrxCfg)
+{
+ struct DRX_ConfigRrc *cuDrxConfig;
+
+ if(storedDrxCfg)
+ {
+ memcpy(drxCfg, storedDrxCfg, sizeof(DrxCfg));
+ }
+ else
+ {
+ if(cuMacCellGrpDrxConfig)
+ {
+ switch(cuMacCellGrpDrxConfig->present)
+ {
+ case MAC_CellGroupConfig__drx_ConfigRrc_PR_NOTHING:
+ break;
+
+ case MAC_CellGroupConfig__drx_ConfigRrc_PR_setup:
+ {
+ cuDrxConfig = cuMacCellGrpDrxConfig->choice.setup;
+ if(cuDrxConfig)
+ {
+ switch(cuDrxConfig->drx_onDurationTimer.present)
+ {
+ case DRX_ConfigRrc__drx_onDurationTimer_PR_NOTHING:
+ break;
+ case DRX_ConfigRrc__drx_onDurationTimer_PR_milliSeconds:
+ {
+ drxCfg->drxOnDurationTimer.onDurationTimerValInMs = true;
+ drxCfg->drxOnDurationTimer.onDurationtimerValue.milliSeconds=convertOnDurationTimerMilliSecondsEnumToValue(cuDrxConfig->\
+ drx_onDurationTimer.choice.milliSeconds);
+ break;
+ }
+ case DRX_ConfigRrc__drx_onDurationTimer_PR_subMilliSeconds:
+ {
+ drxCfg->drxOnDurationTimer.onDurationTimerValInMs = false;
+ drxCfg->drxOnDurationTimer.onDurationtimerValue.subMilliSeconds = cuDrxConfig->drx_onDurationTimer.choice.subMilliSeconds;
+ break;
+ }
+ }
+ }
+ fillLongCycleOffsetValueInUeDb(&drxCfg->drxLongCycleStartOffset, &cuDrxConfig->drx_LongCycleStartOffset);
+ drxCfg->drxInactivityTimer = convertDrxInactivityTimerEnumToValue(cuDrxConfig->drx_InactivityTimer);
+ drxCfg->drxHarqRttTimerDl = cuDrxConfig->drx_HARQ_RTT_TimerDL;
+ drxCfg->drxHarqRttTimerUl = cuDrxConfig->drx_HARQ_RTT_TimerUL;
+ drxCfg->drxRetransmissionTimerDl = convertDrxRetransmissionTimerDlEnumToValue(cuDrxConfig->drx_RetransmissionTimerDL);
+ drxCfg->drxRetransmissionTimerUl = convertDrxRetransmissionTimerUlEnumToValue(cuDrxConfig->drx_RetransmissionTimerUL);
+ drxCfg->drxSlotOffset = cuDrxConfig->drx_SlotOffset;
+ if(cuDrxConfig->shortDRX)
+ {
+ drxCfg->shortDrxPres=true;
+ drxCfg->shortDrx.drxShortCycle = convertShortDrxCycleLengthEnumToValue(cuDrxConfig->shortDRX->drx_ShortCycle);
+ drxCfg->shortDrx.drxShortCycleTimer = cuDrxConfig->shortDRX->drx_ShortCycleTimer;
+ }
+ else
+ drxCfg->shortDrxPres=false;
+
+ break;
+ }
+
+ case MAC_CellGroupConfig__drx_ConfigRrc_PR_release:
+ break;
+ }
+ }
+ }
+}
+#endif
+
/*******************************************************************
*
* @brief Fills Reconfig Cell group Info received by CU
*
* @details
*
- * Function : extractUeReCfgCellInfo
+ * Function : extractUeRecfgCellInfo
*
* Functionality: Fills Reconfig Cell group Info received by CU
*
* @params[in] CellGroupConfigRrc_t *cellGrp = CellGroupConfigRrc_t information which
* is send by CU, which we have stored in F1UeContextSetupDb
- * MacUeCfg *MacUeCfg = Used to Store the information,
+ * DuMacUeCfg *MacUeCfg = Used to Store the information,
* which needs to send in other layer, as well as this can be
* the variable which stores the information in DuCb,
- * MacUeCfg *storedMacUeCfg = Null in case of sending the
+ * DuMacUeCfg *storedMacUeCfg = Null in case of sending the
* information to other layer else it will have copyOfmacUeCfg
* which we have stored in F1UeContextSetupDb.
*
* @return ROK/RFAILED
*
* ****************************************************************/
-uint8_t extractUeReCfgCellInfo(CellGroupConfigRrc_t *cellGrp, MacUeCfg *macUeCfg, MacUeCfg *storedMacUeCfg)
+uint8_t extractUeRecfgCellInfo(CellGroupConfigRrc_t *cellGrp, DuMacUeCfg *macUeCfg, DuMacUeCfg *storedMacUeCfg)
{
uint8_t ret = ROK;
MAC_CellGroupConfig_t *macCellGroup = NULLP;
{
macUeCfg->macCellGrpCfgPres = true;
macCellGroup = ((MAC_CellGroupConfig_t *)(cellGrp->mac_CellGroupConfig));
+
+#ifdef NR_DRX
+ if(macCellGroup->drx_ConfigRrc)
+ {
+ if(storedMacUeCfg)
+ {
+ if(!storedMacUeCfg->macCellGrpCfgPres)
+ {
+ extractDrxConfiguration(macCellGroup->drx_ConfigRrc, &macUeCfg->macCellGrpCfg.drxCfg,NULL);
+ }
+ else
+ {
+ extractDrxConfiguration(macCellGroup->drx_ConfigRrc, &macUeCfg->macCellGrpCfg.drxCfg, &storedMacUeCfg->macCellGrpCfg.drxCfg);
+ }
+ }
+ else
+ {
+ extractDrxConfiguration(macCellGroup->drx_ConfigRrc, &macUeCfg->macCellGrpCfg.drxCfg,NULL);
+ }
+ }
+#endif
+
if(macCellGroup->schedulingRequestConfig)
{
extractSchReqReConfig(macCellGroup->schedulingRequestConfig, &macUeCfg->macCellGrpCfg.schReqCfg);
*
* @details
*
- * Function : procUeReCfgCellInfo
+ * Function : procUeRecfgCellInfo
*
* Functionality: builds Mac Cell Cfg
*
- * @params[in] MacUeCfg *macUeCfgToSend = Used to Store the information which
+ * @params[in] DuMacUeCfg *macUeCfgToSend = Used to Store the information which
* needs to send in other layer, as well as this can be
* the variable which stores the information in DuCb.
- * MacUeCfg *storedMacUeCfg = Null in case of sending the
+ * DuMacUeCfg *storedMacUeCfg = Null in case of sending the
* information to other layer else it will have copyOfmacUeCfg
* which we have stored in F1UeContextSetupDb
* void *cellInfo = CellGroupConfigRrc_t information which is send
* @return void
*
* ****************************************************************/
-uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfgToSend,MacUeCfg *storedMacUeCfg, void *cellInfo)
+uint8_t procUeRecfgCellInfo(DuMacUeCfg *macUeCfgToSend, DuMacUeCfg *storedMacUeCfg, void *cellInfo)
{
uint8_t ret = ROK;
CellGroupConfigRrc_t *cellGrp = NULLP;
if(cellInfo)
{
cellGrp = (CellGroupConfigRrc_t *)cellInfo;
- ret = extractUeReCfgCellInfo(cellGrp, macUeCfgToSend, storedMacUeCfg);
+ ret = extractUeRecfgCellInfo(cellGrp, macUeCfgToSend, storedMacUeCfg);
if(ret == RFAILED)
- DU_LOG("\nERROR --> F1AP : Failed at procUeReCfgCellInfo()");
+ DU_LOG("\nERROR --> F1AP : Failed at procUeRecfgCellInfo()");
}
if(ret == RFAILED)
{
- freeUeReCfgCellGrpInfo(macUeCfgToSend);
+ freeUeRecfgCellGrpInfo(macUeCfgToSend);
}
return ret;
}
* RFAILED - failure
*
* ****************************************************************/
-void duFillModulationDetails(MacUeCfg *ueCfg, MacUeCfg *oldUeCfg, void *ueCap)
+void duFillModulationDetails(DuMacUeCfg *ueCfg, DuMacUeCfg *oldUeCfg, void *ueCap)
{
UE_NR_Capability_t *ueNrCap=NULLP;
- if(!ueCap)
+ if(!ueCap && oldUeCfg)
{
memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo));
memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo));
default:
{
DU_LOG("\nERROR --> DU APP: Incorrect downlink modulation order received. Reatining old modulation configuration");
- memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo));
+ if(oldUeCfg)
+ memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo));
break;
}
}
}
else
{
- memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo));
+ if(oldUeCfg)
+ memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo));
}
/* Filling UL modulation info */
default:
{
DU_LOG("\nERROR --> DU APP: Incorrect uplink modulation order received. Reatining old modulation configuration");
- memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo));
+ if(oldUeCfg)
+ memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo));
break;
}
}
}
else
{
- memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo));
+ if(oldUeCfg)
+ memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo));
}
}
}
/*******************************************************************
*
- * @brief Function to extract cellGrp Info present in cutoDu cont
+ * @brief Function to extract info from CU to DU RRC container extension
*
* @details
*
- * Function : extractCellGrpInfo
+ * Function : extractCuToDuRrcInfoExt
*
- * Functionality: Function to extract cellGrp Info present
- * in cutoDu cont
+ * Functionality: Function to extract info from CU to DU RRC container
+ * extension
*
* @params[in] ProtocolExtensionContainer_4624P16_t pointer
*
- * @return CellGroupConfigRrc_t *
+ * @return ROK
+ * RFAILED
*
* ****************************************************************/
-
-CellGroupConfigRrc_t *extractCellGrpInfo(ProtocolExtensionContainer_4624P16_t *protocolIeExtn,\
- DuUeCfg *ueCfgDb)
+uint8_t extractCuToDuRrcInfoExt(ProtocolExtensionContainer_4624P16_t *protocolIeExtn, DuUeCfg *ueCfgDb)
{
- uint8_t idx2 =0;
- uint16_t id =0;
+ uint8_t ieIdx =0;
uint16_t recvBufLen =0;
CellGroupConfigRrc_t *cellGrpCfg = NULLP;
CUtoDURRCInformation_ExtIEs_t *extIeInfo = NULLP;
if(protocolIeExtn)
{
- for(idx2 = 0; idx2 < protocolIeExtn->list.count; idx2++)
+ for(ieIdx = 0; ieIdx < protocolIeExtn->list.count; ieIdx++)
{
- extIeInfo = ((CUtoDURRCInformation_ExtIEs_t *)(protocolIeExtn->list.array[idx2]));
- id = extIeInfo->id;
- switch(id)
+ extIeInfo = ((CUtoDURRCInformation_ExtIEs_t *)(protocolIeExtn->list.array[ieIdx]));
+ switch(extIeInfo->id)
{
case ProtocolIE_ID_id_CellGroupConfig:
- {
- recvBufLen = extIeInfo->extensionValue.choice.CellGroupConfig.size;
- /* decoding the CellGroup Buf received */
- DU_ALLOC(cellGrpCfg, sizeof(CellGroupConfigRrc_t));
- if(cellGrpCfg)
- {
- memset(cellGrpCfg, 0, sizeof(CellGroupConfigRrc_t));
- rval = aper_decode(0, &asn_DEF_CellGroupConfigRrc, (void **)&cellGrpCfg,
- extIeInfo->extensionValue.choice.CellGroupConfig.buf, recvBufLen, 0, 0);
- if(rval.code == RC_FAIL || rval.code == RC_WMORE)
+ {
+ /* decoding the CellGroup Buf received */
+ recvBufLen = extIeInfo->extensionValue.choice.CellGroupConfig.size;
+ DU_ALLOC(cellGrpCfg, sizeof(CellGroupConfigRrc_t));
+ if(cellGrpCfg)
{
- DU_LOG("\nERROR --> F1AP : ASN decode failed at decodeCellGrpCfg()");
- return NULLP;
+ memset(cellGrpCfg, 0, sizeof(CellGroupConfigRrc_t));
+ rval = uper_decode(0, &asn_DEF_CellGroupConfigRrc, (void **)&cellGrpCfg,
+ extIeInfo->extensionValue.choice.CellGroupConfig.buf, recvBufLen, 0, 0);
+ if(rval.code == RC_FAIL || rval.code == RC_WMORE)
+ {
+ DU_LOG("\nERROR --> F1AP : ASN decode failed at decodeCellGrpCfg()");
+ return RFAILED;
+ }
+ xer_fprint(stdout, &asn_DEF_CellGroupConfigRrc, cellGrpCfg);
+
+ if(extractRlcCfgToAddMod(cellGrpCfg->rlc_BearerToAddModList, ueCfgDb))
+ return NULLP;
+ ueCfgDb->cellGrpCfg = cellGrpCfg;
}
- xer_fprint(stdout, &asn_DEF_CellGroupConfigRrc, cellGrpCfg);
- if(extractRlcCfgToAddMod(cellGrpCfg->rlc_BearerToAddModList, ueCfgDb))
- return NULLP;
- }
- break;
- }
+ break;
+ }
+
+ case ProtocolIE_ID_id_HandoverPreparationInformation:
+ {
+ DU_LOG("\nINFO --> F1AP : Received HANDOVER PREPARATION INFO in UE CONTEXT SETUP REQUEST");
+ break;
+ }
+
default:
- DU_LOG("\nERROR --> F1AP : Invalid IE received CUtoDURRCInformation:%d at decodeCellGrpCfg()", id);
- break;
+ DU_LOG("\nERROR --> F1AP : Invalid IE received CUtoDURRCInformation: %ld at decodeCellGrpCfg()", extIeInfo->id);
+ break;
}
}
}
- return cellGrpCfg;
+ return ROK;
}
/*******************************************************************
* Functionality: Fills Srb List received by CU
*
* @params[in] SRBs_ToBeSetup_Item_t *cuSrbItem
- * LcCfg pointer
+ * DuLcCfg pointer
* RlcBearerCfg pointer
* @return void
*
* ****************************************************************/
-uint8_t procSrbListToSetup(SRBs_ToBeSetup_Item_t * srbItem, LcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd)
+uint8_t procSrbListToSetup(SRBs_ToBeSetup_Item_t * srbItem, DuLcCfg *duMacLcToAdd, DuRlcBearerCfg *rlcLcToAdd)
{
/* Filling RLC INFO */
procRlcLcCfg(srbItem->sRBID, srbItem->sRBID, RB_TYPE_SRB, RLC_AM, CONFIG_ADD, NULL, rlcLcToAdd, NULL);
/* Filling MAC INFO */
- if(procMacLcCfg(srbItem->sRBID, RB_TYPE_SRB, CONFIG_ADD, NULL,NULL, NULL, NULL, macLcToAdd, NULL) != ROK)
+ if(procMacLcCfg(srbItem->sRBID, RB_TYPE_SRB, CONFIG_ADD, NULL,NULL, NULL, NULL, duMacLcToAdd, NULL) != ROK)
{
DU_LOG("\nERROR --> F1AP : Failed at MAC LC Cfg in procSrbListToSetup()");
return RFAILED;
uint8_t extractSrbListToSetup(SRBs_ToBeSetup_List_t *srbCfg, DuUeCfg *ueCfgDb)
{
- uint8_t ret, srbIdx;
+ uint8_t ret = ROK, srbIdx = 0, rlcLcIdx = 0;
SRBs_ToBeSetup_Item_t *srbItem = NULLP;
+ DuLcCfg *macLcCtxt = NULLP;
+ DuRlcBearerCfg *rlcLcCtxt = NULLP;
if(srbCfg)
{
for(srbIdx = 0; srbIdx < srbCfg->list.count; srbIdx++)
{
+ macLcCtxt = NULL;
+ rlcLcCtxt = NULL;
+
srbItem = &srbCfg->list.array[srbIdx]->value.choice.SRBs_ToBeSetup_Item;
if(ueCfgDb->numMacLcs > MAX_NUM_LC)
- {
+ {
DU_LOG("\nERROR --> F1AP: MAX LC Reached in MAC");
- ret = RFAILED;
- break;
- }
+ ret = RFAILED;
+ break;
+ }
if(ueCfgDb->numRlcLcs > MAX_NUM_LC)
- {
+ {
DU_LOG("\nERROR --> F1AP: MAX LC Reached in RLC");
- ret = RFAILED;
- break;
- }
- memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(LcCfg));
- memset(&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], 0, sizeof(RlcBearerCfg));
- ret = procSrbListToSetup(srbItem, &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs],\
- &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs]);
- ueCfgDb->numRlcLcs++;
- ueCfgDb->numMacLcs++;
- DU_LOG("\nDEBUG --> DUAPP: extractSrbListToSetup: SRBID: %d [RLC,MAC,NumDrb]:[%x,%x,%x]",\
- srbItem->sRBID, ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs, ueCfgDb->numDrb);
- if(ret == RFAILED)
- {
+ ret = RFAILED;
+ break;
+ }
+
+ for(rlcLcIdx = 0; rlcLcIdx < ueCfgDb->numMacLcs; rlcLcIdx++)
+ {
+ if(ueCfgDb->rlcLcCfg[rlcLcIdx].rlcBearerCfg.rbId == srbItem->sRBID && ueCfgDb->rlcLcCfg[rlcLcIdx].rlcBearerCfg.rbType == RB_TYPE_SRB)
+ {
+ macLcCtxt = &ueCfgDb->macLcCfg[rlcLcIdx];
+ rlcLcCtxt = &ueCfgDb->rlcLcCfg[rlcLcIdx];
+ break;
+ }
+ }
+ if(!macLcCtxt)
+ {
+ memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(DuLcCfg));
+ macLcCtxt = &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs];
+ ueCfgDb->numMacLcs++;
+ }
+ if(!rlcLcCtxt)
+ {
+ memset(&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], 0, sizeof(DuRlcBearerCfg));
+ rlcLcCtxt = &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs];
+ ueCfgDb->numRlcLcs++;
+ }
+
+ ret = procSrbListToSetup(srbItem, macLcCtxt, rlcLcCtxt);
+
+ DU_LOG("\nDEBUG --> DUAPP: extractSrbListToSetup: SRBID: %ld [RLC,MAC,NumDrb]:[%x,%x,%x]",\
+ srbItem->sRBID, ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs, ueCfgDb->numDrb);
+ if(ret == RFAILED)
+ {
DU_LOG("\nERROR --> F1AP: Failed at extractSrbListToSetup()");
- break;
- }
+ break;
+ }
}
}
else
* for both MAC and RLC
*
* @params[in] DRBs_ToBeSetup_Item_t , DRBs_ToBeSetupMod_Item_t,
- * DRBs_ToBeModified_Item_t , lcId, LcCfg pointer,
- * RlcBearerCfg , UpTnlCfg, RlcUeCfg
+ * DRBs_ToBeModified_Item_t , lcId, DuLcCfg pointer,
+ * RlcBearerCfg , UpTnlCfg, DuRlcUeCfg
* @return void
*
* ****************************************************************/
uint8_t procDrbListToSetupMod(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbItem,\
-DRBs_ToBeSetupMod_Item_t *drbSetupModItem, DRBs_ToBeModified_Item_t *drbModItem, LcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd, UpTnlCfg *upTnlInfo, RlcUeCfg *storedRlcUeCfg)
+DRBs_ToBeSetupMod_Item_t *drbSetupModItem, DRBs_ToBeModified_Item_t *drbModItem, DuLcCfg *macLcToAdd, DuRlcBearerCfg *rlcLcToAdd, UpTnlCfg *upTnlInfo, DuRlcUeCfg *storedRlcUeCfg)
{
uint8_t cfgIdx = 0;
RlcMode rlcModeInfo;
{
for(cfgIdx = 0; cfgIdx < storedRlcUeCfg->numLcs; cfgIdx++)
{
- if(storedRlcUeCfg->rlcLcCfg[cfgIdx].lcId == lcId)
+ if(storedRlcUeCfg->rlcLcCfg[cfgIdx].rlcBearerCfg.lcId == lcId)
{
- rlcModeInfo = storedRlcUeCfg->rlcLcCfg[cfgIdx].rlcMode;
+ rlcModeInfo = storedRlcUeCfg->rlcLcCfg[cfgIdx].rlcBearerCfg.rlcMode;
break;
}
}
* ****************************************************************/
uint8_t extractDrbListToSetupMod(DRBs_ToBeSetup_List_t *drbCfg, DRBs_ToBeSetupMod_List_t *drbSetupModCfg,\
- DRBs_ToBeModified_List_t *drbModCfg, uint8_t drbCount, DuUeCfg *ueCfgDb, uint32_t *drbBitMap, RlcUeCfg *rlcUeCfg)
+ DRBs_ToBeModified_List_t *drbModCfg, uint8_t drbCount, DuUeCfg *ueCfgDb, uint32_t *drbBitMap, DuRlcUeCfg *rlcUeCfg)
{
- uint8_t ret, drbIdx, lcId = 0;
+ uint8_t ret = ROK;
+ uint8_t drbIdx = 0, rlcLcIdx = 0;
+ uint8_t drbId = 0, lcId = 0;
DRBs_ToBeSetup_Item_t *drbItem = NULLP;
DRBs_ToBeSetupMod_ItemIEs_t *drbSetupModItem = NULLP;
DRBs_ToBeModified_ItemIEs_t *drbModItem = NULLP;
+ DuLcCfg *macLcCtxt = NULLP;
+ DuRlcBearerCfg *rlcLcCtxt = NULLP;
ret = ROK;
if(drbCount > 0)
{
for(drbIdx = 0; drbIdx < drbCount; drbIdx++)
{
+ macLcCtxt = NULL;
+ rlcLcCtxt = NULL;
+
if(ueCfgDb->numMacLcs > MAX_NUM_LC)
{
DU_LOG("\nERROR --> F1AP : MAX LC Reached in MAC at extractDrbListToSetupMod()");
ret = RFAILED;
break;
}
- memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(LcCfg));
- memset(&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], 0, sizeof(RlcBearerCfg));
if(drbModCfg != NULLP)
{
drbModItem = (DRBs_ToBeModified_ItemIEs_t *) drbModCfg->list.array[drbIdx];
- lcId = fetchLcId(drbModItem->value.choice.DRBs_ToBeModified_Item.dRBID);
+ drbId = drbModItem->value.choice.DRBs_ToBeModified_Item.dRBID;
+ }
+ else if(drbCfg != NULLP)
+ drbId = drbCfg->list.array[drbIdx]->value.choice.DRBs_ToBeSetup_Item.dRBID;
+ else if(drbSetupModCfg != NULL)
+ {
+ drbSetupModItem = (DRBs_ToBeSetupMod_ItemIEs_t *) drbSetupModCfg->list.array[drbIdx];
+ drbId = drbSetupModItem->value.choice.DRBs_ToBeSetupMod_Item.dRBID;
+ }
+
+ for(rlcLcIdx = 0; rlcLcIdx < ueCfgDb->numRlcLcs; rlcLcIdx++)
+ {
+ if(ueCfgDb->rlcLcCfg[rlcLcIdx].rlcBearerCfg.rbId == drbId && \
+ ueCfgDb->rlcLcCfg[rlcLcIdx].rlcBearerCfg.rbType == RB_TYPE_DRB)
+ {
+ macLcCtxt = &ueCfgDb->macLcCfg[rlcLcIdx];
+ rlcLcCtxt = &ueCfgDb->rlcLcCfg[rlcLcIdx];
+ break;
+ }
+ }
+ if(!macLcCtxt)
+ {
+ memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(DuLcCfg));
+ macLcCtxt = &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs];
+ ueCfgDb->numMacLcs++;
+ }
+ if(!rlcLcCtxt)
+ {
+ memset(&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], 0, sizeof(RlcBearerCfg));
+ rlcLcCtxt = &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs];
+ ueCfgDb->numRlcLcs++;
+ }
+
+ if(drbModCfg != NULLP)
+ {
+ lcId = fetchLcId(drbId);
if(lcId < MIN_DRB_LCID)
{
DU_LOG("\nERROR --> F1AP : Failed fetching LCID %d in extractDrbListToSetupMod() for Modified List", lcId);
break;
}
ret = procDrbListToSetupMod(lcId, NULL, NULL, &(drbModItem->value.choice.DRBs_ToBeModified_Item),\
- &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs],\
- &ueCfgDb->upTnlInfo[ueCfgDb->numDrb], rlcUeCfg);
+ macLcCtxt, rlcLcCtxt, &ueCfgDb->upTnlInfo[ueCfgDb->numDrb], rlcUeCfg);
if(ret == RFAILED)
{
DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetupMod() for Modified List");
break;
}
-
+ ueCfgDb->numDrbModified++;
}
else
{
if(drbCfg != NULL)
{
drbItem = &drbCfg->list.array[drbIdx]->value.choice.DRBs_ToBeSetup_Item;
- ret = procDrbListToSetupMod(lcId, drbItem, NULL, NULL, &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs],\
- &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], &ueCfgDb->upTnlInfo[ueCfgDb->numDrb], rlcUeCfg);
+ ret = procDrbListToSetupMod(lcId, drbItem, NULL, NULL, macLcCtxt, rlcLcCtxt, &ueCfgDb->upTnlInfo[ueCfgDb->numDrb], rlcUeCfg);
if(ret == RFAILED)
{
DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetupMod() for DrbSetup List");
}
else if(drbSetupModCfg != NULL)
{
- drbSetupModItem = (DRBs_ToBeSetupMod_ItemIEs_t *) drbSetupModCfg->list.array[drbIdx];
ret = procDrbListToSetupMod(lcId, NULL, &(drbSetupModItem->value.choice.DRBs_ToBeSetupMod_Item), NULL,\
- &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs],\
- &ueCfgDb->upTnlInfo[ueCfgDb->numDrb], rlcUeCfg);
+ macLcCtxt, rlcLcCtxt, &ueCfgDb->upTnlInfo[ueCfgDb->numDrb], rlcUeCfg);
if(ret == RFAILED)
{
DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetupMod() for DrbSetupMod List");
break;
}
+ ueCfgDb->numDrbSetupMod++;
}
}
- ueCfgDb->numRlcLcs++;
- ueCfgDb->numMacLcs++;
ueCfgDb->numDrb++;
DU_LOG("\nDEBUG --> DUAPP: extractDrbListToSetupMod:lcId:%x ,BitMap:%x, [RLC,MAC,NumDrb]:[%x,%x,%x]",\
return ret;
}
+/*******************************************************************
+ *
+ * @brief extract Drb List received from CU
+ *
+ * @details
+ *
+ * Function : extractDrbListToRelease
+ *
+ * Functionality: extract Drb List received from CU
+ * for both MAC and RLC
+ *
+ * @params[in] DRBs_ToBeReleased_Item_t pointer
+ * DuUeCfg pointer
+ * @return ROK/RFAIED
+ *
+ * ****************************************************************/
+
+uint8_t extractDrbListToRelease(uint8_t ueId, DRBs_ToBeReleased_List_t *drbToRel, uint8_t drbCount, DuUeCfg *ueCfgDb, DuRlcUeCfg *rlcUeCfg)
+{
+ uint8_t ret = ROK, teIdx = 0;
+ uint8_t drbIdx = 0, rlcLcIdx = 0;
+ uint8_t drbId = 0, lcId = 0;
+ DRBs_ToBeReleased_ItemIEs_t *drbRelItem = NULLP;
+ DuLcCfg *macLcCtxt = NULLP;
+ DuRlcBearerCfg *rlcLcCtxt = NULLP;
+
+ ret = ROK;
+ if(drbCount > 0)
+ {
+ for(drbIdx = 0; drbIdx < drbCount; drbIdx++)
+ {
+ macLcCtxt = NULL;
+ rlcLcCtxt = NULL;
+
+ if(drbToRel != NULLP)
+ {
+ drbRelItem = (DRBs_ToBeReleased_ItemIEs_t *) drbToRel->list.array[drbIdx];
+ drbId = drbRelItem->value.choice.DRBs_ToBeReleased_Item.dRBID;
+ }
+ else
+ {
+ DU_LOG("ERROR --> DU APP : DrbToRelease pointer is NULL in extractDrbListToRelease");
+ return RFAILED;
+ }
+
+ for(rlcLcIdx = 0; rlcLcIdx < ueCfgDb->numRlcLcs; rlcLcIdx++)
+ {
+ if(ueCfgDb->rlcLcCfg[rlcLcIdx].rlcBearerCfg.rbId == drbId && ueCfgDb->rlcLcCfg[rlcLcIdx].rlcBearerCfg.rbType == RB_TYPE_DRB)
+ {
+ macLcCtxt = &ueCfgDb->macLcCfg[rlcLcIdx];
+ rlcLcCtxt = &ueCfgDb->rlcLcCfg[rlcLcIdx];
+ break;
+ }
+ }
+
+ if(!macLcCtxt)
+ {
+ memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(DuLcCfg));
+ macLcCtxt = &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs];
+ ueCfgDb->numMacLcs++;
+ }
+ if(!rlcLcCtxt)
+ {
+ memset(&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], 0, sizeof(DuRlcBearerCfg));
+ rlcLcCtxt = &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs];
+ ueCfgDb->numRlcLcs++;
+ }
+ lcId = fetchLcId(drbId);
+ if(lcId < MIN_DRB_LCID)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed fetching LCID %d in extractDrbListToRelease() for Modified List", lcId);
+ break;
+ }
+
+ /* Filling RLC INFO */
+ procRlcLcCfg(drbId, lcId, RB_TYPE_DRB, rlcLcCtxt->rlcBearerCfg.rlcMode, CONFIG_DEL, NULL, rlcLcCtxt, NULLP);
+ /* Filling MAC INFO */
+ if(procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_DEL, NULL, NULL, NULL, NULL, macLcCtxt, NULLP) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at RLC LC Cfg in extractDrbListToRelease()");
+ return RFAILED;
+ }
+ ueCfgDb->upTnlInfo[ueCfgDb->numDrb].configType = CONFIG_DEL;
+ ueCfgDb->upTnlInfo[ueCfgDb->numDrb].drbId = drbId;
+ ueCfgDb->upTnlInfo[ueCfgDb->numDrb].ueId = ueId;
+
+ for(teIdx = 0; teIdx < duCb.numTeId; teIdx++)
+ {
+ if((duCb.upTnlCfg[teIdx]->ueId == ueCfgDb->upTnlInfo[ueCfgDb->numDrb].ueId) && \
+ (duCb.upTnlCfg[teIdx]->drbId == ueCfgDb->upTnlInfo[ueCfgDb->numDrb].drbId))
+ {
+ DU_ALLOC(ueCfgDb->upTnlInfo[ueCfgDb->numDrb].tnlCfg1, sizeof(GtpTnlCfg));
+ memcpy(ueCfgDb->upTnlInfo[ueCfgDb->numDrb].tnlCfg1, duCb.upTnlCfg[teIdx]->tnlCfg1, sizeof(GtpTnlCfg));
+ break;
+ }
+ }
+
+ ueCfgDb->numDrb++;
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToRelease() for Modified List");
+ break;
+ }
+
+ DU_LOG("\nDEBUG --> DUAPP: extractDrbListToRelease():lcId:%x, [RLC,MAC,NumDrb]:[%x,%x,%x]",\
+ lcId,ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs, ueCfgDb->numDrb);
+ }
+ }
+ else
+ ret = RFAILED;
+
+ return ret;
+}
+
/*******************************************************************
*
* @brief Function to extract Dl RRC Msg received from CU
}
memset(ueCapRatContList, 0, sizeof(UE_CapabilityRAT_ContainerListRRC_t));
memset(&rval, 0, sizeof(asn_dec_rval_t));
- rval = aper_decode(0, &asn_DEF_UE_CapabilityRAT_ContainerListRRC, (void **)&ueCapRatContList,
+ rval = uper_decode(0, &asn_DEF_UE_CapabilityRAT_ContainerListRRC, (void **)&ueCapRatContList,
ueCapablityListBuf->buf, recvBufLen, 0, 0);
if(rval.code == RC_FAIL || rval.code == RC_WMORE)
{
}
memset(ueNrCap, 0, sizeof(UE_NR_Capability_t));
memset(&rval, 0, sizeof(asn_dec_rval_t));
- rval = aper_decode(0, &asn_DEF_UE_NR_Capability, (void **)&ueNrCap,
+ rval = uper_decode(0, &asn_DEF_UE_NR_Capability, (void **)&ueNrCap,
ueCapRatContList->list.array[idx]->ue_CapabilityRAT_Container.buf, recvBufLen, 0, 0);
if(rval.code == RC_FAIL || rval.code == RC_WMORE)
{
{
for(ieIdx = 0; ieIdx < ueSetReq->protocolIEs.list.count; ieIdx++)
{
- if(ueSetReq->protocolIEs.list.array[ieIdx])
- {
- switch(ueSetReq->protocolIEs.list.array[ieIdx]->id)
- {
- case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
- break;
- case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
- break;
- case ProtocolIE_ID_id_SpCell_ID:
- freeAperDecodeNrcgi(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.NRCGI);
- break;
- case ProtocolIE_ID_id_ServCellIndex:
- break;
- case ProtocolIE_ID_id_SpCellULConfigured:
- break;
- case ProtocolIE_ID_id_CUtoDURRCInformation:
+ if(ueSetReq->protocolIEs.list.array[ieIdx])
+ {
+ switch(ueSetReq->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+ break;
+ case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+ break;
+ case ProtocolIE_ID_id_SpCell_ID:
+ freeAperDecodeNrcgi(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.NRCGI);
+ break;
+ case ProtocolIE_ID_id_ServCellIndex:
+ break;
+ case ProtocolIE_ID_id_SpCellULConfigured:
+ break;
+ case ProtocolIE_ID_id_CUtoDURRCInformation:
- freeAperDecodeCuToDuInfo(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation);
- break;
- case ProtocolIE_ID_id_SCell_ToBeSetup_List:
+ freeAperDecodeCuToDuInfo(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation);
+ break;
+ case ProtocolIE_ID_id_SCell_ToBeSetup_List:
- freeAperDecodeSplCellList(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.SCell_ToBeSetup_List);
- break;
- case ProtocolIE_ID_id_SRBs_ToBeSetup_List:
+ freeAperDecodeSplCellList(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.SCell_ToBeSetup_List);
+ break;
+ case ProtocolIE_ID_id_SRBs_ToBeSetup_List:
- freeAperDecodeSRBSetup(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.SRBs_ToBeSetup_List);
- break;
- case ProtocolIE_ID_id_DRBs_ToBeSetup_List:
+ freeAperDecodeSRBSetup(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.SRBs_ToBeSetup_List);
+ break;
+ case ProtocolIE_ID_id_DRBs_ToBeSetup_List:
- freeAperDecodeDRBSetup(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRBs_ToBeSetup_List);
- break;
- case ProtocolIE_ID_id_RRCContainer:
- {
+ freeAperDecodeDRBSetup(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRBs_ToBeSetup_List);
+ break;
+ case ProtocolIE_ID_id_RRCContainer:
+ {
- if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf != NULLP)
- {
+ if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf != NULLP)
+ {
- free(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf);
- }
- break;
- }
- case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
- break;
- case ProtocolIE_ID_id_GNB_DU_UE_AMBR_UL:
- {
- if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf)
- {
- free(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf);
- }
- break;
- }
- default:
- DU_LOG("\nERROR --> F1AP: Invalid event type %ld " ,ueSetReq->protocolIEs.list.array[ieIdx]->id);
- }
- free(ueSetReq->protocolIEs.list.array[ieIdx]);
- }
+ free(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf);
+ }
+ break;
+ }
+ case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
+ break;
+ case ProtocolIE_ID_id_GNB_DU_UE_AMBR_UL:
+ {
+ if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf)
+ {
+ free(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf);
+ }
+ break;
+ }
+#ifdef NR_DRX
+ case ProtocolIE_ID_id_DRXCycle:
+ {
+ if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRXCycle.shortDRXCycleLength)
+ free(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRXCycle.shortDRXCycleLength);
+ if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRXCycle.shortDRXCycleTimer)
+ free(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRXCycle.shortDRXCycleTimer);
+ break;
+ }
+#endif
+ default:
+ DU_LOG("\nERROR --> F1AP: Invalid event type %ld " ,ueSetReq->protocolIEs.list.array[ieIdx]->id);
+ }
+ free(ueSetReq->protocolIEs.list.array[ieIdx]);
+ }
}
free(ueSetReq->protocolIEs.list.array);
}
* ****************************************************************/
uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
{
- uint8_t ret=0, ieIdx=0, ueIdx=0, cellIdx=0;
- bool ueCbFound = false;
+ int8_t ueIdx = -1;
+ uint8_t ret=0, ieIdx=0, ieExtIdx = 0;
+ //uint8_t servCellIdx = 0;
+ bool ueCbFound = false, hoInProgress = false;
+ uint16_t cellIdx=0;
+ uint64_t nrCellId = 0;
uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId=0, bitRateSize=0;
DuUeCb *duUeCb = NULL;
UEContextSetupRequest_t *ueSetReq = NULL;
DRBs_ToBeSetup_List_t *drbCfg = NULL;
-
+ CUtoDURRCInformation_t *rrcInfo = NULL;
+#ifdef NR_DRX
+ DRXCycle_t *drxCycle;
+#endif
ret = ROK;
ueSetReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextSetupRequest;
gnbCuUeF1apId = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID;
break;
}
+
case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
{
gnbDuUeF1apId = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID;
break;
}
+
+ case ProtocolIE_ID_id_SpCell_ID:
+ {
+ bitStringToInt(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.NRCGI.nRCellIdentity, &nrCellId);
+
+ GET_CELL_IDX(nrCellId, cellIdx);
+ if(!duCb.actvCellLst[cellIdx])
+ {
+ DU_LOG("\nERROR --> F1AP : Cell Id [%lu] not found", nrCellId);
+ ret = RFAILED;
+ }
+ break;
+ }
+
case ProtocolIE_ID_id_ServCellIndex:
{
- cellIdx = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.ServCellIndex;
+ //servCellIdx = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.ServCellIndex;
+ break;
+ }
+
+ case ProtocolIE_ID_id_SpCellULConfigured:
+ {
+ /* Indicates whether the gNB-CU requests the gNB-DU to configure the uplink as no UL,
+ UL, SUL or UL+SUL for the indicated cell for the UE */
+ break;
+ }
+
+ case ProtocolIE_ID_id_CUtoDURRCInformation:
+ {
+ rrcInfo = &ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation;
+
+ /* Search if UE context is present */
for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
{
- if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
- (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
+ if(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId)
{
ueCbFound = true;
duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
- DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
- if(duUeCb->f1UeDb)
- {
- memset(duUeCb->f1UeDb, 0, sizeof(F1UeContextSetupDb));
- duUeCb->f1UeDb->actionType = UE_CTXT_SETUP;
- duUeCb->f1UeDb->cellIdx = cellIdx;
- }
- else
+ break;
+ }
+ }
+
+ /* Check if UE Handover scenario */
+ if(rrcInfo->iE_Extensions)
+ {
+ for(ieExtIdx = 0; ieExtIdx < rrcInfo->iE_Extensions->list.count; ieExtIdx++)
+ {
+ if(rrcInfo->iE_Extensions->list.array[ieExtIdx]->id == ProtocolIE_ID_id_HandoverPreparationInformation)
{
- DU_LOG("\nERROR --> F1AP: Memory Alloc Failed at procF1UeContextSetupReq()");
- ret = RFAILED;
+ hoInProgress = true;
+ break;
}
- break;
}
+ }
+
+ /* If UE context is not present, but UE is in handover */
+ if(!ueCbFound && hoInProgress)
+ {
+ ueIdx = getFreeBitFromUeBitMap(nrCellId);
+ if(ueIdx != -1)
+ gnbDuUeF1apId = ueIdx +1;
else
- ueCbFound = false;
+ {
+ DU_LOG("\nERROR --> F1AP : No free UE IDX found in UE bit map of cell Id [%lu]", nrCellId);
+ ret = RFAILED;
+ break;
+ }
+ duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
+ duUeCb->f1UeDb = NULL;
+ duUeCb->gnbCuUeF1apId = gnbCuUeF1apId;
+ duUeCb->gnbDuUeF1apId = gnbDuUeF1apId;
+ GET_CRNTI(duUeCb->crnti, duUeCb->gnbDuUeF1apId);
+ duUeCb->ueState = UE_HANDIN_IN_PROGRESS;
+ }
+ if(duUeCb)
+ {
+ DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
+ if(duUeCb->f1UeDb)
+ {
+ memset(duUeCb->f1UeDb, 0, sizeof(F1UeContextSetupDb));
+ duUeCb->f1UeDb->actionType = UE_CTXT_SETUP;
+ duUeCb->f1UeDb->cellIdx = cellIdx;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> F1AP: Memory Alloc Failed at procF1UeContextSetupReq()");
+ ret = RFAILED;
+ break;
+ }
}
- if(!ueCbFound)
+ else
{
DU_LOG("\nERROR --> F1AP: DuUeCb is not found at procF1UeContextSetupReq()");
ret = RFAILED;
+ break;
}
- break;
- }
- case ProtocolIE_ID_id_SpCellULConfigured:
- /* Indicates whether the gNB-CU requests the gNB-DU to configure the uplink as no UL,
- UL, SUL or UL+SUL for the indicated cell for the UE */
- break;
- case ProtocolIE_ID_id_CUtoDURRCInformation:
- {
- if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList)
+
+ /* Extract UE capability info */
+ if(rrcInfo->uE_CapabilityRAT_ContainerList)
{
- duUeCb->f1UeDb->duUeCfg.ueNrCapability = \
- extractUeCapability(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation.\
- uE_CapabilityRAT_ContainerList, duUeCb);
+ duUeCb->f1UeDb->duUeCfg.ueNrCapability = extractUeCapability(rrcInfo->uE_CapabilityRAT_ContainerList, duUeCb);
}
- if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation.iE_Extensions)
+
+ /* Extract IE extension */
+ if(rrcInfo->iE_Extensions)
{
- duUeCb->f1UeDb->duUeCfg.cellGrpCfg = extractCellGrpInfo(ueSetReq->protocolIEs.list.array[ieIdx]->\
- value.choice.CUtoDURRCInformation.iE_Extensions, &duUeCb->f1UeDb->duUeCfg);
- if(!duUeCb->f1UeDb->duUeCfg.cellGrpCfg)
+ if(extractCuToDuRrcInfoExt(rrcInfo->iE_Extensions, &duUeCb->f1UeDb->duUeCfg) != ROK)
{
- DU_LOG("\nERROR --> F1AP: Failed to extract cell Grp Info");
+ DU_LOG("\nERROR --> F1AP: Failed to extract CU to DU RRC information extension IE");
//TODO: Update the failure cause in ue context Setup Response
ret = RFAILED;
}
}
break;
}
- case ProtocolIE_ID_id_SCell_ToBeSetup_List:
+
+#ifdef NR_DRX
+ case ProtocolIE_ID_id_DRXCycle:
{
- DU_LOG("\nINFO --> DU_APP: Received SCell_ToBeSetup_List but Not processing the list");
+ duUeCb->f1UeDb->duUeCfg.drxCyclePres = true;
+ drxCycle = &ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRXCycle;
+ duUeCb->f1UeDb->duUeCfg.drxCycle.drxLongCycleLength = convertLongDrxCycleLengthEnumToValue(drxCycle->longDRXCycleLength);
+ if(drxCycle->shortDRXCycleLength)
+ {
+ duUeCb->f1UeDb->duUeCfg.drxCycle.shortDrxCyclePres = true;
+ duUeCb->f1UeDb->duUeCfg.drxCycle.shortDrxCycle.drxShortCycle = \
+ convertShortDrxCycleLengthEnumToValue(*(drxCycle->shortDRXCycleLength));
+ }
+ if(drxCycle->shortDRXCycleTimer)
+ duUeCb->f1UeDb->duUeCfg.drxCycle.shortDrxCycle.drxShortCycleTimer = *(drxCycle->shortDRXCycleTimer);
+
break;
}
+
+#endif
case ProtocolIE_ID_id_SRBs_ToBeSetup_List:
{
if(extractSrbListToSetup(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.SRBs_ToBeSetup_List,\
- &duUeCb->f1UeDb->duUeCfg))
+ &duUeCb->f1UeDb->duUeCfg))
{
DU_LOG("\nERROR --> DU APP : Failed at extractSrbListToSetup()");
//TODO: Update the failure cause in ue context Setup Response
}
break;
}
+
case ProtocolIE_ID_id_DRBs_ToBeSetup_List:
{
- drbCfg = &ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRBs_ToBeSetup_List;
+ drbCfg = &ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRBs_ToBeSetup_List;
- if(extractDrbListToSetupMod(drbCfg, NULL, NULL, drbCfg->list.count, &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap, NULLP))
- {
- DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetupMod()");
- //TODO: Update the failure cause in ue context Setup Response
- ret = RFAILED;
- }
+ if(extractDrbListToSetupMod(drbCfg, NULL, NULL, drbCfg->list.count, &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap, NULLP))
+ {
+ DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetupMod()");
+ //TODO: Update the failure cause in ue context Setup Response
+ ret = RFAILED;
+ }
break;
}
case ProtocolIE_ID_id_RRCContainer:
}
break;
}
+
case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
{
- if(duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu)
- {
- duUeCb->f1UeDb->dlRrcMsg->deliveryStatRpt = true;
- }
- else
+ if(duUeCb->f1UeDb->dlRrcMsg)
{
- DU_LOG("\nERROR --> Ignoring delivery report, since rrcContainer is not present");
+ if(duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu)
+ {
+ duUeCb->f1UeDb->dlRrcMsg->deliveryStatRpt = true;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> Ignoring delivery report, since rrcContainer is not present");
+ }
}
break;
}
+
case ProtocolIE_ID_id_GNB_DU_UE_AMBR_UL:
{
/* MaximumBitRate Uplink */
ret = RFAILED;
break;
}
+
default:
{
break;
}
+ } /* End of switch */
+
+ /* In case of any failure in any IE */
+ if(ret == RFAILED)
+ {
+ // BuildAndSendUeContextSetupRsp(cellId,ueId);
+ DU_LOG("\nERROR --> F1AP: Failed to process UE CNTXT SETUP REQ at procF1UeContextSetupReq()");
+ break;
}
- }
- if(ret == RFAILED)
- {
- /*TODO : Negative case*/
- // BuildAndSendUeContextSetupRsp(cellId,ueIdx);
- DU_LOG("\nERROR --> F1AP: Failed to process UE CNTXT SETUP REQ at procF1UeContextSetupReq()");
- }
- else
+ } /* End of for loop of IEs */
+
+ if(ret == ROK)
ret = duProcUeContextSetupRequest(duUeCb);
freeAperDecodeF1UeContextSetupReq(ueSetReq);
{
if(f1apMsg->choice.successfulOutcome)
{
- ueSetRsp = &f1apMsg->choice.successfulOutcome->value.choice.\
- UEContextSetupResponse;
- if(ueSetRsp->protocolIEs.list.array)
- {
- for(idx = 0; idx < ueSetRsp->protocolIEs.list.count; idx++)
- {
- if(ueSetRsp->protocolIEs.list.array[idx])
- {
- switch(ueSetRsp->protocolIEs.list.array[idx]->id)
- {
- case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
- break;
- case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
- break;
- case ProtocolIE_ID_id_DUtoCURRCInformation:
- {
- CellGroupConfig_t *cellGrpCfg = NULLP;
- cellGrpCfg = &ueSetRsp->protocolIEs.list.array[idx]->value.choice.\
- DUtoCURRCInformation.cellGroupConfig;
- if(cellGrpCfg->buf != NULLP)
- {
- DU_FREE(cellGrpCfg->buf, cellGrpCfg->size);
- cellGrpCfg = NULLP;
- }
- break;
- }
- case ProtocolIE_ID_id_DRBs_Setup_List:
- {
+ ueSetRsp = &f1apMsg->choice.successfulOutcome->value.choice.\
+ UEContextSetupResponse;
+ if(ueSetRsp->protocolIEs.list.array)
+ {
+ for(idx = 0; idx < ueSetRsp->protocolIEs.list.count; idx++)
+ {
+ if(ueSetRsp->protocolIEs.list.array[idx])
+ {
+ switch(ueSetRsp->protocolIEs.list.array[idx]->id)
+ {
+ case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+ break;
+ case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+ break;
+ case ProtocolIE_ID_id_C_RNTI:
+ break;
+ case ProtocolIE_ID_id_DUtoCURRCInformation:
+ {
+ CellGroupConfig_t *cellGrpCfg = NULLP;
+ cellGrpCfg = &ueSetRsp->protocolIEs.list.array[idx]->value.choice.\
+ DUtoCURRCInformation.cellGroupConfig;
+ if(cellGrpCfg->buf != NULLP)
+ {
+ DU_FREE(cellGrpCfg->buf, cellGrpCfg->size);
+ cellGrpCfg = NULLP;
+ }
+ break;
+ }
+ case ProtocolIE_ID_id_DRBs_Setup_List:
+ {
freeDrbSetupList(&ueSetRsp->protocolIEs.list.array[idx]->value.choice.DRBs_Setup_List);
break;
- }
- default:
- DU_LOG("\nERROR --> DUAPP: Invalid Id %ld at FreeUeContextSetupRsp()",\
- ueSetRsp->protocolIEs.list.array[idx]->id);
- break;
- }
- DU_FREE(ueSetRsp->protocolIEs.list.array[idx],\
- sizeof(UEContextSetupResponseIEs_t));
- }
- }
- DU_FREE(ueSetRsp->protocolIEs.list.array, \
- ueSetRsp->protocolIEs.list.size);
- }
- DU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
+ }
+ default:
+ DU_LOG("\nERROR --> DUAPP: Invalid Id %ld at FreeUeContextSetupRsp()",\
+ ueSetRsp->protocolIEs.list.array[idx]->id);
+ break;
+ }
+ DU_FREE(ueSetRsp->protocolIEs.list.array[idx],\
+ sizeof(UEContextSetupResponseIEs_t));
+ }
+ }
+ DU_FREE(ueSetRsp->protocolIEs.list.array, \
+ ueSetRsp->protocolIEs.list.size);
+ }
+ DU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
}
DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
}
xer_fprint(stdout, &asn_DEF_CellGroupConfigRrc, duCellGrpCfg);
memset((uint8_t *)encBuf, 0, ENC_BUF_MAX_LEN);
encBufSize = 0;
- encRetVal = aper_encode(&asn_DEF_CellGroupConfigRrc, 0, duCellGrpCfg, PrepFinalEncBuf, encBuf);
+ encRetVal = uper_encode(&asn_DEF_CellGroupConfigRrc, 0, duCellGrpCfg, PrepFinalEncBuf, encBuf);
/* Encode results */
if(encRetVal.encoded == ENCODE_FAIL)
{
else
{
DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for UeCntxtDuToCuInfo\n");
+#ifdef DEBUG_ASN_PRINT
for(int i=0; i< encBufSize; i++)
{
printf("%x",encBuf[i]);
}
+#endif
}
duToCuCellGrp->size = encBufSize;
DU_ALLOC(duToCuCellGrp->buf, duToCuCellGrp->size);
* Functionality: Constructs the UE Setup Response and sends
* it to the DU through SCTP.
*
- * @params[in] uint8_t cellId,uint8_t ueIdx
+ * @params[in] uint8_t cellId,uint8_t ueId
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildAndSendUeContextSetupRsp(uint8_t cellId,uint8_t ueIdx)
+uint8_t BuildAndSendUeContextSetupRsp(uint8_t cellId,uint8_t ueId)
{
uint8_t idx, ret, cellIdx, elementCnt;
uint32_t gnbCuUeF1apId; /* gNB-CU UE F1AP Id */
asn_enc_rval_t encRetVal; /* Encoder return value */
F1AP_PDU_t *f1apMsg = NULLP;
UEContextSetupResponse_t *ueSetRsp = NULLP;
- CellGroupConfigRrc_t *cellGrpCfg = NULLP;
DuUeCb *ueCb = NULLP;
- DU_LOG("\n INFO --> F1AP : Building UE Context Setup Response for cellId %d, ueIdx %d\n", cellId, ueIdx);
+ DU_LOG("\n INFO --> F1AP : Building UE Context Setup Response for cellId %d, ueId %d\n", cellId, ueId);
while(true)
{
DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
if(f1apMsg == NULLP)
{
- DU_LOG(" ERROR --> F1AP : Memory allocation for F1AP-PDU failed");
- ret = RFAILED;
- break;
+ DU_LOG(" ERROR --> F1AP : Memory allocation for F1AP-PDU failed");
+ ret = RFAILED;
+ break;
}
f1apMsg->present = F1AP_PDU_PR_successfulOutcome;
DU_ALLOC(f1apMsg->choice.successfulOutcome,
- sizeof(SuccessfulOutcome_t));
+ sizeof(SuccessfulOutcome_t));
if(f1apMsg->choice.successfulOutcome == NULLP)
{
- DU_LOG(" ERROR --> F1AP : Memory allocation for F1AP-PDU failed");
- ret = RFAILED;
- break;
+ DU_LOG(" ERROR --> F1AP : Memory allocation for F1AP-PDU failed");
+ ret = RFAILED;
+ break;
}
f1apMsg->choice.successfulOutcome->procedureCode = \
- ProcedureCode_id_UEContextSetup;
+ ProcedureCode_id_UEContextSetup;
f1apMsg->choice.successfulOutcome->criticality = Criticality_reject;
f1apMsg->choice.successfulOutcome->value.present = \
- SuccessfulOutcome__value_PR_UEContextSetupResponse;
+ SuccessfulOutcome__value_PR_UEContextSetupResponse;
ueSetRsp =
- &f1apMsg->choice.successfulOutcome->value.choice.UEContextSetupResponse;
- elementCnt = 4;
+ &f1apMsg->choice.successfulOutcome->value.choice.UEContextSetupResponse;
+ elementCnt = 5;
ueSetRsp->protocolIEs.list.count = elementCnt;
ueSetRsp->protocolIEs.list.size = \
- elementCnt * sizeof(UEContextSetupResponse_t *);
+ elementCnt * sizeof(UEContextSetupResponse_t *);
/* Initialize the UESetup members */
DU_ALLOC(ueSetRsp->protocolIEs.list.array, \
- ueSetRsp->protocolIEs.list.size);
+ ueSetRsp->protocolIEs.list.size);
if(ueSetRsp->protocolIEs.list.array == NULLP)
{
- DU_LOG(" ERROR --> F1AP : Memory allocation for UE Setup Response failed");
- ret = RFAILED;
- break;
+ DU_LOG(" ERROR --> F1AP : Memory allocation for UE Setup Response failed");
+ ret = RFAILED;
+ break;
}
for(idx=0; idx<elementCnt; idx++)
{
- DU_ALLOC(ueSetRsp->protocolIEs.list.array[idx],\
- sizeof(UEContextSetupResponseIEs_t));
- if(ueSetRsp->protocolIEs.list.array[idx] == NULLP)
- {
- DU_LOG(" ERROR --> F1AP : Memory allocation for UE Setup Response failed");
- ret = RFAILED;
- break;
- }
+ DU_ALLOC(ueSetRsp->protocolIEs.list.array[idx],\
+ sizeof(UEContextSetupResponseIEs_t));
+ if(ueSetRsp->protocolIEs.list.array[idx] == NULLP)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for UE Setup Response failed");
+ ret = RFAILED;
+ break;
+ }
}
/* Fetching Ue Cb Info*/
GET_CELL_IDX(cellId, cellIdx);
- gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbDuUeF1apId;
- gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbCuUeF1apId;
- ueCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1];
+ gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueId-1].gnbDuUeF1apId;
+ gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueId-1].gnbCuUeF1apId;
+ ueCb = &duCb.actvCellLst[cellIdx]->ueCb[ueId-1];
idx = 0;
/*GNB CU UE F1AP ID*/
ueSetRsp->protocolIEs.list.array[idx]->id = \
- ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
+ ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ueSetRsp->protocolIEs.list.array[idx]->criticality = Criticality_reject;
ueSetRsp->protocolIEs.list.array[idx]->value.present = \
- UEContextSetupResponseIEs__value_PR_GNB_CU_UE_F1AP_ID;
+ UEContextSetupResponseIEs__value_PR_GNB_CU_UE_F1AP_ID;
ueSetRsp->protocolIEs.list.array[idx]->value.choice.GNB_CU_UE_F1AP_ID = gnbCuUeF1apId;
/*GNB DU UE F1AP ID*/
idx++;
ueSetRsp->protocolIEs.list.array[idx]->id = \
- ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+ ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ueSetRsp->protocolIEs.list.array[idx]->criticality = Criticality_reject;
ueSetRsp->protocolIEs.list.array[idx]->value.present = \
- UEContextSetupResponseIEs__value_PR_GNB_DU_UE_F1AP_ID;
+ UEContextSetupResponseIEs__value_PR_GNB_DU_UE_F1AP_ID;
ueSetRsp->protocolIEs.list.array[idx]->value.choice.GNB_DU_UE_F1AP_ID = gnbDuUeF1apId;
/*DUtoCURRC Information */
idx++;
ueSetRsp->protocolIEs.list.array[idx]->id = \
- ProtocolIE_ID_id_DUtoCURRCInformation;
+ ProtocolIE_ID_id_DUtoCURRCInformation;
ueSetRsp->protocolIEs.list.array[idx]->criticality = Criticality_reject;
ueSetRsp->protocolIEs.list.array[idx]->value.present =\
- UEContextSetupResponseIEs__value_PR_DUtoCURRCInformation;
- if(ueCb->f1UeDb)
- {
- if(ueCb->f1UeDb->duUeCfg.cellGrpCfg)
- {
- cellGrpCfg = (CellGroupConfigRrc_t*)ueCb->f1UeDb->duUeCfg.cellGrpCfg;
- ret = EncodeUeCntxtDuToCuInfo(&ueSetRsp->protocolIEs.list.array[idx]->value.\
- choice.DUtoCURRCInformation.cellGroupConfig, cellGrpCfg);
- if(ret == RFAILED)
- {
- DU_LOG("\nERROR --> F1AP : Failed to EncodeUeCntxtDuToCuInfo in BuildAndSendUeContextSetupRsp()");
- freeF1UeDb(ueCb->f1UeDb);
- ueCb->f1UeDb = NULLP;
- break;
- }
- }
- }
- else
- {
- DU_LOG("\nERROR --> F1AP : Failed to form DUtoCU RRCInfo at BuildAndSendUeContextSetupRsp()");
- ret = RFAILED;
- break;
- }
+ UEContextSetupResponseIEs__value_PR_DUtoCURRCInformation;
+ BuildCellGroupConfigRrc(ueCb, &ueSetRsp->protocolIEs.list.array[idx]->value.choice.DUtoCURRCInformation.cellGroupConfig);
+
+ /* CRNTI */
+ idx++;
+ ueSetRsp->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_C_RNTI;
+ ueSetRsp->protocolIEs.list.array[idx]->criticality = Criticality_reject;
+ ueSetRsp->protocolIEs.list.array[idx]->value.present = UEContextSetupResponseIEs__value_PR_C_RNTI;
+ ueSetRsp->protocolIEs.list.array[idx]->value.choice.C_RNTI = ueCb->crnti;
+
/* Drb Setup List */
idx++;
ueSetRsp->protocolIEs.list.array[idx]->id = \
- ProtocolIE_ID_id_DRBs_Setup_List;
+ ProtocolIE_ID_id_DRBs_Setup_List;
ueSetRsp->protocolIEs.list.array[idx]->criticality = Criticality_reject;
ueSetRsp->protocolIEs.list.array[idx]->value.present =\
- UEContextSetupResponseIEs__value_PR_DRBs_Setup_List;
+ UEContextSetupResponseIEs__value_PR_DRBs_Setup_List;
ret = fillDrbSetupList(&ueSetRsp->protocolIEs.list.array[idx]->value.choice.DRBs_Setup_List,\
- &ueCb->f1UeDb->duUeCfg);
+ &ueCb->f1UeDb->duUeCfg);
if(ret == RFAILED)
{
DU_LOG("\nERROR --> F1AP : Failed to fillDrbSetupList in BuildAndSendUeContextSetupRsp()");
break;
}
- /* Free UeContext Db created during Ue context Req */
- freeF1UeDb(ueCb->f1UeDb);
- ueCb->f1UeDb = NULLP;
+ /* Free UeContext Db created during Ue context Req */
+ freeF1UeDb(ueCb->f1UeDb);
+ ueCb->f1UeDb = NULLP;
/* TODO: To send Drb list */
xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
memset((uint8_t *)encBuf, 0, ENC_BUF_MAX_LEN);
encBufSize = 0;
encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf,\
- encBuf);
+ encBuf);
/* Encode results */
if(encRetVal.encoded == ENCODE_FAIL)
{
- DU_LOG( "\nERROR --> F1AP : Could not encode UE Context Setup Response structure (at %s)\n",\
- encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
- ret = RFAILED;
- break;
+ DU_LOG( "\nERROR --> F1AP : Could not encode UE Context Setup Response structure (at %s)\n",\
+ encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+ ret = RFAILED;
+ break;
}
else
{
- DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for UE Context Setup Response\n");
- for(int i=0; i< encBufSize; i++)
- {
- printf("%x",encBuf[i]);
- }
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for UE Context Setup Response\n");
+#ifdef DEBUG_ASN_PRINT
+ for(int i=0; i< encBufSize; i++)
+ {
+ printf("%x",encBuf[i]);
+ }
+#endif
}
/* Sending msg */
if(sendF1APMsg() != ROK)
{
- DU_LOG("\nERROR --> F1AP : Sending UE Context Setup Response failed");
- ret = RFAILED;
- break;
+ DU_LOG("\nERROR --> F1AP : Sending UE Context Setup Response failed");
+ ret = RFAILED;
+ break;
}
break;
}
FreeUeContextSetupRsp(f1apMsg);
return ret;
}/* End of BuildAndSendUeContextSetupRsp */
+
/*******************************************************************
*
* @brief Build And Send Ue Context Rsp
* failure = RFAILED
*
* ****************************************************************/
-uint8_t BuildAndSendUeCtxtRsp(uint8_t cellId, uint8_t ueIdx)
+uint8_t BuildAndSendUeCtxtRsp(uint8_t cellId, uint8_t ueId)
{
uint8_t cellIdx = 0, actionType = 0;
GET_CELL_IDX(cellId, cellIdx);
- actionType = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].f1UeDb->actionType;
+ actionType = duCb.actvCellLst[cellIdx]->ueCb[ueId-1].f1UeDb->actionType;
switch(actionType)
{
case UE_CTXT_SETUP:
{
- BuildAndSendUeContextSetupRsp(cellId,ueIdx);
+ if((BuildAndSendUeContextSetupRsp(cellId,ueId)) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at BuildAndSendUeContextSetupRsp()");
+ return RFAILED;
+ }
break;
}
case UE_CTXT_MOD:
{
- BuildAndSendUeContextModRsp(cellId, ueIdx);
+ if((BuildAndSendUeContextModRsp(&duCb.actvCellLst[cellIdx]->ueCb[ueId-1])) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at BuildAndSendUeContextModRsp");
+ return RFAILED;
+ }
break;
}
default:
else
{
DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for F1Reset\n");
+#ifdef DEBUG_ASN_PRINT
for(idx=0; idx< encBufSize; idx++)
{
printf("%x",encBuf[idx]);
}
+#endif
}
if(sendF1APMsg() != ROK)
else
{
DU_LOG("\nDUBUG --> F1AP : Created APER encoded buffer for F1ResetAck\n");
+#ifdef DEBUG_ASN_PRINT
for(int i=0; i< encBufSize; i++)
{
printf("%x",encBuf[i]);
}
+#endif
}
/* Sending msg */
if(sendF1APMsg() != ROK)
else
{
DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for RRC Delivery Msg \n");
+#ifdef DEBUG_ASN_PRINT
for(idx=0; idx< encBufSize; idx++)
{
printf("%x",encBuf[idx]);
}
+#endif
}
/* Sending msg */
uint8_t extractCellsToBeActivated(Cells_to_be_Activated_List_t cellsToActivate)
{
uint8_t ret = ROK;
- uint16_t idx, nci, pci = 0;
+ uint16_t idx, pci = 0;
+ uint64_t nci;
Cells_to_be_Activated_List_Item_t cell;
for(idx=0; idx<cellsToActivate.list.count; idx++)
if(cell.nRPCI)
{
- pci = *cell.nRPCI;
+ pci = *cell.nRPCI;
}
ret = duProcCellsToBeActivated(cell.nRCGI.pLMN_Identity.buf, nci, pci);
}
* RFAILED - failure
*
* ****************************************************************/
-uint8_t procF1SetupRsp(F1AP_PDU_t *f1apMsg)
+uint8_t procF1SetupRsp(F1AP_PDU_t *f1apMsg, MsgLen recvBufLen, char *recvBuf)
{
uint8_t ret = ROK;
uint16_t idx =0;
DU_LOG("\nERROR --> DU_APP : Invalid IE received in F1SetupRsp:%ld",
f1SetRspMsg->protocolIEs.list.array[idx]->id);
}
- duProcF1SetupRsp();
}
+ duProcF1SetupRsp();
freeAperDecodeF1SetupRsp(f1SetRspMsg);
+
+ addOrModifyE2NodeComponent(E2_NODE_COMPONENT_ADD, false, recvBufLen, recvBuf);
+
+ if(BuildAndSendE2SetupReq() != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to build and send E2 setup request ");
+ return RFAILED;
+ }
return ret;
}
/*******************************************************************
uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId)
{
uint8_t ieIdx=0, arrIdx=0,ret=ROK;
- uint8_t ueId =0 , ueIdx =0;
- uint16_t cellId =0, cellIdx =0, crnti=0;
+ uint8_t ueId =0 , ueIdx =0, totalActiveUe = 0;
+ uint16_t cellIdx =0, crnti=0;
+ uint64_t cellId =0;
CmLList *f1apPduNode = NULLP;
ReservedF1apPduInfo *f1apPduInfo =NULLP;
F1AP_PDU_t *f1apMsgPdu = NULLP;
{
cellIdentity = &deleteItem->oldNRCGI.nRCellIdentity;
bitStringToInt(cellIdentity, &cellId);
+
+ GET_CELL_IDX(cellId, cellIdx);
+ if(duCb.actvCellLst[cellIdx] != NULLP)
+ {
+ duCb.actvCellLst[cellId-1]->cellStatus = DELETION_IN_PROGRESS;
+ }
}
}
}
- GET_CELL_IDX(cellId, cellIdx);
if(duCb.actvCellLst[cellIdx] != NULLP)
{
if(duCb.actvCellLst[cellIdx]->numActvUes == 0)
{
- duCb.actvCellLst[cellId-1]->cellStatus = DELETION_IN_PROGRESS;
ret = duSendCellDeletReq(cellId);
if(ret == RFAILED)
{
- DU_LOG("ERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to send cell delete\
- request for cellId[%d]", cellId);
+ DU_LOG("\nERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to send cell delete\
+ request for cellId[%lu]", cellId);
}
}
else
{
- for(ueIdx = 0; ueIdx < duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++)
+ totalActiveUe = duCb.actvCellLst[cellIdx]->numActvUes;
+ while(totalActiveUe)
{
+ if(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].ueState != UE_ACTIVE)
+ {
+ ueIdx++;
+ continue;
+ }
+
crnti = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].crnti;
- GET_UE_IDX(crnti,ueId);
+ GET_UE_ID(crnti,ueId);
+ /* Sending Ue Context release request only for maximum supporting UEs */
ret = BuildAndSendUeContextReleaseReq(cellId, ueId);
if(ret == RFAILED)
{
- DU_LOG("ERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to build and send UE delete\
- request for cellId[%d]", cellId);
+ DU_LOG("\nERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to build and send UE delete\
+ request for cellId[%lu]", cellId);
}
+ ueIdx++;
+ totalActiveUe--;
}
}
}
else
{
- DU_LOG("ERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): CellId [%d] not found", cellId);
+ DU_LOG("\nERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): CellId [%lu] not found", cellId);
ret = RFAILED;
}
break;
{
if(f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.size > 0)
{
- dlMsg.rrcMsgSize = f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.size;
- DU_ALLOC_SHRABL_BUF(dlMsg.rrcMsgPdu, dlMsg.rrcMsgSize);
- if(dlMsg.rrcMsgPdu)
- {
- memcpy(dlMsg.rrcMsgPdu, f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf,\
- dlMsg.rrcMsgSize);
- }
- else
- {
- DU_LOG("\nERROR --> DU APP : Memory alloc Failed at RRC Container at procF1DlRrcMsgTrans()");
- return RFAILED;
- }
- }
- else
- {
- DU_LOG("\nERROR --> DU_APP : RRC Container Size is invalid:%ld",\
- f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.size);
- return RFAILED;
- }
- break;
- }
- case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
- {
- dlMsg.deliveryStatRpt = true;
- break;
- }
- default:
- DU_LOG("\nERROR --> DU_APP : Invalid IE received in DL RRC Msg Transfer:%ld",
- f1DlRrcMsg->protocolIEs.list.array[idx]->id);
+ dlMsg.rrcMsgSize = f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.size;
+ DU_ALLOC_SHRABL_BUF(dlMsg.rrcMsgPdu, dlMsg.rrcMsgSize);
+ if(dlMsg.rrcMsgPdu)
+ {
+ memcpy(dlMsg.rrcMsgPdu, f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf,\
+ dlMsg.rrcMsgSize);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : Memory alloc Failed at RRC Container at procF1DlRrcMsgTrans()");
+ return RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP : RRC Container Size is invalid:%ld",\
+ f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.size);
+ return RFAILED;
+ }
+ break;
+ }
+ case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
+ {
+ dlMsg.deliveryStatRpt = true;
+ break;
+ }
+ default:
+ DU_LOG("\nERROR --> DU_APP : Invalid IE received in DL RRC Msg Transfer:%ld",
+ f1DlRrcMsg->protocolIEs.list.array[idx]->id);
}
}
freeAperDecodef1DlRrcMsg(f1DlRrcMsg);
return ret;
}
+/*******************************************************************
+ *
+* @brief Builds the DRB to be Setup Mod list
+*
+* @details
+*
+* Function :
+*
+* Functionality: Constructs the DRB to be Setup Mod list
+*
+* @params[in] DRBs_SetupMod_List_t *drbSet
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t BuildSrbSetupModList(SRBs_SetupMod_List_t *srbList, DuUeCfg *ueCfg)
+{
+ uint8_t srbIdx = 0;
+ struct SRBs_SetupMod_ItemIEs *srbItemIe;
+
+ srbList->list.count = ueCfg->numRlcLcs;
+ srbList->list.size = srbList->list.count * sizeof(SRBs_SetupMod_ItemIEs_t *);
+
+ DU_ALLOC(srbList->list.array, srbList->list.size);
+ if(srbList->list.array == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed in BuildSrbSetupModList");
+ return RFAILED;
+ }
+
+ for(srbIdx = 0; srbIdx < srbList->list.count; srbIdx++)
+ {
+ DU_ALLOC(srbList->list.array[srbIdx], sizeof(SRBs_SetupMod_ItemIEs_t));
+ if(srbList->list.array[srbIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed in BuildSrbSetupModList");
+ return RFAILED;
+ }
+ }
+
+ for(srbIdx=0; srbIdx < srbList->list.count; srbIdx++)
+ {
+ srbItemIe = (struct SRBs_SetupMod_ItemIEs *)srbList->list.array[srbIdx];
+ srbItemIe->id = ProtocolIE_ID_id_SRBs_SetupMod_Item;
+ srbItemIe->criticality = Criticality_reject;
+ srbItemIe->value.present = SRBs_SetupMod_ItemIEs__value_PR_SRBs_SetupMod_Item;
+ srbItemIe->value.choice.SRBs_SetupMod_Item.sRBID = ueCfg->rlcLcCfg[srbIdx].rlcBearerCfg.rbId;
+ srbItemIe->value.choice.SRBs_SetupMod_Item.lCID = ueCfg->rlcLcCfg[srbIdx].rlcBearerCfg.lcId;
+ }
+ return ROK;
+}
+
/*******************************************************************
*
* @brief Builds the DRB to be Setup Mod list
uint8_t drbCnt =0;
struct DRBs_SetupMod_ItemIEs *drbItemIe;
- drbCnt = 1;
+ drbCnt = ueCfg->numDrbSetupMod;
+
drbSet->list.count = drbCnt;
drbSet->list.size = drbCnt * sizeof(DRBs_SetupMod_ItemIEs_t *);
DU_ALLOC(drbSet->list.array, drbSet->list.size);
return RFAILED;
}
- drbItemIe = (struct DRBs_SetupMod_ItemIEs *)drbSet->list.array[arrIdx];
- drbItemIe->id = ProtocolIE_ID_id_DRBs_SetupMod_Item;
- drbItemIe->criticality = Criticality_reject;
- drbItemIe->value.present = DRBs_SetupMod_ItemIEs__value_PR_DRBs_SetupMod_Item;
- drbItemIe->value.choice.DRBs_SetupMod_Item.dRBID = ueCfg->upTnlInfo[arrIdx].drbId;
- if(fillDlTnlSetupList(&drbItemIe->value.choice.DRBs_SetupMod_Item.dLUPTNLInformation_ToBeSetup_List,\
- &ueCfg->upTnlInfo[arrIdx])!= ROK)
+ drbItemIe = (struct DRBs_SetupMod_ItemIEs *)drbSet->list.array[arrIdx];
+ drbItemIe->id = ProtocolIE_ID_id_DRBs_SetupMod_Item;
+ drbItemIe->criticality = Criticality_reject;
+ drbItemIe->value.present = DRBs_SetupMod_ItemIEs__value_PR_DRBs_SetupMod_Item;
+ drbItemIe->value.choice.DRBs_SetupMod_Item.dRBID = ueCfg->upTnlInfo[arrIdx].drbId;
+ if(fillDlTnlSetupList(&drbItemIe->value.choice.DRBs_SetupMod_Item.dLUPTNLInformation_ToBeSetup_List,\
+ &ueCfg->upTnlInfo[arrIdx])!= ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to fill DlTnl SetupList in BuildDrbToBeSetupModList");
+ return RFAILED;
+ }
+
+ }
+
+ return ROK;
+}
+/*******************************************************************
+* @brief Free the memory allocated for DRB setup List
+*
+* @details
+*
+* Function : FreeDrbSetupModList
+*
+* Functionality:
+* Free the memory allocated for DRB setup list
+*
+* @params[in] DRBs_Setup_List_t *
+* @return void
+*
+* ****************************************************************/
+void FreeDrbSetupModList(DRBs_SetupMod_List_t *drbSetupList)
+{
+ uint8_t arrIdx = 0;
+ DRBs_SetupMod_ItemIEs_t *drbItemIe = NULLP;
+
+ for(arrIdx = 0; arrIdx < drbSetupList->list.count; arrIdx++)
+ {
+ drbItemIe = ((DRBs_SetupMod_ItemIEs_t *)drbSetupList->list.array[arrIdx]);
+ freeDlTnlInfo(&drbItemIe->value.choice.DRBs_SetupMod_Item.dLUPTNLInformation_ToBeSetup_List);
+ DU_FREE(drbSetupList->list.array[arrIdx], sizeof(DRBs_SetupMod_ItemIEs_t));
+ }
+ DU_FREE(drbSetupList->list.array, drbSetupList->list.size);
+}
+
+/*******************************************************************
+*
+* @brief Builds the DRB to be Mod list
+*
+* @details
+*
+* Function :
+*
+* Functionality: Constructs the DRB to be Mod list
+*
+* @params[in] DRBs_Modified_List_t *drbModList
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t BuildDrbModList(DRBs_Modified_List_t *drbModList, DuUeCfg *ueCfg)
+{
+ uint8_t arrIdx =0, drbIdx = 0;
+ uint8_t drbCnt =0;
+ struct DRBs_Modified_ItemIEs *drbItemIe;
+
+ drbCnt = ueCfg->numDrbModified;
+
+ drbModList->list.count = drbCnt;
+ drbModList->list.size = drbCnt * sizeof(DRBs_Modified_ItemIEs_t *);
+ DU_ALLOC(drbModList->list.array, drbModList->list.size);
+ if(drbModList->list.array == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbModList()");
+ return RFAILED;
+ }
+
+ drbIdx = 0;
+ for(arrIdx = 0; arrIdx < ueCfg->numMacLcs; arrIdx++)
+ {
+ if(ueCfg->macLcCfg[arrIdx].configType == CONFIG_MOD)
{
- DU_LOG("\nERROR --> F1AP : Failed to fill DlTnl SetupList in BuildDrbToBeSetupModList");
- return RFAILED;
- }
-
+ DU_ALLOC(drbModList->list.array[drbIdx], sizeof(DRBs_Modified_ItemIEs_t));
+ if(drbModList->list.array[drbIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbModList");
+ return RFAILED;
+ }
+
+ drbItemIe = (struct DRBs_Modified_ItemIEs *)drbModList->list.array[drbIdx];
+ drbItemIe->id = ProtocolIE_ID_id_DRBs_Modified_Item;
+ drbItemIe->criticality = Criticality_reject;
+ drbItemIe->value.present = DRBs_Modified_ItemIEs__value_PR_DRBs_Modified_Item;
+ drbItemIe->value.choice.DRBs_Modified_Item.dRBID = ueCfg->upTnlInfo[arrIdx].drbId;
+ if(fillDlTnlSetupList(&drbItemIe->value.choice.DRBs_Modified_Item.dLUPTNLInformation_ToBeSetup_List,\
+ &ueCfg->upTnlInfo[arrIdx])!= ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to fill DlTnl SetupList in BuildDrbModList");
+ return RFAILED;
+ }
+ drbIdx++;
+ }
}
return ROK;
}
+
/*******************************************************************
-* @brief Free the memory allocated for DRB setup List
+* @brief Free the memory allocated for DRB Mod List
*
* @details
*
-* Function : FreeDrbSetupModList
+* Function : FreeDrbModList
*
* Functionality:
-* Free the memory allocated for DRB setup list
+* Free the memory allocated for DRB modified list
*
-* @params[in] DRBs_Setup_List_t *
+* @params[in] DRBs_Modified_List_t *
* @return void
*
* ****************************************************************/
-void FreeDrbSetupModList(DRBs_SetupMod_List_t *drbSetupList)
+void FreeDrbModList(DRBs_Modified_List_t *drbModList)
{
uint8_t arrIdx = 0;
- DRBs_SetupMod_ItemIEs_t *drbItemIe = NULLP;
+ DRBs_Modified_ItemIEs_t *drbItemIe = NULLP;
- for(arrIdx = 0; arrIdx < drbSetupList->list.count; arrIdx++)
+ for(arrIdx = 0; arrIdx < drbModList->list.count; arrIdx++)
{
- drbItemIe = ((DRBs_SetupMod_ItemIEs_t *)drbSetupList->list.array[arrIdx]);
- freeDlTnlInfo(&drbItemIe->value.choice.DRBs_SetupMod_Item.dLUPTNLInformation_ToBeSetup_List);
- DU_FREE(drbSetupList->list.array[arrIdx], sizeof(DRBs_SetupMod_ItemIEs_t));
+ drbItemIe = ((DRBs_Modified_ItemIEs_t *)drbModList->list.array[arrIdx]);
+ freeDlTnlInfo(&drbItemIe->value.choice.DRBs_Modified_Item.dLUPTNLInformation_ToBeSetup_List);
+ DU_FREE(drbModList->list.array[arrIdx], sizeof(DRBs_Modified_ItemIEs_t));
}
- DU_FREE(drbSetupList->list.array, drbSetupList->list.size);
+ DU_FREE(drbModList->list.array, drbModList->list.size);
+}
+
+/*******************************************************************
+* @brief Free the memory allocated for SRB setup List
+*
+* @details
+*
+* Function : FreeSrbSetupModList
+*
+* Functionality:
+* Free the memory allocated for SRB setup list
+*
+* @params[in] SRBs_Setup_List_t *
+* @return void
+*
+* ****************************************************************/
+void FreeSrbSetupModList(SRBs_SetupMod_List_t *srbSetupList)
+{
+ uint8_t srbIdx = 0;
+
+ for(srbIdx = 0; srbIdx < srbSetupList->list.count; srbIdx++)
+ DU_FREE(srbSetupList->list.array[srbIdx], sizeof(SRBs_SetupMod_ItemIEs_t));
+ DU_FREE(srbSetupList->list.array, srbSetupList->list.size);
}
+
/*******************************************************************
* @brief Free the memory allocated for UE Context Mod Response
*
break;
case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
break;
+ case ProtocolIE_ID_id_DUtoCURRCInformation:
+ {
+ DU_FREE(ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.choice.DUtoCURRCInformation.\
+ cellGroupConfig.buf, ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.choice.\
+ DUtoCURRCInformation.cellGroupConfig.size);
+ break;
+ }
case ProtocolIE_ID_id_DRBs_SetupMod_List:
{
FreeDrbSetupModList(&(ueContextModifyRes->protocolIEs.list.array[ieIdx]->\
value.choice.DRBs_SetupMod_List));
- break;
+ break;
+ }
+ case ProtocolIE_ID_id_DRBs_Modified_List:
+ {
+ FreeDrbModList(&(ueContextModifyRes->protocolIEs.list.array[ieIdx]->\
+ value.choice.DRBs_Modified_List));
+ break;
+ }
+ case ProtocolIE_ID_id_SRBs_SetupMod_List:
+ {
+ FreeSrbSetupModList(&(ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.choice.\
+ SRBs_SetupMod_List));
+ break;
}
}
DU_FREE(ueContextModifyRes->protocolIEs.list.array[ieIdx], sizeof(UEContextModificationResponse_t));
* Functionality:
* - Creating the ue context modifcation response
*
-* @params[in] uint8_t cellId,uint8_t ueIdx
+* @params[in] uint8_t cellId,uint8_t ueId
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildAndSendUeContextModRsp(uint8_t cellId,uint8_t ueIdx)
+uint8_t BuildAndSendUeContextModRsp(DuUeCb *ueCb)
{
- uint8_t ieIdx = 0;
- uint8_t cellIdx =0;
+ uint8_t ieIdx = 0, tnlIdx = 0, rbIdx = 0;
uint8_t elementCnt = 0;
uint8_t ret = RFAILED;
- uint32_t gnbCuUeF1apId; /* gNB-CU UE F1AP Id */
- uint32_t gnbDuUeF1apId; /* gNB-DU UE F1AP Id */
F1AP_PDU_t *f1apMsg = NULLP;
- asn_enc_rval_t encRetVal;
+ asn_enc_rval_t encRetVal;
UEContextModificationResponse_t *ueContextModifyRes = NULLP;
- DuUeCb *ueCb = NULLP;
- DU_LOG("\nINFO --> F1AP : Building Ue context modification response\n");
+ DU_LOG("\nINFO --> F1AP : Building UE context modification response\n");
- while(1)
+ while(true)
{
DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
if(f1apMsg == NULLP)
f1apMsg->choice.successfulOutcome->value.present = SuccessfulOutcome__value_PR_UEContextModificationResponse;
ueContextModifyRes =&f1apMsg->choice.successfulOutcome->value.choice.UEContextModificationResponse;
-
- elementCnt = 3;
+
+ if(ueCb->f1UeDb->actionType == UE_CTXT_MOD)
+ {
+ elementCnt = 2;
+ if(ueCb->f1UeDb->duUeCfg.numDrbSetupMod)
+ elementCnt++;
+ if(ueCb->f1UeDb->duUeCfg.numDrbModified)
+ elementCnt++;
+ }
+ if(ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY)
+ {
+ elementCnt = 5;
+ }
+ if(ueCb->f1UeDb->actionType == UE_CTXT_RRC_RECFG_COMPLETE)
+ elementCnt = 2;
ueContextModifyRes->protocolIEs.list.count = elementCnt;
ueContextModifyRes->protocolIEs.list.size = elementCnt*sizeof(UEContextModificationResponse_t*);
}
}
- /* Fetching Ue Cb Info*/
- GET_CELL_IDX(cellId, cellIdx);
- gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbDuUeF1apId;
- gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbCuUeF1apId;
- ueCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1];
-
ieIdx=0;
ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ueContextModifyRes->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.present =\
UEContextModificationResponseIEs__value_PR_GNB_CU_UE_F1AP_ID;
- ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID = gnbCuUeF1apId;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID = ueCb->gnbCuUeF1apId;
ieIdx++;
ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ueContextModifyRes->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.present=\
UEContextModificationResponseIEs__value_PR_GNB_DU_UE_F1AP_ID;
- ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID = gnbDuUeF1apId;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID = ueCb->gnbDuUeF1apId;
- ieIdx++;
- ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_DRBs_SetupMod_List;
- ueContextModifyRes->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
- ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.present =\
- UEContextModificationResponseIEs__value_PR_DRBs_SetupMod_List;
- if(ueCb->f1UeDb)
+ if(ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY)
{
+ ieIdx++;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_DUtoCURRCInformation;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.present = \
+ UEContextModificationResponseIEs__value_PR_DUtoCURRCInformation;
+ BuildCellGroupConfigRrc(ueCb, &ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.choice.DUtoCURRCInformation.cellGroupConfig);
+ }
+
+ if((ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY) || \
+ ((ueCb->f1UeDb->actionType == UE_CTXT_MOD) && (ueCb->f1UeDb->duUeCfg.numDrbSetupMod)))
+ {
+ ieIdx++;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_DRBs_SetupMod_List;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.present =\
+ UEContextModificationResponseIEs__value_PR_DRBs_SetupMod_List;
+ if(ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY)
+ {
+ for(tnlIdx = 0; tnlIdx < duCb.numTeId; tnlIdx++)
+ {
+ if(duCb.upTnlCfg[tnlIdx]->ueId == ueCb->gnbDuUeF1apId)
+ {
+ memcpy(&ueCb->f1UeDb->duUeCfg.upTnlInfo[ueCb->f1UeDb->duUeCfg.numDrbSetupMod++], duCb.upTnlCfg[tnlIdx], sizeof(UpTnlCfg));
+ }
+ }
+ }
ret = BuildDrbSetupModList(&(ueContextModifyRes->protocolIEs.list.array[ieIdx]->\
value.choice.DRBs_SetupMod_List) , &ueCb->f1UeDb->duUeCfg);
if(ret != ROK)
{
- DU_LOG( "\nERROR --> F1AP : Failed to build drb setupmod List ");
+ DU_LOG( "\nERROR --> F1AP : Failed to build DRB setupmod List ");
+ break;
+ }
+ }
+
+ if((ueCb->f1UeDb->actionType == UE_CTXT_MOD) && (ueCb->f1UeDb->duUeCfg.numDrbModified))
+ {
+ ieIdx++;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_DRBs_Modified_List;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.present =\
+ UEContextModificationResponseIEs__value_PR_DRBs_Modified_List;
+ ret = BuildDrbModList(&(ueContextModifyRes->protocolIEs.list.array[ieIdx]->\
+ value.choice.DRBs_Modified_List) , &ueCb->f1UeDb->duUeCfg);
+ if(ret != ROK)
+ {
+ DU_LOG( "\nERROR --> F1AP : Failed to build DRB Modified List ");
+ break;
+ }
+ }
+
+ if(ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY)
+ {
+ ieIdx++;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_SRBs_SetupMod_List;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.present = \
+ UEContextModificationResponseIEs__value_PR_SRBs_SetupMod_List;
+ for(rbIdx = 0; rbIdx < ueCb->duRlcUeCfg.numLcs; rbIdx++)
+ {
+ if(ueCb->duRlcUeCfg.rlcLcCfg[rbIdx].rlcBearerCfg.rbType == RB_TYPE_SRB)
+ {
+ memcpy(&ueCb->f1UeDb->duUeCfg.rlcLcCfg[ueCb->f1UeDb->duUeCfg.numRlcLcs++], &ueCb->duRlcUeCfg.rlcLcCfg[rbIdx],\
+ sizeof(DuRlcBearerCfg));
+ }
+ }
+ ret = BuildSrbSetupModList(&ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.choice.SRBs_SetupMod_List, \
+ &ueCb->f1UeDb->duUeCfg);
+ if(ret != ROK)
+ {
+ DU_LOG( "\nERROR --> F1AP : Failed to build SRB setupmod List ");
break;
}
- freeF1UeDb(ueCb->f1UeDb);
- ueCb->f1UeDb = NULLP;
}
+
+ freeF1UeDb(ueCb->f1UeDb);
+ ueCb->f1UeDb = NULLP;
+
xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
/* Encode the F1SetupRequest type as APER */
/* Encode results */
if(encRetVal.encoded == ENCODE_FAIL)
{
- DU_LOG( "\nERROR --> F1AP : Could not encode UE Context Setup Request structure (at %s)\n",\
+ DU_LOG( "\nERROR --> F1AP : Could not encode UE Modification Response structure (at %s)\n",\
encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
ret = RFAILED;
break;
else
{
DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for UE Context Modification Response\n");
+#ifdef DEBUG_ASN_PRINT
for(int i=0; i< encBufSize; i++)
{
printf("%x",encBuf[i]);
}
+#endif
}
/* Sending msg */
- if(sendF1APMsg() != ROK)
+ if(sendF1APMsg() != ROK && (ret == ROK))
{
- DU_LOG("\nERROR --> F1AP : Sending UE Context Setup Res Failed");
+ DU_LOG("\nERROR --> F1AP : Sending UE Modification Res Failed");
ret = RFAILED;
break;
}
+
+ ret = ROK;
break;
}
+
FreeUeContextModResp(f1apMsg);
return ret;
}
+
/*******************************************************************
*
* @brief Deallocating the memory allocated by the aper decoder
free(ulInfo->list.array);
}
}
+
/*******************************************************************
*
* @brief Deallocating the memory allocated by the aper decoder
free(drbSet->list.array);
}
+}
+
+/*******************************************************************
+ *
+ * @brief Deallocating the memory allocated by the aper decoder
+ * for DrbSetupModItem
+ *
+ * @details
+ *
+ * Function : freeAperDecodeDrbModifiedItem
+ *
+ * Functionality: Deallocating memory allocated for DrbModifedItem
+ *
+ * @params[in] DRBs_ToBeModified_Item_t *drbItem
+ *
+ * @return void
+ *
+ * ****************************************************************/
+
+void freeAperDecodeDrbModifiedItem(DRBs_ToBeModified_Item_t *drbItem)
+{
+ uint8_t arrIdx =0;
+ SNSSAI_t *snssai =NULLP;
+ Flows_Mapped_To_DRB_List_t *flowMap = NULLP;
+
+ if(drbItem->qoSInformation != NULLP)
+ {
+ drbItem->qoSInformation->present = QoSInformation_PR_choice_extension;
+ switch(drbItem->qoSInformation->present)
+ {
+ case QoSInformation_PR_NOTHING:
+ break;
+ case QoSInformation_PR_eUTRANQoS:
+ {
+ if(drbItem->qoSInformation->choice.eUTRANQoS)
+ {
+ free(drbItem->qoSInformation->choice.eUTRANQoS);
+ }
+ break;
+ }
+ case QoSInformation_PR_choice_extension:
+ {
+ if(drbItem->qoSInformation->choice.choice_extension)
+ {
+ freeAperDecodeQosInfo(&drbItem->qoSInformation->choice.choice_extension->value.choice.\
+ DRB_Information.dRB_QoS);
+ snssai = &drbItem->qoSInformation->choice.choice_extension->value.choice.DRB_Information.sNSSAI;
+ if(snssai->sST.buf)
+ {
+ free(snssai->sST.buf);
+ }
+ if(snssai->sD)
+ {
+ if(snssai->sD->buf)
+ {
+ free(snssai->sD->buf);
+ }
+ free(snssai->sD);
+ }
+
+ flowMap = &drbItem->qoSInformation->choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List;
+ if(flowMap->list.array)
+ {
+ for(arrIdx=0; arrIdx<flowMap->list.count; arrIdx++)
+ {
+ if(flowMap->list.array[arrIdx] )
+ {
+ freeAperDecodeQosInfo(&flowMap->list.array[arrIdx]->qoSFlowLevelQoSParameters);
+ free(flowMap->list.array[arrIdx]);
+ }
+ }
+ free(flowMap->list.array);
+ }
+
+ free(drbItem->qoSInformation->choice.choice_extension);
+ }
+ break;
+ }
+ }
+ free(drbItem->qoSInformation);
+ }
+ freeAperDecodeUlTnlInfoforDrbSetupMod(&drbItem->uLUPTNLInformation_ToBeSetup_List);
+ if(drbItem->uLConfiguration)
+ {
+ free(drbItem->uLConfiguration);
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Deallocating the memory allocated by the aper decoder
+ * for DrbToBeSetupModList
+ *
+ * @details
+ *
+ * Function : freeAperDecodeDrbToBeModifiedList
+ *
+ * Functionality: Deallocating memory allocated for DrbToBeModifiedList
+ *
+ * @params[in] DRBs_ToBeModified_List_t *drbSet
+ *
+ * @return void
+ *
+ * ****************************************************************/
+
+void freeAperDecodeDrbToBeModifiedList(DRBs_ToBeModified_List_t *drbSet)
+{
+ uint8_t arrIdx =0;
+ struct DRBs_ToBeModified_ItemIEs *drbItemIe;
+
+ if(drbSet->list.array)
+ {
+ for(arrIdx=0; arrIdx<drbSet->list.count ; arrIdx++)
+ {
+ if(drbSet->list.array[arrIdx] != NULLP)
+ {
+ if(arrIdx == 0)
+ {
+ drbItemIe = (DRBs_ToBeModified_ItemIEs_t *)drbSet->list.array[arrIdx];
+ freeAperDecodeDrbModifiedItem(&(drbItemIe->value.choice.DRBs_ToBeModified_Item));
+ }
+ free(drbSet->list.array[arrIdx]);
+ }
+ }
+ free(drbSet->list.array);
+ }
+
+}
+
+/*******************************************************************
+ *
+ * @brief Deallocating the memory allocated by the aper decoder
+ * for DrbToBeSetupModList
+ *
+ * @details
+ *
+ * Function : freeAperDecodeDrbToBeReleasedList
+ *
+ * Functionality: Deallocating memory allocated for DrbToBeReleasedList
+ *
+ * @params[in] DRBs_ToBeReleased_List_t *drbSet
+ *
+ * @return void
+ *
+ * ****************************************************************/
+
+void freeAperDecodeDrbToBeReleasedList(DRBs_ToBeReleased_List_t *drbSet)
+{
+ uint8_t arrIdx =0;
+
+ if(drbSet->list.array)
+ {
+ for(arrIdx=0; arrIdx<drbSet->list.count ; arrIdx++)
+ {
+ if(drbSet->list.array[arrIdx] != NULLP)
+ {
+ free(drbSet->list.array[arrIdx]);
+ }
+ }
+ free(drbSet->list.array);
+ }
+
}
/*******************************************************************
*
* @return void
*
* ****************************************************************/
-void freeAperDecodeUeContextModificationReqMsg(UEContextModificationRequest_t *UeContextModifyReq )
+void freeAperDecodeUeContextModificationReqMsg(UEContextModificationRequest_t *ueContextModifyReq )
{
uint8_t arrIdx, ieId;
- if(UeContextModifyReq->protocolIEs.list.array)
+ if(ueContextModifyReq->protocolIEs.list.array)
{
- for( arrIdx = 0 ; arrIdx<UeContextModifyReq->protocolIEs.list.count ; arrIdx++)
+ for( arrIdx = 0 ; arrIdx<ueContextModifyReq->protocolIEs.list.count ; arrIdx++)
{
- if(UeContextModifyReq->protocolIEs.list.array[arrIdx])
+ if(ueContextModifyReq->protocolIEs.list.array[arrIdx])
{
- ieId = UeContextModifyReq->protocolIEs.list.array[arrIdx]->id;
+ ieId = ueContextModifyReq->protocolIEs.list.array[arrIdx]->id;
switch(ieId)
{
case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
break;
case ProtocolIE_ID_id_DRBs_ToBeSetupMod_List:
{
- freeAperDecodeDrbToBeSetupModList(&UeContextModifyReq->protocolIEs.list.array[arrIdx]->\
+ freeAperDecodeDrbToBeSetupModList(&ueContextModifyReq->protocolIEs.list.array[arrIdx]->\
value.choice.DRBs_ToBeSetupMod_List);
break;
}
+ case ProtocolIE_ID_id_DRBs_ToBeModified_List:
+ {
+ freeAperDecodeDrbToBeModifiedList(&ueContextModifyReq->protocolIEs.list.array[arrIdx]->\
+ value.choice.DRBs_ToBeModified_List);
+ break;
+ }
+ case ProtocolIE_ID_id_DRBs_ToBeReleased_List:
+ {
+ freeAperDecodeDrbToBeReleasedList(&ueContextModifyReq->protocolIEs.list.array[arrIdx]->\
+ value.choice.DRBs_ToBeReleased_List);
+ break;
+ }
+ case ProtocolIE_ID_id_TransmissionActionIndicator:
+ break;
+ case ProtocolIE_ID_id_RRCContainer:
+ {
+ free(ueContextModifyReq->protocolIEs.list.array[arrIdx]->value.choice.RRCContainer.buf);
+ }
}
- free(UeContextModifyReq->protocolIEs.list.array[arrIdx]);
+ free(ueContextModifyReq->protocolIEs.list.array[arrIdx]);
}
}
- free(UeContextModifyReq->protocolIEs.list.array);
+ free(ueContextModifyReq->protocolIEs.list.array);
}
}
/*******************************************************************
uint8_t procF1UeContextModificationReq(F1AP_PDU_t *f1apMsg)
{
UEContextModificationRequest_t *ueContextModifyReq = NULLP;
- uint8_t ret = ROK, ieIdx = 0, cellIdx=0, ueIdx=0;
+ uint8_t ret = ROK, ieIdx = 0, cellIdx=0;
DuUeCb *duUeCb = NULLP;
- DRBs_ToBeSetupMod_List_t *drbSetupModCfg;
- DRBs_ToBeModified_List_t *drbModifiedCfg;
+ DRBs_ToBeSetupMod_List_t *drbSetupModCfg = NULLP;
+ DRBs_ToBeModified_List_t *drbModifiedCfg = NULLP;
+ DRBs_ToBeReleased_List_t *drbToRelease = NULLP;
uint32_t gnbCuUeF1apId, gnbDuUeF1apId;
ueContextModifyReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextModificationRequest;
gnbCuUeF1apId = ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID;
break;
}
- case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+ case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+ {
+ gnbDuUeF1apId = ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID;
+ for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++)
+ {
+ if(duCb.actvCellLst[cellIdx])
+ {
+ if((duCb.actvCellLst[cellIdx]->ueCb[gnbDuUeF1apId-1].gnbDuUeF1apId == gnbDuUeF1apId)&&\
+ (duCb.actvCellLst[cellIdx]->ueCb[gnbDuUeF1apId-1].gnbCuUeF1apId == gnbCuUeF1apId))
+ {
+ duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[gnbDuUeF1apId-1];
+ if(duUeCb->f1UeDb == NULLP)
+ {
+ DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
+ duUeCb->f1UeDb->cellIdx = cellIdx;
+ duUeCb->f1UeDb->actionType = UE_CTXT_MOD;
+ }
+ break;
+ }
+ }
+ }
+ if(duUeCb == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : wrong values of gnbCuUeF1apId and gnbDuUeF1apId ");
+ ret = RFAILED;
+ }
+ break;
+ }
+
+ case ProtocolIE_ID_id_RRCContainer:
{
- gnbDuUeF1apId = ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID;
+ /* Filling Dl RRC Msg Info */
+ DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
+ if(!duUeCb->f1UeDb->dlRrcMsg)
+ {
+ DU_LOG("\nERROR --> DU APP : procF1UeContextReleaseCommand(): \
+ Memory allocation failed ");
+ ret = RFAILED;
+ }
+ else
+ {
+ duUeCb->f1UeDb->dlRrcMsgPres = true;
+ memset(duUeCb->f1UeDb->dlRrcMsg, 0, sizeof(F1DlRrcMsg));
+ ret = extractDlRrcMsg(gnbDuUeF1apId, gnbCuUeF1apId, duUeCb->f1UeDb->dlRrcMsg,\
+ &ueContextModifyReq->protocolIEs.list.array[ieIdx]->\
+ value.choice.RRCContainer);
+ }
+
break;
}
+
case ProtocolIE_ID_id_DRBs_ToBeSetupMod_List:
case ProtocolIE_ID_id_DRBs_ToBeModified_List:
+ case ProtocolIE_ID_id_DRBs_ToBeReleased_List:
{
- for(cellIdx = 0; cellIdx < duCb.numActvCells; cellIdx++)
+ if(duUeCb->f1UeDb)
{
- for(ueIdx = 0; ueIdx < duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++)
+ /*DRBs to be Added*/
+ if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present ==\
+ UEContextModificationRequestIEs__value_PR_DRBs_ToBeSetupMod_List)
{
- if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
- (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
- {
+ drbSetupModCfg = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\
+ choice.DRBs_ToBeSetupMod_List;
- duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
- if(duUeCb->f1UeDb == NULLP)
- {
- DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
- }
- if(duUeCb->f1UeDb)
- {
- duUeCb->f1UeDb->actionType = UE_CTXT_MOD;
- if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present ==\
- UEContextModificationRequestIEs__value_PR_DRBs_ToBeSetupMod_List)
- {
- drbSetupModCfg = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\
- choice.DRBs_ToBeSetupMod_List;
-
- if(extractDrbListToSetupMod(NULL, drbSetupModCfg, NULL, drbSetupModCfg->list.count,\
+ if(extractDrbListToSetupMod(NULL, drbSetupModCfg, NULL, drbSetupModCfg->list.count,\
&duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap, NULL))
- {
- DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetupMod() for DrbSetupModList");
- ret = RFAILED;
- }
- }
+ {
+ DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetupMod() for DrbSetupModList");
+ ret = RFAILED;
+ }
+ }
- if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present == \
- UEContextModificationRequestIEs__value_PR_DRBs_ToBeModified_List)
+ /*DRBs to be Modified*/
+ if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present == \
+ UEContextModificationRequestIEs__value_PR_DRBs_ToBeModified_List)
- {
- drbModifiedCfg = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\
- choice.DRBs_ToBeModified_List;
- if(extractDrbListToSetupMod(NULL, NULL, drbModifiedCfg, drbSetupModCfg->list.count,\
- &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap, &duUeCb->rlcUeCfg))
- {
- DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetupMod() for DrbModifiedList");
- ret = RFAILED;
- }
- }
- }
- break;
+ {
+ drbModifiedCfg = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\
+ choice.DRBs_ToBeModified_List;
+ if(extractDrbListToSetupMod(NULL, NULL, drbModifiedCfg, drbModifiedCfg->list.count,\
+ &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap, &duUeCb->duRlcUeCfg))
+ {
+ DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetupMod() for DrbModifiedList");
+ ret = RFAILED;
}
}
- if(ueIdx >= duCb.actvCellLst[cellIdx]->numActvUes)
+ /*DRBs to be Released*/
+ if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present == \
+ UEContextModificationRequestIEs__value_PR_DRBs_ToBeReleased_List)
+
{
- DU_LOG("\nERROR --> DU APP : wrong values of gnbCuUeF1apId and gnbDuUeF1apId ");
- ret = RFAILED;
+ drbToRelease = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\
+ choice.DRBs_ToBeReleased_List;
+ if(extractDrbListToRelease(gnbDuUeF1apId, drbToRelease, drbToRelease->list.count,\
+ &duUeCb->f1UeDb->duUeCfg, &duUeCb->duRlcUeCfg))
+ {
+ DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetupMod() for DrbModifiedList");
+ ret = RFAILED;
+ }
+ }
+ }
+ break;
+ }
+
+ case ProtocolIE_ID_id_GNB_DUConfigurationQuery:
+ {
+ DU_LOG("\nINFO --> DU APP : Received GNB DU Configuration Query in UE Context Modification Request from CU");
+ if(duUeCb->f1UeDb)
+ {
+ duUeCb->f1UeDb->actionType = UE_CTXT_CFG_QUERY;
+ }
+ break;
+ }
+
+ case ProtocolIE_ID_id_RRCReconfigurationCompleteIndicator:
+ {
+ if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.choice.RRCReconfigurationCompleteIndicator == \
+ RRCReconfigurationCompleteIndicator_true)
+ {
+ duUeCb->f1UeDb->actionType = UE_CTXT_RRC_RECFG_COMPLETE;
+ }
+ break;
+ }
+ case ProtocolIE_ID_id_TransmissionActionIndicator:
+ {
+ if(duUeCb->f1UeDb)
+ {
+ if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.choice.TransmissionActionIndicator == TransmissionActionIndicator_stop)
+ {
+ duUeCb->f1UeDb->duUeCfg.dataTransmissionAction = STOP_TRANSMISSION;
}
+ else
+ {
+ duUeCb->f1UeDb->duUeCfg.dataTransmissionAction = RESTART_TRANSMISSION;
+ }
+ }
+ break;
+ }
+
+ case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
+ {
+ if(duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu)
+ {
+ duUeCb->f1UeDb->dlRrcMsg->deliveryStatRpt = true;
}
break;
}
+#ifdef NR_DRX
+ case ProtocolIE_ID_id_DRXConfigurationIndicator:
+ {
+ duUeCb->f1UeDb->duUeCfg.drxConfigIndicatorRelease = true;
+ break;
+ }
+#endif
+
}
}
- if(ret != RFAILED)
+
+ if(ret != RFAILED)
{
ret = duProcUeContextModReq(duUeCb);
}
freeAperDecodeUeContextModificationReqMsg(ueContextModifyReq);
return ret;
}
+
/*****************************************************************i
*
* @brief Free memory allocated for UE Context Release Request
* RFAILED - failure
*
* *************************************************************/
-uint8_t BuildAndSendUeContextReleaseReq(uint16_t cellId, uint8_t ueIdx)
+uint8_t BuildAndSendUeContextReleaseReq(uint16_t cellId, uint8_t ueId)
{
bool memAllocFail = false;
uint8_t ieIdx =0;
}
else
{
- GET_CRNTI(crnti, ueIdx);
- if(duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].crnti != crnti)
+ GET_CRNTI(crnti, ueId);
+ if(duCb.actvCellLst[cellIdx]->ueCb[ueId-1].crnti != crnti)
{
DU_LOG("\nERROR --> F1AP : BuildAndSendUeContextReleaseReq(): crnti[%d] does not exist", crnti);
break;
}
- gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbDuUeF1apId;
- gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbCuUeF1apId;
+ gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueId-1].gnbDuUeF1apId;
+ gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueId-1].gnbCuUeF1apId;
}
ieIdx=0;
else
{
DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for UEContextReleaseRequest\n");
+#ifdef DEBUG_ASN_PRINT
for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
{
printf("%x",encBuf[ieIdx]);
}
+#endif
}
/* Sending msg */
else
{
DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for UEContextReleaseComplete\n");
+#ifdef DEBUG_ASN_PRINT
for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
{
printf("%x",encBuf[ieIdx]);
}
+#endif
}
/* Sending msg */
break;
}while(true);
- if(ret == ROK)
+ if((ret == ROK) && (duCb.actvCellLst[cellId-1]) && (duCb.actvCellLst[cellId-1]->cellStatus == DELETION_IN_PROGRESS)
+ && (duCb.actvCellLst[cellId-1]->numActvUes == 0))
{
- duCb.actvCellLst[cellId-1]->cellStatus = DELETION_IN_PROGRESS;
ret = duSendCellDeletReq(cellId);
if(ret != ROK)
{
uint8_t procF1UeContextReleaseCommand(F1AP_PDU_t *f1apMsg)
{
uint8_t ieIdx=0, ret=ROK, ueIdx=0;
- uint16_t cellIdx =0;
- bool ueIdxFound;
+ uint16_t cellIdx =0, cellId = 0;
+ bool ueIdxFound = false;
uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId=0;
DuUeCb *duUeCb = NULLP;
UEContextReleaseCommand_t *ueContextReleaseCommand = NULLP;
case ProtocolIE_ID_id_Cause:
{
- break;
- }
-
- case ProtocolIE_ID_id_RRCContainer:
- {
- for(cellIdx = 0; cellIdx < duCb.numActvCells; cellIdx++)
+ for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++)
{
- for(ueIdx = 0; ueIdx < duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++)
+ for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
{
- if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
+ if(duCb.actvCellLst[cellIdx] && (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
{
+ cellId = duCb.actvCellLst[cellIdx]->cellId;
duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
- DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
- if(duUeCb->f1UeDb)
- {
- memset(duUeCb->f1UeDb, 0, sizeof(F1UeContextSetupDb));
- duUeCb->f1UeDb->actionType = UE_CTXT_RELEASE;
- duUeCb->f1UeDb->cellIdx = cellIdx;
- /* Filling Dl RRC Msg Info */
- DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
- if(!duUeCb->f1UeDb->dlRrcMsg)
- {
- DU_LOG("\nERROR --> DU APP : procF1UeContextReleaseCommand(): \
- Memory allocation failed ");
- ret = RFAILED;
- }
- else
- {
- duUeCb->f1UeDb->dlRrcMsgPres = true;
- memset(duUeCb->f1UeDb->dlRrcMsg, 0, sizeof(F1DlRrcMsg));
- ret = extractDlRrcMsg(gnbDuUeF1apId, gnbCuUeF1apId, duUeCb->f1UeDb->dlRrcMsg,\
- &ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->\
- value.choice.RRCContainer);
- }
-
- }
- else
- {
- DU_LOG("\nERROR --> DU APP : procF1UeContextReleaseCommand(): \
- Memory allocation failed ");
- ret = RFAILED;
-
- }
-
ueIdxFound = true;
break;
}
break;
}
}
+
if(!ueIdxFound)
{
- DU_LOG("\nERROR --> F1AP: DuUeCb is not found at procF1UeContextSetupReq()");
+ DU_LOG("\nERROR --> F1AP: procF1UeContextReleaseCommand(): Ue Information is not available");
ret = RFAILED;
}
+ break;
+ }
+
+ case ProtocolIE_ID_id_RRCContainer:
+ {
+ if(ueIdxFound == true)
+ {
+ DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
+ if(duUeCb->f1UeDb)
+ {
+ memset(duUeCb->f1UeDb, 0, sizeof(F1UeContextSetupDb));
+ duUeCb->f1UeDb->actionType = UE_CTXT_RELEASE;
+ duUeCb->f1UeDb->cellIdx = cellIdx;
+ /* Filling Dl RRC Msg Info */
+ DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
+ if(!duUeCb->f1UeDb->dlRrcMsg)
+ {
+ DU_LOG("\nERROR --> DU APP : procF1UeContextReleaseCommand(): \
+ Memory allocation failed ");
+ ret = RFAILED;
+ }
+ else
+ {
+ duUeCb->f1UeDb->dlRrcMsgPres = true;
+ memset(duUeCb->f1UeDb->dlRrcMsg, 0, sizeof(F1DlRrcMsg));
+ ret = extractDlRrcMsg(gnbDuUeF1apId, gnbCuUeF1apId, duUeCb->f1UeDb->dlRrcMsg,\
+ &ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->\
+ value.choice.RRCContainer);
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : procF1UeContextReleaseCommand(): \
+ Memory allocation failed ");
+ ret = RFAILED;
+ }
+ }
break;
}
default :
}
if(ret != RFAILED)
{
- duProcUeContextReleaseCommand(duUeCb);
+ duProcUeContextReleaseCommand(cellId, duUeCb);
}
freeAperDecodeUeContextReleaseCommand(f1apMsg);
return ret;
}
+
+/**************************************************************
+ *
+ * @brief free the memory allocated by aper decoder for paging
+ *
+ * @details
+ *
+ * Function : freeAperDecodePagingMsg
+ *
+ * Functionality:
+ * - free the memory allocated by aper decoder for
+ * the paging f1ap msg
+ *
+ * @params[in] Paging_t *paging
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ ****************************************************************/
+void freeAperDecodePagingMsg(Paging_t *paging)
+{
+ uint8_t ieIdx, cellIdx;
+ PagingCell_ItemIEs_t *pagingCellItemIes;
+ PagingCell_Item_t *pagingCellItem;
+ PagingCell_list_t *pagingCelllist;
+
+ if(paging)
+ {
+ if(paging->protocolIEs.list.array)
+ {
+ for(ieIdx=0 ; ieIdx<paging->protocolIEs.list.count; ieIdx++)
+ {
+ if(paging->protocolIEs.list.array[ieIdx])
+ {
+ switch(paging->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_ID_id_UEIdentityIndexValue:
+ {
+ free(paging->protocolIEs.list.array[ieIdx]->value.choice.UEIdentityIndexValue.choice.indexLength10.buf);
+ break;
+ }
+ case ProtocolIE_ID_id_PagingIdentity:
+ {
+ if(paging->protocolIEs.list.array[ieIdx]->value.choice.PagingIdentity.present == PagingIdentity_PR_cNUEPagingIdentity)
+ {
+ if(paging->protocolIEs.list.array[ieIdx]->value.choice.PagingIdentity.choice.cNUEPagingIdentity)
+ {
+ if(paging->protocolIEs.list.array[ieIdx]->value.choice.PagingIdentity.choice.cNUEPagingIdentity->present == \
+ CNUEPagingIdentity_PR_fiveG_S_TMSI)
+ {
+ free(paging->protocolIEs.list.array[ieIdx]->value.choice.PagingIdentity.choice.cNUEPagingIdentity->choice.fiveG_S_TMSI.buf);
+ }
+ free(paging->protocolIEs.list.array[ieIdx]->value.choice.PagingIdentity.choice.cNUEPagingIdentity);
+ }
+ }
+ break;
+ }
+ case ProtocolIE_ID_id_PagingCell_List:
+ {
+ pagingCelllist = &paging->protocolIEs.list.array[ieIdx]->value.choice.PagingCell_list;
+ if(pagingCelllist->list.array)
+ {
+ for(cellIdx = 0; cellIdx < pagingCelllist->list.count; cellIdx++)
+ {
+ if(pagingCelllist->list.array[cellIdx])
+ {
+ pagingCellItemIes = (PagingCell_ItemIEs_t *)pagingCelllist->list.array[cellIdx];
+ if(pagingCellItemIes->id == ProtocolIE_ID_id_PagingCell_Item)
+ {
+ pagingCellItem = &pagingCellItemIes->value.choice.PagingCell_Item;
+ free(pagingCellItem->nRCGI.pLMN_Identity.buf);
+ free(pagingCellItem->nRCGI.nRCellIdentity.buf);
+ }
+ free(pagingCelllist->list.array[cellIdx]);
+ }
+ }
+ free(pagingCelllist->list.array);
+ }
+ break;
+ }
+ }
+ free(paging->protocolIEs.list.array[ieIdx]);
+ }
+ }
+ free(paging->protocolIEs.list.array);
+
+ }
+ }
+}
+
+/**************************************************************
+ *
+ * @brief processing the paging f1ap msg received from CU
+ *
+ * @details
+ *
+ * Function : procPagingMsg
+ *
+ * Functionality:
+ * - processing the paging f1ap msg received from CU
+ *
+ * @params[in] F1AP_PDU_t *f1apMsg
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ *
+ ****************************************************************/
+uint8_t procPagingMsg(F1AP_PDU_t *f1apMsg)
+{
+ uint8_t ieIdx = 0, cellListIdx = 0;
+ uint64_t cellId = 0;
+ Paging_t *paging = NULLP;
+ PagingCell_list_t *pagingCelllist = NULLP;
+ PagingCell_ItemIEs_t *pagingCellItemIes = NULLP;
+ PagingCell_Item_t *pagingCellItem = NULLP;
+ DuPagingMsg *tmpPagingParam = NULLP;
+
+ paging = &f1apMsg->choice.initiatingMessage->value.choice.Paging;
+ if(paging)
+ {
+ if(paging->protocolIEs.list.array)
+ {
+ DU_ALLOC(tmpPagingParam, sizeof(DuPagingMsg));
+ if(tmpPagingParam == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory Allocation Failure in procPagingMsg");
+ freeAperDecodePagingMsg(paging);
+ return RFAILED;
+ }
+ for(ieIdx=0 ; ieIdx<paging->protocolIEs.list.count; ieIdx++)
+ {
+ if(paging->protocolIEs.list.array[ieIdx])
+ {
+ switch(paging->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_ID_id_UEIdentityIndexValue:
+ {
+ bitStringToInt(&paging->protocolIEs.list.array[ieIdx]->value.choice.UEIdentityIndexValue.choice.indexLength10,\
+ &tmpPagingParam->pagUeId);
+ break;
+ }
+
+ case ProtocolIE_ID_id_PagingIdentity:
+ {
+ switch(paging->protocolIEs.list.array[ieIdx]->value.choice.PagingIdentity.present)
+ {
+ case PagingIdentity_PR_cNUEPagingIdentity:
+ {
+ if(paging->protocolIEs.list.array[ieIdx]->value.choice.PagingIdentity.choice.cNUEPagingIdentity)
+ {
+ bitStringToInt(&paging->protocolIEs.list.array[ieIdx]->value.choice.PagingIdentity.choice.\
+ cNUEPagingIdentity->choice.fiveG_S_TMSI, &tmpPagingParam->sTmsi);
+
+ }
+ break;
+ }
+ case PagingIdentity_PR_rANUEPagingIdentity:
+ {
+ /*TODO: This Identifier is specific to RAN Initiated Paging – Connected Mode Paging*/
+ break;
+ }
+ default:
+ {
+ DU_LOG("ERROR --> DU APP: Invalid UE Paging Identity, Skipping this Paging Message:");
+ continue;
+ }
+ }
+ }
+
+ case ProtocolIE_ID_id_PagingDRX:
+ {
+ tmpPagingParam->pagingDrxPres = TRUE;
+ tmpPagingParam->pagingDrx = convertPagingCycleEnumToValue(paging->protocolIEs.list.array[ieIdx]->value.choice.PagingDRX);
+ break;
+ }
+
+ case ProtocolIE_ID_id_PagingPriority:
+ {
+ tmpPagingParam->pagPriority = paging->protocolIEs.list.array[ieIdx]->value.choice.PagingPriority;
+ break;
+ }
+
+ case ProtocolIE_ID_id_PagingCell_List:
+ {
+ pagingCelllist = &paging->protocolIEs.list.array[ieIdx]->value.choice.PagingCell_list;
+ if(pagingCelllist->list.array)
+ {
+ for(cellListIdx = 0; cellListIdx < pagingCelllist->list.count; cellListIdx++)
+ {
+ if(pagingCelllist->list.array[cellListIdx])
+ {
+ pagingCellItemIes = (PagingCell_ItemIEs_t *)pagingCelllist->list.array[cellListIdx];
+ pagingCellItem = &pagingCellItemIes->value.choice.PagingCell_Item;
+ bitStringToInt(&pagingCellItem->nRCGI.nRCellIdentity, &cellId);
+ if(processPagingMsg(cellId, tmpPagingParam) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Paging Processing Failed at CellId:%lu",cellId);
+ continue;
+ }
+ }
+ }
+ }
+ break;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> F1AP : Incorrect Paging IE option");
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ DU_FREE(tmpPagingParam, sizeof(DuPagingMsg));
+ freeAperDecodePagingMsg(paging);
+
+ return ROK;
+}
+
/**************************************************************
*
* @brief Handles received F1AP message and sends back response
return;
}
+#ifdef DEBUG_ASN_PRINT
printf("\nDEBUG --> F1AP : Received flat buffer to be decoded : ");
for(i=0; i< recvBufLen; i++)
{
printf("%x",recvBuf[i]);
}
+#endif
/* Decoding flat buffer into F1AP messsage */
f1apMsg = &f1apasnmsg;
memset(f1apMsg, 0, sizeof(F1AP_PDU_t));
rval = aper_decode(0, &asn_DEF_F1AP_PDU, (void **)&f1apMsg, recvBuf, recvBufLen, 0, 0);
- DU_FREE(recvBuf, (Size)recvBufLen);
if(rval.code == RC_FAIL || rval.code == RC_WMORE)
{
case SuccessfulOutcome__value_PR_F1SetupResponse:
{
#ifndef ODU_TEST_STUB
- procF1SetupRsp(f1apMsg);
+ procF1SetupRsp(f1apMsg, recvBufLen, recvBuf);
#endif
break;
}
procF1UeContextReleaseCommand(f1apMsg);
break;
}
+ case InitiatingMessage__value_PR_Paging:
+ {
+ procPagingMsg(f1apMsg);
+ break;
+ }
default:
{
DU_LOG("\nERROR --> F1AP : Invalid type of F1AP_PDU_PR_initiatingMessage [%d]",
free(f1apMsg);
}/* End of switch(f1apMsg->present) */
-
+
+ DU_FREE(recvBuf, (Size)recvBufLen);
} /* End of F1APMsgHdlr */
/**********************************************************************