#include "du_app_rlc_inf.h"
#include "du_mgr_main.h"
#include "du_utils.h"
+#include "RAT-Type.h"
+#include "FeatureSetUplinkPerCC.h"
+#include "FeatureSetDownlinkPerCC.h"
+#include "FeatureSets.h"
+#include "UE-NR-Capability.h"
+#include "UE-CapabilityRAT-Container.h"
+#include "UE-CapabilityRAT-ContainerListRRC.h"
#include "GNB-DU-System-Information.h"
#include "CellGroupConfigRrc.h"
#include "MAC-CellGroupConfig.h"
#include "DUtoCURRCContainer.h"
#include "GBR-QoSFlowInformation.h"
#include "QoSFlowLevelQoSParameters.h"
+#include "PUCCH-Config.h"
+#include "PUCCH-ResourceSet.h"
+#include "PUCCH-Resource.h"
+#include "PUCCH-PowerControl.h"
+#include "P0-PUCCH.h"
+#include "PUCCH-PathlossReferenceRS.h"
+#include "PUCCH-format0.h"
+#include "PUCCH-format1.h"
+#include "PUCCH-format2.h"
+#include "PUCCH-format3.h"
+#include "PUCCH-format4.h"
+#include "PUCCH-FormatConfig.h"
+#include "SchedulingRequestResourceConfig.h"
#include<ProtocolIE-Field.h>
#include "ProtocolExtensionField.h"
#include "F1AP-PDU.h"
#include "odu_common_codec.h"
#include "du_mgr.h"
+#include "du_cell_mgr.h"
#include "du_f1ap_msg_hdl.h"
+#include "DRBs-Setup-Item.h"
+#include "DLUPTNLInformation-ToBeSetup-List.h"
+#include "DLUPTNLInformation-ToBeSetup-Item.h"
+#include "UPTransportLayerInformation.h"
+#include "GTPTunnel.h"
-extern DuCfgParams duCfgParam;
+DuCfgParams duCfgParam;
-uint8_t procGNBDUCfgUpdAck(F1AP_PDU_t *f1apMsg);
-uint8_t procDlRrcMsgTrans(F1AP_PDU_t *f1apMsg);
-void FreeDUConfigUpdate(F1AP_PDU_t *f1apDuCfg);
-uint8_t sctpSend(Buffer *mBuf, uint8_t itfType);
-uint8_t BuildInitialUlBWP(BWP_UplinkDedicated_t *ulBwp);
+/************************************************************************
+ *
+ * @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
+ *
+ * ****************************************************************/
+int16_t getPollPdu(uint8_t pollPduCfg)
+{
+ int16_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
+ *
+ * @details
+ *
+ * Function : getReAsmblTmr
+ *
+ * Functionality: Converts enum values into actual value of reassembly
+ * timer
+ *
+ * @params[in] Enum value of reassembly timer
+ * @return Actual value of reassembly timer
+ *
+ * **********************************************************************/
+
+int8_t getReAsmblTmr(uint8_t reAsmblTmrCfg)
+{
+ 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
+ *
+ * **********************************************************************/
+
+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
+ {
+ switch(statProhTmrCfg)
+ {
+ 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;
+ }
+ }
+ return statProhTmr;
+}
/*******************************************************************
*
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
uint8_t BuildNrcgi(NRCGI_t *nrcgi)
{
uint8_t ret;
- uint8_t unused = 4;
uint8_t byteSize = 5;
- uint8_t val = 16;
/* Allocate Buffer Memory */
nrcgi->pLMN_Identity.size = PLMN_SIZE * sizeof(uint8_t);
DU_ALLOC(nrcgi->pLMN_Identity.buf, nrcgi->pLMN_Identity.size);
return RFAILED;
}
/*nrCellIdentity*/
- //ret = BuildNrCellId(&nrcgi->nRCellIdentity);
nrcgi->nRCellIdentity.size = byteSize * sizeof(uint8_t);
DU_ALLOC(nrcgi->nRCellIdentity.buf, nrcgi->nRCellIdentity.size);
if(nrcgi->nRCellIdentity.buf == NULLP)
{
return RFAILED;
}
- ret = fillBitString(&nrcgi->nRCellIdentity, unused, byteSize, val);
- if(ret != ROK)
- {
- return RFAILED;
- }
+ BuildNrCellId(&nrcgi->nRCellIdentity);
+
return ROK;
}
/*******************************************************************
* ****************************************************************/
uint8_t SendF1APMsg(Region region, Pool pool)
{
- Buffer *mBuf;
-
+ Buffer *mBuf = NULLP;
+
if(ODU_GET_MSG_BUF(region, pool, &mBuf) == ROK)
{
if(ODU_ADD_POST_MSG_MULT((Data *)encBuf, encBufSize, mBuf) == ROK)
{
- ODU_PRINT_MSG(mBuf, 0,0);
+ ODU_PRINT_MSG(mBuf, 0,0);
- if(sctpSend(mBuf, F1_INTERFACE) != ROK)
- {
- DU_LOG("\nF1AP : SCTP Send failed");
- ODU_PUT_MSG_BUF(mBuf);
- return RFAILED;
- }
+ if(sctpSend(mBuf, F1_INTERFACE) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : SCTP Send failed");
+ ODU_PUT_MSG_BUF(mBuf);
+ return RFAILED;
+ }
}
else
{
- DU_LOG("\nF1AP : ODU_ADD_POST_MSG_MULT failed");
+ DU_LOG("\nERROR --> F1AP : ODU_ADD_POST_MSG_MULT failed");
ODU_PUT_MSG_BUF(mBuf);
return RFAILED;
}
}
else
{
- DU_LOG("\nF1AP : Failed to allocate memory");
+ DU_LOG("\nERROR --> F1AP : Failed to allocate memory");
return RFAILED;
}
return ROK;
* ****************************************************************/
void FreeF1SetupReq(F1AP_PDU_t *f1apMsg)
{
- uint8_t idx =0;
- uint8_t idx1=1;
- F1SetupRequest_t *f1SetupReq=NULLP;
-
+ uint8_t ieIdx, ieIdx2;
+ F1SetupRequest_t *f1SetupReq=NULLP;
if(f1apMsg != NULLP)
{
f1SetupReq = &f1apMsg->choice.initiatingMessage->value.choice.F1SetupRequest;
if(f1SetupReq->protocolIEs.list.array != NULLP)
{
- if(f1SetupReq->protocolIEs.list.array[idx1]!=NULLP)
+ for(ieIdx = 0; ieIdx < f1SetupReq->protocolIEs.list.count; ieIdx++)
{
- if(f1SetupReq->protocolIEs.list.array[idx1]->value.choice.GNB_DU_ID.buf != NULLP)
+ if(f1SetupReq->protocolIEs.list.array[ieIdx] != NULLP)
{
- DU_FREE(f1SetupReq->protocolIEs.list.array[idx1]->value.choice.GNB_DU_ID.buf,\
- f1SetupReq->protocolIEs.list.array[idx1]->value.choice.GNB_DU_ID.size);
- idx1++;
- if(f1SetupReq->protocolIEs.list.array[idx1]->value.choice.GNB_DU_Name.buf != NULLP)
+ switch(f1SetupReq->protocolIEs.list.array[ieIdx]->id)
{
- DU_FREE(f1SetupReq->protocolIEs.list.array[idx1]->value.choice.GNB_DU_Name.buf,
- strlen((char *)duCfgParam.duName));
-
- idx1++;
- FreeServedCellList(&f1SetupReq->protocolIEs.list.array[idx1]->value.\
- choice.GNB_DU_Served_Cells_List);
-
- idx1++;
- FreeRrcVer(&f1SetupReq->protocolIEs.list.array[idx1]->value.choice.RRC_Version);
+ 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;
}
}
+ break;
}
- for(idx=0; idx<f1SetupReq->protocolIEs.list.count; idx++)
+ for(ieIdx2=0; ieIdx2< ieIdx; ieIdx2++)
{
- if(f1SetupReq->protocolIEs.list.array[idx]!=NULLP)
- {
- DU_FREE(f1SetupReq->protocolIEs.list.array[idx],sizeof(F1SetupRequestIEs_t));
- }
+ DU_FREE(f1SetupReq->protocolIEs.list.array[ieIdx2],sizeof(F1SetupRequestIEs_t));
}
DU_FREE(f1SetupReq->protocolIEs.list.array,\
f1SetupReq->protocolIEs.list.size);
}
DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
}
-
}
/*******************************************************************
*
******************************************************************/
uint8_t BuildAndSendF1SetupReq()
{
- uint8_t idx=0;
- uint8_t idx2=0;
- uint8_t i=0;
- uint8_t elementCnt=0;
+ 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 */
- uint8_t ret= RFAILED;
- uint8_t BuildRrcVerreturn=0;
+ ret= RFAILED;
- DU_LOG("\nF1AP : Building F1 Setup Request\n");
+ DU_LOG("\nINFO --> F1AP : Building F1 Setup Request\n");
do
{
DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
{
break;
}
- for(idx=0; idx<elementCnt; idx++)
+ for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
{
- DU_ALLOC(f1SetupReq->protocolIEs.list.array[idx],\
+ DU_ALLOC(f1SetupReq->protocolIEs.list.array[ieIdx],\
sizeof(F1SetupRequestIEs_t));
- if(f1SetupReq->protocolIEs.list.array[idx] == NULLP)
+ if(f1SetupReq->protocolIEs.list.array[ieIdx] == NULLP)
{
break;
}
}
- idx2 = 0;
+ ieIdx = 0;
/*TransactionID*/
- f1SetupReq->protocolIEs.list.array[idx2]->id = ProtocolIE_ID_id_TransactionID;
- f1SetupReq->protocolIEs.list.array[idx2]->criticality = Criticality_reject;
- f1SetupReq->protocolIEs.list.array[idx2]->value.present =\
+ 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;
- f1SetupReq->protocolIEs.list.array[idx2]->value.choice.TransactionID = \
+ f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.TransactionID = \
TRANS_ID;
/*DU ID*/
- idx2++;
- f1SetupReq->protocolIEs.list.array[idx2]->id = ProtocolIE_ID_id_gNB_DU_ID;
- f1SetupReq->protocolIEs.list.array[idx2]->criticality = Criticality_reject;
- f1SetupReq->protocolIEs.list.array[idx2]->value.present = \
+ 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;
- f1SetupReq->protocolIEs.list.array[idx2]->value.choice.GNB_DU_ID.size =\
+ f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size =\
sizeof(uint8_t);
- DU_ALLOC(f1SetupReq->protocolIEs.list.array[idx2]->value.choice.GNB_DU_ID.buf,\
- f1SetupReq->protocolIEs.list.array[idx2]->value.choice.GNB_DU_ID.size);
- if(f1SetupReq->protocolIEs.list.array[idx2]->value.choice.GNB_DU_ID.buf == \
+ DU_ALLOC(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf,\
+ f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
+ if(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf == \
NULLP)
{
break;
}
- f1SetupReq->protocolIEs.list.array[idx2]->value.choice.GNB_DU_ID.buf[0] =\
- duCfgParam.duId;
+ f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf[0] =\
+ duCfgParam.duId;
/*DU Name*/
if(duCfgParam.duName != NULL)
{
- idx2++;
- f1SetupReq->protocolIEs.list.array[idx2]->id = ProtocolIE_ID_id_gNB_DU_Name ;
- f1SetupReq->protocolIEs.list.array[idx2]->criticality = Criticality_ignore;
- f1SetupReq->protocolIEs.list.array[idx2]->value.present = F1SetupRequestIEs__value_PR_GNB_DU_Name;
- f1SetupReq->protocolIEs.list.array[idx2]->value.choice.GNB_DU_Name.size =\
- strlen((char *)duCfgParam.duName);
- DU_ALLOC(f1SetupReq->protocolIEs.list.array[idx2]->value.choice.\
+ 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[idx2]->value.choice.GNB_DU_Name.\
+ if(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.\
buf == NULLP)
{
break;
}
- strcpy((char*)f1SetupReq->protocolIEs.list.array[idx2]->value.\
+ strcpy((char*)f1SetupReq->protocolIEs.list.array[ieIdx]->value.\
choice.GNB_DU_Name.buf,
(char*)&duCfgParam.duName);
}
/*Served Cell list */
- idx2++;
- f1SetupReq->protocolIEs.list.array[idx2]->id = \
+ ieIdx++;
+ f1SetupReq->protocolIEs.list.array[ieIdx]->id = \
ProtocolIE_ID_id_gNB_DU_Served_Cells_List;
- f1SetupReq->protocolIEs.list.array[idx2]->criticality = Criticality_reject;
- f1SetupReq->protocolIEs.list.array[idx2]->value.present = \
+ f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ f1SetupReq->protocolIEs.list.array[ieIdx]->value.present = \
F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List;
duServedCell = &f1SetupReq->protocolIEs.list.\
- array[idx2]->value.choice.GNB_DU_Served_Cells_List;
- if((BuildServedCellList(duServedCell)) != ROK)
+ array[ieIdx]->value.choice.GNB_DU_Served_Cells_List;
+ if(BuildServedCellList(duServedCell))
{
break;
}
/*RRC Version*/
- idx2++;
- f1SetupReq->protocolIEs.list.array[idx2]->id = \
+ ieIdx++;
+ f1SetupReq->protocolIEs.list.array[ieIdx]->id = \
ProtocolIE_ID_id_GNB_DU_RRC_Version ;
- f1SetupReq->protocolIEs.list.array[idx2]->criticality = Criticality_reject;
- f1SetupReq->protocolIEs.list.array[idx2]->value.present = \
+ f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ f1SetupReq->protocolIEs.list.array[ieIdx]->value.present = \
F1SetupRequestIEs__value_PR_RRC_Version;
- rrcVer = &f1SetupReq->protocolIEs.list.array[idx2]->value.choice.RRC_Version;
- BuildRrcVerreturn = BuildRrcVer(rrcVer);
- if(BuildRrcVerreturn != ROK)
+ rrcVer = &f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.RRC_Version;
+ if(BuildRrcVer(rrcVer))
{
break;
}
/* Encode results */
if(encRetVal.encoded == ENCODE_FAIL)
{
- DU_LOG("\nF1AP : Could not encode F1SetupRequest structure (at %s)\n",\
+ DU_LOG("\nERROR --> F1AP : Could not encode F1SetupRequest structure (at %s)\n",\
encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
break;
}
else
{
- DU_LOG("\nF1AP : Created APER encoded buffer for F1SetupRequest\n");
- for(i=0; i< encBufSize; i++)
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for F1SetupRequest\n");
+ for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
{
- printf("%x",encBuf[i]);
+ printf("%x",encBuf[ieIdx]);
}
}
/* Sending msg */
if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
{
- DU_LOG("\nF1AP : Sending F1 Setup request failed");
+ DU_LOG("\nERROR --> F1AP : Sending F1 Setup request failed");
break;
}
/*******************************************************************
*
- * @brief Builds and sends the DUConfigUpdate
+ * @brief Deallocating memory of BuildAndSendDUConfigUpdate
*
* @details
*
- * Function : BuildAndSendDUConfigUpdate
+ * Function : FreeDUConfigUpdate
*
- * Functionality: Constructs the DU Update message and sends
- * it to the CU through SCTP.
- *
- * @params[in] void **buf,Buffer to which encoded pattern is written into
- * @params[in] int *size,size of buffer
- *
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-uint8_t BuildAndSendDUConfigUpdate()
-{
- uint8_t idx;
- uint8_t idy;
- uint8_t idx1;
- uint8_t idy1;
- uint8_t idy2;
- uint8_t elementCnt;
- uint8_t modifyCnt;
- uint8_t servPlmnCnt;
- uint8_t extensionCnt;
- asn_enc_rval_t encRetVal; /* Encoder return value */
- F1AP_PDU_t *f1apDuCfg = NULL;
- GNBDUConfigurationUpdate_t *duCfgUpdate;
- Served_Cells_To_Modify_List_t *cellsToModify;
- Served_Cells_To_Modify_Item_t *modifyItem;
- uint8_t ret= RFAILED;
- uint8_t i;
-
- while(true)
- {
- DU_LOG("\nF1AP : Building DU config update\n");
- /* Allocate the memory for F1DuCfg */
- DU_ALLOC(f1apDuCfg, sizeof(F1AP_PDU_t));
- if(f1apDuCfg == NULLP)
- {
- DU_LOG("\nF1AP : Memory allocation for F1AP-PDU failed");
- break;
- }
-
- f1apDuCfg->present = F1AP_PDU_PR_initiatingMessage;
- DU_ALLOC(f1apDuCfg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
- if(f1apDuCfg->choice.initiatingMessage == NULLP)
- {
- DU_LOG("\nF1AP : Memory allocation for F1AP-PDU failed");
- break;
- }
-
- f1apDuCfg->choice.initiatingMessage->procedureCode = \
- ProcedureCode_id_gNBDUConfigurationUpdate;
- f1apDuCfg->choice.initiatingMessage->criticality = Criticality_reject;
- f1apDuCfg->choice.initiatingMessage->value.present = \
- InitiatingMessage__value_PR_GNBDUConfigurationUpdate;
- duCfgUpdate = &f1apDuCfg->choice.initiatingMessage->value.\
- choice.GNBDUConfigurationUpdate;
- elementCnt = 3;
- duCfgUpdate->protocolIEs.list.count = elementCnt;
- duCfgUpdate->protocolIEs.list.size = \
- elementCnt * sizeof(GNBDUConfigurationUpdateIEs_t*);
-
- /* Initialize the F1Setup members */
- DU_ALLOC(duCfgUpdate->protocolIEs.list.array,duCfgUpdate->protocolIEs.list.size);
- if(duCfgUpdate->protocolIEs.list.array == NULLP)
- {
- DU_LOG("F1AP : Memory allocation for F1RequestIEs failed");
- break;
- }
- for(idx=0;idx<elementCnt;idx++)
- {
- DU_ALLOC(duCfgUpdate->protocolIEs.list.array[idx],sizeof(GNBDUConfigurationUpdateIEs_t));
- if(duCfgUpdate->protocolIEs.list.array[idx] == NULLP)
- {
- break;
- }
- }
-
- /*TransactionID*/
- idx1 = 0;
- duCfgUpdate->protocolIEs.list.array[idx1]->id=ProtocolIE_ID_id_TransactionID;
- duCfgUpdate->protocolIEs.list.array[idx1]->criticality= Criticality_reject;
- duCfgUpdate->protocolIEs.list.array[idx1]->value.present = \
- GNBDUConfigurationUpdateIEs__value_PR_TransactionID;
- duCfgUpdate->protocolIEs.list.array[idx1]->value.choice.TransactionID = \
- TRANS_ID;
-
- /*Served Cell to Modify */
- idx1++;
- duCfgUpdate->protocolIEs.list.array[idx1]->id = \
- ProtocolIE_ID_id_Served_Cells_To_Modify_List;
- duCfgUpdate->protocolIEs.list.array[idx1]->criticality =Criticality_reject;
- duCfgUpdate->protocolIEs.list.array[idx1]->value.present = \
- GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Modify_List;
- cellsToModify = &duCfgUpdate->protocolIEs.list.array[idx1]->value.choice.\
- Served_Cells_To_Modify_List;
- modifyCnt = 1;
- cellsToModify->list.count = modifyCnt;
- cellsToModify->list.size = \
- modifyCnt*sizeof(Served_Cells_To_Modify_ItemIEs_t *);
- DU_ALLOC(cellsToModify->list.array,cellsToModify->list.size);
- if(cellsToModify->list.array == NULLP)
- {
- break;
- }
- for(idy=0; idy<modifyCnt ;idy++)
- {
- DU_ALLOC(cellsToModify->list.array[idy],sizeof(\
- Served_Cells_To_Modify_ItemIEs_t));
- if(cellsToModify->list.array[idy] == NULLP)
- {
- break;
- }
- }
- cellsToModify->list.array[0]->id = \
- ProtocolIE_ID_id_Served_Cells_To_Modify_Item;
- cellsToModify->list.array[0]->criticality = Criticality_reject;
- cellsToModify->list.array[0]->value.present =\
- Served_Cells_To_Modify_ItemIEs__value_PR_Served_Cells_To_Modify_Item;
- modifyItem=&cellsToModify->list.array[0]->value.choice.\
- Served_Cells_To_Modify_Item;
-
- /*pLMN_Identity*/
- modifyItem->oldNRCGI.pLMN_Identity.size = 3*sizeof(uint8_t);
- DU_ALLOC(modifyItem->oldNRCGI.pLMN_Identity.buf,modifyItem->oldNRCGI.pLMN_Identity.size);
- if(modifyItem->oldNRCGI.pLMN_Identity.buf == NULLP)
- {
- break;
- }
- buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
- modifyItem->oldNRCGI.pLMN_Identity.buf);
-
- /*nRCellIdentity*/
- modifyItem->oldNRCGI.nRCellIdentity.size = 5*sizeof(uint8_t);
- DU_ALLOC(modifyItem->oldNRCGI.nRCellIdentity.buf,\
- modifyItem->oldNRCGI.nRCellIdentity.size);
- if(modifyItem->oldNRCGI.nRCellIdentity.buf == NULLP)
- {
- break;
- }
- for (int tmp = 0;tmp < modifyItem->oldNRCGI.nRCellIdentity.size-1;tmp++)
- {
- modifyItem->oldNRCGI.nRCellIdentity.buf[tmp] = 0;
- }
- modifyItem->oldNRCGI.nRCellIdentity.buf[4] = 16;
- modifyItem->oldNRCGI.nRCellIdentity.bits_unused = 4;
- /*pLMN_Identity*/
- /*nRCGI*/
- modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.size =3*sizeof(uint8_t);
- DU_ALLOC(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf,\
- modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.size);
- if(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf == NULLP)
- {
- break;
- }
- buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
- modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf);
- modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.size =5*sizeof(uint8_t);
- DU_ALLOC(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\
- modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.size);
- if(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf == NULLP)
- {
- break;
- }
- for (int tmp = 0 ; tmp < modifyItem->served_Cell_Information.\
- nRCGI.nRCellIdentity.size-1 ; tmp++)
- {
- modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf[tmp] = 0;
- }
- modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf[4] = 16;
- modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.bits_unused =4;
- /*nRPCI*/
- modifyItem->served_Cell_Information.nRPCI = \
- duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrPci;
- /*servedPLMNs*/
- servPlmnCnt = 1;
- modifyItem->served_Cell_Information.servedPLMNs.list.count = servPlmnCnt;
- modifyItem->served_Cell_Information.servedPLMNs.list.size = \
- servPlmnCnt*sizeof(ServedPLMNs_Item_t *);
- DU_ALLOC(modifyItem->served_Cell_Information.servedPLMNs.list.array,\
- modifyItem->served_Cell_Information.servedPLMNs.list.size);
- if(modifyItem->served_Cell_Information.servedPLMNs.list.array == NULLP)
- {
- break;
- }
- for(idy1=0;idy1<servPlmnCnt;idy1++)
- {
- DU_ALLOC(modifyItem->served_Cell_Information.servedPLMNs.list.array[idy1],\
- sizeof(ServedPLMNs_Item_t));
- if(modifyItem->served_Cell_Information.servedPLMNs.list.array[idy1]== NULLP)
- {
- break;
- }
- }
- modifyItem->served_Cell_Information.servedPLMNs.list.\
- array[0]->pLMN_Identity.size = 3*sizeof(uint8_t);
- DU_ALLOC(modifyItem->served_Cell_Information.servedPLMNs.list.\
- array[0]->pLMN_Identity.buf,modifyItem->served_Cell_Information.servedPLMNs.list.\
- array[0]->pLMN_Identity.size);
- if(modifyItem->served_Cell_Information.servedPLMNs.list.\
- array[0]->pLMN_Identity.buf == NULLP)
- {
- break;
- }
- buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.plmn[0],\
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->pLMN_Identity.buf);
- DU_ALLOC(modifyItem->served_Cell_Information.servedPLMNs.list.\
- array[0]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
- if(modifyItem->served_Cell_Information.servedPLMNs.list.\
- array[0]->iE_Extensions == NULLP)
- {
- break;
- }
- extensionCnt=1;
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.count = extensionCnt;
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.size = extensionCnt *sizeof(ServedPLMNs_ItemExtIEs_t *);
- DU_ALLOC(modifyItem->served_Cell_Information.servedPLMNs.list.\
- array[0]->iE_Extensions->list.array,modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.size);
- if(modifyItem->served_Cell_Information.servedPLMNs.list.\
- array[0]->iE_Extensions->list.array == NULLP)
- {
- break;
- }
- for(idy2=0;idy2<extensionCnt;idy2++)
- {
- DU_ALLOC(modifyItem->served_Cell_Information.servedPLMNs.list.\
- array[0]->iE_Extensions->list.array[idy2],\
- sizeof(ServedPLMNs_ItemExtIEs_t));
- if(modifyItem->served_Cell_Information.servedPLMNs.list.\
- array[0]->iE_Extensions->list.array[idy2] == NULLP)
- {
- break;
- }
- }
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->id =ProtocolIE_ID_id_TAISliceSupportList;
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->criticality = Criticality_ignore;
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.present = \
- ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.count = 1;
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.size = sizeof(SliceSupportItem_t *);
- DU_ALLOC(modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array,modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.size);
- if(modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array == NULLP)
- {
- break;
- }
-
- DU_ALLOC(modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0],sizeof( SliceSupportItem_t));
- if(modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0] == NULLP)
- {
- break;
- }
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sST.size = sizeof(uint8_t);
- DU_ALLOC(modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sST.buf,modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.array[0]->sNSSAI.sST.size);
- if(modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sST.buf == NULLP)
- {
- break;
- }
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sST.buf[0] = 3;
- DU_ALLOC(modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD,sizeof(OCTET_STRING_t));
- if(modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD == NULLP)
- {
- break;
- }
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->size = 3*sizeof(uint8_t);
- DU_ALLOC(modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->buf,modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->size);
- if(modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->buf == NULLP)
- {
- break;
- }
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->buf[0] = 3;
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->buf[1] = 6;
- modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->\
- iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
- list.array[0]->sNSSAI.sD->buf[2] = 9;
-
- /*nR Mode Info with FDD*/
- modifyItem->served_Cell_Information.nR_Mode_Info.present = \
- NR_Mode_Info_PR_fDD;
- DU_ALLOC(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD,\
- sizeof(FDD_Info_t));
- if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD == NULLP)
- {
- break;
- }
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->\
- uL_NRFreqInfo.nRARFCN = duCfgParam.srvdCellLst[0].duCellInfo.\
- f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn;
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->\
- uL_NRFreqInfo.freqBandListNr.list.count = 1;
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->\
- uL_NRFreqInfo.freqBandListNr.list.size = sizeof(FreqBandNrItem_t*);
- DU_ALLOC(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->uL_NRFreqInfo.freqBandListNr.list.array == NULLP)
- {
- break;
- }
- DU_ALLOC(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->\
- uL_NRFreqInfo.freqBandListNr.list.array[0],sizeof(FreqBandNrItem_t));
- if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->
- uL_NRFreqInfo.freqBandListNr.list.array[0] == NULLP)
- {
- break;
- }
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.\
- freqBandListNr.list.array[0]->freqBandIndicatorNr = \
- duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.\
- freqBand[0].nrFreqBand;
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.\
- freqBandListNr.list.array[0]->supportedSULBandList.list.count=0;
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
- nRARFCN = duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.fdd.\
- dlNrFreqInfo.nrArfcn;
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
- freqBandListNr.list.count = 1;
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
- freqBandListNr.list.size = sizeof(FreqBandNrItem_t *);
- DU_ALLOC(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);
- if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->\
- dL_NRFreqInfo.freqBandListNr.list.array == NULLP)
- {
- break;
- }
- DU_ALLOC(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->\
- dL_NRFreqInfo.freqBandListNr.list.array[0],\
- sizeof(FreqBandNrItem_t));
- if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->\
- dL_NRFreqInfo.freqBandListNr.list.array[0] == NULLP)
- {
- break;
- }
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
- freqBandListNr.list.array[0]->freqBandIndicatorNr = \
- duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.\
- freqBand[0].nrFreqBand;
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
- freqBandListNr.list.array[0]->supportedSULBandList.list.count=0;
-
- /*Transmission Bandwidth*/
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->\
- uL_Transmission_Bandwidth.nRSCS = duCfgParam.srvdCellLst[0].duCellInfo.\
- f1Mode.mode.fdd.ulTxBw.nrScs;
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->\
- uL_Transmission_Bandwidth.nRNRB = duCfgParam.srvdCellLst[0].duCellInfo.\
- f1Mode.mode.fdd.ulTxBw.nrb;
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->\
- dL_Transmission_Bandwidth.nRSCS = duCfgParam.srvdCellLst[0].duCellInfo.\
- f1Mode.mode.fdd.dlTxBw.nrScs;
- modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->\
- dL_Transmission_Bandwidth.nRNRB = duCfgParam.srvdCellLst[0].duCellInfo.\
- f1Mode.mode.fdd.dlTxBw.nrb;
- /*Measurement timing Config*/
- modifyItem->served_Cell_Information.measurementTimingConfiguration.size = \
- sizeof(uint8_t);
- DU_ALLOC(modifyItem->served_Cell_Information.measurementTimingConfiguration.\
- buf,modifyItem->served_Cell_Information.measurementTimingConfiguration.size);
- if(modifyItem->served_Cell_Information.measurementTimingConfiguration.buf == NULLP)
- {
- break;
- }
- modifyItem->served_Cell_Information.measurementTimingConfiguration.\
- buf[0] = duCfgParam.srvdCellLst[0].duCellInfo.measTimeCfg;
-
- // NOTE :GNB DU SYS INFO:MIB AND SIB1 INFORMATION TO BE BUILT AND FILLED HERE
- /*GNB DU ID */
- idx1++;
- duCfgUpdate->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_gNB_DU_ID;
- duCfgUpdate->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
- duCfgUpdate->protocolIEs.list.array[idx1]->value.present = \
- GNBDUConfigurationUpdateIEs__value_PR_GNB_DU_ID;
- duCfgUpdate->protocolIEs.list.array[idx1]->value.choice.GNB_DU_ID.size = \
- sizeof(uint8_t);
- DU_ALLOC(duCfgUpdate->protocolIEs.list.array[idx1]->value.choice.GNB_DU_ID.buf,\
- duCfgUpdate->protocolIEs.list.array[idx1]->value.choice.GNB_DU_ID.size);
- if(duCfgUpdate->protocolIEs.list.array[idx1]->value.choice.GNB_DU_ID.buf == NULLP)
- {
- break;
- }
- duCfgUpdate->protocolIEs.list.array[idx1]->value.choice.GNB_DU_ID.buf[0] = \
- duCfgParam.duId;
-
- xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apDuCfg);
-
- /* Encode the DU Config Update type as APER */
- memset(encBuf, 0, ENC_BUF_MAX_LEN);
- encBufSize = 0;
- encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apDuCfg, PrepFinalEncBuf, encBuf);
-
- /* Checking encode results */
- if(encRetVal.encoded == ENCODE_FAIL)
- {
- DU_LOG("F1AP : Could not encode DUConfigUpdate structure (at %s)\n",encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
- break;
- }
- else
- {
- DU_LOG("\nF1AP : Created APER encoded buffer for DUConfigUpdate\n");
- for(i=0; i< encBufSize; i++)
- {
- printf("%x",encBuf[i]);
- }
- }
- /* Sending msg */
- if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
- {
- DU_LOG("\nF1AP : Sending GND-DU Config Update failed");
- break;
- }
-
- ret = ROK;
- break;
- }
- FreeDUConfigUpdate(f1apDuCfg);
-
- return ret;
-}
-/*******************************************************************
- *
- * @brief Deallocating memory of BuildAndSendDUConfigUpdate
- *
- * @details
- *
- * Function : FreeDUConfigUpdate
- *
- * Functionality: Deallocating memory of variables allocated in
- * BuildAndSendDUConfigUpdate function
+ * Functionality: Deallocating memory of variables allocated in
+ * BuildAndSendDUConfigUpdate function
*
* @params[in] F1AP_PDU_t *f1apDuCfg
*
{
uint8_t i;
uint8_t idx;
- GNBDUConfigurationUpdate_t *duCfgUpdate;
+ GNBDUConfigurationUpdate_t *duCfgUpdate = NULLP;
Served_Cells_To_Modify_List_t *cellsToModify;
Served_Cells_To_Modify_Item_t *modifyItem;
idx=0;
DU_FREE(f1apDuCfg, (Size)sizeof(F1AP_PDU_t));
}
}
-/*******************************************************************
- *
- * @brief free the ULRRCMessageTransfer
- *
- * @details
- *
- * Function : FreeULRRCMessageTransfer
- *
- * Functionality: Deallocating the memory of variable allocated in
- * FreeULRRCMessageTransfer
- *
- * @params[in]
- *
- * @return ROK - void
- *
- ******************************************************************/
-void FreeULRRCMessageTransfer( F1AP_PDU_t *f1apMsg)
-{
- uint8_t idx1;
- ULRRCMessageTransfer_t *ulRRCMsg;
- if(f1apMsg != NULLP)
- {
- if(f1apMsg->choice.initiatingMessage != NULLP)
- {
- ulRRCMsg = &f1apMsg->choice.initiatingMessage->value.choice.ULRRCMessageTransfer;
- if(ulRRCMsg->protocolIEs.list.array != NULLP)
- {
- for(idx1=0;idx1<ulRRCMsg->protocolIEs.list.count;idx1++)
- {
- if(ulRRCMsg->protocolIEs.list.array[idx1] != NULLP)
- {
- if(ulRRCMsg->protocolIEs.list.array[idx1]->value.present ==
- ULRRCMessageTransferIEs__value_PR_RRCContainer)
- {
- DU_FREE(ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf,
- ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.size);
- }
- DU_FREE(ulRRCMsg->protocolIEs.list.array[idx1],sizeof(ULRRCMessageTransferIEs_t));
- }
- }
- DU_FREE(ulRRCMsg->protocolIEs.list.array,ulRRCMsg->protocolIEs.list.size );
- }
- DU_FREE(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
- }
- DU_FREE(f1apMsg,sizeof(F1AP_PDU_t));
- }
-}
/*******************************************************************
*
- * @brief Builds and sends the ULRRCMessageTransfer
+ * @brief Fills Served Plmns required in ServCellInfo IE
*
* @details
*
- * Function : BuildAndSendULRRCMessageTransfer
+ * Function : fillServedPlmns
*
- * Functionality: Constructs the UL RRC Message Transfer and sends
- * it to the CU through SCTP.
+ * Functionality: Fills Served Plmns required in ServCellInfo IE
*
- * @params[in]
+ * @params[in] Pointer to ServedPLMNs_List_t *
*
* @return ROK - success
* RFAILED - failure
*
- * ****************************************************************/
-uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb ueCb, uint8_t lcId, \
- uint16_t msgLen, uint8_t *rrcMsg)
+ *****************************************************************/
+
+uint8_t fillServedPlmns(ServedPLMNs_List_t *servedPlmn)
{
- uint8_t elementCnt;
- uint8_t idx1;
- uint8_t idx;
- F1AP_PDU_t *f1apMsg = NULL;
- ULRRCMessageTransfer_t *ulRRCMsg;
- asn_enc_rval_t encRetVal; /* Encoder return value */
- uint8_t ret =RFAILED;
- while(true)
- {
- DU_LOG("\n F1AP : Building UL RRC Message Transfer Message\n");
+ uint8_t ieIdx, ieListCnt;
- DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
- if(f1apMsg == NULLP)
- {
- DU_LOG(" F1AP : Memory allocation for F1AP-PDU failed");
- break;
- }
-
- f1apMsg->present = F1AP_PDU_PR_initiatingMessage;
- DU_ALLOC(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
- if(f1apMsg->choice.initiatingMessage == NULLP)
- {
- DU_LOG(" F1AP : Memory allocation for F1AP-PDU failed");
- break;
- }
- f1apMsg->choice.initiatingMessage->procedureCode = ProcedureCode_id_ULRRCMessageTransfer;
- f1apMsg->choice.initiatingMessage->criticality = Criticality_ignore;
- f1apMsg->choice.initiatingMessage->value.present = \
- InitiatingMessage__value_PR_ULRRCMessageTransfer;
- ulRRCMsg =
- &f1apMsg->choice.initiatingMessage->value.choice.ULRRCMessageTransfer;
- elementCnt = 4;
- ulRRCMsg->protocolIEs.list.count = elementCnt;
- ulRRCMsg->protocolIEs.list.size = \
- elementCnt * sizeof(ULRRCMessageTransferIEs_t *);
+ servedPlmn->list.array[0]->pLMN_Identity.size = 3*sizeof(uint8_t);
+ DU_ALLOC(servedPlmn->list.array[0]->pLMN_Identity.buf, servedPlmn->list.\
+ array[0]->pLMN_Identity.size);
+ if(servedPlmn->list.array[0]->pLMN_Identity.buf == NULLP)
+ {
+ return RFAILED;
+ }
+ buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.plmn[0],\
+ servedPlmn->list.array[0]->pLMN_Identity.buf);
+ DU_ALLOC(servedPlmn->list.array[0]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
+ if(servedPlmn->list.array[0]->iE_Extensions == NULLP)
+ {
+ return RFAILED;
+ }
- /* Initialize the F1Setup members */
- DU_ALLOC(ulRRCMsg->protocolIEs.list.array, ulRRCMsg->protocolIEs.list.size);
- if(ulRRCMsg->protocolIEs.list.array == NULLP)
- {
- DU_LOG(" F1AP : Memory allocation for UL RRC MessageTransferIEs failed");
- break;
- }
- for(idx=0; idx<elementCnt; idx++)
+ ieListCnt=1;
+ servedPlmn->list.array[0]->iE_Extensions->list.count = ieListCnt;
+ servedPlmn->list.array[0]->iE_Extensions->list.size = ieListCnt *sizeof(ServedPLMNs_ItemExtIEs_t *);
+ DU_ALLOC(servedPlmn->list.array[0]->iE_Extensions->list.array,servedPlmn->list.array[0]->\
+ iE_Extensions->list.size);
+ if(servedPlmn->list.array[0]->iE_Extensions->list.array == NULLP)
+ {
+ return RFAILED;
+ }
+ for(ieIdx=0;ieIdx<ieListCnt;ieIdx++)
+ {
+ DU_ALLOC(servedPlmn->list.array[0]->iE_Extensions->list.array[ieIdx],\
+ sizeof(ServedPLMNs_ItemExtIEs_t));
+ if(servedPlmn->list.array[0]->iE_Extensions->list.array[ieIdx] == NULLP)
{
- DU_ALLOC(ulRRCMsg->protocolIEs.list.array[idx],sizeof(ULRRCMessageTransferIEs_t));
- if(ulRRCMsg->protocolIEs.list.array[idx] == NULLP)
- {
- break;
- }
+ return RFAILED;
}
+ }
+ //plmnIeExt = servedPlmn->list.array[0]->iE_Extensions;
+ servedPlmn->list.array[0]->iE_Extensions->list.array[0]->id =ProtocolIE_ID_id_TAISliceSupportList;
+ servedPlmn->list.array[0]->iE_Extensions->list.array[0]->criticality = Criticality_ignore;
+ servedPlmn->list.array[0]->iE_Extensions->list.array[0]->extensionValue.present = \
+ ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
+ servedPlmn->list.array[0]->iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.count = 1;
+ servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.size = sizeof(SliceSupportItem_t *);
+ DU_ALLOC(servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array,servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.size);
+ if(servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array == NULLP)
+ {
+ return RFAILED;
+ }
- idx1 = 0;
-
- /*GNB CU UE F1AP ID*/
- ulRRCMsg->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
- 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;
-
- /*GNB DU UE F1AP ID*/
- idx1++;
- ulRRCMsg->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
- 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;
-
- /*SRBID*/
- idx1++;
- ulRRCMsg->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_SRBID;
- ulRRCMsg->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
- ulRRCMsg->protocolIEs.list.array[idx1]->value.present = \
- ULRRCMessageTransferIEs__value_PR_SRBID;
- ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.SRBID = lcId;
-
- /*RRCContainer*/
- idx1++;
- ulRRCMsg->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_RRCContainer;
- ulRRCMsg->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
- ulRRCMsg->protocolIEs.list.array[idx1]->value.present = \
- ULRRCMessageTransferIEs__value_PR_RRCContainer;
- ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.size = msgLen;
- DU_ALLOC(ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf,
- ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.size)
- if(!ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf)
- {
- DU_LOG(" F1AP : Memory allocation for BuildAndSendULRRCMessageTransfer failed");
- break;
- }
- memcpy(ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf, \
- rrcMsg, ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.size);
-
- xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
+ DU_ALLOC(servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0],sizeof( SliceSupportItem_t));
+ if(servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0] == NULLP)
+ {
+ return RFAILED;
+ }
+ servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0]->sNSSAI.sST.size = sizeof(uint8_t);
+ DU_ALLOC(servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0]->sNSSAI.sST.buf,servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.array[0]->sNSSAI.sST.size);
+ if(servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0]->sNSSAI.sST.buf == NULLP)
+ {
+ return RFAILED;
+ }
+ servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0]->sNSSAI.sST.buf[0] = 3;
+ DU_ALLOC(servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0]->sNSSAI.sD,sizeof(OCTET_STRING_t));
+ if(servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0]->sNSSAI.sD == NULLP)
+ {
+ return RFAILED;
+ }
+ servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0]->sNSSAI.sD->size = 3*sizeof(uint8_t);
+ DU_ALLOC(servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0]->sNSSAI.sD->buf,servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0]->sNSSAI.sD->size);
+ if(servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0]->sNSSAI.sD->buf == NULLP)
+ {
+ return RFAILED;
+ }
+ servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0]->sNSSAI.sD->buf[0] = 3;
+ servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0]->sNSSAI.sD->buf[1] = 6;
+ servedPlmn->list.array[0]->\
+ iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+ list.array[0]->sNSSAI.sD->buf[2] = 9;
+ return ROK;
+}
- /* 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);
- /* Encode results */
- if(encRetVal.encoded == ENCODE_FAIL)
- {
- DU_LOG( "\n F1AP : Could not encode ULRRCMessageTransfer structure (at %s)\n",\
- encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
- break;
- }
- else
- {
- DU_LOG("\n F1AP : Created APER encoded buffer for ULRRCMessageTransfer\n");
- for(int i=0; i< encBufSize; i++)
- {
- printf("%x",encBuf[i]);
- }
- }
+/*******************************************************************
+ *
+ * @brief Fills Nr Fdd Info required in ServCellInfo IE
+ *
+ * @details
+ *
+ * Function : fillNrFddInfo
+ *
+ * Functionality: Fills Nr Fdd Info required in ServCellInfo IE
+ *
+ * @params[in] Pointer to NR_Mode_Info_t *
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ *****************************************************************/
- /* Sending msg */
- if(SendF1APMsg(DU_APP_MEM_REGION,DU_POOL) != ROK)
- {
- DU_LOG("\n F1AP : Sending UL RRC Message Transfer Failed");
- break;
- }
- ret = ROK;
- break;
+uint8_t fillNrFddInfo(NR_Mode_Info_t *nrFdd)
+{
+ nrFdd->choice.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)
+ {
+ return RFAILED;
}
- FreeULRRCMessageTransfer(f1apMsg);
+ DU_ALLOC(nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array[0], \
+ sizeof(FreqBandNrItem_t));
+ if(nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array[0] == NULLP)
+ {
+ return RFAILED;
+ }
+ nrFdd->choice.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.\
+ 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)
+ {
+ 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)
+ {
+ return RFAILED;
+ }
+ nrFdd->choice.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;
+
+ /*Transmission Bandwidth*/
+ nrFdd->choice.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.\
+ f1Mode.mode.fdd.ulTxBw.nrb;
+ nrFdd->choice.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.\
+ f1Mode.mode.fdd.dlTxBw.nrb;
- return ret;
-}/* End of BuildAndSendULRRCMessageTransfer*/
+ return ROK;
+}
/*******************************************************************
*
- * @brief Builds tag config
+ * @brief Fills ServCellInfo IE
*
* @details
*
- * Function : BuildTagConfig
+ * Function : fillServedCellInfo
*
- * Functionality: Builds tag config in MacCellGroupConfig
+ * Functionality: Fills ServCellInfo
*
- * @params[in] TAG_Config *tag_Config
+ * @params[in] Pointer to Served_Cell_Information_t *
*
* @return ROK - success
* RFAILED - failure
*
- * ****************************************************************/
-uint8_t BuildTagConfig(struct TAG_Config *tagConfig)
+ *****************************************************************/
+
+uint8_t fillServedCellInfo(Served_Cell_Information_t *srvCellInfo)
{
- struct TAG_Config__tag_ToAddModList *tagList;
- uint8_t idx, elementCnt;
+ uint8_t tmp, ieIdx, ieListCnt;
- tagConfig->tag_ToReleaseList = NULLP;
- tagConfig->tag_ToAddModList = NULLP;
- DU_ALLOC(tagConfig->tag_ToAddModList, sizeof(struct TAG_Config__tag_ToAddModList));
- if(!tagConfig->tag_ToAddModList)
+ /*nRCGI*/
+ srvCellInfo->nRCGI.pLMN_Identity.size =3*sizeof(uint8_t);
+ DU_ALLOC(srvCellInfo->nRCGI.pLMN_Identity.buf,\
+ srvCellInfo->nRCGI.pLMN_Identity.size);
+ if(srvCellInfo->nRCGI.pLMN_Identity.buf == NULLP)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildTagConfig");
return RFAILED;
}
+ buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
+ srvCellInfo->nRCGI.pLMN_Identity.buf);
+ srvCellInfo->nRCGI.nRCellIdentity.size =5*sizeof(uint8_t);
+ DU_ALLOC(srvCellInfo->nRCGI.nRCellIdentity.buf,\
+ srvCellInfo->nRCGI.nRCellIdentity.size);
+ if(srvCellInfo->nRCGI.nRCellIdentity.buf == NULLP)
+ {
+ 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;
- elementCnt = 1; //ODU_VALUE_ONE;
- tagList = tagConfig->tag_ToAddModList;
- tagList->list.count = elementCnt;
- tagList->list.size = elementCnt * sizeof(struct TAG *);
+ /*nRPCI*/
+ srvCellInfo->nRPCI = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrPci;
- tagList->list.array = NULLP;
- DU_ALLOC(tagList->list.array, tagList->list.size);
- if(!tagList->list.array)
+ /*servedPLMNs*/
+ 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);
+ if(srvCellInfo->servedPLMNs.list.array == NULLP)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildTagConfig");
return RFAILED;
}
-
- for(idx=0; idx<tagList->list.count; idx++)
+ for(ieIdx=0; ieIdx < ieListCnt; ieIdx++)
{
- tagList->list.array[idx] = NULLP;
- DU_ALLOC(tagList->list.array[idx], sizeof(struct TAG));
- if(!tagList->list.array[idx])
+ DU_ALLOC(srvCellInfo->servedPLMNs.list.array[ieIdx],\
+ sizeof(ServedPLMNs_Item_t));
+ if(srvCellInfo->servedPLMNs.list.array[ieIdx]== NULLP)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildTagConfig");
return RFAILED;
}
}
+ if(fillServedPlmns(&srvCellInfo->servedPLMNs))
+ {
+ return RFAILED;
+ }
- idx = 0;
- tagList->list.array[idx]->tag_Id = TAG_ID;
- tagList->list.array[idx]->timeAlignmentTimer = TIME_ALIGNMENT_TMR;
+ /*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));
+ if(srvCellInfo->nR_Mode_Info.choice.fDD == NULLP)
+ {
+ return RFAILED;
+ }
+ if(fillNrFddInfo(&srvCellInfo->nR_Mode_Info))
+ return RFAILED;
+
+ /*Measurement timing Config*/
+ srvCellInfo->measurementTimingConfiguration.size = sizeof(uint8_t);
+ DU_ALLOC(srvCellInfo->measurementTimingConfiguration.\
+ buf,srvCellInfo->measurementTimingConfiguration.size);
+ if(srvCellInfo->measurementTimingConfiguration.buf == NULLP)
+ {
+ return RFAILED;
+ }
+ srvCellInfo->measurementTimingConfiguration.\
+ buf[0] = duCfgParam.srvdCellLst[0].duCellInfo.measTimeCfg;
return ROK;
}
/*******************************************************************
*
- * @brief Builds PHR Config
+ * @brief Fills ServCellToModItem IE
*
* @details
*
- * Function : BuildPhrConfig
+ * Function : fillServCellToModItem
*
- * Functionality: Builds phrConfig in MacCellGroupConfig
+ * Functionality: Fills ServCellToModItem IE
*
- * @params[in] PHR Config *
+ * @params[in] Pointer to Served_Cells_To_Modify_Item_t *
*
* @return ROK - success
* RFAILED - failure
*
- * ****************************************************************/
-uint8_t BuildPhrConfig(struct MAC_CellGroupConfig__phr_Config *phrConfig)
+ *****************************************************************/
+
+uint8_t fillServCellToModItem(Served_Cells_To_Modify_Item_t *modifyItem)
{
+ uint8_t ieIdx;
- phrConfig->present = MAC_CellGroupConfig__phr_Config_PR_setup;
- phrConfig->choice.setup = NULLP;
- DU_ALLOC(phrConfig->choice.setup, sizeof(struct PHR_Config));
- if(!phrConfig->choice.setup)
+ /*pLMN_Identity*/
+ modifyItem->oldNRCGI.pLMN_Identity.size = 3*sizeof(uint8_t);
+ DU_ALLOC(modifyItem->oldNRCGI.pLMN_Identity.buf,modifyItem->oldNRCGI.pLMN_Identity.size);
+ if(modifyItem->oldNRCGI.pLMN_Identity.buf == NULLP)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildPhrConfig");
return RFAILED;
}
+ buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
+ modifyItem->oldNRCGI.pLMN_Identity.buf);
- 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;
+ /*nRCellIdentity*/
+ modifyItem->oldNRCGI.nRCellIdentity.size = 5*sizeof(uint8_t);
+ DU_ALLOC(modifyItem->oldNRCGI.nRCellIdentity.buf,\
+ modifyItem->oldNRCGI.nRCellIdentity.size);
+ if(modifyItem->oldNRCGI.nRCellIdentity.buf == NULLP)
+ {
+ 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;
- return ROK;
+ if(fillServedCellInfo(&modifyItem->served_Cell_Information))
+ return RFAILED;
+ else
+ return ROK;
}
/*******************************************************************
*
- * @brief Builds BSR Config
+ * @brief Builds ServCellToModList
*
* @details
*
- * Function : BuildBsrConfig
+ * Function : buildServCellToModList
*
- * Functionality: Builds BuildBsrConfig in MacCellGroupConfig
+ * Functionality: Builds the serv cell to Mod List
*
- * @params[in] BSR_Config *bsrConfig
+ * @params[in] Pointer to Served_Cells_To_Modify_List_t *
*
* @return ROK - success
* RFAILED - failure
*
- * ****************************************************************/
-uint8_t BuildBsrConfig(struct BSR_Config *bsrConfig)
+ *****************************************************************/
+
+uint8_t buildServCellToModList(Served_Cells_To_Modify_List_t *cellsToModify)
{
- bsrConfig->periodicBSR_Timer = PERIODIC_BSR_TMR;
- bsrConfig->retxBSR_Timer = RETX_BSR_TMR;
- bsrConfig->logicalChannelSR_DelayTimer = NULLP;
+ uint8_t ieListCnt, ieIdx;
+ Served_Cells_To_Modify_Item_t *modifyItem = NULLP;
- return ROK;
+ ieListCnt = 1;
+ cellsToModify->list.count = ieListCnt;
+ cellsToModify->list.size = ieListCnt*sizeof(Served_Cells_To_Modify_ItemIEs_t *);
+ DU_ALLOC(cellsToModify->list.array,cellsToModify->list.size);
+ if(cellsToModify->list.array == NULLP)
+ {
+ return RFAILED;
+ }
+ for(ieIdx=0; ieIdx< ieListCnt; ieIdx++)
+ {
+ DU_ALLOC(cellsToModify->list.array[ieIdx],sizeof(Served_Cells_To_Modify_ItemIEs_t));
+ if(cellsToModify->list.array[ieIdx] == NULLP)
+ {
+ return RFAILED;
+ }
+ }
+ cellsToModify->list.array[0]->id = ProtocolIE_ID_id_Served_Cells_To_Modify_Item;
+ cellsToModify->list.array[0]->criticality = Criticality_reject;
+ cellsToModify->list.array[0]->value.present =\
+ Served_Cells_To_Modify_ItemIEs__value_PR_Served_Cells_To_Modify_Item;
+ modifyItem=&cellsToModify->list.array[0]->value.choice.Served_Cells_To_Modify_Item;
+
+ if(fillServCellToModItem(modifyItem))
+ return RFAILED;
+ else
+ return ROK;
}
/*******************************************************************
*
- * @brief Builds scheduling request config
+ * @brief Builds and sends the DUConfigUpdate
*
* @details
*
- * Function : BuildSchedulingReqConfig
+ * Function : BuildAndSendDUConfigUpdate
*
- * Functionality: Builds BuildSchedulingReqConfig in MacCellGroupConfig
+ * Functionality: Constructs the DU Update message and sends
+ * it to the CU through SCTP.
*
- * @params[in] SchedulingRequestConfig *schedulingRequestConfig
+ * @params[in] void **buf,Buffer to which encoded pattern is written into
+ * @params[in] int *size,size of buffer
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildSchedulingReqConfig(struct SchedulingRequestConfig *schedulingRequestConfig)
+uint8_t BuildAndSendDUConfigUpdate()
{
- struct SchedulingRequestConfig__schedulingRequestToAddModList *schReqList;
- uint8_t idx, elementCnt;
+ uint8_t ret, ieIdx, elementCnt;
+ F1AP_PDU_t *f1apDuCfg = NULLP;
+ GNBDUConfigurationUpdate_t *duCfgUpdate = NULLP;
+ asn_enc_rval_t encRetVal; /* Encoder return value */
+ memset(&encRetVal, 0, sizeof(asn_enc_rval_t));
+ ret= RFAILED;
- schedulingRequestConfig->schedulingRequestToAddModList = NULLP;
- DU_ALLOC(schedulingRequestConfig->schedulingRequestToAddModList,
- sizeof(struct SchedulingRequestConfig__schedulingRequestToAddModList));
- if(!schedulingRequestConfig->schedulingRequestToAddModList)
+ while(true)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildSchedulingReqConfig");
- return RFAILED;
- }
+ DU_LOG("\nINFO --> F1AP : Building DU config update\n");
+ /* Allocate the memory for F1DuCfg */
+ DU_ALLOC(f1apDuCfg, sizeof(F1AP_PDU_t));
+ if(f1apDuCfg == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation for F1AP-PDU failed");
+ break;
+ }
- elementCnt = 1; //ODU_VALUE_ONE;
- schReqList = schedulingRequestConfig->schedulingRequestToAddModList;
- schReqList->list.count = elementCnt;
- schReqList->list.size = elementCnt * sizeof(struct SchedulingRequestToAddMod *);
+ f1apDuCfg->present = F1AP_PDU_PR_initiatingMessage;
+ DU_ALLOC(f1apDuCfg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
+ if(f1apDuCfg->choice.initiatingMessage == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation for F1AP-PDU failed");
+ break;
+ }
- schReqList->list.array = NULLP;
- DU_ALLOC(schReqList->list.array, schReqList->list.size);
- if(!schReqList->list.array)
- {
- DU_LOG("\nF1AP : Memory allocation failure in BuildSchedulingReqConfig");
- return RFAILED;
- }
+ f1apDuCfg->choice.initiatingMessage->procedureCode = \
+ ProcedureCode_id_gNBDUConfigurationUpdate;
+ f1apDuCfg->choice.initiatingMessage->criticality = Criticality_reject;
+ f1apDuCfg->choice.initiatingMessage->value.present = \
+ InitiatingMessage__value_PR_GNBDUConfigurationUpdate;
+ duCfgUpdate = &f1apDuCfg->choice.initiatingMessage->value.\
+ choice.GNBDUConfigurationUpdate;
+ elementCnt = 3;
+ duCfgUpdate->protocolIEs.list.count = elementCnt;
+ duCfgUpdate->protocolIEs.list.size = \
+ elementCnt * sizeof(GNBDUConfigurationUpdateIEs_t*);
- 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])
+ /* Initialize the F1Setup members */
+ DU_ALLOC(duCfgUpdate->protocolIEs.list.array,duCfgUpdate->protocolIEs.list.size);
+ if(duCfgUpdate->protocolIEs.list.array == NULLP)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildSchedulingReqConfig");
- return RFAILED;
+ DU_LOG("ERROR --> F1AP : Memory allocation for F1RequestIEs failed");
+ break;
+ }
+ for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
+ {
+ DU_ALLOC(duCfgUpdate->protocolIEs.list.array[ieIdx],sizeof(GNBDUConfigurationUpdateIEs_t));
+ if(duCfgUpdate->protocolIEs.list.array[ieIdx] == NULLP)
+ {
+ break;
+ }
}
- }
- idx = 0;
- schReqList->list.array[idx]->schedulingRequestId = SCH_REQ_ID;
+ /*TransactionID*/
+ ieIdx = 0;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->id=ProtocolIE_ID_id_TransactionID;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality= Criticality_reject;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
+ GNBDUConfigurationUpdateIEs__value_PR_TransactionID;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.TransactionID = TRANS_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)
- {
- DU_LOG("\nF1AP : Memory allocation failure in BuildSchedulingReqConfig");
- return RFAILED;
+ /*Served Cell to Modify */
+ ieIdx++;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->id = \
+ ProtocolIE_ID_id_Served_Cells_To_Modify_List;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality =Criticality_reject;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
+ GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Modify_List;
+ if(buildServCellToModList(&duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.\
+ Served_Cells_To_Modify_List))
+ break;
+
+ // NOTE :GNB DU SYS INFO:MIB AND SIB1 INFORMATION TO BE BUILT AND FILLED HERE
+ /*GNB DU ID */
+ ieIdx++;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_ID;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
+ GNBDUConfigurationUpdateIEs__value_PR_GNB_DU_ID;
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size = sizeof(uint8_t);
+ DU_ALLOC(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf,\
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
+ if(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf == NULLP)
+ {
+ break;
+ }
+ duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf[0] = duCfgParam.duId;
+
+ xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apDuCfg);
+
+ /* Encode the DU Config Update type as APER */
+ memset((uint8_t *)encBuf, 0, ENC_BUF_MAX_LEN);
+ encBufSize = 0;
+ encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apDuCfg, PrepFinalEncBuf, encBuf);
+
+ /* Checking encode results */
+ if(encRetVal.encoded == ENCODE_FAIL)
+ {
+ DU_LOG("ERROR --> F1AP : Could not encode DUConfigUpdate structure (at %s)\n",\
+ encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+ break;
+ }
+ else
+ {
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for DUConfigUpdate\n");
+ for(ieIdx =0; ieIdx < encBufSize; ieIdx++)
+ {
+ printf("%x",encBuf[ieIdx]);
+ }
+ }
+ /* Sending msg */
+ if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Sending GNB-DU Config Update failed");
+ break;
+ }
+
+ ret = ROK;
+ break;
}
- *(schReqList->list.array[idx]->sr_ProhibitTimer) = SR_PROHIBIT_TMR;
- schReqList->list.array[idx]->sr_TransMax = SR_TRANS_MAX;
- schedulingRequestConfig->schedulingRequestToReleaseList = NULLP;
+ FreeDUConfigUpdate(f1apDuCfg);
- return ROK;
+ return ret;
}
+
/*******************************************************************
*
- * @brief Builds RLC Config
+ * @brief free the ULRRCMessageTransfer
*
* @details
*
- * Function : BuildRlcConfig
+ * Function : FreeULRRCMessageTransfer
*
- * Functionality: Builds RLC Config in BuildRlcBearerToAddModList
+ * Functionality: Deallocating the memory of variable allocated in
+ * FreeULRRCMessageTransfer
*
- * @params[in] RLC_Config *rlcConfig
+ * @params[in]
*
- * @return ROK - success
- * RFAILED - failure
+ * @return ROK - void
*
- * ****************************************************************/
-uint8_t BuildRlcConfig(struct RLC_Config *rlcConfig)
+ ******************************************************************/
+void FreeULRRCMessageTransfer( F1AP_PDU_t *f1apMsg)
{
+ uint8_t idx1;
+ ULRRCMessageTransfer_t *ulRRCMsg;
- 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("\nF1AP : Memory allocation failure in BuildRlcConfig");
- return RFAILED;
- }
-
- /* UL */
- 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("\nF1AP : Memory allocation failure in BuildRlcConfig");
- 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 */
- 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("\nF1AP : Memory allocation failure in BuildRlcConfig");
- return RFAILED;
+ if(f1apMsg != NULLP)
+ {
+ if(f1apMsg->choice.initiatingMessage != NULLP)
+ {
+ ulRRCMsg = &f1apMsg->choice.initiatingMessage->value.choice.ULRRCMessageTransfer;
+ if(ulRRCMsg->protocolIEs.list.array != NULLP)
+ {
+ for(idx1=0;idx1<ulRRCMsg->protocolIEs.list.count;idx1++)
+ {
+ if(ulRRCMsg->protocolIEs.list.array[idx1] != NULLP)
+ {
+ if(ulRRCMsg->protocolIEs.list.array[idx1]->value.present ==
+ ULRRCMessageTransferIEs__value_PR_RRCContainer)
+ {
+ DU_FREE(ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf,
+ ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.size);
+ }
+ DU_FREE(ulRRCMsg->protocolIEs.list.array[idx1],sizeof(ULRRCMessageTransferIEs_t));
+ }
+ }
+ DU_FREE(ulRRCMsg->protocolIEs.list.array,ulRRCMsg->protocolIEs.list.size );
+ }
+ DU_FREE(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
+ }
+ DU_FREE(f1apMsg,sizeof(F1AP_PDU_t));
}
- *(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;
-
- return ROK;
}
-
/*******************************************************************
*
- * @brief Builds MAC LC Config
+ * @brief Builds and sends the ULRRCMessageTransfer
*
* @details
*
- * Function : BuildMacLCConfig
+ * Function : BuildAndSendULRRCMessageTransfer
*
- * Functionality: Builds MAC LC Config in BuildRlcBearerToAddModList
+ * Functionality: Constructs the UL RRC Message Transfer and sends
+ * it to the CU through SCTP.
*
- * @params[in] struct LogicalChannelConfig macLcConfig
+ * @params[in]
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildMacLCConfig(struct LogicalChannelConfig *macLcConfig)
+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;
+
+ memset(&encRetVal, 0, sizeof(asn_enc_rval_t));
- macLcConfig->ul_SpecificParameters = NULLP;
- DU_ALLOC(macLcConfig->ul_SpecificParameters, sizeof(struct LogicalChannelConfig__ul_SpecificParameters));
- if(!macLcConfig->ul_SpecificParameters)
- {
- DU_LOG("\nF1AP : Memory allocation failure in BuildMacLCConfig");
- return RFAILED;
- }
-
- macLcConfig->ul_SpecificParameters->priority = MAC_LC_PRIORITY;
- macLcConfig->ul_SpecificParameters->prioritisedBitRate = PRIORTISIED_BIT_RATE;
- macLcConfig->ul_SpecificParameters->bucketSizeDuration = BUCKET_SIZE_DURATION;
- macLcConfig->ul_SpecificParameters->allowedServingCells = NULLP;
- macLcConfig->ul_SpecificParameters->allowedSCS_List = NULLP;
- macLcConfig->ul_SpecificParameters->maxPUSCH_Duration = NULLP;
- macLcConfig->ul_SpecificParameters->configuredGrantType1Allowed = NULLP;
-
- macLcConfig->ul_SpecificParameters->logicalChannelGroup = NULLP;
- DU_ALLOC(macLcConfig->ul_SpecificParameters->logicalChannelGroup, sizeof(long));
- if(!macLcConfig->ul_SpecificParameters->logicalChannelGroup)
+ while(true)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildMacLCConfig");
- return RFAILED;
- }
- *(macLcConfig->ul_SpecificParameters->logicalChannelGroup) = LC_GRP;
+ DU_LOG("\n INFO --> F1AP : Building UL RRC Message Transfer Message\n");
- macLcConfig->ul_SpecificParameters->schedulingRequestID = NULLP;
- DU_ALLOC(macLcConfig->ul_SpecificParameters->schedulingRequestID, sizeof(SchedulingRequestId_t));
- if(!macLcConfig->ul_SpecificParameters->schedulingRequestID)
- {
- DU_LOG("\nF1AP : Memory allocation failure in BuildMacLCConfig");
- return RFAILED;
- }
- *(macLcConfig->ul_SpecificParameters->schedulingRequestID) = SCH_REQ_ID;
+ DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
+ if(f1apMsg == NULLP)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for F1AP-PDU failed");
+ break;
+ }
+ f1apMsg->present = F1AP_PDU_PR_initiatingMessage;
+ DU_ALLOC(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
+ if(f1apMsg->choice.initiatingMessage == NULLP)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for F1AP-PDU failed");
+ break;
+ }
+ f1apMsg->choice.initiatingMessage->procedureCode = ProcedureCode_id_ULRRCMessageTransfer;
+ f1apMsg->choice.initiatingMessage->criticality = Criticality_ignore;
+ f1apMsg->choice.initiatingMessage->value.present = \
+ InitiatingMessage__value_PR_ULRRCMessageTransfer;
+ ulRRCMsg =
+ &f1apMsg->choice.initiatingMessage->value.choice.ULRRCMessageTransfer;
+ elementCnt = 4;
+ ulRRCMsg->protocolIEs.list.count = elementCnt;
+ ulRRCMsg->protocolIEs.list.size = \
+ elementCnt * sizeof(ULRRCMessageTransferIEs_t *);
- macLcConfig->ul_SpecificParameters->logicalChannelSR_Mask = false;
- macLcConfig->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = false;
- macLcConfig->ul_SpecificParameters->bitRateQueryProhibitTimer = NULLP;
+ /* Initialize the F1Setup members */
+ DU_ALLOC(ulRRCMsg->protocolIEs.list.array, ulRRCMsg->protocolIEs.list.size);
+ if(ulRRCMsg->protocolIEs.list.array == NULLP)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for UL RRC MessageTransferIEs failed");
+ break;
+ }
+ for(idx=0; idx<elementCnt; idx++)
+ {
+ DU_ALLOC(ulRRCMsg->protocolIEs.list.array[idx],sizeof(ULRRCMessageTransferIEs_t));
+ if(ulRRCMsg->protocolIEs.list.array[idx] == NULLP)
+ {
+ break;
+ }
+ }
- return ROK;
-}
+ idx1 = 0;
+
+ /*GNB CU UE F1AP ID*/
+ ulRRCMsg->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
+ 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;
+
+ /*GNB DU UE F1AP ID*/
+ idx1++;
+ ulRRCMsg->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+ 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;
+
+ /*SRBID*/
+ idx1++;
+ ulRRCMsg->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_SRBID;
+ ulRRCMsg->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
+ ulRRCMsg->protocolIEs.list.array[idx1]->value.present = \
+ ULRRCMessageTransferIEs__value_PR_SRBID;
+ ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.SRBID = lcId;
+
+ /*RRCContainer*/
+ idx1++;
+ ulRRCMsg->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_RRCContainer;
+ ulRRCMsg->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
+ ulRRCMsg->protocolIEs.list.array[idx1]->value.present = \
+ ULRRCMessageTransferIEs__value_PR_RRCContainer;
+ ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.size = msgLen;
+ DU_ALLOC(ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf,
+ ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.size)
+ if(!ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for BuildAndSendULRRCMessageTransfer failed");
+ break;
+ }
+ memset(ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf, 0, msgLen);
+ memcpy(ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf, \
+ rrcMsg, ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.size);
+
+ 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);
+ /* Encode results */
+ if(encRetVal.encoded == ENCODE_FAIL)
+ {
+ DU_LOG( "\nERROR --> F1AP : Could not encode ULRRCMessageTransfer structure (at %s)\n",\
+ encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+ break;
+ }
+ else
+ {
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for ULRRCMessageTransfer\n");
+ for(int i=0; i< encBufSize; i++)
+ {
+ printf("%x",encBuf[i]);
+ }
+ }
+
+ /* Sending msg */
+ if(SendF1APMsg(DU_APP_MEM_REGION,DU_POOL) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Sending UL RRC Message Transfer Failed");
+ break;
+ }
+ ret = ROK;
+ break;
+ }
+ FreeULRRCMessageTransfer(f1apMsg);
+
+ return ret;
+}/* End of BuildAndSendULRRCMessageTransfer*/
/*******************************************************************
*
- * @brief Builds RLC Bearer to Add/Mod list
+ * @brief Builds tag config
*
* @details
*
- * Function :BuildRlcBearerToAddModList
+ * Function : BuildTagConfig
*
- * Functionality: Builds RLC Bearer to Add/Mod list in DuToCuRrcContainer
+ * Functionality: Builds tag config in MacCellGroupConfig
*
- * @params[in] rlc_BearerToAddModList
+ * @params[in] TAG_Config *tag_Config
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildRlcBearerToAddModList(struct CellGroupConfigRrc__rlc_BearerToAddModList *rlcBearerList)
+uint8_t BuildTagConfig(struct TAG_Config *tagConfig)
{
+ struct TAG_Config__tag_ToAddModList *tagList;
uint8_t idx, elementCnt;
- elementCnt = 1;
- rlcBearerList->list.count = elementCnt;
- rlcBearerList->list.size = elementCnt * sizeof(struct RLC_BearerConfig *);
+ tagConfig->tag_ToReleaseList = NULLP;
+ tagConfig->tag_ToAddModList = NULLP;
+ DU_ALLOC(tagConfig->tag_ToAddModList, sizeof(struct TAG_Config__tag_ToAddModList));
+ if(!tagConfig->tag_ToAddModList)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildTagConfig");
+ return RFAILED;
+ }
- rlcBearerList->list.array = NULLP;
- DU_ALLOC(rlcBearerList->list.array, rlcBearerList->list.size);
- if(!rlcBearerList->list.array)
+ elementCnt = 1; //ODU_VALUE_ONE;
+ tagList = tagConfig->tag_ToAddModList;
+ tagList->list.count = elementCnt;
+ tagList->list.size = elementCnt * sizeof(struct TAG *);
+
+ tagList->list.array = NULLP;
+ DU_ALLOC(tagList->list.array, tagList->list.size);
+ if(!tagList->list.array)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildRlcBearerToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildTagConfig");
return RFAILED;
}
- for(idx=0; idx<rlcBearerList->list.count; idx++)
+ for(idx=0; idx<tagList->list.count; idx++)
{
- rlcBearerList->list.array[idx] = NULLP;
- DU_ALLOC(rlcBearerList->list.array[idx], sizeof(struct RLC_BearerConfig));
- if(!rlcBearerList->list.array[idx])
+ tagList->list.array[idx] = NULLP;
+ DU_ALLOC(tagList->list.array[idx], sizeof(struct TAG));
+ if(!tagList->list.array[idx])
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildRlcBearerToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildTagConfig");
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("\nF1AP : 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;
+ tagList->list.array[idx]->tag_Id = TAG_ID;
+ tagList->list.array[idx]->timeAlignmentTimer = TIME_ALIGNMENT_TMR;
- 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("\nF1AP : Memory allocation failure in BuildRlcBearerToAddModList");
- return RFAILED;
- }
+ return ROK;
+}
- if(BuildRlcConfig(rlcBearerList->list.array[idx]->rlc_Config) != ROK)
- {
- DU_LOG("\nF1AP : BuildRlcConfig failed");
- return RFAILED;
- }
+/*******************************************************************
+ *
+ * @brief Builds PHR Config
+ *
+ * @details
+ *
+ * Function : BuildPhrConfig
+ *
+ * Functionality: Builds phrConfig in MacCellGroupConfig
+ *
+ * @params[in] PHR Config *
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildPhrConfig(struct MAC_CellGroupConfig__phr_Config *phrConfig)
+{
- 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)
+ phrConfig->present = MAC_CellGroupConfig__phr_Config_PR_setup;
+ phrConfig->choice.setup = NULLP;
+ DU_ALLOC(phrConfig->choice.setup, sizeof(struct PHR_Config));
+ if(!phrConfig->choice.setup)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildRlcBearerToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildPhrConfig");
return RFAILED;
}
- if(BuildMacLCConfig(rlcBearerList->list.array[idx]->mac_LogicalChannelConfig) != ROK)
- {
- DU_LOG("\nF1AP : BuildMacLCConfig failed");
- 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;
return ROK;
}
/*******************************************************************
*
- * @brief Build Control resource set to add/modify list
+ * @brief Builds BSR Config
*
* @details
*
- * Function : BuildControlRSetToAddModList
+ * Function : BuildBsrConfig
*
- * Functionality: Build Control resource set to add/modify list
+ * Functionality: Builds BuildBsrConfig in MacCellGroupConfig
*
- * @params[in]
- * struct PDCCH_Config__controlResourceSetToAddModList *controlRSetList
+ * @params[in] BSR_Config *bsrConfig
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
- uint8_t BuildControlRSetToAddModList
-(
- struct PDCCH_Config__controlResourceSetToAddModList *controlRSetList
- )
+uint8_t BuildBsrConfig(struct BSR_Config *bsrConfig)
{
- uint8_t idx;
- uint8_t elementCnt;
- uint8_t numBytes, bitsUnused;
- struct ControlResourceSet *controlRSet;
- uint8_t freqDomainResource[FREQ_DOM_RSRC_SIZE] = {0};
- uint8_t coreset0EndPrb, coreset1StartPrb, coreset1NumPrb;
-
+ bsrConfig->periodicBSR_Timer = PERIODIC_BSR_TMR;
+ bsrConfig->retxBSR_Timer = RETX_BSR_TMR;
+ bsrConfig->logicalChannelSR_DelayTimer = NULLP;
- elementCnt = 1;
- controlRSetList->list.count = elementCnt;
- controlRSetList->list.size = \
- elementCnt * sizeof(struct ControlResourceSet *);
+ return ROK;
+}
- controlRSetList->list.array = NULLP;
- DU_ALLOC(controlRSetList->list.array, controlRSetList->list.size);
- if(!controlRSetList->list.array)
+/*******************************************************************
+ *
+ * @brief Builds scheduling request config
+ *
+ * @details
+ *
+ * Function : BuildSchedulingReqConfig
+ *
+ * Functionality: Builds BuildSchedulingReqConfig in MacCellGroupConfig
+ *
+ * @params[in] SchedulingRequestConfig *schedulingRequestConfig
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildSchedulingReqConfig(struct SchedulingRequestConfig *schedulingRequestConfig)
+{
+ struct SchedulingRequestConfig__schedulingRequestToAddModList *schReqList;
+ uint8_t idx, elementCnt;
+
+ schedulingRequestConfig->schedulingRequestToAddModList = NULLP;
+ DU_ALLOC(schedulingRequestConfig->schedulingRequestToAddModList,
+ sizeof(struct SchedulingRequestConfig__schedulingRequestToAddModList));
+ if(!schedulingRequestConfig->schedulingRequestToAddModList)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSchedulingReqConfig");
return RFAILED;
}
- for(idx = 0; idx < elementCnt; idx++)
+ elementCnt = 1; //ODU_VALUE_ONE;
+ schReqList = schedulingRequestConfig->schedulingRequestToAddModList;
+ schReqList->list.count = elementCnt;
+ schReqList->list.size = elementCnt * sizeof(struct SchedulingRequestToAddMod *);
+
+ schReqList->list.array = NULLP;
+ DU_ALLOC(schReqList->list.array, schReqList->list.size);
+ if(!schReqList->list.array)
{
- controlRSetList->list.array[idx] = NULLP;
- DU_ALLOC(controlRSetList->list.array[idx], sizeof(struct ControlResourceSet));
- if(!controlRSetList->list.array[idx])
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSchedulingReqConfig");
+ return RFAILED;
+ }
+
+ 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("\nF1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSchedulingReqConfig");
return RFAILED;
}
}
- idx=0;
- controlRSet = controlRSetList->list.array[idx];
-
- controlRSet->controlResourceSetId = PDCCH_CTRL_RSRC_SET_ONE_ID;
-
- /* size 6 bytes
- * 3 LSBs unsued
- * Bit string stored ff0000000000
- */
- numBytes = 6;
- bitsUnused = 3;
- controlRSet->frequencyDomainResources.size = numBytes * sizeof(uint8_t);
+ idx = 0;
+ schReqList->list.array[idx]->schedulingRequestId = SCH_REQ_ID;
- controlRSet->frequencyDomainResources.buf = NULLP;
- DU_ALLOC(controlRSet->frequencyDomainResources.buf, \
- controlRSet->frequencyDomainResources.size);
- if(!controlRSet->frequencyDomainResources.buf)
+ 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("\nF1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ 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;
+ schedulingRequestConfig->schedulingRequestToReleaseList = NULLP;
- memset(controlRSet->frequencyDomainResources.buf, 0, FREQ_DOM_RSRC_SIZE);
- coreset0EndPrb = CORESET0_END_PRB;
- coreset1StartPrb = coreset0EndPrb + 6;
- coreset1NumPrb = CORESET1_NUM_PRB;
- /* calculate the PRBs */
- freqDomRscAllocType0(((coreset1StartPrb)/6), (coreset1NumPrb/6), freqDomainResource);
- memcpy(controlRSet->frequencyDomainResources.buf, freqDomainResource, FREQ_DOM_RSRC_SIZE);
- controlRSet->frequencyDomainResources.bits_unused = bitsUnused;
+ return ROK;
+}
- controlRSet->duration = PDCCH_CTRL_RSRC_SET_ONE_DURATION;
- controlRSet->cce_REG_MappingType.present = \
- ControlResourceSet__cce_REG_MappingType_PR_nonInterleaved;
+/*******************************************************************
+ *
+ * @brief Builds RLC Config
+ *
+ * @details
+ *
+ * Function : BuildRlcConfig
+ *
+ * Functionality: Builds RLC Config in BuildRlcBearerToAddModList
+ *
+ * @params[in] RLC_Config *rlcConfig
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildRlcConfig(struct RLC_Config *rlcConfig)
+{
- 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;
+ rlcConfig->present = RLC_Config_PR_am;
- DU_ALLOC(controlRset->tci_StatesPDCCH_ToAddList, \
- sizeof(struct ControlResourceSet__tci_StatesPDCCH_ToAddList));
- if(!controlRset->tci_StatesPDCCH_ToAddList)
+ rlcConfig->choice.am = NULLP;
+ DU_ALLOC(rlcConfig->choice.am, sizeof(struct RLC_Config__am));
+ if(!rlcConfig->choice.am)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfig");
return RFAILED;
}
- 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("\nF1AP : Memory allocation failed in BuildControlRSetToAddModList");
- return RFAILED;
- }
+ /* UL */
+ 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");
+ 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;
- for(tciStateIdx = 0; tciStateIdx <elementCntl; tciStateIdx++)
+ /* DL */
+ 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_ALLOC(controlRset->tci_StatesPDCCH_ToAddList->list.array[tciStateIdx], sizeof(TCI_StateId_t));
- if(!controlRset->tci_StatesPDCCH_ToAddList->list.array[tciStateIdx])
- {
- DU_LOG("\nF1AP : Memory allocation failed in BuildControlRSetToAddModList");
- return RFAILED;
- }
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcConfig");
+ 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;
- tciStateIdx = 0;
- /* TODO */
- *(controlRset->tci_StatesPDCCH_ToAddList->list.array[tciStateIdx]);
+ return ROK;
+}
- DU_ALLOC(controlRset->tci_PresentInDCI, sizeof(long));
- if(!controlRset->tci_PresentInDCI)
+/*******************************************************************
+ *
+ * @brief Builds MAC LC Config
+ *
+ * @details
+ *
+ * Function : BuildMacLCConfig
+ *
+ * Functionality: Builds MAC LC Config in BuildRlcBearerToAddModList
+ *
+ * @params[in] struct LogicalChannelConfig macLcConfig
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildMacLCConfig(struct LogicalChannelConfig *macLcConfig)
+{
+
+ macLcConfig->ul_SpecificParameters = NULLP;
+ DU_ALLOC(macLcConfig->ul_SpecificParameters, sizeof(struct LogicalChannelConfig__ul_SpecificParameters));
+ if(!macLcConfig->ul_SpecificParameters)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacLCConfig");
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)
+ macLcConfig->ul_SpecificParameters->priority = MAC_LC_PRIORITY;
+ macLcConfig->ul_SpecificParameters->prioritisedBitRate = PRIORTISIED_BIT_RATE;
+ macLcConfig->ul_SpecificParameters->bucketSizeDuration = BUCKET_SIZE_DURATION;
+ macLcConfig->ul_SpecificParameters->allowedServingCells = NULLP;
+ macLcConfig->ul_SpecificParameters->allowedSCS_List = NULLP;
+ macLcConfig->ul_SpecificParameters->maxPUSCH_Duration = NULLP;
+ macLcConfig->ul_SpecificParameters->configuredGrantType1Allowed = NULLP;
+
+ macLcConfig->ul_SpecificParameters->logicalChannelGroup = NULLP;
+ DU_ALLOC(macLcConfig->ul_SpecificParameters->logicalChannelGroup, sizeof(long));
+ if(!macLcConfig->ul_SpecificParameters->logicalChannelGroup)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacLCConfig");
return RFAILED;
}
- *(controlRSet->pdcch_DMRS_ScramblingID) = SCRAMBLING_ID;
+ *(macLcConfig->ul_SpecificParameters->logicalChannelGroup) = LC_GRP;
+
+ macLcConfig->ul_SpecificParameters->schedulingRequestID = NULLP;
+ DU_ALLOC(macLcConfig->ul_SpecificParameters->schedulingRequestID, sizeof(SchedulingRequestId_t));
+ if(!macLcConfig->ul_SpecificParameters->schedulingRequestID)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacLCConfig");
+ return RFAILED;
+ }
+ *(macLcConfig->ul_SpecificParameters->schedulingRequestID) = SCH_REQ_ID;
+
+ macLcConfig->ul_SpecificParameters->logicalChannelSR_Mask = false;
+ macLcConfig->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = false;
+ macLcConfig->ul_SpecificParameters->bitRateQueryProhibitTimer = NULLP;
return ROK;
-} /* End BuildControlRSetToAddModList */
+}
/*******************************************************************
*
- * @brief Build search space to add/modify list
+ * @brief Builds RLC Bearer to Add/Mod list
*
* @details
*
- * Function : BuildSearchSpcToAddModList
+ * Function :BuildRlcBearerToAddModList
*
- * Functionality: Build search space to add/modify list
+ * Functionality: Builds RLC Bearer to Add/Mod list in DuToCuRrcContainer
+ *
+ * @params[in] rlc_BearerToAddModList
*
- * @params[in]
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
- uint8_t BuildSearchSpcToAddModList
-(
- struct PDCCH_Config__searchSpacesToAddModList *searchSpcList
- )
+uint8_t BuildRlcBearerToAddModList(struct CellGroupConfigRrc__rlc_BearerToAddModList *rlcBearerList)
{
- uint8_t idx;
- uint8_t numBytes;
- uint8_t byteIdx;
- uint8_t bitsUnused;
- uint8_t elementCnt;
- struct SearchSpace *searchSpc;
+ uint8_t idx, elementCnt;
elementCnt = 1;
- searchSpcList->list.count = elementCnt;
- searchSpcList->list.size = elementCnt * sizeof(struct SearchSpace *);
+ rlcBearerList->list.count = elementCnt;
+ rlcBearerList->list.size = elementCnt * sizeof(struct RLC_BearerConfig *);
- searchSpcList->list.array = NULLP;
- DU_ALLOC(searchSpcList->list.array, searchSpcList->list.size);
- if(!searchSpcList->list.array)
+ rlcBearerList->list.array = NULLP;
+ DU_ALLOC(rlcBearerList->list.array, rlcBearerList->list.size);
+ if(!rlcBearerList->list.array)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList");
return RFAILED;
}
- for(idx = 0; idx < elementCnt; idx++)
+ for(idx=0; idx<rlcBearerList->list.count; idx++)
{
- searchSpcList->list.array[idx] = NULLP;
- DU_ALLOC(searchSpcList->list.array[idx], sizeof(struct SearchSpace));
- if(!searchSpcList->list.array[idx])
+ rlcBearerList->list.array[idx] = NULLP;
+ DU_ALLOC(rlcBearerList->list.array[idx], sizeof(struct RLC_BearerConfig));
+ if(!rlcBearerList->list.array[idx])
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildRlcBearerToAddModList");
return RFAILED;
}
}
idx = 0;
- searchSpc = searchSpcList->list.array[idx];
-
- searchSpc->searchSpaceId = PDCCH_SRCH_SPC_TWO_ID;
+ rlcBearerList->list.array[idx]->logicalChannelIdentity = SRB1_LCID;
- searchSpc->controlResourceSetId = NULLP;
- DU_ALLOC(searchSpc->controlResourceSetId, sizeof(ControlResourceSetId_t));
- if(!searchSpc->controlResourceSetId)
+ 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]->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(rlcBearerList->list.array[idx]->rlc_Config) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildRlcConfig failed");
+ return RFAILED;
+ }
+
+ 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(rlcBearerList->list.array[idx]->mac_LogicalChannelConfig) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildMacLCConfig failed");
+ return RFAILED;
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Build Control resource set to add/modify list
+ *
+ * @details
+ *
+ * Function : BuildControlRSetToAddModList
+ *
+ * Functionality: Build Control resource set to add/modify list
+ *
+ * @params[in]
+ * struct PDCCH_Config__controlResourceSetToAddModList *controlRSetList
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+ uint8_t BuildControlRSetToAddModList
+(
+ struct PDCCH_Config__controlResourceSetToAddModList *controlRSetList
+ )
+{
+ uint8_t idx;
+ uint8_t elementCnt;
+ uint8_t numBytes, bitsUnused;
+ struct ControlResourceSet *controlRSet;
+ uint8_t freqDomainResource[FREQ_DOM_RSRC_SIZE] = {0};
+ uint8_t coreset0EndPrb, coreset1StartPrb, coreset1NumPrb;
+
+
+ elementCnt = 1;
+ controlRSetList->list.count = elementCnt;
+ controlRSetList->list.size = \
+ elementCnt * sizeof(struct ControlResourceSet *);
+
+ controlRSetList->list.array = NULLP;
+ DU_ALLOC(controlRSetList->list.array, controlRSetList->list.size);
+ if(!controlRSetList->list.array)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildControlRSetToAddModList");
+ return RFAILED;
+ }
+
+ for(idx = 0; idx < elementCnt; idx++)
+ {
+ controlRSetList->list.array[idx] = NULLP;
+ 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;
+ }
+ }
+
+ idx=0;
+ controlRSet = controlRSetList->list.array[idx];
+
+ controlRSet->controlResourceSetId = PDCCH_CTRL_RSRC_SET_ONE_ID;
+
+ /* 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;
+ }
+
+ memset(controlRSet->frequencyDomainResources.buf, 0, FREQ_DOM_RSRC_SIZE);
+ coreset0EndPrb = CORESET0_END_PRB;
+ coreset1StartPrb = coreset0EndPrb + 6;
+ coreset1NumPrb = CORESET1_NUM_PRB;
+ /* calculate the PRBs */
+ freqDomRscAllocType0(((coreset1StartPrb)/6), (coreset1NumPrb/6), freqDomainResource);
+ memcpy(controlRSet->frequencyDomainResources.buf, freqDomainResource, FREQ_DOM_RSRC_SIZE);
+ controlRSet->frequencyDomainResources.bits_unused = bitsUnused;
+
+ 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;
+ controlRSet->tci_StatesPDCCH_ToAddList = NULLP;
+ controlRSet->tci_StatesPDCCH_ToReleaseList = NULLP;
+ controlRSet->tci_PresentInDCI = NULLP;
+#if 0
+ uint8_t tciStateIdx;
+
+ 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;
+ }
+
+ 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_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]);
+
+ 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) = SCRAMBLING_ID;
+
+ return ROK;
+} /* End BuildControlRSetToAddModList */
+
+/*******************************************************************
+ *
+ * @brief Build search space to add/modify list
+ *
+ * @details
+ *
+ * Function : BuildSearchSpcToAddModList
+ *
+ * Functionality: Build search space to add/modify list
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+ uint8_t BuildSearchSpcToAddModList
+(
+ struct PDCCH_Config__searchSpacesToAddModList *searchSpcList
+ )
+{
+ uint8_t idx;
+ uint8_t numBytes;
+ uint8_t byteIdx;
+ uint8_t bitsUnused;
+ uint8_t elementCnt;
+ struct SearchSpace *searchSpc;
+
+ elementCnt = 1;
+ searchSpcList->list.count = elementCnt;
+ searchSpcList->list.size = elementCnt * sizeof(struct SearchSpace *);
+
+ searchSpcList->list.array = NULLP;
+ DU_ALLOC(searchSpcList->list.array, searchSpcList->list.size);
+ if(!searchSpcList->list.array)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ return RFAILED;
+ }
+
+ for(idx = 0; idx < elementCnt; idx++)
+ {
+ searchSpcList->list.array[idx] = NULLP;
+ 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;
+ }
+ }
+
+ 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("\nF1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
return RFAILED;
}
*(searchSpc->controlResourceSetId) = PDCCH_CTRL_RSRC_SET_ONE_ID;
sizeof(struct SearchSpace__monitoringSlotPeriodicityAndOffset));
if(!searchSpc->monitoringSlotPeriodicityAndOffset)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
return RFAILED;
}
searchSpc->monitoringSlotPeriodicityAndOffset->present = \
DU_ALLOC(searchSpc->monitoringSymbolsWithinSlot, sizeof(BIT_STRING_t));
if(!searchSpc->monitoringSymbolsWithinSlot)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
return RFAILED;
}
searchSpc->monitoringSymbolsWithinSlot->size);
if(!searchSpc->monitoringSymbolsWithinSlot->buf)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
return RFAILED;
}
DU_ALLOC(searchSpc->nrofCandidates, sizeof(struct SearchSpace__nrofCandidates));
if(!searchSpc->nrofCandidates)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
return RFAILED;
}
DU_ALLOC(searchSpc->searchSpaceType, sizeof(struct SearchSpace__searchSpaceType));
if(!searchSpc->searchSpaceType)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
return RFAILED;
}
sizeof(struct SearchSpace__searchSpaceType__ue_Specific));
if(!searchSpc->searchSpaceType->choice.ue_Specific)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildSearchSpcToAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSearchSpcToAddModList");
return RFAILED;
}
searchSpc->searchSpaceType->choice.ue_Specific->dci_Formats = \
sizeof(struct PDCCH_Config__controlResourceSetToAddModList));
if(!pdcchCfg->controlResourceSetToAddModList)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildBWPDlDedPdcchCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPDlDedPdcchCfg");
return RFAILED;
}
sizeof(struct PDCCH_Config__searchSpacesToAddModList));
if(!pdcchCfg->searchSpacesToAddModList)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildBWPDlDedPdcchCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPDlDedPdcchCfg");
return RFAILED;
}
DU_ALLOC(dmrsDlCfg->choice.setup, sizeof(struct DMRS_DownlinkConfig));
if(!dmrsDlCfg->choice.setup)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
return RFAILED;
}
DU_ALLOC(dmrsDlCfg->choice.setup->dmrs_AdditionalPosition, sizeof(long));
if(!dmrsDlCfg->choice.setup->dmrs_AdditionalPosition)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildDMRSDLPdschMapTypeA");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDMRSDLPdschMapTypeA");
return RFAILED;
}
*(dmrsDlCfg->choice.setup->dmrs_AdditionalPosition) = DMRS_ADDITIONAL_POS;
sizeof(struct PDSCH_TimeDomainResourceAllocationList));
if(!timeDomAllocList->choice.setup)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
return RFAILED;
}
timeDomAllocList->choice.setup->list.size);
if(!timeDomAllocList->choice.setup->list.array)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
return RFAILED;
}
sizeof(struct PDSCH_TimeDomainResourceAllocation));
if(!timeDomAllocList->choice.setup->list.array[idx])
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
return RFAILED;
}
}
sizeof(struct PDSCH_Config__prb_BundlingType__staticBundling));
if(!prbBndlType->choice.staticBundling)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildPdschPrbBundlingType");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschPrbBundlingType");
return RFAILED;
}
prbBndlType->choice.staticBundling->bundleSize = NULLP;
sizeof(struct PDSCH_Config__dmrs_DownlinkForPDSCH_MappingTypeA));
if(!pdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
return RFAILED;
}
DU_ALLOC(pdschCfg->tci_StatesToAddModList, sizeof(struct PDSCH_Config__tci_StatesToAddModList));
if(!pdschCfg->tci_StatesToAddModList)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
return RFAILED;
}
if(BuildTCIStatesToAddModList(pdschCfg->tci_StatesToAddModList) != ROK)
sizeof(struct PDSCH_Config__pdsch_TimeDomainAllocationList));
if(!pdschCfg->pdsch_TimeDomainAllocationList)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
return RFAILED;
}
DU_ALLOC(pdschCfg->maxNrofCodeWordsScheduledByDCI, sizeof(long));
if(!pdschCfg->maxNrofCodeWordsScheduledByDCI)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPDlDedPdschCfg");
return RFAILED;
}
*(pdschCfg->maxNrofCodeWordsScheduledByDCI) = PDSCH_MAX_CODEWORD_SCH_BY_DCI;
DU_ALLOC(dlBwp->pdcch_Config, sizeof(struct BWP_DownlinkDedicated__pdcch_Config));
if(!dlBwp->pdcch_Config)
{
- DU_LOG("\nF1AP : Memory Allocation failure in BuildInitialDlBWP");
+ DU_LOG("\nERROR --> F1AP : Memory Allocation failure in BuildInitialDlBWP");
return RFAILED;
}
dlBwp->pdcch_Config->present = BWP_DownlinkDedicated__pdcch_Config_PR_setup;
DU_ALLOC(dlBwp->pdcch_Config->choice.setup, sizeof(struct PDCCH_Config));
if(!dlBwp->pdcch_Config->choice.setup)
{
- DU_LOG("\nF1AP : Memory Allocation failure in BuildInitialDlBWP");
+ DU_LOG("\nERROR --> F1AP : Memory Allocation failure in BuildInitialDlBWP");
return RFAILED;
}
if(BuildBWPDlDedPdcchCfg(dlBwp->pdcch_Config->choice.setup) != ROK)
DU_ALLOC(dlBwp->pdsch_Config, sizeof(struct BWP_DownlinkDedicated__pdsch_Config));
if(!dlBwp->pdsch_Config)
{
- DU_LOG("\nF1AP : Memory Allocation failure in BuildInitialDlBWP");
+ DU_LOG("\nERROR --> F1AP : Memory Allocation failure in BuildInitialDlBWP");
return RFAILED;
}
dlBwp->pdsch_Config->present = BWP_DownlinkDedicated__pdsch_Config_PR_setup;
DU_ALLOC(dlBwp->pdsch_Config->choice.setup, sizeof(struct PDSCH_Config));
if(!dlBwp->pdsch_Config->choice.setup)
{
- DU_LOG("\nF1AP : Memory Allocation failure in BuildInitialDlBWP");
+ DU_LOG("\nERROR --> F1AP : Memory Allocation failure in BuildInitialDlBWP");
return RFAILED;
}
DU_ALLOC(dmrsUlCfg->choice.setup, sizeof(DMRS_UplinkConfig_t));
if(!dmrsUlCfg->choice.setup)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildDMRSULPuschMapTypeA");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDMRSULPuschMapTypeA");
return RFAILED;
}
DU_ALLOC(dmrsUlCfg->choice.setup->dmrs_AdditionalPosition, sizeof(long));
if(!dmrsUlCfg->choice.setup->dmrs_AdditionalPosition)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildDMRSULPuschMapTypeA");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDMRSULPuschMapTypeA");
return RFAILED;
}
*(dmrsUlCfg->choice.setup->dmrs_AdditionalPosition) = DMRS_ADDITIONAL_POS;
sizeof(struct DMRS_UplinkConfig__transformPrecodingDisabled));
if(!dmrsUlCfg->choice.setup->transformPrecodingDisabled)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildDMRSULPuschMapTypeA");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDMRSULPuschMapTypeA");
return RFAILED;
}
sizeof(long));
if(!dmrsUlCfg->choice.setup->transformPrecodingDisabled->scramblingID0)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildDMRSULPuschMapTypeA");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDMRSULPuschMapTypeA");
return RFAILED;
}
*(dmrsUlCfg->choice.setup->transformPrecodingDisabled->scramblingID0) = SCRAMBLING_ID;
sizeof(struct PUSCH_TimeDomainResourceAllocationList));
if(!timeDomAllocList->choice.setup)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
return RFAILED;
}
timeDomAllocList->choice.setup->list.size);
if(!timeDomAllocList->choice.setup->list.array)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
return RFAILED;
}
sizeof(PUSCH_TimeDomainResourceAllocation_t));
if(!timeDomAllocList->choice.setup->list.array[idx])
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
return RFAILED;
}
}
DU_ALLOC(timeDomAlloc->k2, sizeof(long));
if(!timeDomAlloc->k2)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
return RFAILED;
}
*(timeDomAlloc->k2) = PUSCH_K2;
DU_ALLOC(puschCfg->dataScramblingIdentityPUSCH, sizeof(long));
if(!puschCfg->dataScramblingIdentityPUSCH)
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildBWPUlDedPuschCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPuschCfg");
return RFAILED;
}
*(puschCfg->dataScramblingIdentityPUSCH) = SCRAMBLING_ID;
sizeof(struct PUSCH_Config__dmrs_UplinkForPUSCH_MappingTypeA));
if(!puschCfg->dmrs_UplinkForPUSCH_MappingTypeA)
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildBWPUlDedPuschCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPuschCfg");
return RFAILED;
}
sizeof(struct PUSCH_Config__pusch_TimeDomainAllocationList));
if(!puschCfg->pusch_TimeDomainAllocationList)
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildBWPUlDedPuschCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPuschCfg");
return RFAILED;
}
DU_ALLOC(puschCfg->transformPrecoder, sizeof(long));
if(!puschCfg->transformPrecoder)
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildBWPUlDedPuschCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedPuschCfg");
return RFAILED;
}
*(puschCfg->transformPrecoder) = PUSCH_TRANSFORM_PRECODER;
DU_ALLOC(resourceList->list.array, resourceList->list.size);
if(!resourceList->list.array)
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildSrsRsrcAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcAddModList");
return RFAILED;
}
DU_ALLOC(resourceList->list.array[rsrcIdx], sizeof(SRS_Resource_t));
if(!resourceList->list.array[rsrcIdx])
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildSrsRsrcAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcAddModList");
return RFAILED;
}
}
sizeof(struct SRS_Resource__transmissionComb__n2));
if(!resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2)
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildSrsRsrcAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcAddModList");
return RFAILED;
}
resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2->combOffset_n2\
sizeof(struct SRS_Resource__resourceType__aperiodic));
if(!resourceList->list.array[rsrcIdx]->resourceType.choice.aperiodic)
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildSrsRsrcAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcAddModList");
return RFAILED;
}
resourceList->list.array[rsrcIdx]->sequenceId = SRS_SEQ_ID;
DU_ALLOC(rsrcSetList->list.array, rsrcSetList->list.size);
if(!rsrcSetList->list.array)
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildSrsRsrcSetAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
return RFAILED;
}
DU_ALLOC(rsrcSetList->list.array[rSetIdx], sizeof(SRS_ResourceSet_t));
if(!rsrcSetList->list.array[rSetIdx])
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildSrsRsrcSetAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
return RFAILED;
}
}
sizeof(struct SRS_ResourceSet__srs_ResourceIdList));
if(!rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList)
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildSrsRsrcSetAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
return RFAILED;
}
DU_ALLOC(rsrcIdList->list.array, rsrcIdList->list.size);
if(!rsrcIdList->list.array)
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildSrsRsrcSetAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
return RFAILED;
}
DU_ALLOC(rsrcIdList->list.array[rsrcIdx], sizeof(SRS_ResourceId_t));
if(!rsrcIdList->list.array[rsrcIdx])
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildSrsRsrcSetAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
return RFAILED;
}
}
sizeof(struct SRS_ResourceSet__resourceType__aperiodic));
if(!rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic)
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildSrsRsrcSetAddModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildSrsRsrcSetAddModList");
return RFAILED;
}
rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger \
sizeof(struct SRS_Config__srs_ResourceSetToAddModList));
if(!srsCfg->srs_ResourceSetToAddModList)
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildBWPUlDedSrsCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedSrsCfg");
return RFAILED;
}
if(BuildSrsRsrcSetAddModList(srsCfg->srs_ResourceSetToAddModList) != ROK)
sizeof(struct SRS_Config__srs_ResourceToAddModList));
if(!srsCfg->srs_ResourceToAddModList)
{
- DU_LOG("\nF1AP: Memory allocation failed in BuildBWPUlDedSrsCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildBWPUlDedSrsCfg");
return RFAILED;
}
return ROK;
}
+
+
/*******************************************************************
*
- * @brief Builds inital UL BWP
+ * @brief Builds Pusch Serving cell Config
*
* @details
*
- * Function : BuildInitialUlBWP
+ * Function : BuildPuschSrvCellCfg
*
- * Functionality: Builds initial UL BWP
+ * Functionality: Builds Pusch Serving cell Config
+ *
+ * @params[in] struct UplinkConfig__pusch_ServingCellConfig *puschCfg
*
- * @params[in] BWP_UplinkDedicated_t *ulBwp
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildInitialUlBWP(BWP_UplinkDedicated_t *ulBwp)
+uint8_t BuildPuschSrvCellCfg(struct UplinkConfig__pusch_ServingCellConfig *puschCfg)
{
- ulBwp->pucch_Config = NULLP;
-
- /* 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("\nF1AP : 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)
+ 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("\nF1AP : Memory allocation failed in BuildInitialUlBWP");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschSrvCellCfg");
return RFAILED;
}
- if(BuildBWPUlDedPuschCfg(ulBwp->pusch_Config->choice.setup) != ROK)
+ 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;
}
- 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)
+ 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("\nF1AP : Memory allocation failed in BuildInitialUlBWP");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschSrvCellCfg");
return RFAILED;
}
+ *(puschCfg->choice.setup->ext1->maxMIMO_Layers) = PUSCH_MAX_MIMO_LAYERS;
- 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)
+ puschCfg->choice.setup->ext1->processingType2Enabled= NULLP;
+ DU_ALLOC(puschCfg->choice.setup->ext1->processingType2Enabled,sizeof(BOOLEAN_t));
+ if(!puschCfg->choice.setup->ext1->processingType2Enabled)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildInitialUlBWP");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPuschSrvCellCfg");
return RFAILED;
}
-
- if(BuildBWPUlDedSrsCfg(ulBwp->srs_Config->choice.setup) != ROK)
- {
- return RFAILED;
- }
-
- ulBwp->beamFailureRecoveryConfig = NULLP;
-
+ *(puschCfg->choice.setup->ext1->processingType2Enabled) = PUSCH_PROCESS_TYPE2_ENABLED;
return ROK;
}
/*******************************************************************
*
- * @brief Builds Pusch Serving cell Config
+ * @brief Builds inital UL BWP
*
* @details
*
- * Function : BuildPuschSrvCellCfg
- *
- * Functionality: Builds Pusch Serving cell Config
+ * Function : BuildInitialUlBWP
*
- * @params[in] struct UplinkConfig__pusch_ServingCellConfig *puschCfg
+ * Functionality: Builds initial UL BWP
*
+ * @params[in] BWP_UplinkDedicated_t *ulBwp
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildPuschSrvCellCfg(struct UplinkConfig__pusch_ServingCellConfig *puschCfg)
+uint8_t BuildInitialUlBWP(BWP_UplinkDedicated_t *ulBwp)
{
- puschCfg->present = UplinkConfig__pusch_ServingCellConfig_PR_setup;
- puschCfg->choice.setup = NULLP;
- DU_ALLOC(puschCfg->choice.setup, sizeof(struct PUSCH_ServingCellConfig));
- if(!puschCfg->choice.setup)
+ ulBwp->pucch_Config = NULLP;
+
+ /* 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("\nF1AP : Memory allocation failed in BuildPuschSrvCellCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
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)
+ 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("\nF1AP : Memory allocation failed in BuildPuschSrvCellCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
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)
+ if(BuildBWPUlDedPuschCfg(ulBwp->pusch_Config->choice.setup) != ROK)
{
- DU_LOG("\nF1AP : 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)
+ 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("\nF1AP : Memory allocation failed in BuildPuschSrvCellCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildInitialUlBWP");
return RFAILED;
}
- *(puschCfg->choice.setup->ext1->processingType2Enabled) = PUSCH_PROCESS_TYPE2_ENABLED;
+
+ 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;
}
DU_ALLOC(ulCfg->initialUplinkBWP, sizeof(BWP_UplinkDedicated_t));
if(!ulCfg->initialUplinkBWP)
{
- DU_LOG("\nF1AP : Memory Allocation failed in BuildUlCfg");
+ DU_LOG("\nERROR --> F1AP : Memory Allocation failed in BuildUlCfg");
return RFAILED;
}
DU_ALLOC(ulCfg->firstActiveUplinkBWP_Id, sizeof(BWP_Id_t));
if(!ulCfg->firstActiveUplinkBWP_Id)
{
- DU_LOG("\nF1AP : Memory Allocation failed in BuildUlCfg");
+ DU_LOG("\nERROR --> F1AP : Memory Allocation failed in BuildUlCfg");
return RFAILED;
}
*(ulCfg->firstActiveUplinkBWP_Id) = ACTIVE_UL_BWP_ID;
sizeof(struct UplinkConfig__pusch_ServingCellConfig));
if(!ulCfg->pusch_ServingCellConfig)
{
- DU_LOG("\nF1AP : Memory Allocation failed in BuildUlCfg");
+ DU_LOG("\nERROR --> F1AP : Memory Allocation failed in BuildUlCfg");
return RFAILED;
}
DU_ALLOC(pdschCfg->choice.setup, sizeof( struct PDSCH_ServingCellConfig));
if(!pdschCfg->choice.setup)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildPdschSrvCellCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschSrvCellCfg");
return RFAILED;
}
DU_ALLOC(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH, sizeof(long));
if(!pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildPdschSrvCellCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschSrvCellCfg");
return RFAILED;
}
*(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH)= PDSCH_NUM_HARQ_PROC;
DU_ALLOC(srvCellCfg->tdd_UL_DL_ConfigurationDedicated, sizeof(TDD_UL_DL_ConfigDedicated_t));
if(!srvCellCfg->tdd_UL_DL_ConfigurationDedicated)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildSpCellCfgDed");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
return RFAILED;
}
DU_ALLOC(srvCellCfg->initialDownlinkBWP, sizeof(BWP_DownlinkDedicated_t));
if(!srvCellCfg->initialDownlinkBWP)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildSpCellCfgDed");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
return RFAILED;
}
if(BuildInitialDlBWP(srvCellCfg->initialDownlinkBWP) != ROK)
{
- DU_LOG("\nF1AP : BuildInitialDlBWP failed");
+ DU_LOG("\nERROR --> F1AP : BuildInitialDlBWP failed");
return RFAILED;
}
srvCellCfg->downlinkBWP_ToReleaseList = NULLP;
DU_ALLOC(srvCellCfg->firstActiveDownlinkBWP_Id, sizeof(long));
if(!srvCellCfg->firstActiveDownlinkBWP_Id)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildSpCellCfgDed");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
return RFAILED;
}
*(srvCellCfg->firstActiveDownlinkBWP_Id) = ACTIVE_DL_BWP_ID;
DU_ALLOC(srvCellCfg->defaultDownlinkBWP_Id, sizeof(long));
if(!srvCellCfg->defaultDownlinkBWP_Id)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildSpCellCfgDed");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
return RFAILED;
}
*(srvCellCfg->defaultDownlinkBWP_Id) = ACTIVE_DL_BWP_ID;
DU_ALLOC(srvCellCfg->uplinkConfig, sizeof(UplinkConfig_t));
if(!srvCellCfg->uplinkConfig)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildSpCellCfgDed");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
return RFAILED;
}
if(BuildUlCfg(srvCellCfg->uplinkConfig) != ROK)
{
- DU_LOG("\nF1AP : BuildUlCfg failed");
+ DU_LOG("\nERROR --> F1AP : BuildUlCfg failed");
return RFAILED;
}
srvCellCfg->supplementaryUplink = NULLP;
DU_ALLOC(srvCellCfg->pdsch_ServingCellConfig, sizeof(struct ServingCellConfig__pdsch_ServingCellConfig));
if(!srvCellCfg->pdsch_ServingCellConfig)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildSpCellCfgDed");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
return RFAILED;
}
if(BuildPdschSrvCellCfg(srvCellCfg->pdsch_ServingCellConfig) != ROK)
{
- DU_LOG("\nF1AP : BuildPdschSrvCellCfg failed");
+ DU_LOG("\nERROR --> F1AP : BuildPdschSrvCellCfg failed");
return RFAILED;
}
DU_ALLOC(srvCellCfg->csi_MeasConfig, sizeof(struct ServingCellConfig__csi_MeasConfig))
if(!srvCellCfg->csi_MeasConfig)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildSpCellCfgDed");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfgDed");
return RFAILED;
}
DU_ALLOC(spCellCfg->servCellIndex, sizeof(long));
if(!spCellCfg->servCellIndex)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildSpCellCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfg");
return RFAILED;
}
*(spCellCfg->servCellIndex) = SERV_CELL_IDX;
DU_ALLOC(spCellCfg->rlmInSyncOutOfSyncThreshold, sizeof(long));
if(!spCellCfg->rlmInSyncOutOfSyncThreshold)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildSpCellCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfg");
return RFAILED;
}
*(spCellCfg->rlmInSyncOutOfSyncThreshold) = RLM_SYNC_OUT_SYNC_THRESHOLD;
DU_ALLOC(spCellCfg->spCellConfigDedicated, sizeof(ServingCellConfig_t));
if(!spCellCfg->spCellConfigDedicated)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildSpCellCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildSpCellCfg");
return RFAILED;
}
if(BuildSpCellCfgDed(spCellCfg->spCellConfigDedicated) != ROK)
{
- DU_LOG("\nF1AP : BuildSpCellCfgDed failed");
+ DU_LOG("\nERROR --> F1AP : BuildSpCellCfgDed failed");
return RFAILED;
}
return ROK;
DU_ALLOC(phyCellGrpCfg->p_NR_FR1, sizeof(long));
if(!phyCellGrpCfg->p_NR_FR1)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildPhyCellGrpCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildPhyCellGrpCfg");
return RFAILED;
}
*(phyCellGrpCfg->p_NR_FR1) = P_NR_FR1;
DU_ALLOC(macCellGrpCfg->schedulingRequestConfig, sizeof(struct SchedulingRequestConfig));
if(!macCellGrpCfg->schedulingRequestConfig)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildMacCellGrpCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacCellGrpCfg");
return RFAILED;
}
if(BuildSchedulingReqConfig(macCellGrpCfg->schedulingRequestConfig) != ROK)
{
- DU_LOG("\nF1AP : BuildSchedulingReqConfig failed");
+ DU_LOG("\nERROR --> F1AP : BuildSchedulingReqConfig failed");
return RFAILED;
}
DU_ALLOC(macCellGrpCfg->bsr_Config, sizeof(struct BSR_Config));
if(!macCellGrpCfg->bsr_Config)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildMacCellGrpCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacCellGrpCfg");
return RFAILED;
}
if(BuildBsrConfig(macCellGrpCfg->bsr_Config) != ROK)
{
- DU_LOG("\nF1AP : BuildBsrConfig failed");
+ DU_LOG("\nERROR --> F1AP : BuildBsrConfig failed");
return RFAILED;
}
DU_ALLOC(macCellGrpCfg->tag_Config, sizeof(struct TAG_Config));
if(!macCellGrpCfg->tag_Config)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildMacCellGrpCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacCellGrpCfg");
return RFAILED;
}
if(BuildTagConfig(macCellGrpCfg->tag_Config) != ROK)
{
- DU_LOG("\nF1AP : BuildTagConfig failed");
+ DU_LOG("\nERROR --> F1AP : BuildTagConfig failed");
return RFAILED;
}
DU_ALLOC(macCellGrpCfg->phr_Config, sizeof(struct MAC_CellGroupConfig__phr_Config));
if(!macCellGrpCfg->phr_Config)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildMacCellGrpCfg");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildMacCellGrpCfg");
return RFAILED;
}
if(BuildPhrConfig(macCellGrpCfg->phr_Config) != ROK)
{
- DU_LOG("\nF1AP : BuildPhrConfig failed");
+ DU_LOG("\nERROR --> F1AP : BuildPhrConfig failed");
return RFAILED;
}
*
* @return void
*
- 4221 * ****************************************************************/
+ * ****************************************************************/
void FreePuschTimeDomAllocList(PUSCH_Config_t *puschCfg)
{
uint8_t idx1=0;
* ****************************************************************/
uint8_t BuildDuToCuRrcContainer(DUtoCURRCContainer_t *duToCuRrcContainer)
{
+ uint8_t ret = ROK;
CellGroupConfigRrc_t cellGrpCfg;
asn_enc_rval_t encRetVal;
- uint8_t ret = RFAILED;
+ memset(&cellGrpCfg, 0, sizeof(CellGroupConfigRrc_t));
+ memset(&encRetVal, 0, sizeof(asn_enc_rval_t));
while(true)
{
DU_ALLOC(cellGrpCfg.rlc_BearerToAddModList, sizeof(struct CellGroupConfigRrc__rlc_BearerToAddModList));
if(!cellGrpCfg.rlc_BearerToAddModList)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildDuToCuRrcContainer");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDuToCuRrcContainer");
+ ret = RFAILED;
break;
}
if(BuildRlcBearerToAddModList(cellGrpCfg.rlc_BearerToAddModList) != ROK)
{
- DU_LOG("\nF1AP : BuildRlcBearerToAddModList failed");
+ DU_LOG("\nERROR --> F1AP : BuildRlcBearerToAddModList failed");
+ ret = RFAILED;
break;
}
DU_ALLOC(cellGrpCfg.mac_CellGroupConfig, sizeof(MAC_CellGroupConfig_t));
if(!cellGrpCfg.mac_CellGroupConfig)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildDuToCuRrcContainer");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDuToCuRrcContainer");
+ ret = RFAILED;
break;
}
if(BuildMacCellGrpCfg(cellGrpCfg.mac_CellGroupConfig) != ROK)
{
- DU_LOG("\nF1AP : BuildMacCellGrpCfg failed");
+ DU_LOG("\nERROR --> F1AP : BuildMacCellGrpCfg failed");
+ ret = RFAILED;
break;
}
-
cellGrpCfg.physicalCellGroupConfig = NULLP;
DU_ALLOC(cellGrpCfg.physicalCellGroupConfig, sizeof(PhysicalCellGroupConfig_t));
if(!cellGrpCfg.physicalCellGroupConfig)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildDuToCuRrcContainer");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDuToCuRrcContainer");
+ ret = RFAILED;
break;
}
if(BuildPhyCellGrpCfg(cellGrpCfg.physicalCellGroupConfig) != ROK)
{
- DU_LOG("\nF1AP : BuildPhyCellGrpCfg failed");
+ DU_LOG("\nERROR --> F1AP : BuildPhyCellGrpCfg failed");
+ ret = RFAILED;
break;
}
DU_ALLOC(cellGrpCfg.spCellConfig, sizeof(SpCellConfig_t));
if(!cellGrpCfg.spCellConfig)
{
- DU_LOG("\nF1AP : Memory allocation failure in BuildDuToCuRrcContainer");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failure in BuildDuToCuRrcContainer");
+ ret = RFAILED;
break;
}
if(BuildSpCellCfg(cellGrpCfg.spCellConfig) != ROK)
{
- DU_LOG("\nF1AP : BuildSpCellCfg failed");
+ DU_LOG("\nERROR --> F1AP : BuildSpCellCfg failed");
+ ret = RFAILED;
break;
}
/* Encode results */
if(encRetVal.encoded == ENCODE_FAIL)
{
- DU_LOG( "\n F1AP : Could not encode DuToCuRrcContainer (at %s)\n",\
+ 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("\n F1AP : Created APER encoded buffer for DuToCuRrcContainer\n");
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for DuToCuRrcContainer\n");
for(int i=0; i< encBufSize; i++)
{
printf("%x",encBuf[i]);
DU_ALLOC(duToCuRrcContainer->buf, duToCuRrcContainer->size);
if(!duToCuRrcContainer->buf)
{
- DU_LOG("\nF1AP : Memory allocation failed in BuildDuToCuRrcContainer");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDuToCuRrcContainer");
+ ret = RFAILED;
break;
}
- memcpy(duToCuRrcContainer->buf, encBuf, duToCuRrcContainer->size);
- ret = ROK;
+ if(ret == ROK)
+ {
+ memcpy(duToCuRrcContainer->buf, encBuf, duToCuRrcContainer->size);
+ }
break;
}
FreeMemDuToCuRrcCont(&cellGrpCfg);
return ret;
}
+/*******************************************************************
+ *
+ * @brief Free memory allocated in InitialULRRCMessage
+ *
+ * @details
+ *
+ * Function : freeInitUlRrcMsgTransfer
+ *
+ * Functionality: Free memory allocated in InitialULRRCMessage
+ *
+ * @params[in]F1AP_PDU_t *f1apMsg)
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t freeInitUlRrcMsgTransfer(F1AP_PDU_t *f1apMsg)
+{
+ uint8_t ieIdx, arrIdx;
+ InitialULRRCMessageTransfer_t *initULRRCMsg=NULLP;
+
+ if(f1apMsg)
+ {
+ if(f1apMsg->choice.initiatingMessage)
+ {
+ initULRRCMsg = &f1apMsg->choice.initiatingMessage->value.\
+ choice.InitialULRRCMessageTransfer;
+ if(initULRRCMsg->protocolIEs.list.array)
+ {
+ for(ieIdx = 0; ieIdx < initULRRCMsg->protocolIEs.list.count; ieIdx++)
+ {
+ switch(initULRRCMsg->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_ID_id_NRCGI:
+ {
+ if(initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.NRCGI.pLMN_Identity.buf)
+ {
+ if(initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.NRCGI.nRCellIdentity.buf)
+ {
+ DU_FREE(initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.NRCGI.nRCellIdentity.buf,\
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.NRCGI.nRCellIdentity.size);
+ }
+ DU_FREE(initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.NRCGI.pLMN_Identity.buf,\
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.NRCGI.pLMN_Identity.size);
+ }
+ break;
+ }
+ case ProtocolIE_ID_id_RRCContainer:
+ {
+ if(initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf)
+ {
+ DU_FREE(initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf,\
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size);
+ }
+ break;
+ }
+ case ProtocolIE_ID_id_DUtoCURRCContainer:
+ {
+ if(initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.DUtoCURRCContainer.buf)
+ {
+ DU_FREE(initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.DUtoCURRCContainer.buf,
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.DUtoCURRCContainer.size);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ for(arrIdx = 0; arrIdx < ieIdx; arrIdx++)
+ {
+ if(initULRRCMsg->protocolIEs.list.array[arrIdx])
+ {
+ DU_FREE(initULRRCMsg->protocolIEs.list.array[arrIdx],\
+ sizeof(InitialULRRCMessageTransferIEs_t));
+ }
+ }
+ DU_FREE(initULRRCMsg->protocolIEs.list.array, initULRRCMsg->protocolIEs.list.size);
+ }
+ DU_FREE(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
+ }
+ DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP : Recevied F1ap Pdu is null at freeInitUlRrcMsgTransfer()");
+ return RFAILED;
+ }
+ return ROK;
+}
+
/*******************************************************************
*
* @brief Builds and sends the InitialULRRCMessage
{
uint8_t ret;
uint8_t elementCnt;
- uint8_t ieId;
- uint8_t idx;
- uint8_t idx1;
+ uint8_t ieIdx;
+ asn_enc_rval_t encRetVal;
F1AP_PDU_t *f1apMsg = NULLP;
- InitialULRRCMessageTransfer_t *initULRRCMsg=NULLP;
- asn_enc_rval_t encRetVal;
- bool checkvar=false;
+ InitialULRRCMessageTransfer_t *initULRRCMsg = NULLP;
+ memset(&encRetVal, 0, sizeof(asn_enc_rval_t));
+
while(true)
{
- DU_LOG("\n F1AP : Building RRC Setup Request\n");
+ DU_LOG("\n INFO --> F1AP : Building RRC Setup Request\n");
DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
if(f1apMsg == NULLP)
{
- DU_LOG(" F1AP : Memory allocation for F1AP-PDU failed");
+ DU_LOG(" ERROR --> F1AP : Memory allocation for F1AP-PDU failed");
break;
}
f1apMsg->present = F1AP_PDU_PR_initiatingMessage;
DU_ALLOC(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
if(f1apMsg->choice.initiatingMessage == NULLP)
{
- DU_LOG(" F1AP : Memory allocation for F1AP-PDU failed");
+ DU_LOG(" ERROR --> F1AP : Memory allocation for F1AP-PDU failed");
break;
}
f1apMsg->choice.initiatingMessage->procedureCode =\
DU_ALLOC(initULRRCMsg->protocolIEs.list.array,initULRRCMsg->protocolIEs.list.size);
if(initULRRCMsg->protocolIEs.list.array == NULLP)
{
- DU_LOG(" F1AP : Memory allocation for\
+ DU_LOG(" ERROR --> F1AP : Memory allocation for\
RRCSetupRequestMessageTransferIEs failed");
break;
}
- for(idx=0; idx<elementCnt; idx++)
+ for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
{
- DU_ALLOC(initULRRCMsg->protocolIEs.list.array[idx],\
+ DU_ALLOC(initULRRCMsg->protocolIEs.list.array[ieIdx],\
sizeof(InitialULRRCMessageTransferIEs_t));
- if(initULRRCMsg->protocolIEs.list.array[idx] == NULLP)
+ if(initULRRCMsg->protocolIEs.list.array[ieIdx] == NULLP)
{
break;
}
}
- idx1 = 0;
+ ieIdx = 0;
/*GNB DU UE F1AP ID*/
- initULRRCMsg->protocolIEs.list.array[idx1]->id = \
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->id = \
ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
- initULRRCMsg->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
- initULRRCMsg->protocolIEs.list.array[idx1]->value.present = \
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.present = \
InitialULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
- initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.GNB_DU_UE_F1AP_ID = gnbDuUeF1apId;
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID = gnbDuUeF1apId;
/*NRCGI*/
- idx1++;
- initULRRCMsg->protocolIEs.list.array[idx1]->id = \
+ ieIdx++;
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->id = \
ProtocolIE_ID_id_NRCGI;
- initULRRCMsg->protocolIEs.list.array[idx1]->criticality =Criticality_reject;
- initULRRCMsg->protocolIEs.list.array[idx1]->value.present = \
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->criticality =Criticality_reject;
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.present = \
InitialULRRCMessageTransferIEs__value_PR_NRCGI;
ret =\
- BuildNrcgi(&initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.NRCGI);
+ BuildNrcgi(&initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.NRCGI);
if(ret!=ROK)
{
break;
}
/*CRNTI*/
- idx1++;
- initULRRCMsg->protocolIEs.list.array[idx1]->id = \
+ ieIdx++;
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->id = \
ProtocolIE_ID_id_C_RNTI;
- initULRRCMsg->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
- initULRRCMsg->protocolIEs.list.array[idx1]->value.present =\
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.present =\
InitialULRRCMessageTransferIEs__value_PR_C_RNTI;
- initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.C_RNTI = crnti;
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.C_RNTI = crnti;
/*RRCContainer*/
- idx1++;
- initULRRCMsg->protocolIEs.list.array[idx1]->id = \
+ ieIdx++;
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->id = \
ProtocolIE_ID_id_RRCContainer;
- initULRRCMsg->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
- initULRRCMsg->protocolIEs.list.array[idx1]->value.present =\
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.present =\
InitialULRRCMessageTransferIEs__value_PR_RRCContainer;
- initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.size = rrcContSize;
- DU_ALLOC(initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf,
- initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.size)
- if(!initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf)
- {
- DU_LOG(" F1AP : Memory allocation for RRCSetupRequestMessageTransferIEs failed");
- break;
-
- }
- memcpy(initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf, rrcContainer,
- initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.size);
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size = rrcContSize;
+ DU_ALLOC(initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf,
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size)
+ if(!initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for RRCSetupRequestMessageTransferIEs failed");
+ break;
+
+ }
+ memcpy(initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf, rrcContainer,
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size);
/*DUtoCURRCContainer*/
- idx1++;
- initULRRCMsg->protocolIEs.list.array[idx1]->id = \
- ProtocolIE_ID_id_DUtoCURRCContainer;
- initULRRCMsg->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
- initULRRCMsg->protocolIEs.list.array[idx1]->value.present =\
+ ieIdx++;
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_DUtoCURRCContainer;
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ initULRRCMsg->protocolIEs.list.array[ieIdx]->value.present =\
InitialULRRCMessageTransferIEs__value_PR_DUtoCURRCContainer;
- ret = BuildDuToCuRrcContainer(&initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.DUtoCURRCContainer);
+ ret = BuildDuToCuRrcContainer(&initULRRCMsg->protocolIEs.list.array[ieIdx]->value.choice.DUtoCURRCContainer);
if(ret != ROK)
{
break;
/* Encode results */
if(encRetVal.encoded == ENCODE_FAIL)
{
- DU_LOG( "\n F1AP : Could not encode Initial UL RRC Message Transfer\
+ DU_LOG( "\nERROR --> F1AP : Could not encode Initial UL RRC Message Transfer\
structure (at %s)\n",encRetVal.failed_type ? \
encRetVal.failed_type->name : "unknown");
+ ret = RFAILED;
break;
}
else
{
- DU_LOG("\n F1AP : Created APER encoded buffer for Initial UL RRC\
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for Initial UL RRC\
Message transfer\n");
for(int i=0; i< encBufSize; i++)
{
/* Sending msg */
if(SendF1APMsg(DU_APP_MEM_REGION,DU_POOL) != ROK)
{
- DU_LOG("\n F1AP : Sending Initial UL RRC Message Transfer Failed");
+ DU_LOG("\nERROR --> F1AP : Sending Initial UL RRC Message Transfer Failed");
+ ret = RFAILED;
break;
}
- checkvar=true;
break;
}
-
- if(f1apMsg != NULLP)
- {
- if(f1apMsg->choice.initiatingMessage != NULLP)
- {
- if(initULRRCMsg->protocolIEs.list.array != NULLP)
- {
- if(idx == elementCnt)
- {
- idx1=1;
- if(initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.NRCGI.pLMN_Identity.buf!=NULLP)
- {
- if(initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.NRCGI.nRCellIdentity.buf!=NULLP)
- {
- DU_FREE(initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.NRCGI.nRCellIdentity.buf,
- initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.NRCGI.nRCellIdentity.size);
- }
- DU_FREE(initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.NRCGI.pLMN_Identity.buf,\
- initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.NRCGI.pLMN_Identity.size);
- }
-
- idx1=3;
- if(initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf)
- {
- DU_FREE(initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.buf,
- initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.RRCContainer.size)
- }
-
- idx1 = 4;
- if(initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.DUtoCURRCContainer.buf)
- {
- DU_FREE(initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.DUtoCURRCContainer.buf,
- initULRRCMsg->protocolIEs.list.array[idx1]->value.choice.DUtoCURRCContainer.size);
- }
- for(ieId=0; ieId<elementCnt; ieId++)
- {
- DU_FREE(initULRRCMsg->protocolIEs.list.array[ieId],sizeof(InitialULRRCMessageTransferIEs_t));
- }
- }
- else
- {
- for(ieId=0; ieId<idx; ieId++)
- {
- DU_FREE(initULRRCMsg->protocolIEs.list.array[ieId],sizeof(InitialULRRCMessageTransferIEs_t));
- }
- }
- DU_FREE(initULRRCMsg->protocolIEs.list.array,initULRRCMsg->protocolIEs.list.size);
- }
- DU_FREE(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
- }
- DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
- }
- if(checkvar==true)
- return ROK;
- else
- return RFAILED;
+ freeInitUlRrcMsgTransfer(f1apMsg);
+ return ret;
}/* End of BuildAndSendInitialRrcMsgTransfer*/
/***** UE SETUP REQUEST *****/
break;
}
default:
- DU_LOG("\nDU_APP: Invalid Rlc Mode %d at freeRlcLcCfg()", lcCfg->rlcMode);
+ DU_LOG("\nERROR --> DU_APP: Invalid Rlc Mode %d at freeRlcLcCfg()", lcCfg->rlcMode);
break;
}
memset(lcCfg, 0, sizeof(LcCfg));
}
memset(lcCfg, 0, sizeof(LcCfg));
}
-
/*******************************************************************
*
- * @brief Function to free DuUeCfg
+ * @brief Free UE NR Capability received in UE Context setup request
*
* @details
*
- * Function : freeDuUeCfg
+ * Function : freeAperDecodeUeNrCapability
*
- * Functionality: Function to free DuUeCfg
+ * Functionality:
+ * Free UE NR Capability received in UE Context setup request
*
- * @params[in] DuUeCfg *ueCfg
- * @return void
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
*
* ****************************************************************/
-void freeDuUeCfg(DuUeCfg *ueCfg)
+void freeAperDecodeUeNrCapability(void *ueNrCapability)
{
- uint8_t lcIdx;
+ uint8_t arrIdx =0;
+ FeatureSets_t *featureSets =NULLP;
+ UE_NR_Capability_t *ueNrCap = (UE_NR_Capability_t *)ueNrCapability;
- for(lcIdx = 0; lcIdx < ueCfg->numRlcLcs; lcIdx++)
- {
- freeRlcLcCfg(&ueCfg->rlcLcCfg[lcIdx]);
- }
- for(lcIdx = 0; lcIdx < ueCfg->numMacLcs; lcIdx++)
- {
- freeMacLcCfg(&ueCfg->macLcCfg[lcIdx]);
- }
- if(ueCfg->maxAggrBitRate)
+ if(ueNrCap->rf_Parameters.supportedBandListNR.list.array)
{
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCfg->maxAggrBitRate, sizeof(MaxAggrBitRate));
+ for(arrIdx = 0; arrIdx < ueNrCap->rf_Parameters.supportedBandListNR.list.count; arrIdx++)
+ {
+ if(ueNrCap->rf_Parameters.supportedBandListNR.list.array[arrIdx])
+ free(ueNrCap->rf_Parameters.supportedBandListNR.list.array[arrIdx]);
+ }
+ free(ueNrCap->rf_Parameters.supportedBandListNR.list.array);
}
-}
-/*******************************************************************
- *
- * @brief Function to free UecontextSetupDb
- *
- * @details
- *
- * Function : freeF1UeDb
- *
- * Functionality: Function to free UecontextSetupDb
- *
- * @params[in] UecontextSetupDb *
- * @return void
- *
- * ****************************************************************/
-
-void freeF1UeDb(UeContextSetupDb *f1UeDb)
-{
- if(f1UeDb->cellGrpCfg)
+ if(ueNrCap->featureSets)
{
- DU_FREE(f1UeDb->cellGrpCfg, sizeof(CellGroupConfigRrc_t));
- f1UeDb->cellGrpCfg = NULLP;
- }
- if(f1UeDb->rrcMsg)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, f1UeDb->rrcMsg, f1UeDb->rrcMsgLen);
- }
-
- freeDuUeCfg(&f1UeDb->duUeCfg);
- memset(f1UeDb, 0, sizeof(UeContextSetupDb));
-
+ featureSets = ueNrCap->featureSets;
+ if(featureSets->featureSetsDownlinkPerCC)
+ {
+ if(featureSets->featureSetsDownlinkPerCC->list.array)
+ {
+ for(arrIdx = 0; arrIdx < featureSets->featureSetsDownlinkPerCC->list.count; arrIdx++)
+ {
+ if(featureSets->featureSetsDownlinkPerCC->list.array[arrIdx])
+ {
+ if(featureSets->featureSetsDownlinkPerCC->list.array[arrIdx]->supportedModulationOrderDL)
+ free(featureSets->featureSetsDownlinkPerCC->list.array[arrIdx]->supportedModulationOrderDL);
+ free(featureSets->featureSetsDownlinkPerCC->list.array[arrIdx]);
+ }
+ }
+ free(featureSets->featureSetsDownlinkPerCC->list.array);
+ }
+ free(featureSets->featureSetsDownlinkPerCC);
+ }
+ if(featureSets->featureSetsUplinkPerCC)
+ {
+ if(featureSets->featureSetsUplinkPerCC->list.array)
+ {
+ for(arrIdx = 0; arrIdx < featureSets->featureSetsUplinkPerCC->list.count; arrIdx++)
+ {
+ if(featureSets->featureSetsUplinkPerCC->list.array[arrIdx])
+ {
+ if(featureSets->featureSetsUplinkPerCC->list.array[arrIdx]->supportedModulationOrderUL)
+ free(featureSets->featureSetsUplinkPerCC->list.array[arrIdx]->supportedModulationOrderUL);
+ free(featureSets->featureSetsUplinkPerCC->list.array[arrIdx]);
+ }
+ }
+ free(featureSets->featureSetsUplinkPerCC->list.array);
+ }
+ free(featureSets->featureSetsUplinkPerCC);
+ }
+ free(ueNrCap->featureSets);
+ }
}
/*******************************************************************
- *
- * @brief Function to build Am cfg Info
- *
- * @details
- *
- * Function : extractRlcAmCfg
- *
- * Functionality: Function to build Am cfg Info
- *
- * @params[in] AmBearerCfg *
- * void *
- *
- * @return ROK/RFAILED
- *
- * ****************************************************************/
+*
+* @brief Function to free PdcchSearchSpcToAddModList
+ where memory allocated by aper_decoder
+*
+* @details
+*
+* Function : freeAperDecodePdcchSearchSpcToAddModList
+*
+* Functionality: Function to free PdcchSearchSpcToAddModList
+*
+* @params[in] struct PDCCH_Config__searchSpacesToAddModList *searchSpcList
+* @return void
+*
+* ****************************************************************/
-void extractRlcAmCfg(AmBearerCfg *amCfgToSet, struct RLC_Config__am *rlcAmCfg)
+void freeAperDecodePdcchSearchSpcToAddModList(struct PDCCH_Config__searchSpacesToAddModList *searchSpcList)
{
- if(rlcAmCfg)
+ uint8_t searchSpcArrIdx=0;
+ uint8_t searchSpcArrIdx1=0;
+ struct SearchSpace *searchSpc=NULLP;
+
+
+ if(searchSpcList->list.array)
{
- /* UL AM */
- if(rlcAmCfg->dl_AM_RLC.sn_FieldLength)
+ if(searchSpcList->list.array[searchSpcArrIdx1])
{
- amCfgToSet->ulAmCfg.snLenUl = *(rlcAmCfg->dl_AM_RLC.sn_FieldLength);
- amCfgToSet->ulAmCfg.reAssemTmr = rlcAmCfg->dl_AM_RLC.t_Reassembly;
- amCfgToSet->ulAmCfg.statProhTmr = rlcAmCfg->dl_AM_RLC.t_StatusProhibit;
+ searchSpc = searchSpcList->list.array[searchSpcArrIdx1];
+ if(searchSpc->controlResourceSetId)
+ {
+ if(searchSpc->monitoringSlotPeriodicityAndOffset)
+ {
+ if(searchSpc->monitoringSymbolsWithinSlot)
+ {
+ if(searchSpc->monitoringSymbolsWithinSlot->buf)
+ {
+ if(searchSpc->nrofCandidates)
+ {
+ if(searchSpc->searchSpaceType)
+ {
+ free(searchSpc->searchSpaceType->choice.ue_Specific);
+ free(searchSpc->searchSpaceType);
+ }
+ free(searchSpc->nrofCandidates);
+ }
+ free(searchSpc->monitoringSymbolsWithinSlot->buf);
+ }
+ free(searchSpc->monitoringSymbolsWithinSlot);
+ }
+ free(searchSpc->monitoringSlotPeriodicityAndOffset);
+ }
+ free(searchSpc->controlResourceSetId);
+ }
}
-
- /* DL AM */
- if(rlcAmCfg->ul_AM_RLC.sn_FieldLength)
+ for(searchSpcArrIdx = 0; searchSpcArrIdx < searchSpcList->list.count; searchSpcArrIdx++)
{
- 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;
+ free(searchSpcList->list.array[searchSpcArrIdx]);
}
+ free(searchSpcList->list.array);
}
}
-
/*******************************************************************
- *
- * @brief Function to build Um Bi Info
- *
- * @details
- *
- * Function : extractRlcUmBiCfg
- *
- * Functionality: Function to build Um Bi Info
- *
- * @params[in] UmBiDirBearerCfg *
- * void *
- *
- * @return ROK/RFAILED
- *
- * ****************************************************************/
+*
+* @brief Function for free part for the memory allocated by aper_decoder
+*
+* @details
+*
+* Function : freeAperDecodeBWPDlDedPdcchConfig
+*
+* Functionality: Function to free BWPDlDedPdcchConfig
+*
+* @params[in]
+* @return void
+*
+* ****************************************************************/
-void extractRlcUmBiCfg(UmBiDirBearerCfg *umBiCfgToSet, struct RLC_Config__um_Bi_Directional *rlcBiCfg)
+
+void freeAperDecodeBWPDlDedPdcchConfig(BWP_DownlinkDedicated_t *dlBwp)
{
- if(rlcBiCfg)
+ uint8_t arrIdx1=0;
+ uint8_t arrIdx2=0;
+ struct PDCCH_Config *pdcchCfg=NULLP;
+ struct ControlResourceSet *controlRSet=NULLP;
+ struct PDCCH_Config__controlResourceSetToAddModList *controlRSetList=NULLP;
+
+ if(dlBwp->pdcch_Config->choice.setup)
{
- /* UL UM BI DIR Cfg */
- if(rlcBiCfg->dl_UM_RLC.sn_FieldLength)
+ pdcchCfg=dlBwp->pdcch_Config->choice.setup;
+ if(pdcchCfg->controlResourceSetToAddModList)
{
- umBiCfgToSet->ulUmCfg.snLenUlUm = *(rlcBiCfg->dl_UM_RLC.sn_FieldLength);
- umBiCfgToSet->ulUmCfg.reAssemTmr = rlcBiCfg->dl_UM_RLC.t_Reassembly;
+ controlRSetList = pdcchCfg->controlResourceSetToAddModList;
+ if(controlRSetList->list.array)
+ {
+ controlRSet = controlRSetList->list.array[arrIdx2];
+ if(controlRSet)
+ {
+ if(controlRSet->frequencyDomainResources.buf)
+ {
+ if(controlRSet->pdcch_DMRS_ScramblingID)
+ {
+ if(pdcchCfg->searchSpacesToAddModList)
+ {
+ freeAperDecodePdcchSearchSpcToAddModList(pdcchCfg->searchSpacesToAddModList);
+ free(pdcchCfg->searchSpacesToAddModList);
+ }
+ free(controlRSet->pdcch_DMRS_ScramblingID);
+ }
+ free(controlRSet->frequencyDomainResources.buf);
+ }
+ }
+ for(arrIdx1 = 0; arrIdx1 <controlRSetList->list.count; arrIdx1++)
+ {
+ free(controlRSetList->list.array[arrIdx1]);
+ }
+ free(controlRSetList->list.array);
+ }
+ free(pdcchCfg->controlResourceSetToAddModList);
}
-
- /* DL UM BI DIR Cfg */
- if(rlcBiCfg->ul_UM_RLC.sn_FieldLength)
- umBiCfgToSet->dlUmCfg.snLenDlUm = *(rlcBiCfg->ul_UM_RLC.sn_FieldLength);
+ free(dlBwp->pdcch_Config->choice.setup);
}
}
-
/*******************************************************************
- *
- * @brief Function to build Um Ul Info
- *
- * @details
- *
- * Function : extractRlcUmUlCfg
- *
- * Functionality: Function to build Um Ul Info
- *
- * @params[in] UmUniDirUlBearerCfg *
- * void *
- *
- * @return ROK/RFAILED
- *
- * ****************************************************************/
+*
+* @brief Function to free PdschTimeDomAllocationList
+* where the memory allocated by aper_decoder
+*
+* @details
+*
+* Function : freeAperDecodePdschTimeDomAllocationList
+*
+* Functionality: Function to free PdschTimeDomAllocationList
+*
+* @params[in] struct PDSCH_Config__pdsch_TimeDomainAllocationList *timeDomAllocList
+* @return void
+*
+* ****************************************************************/
-void extractRlcUmUlCfg(UmUniDirUlBearerCfg *umUlCfgToSet, struct RLC_Config__um_Uni_Directional_DL *umUlCfg)
+
+void freeAperDecodePdschTimeDomAllocationList( struct PDSCH_Config__pdsch_TimeDomainAllocationList *timeDomAllocList)
{
- if(umUlCfg)
+ uint8_t arrIdx=0;
+
+ if(timeDomAllocList->choice.setup)
{
- if(umUlCfg->dl_UM_RLC.sn_FieldLength)
+ if(timeDomAllocList->choice.setup->list.array)
{
- umUlCfgToSet->ulUmCfg.snLenUlUm = *(umUlCfg->dl_UM_RLC.sn_FieldLength);
- umUlCfgToSet->ulUmCfg.reAssemTmr = umUlCfg->dl_UM_RLC.t_Reassembly;
+ for(arrIdx = 0; arrIdx <timeDomAllocList->choice.setup->list.count ; arrIdx++)
+ {
+ free(timeDomAllocList->choice.setup->list.array[arrIdx]);
+ }
+ free(timeDomAllocList->choice.setup->list.array);
}
+ free(timeDomAllocList->choice.setup);
}
}
/*******************************************************************
- *
- * @brief Function to build Um Uni Dl Info
- *
- * @details
- *
- * Function : extractRlcUmDlCfg
- *
- * Functionality: Function to build Um Uni Dl Info
- *
- * @params[in] UmUniDirDlBearerCfg *
- * void *
- *
- * @return ROK/RFAILED
- *
- * ****************************************************************/
-void extractRlcUmDlCfg(UmUniDirDlBearerCfg *umDlCfgToSet, struct RLC_Config__um_Uni_Directional_UL *umDlCfg)
+*
+* @brief Function to free BWPDlDedPdschConfig
+* where the memory allocated by aper_decoder
+*
+* @details
+*
+* Function : freeAperDecodeBWPDlDedPdschConfig
+*
+* Functionality: Function to free BWPDlDedPdschConfig
+*
+* @params[in] BWP_DownlinkDedicated_t *dlBwp
+* @return void
+*
+* ****************************************************************/
+
+
+void freeAperDecodeBWPDlDedPdschConfig(BWP_DownlinkDedicated_t *dlBwp)
{
- if(umDlCfg)
+ struct PDSCH_Config *pdschCfg=NULLP;
+ struct PDSCH_Config__prb_BundlingType *prbBndlType=NULLP;
+ struct PDSCH_Config__pdsch_TimeDomainAllocationList *timeDomAllocList=NULLP;
+ struct PDSCH_Config__dmrs_DownlinkForPDSCH_MappingTypeA *dmrsDlCfg=NULLP;
+
+ if(dlBwp->pdsch_Config->choice.setup)
{
- if(umDlCfg->ul_UM_RLC.sn_FieldLength)
- umDlCfgToSet->dlUmCfg.snLenDlUm = *(umDlCfg->ul_UM_RLC.sn_FieldLength);
+ pdschCfg=dlBwp->pdsch_Config->choice.setup;
+ if(pdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA)
+ {
+ if(pdschCfg->pdsch_TimeDomainAllocationList)
+ {
+ timeDomAllocList=pdschCfg->pdsch_TimeDomainAllocationList;
+ if(pdschCfg->maxNrofCodeWordsScheduledByDCI)
+ {
+ prbBndlType=&pdschCfg->prb_BundlingType;
+ free(prbBndlType->choice.staticBundling);
+ free(pdschCfg->maxNrofCodeWordsScheduledByDCI);
+ }
+ freeAperDecodePdschTimeDomAllocationList(timeDomAllocList);
+ free(pdschCfg->pdsch_TimeDomainAllocationList);
+ }
+ dmrsDlCfg=pdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA;
+ if(dmrsDlCfg->choice.setup)
+ {
+ free(dmrsDlCfg->choice.setup->dmrs_AdditionalPosition);
+ free(dmrsDlCfg->choice.setup);
+ }
+ free(pdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA);
+ }
+ free(dlBwp->pdsch_Config->choice.setup);
}
}
-
/*******************************************************************
- *
- * @brief Function to extractRlcModeCfg
- *
- * @details
- *
- * Function : extractRlcModeCfg
- *
- * Functionality: Function to extractRlcModeCfg
- *
- * @params[in] RLC_Config_t *
- * RlcBearerCfg *
- * void *
- * @return ROK/RFAILED
- *
- * ****************************************************************/
-void extractRlcModeCfg(uint8_t rlcMode, RlcBearerCfg *rlcDbCfg, RLC_Config_t *lcCfg)
+*
+* @brief Function to free PuschTimeDomAllocListCfg
+ where the memory allocated by aper_decoder
+*
+* @details
+*
+* Function : freeAperDecodePuschTimeDomAllocListCfg
+*
+* Functionality: Function to free PuschTimeDomAllocListCfg
+*
+* @params[in] PUSCH_Config_t *puschCfg
+* @return void
+*
+* ****************************************************************/
+
+
+void freeAperDecodePuschTimeDomAllocListCfg(PUSCH_Config_t *puschCfg)
{
- if(lcCfg)
- {
- switch(rlcMode)
+ uint8_t arrIdx=0;
+ uint8_t arrIdx1=0;
+ struct PUSCH_Config__pusch_TimeDomainAllocationList *timeDomAllocList_t=NULLP;
+
+ if(puschCfg->pusch_TimeDomainAllocationList)
+ {
+ timeDomAllocList_t=puschCfg->pusch_TimeDomainAllocationList;
+ if(timeDomAllocList_t->choice.setup)
{
- case RLC_AM :
- {
- if(lcCfg->choice.am)
- {
- DU_ALLOC_SHRABL_BUF(rlcDbCfg->u.amCfg, sizeof(AmBearerCfg));
- if(rlcDbCfg->u.amCfg)
- extractRlcAmCfg(rlcDbCfg->u.amCfg, lcCfg->choice.am);
- }
- break;
- }
- case RLC_UM_BI_DIRECTIONAL :
- {
- if(lcCfg->choice.um_Bi_Directional)
- {
- DU_ALLOC_SHRABL_BUF(rlcDbCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
- if(rlcDbCfg->u.umBiDirCfg)
- extractRlcUmBiCfg(rlcDbCfg->u.umBiDirCfg, lcCfg->choice.um_Bi_Directional);
- }
- break;
- }
- case RLC_UM_UNI_DIRECTIONAL_UL :
- {
- if(lcCfg->choice.um_Uni_Directional_DL)
- {
- DU_ALLOC_SHRABL_BUF(rlcDbCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
- if(rlcDbCfg->u.umUniDirUlCfg)
- extractRlcUmUlCfg(rlcDbCfg->u.umUniDirUlCfg, lcCfg->choice.um_Uni_Directional_DL);
- }
- break;
- }
- case RLC_UM_UNI_DIRECTIONAL_DL :
- {
- if(lcCfg->choice.um_Uni_Directional_UL)
- {
- DU_ALLOC_SHRABL_BUF(rlcDbCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
- if(rlcDbCfg->u.umUniDirDlCfg)
- extractRlcUmDlCfg(rlcDbCfg->u.umUniDirDlCfg, lcCfg->choice.um_Uni_Directional_UL);
- }
- break;
- }
- default:
- DU_LOG("\nDUAPP: Invalid rlcMode %d at extractRlcCfgToAddMod()", rlcMode);
- break;
+ if(timeDomAllocList_t->choice.setup->list.array)
+ {
+ free(timeDomAllocList_t->choice.setup->list.array[arrIdx1]->k2);
+ for(arrIdx = 0; arrIdx<timeDomAllocList_t->choice.setup->list.count; arrIdx++)
+ {
+ free(timeDomAllocList_t->choice.setup->list.array[arrIdx]);
+ }
+ free(timeDomAllocList_t->choice.setup->list.array);
+ }
+ free(timeDomAllocList_t->choice.setup);
}
+ free(puschCfg->transformPrecoder);
+ free(puschCfg->pusch_TimeDomainAllocationList);
}
}
-
/*******************************************************************
- *
- * @brief Function to extract extractUlLcCfg
- *
- * @details
- *
- * Function : extractUlLcCfg
- *
- * Functionality: Function to extract extractUlLcCfg
- *
- * @params[in] UlLcCfg *f1UlLcCfg, LogicalChannelConfig_t *ulLcCfg
- * @return void
- *
- * ****************************************************************/
+*
+* @brief Function to free InitialUlBWPConfig where memory allocated by aper_decoder
+*
+* @details
+*
+* Function : freeAperDecodeInitialUlBWPConfig
+*
+* Functionality: Function to free InitialUlBWPConfig
+*
+* @params[in] BWP_UplinkDedicated_t *ulBwp
+* @return void
+*
+* ****************************************************************/
-void extractUlLcCfg(UlLcCfg *f1UlLcCfg, LogicalChannelConfig_t *ulLcCfg)
+
+void freeAperDecodeInitialUlBWPConfig(BWP_UplinkDedicated_t *ulBwp)
{
- if(ulLcCfg)
+ uint8_t rSetIdx =0;
+ uint8_t rsrcIdx =0;
+ SRS_Config_t *srsCfg = NULLP;
+ PUSCH_Config_t *puschCfg = 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->pusch_Config)
{
- if(ulLcCfg->ul_SpecificParameters)
- {
- f1UlLcCfg->priority = \
- ulLcCfg->ul_SpecificParameters->priority;
- if(ulLcCfg->ul_SpecificParameters->logicalChannelGroup)
+ if(ulBwp->pusch_Config->choice.setup)
{
- f1UlLcCfg->lcGroup = \
- *(ulLcCfg->ul_SpecificParameters->logicalChannelGroup);
+ puschCfg=ulBwp->pusch_Config->choice.setup;
+ if(puschCfg->dataScramblingIdentityPUSCH)
+ {
+ if(puschCfg->dmrs_UplinkForPUSCH_MappingTypeA)
+ {
+ freeAperDecodePuschTimeDomAllocListCfg(puschCfg);
+ dmrsUlCfg=puschCfg->dmrs_UplinkForPUSCH_MappingTypeA;
+ if(dmrsUlCfg->choice.setup)
+ {
+ if(dmrsUlCfg->choice.setup->dmrs_AdditionalPosition)
+ {
+ if(dmrsUlCfg->choice.setup->transformPrecodingDisabled)
+ {
+ free(dmrsUlCfg->choice.setup->transformPrecodingDisabled->scramblingID0);
+ free(dmrsUlCfg->choice.setup->transformPrecodingDisabled);
+ }
+ free(dmrsUlCfg->choice.setup->dmrs_AdditionalPosition);
+ }
+ free(dmrsUlCfg->choice.setup);
+ }
+ free(puschCfg->dmrs_UplinkForPUSCH_MappingTypeA);
+ }
+ free(puschCfg->dataScramblingIdentityPUSCH);
+ }
+ free(ulBwp->pusch_Config->choice.setup);
}
- if(ulLcCfg->ul_SpecificParameters->schedulingRequestID)
+ free(ulBwp->pusch_Config);
+
+ /* Free SRS-Config */
+ if(ulBwp->srs_Config)
{
- f1UlLcCfg->schReqId = \
- *(ulLcCfg->ul_SpecificParameters->schedulingRequestID);
- }
- f1UlLcCfg->pbr = \
- ulLcCfg->ul_SpecificParameters->prioritisedBitRate;
- f1UlLcCfg->bsd = \
- ulLcCfg->ul_SpecificParameters->bucketSizeDuration;
+ if(ulBwp->srs_Config->choice.setup)
+ {
+ srsCfg = ulBwp->srs_Config->choice.setup;
+
+ /* Free Resource Set to add/mod list */
+ if(srsCfg->srs_ResourceSetToAddModList)
+ {
+ rsrcSetList = srsCfg->srs_ResourceSetToAddModList;
+ if(rsrcSetList->list.array)
+ {
+ rSetIdx = 0;
+
+ /* Free SRS resource Id list in this SRS resource set */
+ if(rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList)
+ {
+ rsrcIdList =
+ rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList;
+
+ if(rsrcIdList->list.array)
+ {
+ for(rsrcIdx = 0; rsrcIdx < rsrcIdList->list.count;
+ rsrcIdx++)
+ {
+ free(rsrcIdList->list.array[rsrcIdx]);
+ }
+ free(rsrcIdList->list.array);
+ }
+ free(rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList);
+ }
+
+ /* Free resource type info for this SRS resource set */
+
+ free(rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic);
+
+ /* Free memory for each resource set */
+ for(rSetIdx = 0; rSetIdx < rsrcSetList->list.count; rSetIdx++)
+ {
+ free(rsrcSetList->list.array[rSetIdx]);
+ }
+ free(rsrcSetList->list.array);
+ }
+ free(srsCfg->srs_ResourceSetToAddModList);
+ }
+
+ /* Free resource to add/modd list */
+ if(srsCfg->srs_ResourceToAddModList)
+ {
+ resourceList = srsCfg->srs_ResourceToAddModList;
+ if(resourceList->list.array)
+ {
+ rsrcIdx = 0;
+
+ free(resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2);
+ free(resourceList->list.array[rsrcIdx]->resourceType.choice.aperiodic);
+
+ for(rsrcIdx = 0; rsrcIdx < resourceList->list.count; rsrcIdx++)
+ {
+ free(resourceList->list.array[rsrcIdx]);
+ }
+ free(resourceList->list.array);
+ }
+ free(srsCfg->srs_ResourceToAddModList);
+ }
+
+ free(ulBwp->srs_Config->choice.setup);
+ }
+ free(ulBwp->srs_Config);
}
}
}
-
/*******************************************************************
- *
- * @brief Function to procRlcLcCfg
- *
- * @details
- *
- * Function : procRlcLcCfg
- *
- * Functionality: Function to procRlcLcCfg
- *
- * @params[in] rbId, lcId, rbType, rlcMod
- * RLC_Config_t *, RlcBearerCfg * ,
- * @return void
- *
- * ****************************************************************/
-
-void procRlcLcCfg(uint8_t rbId, uint8_t lcId, uint8_t rbType, uint8_t rlcMode,\
- uint8_t configType, RLC_Config_t *f1RlcCfg, RlcBearerCfg *lcCfg)
-{
+*
+* @brief Function to free initialUplinkBWPConfig where memory allocated by aper_decoder
+*
+* @details
+*
+* Function : freeAperDecodeinitialUplinkBWPConfig
+*
+* Functionality: Function to free initialUplinkBWPConfig
+*
+* @params[in] UplinkConfig_t *ulCfg
+* @return void
+*
+* ****************************************************************/
- lcCfg->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;
- }
- else if(rbType == RB_TYPE_DRB)
- {
- lcCfg->rbType = RB_TYPE_DRB;
- lcCfg->lcId = lcId;
- lcCfg->lcType = LCH_DTCH;
- lcCfg->rlcMode = rlcMode;
- }
- if(f1RlcCfg) /* rlc mode config recived */
+void freeAperDecodeinitialUplinkBWPConfig(UplinkConfig_t *ulCfg)
+{
+ BWP_UplinkDedicated_t *ulBwp=NULLP;
+ struct UplinkConfig__pusch_ServingCellConfig *puschCfg=NULLP;
+
+ if(ulCfg->initialUplinkBWP)
{
- extractRlcModeCfg(lcCfg->rlcMode, lcCfg, f1RlcCfg);
+ ulBwp=ulCfg->initialUplinkBWP;
+ if(ulCfg->firstActiveUplinkBWP_Id)
+ {
+ if(ulCfg->pusch_ServingCellConfig)
+ {
+ puschCfg=ulCfg->pusch_ServingCellConfig;
+ if(puschCfg->choice.setup)
+ {
+ if(puschCfg->choice.setup->ext1)
+ {
+ free(puschCfg->choice.setup->ext1->processingType2Enabled);
+ free(puschCfg->choice.setup->ext1->maxMIMO_Layers);
+ free(puschCfg->choice.setup->ext1);
+ }
+ free(puschCfg->choice.setup);
+ }
+ free(ulCfg->pusch_ServingCellConfig);
+ }
+ free(ulCfg->firstActiveUplinkBWP_Id);
+ }
+ freeAperDecodeInitialUlBWPConfig(ulBwp);
+ free(ulCfg->initialUplinkBWP);
}
}
-
-
/*******************************************************************
*
- * @brief Fills DrbQos Info received by CU
+ * @brief Function to free DuUeCfg
*
* @details
*
- * Function : extractQosInfo
+ * Function : freeDuUeCfg
*
- * Functionality: Fills DrbQos Info received by CU
+ * Functionality: Function to free DuUeCfg
*
- * @params[in] DrbQosInfo *qosToAdd,
- * QoSFlowLevelQoSParameters_t *qosFlowCfg
+ * @params[in] DuUeCfg *ueCfg
* @return void
*
* ****************************************************************/
-
-void extractQosInfo(DrbQosInfo *qosToAdd, QoSFlowLevelQoSParameters_t *qosFlowCfg)
+void freeDuUeCfg(DuUeCfg *ueCfg)
{
- qosToAdd->fiveQiType = qosFlowCfg->qoS_Characteristics.present;
- qosToAdd->u.nonDyn5Qi.fiveQi =\
- qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->fiveQI;
- if(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow)
- {
- 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->qoSPriorityLevel)
- {
- qosToAdd->u.nonDyn5Qi.priorLevel = \
- *(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel);
- }
- qosToAdd->ngRanRetPri.priorityLevel = \
- qosFlowCfg->nGRANallocationRetentionPriority.priorityLevel;
- qosToAdd->ngRanRetPri.preEmptionCap = \
- qosFlowCfg->nGRANallocationRetentionPriority.pre_emptionCapability;
- qosToAdd->ngRanRetPri.preEmptionVul = \
- qosFlowCfg->nGRANallocationRetentionPriority.pre_emptionVulnerability;
- if(qosFlowCfg->gBR_QoS_Flow_Information)
- {
- memcpy(&qosToAdd->grbQosInfo.maxFlowBitRateDl, \
- qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateDownlink.buf, \
- qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateDownlink.size);
- memcpy(&qosToAdd->grbQosInfo.maxFlowBitRateUl, \
- qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateUplink.buf, \
- qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateUplink.size);
- memcpy(&qosToAdd->grbQosInfo.guarFlowBitRateDl,\
- qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateDownlink.buf, \
- qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateDownlink.size);
- memcpy(&qosToAdd->grbQosInfo.guarFlowBitRateUl,\
- qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateUplink.buf, \
- qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateUplink.size);
- }
- qosToAdd->pduSessionId = 0;
- qosToAdd->ulPduSessAggMaxBitRate = 0;
-}
-
-uint8_t extractDrbCfg(DRBs_ToBeSetup_Item_t *drbItem, LcCfg *macLcToAdd)
-{
- DRB_Information_t *drbInfo = NULLP;
+ uint8_t lcIdx = 0;
+ uint8_t arrIdx = 0;
+ SpCellConfig_t *spCellCfg = NULLP;
+ ServingCellConfig_t *srvCellCfg = NULLP;
+ BWP_DownlinkDedicated_t *dlBwp = NULLP;
+ MAC_CellGroupConfig_t *macCellGrpCfg = NULLP;
+ PhysicalCellGroupConfig_t *phyCellGrpCfg = NULLP;
+ struct CellGroupConfigRrc__rlc_BearerToAddModList *rlcBearerList = NULLP;
+ struct RLC_Config *rlcConfig = NULLP;
+ struct LogicalChannelConfig *macLcConfig = NULLP;
+ struct SchedulingRequestConfig *schedulingRequestConfig = NULLP;
+ struct SchedulingRequestConfig__schedulingRequestToAddModList *schReqList = NULLP;
+ struct TAG_Config *tagConfig = NULLP;
+ struct TAG_Config__tag_ToAddModList *tagList = NULLP;
+ struct MAC_CellGroupConfig__phr_Config *phrConfig = NULLP;
+ struct ServingCellConfig__pdsch_ServingCellConfig *pdschCfg = NULLP;
+ CellGroupConfigRrc_t *cellGrpCfg = ueCfg->cellGrpCfg;
+
+ if(ueCfg->ueNrCapability)
+ {
+ freeAperDecodeUeNrCapability(ueCfg->ueNrCapability);
+ DU_FREE(ueCfg->ueNrCapability, sizeof(UE_NR_Capability_t));
+ ueCfg->ueNrCapability = NULLP;
+ }
+
+ 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(drbItem->qoSInformation.present == QoSInformation_PR_choice_extension)
- {
- if(drbItem->qoSInformation.choice.choice_extension->value.present ==
- QoSInformation_ExtIEs__value_PR_DRB_Information)
+ macCellGrpCfg = cellGrpCfg->mac_CellGroupConfig;
+ if(macCellGrpCfg)
{
- drbInfo = &drbItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information;
-
- if(!macLcToAdd->drbQos)
+ schedulingRequestConfig = macCellGrpCfg->schedulingRequestConfig;
+ if(schedulingRequestConfig)
{
- DU_ALLOC_SHRABL_BUF(macLcToAdd->drbQos, sizeof(DrbQosInfo));
- if(macLcToAdd->drbQos == NULLP)
+ schReqList = schedulingRequestConfig->schedulingRequestToAddModList;
+ if(schReqList)
{
- DU_LOG("\n DUAPP:Memory failed at allocating DrbQos at extractDrbCfg()");
- return RFAILED;
+ 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(drbInfo->dRB_QoS.qoS_Characteristics.present == QoS_Characteristics_PR_non_Dynamic_5QI)
+ if(macCellGrpCfg->bsr_Config)
{
- extractQosInfo(macLcToAdd->drbQos, &drbInfo->dRB_QoS);
- macLcToAdd->dlLcCfg.lcp = macLcToAdd->drbQos->ngRanRetPri.priorityLevel;
+ free(macCellGrpCfg->bsr_Config);
}
- if(!macLcToAdd->snssai)
+ tagConfig = macCellGrpCfg->tag_Config;
+ if(tagConfig)
{
- DU_ALLOC_SHRABL_BUF(macLcToAdd->snssai, sizeof(Snssai));
- if(macLcToAdd->snssai == NULLP)
+ tagList = tagConfig->tag_ToAddModList;
+ if(tagList)
{
- DU_LOG("\n DUAPP:Memory failed at allocating SNSSAI at extractDrbCfg()");
- return RFAILED;
+ 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);
}
- memcpy(&macLcToAdd->snssai->sst, drbInfo->sNSSAI.sST.buf, \
- drbInfo->sNSSAI.sST.size);
- if(drbInfo->sNSSAI.sD)
+
+ phrConfig = macCellGrpCfg->phr_Config;
+ if(phrConfig)
{
- memcpy(macLcToAdd->snssai->sd, drbInfo->sNSSAI.sD->buf, \
- drbInfo->sNSSAI.sD->size);
+ free(phrConfig->choice.setup);
+ free(phrConfig);
}
- }/*End of DRB Info*/
- }
- return ROK;
-}
-uint8_t extractMacRbCfg(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbCfg, LogicalChannelConfig_t *ulLcCfg, LcCfg *lcCfg)
-{
- uint8_t ret = ROK;
+ free(macCellGrpCfg);
+ }
- if(drbCfg)
- {
- ret = extractDrbCfg(drbCfg, lcCfg);
- if(ret == RFAILED)
+ phyCellGrpCfg = cellGrpCfg->physicalCellGroupConfig;
+ if(phyCellGrpCfg)
+ {
+ free(phyCellGrpCfg->p_NR_FR1);
+ free(phyCellGrpCfg);
+ }
+
+ spCellCfg = cellGrpCfg->spCellConfig;
+ if(spCellCfg)
{
- DU_LOG("F1AP: Failed to build Drb Qos at extractMacRbCfg()");
- return ret;
+ 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)
+ {
+
+ free(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH);
+ free(pdschCfg->choice.setup);
+ }
+
+ free(srvCellCfg->pdsch_ServingCellConfig);
+ }
+
+ 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(spCellCfg->spCellConfigDedicated);
+ }
+ free(spCellCfg->rlmInSyncOutOfSyncThreshold);
+ }
+ free(spCellCfg->servCellIndex);
+ }
+ free(spCellCfg);
}
+ DU_FREE(ueCfg->cellGrpCfg, sizeof(CellGroupConfigRrc_t));
+ ueCfg->cellGrpCfg = NULLP;
}
- else
+ if(ueCfg->ambrCfg)
{
- lcCfg->drbQos = NULLP;
- lcCfg->snssai = NULLP;
- if(lcCfg->lcId == SRB2_LCID)
- lcCfg->dlLcCfg.lcp = LC_PRIORITY_3;
- else
- lcCfg->dlLcCfg.lcp = LC_PRIORITY_1;
+ memset(ueCfg->ambrCfg, 0, sizeof(AmbrCfg));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCfg->ambrCfg, sizeof(AmbrCfg));
}
- if(ulLcCfg)
+ for(lcIdx = 0; lcIdx < ueCfg->numRlcLcs; lcIdx++)
{
- lcCfg->ulLcCfgPres = true;
- extractUlLcCfg(&lcCfg->ulLcCfg, ulLcCfg);
+ freeRlcLcCfg(&ueCfg->rlcLcCfg[lcIdx]);
}
- else
- lcCfg->ulLcCfgPres = false;
- return ret;
-}
-
-uint8_t procMacLcCfg(uint8_t lcId, uint8_t rbType, uint8_t configType,\
- DRBs_ToBeSetup_Item_t *drbItem, LogicalChannelConfig_t *ulLcCfg, LcCfg *lcCfg)
-{
- uint8_t ret = ROK;
-
- lcCfg->lcId = lcId;
- lcCfg->configType = configType;
- if(rbType == RB_TYPE_SRB)
+ for(lcIdx = 0; lcIdx < ueCfg->numMacLcs; lcIdx++)
{
- ret = extractMacRbCfg(lcId, NULL, ulLcCfg, lcCfg);
+ freeMacLcCfg(&ueCfg->macLcCfg[lcIdx]);
}
- else if(rbType == RB_TYPE_DRB)
+ for(lcIdx = 0; lcIdx < ueCfg->numDrb; lcIdx++)
{
- ret = extractMacRbCfg(lcId, drbItem, ulLcCfg, lcCfg);
+ DU_FREE(ueCfg->upTnlInfo[lcIdx].tnlCfg1, sizeof(GtpTnlCfg));
+ memset(&ueCfg->upTnlInfo[lcIdx], 0, sizeof(UpTnlCfg));
}
- return ret;
}
/*******************************************************************
*
- * @brief Function to extract Rlc cfg To Add/Mod in CellGrp Info
+ * @brief Function to free UecontextSetupDb
*
* @details
*
- * Function : extractRlcCfgToAddMod
+ * Function : freeF1UeDb
*
- * Functionality: Function to extract Rlc cfg To Add/Mod in CellGrp Info
+ * Functionality: Function to free UecontextSetupDb
*
- * @params[in] CellGroupConfigRrc__rlc_BearerTo pointer
- * DuUeCfg Pointer
- * @return ROK/RFAILED
+ * @params[in] UecontextSetupDb *
+ * @return void
*
* ****************************************************************/
-uint8_t extractRlcCfgToAddMod(struct CellGroupConfigRrc__rlc_BearerToAddModList *lcCfg, \
- DuUeCfg *ueCfgDb)
+void freeF1UeDb(F1UeContextSetupDb *f1UeDb)
{
- uint8_t ret, idx, rbId, lcId, rlcMode, rbType;
- RLC_Config_t *f1RlcCfg = NULLP;
- LogicalChannelConfig_t *macUlLcCfg = NULLP;
-
- for(idx = 0; idx < lcCfg->list.count; idx++)
- {
- lcId = lcCfg->list.array[idx]->logicalChannelIdentity;
- if(lcCfg->list.array[idx]->servedRadioBearer)
- {
- /* RadioBearer for SRB/DRB */
- if(lcCfg->list.array[idx]->servedRadioBearer->present ==\
- RLC_BearerConfig__servedRadioBearer_PR_srb_Identity)
- {
- rbId = lcCfg->list.array[idx]->servedRadioBearer->choice.srb_Identity;
- rbType = RB_TYPE_SRB;
- }
- else if(lcCfg->list.array[idx]->servedRadioBearer->present ==\
- RLC_BearerConfig__servedRadioBearer_PR_drb_Identity)
- {
- rbId = lcCfg->list.array[idx]->servedRadioBearer->choice.drb_Identity;
- rbType = RB_TYPE_DRB;
- }
- else
- {
- DU_LOG("\n No components present in Bearer config to ADD/MOD");
- return RFAILED;
- }
- /* MAC UL LC Config */
- if(lcCfg->list.array[idx]->mac_LogicalChannelConfig)
- {
- macUlLcCfg = lcCfg->list.array[idx]->mac_LogicalChannelConfig;
- }
- }
- else
- {
- DU_LOG("\nDUAPP: Received RadioBearer config is NULL");
- return RFAILED;
- }
- /* RLC Mode Config */
- if(lcCfg->list.array[idx]->rlc_Config)
- {
- rlcMode = lcCfg->list.array[idx]->rlc_Config->present;
- f1RlcCfg = lcCfg->list.array[idx]->rlc_Config;
- }
-
- /* Filling RLC/MAC Config*/
- memset(&ueCfgDb->macLcCfg[idx], 0, sizeof(LcCfg));
- memset(&ueCfgDb->rlcLcCfg[idx], 0, sizeof(RlcBearerCfg));
- procRlcLcCfg(rbId, lcId, rbType, rlcMode, CONFIG_UNKNOWN, f1RlcCfg, &(ueCfgDb->rlcLcCfg[idx]));
- ret = procMacLcCfg(lcId, rbType, CONFIG_UNKNOWN, NULL, macUlLcCfg, &ueCfgDb->macLcCfg[idx]);
- if(ret == RFAILED)
- {
- DU_LOG("\nDUAPP: Failed while filling MAC LC config at extractRlcCfgToAddMod()");
- return ret;
- }
- (ueCfgDb->numRlcLcs)++;
- (ueCfgDb->numMacLcs)++;
- }
- //TODO: To send the failure cause in UeContextSetupRsp
- return ret;
+
+ if(f1UeDb->dlRrcMsg)
+ {
+ if(f1UeDb->dlRrcMsg->rrcMsgPdu)
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,\
+ f1UeDb->dlRrcMsg->rrcMsgPdu, f1UeDb->dlRrcMsg->rrcMsgSize);
+ }
+ memset(f1UeDb->dlRrcMsg, 0, sizeof(F1DlRrcMsg));
+ }
+ freeDuUeCfg(&f1UeDb->duUeCfg);
+ memset(f1UeDb, 0, sizeof(F1UeContextSetupDb));
+ DU_FREE(f1UeDb, sizeof(F1UeContextSetupDb));
}
/*******************************************************************
*
- * @brief DeAlloc pdsch serv cell config info
+ * @brief Function to build Am cfg Info
*
* @details
*
- * Function : freeMacPdschServCellInfo
+ * Function : extractRlcAmCfg
*
- * Functionality: DeAlloc pdsch serv cell config info
+ * Functionality: Function to build Am cfg Info
*
- * @params[in] PdschServCellCfg pointer
- * @return void
+ * @params[in] AmBearerCfg *
+ * void *
+ *
+ * @return ROK/RFAILED
*
* ****************************************************************/
-void freeMacPdschServCellInfo(PdschServCellCfg *pdsch)
+void extractRlcAmCfg(AmBearerCfg *amCfgToSet, struct RLC_Config__am *rlcAmCfg)
{
- if(pdsch->xOverhead)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->xOverhead, sizeof(uint8_t));
- }
- if(pdsch->codeBlkGrpFlushInd)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->codeBlkGrpFlushInd, sizeof(bool));
- }
- if(pdsch->maxCodeBlkGrpPerTb)
- {
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->maxCodeBlkGrpPerTb, sizeof(uint8_t));
- }
- if(pdsch->maxMimoLayers)
+ if(rlcAmCfg)
{
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->maxMimoLayers, sizeof(uint8_t));
+ /* UL AM */
+ if(rlcAmCfg->dl_AM_RLC.sn_FieldLength)
+ {
+ amCfgToSet->ulAmCfg.snLenUl = *(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;
+ }
+
+ /* 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;
+ }
}
}
/*******************************************************************
*
- * @brief Free Serving cell Info
+ * @brief Function to build Um Bi Info
*
* @details
*
- * Function : freeMacServingCellInfo
+ * Function : extractRlcUmBiCfg
*
- * Functionality: Free Serving cell Info
+ * Functionality: Function to build Um Bi Info
*
- * @params[in] ServCellCfgInfo *srvCellCfg
- * @return void
+ * @params[in] UmBiDirBearerCfg *
+ * void *
+ *
+ * @return ROK/RFAILED
*
* ****************************************************************/
-void freeMacServingCellInfo(ServCellCfgInfo *srvCellCfg)
+
+void extractRlcUmBiCfg(UmBiDirBearerCfg *umBiCfgToSet, struct RLC_Config__um_Bi_Directional *rlcBiCfg)
{
- freeMacPdschServCellInfo(&srvCellCfg->pdschServCellCfg);
- if(srvCellCfg->bwpInactivityTmr)
+ if(rlcBiCfg)
{
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, srvCellCfg->bwpInactivityTmr, sizeof(uint8_t));
+ /* 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;
+ }
+
+ /* DL UM BI DIR Cfg */
+ if(rlcBiCfg->ul_UM_RLC.sn_FieldLength)
+ umBiCfgToSet->dlUmCfg.snLenDlUm = *(rlcBiCfg->ul_UM_RLC.sn_FieldLength);
}
}
/*******************************************************************
*
- * @brief Free cell Grp Cfg Info
+ * @brief Function to build Um Ul Info
*
* @details
*
- * Function : freeUeReCfgCellGrpInfo
+ * Function : extractRlcUmUlCfg
*
- * Functionality: Free cell Grp Cfg Info
+ * Functionality: Function to build Um Ul Info
*
- * @params[in] MacUeCfg* duUeCfg
- * @return void
+ * @params[in] UmUniDirUlBearerCfg *
+ * void *
+ *
+ * @return ROK/RFAILED
*
* ****************************************************************/
-void freeUeReCfgCellGrpInfo(MacUeCfg *macUeCfg)
+void extractRlcUmUlCfg(UmUniDirUlBearerCfg *umUlCfgToSet, struct RLC_Config__um_Uni_Directional_DL *umUlCfg)
{
- freeMacServingCellInfo(&macUeCfg->spCellCfg.servCellCfg);
+ if(umUlCfg)
+ {
+ 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;
+ }
+ }
}
/*******************************************************************
*
- * @brief Fills Reconfig SchReqReConfig
+ * @brief Function to build Um Uni Dl Info
*
* @details
*
- * Function : extractSchReqReConfig
+ * Function : extractRlcUmDlCfg
*
- * Functionality: Fills Reconfig SchReqReConfig
+ * Functionality: Function to build Um Uni Dl Info
*
- * @params[in] SchedulingRequestConfig_t *cuSchedReq
- * SchedReqCfg* macSchedReq
- * @return void
+ * @params[in] UmUniDirDlBearerCfg *
+ * void *
+ *
+ * @return ROK/RFAILED
*
* ****************************************************************/
-void extractSchReqReConfig(SchedulingRequestConfig_t *cuSchedReq, SchedReqCfg *macSchedReq)
+void extractRlcUmDlCfg(UmUniDirDlBearerCfg *umDlCfgToSet, struct RLC_Config__um_Uni_Directional_UL *umDlCfg)
{
- uint8_t schReqIdx = 0;
- struct SchedulingRequestConfig__schedulingRequestToAddModList *schReqListToAdd = NULLP;
- struct SchedulingRequestConfig__schedulingRequestToReleaseList *schReqListToRel = NULLP;
-
- if(cuSchedReq->schedulingRequestToAddModList)
+ if(umDlCfg)
{
- schReqListToAdd = cuSchedReq->schedulingRequestToAddModList;
- if(schReqListToAdd->list.count)
- {
- macSchedReq->addModListCount = schReqListToAdd->list.count;
- for(schReqIdx = 0; schReqIdx < schReqListToAdd->list.count; schReqIdx++)
- {
- macSchedReq->addModList[schReqIdx].schedReqId = \
- schReqListToAdd->list.array[schReqIdx]->schedulingRequestId;
- macSchedReq->addModList[schReqIdx].srProhibitTmr = \
- *(schReqListToAdd->list.array[schReqIdx]->sr_ProhibitTimer);
- macSchedReq->addModList[schReqIdx].srTransMax =\
- schReqListToAdd->list.array[schReqIdx]->sr_TransMax;
- }
- }
+ if(umDlCfg->ul_UM_RLC.sn_FieldLength)
+ umDlCfgToSet->dlUmCfg.snLenDlUm = *(umDlCfg->ul_UM_RLC.sn_FieldLength);
}
- /* Scheduling Req To release */
- if(cuSchedReq->schedulingRequestToReleaseList)
+}
+
+/*******************************************************************
+ *
+ * @brief Function to extractRlcModeCfg
+ *
+ * @details
+ *
+ * Function : extractRlcModeCfg
+ *
+ * Functionality: Function to extractRlcModeCfg
+ *
+ * @params[in] RLC_Config_t *
+ * RlcBearerCfg *
+ * void *
+ * @return ROK/RFAILED
+ *
+ * ****************************************************************/
+void extractRlcModeCfg(uint8_t rlcMode, RlcBearerCfg *rlcDbCfg, RLC_Config_t *lcCfg)
+{
+ if(lcCfg)
{
- schReqListToRel = cuSchedReq->schedulingRequestToReleaseList;
- if(schReqListToRel->list.count)
+ switch(rlcMode)
{
- macSchedReq->relListCount = schReqListToRel->list.count;
- for(schReqIdx = 0; schReqIdx < schReqListToRel->list.count; schReqIdx++)
- {
- macSchedReq->relList[schReqIdx] = \
- *schReqListToRel->list.array[schReqIdx];
- }
+ case RLC_AM :
+ {
+ if(lcCfg->choice.am)
+ {
+ DU_ALLOC_SHRABL_BUF(rlcDbCfg->u.amCfg, sizeof(AmBearerCfg));
+ if(rlcDbCfg->u.amCfg)
+ extractRlcAmCfg(rlcDbCfg->u.amCfg, lcCfg->choice.am);
+ }
+ break;
+ }
+ case RLC_UM_BI_DIRECTIONAL :
+ {
+ if(lcCfg->choice.um_Bi_Directional)
+ {
+ DU_ALLOC_SHRABL_BUF(rlcDbCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
+ if(rlcDbCfg->u.umBiDirCfg)
+ extractRlcUmBiCfg(rlcDbCfg->u.umBiDirCfg, lcCfg->choice.um_Bi_Directional);
+ }
+ break;
+ }
+ case RLC_UM_UNI_DIRECTIONAL_UL :
+ {
+ if(lcCfg->choice.um_Uni_Directional_DL)
+ {
+ DU_ALLOC_SHRABL_BUF(rlcDbCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
+ if(rlcDbCfg->u.umUniDirUlCfg)
+ extractRlcUmUlCfg(rlcDbCfg->u.umUniDirUlCfg, lcCfg->choice.um_Uni_Directional_DL);
+ }
+ break;
+ }
+ case RLC_UM_UNI_DIRECTIONAL_DL :
+ {
+ if(lcCfg->choice.um_Uni_Directional_UL)
+ {
+ DU_ALLOC_SHRABL_BUF(rlcDbCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
+ if(rlcDbCfg->u.umUniDirDlCfg)
+ extractRlcUmDlCfg(rlcDbCfg->u.umUniDirDlCfg, lcCfg->choice.um_Uni_Directional_UL);
+ }
+ break;
+ }
+ default:
+ DU_LOG("\nERROR --> DUAPP: Invalid rlcMode %d at extractRlcCfgToAddMod()", rlcMode);
+ break;
}
}
}
/*******************************************************************
*
- * @brief Fills TagReconfig
+ * @brief Function to extract extractUlLcCfg
*
* @details
*
- * Function : extractTagReconfig
+ * Function : extractUlLcCfg
*
- * Functionality: Fills extractTagReconfig
+ * Functionality: Function to extract extractUlLcCfg
*
- * @params[in] TAG_Config_t *cuTagCfg
- * TagCfg *macTagCfg
+ * @params[in] UlLcCfg *f1UlLcCfg, LogicalChannelConfig_t *ulLcCfg
* @return void
*
* ****************************************************************/
-void extractTagReconfig(TAG_Config_t *cuTagCfg, TagCfg *macTagCfg)
+void extractUlLcCfg(UlLcCfg *f1UlLcCfg, LogicalChannelConfig_t *ulLcCfg)
{
- uint8_t tagIdx = 0;
- struct TAG_Config__tag_ToAddModList *tagListToAddMod = NULLP;
- struct TAG_Config__tag_ToReleaseList *tagListToRel = NULLP;
-
- /* Tag config to AddMod */
- if(cuTagCfg->tag_ToAddModList)
- {
- tagListToAddMod = cuTagCfg->tag_ToAddModList;
- if(tagListToAddMod->list.count)
- {
- macTagCfg->addModListCount = tagListToAddMod->list.count;
- for(tagIdx = 0; tagIdx < tagListToAddMod->list.count; tagIdx++)
- {
- macTagCfg->addModList[tagIdx].tagId =\
- tagListToAddMod->list.array[tagIdx]->tag_Id;
- macTagCfg->addModList[tagIdx].timeAlignTimer = \
-
- tagListToAddMod->list.array[tagIdx]->timeAlignmentTimer;
- }
- }
- }
- /* Tag config to release */
- if(cuTagCfg->tag_ToReleaseList)
- {
- tagListToRel = cuTagCfg->tag_ToReleaseList;
- if(tagListToRel->list.count)
- {
- macTagCfg->relListCount = tagListToRel->list.count;
- for(tagIdx = 0; tagIdx < tagListToRel->list.count; tagIdx++)
- {
- macTagCfg->relList[tagIdx] = *tagListToRel->list.array[tagIdx];
- }
- }
- }
+ if(ulLcCfg)
+ {
+ if(ulLcCfg->ul_SpecificParameters)
+ {
+ f1UlLcCfg->priority = \
+ ulLcCfg->ul_SpecificParameters->priority;
+ if(ulLcCfg->ul_SpecificParameters->logicalChannelGroup)
+ {
+ f1UlLcCfg->lcGroup = \
+ *(ulLcCfg->ul_SpecificParameters->logicalChannelGroup);
+ }
+ if(ulLcCfg->ul_SpecificParameters->schedulingRequestID)
+ {
+ f1UlLcCfg->schReqId = \
+ *(ulLcCfg->ul_SpecificParameters->schedulingRequestID);
+ }
+ f1UlLcCfg->pbr = \
+ ulLcCfg->ul_SpecificParameters->prioritisedBitRate;
+ f1UlLcCfg->bsd = \
+ ulLcCfg->ul_SpecificParameters->bucketSizeDuration;
+ }
+ }
}
/*******************************************************************
*
- * @brief Fills PdcchCfg received by CU
+ * @brief Function to procRlcLcCfg
*
* @details
*
- * Function : extractPdcchCfg
+ * Function : procRlcLcCfg
*
- * Functionality: Fills PdcchCfg received by CU
+ * Functionality: Function to procRlcLcCfg
*
- * @params[in] PDCCH_Config_t *cuPdcchCfg,
- * PdcchConfig *duPdcchCfg
+ * @params[in] rbId, lcId, rbType, rlcMod
+ * RLC_Config_t *, RlcBearerCfg * ,
* @return void
*
* ****************************************************************/
-void extractPdcchCfg(PDCCH_Config_t *cuPdcchCfg, PdcchConfig *macPdcchCfg)
+void procRlcLcCfg(uint8_t rbId, uint8_t lcId, uint8_t rbType, uint8_t rlcMode,\
+ uint8_t configType, RLC_Config_t *f1RlcCfg, RlcBearerCfg *lcCfg)
{
- uint8_t cRsetIdx = 0;
- uint8_t srchSpcIdx = 0;
-
- struct PDCCH_Config__controlResourceSetToAddModList *cRsetToAddModList = NULLP;
- struct PDCCH_Config__controlResourceSetToReleaseList *cRsetToRelList = NULLP;
- struct PDCCH_Config__searchSpacesToAddModList *srchSpcToAddModList = NULLP;
- struct PDCCH_Config__searchSpacesToReleaseList *srchSpcToRelList = NULLP;
+ lcCfg->rbId = rbId;
+ lcCfg->configType = configType;
- /* Control Resource Set To Add/Mod List */
- if(cuPdcchCfg->controlResourceSetToAddModList)
+ if(rbType == RB_TYPE_SRB)
{
- cRsetToAddModList = cuPdcchCfg->controlResourceSetToAddModList;
- if(cRsetToAddModList->list.count)
- {
- macPdcchCfg->numCRsetToAddMod = cRsetToAddModList->list.count;
- for(cRsetIdx = 0; cRsetIdx < cRsetToAddModList->list.count; cRsetIdx++)
- {
- macPdcchCfg->cRSetToAddModList[cRsetIdx].cRSetId = \
- cRsetToAddModList->list.array[cRsetIdx]->controlResourceSetId;
- bitStringToInt(&cRsetToAddModList->list.array[cRsetIdx]->frequencyDomainResources,\
- macPdcchCfg->cRSetToAddModList[cRsetIdx].freqDomainRsrc);
- macPdcchCfg->cRSetToAddModList[cRsetIdx].duration = \
- cRsetToAddModList->list.array[cRsetIdx]->duration;
-
- macPdcchCfg->cRSetToAddModList[cRsetIdx].cceRegMappingType = \
- cRsetToAddModList->list.array[cRsetIdx]->cce_REG_MappingType.present;
- if(macPdcchCfg->cRSetToAddModList[cRsetIdx].cceRegMappingType == CCE_REG_MAPPINGTYPE_PR_INTERLEAVED)
- {
- //TODO: handle the case for Interleaved
- }
- macPdcchCfg->cRSetToAddModList[cRsetIdx].precoderGranularity = \
- cRsetToAddModList->list.array[cRsetIdx]->precoderGranularity;
- if(cRsetToAddModList->list.array[cRsetIdx]->pdcch_DMRS_ScramblingID)
- {
- macPdcchCfg->cRSetToAddModList[cRsetIdx].dmrsScramblingId= \
- *(cRsetToAddModList->list.array[cRsetIdx]->pdcch_DMRS_ScramblingID);
- }
- }
- }
+ lcCfg->rbType = RB_TYPE_SRB;
+ lcCfg->lcId = rbId;
+ lcCfg->lcType = LCH_DCCH;
+ lcCfg->rlcMode = RLC_AM;
+ }
+ else if(rbType == RB_TYPE_DRB)
+ {
+ lcCfg->rbType = RB_TYPE_DRB;
+ lcCfg->lcId = lcId;
+ lcCfg->lcType = LCH_DTCH;
+ lcCfg->rlcMode = rlcMode;
+ }
+ if(f1RlcCfg) /* rlc mode config recived */
+ {
+ extractRlcModeCfg(lcCfg->rlcMode, lcCfg, f1RlcCfg);
+ }
+}
+
+
+/*******************************************************************
+ *
+ * @brief Fills DrbQos Info received by CU
+ *
+ * @details
+ *
+ * Function : extractQosInfo
+ *
+ * Functionality: Fills DrbQos Info received by CU
+ *
+ * @params[in] DrbQosInfo *qosToAdd,
+ * QoSFlowLevelQoSParameters_t *qosFlowCfg
+ * @return void
+ *
+ * ****************************************************************/
+
+void extractQosInfo(DrbQosInfo *qosToAdd, QoSFlowLevelQoSParameters_t *qosFlowCfg)
+{
+ qosToAdd->fiveQiType = qosFlowCfg->qoS_Characteristics.present;
+ qosToAdd->u.nonDyn5Qi.fiveQi =\
+ qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->fiveQI;
+ if(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow)
+ {
+ qosToAdd->u.nonDyn5Qi.avgWindow = \
+ *(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow);
}
- /* Control Resource Set To Release List */
- if(cuPdcchCfg->controlResourceSetToReleaseList)
+ qosToAdd->u.nonDyn5Qi.maxDataBurstVol = \
+ *(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume);
+ if(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel)
{
- cRsetToRelList = cuPdcchCfg->controlResourceSetToReleaseList;
- if(cRsetToRelList->list.count)
- {
- macPdcchCfg->numCRsetToRel = cRsetToRelList->list.count;
- for(cRsetIdx = 0; cRsetIdx < cRsetToRelList->list.count; cRsetIdx++)
- {
- macPdcchCfg->cRSetToRelList[cRsetIdx] = *(cRsetToRelList->list.array[cRsetIdx]);
- }
- }
+ qosToAdd->u.nonDyn5Qi.priorLevel = \
+ *(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel);
+ }
+ qosToAdd->ngRanRetPri.priorityLevel = \
+ qosFlowCfg->nGRANallocationRetentionPriority.priorityLevel;
+ qosToAdd->ngRanRetPri.preEmptionCap = \
+ qosFlowCfg->nGRANallocationRetentionPriority.pre_emptionCapability;
+ qosToAdd->ngRanRetPri.preEmptionVul = \
+ qosFlowCfg->nGRANallocationRetentionPriority.pre_emptionVulnerability;
+ if(qosFlowCfg->gBR_QoS_Flow_Information)
+ {
+ memcpy(&qosToAdd->grbQosInfo.maxFlowBitRateDl, \
+ qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateDownlink.buf, \
+ qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateDownlink.size);
+ memcpy(&qosToAdd->grbQosInfo.maxFlowBitRateUl, \
+ qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateUplink.buf, \
+ qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateUplink.size);
+ memcpy(&qosToAdd->grbQosInfo.guarFlowBitRateDl,\
+ qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateDownlink.buf, \
+ qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateDownlink.size);
+ memcpy(&qosToAdd->grbQosInfo.guarFlowBitRateUl,\
+ qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateUplink.buf, \
+ qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateUplink.size);
}
+ qosToAdd->pduSessionId = 0;
+ qosToAdd->ulPduSessAggMaxBitRate = 0;
+}
- /* Search space To Add/Mod List */
- if(cuPdcchCfg->searchSpacesToAddModList)
+/*******************************************************************
+ *
+ * @brief Function to extract GTP Tunnel Info from CU
+ *
+ * @details
+ *
+ * Function : extractUpTnlInfo
+ *
+ * Functionality: Function to extract GTP Tunnel Info from CU
+ *
+ * @params[in] F1AP message
+ * @return ROK/RFAILED
+ *
+ * ****************************************************************/
+
+uint8_t extractUpTnlInfo(uint8_t drbId, uint8_t configType,\
+ ULUPTNLInformation_ToBeSetup_List_t *tnlInfo, UpTnlCfg *upTnlInfo)
+{
+ uint8_t tnlIdx;
+ uint32_t ipv4_du = 0;
+ GTPTunnel_t *gtpTunnel = NULLP;
+
+ upTnlInfo->drbId = drbId;
+ upTnlInfo->configType = configType;
+ cmInetAddr((char *)DU_IP_V4_ADDR, &ipv4_du);
+
+ for(tnlIdx=0; tnlIdx < tnlInfo->list.count; tnlIdx++)
{
- srchSpcToAddModList = cuPdcchCfg->searchSpacesToAddModList;
- if(srchSpcToAddModList->list.count)
+ if(tnlInfo->list.array[tnlIdx]->uLUPTNLInformation.present == UPTransportLayerInformation_PR_gTPTunnel)
{
- macPdcchCfg->numSearchSpcToAddMod = srchSpcToAddModList->list.count;
- for(srchSpcIdx = 0; srchSpcIdx < srchSpcToAddModList->list.count; srchSpcIdx++)
+ if(tnlInfo->list.array[tnlIdx]->uLUPTNLInformation.choice.gTPTunnel)
{
- macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceId =\
- srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceId;
- macPdcchCfg->searchSpcToAddModList[srchSpcIdx].cRSetId =\
- *(srchSpcToAddModList->list.array[srchSpcIdx]->controlResourceSetId);
- if(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset)
+ gtpTunnel = tnlInfo->list.array[tnlIdx]->uLUPTNLInformation.choice.gTPTunnel;
+ DU_ALLOC(upTnlInfo->tnlCfg1, sizeof(GtpTnlCfg));
+ if(upTnlInfo->tnlCfg1 == NULLP)
{
- macPdcchCfg->searchSpcToAddModList[srchSpcIdx].mSlotPeriodicityAndOffset =\
- srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset->present;
- }
- if(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSymbolsWithinSlot)
- {
- bitStringToInt(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSymbolsWithinSlot,\
- macPdcchCfg->searchSpcToAddModList[srchSpcIdx].mSymbolsWithinSlot);
- }
- if(srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates)
- {
- macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel1 = \
- srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel1;
- macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel2 = \
- srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel2;
- macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel4 = \
- srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel4;
-
- macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel8 = \
- srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel8;
-
- macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel16 = \
- srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel16;
+ DU_LOG("\nERROR --> F1AP : extractUpTnlInfo: Failed to allocate mmeory for tunnel cfg 1");
+ return RFAILED;
}
- if(srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType)
+ bitStringToInt(>pTunnel->transportLayerAddress, &upTnlInfo->tnlCfg1->ulTnlAddress);
+ upTnlInfo->tnlCfg1->dlTnlAddress = ipv4_du;
+ if(gtpTunnel->gTP_TEID.size > 0)
{
- macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceType =\
- srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType->present;
- if(macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceType == SEARCHSPACETYPE_PR_UE_SPECIFIC)
- {
- macPdcchCfg->searchSpcToAddModList[srchSpcIdx].ueSpecificDciFormat =\
- srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType->choice.ue_Specific->dci_Formats;
- }
-
+ teIdStringToInt(gtpTunnel->gTP_TEID.buf, &upTnlInfo->tnlCfg1->teId);
}
}
+ break;
}
}
- /* Search space To Rel List */
- if(cuPdcchCfg->searchSpacesToReleaseList)
+ return ROK;
+}
+/*******************************************************************
+*
+* @brief Function to extract Drb Qos Cfg Info from CU
+*
+* @details
+*
+* Function : extractDrbQosCfg
+*
+* Functionality: Function to extract Drb Qos Cfg Info from CU
+*
+* @params[in] DRB_Information_t *drbInfo, LcCfg *macLcToAdd
+* @return ROK/RFAILED
+*
+* ****************************************************************/
+
+uint8_t extractDrbQosCfg(DRB_Information_t *drbInfo, LcCfg *macLcToAdd )
+{
+ if(!macLcToAdd->drbQos)
{
- srchSpcToRelList = cuPdcchCfg->searchSpacesToReleaseList;
- if(srchSpcToRelList->list.count)
+ DU_ALLOC_SHRABL_BUF(macLcToAdd->drbQos, sizeof(DrbQosInfo));
+ if(macLcToAdd->drbQos == NULLP)
{
- macPdcchCfg->numSearchSpcToRel = srchSpcToRelList->list.count;
- for(srchSpcIdx = 0; srchSpcIdx < srchSpcToRelList->list.count; srchSpcIdx++)
- {
- macPdcchCfg->searchSpcToRelList[srchSpcIdx] =\
- *(srchSpcToRelList->list.array[srchSpcIdx]);
- }
+ DU_LOG("\nERROR --> DUAPP:Memory failed at allocating DrbQos at extractDrbCfg()");
+ return RFAILED;
+ }
+
+ }
+ if(drbInfo->dRB_QoS.qoS_Characteristics.present == QoS_Characteristics_PR_non_Dynamic_5QI)
+ {
+ extractQosInfo(macLcToAdd->drbQos, &drbInfo->dRB_QoS);
+ macLcToAdd->dlLcCfg.lcp = macLcToAdd->drbQos->ngRanRetPri.priorityLevel;
+ }
+ if(!macLcToAdd->snssai)
+ {
+ DU_ALLOC_SHRABL_BUF(macLcToAdd->snssai, sizeof(Snssai));
+ if(macLcToAdd->snssai == NULLP)
+ {
+ DU_LOG("\nERROR --> DUAPP : Memory failed at allocating SNSSAI at extractDrbCfg()");
+ return RFAILED;
}
}
+ memcpy(&macLcToAdd->snssai->sst, drbInfo->sNSSAI.sST.buf, \
+ drbInfo->sNSSAI.sST.size);
+ if(drbInfo->sNSSAI.sD)
+ {
+ memcpy(macLcToAdd->snssai->sd, drbInfo->sNSSAI.sD->buf, \
+ drbInfo->sNSSAI.sD->size);
+ }
+ return ROK;
}
-
/*******************************************************************
*
- * @brief Fills PdschCfg received by CU
+ * @brief Function to extract DRB info received from CU
*
* @details
*
- * Function : extractPdschCfg
+ * Function : extractDrbCfg
*
- * Functionality: Fills PdschCfg received by CU
+ * Functionality: Function to extract DRB info received from CU
*
- * @params[in] PDSCH_Config_t *cuPdschCfg,
- * PdschConfig *macPdschCfg
+ * @params[in] F1AP message
* @return void
*
* ****************************************************************/
-
-void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg)
+uint8_t extractDrbCfg(DRBs_ToBeSetup_Item_t *drbItem,DRBs_ToBeSetupMod_Item_t *drbSetupModItem,\
+LcCfg *macLcToAdd, UpTnlCfg *upTnlInfo)
{
- uint8_t timeDomIdx;
- struct PDSCH_Config__pdsch_TimeDomainAllocationList *timeDomAlloc = NULLP;
+ DRB_Information_t *drbInfo = NULLP;
- if(cuPdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA)
+ if(drbItem != NULLP)
{
- if(cuPdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA->present == \
- PDSCH_Config__dmrs_DownlinkForPDSCH_MappingTypeA_PR_setup)
+ if(extractUpTnlInfo(drbItem->dRBID, CONFIG_ADD, &drbItem->uLUPTNLInformation_ToBeSetup_List, upTnlInfo) != ROK)
{
- if(cuPdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup)
- {
- macPdschCfg->dmrsDlCfgForPdschMapTypeA.addPos = \
- *(cuPdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition);
- }
+ DU_LOG("\nERROR --> DUAPP : Failed to extract tunnel Cfg at extractDrbCfg()");
+ return RFAILED;
}
- }
- macPdschCfg->resourceAllocType = cuPdschCfg->resourceAllocation;
- if(cuPdschCfg->pdsch_TimeDomainAllocationList)
- {
- timeDomAlloc = cuPdschCfg->pdsch_TimeDomainAllocationList;
- if(timeDomAlloc->present ==\
- PDSCH_Config__pdsch_TimeDomainAllocationList_PR_setup)
+ if(drbItem->qoSInformation.present == QoSInformation_PR_choice_extension)
{
- if(timeDomAlloc->choice.setup)
- {
- macPdschCfg->numTimeDomRsrcAlloc = timeDomAlloc->choice.setup->list.count;
- for(timeDomIdx = 0; timeDomIdx < timeDomAlloc->choice.setup->list.count; timeDomIdx++)
+ 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)
{
- macPdschCfg->timeDomRsrcAllociList[timeDomIdx].mappingType = \
- timeDomAlloc->choice.setup->list.array[timeDomIdx]->mappingType;
- //macPdschCfg->timeDomRsrcAllociList[timeDomIdx].startSymbol = \
-
- //macPdschCfg->timeDomRsrcAllociList[timeDomIdx].symbolLength;
- macPdschCfg->timeDomRsrcAllociList[timeDomIdx].startSymbolAndLength = \
- timeDomAlloc->choice.setup->list.array[timeDomIdx]->startSymbolAndLength;
- }
- }
+ DU_LOG("\nERROR --> DUAPP : Failed to extract qos Cfg at extractDrbCfg()");
+ return RFAILED;
+ }
+ }
}
}
- macPdschCfg->rbgSize = cuPdschCfg->rbg_Size;
- if(cuPdschCfg->maxNrofCodeWordsScheduledByDCI)
- macPdschCfg->numCodeWordsSchByDci = *(cuPdschCfg->maxNrofCodeWordsScheduledByDCI);
- if(cuPdschCfg->prb_BundlingType.present == PDSCH_Config__prb_BundlingType_PR_staticBundling)
+ else if(drbSetupModItem != NULLP)
{
- macPdschCfg->bundlingType = cuPdschCfg->prb_BundlingType.present;
- if(cuPdschCfg->prb_BundlingType.choice.staticBundling)
+ if(extractUpTnlInfo(drbSetupModItem->dRBID, CONFIG_ADD, &drbSetupModItem->uLUPTNLInformation_ToBeSetup_List,\
+ upTnlInfo) != ROK)
{
- if(cuPdschCfg->prb_BundlingType.choice.staticBundling->bundleSize)
- {
- macPdschCfg->bundlingInfo.StaticBundling.size = \
- *(cuPdschCfg->prb_BundlingType.choice.staticBundling->bundleSize);
- }
+ DU_LOG("\nERROR --> DUAPP : Failed to extract tunnel Cfg at extractDrbCfg()");
+ return RFAILED;
+ }
+ if(drbSetupModItem->qoSInformation.present == QoSInformation_PR_choice_extension)
+ {
+ if(drbSetupModItem->qoSInformation.choice.choice_extension->value.present ==\
+ QoSInformation_ExtIEs__value_PR_DRB_Information)
+ {
+ drbInfo = &drbSetupModItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information;
+ if(extractDrbQosCfg(drbInfo , macLcToAdd) != ROK)
+ {
+ DU_LOG("\nERROR --> DUAPP : Failed to extract qos Cfg at extractDrbCfg()");
+ return RFAILED;
+ }
+
+ }
}
- }
- else if(cuPdschCfg->prb_BundlingType.present == PDSCH_Config__prb_BundlingType_PR_dynamicBundling)
- {
- macPdschCfg->bundlingType = cuPdschCfg->prb_BundlingType.present;
}
+ return ROK;
}
/*******************************************************************
*
- * @brief Fills PdschServingCellCfg received by CU
+ * @brief Function to extract RB info received from CU
*
* @details
*
- * Function : extractPdschServingCellCfg
+ * Function : extractMacRbCfg
*
- * Functionality: Fills PdschCfg received by CU
+ * Functionality: Function to extract RB info received from CU
*
- * @params[in] PDSCH_ServingCellConfig_t *cuPdschSrvCellCfg,
- * PdschServCellCfg *macUePdschSrvCellCfg
+ * @params[in] F1AP message
* @return ROK/RFAILED
*
* ****************************************************************/
-uint8_t extractPdschServingCellCfg(PDSCH_ServingCellConfig_t *cuPdschSrvCellCfg, PdschServCellCfg *macUePdschSrvCellCfg)
+uint8_t extractMacRbCfg(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbCfg,\
+DRBs_ToBeSetupMod_Item_t *drbSetupModCfg, LogicalChannelConfig_t *ulLcCfg, LcCfg *lcCfg, UpTnlCfg *upTnlInfo)
{
- if(cuPdschSrvCellCfg->codeBlockGroupTransmission)
+ if(drbCfg != NULLP)
{
- if(cuPdschSrvCellCfg->codeBlockGroupTransmission->choice.setup)
+ if(extractDrbCfg(drbCfg, NULL, lcCfg, upTnlInfo) != ROK)
{
- if(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb)
- {
- *(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb) = \
- cuPdschSrvCellCfg->codeBlockGroupTransmission->choice.setup->maxCodeBlockGroupsPerTransportBlock;
- }
- else
- {
- DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb, sizeof(uint8_t));
- if(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb)
- {
- *(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb) = \
- cuPdschSrvCellCfg->codeBlockGroupTransmission->choice.setup->maxCodeBlockGroupsPerTransportBlock;
- }
- else
- {
- DU_LOG("\nDUAPP: Memory allocation failed for maxCodeBlkGrpPerTb at extractPdschServingCellCfg()");
- return RFAILED;
- }
- }
- if(macUePdschSrvCellCfg->codeBlkGrpFlushInd)
- {
- *(macUePdschSrvCellCfg->codeBlkGrpFlushInd) = \
- cuPdschSrvCellCfg->codeBlockGroupTransmission->choice.setup->codeBlockGroupFlushIndicator;
- }
- else
- {
- DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb, sizeof(bool));
- if(macUePdschSrvCellCfg->codeBlkGrpFlushInd)
- {
- *(macUePdschSrvCellCfg->codeBlkGrpFlushInd) = \
- cuPdschSrvCellCfg->codeBlockGroupTransmission->choice.setup->codeBlockGroupFlushIndicator;
- }
- else
- {
- DU_LOG("\nDUAPP: Memory allocation failed for codeBlkGrpFlushInd at extractPdschServingCellCfg()");
- return RFAILED;
- }
- }
+ DU_LOG("ERROR --> F1AP : Failed to build Drb Qos at extractMacRbCfg()");
+ return RFAILED;
}
}
- if(cuPdschSrvCellCfg->nrofHARQ_ProcessesForPDSCH)
- {
- macUePdschSrvCellCfg->numHarqProcForPdsch = *(cuPdschSrvCellCfg->nrofHARQ_ProcessesForPDSCH);
- }
- if(cuPdschSrvCellCfg->ext1)
- {
- if(cuPdschSrvCellCfg->ext1->maxMIMO_Layers)
+ else if(drbSetupModCfg != NULLP)
+ {
+ if(extractDrbCfg(NULL, drbSetupModCfg, lcCfg, upTnlInfo) != ROK)
{
- if(macUePdschSrvCellCfg->maxMimoLayers)
- {
- *(macUePdschSrvCellCfg->maxMimoLayers) = *(cuPdschSrvCellCfg->ext1->maxMIMO_Layers);
- }
- else
- {
- DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->maxMimoLayers, sizeof(uint8_t));
- if(macUePdschSrvCellCfg->maxMimoLayers)
- {
- *(macUePdschSrvCellCfg->maxMimoLayers) = *(cuPdschSrvCellCfg->ext1->maxMIMO_Layers);
- }
- else
- {
- DU_LOG("\nDUAPP: Memory allocation failed for maxMimoLayers at extractPdschServingCellCfg()");
- return RFAILED;
- }
- }
+ DU_LOG("ERROR --> F1AP : Failed to build Drb Qos at extractMacRbCfg()");
+ return RFAILED;
}
}
- if(cuPdschSrvCellCfg->xOverhead)
+ else
{
- if(macUePdschSrvCellCfg->xOverhead)
- {
- *(macUePdschSrvCellCfg->xOverhead) = *(cuPdschSrvCellCfg->xOverhead);
- }
+ lcCfg->drbQos = NULLP;
+ lcCfg->snssai = NULLP;
+ if(lcCfg->lcId == SRB2_LCID)
+ lcCfg->dlLcCfg.lcp = LC_PRIORITY_3;
else
- {
- DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->xOverhead, sizeof(uint8_t));
- if(macUePdschSrvCellCfg->xOverhead)
- {
- *(macUePdschSrvCellCfg->xOverhead) = *(cuPdschSrvCellCfg->xOverhead);
- }
- else
- {
- DU_LOG("\nDUAPP: Memory allocation failed for xOverhead at extractPdschServingCellCfg()");
- return RFAILED;
- }
- }
+ lcCfg->dlLcCfg.lcp = LC_PRIORITY_1;
+ }
+ if(ulLcCfg)
+ {
+ lcCfg->ulLcCfgPres = true;
+ extractUlLcCfg(&lcCfg->ulLcCfg, ulLcCfg);
}
+ else
+ lcCfg->ulLcCfgPres = false;
return ROK;
}
/*******************************************************************
*
- * @brief Fills PuschCfg received by CU
+ * @brief Function processing LC config info received from CU
*
* @details
*
- * Function : extractPuschCfg
+ * Function : procMacLcCfg
*
- * Functionality: Fills PuschCfg received by CU
+ * Functionality: Function processing LC config info received from CU
*
- * @params[in] BWP_UplinkDedicated__pusch_Config *cuPuschCfg,
- * PuschCfg *macPuschCfg
- * @return void
+ * @params[in] F1AP message
+ * @return ROK/RFAILED
*
* ****************************************************************/
-void extractPuschCfg(struct BWP_UplinkDedicated__pusch_Config *cuPuschCfg, PuschCfg *macPuschCfg)
+uint8_t procMacLcCfg(uint8_t lcId, uint8_t rbType, uint8_t configType,\
+DRBs_ToBeSetup_Item_t *drbItem, DRBs_ToBeSetupMod_Item_t *drbSetupModItem, LogicalChannelConfig_t *ulLcCfg,\
+LcCfg *lcCfg, UpTnlCfg *upTnlInfo)
{
- uint8_t timeDomIdx = 0;
- DMRS_UplinkConfig_t *dmrsUlCfg = NULLP;
- struct PUSCH_Config__pusch_TimeDomainAllocationList *timeDomAllocList = NULLP;
+ uint8_t ret = ROK;
- if(cuPuschCfg->present == BWP_UplinkDedicated__pusch_Config_PR_setup)
+ lcCfg->lcId = lcId;
+ lcCfg->configType = configType;
+ if(rbType == RB_TYPE_SRB)
{
- if(cuPuschCfg->choice.setup)
- {
- if(cuPuschCfg->choice.setup->dataScramblingIdentityPUSCH)
- {
- macPuschCfg->dataScramblingId = \
- *(cuPuschCfg->choice.setup->dataScramblingIdentityPUSCH);
- }
- if(cuPuschCfg->choice.setup->dmrs_UplinkForPUSCH_MappingTypeA)
- {
- if(cuPuschCfg->choice.setup->dmrs_UplinkForPUSCH_MappingTypeA->present == PUSCH_Config__dmrs_UplinkForPUSCH_MappingTypeA_PR_setup)
- {
- if(cuPuschCfg->choice.setup->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup)
- {
- dmrsUlCfg = (cuPuschCfg->choice.setup->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup);
- if(dmrsUlCfg->dmrs_AdditionalPosition)
- {
- macPuschCfg->dmrsUlCfgForPuschMapTypeA.addPos =\
- *(dmrsUlCfg->dmrs_AdditionalPosition);
- }
- if(dmrsUlCfg->transformPrecodingDisabled)
- {
- if(dmrsUlCfg->transformPrecodingDisabled->scramblingID0)
- {
- macPuschCfg->dmrsUlCfgForPuschMapTypeA.transPrecodDisabled.scramblingId0 = \
- *(dmrsUlCfg->transformPrecodingDisabled->scramblingID0);
- }
- }
- }
- }
- }
- /*Res Alloc Type for UL */
- if(cuPuschCfg->choice.setup->resourceAllocation)
- {
- macPuschCfg->resourceAllocType = \
- cuPuschCfg->choice.setup->resourceAllocation;
- }
- if(cuPuschCfg->choice.setup->pusch_TimeDomainAllocationList)
- {
- timeDomAllocList = cuPuschCfg->choice.setup->pusch_TimeDomainAllocationList;
- if(timeDomAllocList->present == PUSCH_Config__pusch_TimeDomainAllocationList_PR_setup)
- {
- if(timeDomAllocList->choice.setup)
- {
- macPuschCfg->numTimeDomRsrcAlloc = timeDomAllocList->choice.setup->list.count;
- for(timeDomIdx = 0; timeDomIdx <timeDomAllocList->choice.setup->list.count; timeDomIdx++)
- {
- macPuschCfg->timeDomRsrcAllocList[timeDomIdx].k2 = \
- *(timeDomAllocList->choice.setup->list.array[timeDomIdx]->k2);
- macPuschCfg->timeDomRsrcAllocList[timeDomIdx].mappingType = \
- timeDomAllocList->choice.setup->list.array[timeDomIdx]->mappingType;
- macPuschCfg->timeDomRsrcAllocList[timeDomIdx].startSymbolAndLength = \
- timeDomAllocList->choice.setup->list.array[timeDomIdx]->startSymbolAndLength;
- //macPuschCfg->timeDomRsrcAllocList[timeDomIdx].startSymbol = \
- timeDomAllocList->choice.setup->list.array[timeDomIdx]->startSymbol;
- //macPuschCfg->timeDomRsrcAllocList[timeDomIdx].symbolLen = \
- timeDomAllocList->choice.setup->list.array[timeDomIdx]->symbolLen;
- }
- }
- }
- }
- if(cuPuschCfg->choice.setup->transformPrecoder)
- macPuschCfg->transformPrecoder = *(cuPuschCfg->choice.setup->transformPrecoder);
- }
+ ret = extractMacRbCfg(lcId, NULL,NULL, ulLcCfg, lcCfg, NULL);
+ }
+ else if(rbType == RB_TYPE_DRB)
+ {
+ if(drbItem != NULL)
+ ret = extractMacRbCfg(lcId, drbItem, NULL, ulLcCfg, lcCfg, upTnlInfo);
+ else if(drbSetupModItem != NULL)
+ ret = extractMacRbCfg(lcId, NULL, drbSetupModItem, ulLcCfg, lcCfg, upTnlInfo);
}
+ return ret;
}
+
/*******************************************************************
*
- * @brief Fills ServingCellReconfig received by CU
+ * @brief Function to extract Rlc cfg To Add/Mod in CellGrp Info
*
* @details
*
- * Function : extractServingCellReconfig
+ * Function : extractRlcCfgToAddMod
*
- * Functionality: Fills ServingCellReconfig received by CU
+ * Functionality: Function to extract Rlc cfg To Add/Mod in CellGrp Info
*
- * @params[in] ServingCellConfig_t *cuSrvCellCfg
- * ServCellCfgInfo *macSrvCellCfg
- * @return ROK/RFAILD
+ * @params[in] CellGroupConfigRrc__rlc_BearerTo pointer
+ * DuUeCfg Pointer
+ * @return ROK/RFAILED
*
* ****************************************************************/
-uint8_t extractServingCellReconfig(ServingCellConfig_t *cuSrvCellCfg, ServCellCfgInfo *macSrvCellCfg)
+
+uint8_t extractRlcCfgToAddMod(struct CellGroupConfigRrc__rlc_BearerToAddModList *lcCfg, DuUeCfg *ueCfgDb)
{
- uint8_t ret = ROK;
- BWP_DownlinkDedicated_t *dlBwp = NULLP;
- BWP_UplinkDedicated_t *ulBwp = NULLP;
+ uint8_t idx, rbId, lcId, rlcMode, rbType;
+ RLC_Config_t *f1RlcCfg = NULLP;
+ LogicalChannelConfig_t *macUlLcCfg = NULLP;
- if(cuSrvCellCfg->initialDownlinkBWP)
- {
- dlBwp = ((BWP_DownlinkDedicated_t *)(cuSrvCellCfg->initialDownlinkBWP));
- if(dlBwp->pdcch_Config)
- {
- if(dlBwp->pdcch_Config->choice.setup)
- {
- extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg);
- }
- }
- if(dlBwp->pdsch_Config)
- {
- if(dlBwp->pdsch_Config->choice.setup)
- {
- extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg);
- }
- }
- }
- if(cuSrvCellCfg->firstActiveDownlinkBWP_Id)
- macSrvCellCfg->firstActvDlBwpId = *(cuSrvCellCfg->firstActiveDownlinkBWP_Id);
- if(cuSrvCellCfg->defaultDownlinkBWP_Id)
- macSrvCellCfg->defaultDlBwpId = *(cuSrvCellCfg->defaultDownlinkBWP_Id);
- if(cuSrvCellCfg->bwp_InactivityTimer)
- {
- if(macSrvCellCfg->bwpInactivityTmr)
- {
- memcpy(macSrvCellCfg->bwpInactivityTmr, cuSrvCellCfg->bwp_InactivityTimer, sizeof(uint8_t));
- }
- else
- {
- macSrvCellCfg->bwpInactivityTmr = NULLP;
- DU_ALLOC_SHRABL_BUF(macSrvCellCfg->bwpInactivityTmr, sizeof(uint8_t));
- if(macSrvCellCfg->bwpInactivityTmr)
- {
- memcpy(macSrvCellCfg->bwpInactivityTmr, cuSrvCellCfg->bwp_InactivityTimer, sizeof(uint8_t));
- }
- else
- {
- DU_LOG("\nMemory Alloc failed for bwpInactivityTmr at extractServingCellReconfig()");
- return RFAILED;
- }
- }
- }
- if(cuSrvCellCfg->pdsch_ServingCellConfig)
- {
- if(cuSrvCellCfg->pdsch_ServingCellConfig->choice.setup)
- {
- ret = extractPdschServingCellCfg(cuSrvCellCfg->pdsch_ServingCellConfig->choice.setup, &macSrvCellCfg->pdschServCellCfg);
- if(ret == RFAILED)
- {
- DU_LOG("\nFailed at extractPdschServingCellCfg()");
- return RFAILED;
- }
- }
- }
- if(cuSrvCellCfg->uplinkConfig)
- {
- if(cuSrvCellCfg->uplinkConfig->initialUplinkBWP)
+ for(idx = 0; idx < lcCfg->list.count; idx++)
+ {
+ lcId = lcCfg->list.array[idx]->logicalChannelIdentity;
+ if(lcCfg->list.array[idx]->servedRadioBearer)
{
- ulBwp = ((BWP_UplinkDedicated_t *)(cuSrvCellCfg->uplinkConfig->initialUplinkBWP));
- if(ulBwp->pusch_Config)
- {
- macSrvCellCfg->initUlBwp.puschPresent = true;
- extractPuschCfg(ulBwp->pusch_Config, &macSrvCellCfg->initUlBwp.puschCfg);
- }
- if(ulBwp->pucch_Config)
- {
- macSrvCellCfg->initUlBwp.pucchPresent = true;
- //extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg);
- }
+ /* RadioBearer for SRB/DRB */
+ if(lcCfg->list.array[idx]->servedRadioBearer->present ==\
+ RLC_BearerConfig__servedRadioBearer_PR_srb_Identity)
+ {
+ rbId = lcCfg->list.array[idx]->servedRadioBearer->choice.srb_Identity;
+ rbType = RB_TYPE_SRB;
+ }
+ else if(lcCfg->list.array[idx]->servedRadioBearer->present ==\
+ RLC_BearerConfig__servedRadioBearer_PR_drb_Identity)
+ {
+ rbId = lcCfg->list.array[idx]->servedRadioBearer->choice.drb_Identity;
+ rbType = RB_TYPE_DRB;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> No components present in Bearer config to ADD/MOD");
+ return RFAILED;
+ }
+ /* MAC UL LC Config */
+ if(lcCfg->list.array[idx]->mac_LogicalChannelConfig)
+ {
+ macUlLcCfg = lcCfg->list.array[idx]->mac_LogicalChannelConfig;
+ }
}
- if(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id)
- macSrvCellCfg->firstActvUlBwpId = *(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id);
+ else
+ {
+ DU_LOG("\nERROR --> DUAPP: Received RadioBearer config is NULL");
+ return RFAILED;
+ }
+ /* RLC Mode Config */
+ if(lcCfg->list.array[idx]->rlc_Config)
+ {
+ rlcMode = lcCfg->list.array[idx]->rlc_Config->present;
+ f1RlcCfg = lcCfg->list.array[idx]->rlc_Config;
+ }
+
+ /* Filling RLC/MAC Config*/
+ memset(&ueCfgDb->macLcCfg[idx], 0, sizeof(LcCfg));
+ memset(&ueCfgDb->rlcLcCfg[idx], 0, sizeof(RlcBearerCfg));
+ procRlcLcCfg(rbId, lcId, rbType, rlcMode, CONFIG_UNKNOWN, f1RlcCfg, &(ueCfgDb->rlcLcCfg[idx]));
+ if(procMacLcCfg(lcId, rbType, CONFIG_UNKNOWN, NULL, NULL, macUlLcCfg, &ueCfgDb->macLcCfg[idx], NULL) != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed while filling MAC LC config at extractRlcCfgToAddMod()");
+ return RFAILED;
+ }
+ (ueCfgDb->numRlcLcs)++;
+ (ueCfgDb->numMacLcs)++;
+ }
+ //TODO: To send the failure cause in UeContextSetupRsp
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief DeAlloc pdsch serv cell config info
+ *
+ * @details
+ *
+ * Function : freeMacPdschServCellInfo
+ *
+ * Functionality: DeAlloc pdsch serv cell config info
+ *
+ * @params[in] PdschServCellCfg pointer
+ * @return void
+ *
+ * ****************************************************************/
+void freeMacPdschServCellInfo(PdschServCellCfg *pdsch)
+{
+ if(pdsch->xOverhead)
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->xOverhead, sizeof(uint8_t));
+ }
+ if(pdsch->codeBlkGrpFlushInd)
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->codeBlkGrpFlushInd, sizeof(bool));
+ }
+ if(pdsch->maxCodeBlkGrpPerTb)
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->maxCodeBlkGrpPerTb, sizeof(uint8_t));
+ }
+ if(pdsch->maxMimoLayers)
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->maxMimoLayers, sizeof(uint8_t));
}
- return ret;
}
+
/*******************************************************************
*
- * @brief Fills Reconfig Cell group Info received by CU
+ * @brief Free Serving cell Info
*
* @details
*
- * Function : extractUeReCfgCellInfo
+ * Function : freeMacServingCellInfo
*
- * Functionality: Fills Reconfig Cell group Info received by CU
+ * Functionality: Free Serving cell Info
*
- * @params[in] CellGroupConfigRrc_t *macCellGrpCfg
- * MacUeCfg* macUeCfg
- * @return ROK/RFAILED
+ * @params[in] ServCellCfgInfo *srvCellCfg
+ * @return void
*
* ****************************************************************/
-uint8_t extractUeReCfgCellInfo(CellGroupConfigRrc_t *cellGrp, MacUeCfg *macUeCfg)
+void freeMacServingCellInfo(ServCellCfgInfo *srvCellCfg)
{
- uint8_t ret = ROK;
- MAC_CellGroupConfig_t *macCellGroup = NULLP;
- PhysicalCellGroupConfig_t *phyCellGrpCfg = NULLP;
- SpCellConfig_t *spcellCfg = NULLP;
- ServingCellConfig_t *servCellCfg = NULLP;
-
- if(cellGrp)
+ freeMacPdschServCellInfo(&srvCellCfg->pdschServCellCfg);
+ if(srvCellCfg->bwpInactivityTmr)
{
- /* Fill MacCell Group Reconfig */
- if(cellGrp->mac_CellGroupConfig)
- {
- macCellGroup = ((MAC_CellGroupConfig_t *)(cellGrp->mac_CellGroupConfig));
- if(macCellGroup->schedulingRequestConfig)
- {
- extractSchReqReConfig(macCellGroup->schedulingRequestConfig, &macUeCfg->macCellGrpCfg.schReqCfg);
- }
- if(macCellGroup->tag_Config)
- {
- extractTagReconfig(macCellGroup->tag_Config, &macUeCfg->macCellGrpCfg.tagCfg);
- }
- if(macCellGroup->bsr_Config)
- {
- macUeCfg->macCellGrpCfg.bsrTmrCfg.periodicTimer = macCellGroup->bsr_Config->periodicBSR_Timer;
- macUeCfg->macCellGrpCfg.bsrTmrCfg.retxTimer = macCellGroup->bsr_Config->retxBSR_Timer;
- if(macCellGroup->bsr_Config->logicalChannelSR_DelayTimer)
- {
- macUeCfg->macCellGrpCfg.bsrTmrCfg.srDelayTimer =\
- *(macCellGroup->bsr_Config->logicalChannelSR_DelayTimer);
- }
- }
- if(macCellGroup->phr_Config)
- {
- if(macCellGroup->phr_Config->present == MAC_CellGroupConfig__phr_Config_PR_setup)
- {
- macUeCfg->macCellGrpCfg.phrCfgSetupPres = true;
- if(macCellGroup->phr_Config->choice.setup)
- {
- macUeCfg->macCellGrpCfg.phrCfg.periodicTimer = \
- macCellGroup->phr_Config->choice.setup->phr_PeriodicTimer;
- macUeCfg->macCellGrpCfg.phrCfg.prohibitTimer = \
- macCellGroup->phr_Config->choice.setup->phr_ProhibitTimer;
- macUeCfg->macCellGrpCfg.phrCfg.txPowerFactor = \
- macCellGroup->phr_Config->choice.setup->phr_Tx_PowerFactorChange;
- macUeCfg->macCellGrpCfg.phrCfg.multiplePHR = \
- macCellGroup->phr_Config->choice.setup->multiplePHR;
- macUeCfg->macCellGrpCfg.phrCfg.dummy = \
- macCellGroup->phr_Config->choice.setup->dummy;
- macUeCfg->macCellGrpCfg.phrCfg.phrType2OtherCell = \
- macCellGroup->phr_Config->choice.setup->phr_Type2OtherCell;
- macUeCfg->macCellGrpCfg.phrCfg.phrOtherCG = \
- macCellGroup->phr_Config->choice.setup->phr_ModeOtherCG;
- }
- }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, srvCellCfg->bwpInactivityTmr, sizeof(uint8_t));
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Free cell Grp Cfg Info
+ *
+ * @details
+ *
+ * Function : freeUeReCfgCellGrpInfo
+ *
+ * Functionality: Free cell Grp Cfg Info
+ *
+ * @params[in] MacUeCfg* duUeCfg
+ * @return void
+ *
+ * ****************************************************************/
+void freeUeReCfgCellGrpInfo(MacUeCfg *macUeCfg)
+{
+ freeMacServingCellInfo(&macUeCfg->spCellCfg.servCellCfg);
+}
- }
- }
- /* Fill Physical Cell Group Reconfig */
- if(cellGrp->physicalCellGroupConfig)
+/*******************************************************************
+ *
+ * @brief Fills Reconfig SchReqReConfig
+ *
+ * @details
+ *
+ * Function : extractSchReqReConfig
+ *
+ * Functionality: Fills Reconfig SchReqReConfig
+ *
+ * @params[in] SchedulingRequestConfig_t *cuSchedReq
+ * SchedReqCfg* macSchedReq
+ * @return void
+ *
+ * ****************************************************************/
+void extractSchReqReConfig(SchedulingRequestConfig_t *cuSchedReq, SchedReqCfg *macSchedReq)
+{
+ uint8_t schReqIdx = 0;
+ struct SchedulingRequestConfig__schedulingRequestToAddModList *schReqListToAdd = NULLP;
+ struct SchedulingRequestConfig__schedulingRequestToReleaseList *schReqListToRel = NULLP;
+
+ if(cuSchedReq->schedulingRequestToAddModList)
+ {
+ schReqListToAdd = cuSchedReq->schedulingRequestToAddModList;
+ if(schReqListToAdd->list.count)
{
- phyCellGrpCfg = ((PhysicalCellGroupConfig_t *)(cellGrp->physicalCellGroupConfig));
- if(phyCellGrpCfg->p_NR_FR1)
+ macSchedReq->addModListCount = schReqListToAdd->list.count;
+ for(schReqIdx = 0; schReqIdx < schReqListToAdd->list.count; schReqIdx++)
{
- if(*(phyCellGrpCfg->p_NR_FR1) != macUeCfg->phyCellGrpCfg.pNrFr1)
- macUeCfg->phyCellGrpCfg.pNrFr1 = *(phyCellGrpCfg->p_NR_FR1);
+ macSchedReq->addModList[schReqIdx].schedReqId = \
+ schReqListToAdd->list.array[schReqIdx]->schedulingRequestId;
+ macSchedReq->addModList[schReqIdx].srProhibitTmr = \
+ *(schReqListToAdd->list.array[schReqIdx]->sr_ProhibitTimer);
+ macSchedReq->addModList[schReqIdx].srTransMax =\
+ schReqListToAdd->list.array[schReqIdx]->sr_TransMax;
}
- macUeCfg->phyCellGrpCfg.pdschHarqAckCodebook = phyCellGrpCfg->pdsch_HARQ_ACK_Codebook;
}
- /* Fill SpCell Reconfig */
- if(cellGrp->spCellConfig)
+ }
+ /* Scheduling Req To release */
+ if(cuSchedReq->schedulingRequestToReleaseList)
+ {
+ schReqListToRel = cuSchedReq->schedulingRequestToReleaseList;
+ if(schReqListToRel->list.count)
{
- spcellCfg = ((SpCellConfig_t *)(cellGrp->spCellConfig));
- if(spcellCfg->servCellIndex)
- {
- macUeCfg->spCellCfg.servCellIdx = *(spcellCfg->servCellIndex);
- }
- /* Fill Serving cell Reconfig info */
- if(cellGrp->spCellConfig->spCellConfigDedicated)
+ macSchedReq->relListCount = schReqListToRel->list.count;
+ for(schReqIdx = 0; schReqIdx < schReqListToRel->list.count; schReqIdx++)
{
- servCellCfg = ((ServingCellConfig_t *)(cellGrp->spCellConfig->spCellConfigDedicated));
- ret = extractServingCellReconfig(servCellCfg, &macUeCfg->spCellCfg.servCellCfg);
- if(ret == RFAILED)
- {
- DU_LOG("\n Failed at extractServingCellReconfig()");
- }
+ macSchedReq->relList[schReqIdx] = \
+ *schReqListToRel->list.array[schReqIdx];
}
}
}
- return ret;
}
/*******************************************************************
*
- * @brief builds Mac Cell Cfg
+ * @brief Fills TagReconfig
*
* @details
*
- * Function : procUeReCfgCellInfo
- *
- * Functionality: builds Mac Cell Cfg
+ * Function : extractTagReconfig
*
- * @params[in] MacUeCfg pointer
- * void pointer
+ * Functionality: Fills extractTagReconfig
*
- * @return void
+ * @params[in] TAG_Config_t *cuTagCfg
+ * TagCfg *macTagCfg
+ * @return void
*
* ****************************************************************/
-uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfg, void *cellInfo)
-{
+
+void extractTagReconfig(TAG_Config_t *cuTagCfg, TagCfg *macTagCfg)
+{
+ uint8_t tagIdx = 0;
+ struct TAG_Config__tag_ToAddModList *tagListToAddMod = NULLP;
+ struct TAG_Config__tag_ToReleaseList *tagListToRel = NULLP;
+
+ /* Tag config to AddMod */
+ if(cuTagCfg->tag_ToAddModList)
+ {
+ tagListToAddMod = cuTagCfg->tag_ToAddModList;
+ if(tagListToAddMod->list.count)
+ {
+ macTagCfg->addModListCount = tagListToAddMod->list.count;
+ for(tagIdx = 0; tagIdx < tagListToAddMod->list.count; tagIdx++)
+ {
+ macTagCfg->addModList[tagIdx].tagId =\
+ tagListToAddMod->list.array[tagIdx]->tag_Id;
+ macTagCfg->addModList[tagIdx].timeAlignTimer = \
+
+ tagListToAddMod->list.array[tagIdx]->timeAlignmentTimer;
+ }
+ }
+ }
+ /* Tag config to release */
+ if(cuTagCfg->tag_ToReleaseList)
+ {
+ tagListToRel = cuTagCfg->tag_ToReleaseList;
+ if(tagListToRel->list.count)
+ {
+ macTagCfg->relListCount = tagListToRel->list.count;
+ for(tagIdx = 0; tagIdx < tagListToRel->list.count; tagIdx++)
+ {
+ macTagCfg->relList[tagIdx] = *tagListToRel->list.array[tagIdx];
+ }
+ }
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Fills PdcchCfg received by CU
+ *
+ * @details
+ *
+ * Function : extractPdcchCfg
+ *
+ * Functionality: Fills PdcchCfg received by CU
+ *
+ * @params[in] PDCCH_Config_t *cuPdcchCfg,
+ * PdcchConfig *duPdcchCfg
+ * @return void
+ *
+ * ****************************************************************/
+
+void extractPdcchCfg(PDCCH_Config_t *cuPdcchCfg, PdcchConfig *macPdcchCfg)
+{
+ uint8_t cRsetIdx = 0;
+ uint8_t srchSpcIdx = 0;
+
+ struct PDCCH_Config__controlResourceSetToAddModList *cRsetToAddModList = NULLP;
+ struct PDCCH_Config__controlResourceSetToReleaseList *cRsetToRelList = NULLP;
+ struct PDCCH_Config__searchSpacesToAddModList *srchSpcToAddModList = NULLP;
+ struct PDCCH_Config__searchSpacesToReleaseList *srchSpcToRelList = NULLP;
+
+
+ /* Control Resource Set To Add/Mod List */
+ if(cuPdcchCfg->controlResourceSetToAddModList)
+ {
+ cRsetToAddModList = cuPdcchCfg->controlResourceSetToAddModList;
+ if(cRsetToAddModList->list.count)
+ {
+ macPdcchCfg->numCRsetToAddMod = cRsetToAddModList->list.count;
+ for(cRsetIdx = 0; cRsetIdx < cRsetToAddModList->list.count; cRsetIdx++)
+ {
+ macPdcchCfg->cRSetToAddModList[cRsetIdx].cRSetId = \
+ cRsetToAddModList->list.array[cRsetIdx]->controlResourceSetId;
+ bitStringToInt(&cRsetToAddModList->list.array[cRsetIdx]->frequencyDomainResources,\
+ macPdcchCfg->cRSetToAddModList[cRsetIdx].freqDomainRsrc);
+ macPdcchCfg->cRSetToAddModList[cRsetIdx].duration = \
+ cRsetToAddModList->list.array[cRsetIdx]->duration;
+
+ macPdcchCfg->cRSetToAddModList[cRsetIdx].cceRegMappingType = \
+ cRsetToAddModList->list.array[cRsetIdx]->cce_REG_MappingType.present;
+ if(macPdcchCfg->cRSetToAddModList[cRsetIdx].cceRegMappingType == CCE_REG_MAPPINGTYPE_PR_INTERLEAVED)
+ {
+ //TODO: handle the case for Interleaved
+ }
+ macPdcchCfg->cRSetToAddModList[cRsetIdx].precoderGranularity = \
+ cRsetToAddModList->list.array[cRsetIdx]->precoderGranularity;
+ if(cRsetToAddModList->list.array[cRsetIdx]->pdcch_DMRS_ScramblingID)
+ {
+ macPdcchCfg->cRSetToAddModList[cRsetIdx].dmrsScramblingId= \
+ *(cRsetToAddModList->list.array[cRsetIdx]->pdcch_DMRS_ScramblingID);
+ }
+ }
+ }
+
+ }
+ /* Control Resource Set To Release List */
+ if(cuPdcchCfg->controlResourceSetToReleaseList)
+ {
+ cRsetToRelList = cuPdcchCfg->controlResourceSetToReleaseList;
+ if(cRsetToRelList->list.count)
+ {
+ macPdcchCfg->numCRsetToRel = cRsetToRelList->list.count;
+ for(cRsetIdx = 0; cRsetIdx < cRsetToRelList->list.count; cRsetIdx++)
+ {
+ macPdcchCfg->cRSetToRelList[cRsetIdx] = *(cRsetToRelList->list.array[cRsetIdx]);
+ }
+ }
+ }
+
+ /* Search space To Add/Mod List */
+ if(cuPdcchCfg->searchSpacesToAddModList)
+ {
+ srchSpcToAddModList = cuPdcchCfg->searchSpacesToAddModList;
+ if(srchSpcToAddModList->list.count)
+ {
+ macPdcchCfg->numSearchSpcToAddMod = srchSpcToAddModList->list.count;
+ for(srchSpcIdx = 0; srchSpcIdx < srchSpcToAddModList->list.count; srchSpcIdx++)
+ {
+ macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceId =\
+ srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceId;
+ macPdcchCfg->searchSpcToAddModList[srchSpcIdx].cRSetId =\
+ *(srchSpcToAddModList->list.array[srchSpcIdx]->controlResourceSetId);
+ if(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset)
+ {
+ macPdcchCfg->searchSpcToAddModList[srchSpcIdx].mSlotPeriodicityAndOffset =\
+ srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset->present;
+ }
+ if(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSymbolsWithinSlot)
+ {
+ bitStringToInt(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSymbolsWithinSlot,\
+ macPdcchCfg->searchSpcToAddModList[srchSpcIdx].mSymbolsWithinSlot);
+ }
+ if(srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates)
+ {
+ macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel1 = \
+ srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel1;
+ macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel2 = \
+ srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel2;
+ macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel4 = \
+ srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel4;
+
+ macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel8 = \
+ srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel8;
+
+ macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel16 = \
+ srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel16;
+ }
+ if(srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType)
+ {
+ macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceType =\
+ srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType->present;
+ if(macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceType == SEARCHSPACETYPE_PR_UE_SPECIFIC)
+ {
+ macPdcchCfg->searchSpcToAddModList[srchSpcIdx].ueSpecificDciFormat =\
+ srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType->choice.ue_Specific->dci_Formats;
+ }
+
+ }
+ }
+ }
+ }
+ /* Search space To Rel List */
+ if(cuPdcchCfg->searchSpacesToReleaseList)
+ {
+ srchSpcToRelList = cuPdcchCfg->searchSpacesToReleaseList;
+ if(srchSpcToRelList->list.count)
+ {
+ macPdcchCfg->numSearchSpcToRel = srchSpcToRelList->list.count;
+ for(srchSpcIdx = 0; srchSpcIdx < srchSpcToRelList->list.count; srchSpcIdx++)
+ {
+ macPdcchCfg->searchSpcToRelList[srchSpcIdx] =\
+ *(srchSpcToRelList->list.array[srchSpcIdx]);
+ }
+ }
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Fills PdschCfg received by CU
+ *
+ * @details
+ *
+ * Function : extractPdschCfg
+ *
+ * Functionality: Fills PdschCfg received by CU
+ *
+ * @params[in] PDSCH_Config_t *cuPdschCfg,
+ * PdschConfig *macPdschCfg
+ * @return void
+ *
+ * ****************************************************************/
+
+void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg)
+{
+ uint8_t timeDomIdx;
+ struct PDSCH_Config__pdsch_TimeDomainAllocationList *timeDomAlloc = NULLP;
+
+ if(cuPdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA)
+ {
+ if(cuPdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA->present == \
+ PDSCH_Config__dmrs_DownlinkForPDSCH_MappingTypeA_PR_setup)
+ {
+ if(cuPdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup)
+ {
+ macPdschCfg->dmrsDlCfgForPdschMapTypeA.addPos = \
+ *(cuPdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition);
+ }
+ }
+ }
+ macPdschCfg->resourceAllocType = cuPdschCfg->resourceAllocation;
+ if(cuPdschCfg->pdsch_TimeDomainAllocationList)
+ {
+ timeDomAlloc = cuPdschCfg->pdsch_TimeDomainAllocationList;
+ if(timeDomAlloc->present ==\
+ PDSCH_Config__pdsch_TimeDomainAllocationList_PR_setup)
+ {
+ if(timeDomAlloc->choice.setup)
+ {
+ macPdschCfg->numTimeDomRsrcAlloc = timeDomAlloc->choice.setup->list.count;
+ for(timeDomIdx = 0; timeDomIdx < timeDomAlloc->choice.setup->list.count; timeDomIdx++)
+ {
+ macPdschCfg->timeDomRsrcAllociList[timeDomIdx].mappingType = \
+ timeDomAlloc->choice.setup->list.array[timeDomIdx]->mappingType;
+ macPdschCfg->timeDomRsrcAllociList[timeDomIdx].startSymbolAndLength = \
+ timeDomAlloc->choice.setup->list.array[timeDomIdx]->startSymbolAndLength;
+ }
+ }
+ }
+ }
+ macPdschCfg->rbgSize = cuPdschCfg->rbg_Size;
+ if(cuPdschCfg->maxNrofCodeWordsScheduledByDCI)
+ macPdschCfg->numCodeWordsSchByDci = *(cuPdschCfg->maxNrofCodeWordsScheduledByDCI);
+ if(cuPdschCfg->prb_BundlingType.present == PDSCH_Config__prb_BundlingType_PR_staticBundling)
+ {
+ macPdschCfg->bundlingType = cuPdschCfg->prb_BundlingType.present;
+ if(cuPdschCfg->prb_BundlingType.choice.staticBundling)
+ {
+ if(cuPdschCfg->prb_BundlingType.choice.staticBundling->bundleSize)
+ {
+ macPdschCfg->bundlingInfo.StaticBundling.size = \
+ *(cuPdschCfg->prb_BundlingType.choice.staticBundling->bundleSize);
+ }
+ }
+ }
+ else if(cuPdschCfg->prb_BundlingType.present == PDSCH_Config__prb_BundlingType_PR_dynamicBundling)
+ {
+ macPdschCfg->bundlingType = cuPdschCfg->prb_BundlingType.present;
+ }
+
+}
+
+/*******************************************************************
+ *
+ * @brief Fills PdschServingCellCfg received by CU
+ *
+ * @details
+ *
+ * Function : extractPdschServingCellCfg
+ *
+ * Functionality: Fills PdschCfg received by CU
+ *
+ * @params[in] PDSCH_ServingCellConfig_t *cuPdschSrvCellCfg,
+ * PdschServCellCfg *macUePdschSrvCellCfg
+ * @return ROK/RFAILED
+ *
+ * ****************************************************************/
+
+uint8_t extractPdschServingCellCfg(PDSCH_ServingCellConfig_t *cuPdschSrvCellCfg, PdschServCellCfg *macUePdschSrvCellCfg)
+{
+ if(cuPdschSrvCellCfg->codeBlockGroupTransmission)
+ {
+ if(cuPdschSrvCellCfg->codeBlockGroupTransmission->choice.setup)
+ {
+ if(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb)
+ {
+ *(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb) = \
+ cuPdschSrvCellCfg->codeBlockGroupTransmission->choice.setup->maxCodeBlockGroupsPerTransportBlock;
+ }
+ else
+ {
+ DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb, sizeof(uint8_t));
+ if(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb)
+ {
+ *(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb) = \
+ cuPdschSrvCellCfg->codeBlockGroupTransmission->choice.setup->maxCodeBlockGroupsPerTransportBlock;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for maxCodeBlkGrpPerTb at extractPdschServingCellCfg()");
+ return RFAILED;
+ }
+ }
+ if(macUePdschSrvCellCfg->codeBlkGrpFlushInd)
+ {
+ *(macUePdschSrvCellCfg->codeBlkGrpFlushInd) = \
+ cuPdschSrvCellCfg->codeBlockGroupTransmission->choice.setup->codeBlockGroupFlushIndicator;
+ }
+ else
+ {
+ DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb, sizeof(bool));
+ if(macUePdschSrvCellCfg->codeBlkGrpFlushInd)
+ {
+ *(macUePdschSrvCellCfg->codeBlkGrpFlushInd) = \
+ cuPdschSrvCellCfg->codeBlockGroupTransmission->choice.setup->codeBlockGroupFlushIndicator;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for codeBlkGrpFlushInd at extractPdschServingCellCfg()");
+ return RFAILED;
+ }
+ }
+ }
+ }
+ if(cuPdschSrvCellCfg->nrofHARQ_ProcessesForPDSCH)
+ {
+ macUePdschSrvCellCfg->numHarqProcForPdsch = *(cuPdschSrvCellCfg->nrofHARQ_ProcessesForPDSCH);
+ }
+ if(cuPdschSrvCellCfg->ext1)
+ {
+ if(cuPdschSrvCellCfg->ext1->maxMIMO_Layers)
+ {
+ if(macUePdschSrvCellCfg->maxMimoLayers)
+ {
+ *(macUePdschSrvCellCfg->maxMimoLayers) = *(cuPdschSrvCellCfg->ext1->maxMIMO_Layers);
+ }
+ else
+ {
+ DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->maxMimoLayers, sizeof(uint8_t));
+ if(macUePdschSrvCellCfg->maxMimoLayers)
+ {
+ *(macUePdschSrvCellCfg->maxMimoLayers) = *(cuPdschSrvCellCfg->ext1->maxMIMO_Layers);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for maxMimoLayers at extractPdschServingCellCfg()");
+ return RFAILED;
+ }
+ }
+ }
+ }
+ if(cuPdschSrvCellCfg->xOverhead)
+ {
+ if(macUePdschSrvCellCfg->xOverhead)
+ {
+ *(macUePdschSrvCellCfg->xOverhead) = *(cuPdschSrvCellCfg->xOverhead);
+ }
+ else
+ {
+ DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->xOverhead, sizeof(uint8_t));
+ if(macUePdschSrvCellCfg->xOverhead)
+ {
+ *(macUePdschSrvCellCfg->xOverhead) = *(cuPdschSrvCellCfg->xOverhead);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for xOverhead at extractPdschServingCellCfg()");
+ return RFAILED;
+ }
+ }
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills PuschCfg received by CU
+ *
+ * @details
+ *
+ * Function : extractPuschCfg
+ *
+ * Functionality: Fills PuschCfg received by CU
+ *
+ * @params[in] BWP_UplinkDedicated__pusch_Config *cuPuschCfg,
+ * PuschCfg *macPuschCfg
+ * @return void
+ *
+ * ****************************************************************/
+
+void extractPuschCfg(struct BWP_UplinkDedicated__pusch_Config *cuPuschCfg, PuschCfg *macPuschCfg)
+{
+ uint8_t timeDomIdx = 0;
+ DMRS_UplinkConfig_t *dmrsUlCfg = NULLP;
+ struct PUSCH_Config__pusch_TimeDomainAllocationList *timeDomAllocList = NULLP;
+
+ if(cuPuschCfg->present == BWP_UplinkDedicated__pusch_Config_PR_setup)
+ {
+ if(cuPuschCfg->choice.setup)
+ {
+ if(cuPuschCfg->choice.setup->dataScramblingIdentityPUSCH)
+ {
+ macPuschCfg->dataScramblingId = \
+ *(cuPuschCfg->choice.setup->dataScramblingIdentityPUSCH);
+ }
+ if(cuPuschCfg->choice.setup->dmrs_UplinkForPUSCH_MappingTypeA)
+ {
+ if(cuPuschCfg->choice.setup->dmrs_UplinkForPUSCH_MappingTypeA->present == PUSCH_Config__dmrs_UplinkForPUSCH_MappingTypeA_PR_setup)
+ {
+ if(cuPuschCfg->choice.setup->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup)
+ {
+ dmrsUlCfg = (cuPuschCfg->choice.setup->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup);
+ if(dmrsUlCfg->dmrs_AdditionalPosition)
+ {
+ macPuschCfg->dmrsUlCfgForPuschMapTypeA.addPos =\
+ *(dmrsUlCfg->dmrs_AdditionalPosition);
+ }
+ if(dmrsUlCfg->transformPrecodingDisabled)
+ {
+ if(dmrsUlCfg->transformPrecodingDisabled->scramblingID0)
+ {
+ macPuschCfg->dmrsUlCfgForPuschMapTypeA.transPrecodDisabled.scramblingId0 = \
+ *(dmrsUlCfg->transformPrecodingDisabled->scramblingID0);
+ }
+ }
+ }
+ }
+ }
+ /*Res Alloc Type for UL */
+ if(cuPuschCfg->choice.setup->resourceAllocation)
+ {
+ macPuschCfg->resourceAllocType = \
+ cuPuschCfg->choice.setup->resourceAllocation;
+ }
+ if(cuPuschCfg->choice.setup->pusch_TimeDomainAllocationList)
+ {
+ timeDomAllocList = cuPuschCfg->choice.setup->pusch_TimeDomainAllocationList;
+ if(timeDomAllocList->present == PUSCH_Config__pusch_TimeDomainAllocationList_PR_setup)
+ {
+ if(timeDomAllocList->choice.setup)
+ {
+ macPuschCfg->numTimeDomRsrcAlloc = timeDomAllocList->choice.setup->list.count;
+ for(timeDomIdx = 0; timeDomIdx <timeDomAllocList->choice.setup->list.count; timeDomIdx++)
+ {
+ macPuschCfg->timeDomRsrcAllocList[timeDomIdx].k2 = \
+ *(timeDomAllocList->choice.setup->list.array[timeDomIdx]->k2);
+ macPuschCfg->timeDomRsrcAllocList[timeDomIdx].mappingType = \
+ timeDomAllocList->choice.setup->list.array[timeDomIdx]->mappingType;
+ macPuschCfg->timeDomRsrcAllocList[timeDomIdx].startSymbolAndLength = \
+ timeDomAllocList->choice.setup->list.array[timeDomIdx]->startSymbolAndLength;
+ }
+ }
+ }
+ }
+ if(cuPuschCfg->choice.setup->transformPrecoder)
+ macPuschCfg->transformPrecoder = *(cuPuschCfg->choice.setup->transformPrecoder);
+ }
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Function to fill pucch Power Control
+ *
+ * @details
+ *
+ * Function : extractPucchPowerControl
+ *
+ * Functionality: Function to fill pucch Power Control
+ *
+ * @params[in] PucchPowerControl *pwrCtrl,
+ * struct PUCCH_PowerControl *cuPwrCtrlCfg
+ * @return void
+ *
+ * ****************************************************************/
+
+void extractPucchPowerControl(PucchPowerControl *pwrCtrl, struct PUCCH_PowerControl *cuPwrCtrlCfg)
+{
+ uint8_t arrIdx;
+
+ if(cuPwrCtrlCfg->deltaF_PUCCH_f0)
+ pwrCtrl->deltaF_Format0 = *cuPwrCtrlCfg->deltaF_PUCCH_f0;
+ if(cuPwrCtrlCfg->deltaF_PUCCH_f1)
+ pwrCtrl->deltaF_Format1 = *cuPwrCtrlCfg->deltaF_PUCCH_f1;
+ if(cuPwrCtrlCfg->deltaF_PUCCH_f2)
+ pwrCtrl->deltaF_Format2 = *cuPwrCtrlCfg->deltaF_PUCCH_f2;
+ if(cuPwrCtrlCfg->deltaF_PUCCH_f3)
+ pwrCtrl->deltaF_Format3 = *cuPwrCtrlCfg->deltaF_PUCCH_f3;
+ if(cuPwrCtrlCfg->deltaF_PUCCH_f4)
+ pwrCtrl->deltaF_Format4 = *cuPwrCtrlCfg->deltaF_PUCCH_f4;
+ if(cuPwrCtrlCfg->p0_Set)
+ {
+ pwrCtrl->p0SetCount = cuPwrCtrlCfg->p0_Set->list.count;
+ for(arrIdx=0; arrIdx < pwrCtrl->p0SetCount; arrIdx++)
+ {
+ pwrCtrl->p0Set[arrIdx].p0PucchId =\
+ cuPwrCtrlCfg->p0_Set->list.array[arrIdx]->p0_PUCCH_Id;
+ pwrCtrl->p0Set[arrIdx].p0PucchVal =\
+ cuPwrCtrlCfg->p0_Set->list.array[arrIdx]->p0_PUCCH_Value;
+ }
+ }
+ if(cuPwrCtrlCfg->pathlossReferenceRSs)
+ {
+ pwrCtrl->pathLossRefRSListCount = cuPwrCtrlCfg->pathlossReferenceRSs->list.count;
+ for(arrIdx = 0; arrIdx < pwrCtrl->pathLossRefRSListCount; arrIdx++)
+ {
+ pwrCtrl->pathLossRefRSList[arrIdx].pathLossRefRSId =\
+ cuPwrCtrlCfg->pathlossReferenceRSs->list.array[arrIdx]->pucch_PathlossReferenceRS_Id;
+ }
+ }
+}
+
+ /*******************************************************************
+ *
+ * @brief Function to extractResrcSetToAddModList sent by CU
+ *
+ * @details
+ *
+ * Function : extractResrcSetToAddModList
+ *
+ * Functionality: Fucntion to extractResrcSetToAddModList
+ *
+ * @params[in] PucchResrcSetCfg pointer,
+ * struct PUCCH_Config__resourceSetToAddModList pointer
+ * @return void
+ *
+ * ****************************************************************/
+
+void extractResrcSetToAddModList(PucchResrcSetCfg *macRsrcSetList, struct PUCCH_Config__resourceSetToAddModList *cuRsrcSetList)
+{
+ uint8_t arrIdx, rsrcListIdx;
+
+ macRsrcSetList->resrcSetToAddModListCount = cuRsrcSetList->list.count;
+ for(arrIdx = 0; arrIdx < macRsrcSetList->resrcSetToAddModListCount; arrIdx++)
+ {
+ macRsrcSetList->resrcSetToAddModList[arrIdx].resrcSetId =\
+ cuRsrcSetList->list.array[arrIdx]->pucch_ResourceSetId;
+ macRsrcSetList->resrcSetToAddModList[arrIdx].resrcListCount =\
+ cuRsrcSetList->list.array[arrIdx]->resourceList.list.count;
+ for(rsrcListIdx = 0; rsrcListIdx < macRsrcSetList->resrcSetToAddModList[arrIdx].resrcListCount; rsrcListIdx++)
+ {
+ macRsrcSetList->resrcSetToAddModList[arrIdx].resrcList[rsrcListIdx] =\
+ *cuRsrcSetList->list.array[arrIdx]->resourceList.list.array[rsrcListIdx];
+ }
+ macRsrcSetList->resrcSetToAddModList[arrIdx].maxPayLoadSize =\
+ *cuRsrcSetList->list.array[arrIdx]->maxPayloadMinus1;
+ }
+}/* End of extractResrcSetToAddModList */
+
+/*******************************************************************
+ *
+ * @brief Fills extractResrcToAddModList sent by CU
+ *
+ * @details
+ *
+ * Function : extractResrcToAddModList
+ *
+ * Functionality: Fills extractResrcToAddModList
+ *
+ * @params[in] PucchResrcCfg pointer,
+ * struct PUCCH_Config__resourceToAddModList pointer
+ * @return ROk/RFAILED
+ *
+ * ****************************************************************/
+
+uint8_t extractResrcToAddModList(PucchResrcCfg *macResrcList, struct PUCCH_Config__resourceToAddModList *cuResrcList)
+{
+ uint8_t arrIdx;
+
+ macResrcList->resrcToAddModListCount = cuResrcList->list.count;
+ for(arrIdx = 0; arrIdx < macResrcList->resrcToAddModListCount; arrIdx++)
+ {
+ macResrcList->resrcToAddModList[arrIdx].resrcId =\
+ cuResrcList->list.array[arrIdx]->pucch_ResourceId;
+ macResrcList->resrcToAddModList[arrIdx].startPrb =\
+ cuResrcList->list.array[arrIdx]->startingPRB;
+ if(cuResrcList->list.array[arrIdx]->intraSlotFrequencyHopping)
+ {
+ macResrcList->resrcToAddModList[arrIdx].intraFreqHop =\
+ *cuResrcList->list.array[arrIdx]->intraSlotFrequencyHopping;
+ }
+ if(cuResrcList->list.array[arrIdx]->secondHopPRB)
+ {
+ macResrcList->resrcToAddModList[arrIdx].secondPrbHop =\
+ *cuResrcList->list.array[arrIdx]->secondHopPRB;
+ }
+ /* PUCCH RSRC FORMAT */
+ if(cuResrcList->list.array[arrIdx]->format.present == PUCCH_Resource__format_PR_format0)
+ {
+ macResrcList->resrcToAddModList[arrIdx].pucchFormat = PUCCH_FORMAT_0;
+ if(cuResrcList->list.array[arrIdx]->format.choice.format0)
+ {
+ DU_ALLOC_SHRABL_BUF(macResrcList->resrcToAddModList[arrIdx].PucchFormat.format0, sizeof(PucchFormat0));
+ if(macResrcList->resrcToAddModList[arrIdx].PucchFormat.format0 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to allocate memory for Format0 in extractResrcToAddModList()");
+ return RFAILED;
+ }
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format0->initialCyclicShift =\
+ cuResrcList->list.array[arrIdx]->format.choice.format0->initialCyclicShift;
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format0->numSymbols =\
+ cuResrcList->list.array[arrIdx]->format.choice.format0->nrofSymbols;
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format0->startSymbolIdx =\
+ cuResrcList->list.array[arrIdx]->format.choice.format0->startingSymbolIndex;
+ }
+ }
+ else if(cuResrcList->list.array[arrIdx]->format.present == PUCCH_Resource__format_PR_format1)
+ {
+ macResrcList->resrcToAddModList[arrIdx].pucchFormat = PUCCH_FORMAT_1;
+ if(cuResrcList->list.array[arrIdx]->format.choice.format1)
+ {
+ DU_ALLOC_SHRABL_BUF(macResrcList->resrcToAddModList[arrIdx].PucchFormat.format1, sizeof(PucchFormat1));
+ if(macResrcList->resrcToAddModList[arrIdx].PucchFormat.format1 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to allocate memory for Format1 in extractResrcToAddModList()");
+ return RFAILED;
+ }
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format1->initialCyclicShift =\
+ cuResrcList->list.array[arrIdx]->format.choice.format1->initialCyclicShift;
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format1->numSymbols =\
+ cuResrcList->list.array[arrIdx]->format.choice.format1->nrofSymbols;
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format1->startSymbolIdx =\
+ cuResrcList->list.array[arrIdx]->format.choice.format1->startingSymbolIndex;
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format1->timeDomOCC =\
+ cuResrcList->list.array[arrIdx]->format.choice.format1->timeDomainOCC;
+ }
+ }
+ else if(cuResrcList->list.array[arrIdx]->format.present == PUCCH_Resource__format_PR_format2)
+ {
+ macResrcList->resrcToAddModList[arrIdx].pucchFormat = PUCCH_FORMAT_2;
+ if(cuResrcList->list.array[arrIdx]->format.choice.format2)
+ {
+ DU_ALLOC_SHRABL_BUF(macResrcList->resrcToAddModList[arrIdx].PucchFormat.format2, sizeof(PucchFormat2_3));
+ if(macResrcList->resrcToAddModList[arrIdx].PucchFormat.format2 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to allocate memory for Format2 in extractResrcToAddModList()");
+ return RFAILED;
+ }
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format2->numPrbs =\
+ cuResrcList->list.array[arrIdx]->format.choice.format2->nrofPRBs;
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format2->numSymbols =\
+ cuResrcList->list.array[arrIdx]->format.choice.format2->nrofSymbols;
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format2->startSymbolIdx =\
+ cuResrcList->list.array[arrIdx]->format.choice.format2->startingSymbolIndex;
+ }
+ }
+ else if(cuResrcList->list.array[arrIdx]->format.present == PUCCH_Resource__format_PR_format3)
+ {
+ macResrcList->resrcToAddModList[arrIdx].pucchFormat = PUCCH_FORMAT_3;
+ if(cuResrcList->list.array[arrIdx]->format.choice.format3)
+ {
+ DU_ALLOC_SHRABL_BUF(macResrcList->resrcToAddModList[arrIdx].PucchFormat.format3, sizeof(PucchFormat2_3));
+ if(macResrcList->resrcToAddModList[arrIdx].PucchFormat.format3 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to allocate memory for Format3 in extractResrcToAddModList()");
+ return RFAILED;
+ }
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format3->numPrbs =\
+ cuResrcList->list.array[arrIdx]->format.choice.format3->nrofPRBs;
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format3->numSymbols =\
+ cuResrcList->list.array[arrIdx]->format.choice.format3->nrofSymbols;
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format3->startSymbolIdx =\
+ cuResrcList->list.array[arrIdx]->format.choice.format3->startingSymbolIndex;
+ }
+ }
+ else if(cuResrcList->list.array[arrIdx]->format.present == PUCCH_Resource__format_PR_format4)
+ {
+ macResrcList->resrcToAddModList[arrIdx].pucchFormat = PUCCH_FORMAT_4;
+ if(cuResrcList->list.array[arrIdx]->format.choice.format4)
+ {
+ DU_ALLOC_SHRABL_BUF(macResrcList->resrcToAddModList[arrIdx].PucchFormat.format4, sizeof(PucchFormat4));
+ if(macResrcList->resrcToAddModList[arrIdx].PucchFormat.format4 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to allocate memory for Format4 in extractResrcToAddModList()");
+ return RFAILED;
+ }
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format4->numSymbols =\
+ cuResrcList->list.array[arrIdx]->format.choice.format4->nrofSymbols;
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format4->occLen =\
+ cuResrcList->list.array[arrIdx]->format.choice.format4->occ_Length;
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format4->occIdx =\
+ cuResrcList->list.array[arrIdx]->format.choice.format4->occ_Index;
+ macResrcList->resrcToAddModList[arrIdx].PucchFormat.format4->startSymbolIdx =\
+ cuResrcList->list.array[arrIdx]->format.choice.format4->startingSymbolIndex;
+ }
+ }
+ }
+ return ROK;
+
+}/* End of extractResrcToAddModList */
+
+/*******************************************************************
+ *
+ * @brief Fills fillPucchSchedReqPeriodAndOffset sent by CU
+ *
+ * @details
+ *
+ * Function : fillPucchSchedReqPeriodAndOffset
+ *
+ * Functionality: To fillPucchSchedReqPeriodAndOffset
+ *
+ * @params[in] macPeriodicty,
+ * SchedulingRequestResourceConfig__periodicityAndOffset pointer
+ * @return void
+ *
+ * ****************************************************************/
+
+void fillPucchSchedReqPeriodAndOffset(uint8_t macPeriodicty, uint16_t macOffset,\
+ struct SchedulingRequestResourceConfig__periodicityAndOffset *cuPeriodicty)
+{
+ macPeriodicty = cuPeriodicty->present;
+ switch(macPeriodicty)
+ {
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sym2:
+ {
+ macOffset = cuPeriodicty->choice.sym2;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sym6or7:
+ {
+ macOffset = cuPeriodicty->choice.sym6or7;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl1:
+ {
+ macOffset = cuPeriodicty->choice.sl1;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl2:
+ {
+ macOffset = cuPeriodicty->choice.sl2;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl4:
+ {
+ macOffset = cuPeriodicty->choice.sl4;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl5:
+ {
+ macOffset = cuPeriodicty->choice.sl5;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl8:
+ {
+ macOffset = cuPeriodicty->choice.sl8;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl10:
+ {
+ macOffset = cuPeriodicty->choice.sl10;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl16:
+ {
+ macOffset = cuPeriodicty->choice.sl16;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl20:
+ {
+ macOffset = cuPeriodicty->choice.sl20;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40:
+ {
+ macOffset = cuPeriodicty->choice.sl40;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl80:
+ {
+ macOffset = cuPeriodicty->choice.sl80;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl160:
+ {
+ macOffset = cuPeriodicty->choice.sl160;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl320:
+ {
+ macOffset = cuPeriodicty->choice.sl320;
+ break;
+ }
+ case SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl640:
+ {
+ macOffset = cuPeriodicty->choice.sl640;
+ break;
+ }
+ default :
+ DU_LOG("\nERROR --> F1AP : Invalid periodicity %d", macPeriodicty);
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Function to extractPucchFormatCfg sent by CU
+ *
+ * @details
+ *
+ * Function : extractPucchFormatCfg
+ *
+ * Functionality: Function to extractPucchFormatCfg
+ *
+ * @params[in] PucchFormatCfg pointer,
+ * PUCCH_FormatConfig_t pointer
+ * @return void
+ *
+ * ****************************************************************/
+
+void extractPucchFormatCfg(PucchFormatCfg *macFormatCfg, PUCCH_FormatConfig_t *cuFormatCfg)
+ {
+ if(cuFormatCfg->interslotFrequencyHopping)
+ macFormatCfg->interSlotFreqHop = *cuFormatCfg->interslotFrequencyHopping;
+ if(cuFormatCfg->additionalDMRS)
+ macFormatCfg->addDmrs = *cuFormatCfg->additionalDMRS;
+ if(cuFormatCfg->maxCodeRate)
+ macFormatCfg->maxCodeRate = *cuFormatCfg->maxCodeRate;
+ if(cuFormatCfg->nrofSlots)
+ macFormatCfg->numSlots = *cuFormatCfg->nrofSlots;
+ if(cuFormatCfg->pi2BPSK)
+ macFormatCfg->pi2BPSK = *cuFormatCfg->pi2BPSK;
+ if(cuFormatCfg->simultaneousHARQ_ACK_CSI)
+ macFormatCfg->harqAckCSI = *cuFormatCfg->simultaneousHARQ_ACK_CSI;
+ }/* End of extractPucchFormatCfg */
+
+/*******************************************************************
+ *
+ * @brief Function to extractSchedReqCfgToAddMod sent by CU
+ *
+ * @details
+ *
+ * Function : extractSchedReqCfgToAddMod
+ *
+ * Functionality: Function to extractSchedReqCfgToAddMod
+ *
+ * @params[in] PucchSchedReqCfg pointer,
+ * PUCCH_Config__schedulingRequestResourceToAddModList pointer
+ * @return void
+ *
+ * ****************************************************************/
+
+void extractSchedReqCfgToAddMod(PucchSchedReqCfg *macSchedReqCfg, struct PUCCH_Config__schedulingRequestResourceToAddModList *cuSchedReqList)
+{
+ uint8_t arrIdx;
+
+ macSchedReqCfg->schedAddModListCount = cuSchedReqList->list.count;
+ for(arrIdx = 0; arrIdx < macSchedReqCfg->schedAddModListCount; arrIdx++)
+ {
+ macSchedReqCfg->schedAddModList[arrIdx].resrcId =\
+ cuSchedReqList->list.array[arrIdx]->schedulingRequestResourceId;
+ macSchedReqCfg->schedAddModList[arrIdx].requestId =\
+ cuSchedReqList->list.array[arrIdx]->schedulingRequestID;
+ if(cuSchedReqList->list.array[arrIdx]->periodicityAndOffset)
+ {
+ fillPucchSchedReqPeriodAndOffset(macSchedReqCfg->schedAddModList[arrIdx].periodicity,\
+ macSchedReqCfg->schedAddModList[arrIdx].offset, cuSchedReqList->list.array[arrIdx]->periodicityAndOffset);
+ }
+ if(cuSchedReqList->list.array[arrIdx]->resource)
+ {
+ macSchedReqCfg->schedAddModList[arrIdx].resrc =\
+ *cuSchedReqList->list.array[arrIdx]->resource;
+ }
+ }
+
+}/* End of extractSchedReqCfgToAddMod */
+
+ /*******************************************************************
+ *
+ * @brief Fills PucchCfg received by CU
+ *
+ * @details
+ *
+ * Function : extractPucchCfg
+ *
+ * Functionality: Fills PucchCfg received by CU
+ *
+ * @params[in] BWP_UplinkDedicated__pucch_Config *cuPucchCfg,
+ * PucchCfg *macPucchCfg
+ * @return ROK/RFAILED
+ *
+ * ****************************************************************/
+
+uint8_t extractPucchCfg(struct BWP_UplinkDedicated__pucch_Config *cuPucchCfg, PucchCfg *macPucchCfg)
+{
+ uint8_t arrIdx;
+
+ if(cuPucchCfg->present == BWP_UplinkDedicated__pucch_Config_PR_setup)
+ {
+ if(cuPucchCfg->choice.setup)
+ {
+ /* Resource Set Cfg */
+ if(cuPucchCfg->choice.setup->resourceSetToAddModList)
+ {
+ DU_ALLOC_SHRABL_BUF(macPucchCfg->resrcSet, sizeof(PucchResrcSetCfg));
+ if(macPucchCfg->resrcSet == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to extract Resrc set List in extractPucchCfg()");
+ return RFAILED;
+ }
+ memset(macPucchCfg->resrcSet, 0, sizeof(PucchResrcSetCfg));
+ extractResrcSetToAddModList(macPucchCfg->resrcSet, cuPucchCfg->choice.setup->resourceSetToAddModList);
+ }
+
+ /* Resource Cfg */
+ if(cuPucchCfg->choice.setup->resourceToAddModList)
+ {
+ DU_ALLOC_SHRABL_BUF(macPucchCfg->resrc, sizeof(PucchResrcCfg));
+ if(macPucchCfg->resrc == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to extract Resrc List in extractPucchCfg()");
+ return RFAILED;
+ }
+ memset(macPucchCfg->resrc, 0, sizeof(PucchResrcCfg));
+ extractResrcToAddModList(macPucchCfg->resrc, cuPucchCfg->choice.setup->resourceToAddModList);
+ }
+
+ /* Format 1 Cfg */
+ if(cuPucchCfg->choice.setup->format1)
+ {
+ DU_ALLOC_SHRABL_BUF(macPucchCfg->format1, sizeof(PucchFormatCfg));
+ if(macPucchCfg->format1 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to extract format 1 Cfg in extractPucchCfg()");
+ return RFAILED;
+ }
+ memset(macPucchCfg->format1, 0, sizeof(PucchFormatCfg));
+ extractPucchFormatCfg(macPucchCfg->format1,\
+ cuPucchCfg->choice.setup->format1->choice.setup);
+ }
+
+ /* Format 2 Cfg */
+ if(cuPucchCfg->choice.setup->format2)
+ {
+ DU_ALLOC_SHRABL_BUF(macPucchCfg->format2, sizeof(PucchFormatCfg));
+ if(macPucchCfg->format2 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to extract format 2 Cfg in extractPucchCfg()");
+ return RFAILED;
+ }
+ memset(macPucchCfg->format2, 0, sizeof(PucchFormatCfg));
+ extractPucchFormatCfg(macPucchCfg->format2,\
+ cuPucchCfg->choice.setup->format2->choice.setup);
+ }
+
+ /* Format 3 Cfg */
+ if(cuPucchCfg->choice.setup->format3)
+ {
+ DU_ALLOC_SHRABL_BUF(macPucchCfg->format3, sizeof(PucchFormatCfg));
+ if(macPucchCfg->format3 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to extract format 3 Cfg in extractPucchCfg()");
+ return RFAILED;
+ }
+ memset(macPucchCfg->format3, 0, sizeof(PucchFormatCfg));
+ extractPucchFormatCfg(macPucchCfg->format3,\
+ cuPucchCfg->choice.setup->format3->choice.setup);
+ }
+
+ /* Format 4 Cfg */
+ if(cuPucchCfg->choice.setup->format4)
+ {
+ DU_ALLOC_SHRABL_BUF(macPucchCfg->format4, sizeof(PucchFormatCfg));
+ if(macPucchCfg->format4 == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to extract format 4 Cfg in extractPucchCfg()");
+ return RFAILED;
+ }
+ memset(macPucchCfg->format4, 0, sizeof(PucchFormatCfg));
+ extractPucchFormatCfg(macPucchCfg->format4,\
+ cuPucchCfg->choice.setup->format4->choice.setup);
+ }
+
+ /* Sched Req List */
+ if(cuPucchCfg->choice.setup->schedulingRequestResourceToAddModList)
+ {
+ DU_ALLOC_SHRABL_BUF(macPucchCfg->schedReq, sizeof(PucchSchedReqCfg));
+ if(macPucchCfg->schedReq == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to extract schedReqCfg in extractPucchCfg()");
+ return RFAILED;
+ }
+ memset(macPucchCfg->schedReq, 0, sizeof(PucchSchedReqCfg));
+ extractSchedReqCfgToAddMod(macPucchCfg->schedReq,\
+ cuPucchCfg->choice.setup->schedulingRequestResourceToAddModList);
+ }
+
+ /*TODO: Add support for Spatial Info */
+
+ /* MultiCsiCfg */
+ if(cuPucchCfg->choice.setup->multi_CSI_PUCCH_ResourceList)
+ {
+ DU_ALLOC_SHRABL_BUF(macPucchCfg->multiCsiCfg, sizeof(PucchMultiCsiCfg));
+ if(macPucchCfg->multiCsiCfg == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to extract multiCsiCfg in extractPucchCfg()");
+ return RFAILED;
+ }
+ memset(macPucchCfg->multiCsiCfg, 0, sizeof(PucchMultiCsiCfg));
+ macPucchCfg->multiCsiCfg->multiCsiResrcListCount = cuPucchCfg->choice.setup->multi_CSI_PUCCH_ResourceList->list.count;
+ for(arrIdx =0; arrIdx < macPucchCfg->multiCsiCfg->multiCsiResrcListCount; arrIdx++)
+ {
+ macPucchCfg->multiCsiCfg->multiCsiResrcList[arrIdx] =\
+ *cuPucchCfg->choice.setup->multi_CSI_PUCCH_ResourceList->list.array[arrIdx];
+ }
+ }
+
+ /* Dl_DataToUL_ACK */
+ if(cuPucchCfg->choice.setup->dl_DataToUL_ACK)
+ {
+ DU_ALLOC_SHRABL_BUF(macPucchCfg->dlDataToUlAck, sizeof(PucchDlDataToUlAck));
+ if(macPucchCfg->dlDataToUlAck == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to extract Dl_DataToUL_ACK in extractPucchCfg()");
+ return RFAILED;
+ }
+ memset(macPucchCfg->dlDataToUlAck, 0, sizeof(PucchDlDataToUlAck));
+ macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount = cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.count;
+ for(arrIdx = 0; arrIdx < macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount; arrIdx++)
+ {
+ macPucchCfg->dlDataToUlAck->dlDataToUlAckList[arrIdx] =\
+ *cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.array[arrIdx];
+ }
+ }
+
+ /* Power Control */
+ if(cuPucchCfg->choice.setup->pucch_PowerControl)
+ {
+ DU_ALLOC_SHRABL_BUF(macPucchCfg->powerControl, sizeof(PucchPowerControl));
+ if(macPucchCfg->powerControl == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to extract power control in extractPucchCfg()");
+ return RFAILED;
+ }
+ extractPucchPowerControl(macPucchCfg->powerControl,\
+ cuPucchCfg->choice.setup->pucch_PowerControl);
+ }
+ }
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills ServingCellReconfig received by CU
+ *
+ * @details
+ *
+ * Function : extractSpCellDedicatedCfg
+ *
+ * Functionality: Fills ServingCellReconfig received by CU
+ *
+ * @params[in] ServingCellConfig_t *cuSrvCellCfg
+ * ServCellCfgInfo *macSrvCellCfg
+ * @return ROK/RFAILD
+ *
+ * ****************************************************************/
+uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfgInfo *macSrvCellCfg)
+{
+ uint8_t ret = ROK;
+ BWP_DownlinkDedicated_t *dlBwp = NULLP;
+ BWP_UplinkDedicated_t *ulBwp = NULLP;
+
+ if(cuSrvCellCfg->initialDownlinkBWP)
+ {
+ dlBwp = ((BWP_DownlinkDedicated_t *)(cuSrvCellCfg->initialDownlinkBWP));
+ if(dlBwp->pdcch_Config)
+ {
+ if(dlBwp->pdcch_Config->choice.setup)
+ {
+ macSrvCellCfg->initDlBwp.pdcchPresent = true;
+ extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg);
+ }
+ }
+ if(dlBwp->pdsch_Config)
+ {
+ if(dlBwp->pdsch_Config->choice.setup)
+ {
+ macSrvCellCfg->initDlBwp.pdschPresent = true;
+ extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg);
+ }
+ }
+ }
+ if(cuSrvCellCfg->firstActiveDownlinkBWP_Id)
+ macSrvCellCfg->firstActvDlBwpId = *(cuSrvCellCfg->firstActiveDownlinkBWP_Id);
+ if(cuSrvCellCfg->defaultDownlinkBWP_Id)
+ macSrvCellCfg->defaultDlBwpId = *(cuSrvCellCfg->defaultDownlinkBWP_Id);
+ if(cuSrvCellCfg->bwp_InactivityTimer)
+ {
+ if(macSrvCellCfg->bwpInactivityTmr)
+ {
+ memcpy(macSrvCellCfg->bwpInactivityTmr, cuSrvCellCfg->bwp_InactivityTimer, sizeof(uint8_t));
+ }
+ else
+ {
+ macSrvCellCfg->bwpInactivityTmr = NULLP;
+ DU_ALLOC_SHRABL_BUF(macSrvCellCfg->bwpInactivityTmr, sizeof(uint8_t));
+ if(macSrvCellCfg->bwpInactivityTmr)
+ {
+ memcpy(macSrvCellCfg->bwpInactivityTmr, cuSrvCellCfg->bwp_InactivityTimer, sizeof(uint8_t));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> F1AP : Memory Alloc failed for bwpInactivityTmr at extractSpCellDedicatedCfg()");
+ return RFAILED;
+ }
+ }
+ }
+ if(cuSrvCellCfg->pdsch_ServingCellConfig)
+ {
+ if(cuSrvCellCfg->pdsch_ServingCellConfig->choice.setup)
+ {
+ ret = extractPdschServingCellCfg(cuSrvCellCfg->pdsch_ServingCellConfig->choice.setup, &macSrvCellCfg->pdschServCellCfg);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at extractPdschServingCellCfg()");
+ return RFAILED;
+ }
+ }
+ }
+ if(cuSrvCellCfg->uplinkConfig)
+ {
+ if(cuSrvCellCfg->uplinkConfig->initialUplinkBWP)
+ {
+ ulBwp = ((BWP_UplinkDedicated_t *)(cuSrvCellCfg->uplinkConfig->initialUplinkBWP));
+ if(ulBwp->pusch_Config)
+ {
+ macSrvCellCfg->initUlBwp.puschPresent = true;
+ extractPuschCfg(ulBwp->pusch_Config, &macSrvCellCfg->initUlBwp.puschCfg);
+ }
+ if(ulBwp->pucch_Config)
+ {
+ macSrvCellCfg->initUlBwp.pucchPresent = true;
+ memset(&macSrvCellCfg->initUlBwp.pucchCfg, 0, sizeof(PucchCfg));
+ extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg);
+ }
+ }
+ if(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id)
+ macSrvCellCfg->firstActvUlBwpId = *(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id);
+ }
+ return ret;
+}
+/*******************************************************************
+ *
+ * @brief Fills Reconfig Cell group Info received by CU
+ *
+ * @details
+ *
+ * Function : extractUeReCfgCellInfo
+ *
+ * Functionality: Fills Reconfig Cell group Info received by CU
+ *
+ * @params[in] CellGroupConfigRrc_t *macCellGrpCfg
+ * MacUeCfg* macUeCfg
+ * @return ROK/RFAILED
+ *
+ * ****************************************************************/
+uint8_t extractUeReCfgCellInfo(CellGroupConfigRrc_t *cellGrp, MacUeCfg *macUeCfg)
+{
+ uint8_t ret = ROK;
+ MAC_CellGroupConfig_t *macCellGroup = NULLP;
+ PhysicalCellGroupConfig_t *phyCellGrpCfg = NULLP;
+ SpCellConfig_t *spcellCfg = NULLP;
+ ServingCellConfig_t *servCellCfg = NULLP;
+
+ if(cellGrp)
+ {
+ /* Fill MacCell Group Reconfig */
+ if(cellGrp->mac_CellGroupConfig)
+ {
+ macCellGroup = ((MAC_CellGroupConfig_t *)(cellGrp->mac_CellGroupConfig));
+ if(macCellGroup->schedulingRequestConfig)
+ {
+ extractSchReqReConfig(macCellGroup->schedulingRequestConfig, &macUeCfg->macCellGrpCfg.schReqCfg);
+ }
+ if(macCellGroup->tag_Config)
+ {
+ extractTagReconfig(macCellGroup->tag_Config, &macUeCfg->macCellGrpCfg.tagCfg);
+ }
+ if(macCellGroup->bsr_Config)
+ {
+ macUeCfg->macCellGrpCfg.bsrTmrCfg.periodicTimer = macCellGroup->bsr_Config->periodicBSR_Timer;
+ macUeCfg->macCellGrpCfg.bsrTmrCfg.retxTimer = macCellGroup->bsr_Config->retxBSR_Timer;
+ if(macCellGroup->bsr_Config->logicalChannelSR_DelayTimer)
+ {
+ macUeCfg->macCellGrpCfg.bsrTmrCfg.srDelayTimer =\
+ *(macCellGroup->bsr_Config->logicalChannelSR_DelayTimer);
+ }
+ }
+ if(macCellGroup->phr_Config)
+ {
+ if(macCellGroup->phr_Config->present == MAC_CellGroupConfig__phr_Config_PR_setup)
+ {
+ macUeCfg->macCellGrpCfg.phrCfgSetupPres = true;
+ if(macCellGroup->phr_Config->choice.setup)
+ {
+ macUeCfg->macCellGrpCfg.phrCfg.periodicTimer = \
+ macCellGroup->phr_Config->choice.setup->phr_PeriodicTimer;
+ macUeCfg->macCellGrpCfg.phrCfg.prohibitTimer = \
+ macCellGroup->phr_Config->choice.setup->phr_ProhibitTimer;
+ macUeCfg->macCellGrpCfg.phrCfg.txPowerFactor = \
+ macCellGroup->phr_Config->choice.setup->phr_Tx_PowerFactorChange;
+ macUeCfg->macCellGrpCfg.phrCfg.multiplePHR = \
+ macCellGroup->phr_Config->choice.setup->multiplePHR;
+ macUeCfg->macCellGrpCfg.phrCfg.dummy = \
+ macCellGroup->phr_Config->choice.setup->dummy;
+ macUeCfg->macCellGrpCfg.phrCfg.phrType2OtherCell = \
+ macCellGroup->phr_Config->choice.setup->phr_Type2OtherCell;
+ macUeCfg->macCellGrpCfg.phrCfg.phrOtherCG = \
+ macCellGroup->phr_Config->choice.setup->phr_ModeOtherCG;
+ }
+ }
+ }
+ }
+ /* Fill Physical Cell Group Reconfig */
+ if(cellGrp->physicalCellGroupConfig)
+ {
+ phyCellGrpCfg = ((PhysicalCellGroupConfig_t *)(cellGrp->physicalCellGroupConfig));
+ if(phyCellGrpCfg->p_NR_FR1)
+ {
+ if(*(phyCellGrpCfg->p_NR_FR1) != macUeCfg->phyCellGrpCfg.pNrFr1)
+ macUeCfg->phyCellGrpCfg.pNrFr1 = *(phyCellGrpCfg->p_NR_FR1);
+ }
+ macUeCfg->phyCellGrpCfg.pdschHarqAckCodebook = phyCellGrpCfg->pdsch_HARQ_ACK_Codebook;
+ }
+ /* Fill SpCell Reconfig */
+ if(cellGrp->spCellConfig)
+ {
+ spcellCfg = ((SpCellConfig_t *)(cellGrp->spCellConfig));
+ if(spcellCfg->servCellIndex)
+ {
+ macUeCfg->spCellCfg.servCellIdx = *(spcellCfg->servCellIndex);
+ }
+ /* Fill Serving cell Reconfig info */
+ if(cellGrp->spCellConfig->spCellConfigDedicated)
+ {
+ servCellCfg = ((ServingCellConfig_t *)(cellGrp->spCellConfig->spCellConfigDedicated));
+ ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at extractSpCellDedicatedCfg()");
+ }
+ }
+ }
+ }
+ return ret;
+}
+/*******************************************************************
+*
+* @brief free the memory allocated by decoder
+*
+* @details
+*
+* Function : freeAperDecodeNrcgi
+*
+* Functionality: Free Nrcgi values
+*
+* @params[in] NRCGI_t *nrcgi
+* @return void
+*
+* ****************************************************************/
+
+
+void freeAperDecodeNrcgi(NRCGI_t *nrcgi)
+{
+ if(nrcgi->pLMN_Identity.buf != NULLP)
+ {
+ free(nrcgi->pLMN_Identity.buf);
+ }
+ if(nrcgi->nRCellIdentity.buf != NULLP)
+ {
+ free(nrcgi->nRCellIdentity.buf);
+ }
+}
+/*******************************************************************
+*
+* @brief free the memory allocated by decoder
+*
+* @details
+*
+* Function : freeAperDecodeCuToDuInfo
+*
+* Functionality: Free Cu To Du Information
+*
+* @params[in] CUtoDURRCInformation_t *rrcMsg
+* @return void
+*
+* ****************************************************************/
+
+
+void freeAperDecodeCuToDuInfo(CUtoDURRCInformation_t *rrcMsg)
+{
+ uint8_t ieIdx =0;
+ uint8_t arrIdx =0;
+
+ if(rrcMsg->uE_CapabilityRAT_ContainerList)
+ {
+ if(rrcMsg->uE_CapabilityRAT_ContainerList->buf)
+ free(rrcMsg->uE_CapabilityRAT_ContainerList->buf);
+ free(rrcMsg->uE_CapabilityRAT_ContainerList);
+ }
+
+ if(rrcMsg->iE_Extensions)
+ {
+ if(rrcMsg->iE_Extensions->list.array)
+ {
+ for(ieIdx= 0; ieIdx < rrcMsg->iE_Extensions->list.count; ieIdx++)
+ {
+ if(rrcMsg->iE_Extensions->list.array[ieIdx])
+ {
+ switch(rrcMsg->iE_Extensions->list.array[ieIdx]->id)
+ {
+ case ProtocolIE_ID_id_CellGroupConfig:
+ if(rrcMsg->iE_Extensions->list.array[ieIdx]->extensionValue.choice.CellGroupConfig.buf != NULLP)
+ {
+ free(rrcMsg->iE_Extensions->list.array[ieIdx]->extensionValue.choice.CellGroupConfig.buf);
+ }
+ break;
+ default:
+ DU_LOG("\nERROR --> F1AP : Invalid Event type %ld at FreeCuToDuInfo()", \
+ rrcMsg->iE_Extensions->list.array[ieIdx]->id);
+ break;
+ }
+ }
+ }
+ for(arrIdx = 0; arrIdx < ieIdx; arrIdx++)
+ {
+ free(rrcMsg->iE_Extensions->list.array[arrIdx]);
+ }
+ free(rrcMsg->iE_Extensions->list.array);
+
+ }
+
+ free(rrcMsg->iE_Extensions);
+ }
+}
+/*******************************************************************
+*
+* @brief free the memory allocated by decoder
+*
+* @details
+*
+* Function : freeAperDecodeSplCellList
+*
+* Functionality: Free Spl Cell List
+ where memory allocated by aper_decoder
+*
+* @params[in] SCell_ToBeSetup_List_t *spCellLst
+* @return void
+*
+* ****************************************************************/
+
+
+void freeAperDecodeSplCellList(SCell_ToBeSetup_List_t *spCellLst)
+{
+ uint8_t cellIdx =0;
+
+ if(spCellLst->list.array != NULLP)
+ {
+ for(cellIdx=0; cellIdx<spCellLst->list.count; cellIdx++)
+ {
+ if(cellIdx==0&&spCellLst->list.array[cellIdx]!=NULLP)
+ {
+ freeAperDecodeNrcgi(&spCellLst->list.array[cellIdx]->value.choice.SCell_ToBeSetup_Item.sCell_ID);
+ }
+ if(spCellLst->list.array[cellIdx]!=NULLP)
+ {
+ free(spCellLst->list.array[cellIdx]);
+ }
+ }
+ free(spCellLst->list.array);
+ }
+}
+/*******************************************************************
+*
+* @brief free the memory allocated by decoder
+*
+* @details
+*
+* Function : freeAperDecodeSRBSetup
+*
+* Functionality: added free part for the memory allocated by aper_decoder
+*
+* @params[in] SRBs_ToBeSetup_List_t *srbSet
+* @return void
+*
+****************************************************************/
+
+
+void freeAperDecodeSRBSetup(SRBs_ToBeSetup_List_t *srbSet)
+{
+ uint8_t srbIdx =0;
+ if(srbSet->list.array != NULLP)
+ {
+ for(srbIdx=0; srbIdx<srbSet->list.count; srbIdx++)
+ {
+ if(srbSet->list.array[srbIdx]!=NULLP)
+ {
+ free(srbSet->list.array[srbIdx]);
+ }
+ }
+ free(srbSet->list.array);
+ }
+}
+
+/*******************************************************************
+*
+* @brief free the memory allocated by decoder
+*
+* @details
+*
+* Function : freeAperDecodeULTnlInfo
+*
+* Functionality: added free part for the memory allocated by aper_decoder
+*
+* @params[in] ULUPTNLInformation_ToBeSetup_List_t *ulInfo
+* @return void
+*
+* ****************************************************************/
+
+
+void freeAperDecodeULTnlInfo(ULUPTNLInformation_ToBeSetup_List_t *ulInfo)
+{
+ uint8_t ulIdx=0;
+ if(ulInfo->list.array != NULLP)
+ {
+ for(ulIdx=0; ulIdx<ulInfo->list.count; ulIdx++)
+ {
+ if(ulIdx==0&&ulInfo->list.array[ulIdx]!=NULLP)
+ {
+ if(ulInfo->list.array[ulIdx]->uLUPTNLInformation.choice.gTPTunnel!=NULLP)
+ {
+ if(ulInfo->list.array[ulIdx]->uLUPTNLInformation.choice.gTPTunnel->\
+ transportLayerAddress.buf != NULLP)
+ {
+ if(ulInfo->list.array[ulIdx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf\
+ !=NULLP)
+ {
+ free(ulInfo->list.array[ulIdx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf);
+ }
+ free(ulInfo->list.array[ulIdx]->uLUPTNLInformation.choice.gTPTunnel->\
+ transportLayerAddress.buf);
+ }
+ free(ulInfo->list.array[ulIdx]->uLUPTNLInformation.choice.gTPTunnel);
+ }
+ }
+ if(ulInfo->list.array[ulIdx]!=NULLP)
+ {
+ free(ulInfo->list.array[ulIdx]);
+ }
+ }
+ free(ulInfo->list.array);
+ }
+}
+/*******************************************************************
+*
+* @brief free the memory allocated by decoder
+*
+* @details
+*
+* Function : freeAperDecodeDRBSetup
+*
+* Functionality: free DRBSetup which is allocated by decoder
+*
+* @params[in] DRBs_ToBeSetup_List_t *drbSet
+* @return void
+*
+* ****************************************************************/
+
+void freeAperDecodeDRBSetup(DRBs_ToBeSetup_List_t *drbSet)
+{
+ DRBs_ToBeSetup_Item_t *drbSetItem = NULLP;
+ uint8_t flowIdx =0;
+ uint8_t drbIdx =0;
+
+ if(drbSet->list.array != NULLP)
+ {
+ for(drbIdx=0; drbIdx<drbSet->list.count; drbIdx++)
+ {
+ if(drbIdx==0&&drbSet->list.array[drbIdx] != NULLP)
+ {
+ drbSetItem =&drbSet->list.array[drbIdx]->value.choice.DRBs_ToBeSetup_Item;
+ if(drbSetItem->qoSInformation.choice.choice_extension != NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI !=NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow!=NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume!=NULLP)
+ {
+
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.buf!=NULLP)
+ {
+
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD!=NULLP)
+ {
+
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD->\
+ buf!=NULLP)
+ {
+
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.\
+ flows_Mapped_To_DRB_List.list.array != NULLP)
+ {
+
+ for(flowIdx=0;flowIdx<drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.count; flowIdx++)
+ {
+
+ if(flowIdx==0&&drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]!=NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
+ qoSFlowLevelQoSParameters.\
+ qoS_Characteristics.choice.non_Dynamic_5QI!=NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
+ qoSFlowLevelQoSParameters.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow!=NULLP)
+ {
+
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
+ qoSFlowLevelQoSParameters.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume!=NULLP)
+ {
+
+
+ free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
+ qoSFlowLevelQoSParameters.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume);
+ }
+
+ free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
+ qoSFlowLevelQoSParameters.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow);
+ }
+
+ free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
+ qoSFlowLevelQoSParameters.\
+ qoS_Characteristics.choice.non_Dynamic_5QI);
+ }
+ }
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]!=NULLP)
+ {
+
+ free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]);
+ }
+ }
+
+ free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array);
+ }
+
+ free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.sNSSAI.sD->buf);
+ }
+
+ free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD);
+ }
+
+ free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.buf);
+
+ }
+
+ free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+
+ qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume);
+ }
+
+ free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow);
+ }
+
+ free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI);
+ }
+ free(drbSetItem->qoSInformation.choice.choice_extension);
+ }
+ freeAperDecodeULTnlInfo(&drbSetItem->uLUPTNLInformation_ToBeSetup_List);
+ if(drbSetItem->uLConfiguration)
+ {
+ free(drbSetItem->uLConfiguration);
+ }
+ }
+ if(drbSet->list.array[drbIdx]!=NULLP)
+ {
+ free(drbSet->list.array[drbIdx]);
+ }
+ }
+ free(drbSet->list.array);
+ }
+}
+
+
+/*******************************************************************
+ *
+ * @brief builds Mac Cell Cfg
+ *
+ * @details
+ *
+ * Function : procUeReCfgCellInfo
+ *
+ * Functionality: builds Mac Cell Cfg
+ *
+ * @params[in] MacUeCfg pointer
+ * void pointer
+ *
+ * @return void
+ *
+ * ****************************************************************/
+uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfg, void *cellInfo)
+{
+ uint8_t ret = ROK;
+ CellGroupConfigRrc_t *cellGrp = NULLP;
+
+ if(cellInfo)
+ {
+ cellGrp = (CellGroupConfigRrc_t *)cellInfo;
+ ret = extractUeReCfgCellInfo(cellGrp, macUeCfg);
+ if(ret == RFAILED)
+ DU_LOG("\nERROR --> F1AP : Failed at procUeReCfgCellInfo()");
+ }
+ if(ret == RFAILED)
+ {
+ freeUeReCfgCellGrpInfo(macUeCfg);
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Filling modulation info in mac ue cfg
+ *
+ * @details
+ *
+ * Function : duFillModulationDetails
+ *
+ * Functionality: Filling modulation info in mac ue cfg
+ *
+ * @params[in] MAC UE Config to be updated
+ * Current UE configuration
+ * UE NR capability from CU
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+void duFillModulationDetails(MacUeCfg *ueCfg, MacUeCfg *oldUeCfg, void *ueCap)
+{
+ UE_NR_Capability_t *ueNrCap;
+
+ if(ueCap)
+ ueNrCap = (UE_NR_Capability_t *)ueCap;
+
+ /* Filling DL modulation info */
+ if(ueNrCap->featureSets && ueNrCap->featureSets->featureSetsDownlinkPerCC && \
+ ueNrCap->featureSets->featureSetsDownlinkPerCC->list.array[0] && \
+ ueNrCap->featureSets->featureSetsDownlinkPerCC->list.array[0]->supportedModulationOrderDL)
+ {
+ switch(*(ueNrCap->featureSets->featureSetsDownlinkPerCC->list.array[0]->supportedModulationOrderDL))
+ {
+ case ModulationOrder_qpsk:
+ {
+ ueCfg->dlModInfo.modOrder = MOD_ORDER_QPSK;
+ break;
+ }
+ case ModulationOrder_qam16:
+ {
+ ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM16;
+ break;
+ }
+ case ModulationOrder_qam64:
+ {
+ ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM64;
+ ueCfg->dlModInfo.mcsIndex = PDSCH_MCS_INDEX;
+ ueCfg->dlModInfo.mcsTable = MCS_TABLE_QAM64;
+ break;
+ }
+ case ModulationOrder_qam256:
+ {
+ ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM256;
+ break;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> DU APP: Incorrect downlink modulation order received. Reatining old modulation configuration");
+ memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo));
+ break;
+ }
+ }
+ }
+ else
+ {
+ memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo));
+ }
+
+ /* Filling UL modulation info */
+ if(ueNrCap->featureSets && ueNrCap->featureSets->featureSetsUplinkPerCC && \
+ ueNrCap->featureSets->featureSetsUplinkPerCC->list.array[0] && \
+ ueNrCap->featureSets->featureSetsUplinkPerCC->list.array[0]->supportedModulationOrderUL)
+ {
+ switch(*(ueNrCap->featureSets->featureSetsUplinkPerCC->list.array[0]->supportedModulationOrderUL))
+ {
+ case ModulationOrder_qpsk:
+ {
+ ueCfg->ulModInfo.modOrder = MOD_ORDER_QPSK;
+ break;
+ }
+ case ModulationOrder_qam16:
+ {
+ ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM16;
+ ueCfg->ulModInfo.mcsIndex = PUSCH_MCS_INDEX;
+ ueCfg->ulModInfo.mcsTable = MCS_TABLE_QAM64;
+ break;
+ }
+ case ModulationOrder_qam64:
+ {
+ ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM64;
+ break;
+ }
+ case ModulationOrder_qam256:
+ {
+ ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM256;
+ break;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> DU APP: Incorrect uplink modulation order received. Reatining old modulation configuration");
+ memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo));
+ break;
+ }
+ }
+ }
+ else
+ {
+ memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo));
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Function to extract cellGrp Info present in cutoDu cont
+ *
+ * @details
+ *
+ * Function : extractCellGrpInfo
+ *
+ * Functionality: Function to extract cellGrp Info present
+ * in cutoDu cont
+ *
+ * @params[in] ProtocolExtensionContainer_4624P16_t pointer
+ *
+ * @return CellGroupConfigRrc_t *
+ *
+ * ****************************************************************/
+
+CellGroupConfigRrc_t *extractCellGrpInfo(ProtocolExtensionContainer_4624P16_t *protocolIeExtn,\
+ DuUeCfg *ueCfgDb)
+{
+ uint8_t idx2 =0;
+ uint16_t id =0;
+ uint16_t recvBufLen =0;
+ CellGroupConfigRrc_t *cellGrpCfg = NULLP;
+ CUtoDURRCInformation_ExtIEs_t *extIeInfo = NULLP;
+ asn_dec_rval_t rval; /* Decoder return value */
+ memset(&rval, 0, sizeof(asn_dec_rval_t));
+
+ if(protocolIeExtn)
+ {
+ for(idx2 = 0; idx2 < protocolIeExtn->list.count; idx2++)
+ {
+ extIeInfo = ((CUtoDURRCInformation_ExtIEs_t *)(protocolIeExtn->list.array[idx2]));
+ id = extIeInfo->id;
+ switch(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)
+ {
+ DU_LOG("\nERROR --> F1AP : ASN decode failed at decodeCellGrpCfg()");
+ return NULLP;
+ }
+ xer_fprint(stdout, &asn_DEF_CellGroupConfigRrc, cellGrpCfg);
+ if(extractRlcCfgToAddMod(cellGrpCfg->rlc_BearerToAddModList, ueCfgDb))
+ return NULLP;
+ }
+ break;
+ }
+ default:
+ DU_LOG("\nERROR --> F1AP : Invalid IE received CUtoDURRCInformation:%d at decodeCellGrpCfg()", id);
+ break;
+ }
+ }
+ }
+ return cellGrpCfg;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills Srb List received by CU
+ *
+ * @details
+ *
+ * Function : procSrbListToSetup
+ *
+ * Functionality: Fills Srb List received by CU
+ *
+ * @params[in] SRBs_ToBeSetup_Item_t *cuSrbItem
+ * LcCfg pointer
+ * RlcBearerCfg pointer
+ * @return void
+ *
+ * ****************************************************************/
+uint8_t procSrbListToSetup(SRBs_ToBeSetup_Item_t * srbItem, LcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd)
+{
+ uint8_t ret = ROK;
+
+ /* Filling RLC INFO */
+ procRlcLcCfg(srbItem->sRBID, srbItem->sRBID, RB_TYPE_SRB, RLC_AM, CONFIG_ADD, NULL, rlcLcToAdd);
+
+ /* Filling MAC INFO */
+ ret = procMacLcCfg(srbItem->sRBID, RB_TYPE_SRB, CONFIG_ADD, NULL,NULL, NULL, macLcToAdd, NULL);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at MAC LC Cfg in procSrbListToSetup()");
+ return ret;
+ }
+ return ret;
+}
+
+
+
+/*******************************************************************
+ *
+ * @brief extract Srb List received by CU
+ *
+ * @details
+ *
+ * Function : extractSrbListToSetup
+ *
+ * Functionality: extract Srb List received by CU
+ * for both MAC and RLC
+ *
+ * @params[in] SRBs_ToBeSetup_Item_t pointer
+ * DuUeCfg pointer
+ * @return ROK/RFAIED
+ *
+ * ****************************************************************/
+
+uint8_t extractSrbListToSetup(SRBs_ToBeSetup_List_t *srbCfg, DuUeCfg *ueCfgDb)
+{
+ uint8_t ret, srbIdx;
+ SRBs_ToBeSetup_Item_t *srbItem = NULLP;
+
+ if(srbCfg)
+ {
+ for(srbIdx = 0; srbIdx < srbCfg->list.count; srbIdx++)
+ {
+ 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;
+ }
+ 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++;
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> F1AP: Failed at extractSrbListToSetup()");
+ break;
+ }
+ }
+ }
+ else
+ ret = RFAILED;
+
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills Drb List received by CU
+ *
+ * @details
+ *
+ * Function : procDrbListToSetup
+ *
+ * Functionality: Fills Drb List received by CU
+ * for both MAC and RLC
+ *
+ * @params[in] SRBs_ToBeSetup_Item_t pointer
+ * LcCfg pointer,
+ * RlcBearerCfg pointer
+ * @return void
+ *
+ * ****************************************************************/
+
+uint8_t procDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbItem,\
+DRBs_ToBeSetupMod_Item_t *drbSetupModItem, LcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd, UpTnlCfg *upTnlInfo)
+{
+
+ if(drbItem != NULLP)
+ {
+ /* Filling RLC INFO */
+ procRlcLcCfg(drbItem->dRBID, lcId, RB_TYPE_DRB, drbItem->rLCMode, CONFIG_ADD, NULL, rlcLcToAdd);
+
+ /* Filling MAC INFO */
+ if(procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_ADD, drbItem, NULL, NULL, macLcToAdd, upTnlInfo) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at RLC LC Cfg in procDrbListToSetup()");
+ return RFAILED;
+ }
+ }
+ else if(drbSetupModItem != NULLP)
+ {
+ procRlcLcCfg(drbSetupModItem->dRBID, lcId, RB_TYPE_DRB, drbSetupModItem->rLCMode, CONFIG_ADD, NULL, rlcLcToAdd);
+
+ if(procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_ADD, NULL, drbSetupModItem, NULL, macLcToAdd, upTnlInfo) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at RLC LC Cfg in procDrbListToSetup()");
+ return RFAILED;
+ }
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief extract Drb List received by CU
+ *
+ * @details
+ *
+ * Function : extractDrbListToSetup
+ *
+ * Functionality: extract Drb List received by CU
+ * for both MAC and RLC
+ *
+ * @params[in] DRBs_ToBeSetup_Item_t pointer
+ * DuUeCfg pointer
+ * @return ROK/RFAIED
+ *
+ * ****************************************************************/
+
+uint8_t extractDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_List_t *drbCfg,DRBs_ToBeSetupMod_List_t *drbSetupModCfg,\
+uint8_t drbCount, DuUeCfg *ueCfgDb)
+{
+ uint8_t ret, drbIdx;
+ DRBs_ToBeSetup_Item_t *drbItem = NULLP;
+ DRBs_ToBeSetupMod_ItemIEs_t *drbSetupModItem = NULLP;
+
+ ret = ROK;
+ if(drbCount > 0)
+ {
+ for(drbIdx = 0; drbIdx < drbCount; drbIdx++)
+ {
+ if(ueCfgDb->numMacLcs > MAX_NUM_LC)
+ {
+ DU_LOG("\nERROR --> F1AP : MAX LC Reached in MAC at extractDrbListToSetup()");
+ ret = RFAILED;
+ break;
+ }
+ if(ueCfgDb->numRlcLcs > MAX_NUM_LC)
+ {
+ DU_LOG("\nERROR --> F1AP : MAX LC Reached in RLC at extractDrbListToSetup()");
+ ret = RFAILED;
+ break;
+ }
+ memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(LcCfg));
+ memset(&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], 0, sizeof(RlcBearerCfg));
+
+ if(drbCfg != NULL)
+ {
+ drbItem = &drbCfg->list.array[drbIdx]->value.choice.DRBs_ToBeSetup_Item;
+ ret = procDrbListToSetup(lcId, drbItem, NULL, &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs],\
+ &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], &ueCfgDb->upTnlInfo[ueCfgDb->numDrb]);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetup()");
+ break;
+ }
+ }
+ else if(drbSetupModCfg != NULL)
+ {
+ drbSetupModItem = (DRBs_ToBeSetupMod_ItemIEs_t *) drbSetupModCfg->list.array[drbIdx];
+ ret = procDrbListToSetup(lcId, NULL, &(drbSetupModItem->value.choice.DRBs_ToBeSetupMod_Item) ,\
+ &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs],\
+ &ueCfgDb->upTnlInfo[ueCfgDb->numDrb]);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetup()");
+ break;
+ }
+ }
+ ueCfgDb->numRlcLcs++;
+ ueCfgDb->numMacLcs++;
+ ueCfgDb->numDrb++;
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetup()");
+ break;
+ }
+ }
+ }
+ else
+ ret = RFAILED;
+
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Function to extract Dl RRC Msg received from CU
+ *
+ * @details
+ *
+ * Function : extractDlRrcMsg
+ *
+ * Functionality: Function to extract Dl RRC Msg received from CU
+ *
+ * @params[in] F1AP message
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t extractDlRrcMsg(uint32_t gnbDuUeF1apId, uint32_t gnbCuUeF1apId, \
+ F1DlRrcMsg *dlRrcMsg, RRCContainer_t *rrcContainer)
+{
uint8_t ret = ROK;
- CellGroupConfigRrc_t *cellGrp = NULLP;
+ dlRrcMsg->rrcMsgSize = rrcContainer->size;
+ if(dlRrcMsg->rrcMsgSize > 0)
+ {
+ DU_ALLOC_SHRABL_BUF(dlRrcMsg->rrcMsgPdu, dlRrcMsg->rrcMsgSize);
+ if(!dlRrcMsg->rrcMsgPdu)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for RRC Msg in extractDlRrcMsg()");
+ ret = RFAILED;
+ }
+ else
+ {
+ dlRrcMsg->gnbDuUeF1apId = gnbDuUeF1apId;
+ dlRrcMsg->gnbCuUeF1apId = gnbCuUeF1apId;
+ dlRrcMsg->srbId = SRB1_LCID;
+ memcpy(dlRrcMsg->rrcMsgPdu, rrcContainer->buf, dlRrcMsg->rrcMsgSize);
+ }
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Extract UE capability info
+ *
+ * @details
+ *
+ * Function : extractUeCapability
+ *
+ * Functionality: Extract UE capability info and stores in ue Cb
+ *
+ * @params[in] Octet string of UE capability RAT container list
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+UE_NR_Capability_t *extractUeCapability(UE_CapabilityRAT_ContainerList_t *ueCapablityListBuf, DuUeCb *ueCb)
+{
+ uint8_t idx;
+ uint16_t recvBufLen;
+ asn_dec_rval_t rval;
+ UE_NR_Capability_t *ueNrCap = NULLP;
+ UE_CapabilityRAT_ContainerListRRC_t *ueCapRatContList = NULLP;
+
+ /* Decoding UE Capability RAT Container List */
+ recvBufLen = ueCapablityListBuf->size;
+ DU_ALLOC(ueCapRatContList, sizeof(UE_CapabilityRAT_ContainerListRRC_t));
+ if(!ueCapRatContList)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in extractUeCapability");
+ return NULLP;
+ }
+ 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,
+ ueCapablityListBuf->buf, recvBufLen, 0, 0);
+ if(rval.code == RC_FAIL || rval.code == RC_WMORE)
+ {
+ DU_LOG("\nERROR --> F1AP : ASN decode failed at decodeCellGrpCfg()");
+ return NULLP;
+ }
+ xer_fprint(stdout, &asn_DEF_UE_CapabilityRAT_ContainerListRRC, ueCapRatContList);
+
+ /* Free encoded buffer after decoding */
+
+ for(idx = 0; idx < ueCapRatContList->list.count; idx++)
+ {
+ if(ueCapRatContList->list.array[idx]->rat_Type == RAT_Type_nr)
+ {
+ /* Decoding UE NR Capability */
+ recvBufLen = ueCapRatContList->list.array[idx]->ue_CapabilityRAT_Container.size;
+ DU_ALLOC(ueNrCap, sizeof(UE_NR_Capability_t));
+ if(!ueNrCap)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in extractUeCapability");
+ DU_FREE(ueCapRatContList, sizeof(UE_CapabilityRAT_ContainerListRRC_t));
+ return NULLP;
+ }
+ 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,
+ ueCapRatContList->list.array[idx]->ue_CapabilityRAT_Container.buf, recvBufLen, 0, 0);
+ if(rval.code == RC_FAIL || rval.code == RC_WMORE)
+ {
+ DU_LOG("\nERROR --> F1AP : ASN decode failed at decodeCellGrpCfg()");
+ return NULLP;
+ }
+ xer_fprint(stdout, &asn_DEF_UE_NR_Capability, ueNrCap);
+
+ /* Free encoded buffer after decoding */
+ free(ueCapRatContList->list.array[idx]->ue_CapabilityRAT_Container.buf);
+ }
+ free(ueCapRatContList->list.array[idx]);
+ }
+
+ /* Free Memory*/
+ free(ueCapRatContList->list.array);
+ DU_FREE(ueCapRatContList, sizeof(UE_CapabilityRAT_ContainerListRRC_t));
+ return ueNrCap;
+}
+
+/*******************************************************************
+*
+* @brief free UE context setup request from CU
+*
+* @details
+*
+* Function : freeAperDecodeF1UeContextSetupReq
+*
+* Functionality: freeing part for the memory allocated by aper_decoder
+*
+* @params[in] F1AP message
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+void freeAperDecodeF1UeContextSetupReq(UEContextSetupRequest_t *ueSetReq)
+{
+ uint8_t ieIdx = 0;
+
+ if(ueSetReq->protocolIEs.list.array != NULLP)
+ {
+ 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:
+
+ 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:
+
+ 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:
+ {
+
+ 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);
+ }
+}
+/*******************************************************************
+ *
+ * @brief Process UE context setup request from CU
+ *
+ * @details
+ *
+ * Function : procF1UeContextSetupReq
+ *
+ * Functionality: Process UE context setup request from CU
+ *
+ * @params[in] F1AP message
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
+{
+ uint8_t ret=0, ieIdx=0, ueIdx=0, lcId=0, cellIdx=0;
+ bool ueCbFound = false;
+ uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId=0, bitRateSize=0;
+ DuUeCb *duUeCb = NULL;
+ UEContextSetupRequest_t *ueSetReq = NULL;
+ DRBs_ToBeSetup_List_t *drbCfg = NULL;
+
+ ret = ROK;
+
+ ueSetReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextSetupRequest;
+ for(ieIdx=0; (ieIdx < ueSetReq->protocolIEs.list.count && ret == ROK); ieIdx++)
+ {
+ switch(ueSetReq->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+ {
+ 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_ServCellIndex:
+ {
+ cellIdx = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.ServCellIndex;
+ for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
+ {
+ if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
+ (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
+ {
+ DU_LOG("\nERROR --> F1AP: Memory Alloc Failed at procF1UeContextSetupReq()");
+ ret = RFAILED;
+ }
+ }
+ else
+ ueCbFound = false;
+
+ }
+ if(!ueCbFound)
+ {
+ DU_LOG("\nERROR --> F1AP: DuUeCb is not found at procF1UeContextSetupReq()");
+ ret = RFAILED;
+ }
+ 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)
+ {
+ duUeCb->f1UeDb->duUeCfg.ueNrCapability = \
+ extractUeCapability(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation.\
+ uE_CapabilityRAT_ContainerList, duUeCb);
+ }
+ if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation.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)
+ {
+ DU_LOG("\nERROR --> F1AP: Failed to extract cell Grp Info");
+ //TODO: Update the failure cause in ue context Setup Response
+ ret = RFAILED;
+ }
+ }
+ break;
+ }
+ case ProtocolIE_ID_id_SCell_ToBeSetup_List:
+ {
+ DU_LOG("\nINFO --> DU_APP: Received SCell_ToBeSetup_List but Not processing the list");
+ break;
+ }
+ case ProtocolIE_ID_id_SRBs_ToBeSetup_List:
+ {
+ if(extractSrbListToSetup(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.SRBs_ToBeSetup_List,\
+ &duUeCb->f1UeDb->duUeCfg))
+ {
+ DU_LOG("\nERROR --> DU APP : Failed at extractSrbListToSetup()");
+ //TODO: Update the failure cause in ue context Setup Response
+ ret = RFAILED;
+ }
+ break;
+ }
+ case ProtocolIE_ID_id_DRBs_ToBeSetup_List:
+ {
+ lcId = getDrbLcId(&duUeCb->drbBitMap);
+ if(lcId != RFAILED)
+ {
+ drbCfg = &ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRBs_ToBeSetup_List;
+ if(extractDrbListToSetup(lcId, drbCfg, NULL, drbCfg->list.count, &duUeCb->f1UeDb->duUeCfg))
+ {
+ DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetup()");
+ //TODO: Update the failure cause in ue context Setup Response
+ ret = RFAILED;
+ }
+ }
+ else
+ ret = RFAILED;
+ break;
+ }
+ case ProtocolIE_ID_id_RRCContainer:
+ {
+ /* Filling Dl RRC Msg Info */
+ DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
+ if(!duUeCb->f1UeDb->dlRrcMsg)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for DL RRC Msg in procUeCtxtSetupReq()");
+ ret = RFAILED;
+ }
+ else
+ {
+ memset(duUeCb->f1UeDb->dlRrcMsg, 0, sizeof(F1DlRrcMsg));
+ ret = extractDlRrcMsg(gnbDuUeF1apId, gnbCuUeF1apId, duUeCb->f1UeDb->dlRrcMsg,\
+ &ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer);
+ }
+ break;
+ }
+ case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
+ {
+ 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 */
+ bitRateSize = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.size;
+ if(bitRateSize > 0)
+ {
+ DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->duUeCfg.ambrCfg, bitRateSize);
+ if(!duUeCb->f1UeDb->duUeCfg.ambrCfg)
+ {
+ DU_LOG("\nERROR --> DU APP : Memory allocation failed for bitRate in procUeCtxtSetupReq");
+ ret = RFAILED;
+ }
+ else
+ {
+ memset(duUeCb->f1UeDb->duUeCfg.ambrCfg, 0, sizeof(AmbrCfg));
+ memcpy(&duUeCb->f1UeDb->duUeCfg.ambrCfg->ulBr,
+ ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf, bitRateSize);
+ }
+ }
+ else
+ ret = RFAILED;
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+ }
+ if(ret == RFAILED)
+ {
+ /*TODO : Negative case*/
+ // BuildAndSendUeContextSetupRsp(ueIdx, cellId);
+ DU_LOG("\nERROR --> F1AP: Failed to process UE CNTXT SETUP REQ at procF1UeContextSetupReq()");
+ }
+ else
+ ret = duProcUeContextSetupRequest(duUeCb);
+
+ freeAperDecodeF1UeContextSetupReq(ueSetReq);
+ return ret;
+
+}
+/*******************************************************************
+ * @brief Free the memory allocated for Dl Tunnel Info
+ *
+ * @details
+ *
+ * Function : freeDlTnlInfo
+ *
+ * Functionality:
+ * Free the memory allocated for Dl Tunnel Info
+ *
+ * @params[in] DLUPTNLInformation_ToBeSetup_List_t *
+ * @return void
+ *
+ * ****************************************************************/
+
+void freeDlTnlInfo(DLUPTNLInformation_ToBeSetup_List_t *tnlInfo)
+{
+ uint8_t arrIdx = 0;
+
+ for(arrIdx=0; arrIdx < tnlInfo->list.count; arrIdx++)
+ {
+ DU_FREE(tnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel, sizeof(GTPTunnel_t));
+ }
+}
+
+/*******************************************************************
+ * @brief Free the memory allocated for DRB setup List
+ *
+ * @details
+ *
+ * Function : freeDrbSetupList
+ *
+ * Functionality:
+ * Free the memory allocated for DRB setup list
+ *
+ * @params[in] DRBs_Setup_List_t *
+ * @return void
+ *
+ * ****************************************************************/
+void freeDrbSetupList(DRBs_Setup_List_t *drbSetupList)
+{
+ uint8_t arrIdx = 0;
+ DRBs_Setup_ItemIEs_t *drbItemIe = NULLP;
+
+ for(arrIdx = 0; arrIdx < drbSetupList->list.count; arrIdx++)
+ {
+ drbItemIe = ((DRBs_Setup_ItemIEs_t *)drbSetupList->list.array[arrIdx]);
+ freeDlTnlInfo(&drbItemIe->value.choice.DRBs_Setup_Item.dLUPTNLInformation_ToBeSetup_List);
+ }
+}
+
+/*******************************************************************
+ * @brief Free the memory allocated for UE Setup response
+ *
+ * @details
+ *
+ * Function : FreeUeContextSetupRsp
+ *
+ * Functionality:
+ * Free the memory allocated for UE Setup response
+ *
+ * @params[in] F1AP PDU for UE setup response
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+void FreeUeContextSetupRsp(F1AP_PDU_t *f1apMsg)
+{
+ uint8_t idx;
+ UEContextSetupResponse_t *ueSetRsp = NULLP;
+
+ if(f1apMsg)
+ {
+ 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:
+ {
+ 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));
+ }
+ DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Builds Ue context Setup Rsp DU To CU Info
+ *
+ * @details
+ *
+ * Function : EncodeUeCntxtDuToCuInfo
+ *
+ * Functionality: Builds Ue context Setup Rsp DU To CU Info
+ *
+ * @params[in] CellGroupConfig_t *, CellGroupConfigRrc_t *
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ ******************************************************************/
+
+uint8_t EncodeUeCntxtDuToCuInfo(CellGroupConfig_t *duToCuCellGrp, CellGroupConfigRrc_t *duCellGrpCfg)
+{
+ asn_enc_rval_t encRetVal;
+
+ 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);
+ /* Encode results */
+ if(encRetVal.encoded == ENCODE_FAIL)
+ {
+ DU_LOG( "\nERROR --> F1AP : Could not encode UeCntxtDuToCuInfo (at %s)\n",\
+ encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+ return RFAILED;
+ }
+ else
+ {
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for UeCntxtDuToCuInfo\n");
+ for(int i=0; i< encBufSize; i++)
+ {
+ printf("%x",encBuf[i]);
+ }
+ }
+ duToCuCellGrp->size = encBufSize;
+ DU_ALLOC(duToCuCellGrp->buf, duToCuCellGrp->size);
+ if(!duToCuCellGrp->buf)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in UeCntxtDuToCuInfo");
+ }
+ memcpy(duToCuCellGrp->buf, encBuf, duToCuCellGrp->size);
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills Dl Gtp tunnel Info
+ *
+ * @details
+ *
+ * Function : fillGtpTunnelforDl
+ *
+ * Functionality: Fills Dl Gtp tunnel Info
+ *
+ * @params[in]
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t fillGtpTunnelforDl(GTPTunnel_t *gtpDl, GtpTnlCfg *gtpUeCfg)
+{
+ uint8_t bufSize = 0;
+
+ gtpDl->transportLayerAddress.size = 4*sizeof(uint8_t);
+ DU_ALLOC(gtpDl->transportLayerAddress.buf, gtpDl->transportLayerAddress.size);
+ if(gtpDl->transportLayerAddress.buf == NULLP)
+ {
+ return RFAILED;
+ }
+ memcpy(gtpDl->transportLayerAddress.buf, >pUeCfg->dlTnlAddress, gtpDl->transportLayerAddress.size);
+
+ /*GTP TEID*/
+ gtpDl->gTP_TEID.size = 4 * sizeof(uint8_t);
+ DU_ALLOC(gtpDl->gTP_TEID.buf, gtpDl->gTP_TEID.size);
+ if(gtpDl->gTP_TEID.buf == NULLP)
+ {
+ return RFAILED;
+ }
+ bufSize = 3; /*forming an Octect String*/
+ fillTeIdString(bufSize, gtpUeCfg->teId, gtpDl->gTP_TEID.buf);
+
+ return ROK;
+}
- if(cellInfo)
+/*******************************************************************
+ *
+ * @brief Fills DL Tunnel Setup List
+ *
+ * @details
+ *
+ * Function : fillDlTnlSetupList
+ *
+ * Functionality: Fills the DL Tunnel Setup List
+ *
+ * @params[in]
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t fillDlTnlSetupList(DLUPTNLInformation_ToBeSetup_List_t *dlTnlInfo, UpTnlCfg *tnlCfg)
+{
+ uint8_t ret = ROK, arrIdx = 0, eleCount = 0;
+
+ eleCount = 1;
+ dlTnlInfo->list.count = eleCount;
+ dlTnlInfo->list.size = (eleCount * sizeof(DLUPTNLInformation_ToBeSetup_Item_t *));
+
+ /* Initialize the DL Tnl Setup List Members */
+ DU_ALLOC(dlTnlInfo->list.array, dlTnlInfo->list.size);
+ if(dlTnlInfo->list.array == NULLP)
{
- cellGrp = (CellGroupConfigRrc_t *)cellInfo;
- ret = extractUeReCfgCellInfo(cellGrp, macUeCfg);
+ DU_LOG(" ERROR --> F1AP : Memory allocation for DL Tnl Setup List in fillDlTnlSetupList()");
+ ret = RFAILED;
+ }
+ for(arrIdx=0; arrIdx < eleCount; arrIdx++)
+ {
+ DU_ALLOC(dlTnlInfo->list.array[arrIdx], sizeof(DLUPTNLInformation_ToBeSetup_Item_t));
+ if(dlTnlInfo->list.array[arrIdx] == NULLP)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for arrIdx [%d] failed in fillDlTnlSetupList()", arrIdx);
+ return RFAILED;
+ }
+ dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.present = UPTransportLayerInformation_PR_gTPTunnel;
+ DU_ALLOC(dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel, sizeof(GTPTunnel_t));
+ if(dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel == NULLP)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for DL tunnel info in fillDlTnlSetupList()");
+ return RFAILED;
+ }
+ ret = fillGtpTunnelforDl(dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel,\
+ tnlCfg->tnlCfg1);
+ if(ret != ROK)
+ break;
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills the Drb Setup List for Ue Context Setup Response
+ *
+ * @details
+ *
+ * Function : fillDrbSetupList
+ *
+ * Functionality: Fills the Drb Setup List for Ue Context Setup Response
+ *
+ * @params[in]
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t fillDrbSetupList(DRBs_Setup_List_t *drbSetupList, DuUeCfg *ueCfg)
+{
+ uint8_t ret = ROK, arrIdx = 0, eleCount = 0;
+ DRBs_Setup_ItemIEs_t *drbItemIe = NULLP;
+
+ eleCount = ueCfg->numDrb;
+ drbSetupList->list.count = eleCount;
+ drbSetupList->list.size = \
+ (eleCount * sizeof(DRBs_Setup_Item_t *));
+
+ /* Initialize the Drb Setup List Members */
+ DU_ALLOC(drbSetupList->list.array, drbSetupList->list.size);
+ if(drbSetupList->list.array == NULLP)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for DRB Setup List in fillDrbSetupList()");
+ ret = RFAILED;
+ }
+
+ for(arrIdx=0; arrIdx < eleCount; arrIdx++)
+ {
+ DU_ALLOC(drbSetupList->list.array[arrIdx], sizeof(DRBs_Setup_Item_t));
+ if(drbSetupList->list.array[arrIdx] == NULLP)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for arrIdx [%d] failed in fillDrbSetupList()", arrIdx);
+ return RFAILED;
+ }
+ drbItemIe = ((DRBs_Setup_ItemIEs_t *)drbSetupList->list.array[arrIdx]);
+ drbItemIe->id = ProtocolIE_ID_id_DRBs_Setup_Item;
+ drbItemIe->criticality = Criticality_reject;
+ drbItemIe->value.present = DRBs_Setup_ItemIEs__value_PR_DRBs_Setup_Item;
+ drbItemIe->value.choice.DRBs_Setup_Item.dRBID = ueCfg->upTnlInfo[arrIdx].drbId;
+ ret = fillDlTnlSetupList(&drbItemIe->value.choice.DRBs_Setup_Item.dLUPTNLInformation_ToBeSetup_List,\
+ &ueCfg->upTnlInfo[arrIdx]);
+ if(ret != ROK)
+ break;
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds and sends the UE Setup Response
+ *
+ * @details
+ *
+ * Function : BuildAndSendUeContextSetupRsp
+ *
+ * Functionality: Constructs the UE Setup Response and sends
+ * it to the DU through SCTP.
+ *
+ * @params[in]
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildAndSendUeContextSetupRsp(uint8_t ueIdx, uint8_t cellId)
+{
+ uint8_t idx, ret, cellIdx, elementCnt;
+ uint32_t gnbCuUeF1apId; /* gNB-CU UE F1AP Id */
+ uint32_t gnbDuUeF1apId; /* gNB-DU 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);
+
+ 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;
+ }
+
+ f1apMsg->present = F1AP_PDU_PR_successfulOutcome;
+ DU_ALLOC(f1apMsg->choice.successfulOutcome,
+ sizeof(SuccessfulOutcome_t));
+ if(f1apMsg->choice.successfulOutcome == NULLP)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for F1AP-PDU failed");
+ ret = RFAILED;
+ break;
+ }
+
+ f1apMsg->choice.successfulOutcome->procedureCode = \
+ ProcedureCode_id_UEContextSetup;
+ f1apMsg->choice.successfulOutcome->criticality = Criticality_reject;
+ f1apMsg->choice.successfulOutcome->value.present = \
+ SuccessfulOutcome__value_PR_UEContextSetupResponse;
+
+ ueSetRsp =
+ &f1apMsg->choice.successfulOutcome->value.choice.UEContextSetupResponse;
+ elementCnt = 4;
+ ueSetRsp->protocolIEs.list.count = elementCnt;
+ ueSetRsp->protocolIEs.list.size = \
+ elementCnt * sizeof(UEContextSetupResponse_t *);
+
+ /* Initialize the UESetup members */
+ DU_ALLOC(ueSetRsp->protocolIEs.list.array, \
+ ueSetRsp->protocolIEs.list.size);
+ if(ueSetRsp->protocolIEs.list.array == NULLP)
+ {
+ 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;
+ }
+ }
+ /* 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];
+
+ idx = 0;
+ /*GNB CU UE F1AP ID*/
+ ueSetRsp->protocolIEs.list.array[idx]->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;
+ 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;
+ ueSetRsp->protocolIEs.list.array[idx]->criticality = Criticality_reject;
+ ueSetRsp->protocolIEs.list.array[idx]->value.present = \
+ 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;
+ 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;
+ }
+
+ /* Drb Setup List */
+ idx++;
+ ueSetRsp->protocolIEs.list.array[idx]->id = \
+ 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;
+ ret = fillDrbSetupList(&ueSetRsp->protocolIEs.list.array[idx]->value.choice.DRBs_Setup_List,\
+ &ueCb->f1UeDb->duUeCfg);
if(ret == RFAILED)
- DU_LOG("\nF1AP: Failed at procUeReCfgCellInfo()");
+ {
+ DU_LOG("\nERROR --> F1AP : Failed to fillDrbSetupList in BuildAndSendUeContextSetupRsp()");
+ freeF1UeDb(ueCb->f1UeDb);
+ ueCb->f1UeDb = NULLP;
+ break;
+ }
+
+ /* 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);
+
+ /* Encode the UE context setup response type as APER */
+ memset((uint8_t *)encBuf, 0, ENC_BUF_MAX_LEN);
+ encBufSize = 0;
+ encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf,\
+ 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;
+ }
+ 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]);
+ }
+ }
+
+ /* Sending msg */
+ if(SendF1APMsg(DU_APP_MEM_REGION,DU_POOL) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Sending UE Context Setup Response failed");
+ ret = RFAILED;
+ break;
+ }
+ break;
}
- if(ret == RFAILED)
+ FreeUeContextSetupRsp(f1apMsg);
+ return ret;
+}/* End of BuildAndSendUeContextSetupRsp */
+/*******************************************************************
+*
+* @brief Build And Send Ue Context Rsp
+*
+* @details
+*
+* Function : BuildAndSendUeCtxtRsp
+*
+* Functionality : Build And Send Ue Context Rsp
+
+* @params[in]
+* @return sucess = ROK
+* failure = RFAILED
+*
+* ****************************************************************/
+uint8_t BuildAndSendUeCtxtRsp(uint8_t ueIdx, uint8_t cellId)
+{
+ uint8_t cellIdx = 0, actionType = 0;
+
+ GET_CELL_IDX(cellId, cellIdx);
+ actionType = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].f1UeDb->actionType;
+
+ switch(actionType)
{
- freeUeReCfgCellGrpInfo(macUeCfg);
+ case UE_CTXT_SETUP:
+ BuildAndSendUeContextSetupRsp(ueIdx, cellId);
+ break;
+ case UE_CTXT_MOD:
+ BuildAndSendUeContextModResp(ueIdx, cellId);
+ break;
+ default:
+ DU_LOG("ERROR --> F1AP: Invalid Action Type %d at BuildAndSendUeCtxtRsp()", actionType);
+ break;
+
}
- return ret;
+ return ROK;
}
/*******************************************************************
*
- * @brief Function to extract cellGrp Info present in cutoDu cont
+ * @brief deallocating the memory of F1reset msg
*
* @details
*
- * Function : extractCellGrpInfo
+ * Function : FreeF1ResetReq
*
- * Functionality: Function to extract cellGrp Info present
- * in cutoDu cont
+ * Functionality :
+ * - freeing memory of F1reset request msg
*
- * @params[in] ProtocolExtensionContainer_4624P16_t pointer
+ * @params[in]
+ * @return void
*
- * @return CellGroupConfigRrc_t *
*
* ****************************************************************/
-
-CellGroupConfigRrc_t *extractCellGrpInfo(ProtocolExtensionContainer_4624P16_t *protocolIeExtn,\
- DuUeCfg *ueCfgDb)
+void FreeF1ResetReq(F1AP_PDU_t *f1apMsg)
{
- uint8_t idx2;
- uint16_t id;
- uint16_t recvBufLen;
- CellGroupConfigRrc_t *cellGrpCfg = NULLP;
- CUtoDURRCInformation_ExtIEs_t *extIeInfo = NULLP;
- asn_dec_rval_t rval; /* Decoder return value */
- memset(&rval, 0, sizeof(asn_dec_rval_t));
+ uint8_t idx =0 ;
+ Reset_t *f1ResetMsg;
- if(protocolIeExtn)
+ if(f1apMsg)
{
- for(idx2 = 0; idx2 < protocolIeExtn->list.count; idx2++)
+ if(f1apMsg->choice.initiatingMessage)
{
- extIeInfo = ((CUtoDURRCInformation_ExtIEs_t *)(protocolIeExtn->list.array[idx2]));
- id = extIeInfo->id;
- switch(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)
+ f1ResetMsg = &f1apMsg->choice.initiatingMessage->value.choice.Reset;
+
+ if(f1ResetMsg->protocolIEs.list.array)
+ {
+ for(idx=0 ;idx < f1ResetMsg->protocolIEs.list.count ; idx++)
+ {
+ if(f1ResetMsg->protocolIEs.list.array[idx])
{
- 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)
- {
- DU_LOG("\nF1AP : ASN decode failed at decodeCellGrpCfg()");
- return NULLP;
- }
- xer_fprint(stdout, &asn_DEF_CellGroupConfigRrc, cellGrpCfg);
- if(extractRlcCfgToAddMod(cellGrpCfg->rlc_BearerToAddModList, ueCfgDb))
- return NULLP;
+ DU_FREE(f1ResetMsg->protocolIEs.list.array[idx],sizeof(ResetIEs_t));
}
- break;
- }
- default:
- DU_LOG("\nF1AP : Invalid IE received CUtoDURRCInformation:%d at decodeCellGrpCfg()", id);
- break;
- }
+ }
+ DU_FREE(f1ResetMsg->protocolIEs.list.array,f1ResetMsg->protocolIEs.list.size);
+ }
+ DU_FREE(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
}
+ DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
}
- return cellGrpCfg;
}
-
/*******************************************************************
*
- * @brief Fills Srb List received by CU
+ * @brief Build and Send F1reset request
*
* @details
*
- * Function : procSrbListToSetup
+ * Function : BuildAndSendF1ResetReq
*
- * Functionality: Fills Srb List received by CU
+ * Functionality:
+ * - Build and Send F1reset request msg
*
- * @params[in] SRBs_ToBeSetup_Item_t *cuSrbItem
- * LcCfg pointer
- * RlcBearerCfg pointer
- * @return void
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
*
* ****************************************************************/
-uint8_t procSrbListToSetup(SRBs_ToBeSetup_Item_t * srbItem, LcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd)
+uint8_t BuildAndSendF1ResetReq()
{
- uint8_t ret = ROK;
-
- /* Filling RLC INFO */
- procRlcLcCfg(srbItem->sRBID, srbItem->sRBID, RB_TYPE_SRB, RLC_AM, CONFIG_ADD, NULL, rlcLcToAdd);
-
- /* Filling MAC INFO */
- ret = procMacLcCfg(srbItem->sRBID, RB_TYPE_SRB, CONFIG_ADD, NULL, NULL, macLcToAdd);
- if(ret == RFAILED)
- {
- DU_LOG("\nF1AP:Failed at MAC LC Cfg in procSrbListToSetup()");
- return ret;
- }
- return ret;
-}
-
-
+ uint8_t elementCnt=0;
+ uint8_t idx=0;
+ uint8_t ret= RFAILED;
+ Reset_t *f1ResetMsg = NULLP;
+ F1AP_PDU_t *f1apMsg = NULLP;
+ asn_enc_rval_t encRetVal;
+ DU_LOG("\nINFO --> F1AP : Building F1 Reset request \n");
+ do
+ {
+ DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
+ if(f1apMsg == NULLP)
+ {
+ break;
+ }
+ f1apMsg->present = F1AP_PDU_PR_initiatingMessage;
+ DU_ALLOC(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
+ if(f1apMsg->choice.initiatingMessage == NULLP)
+ {
+ break;
+ }
+ f1apMsg->choice.initiatingMessage->procedureCode = ProcedureCode_id_Reset;
+ f1apMsg->choice.initiatingMessage->criticality = Criticality_reject;
+ f1apMsg->choice.initiatingMessage->value.present = InitiatingMessage__value_PR_Reset;
-/*******************************************************************
- *
- * @brief extract Srb List received by CU
- *
- * @details
- *
- * Function : extractSrbListToSetup
- *
- * Functionality: extract Srb List received by CU
- * for both MAC and RLC
- *
- * @params[in] SRBs_ToBeSetup_Item_t pointer
- * DuUeCfg pointer
- * @return ROK/RFAIED
- *
- * ****************************************************************/
+ f1ResetMsg = &f1apMsg->choice.initiatingMessage->value.choice.Reset;
-uint8_t extractSrbListToSetup(SRBs_ToBeSetup_List_t *srbCfg, DuUeCfg *ueCfgDb)
-{
- uint8_t ret, srbIdx;
- SRBs_ToBeSetup_Item_t *srbItem = NULLP;
+ elementCnt = 3;
+ f1ResetMsg->protocolIEs.list.count = elementCnt;
+ f1ResetMsg->protocolIEs.list.size = elementCnt * sizeof(ResetIEs_t *);
- if(srbCfg)
- {
- for(srbIdx = 0; srbIdx < srbCfg->list.count; srbIdx++)
+ /* Initialize the F1Setup members */
+ DU_ALLOC(f1ResetMsg->protocolIEs.list.array,f1ResetMsg->protocolIEs.list.size);
+ if(f1ResetMsg->protocolIEs.list.array == NULLP)
{
- srbItem = &srbCfg->list.array[srbIdx]->value.choice.SRBs_ToBeSetup_Item;
- if(ueCfgDb->numMacLcs > MAX_NUM_LC)
- {
- DU_LOG("\nF1AP: MAX LC Reached in MAC");
- ret = RFAILED;
- break;
- }
- if(ueCfgDb->numRlcLcs > MAX_NUM_LC)
- {
- DU_LOG("\nF1AP: 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++;
- if(ret == RFAILED)
+ break;
+ }
+ for(idx=0; idx<elementCnt; idx++)
+ {
+ DU_ALLOC(f1ResetMsg->protocolIEs.list.array[idx],sizeof(ResetIEs_t));
+ if(f1ResetMsg->protocolIEs.list.array[idx] == NULLP)
{
- DU_LOG("\nF1AP: Failed at extractSrbListToSetup()");
break;
}
}
- }
- else
- ret = RFAILED;
- return ret;
-}
+ /*TransactionID*/
+ idx=0;
+ f1ResetMsg->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_TransactionID;
+ f1ResetMsg->protocolIEs.list.array[idx]->criticality = Criticality_reject;
+ f1ResetMsg->protocolIEs.list.array[idx]->value.present = ResetIEs__value_PR_TransactionID;
+ f1ResetMsg->protocolIEs.list.array[idx]->value.choice.TransactionID = 1;
-/*******************************************************************
- *
- * @brief Fills Drb List received by CU
- *
- * @details
- *
- * Function : procDrbListToSetup
- *
- * Functionality: Fills Drb List received by CU
- * for both MAC and RLC
- *
- * @params[in] SRBs_ToBeSetup_Item_t pointer
- * LcCfg pointer,
- * RlcBearerCfg pointer
- * @return void
- *
- * ****************************************************************/
+ /*Cause*/
+ idx++;
+ f1ResetMsg->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_Cause;
+ f1ResetMsg->protocolIEs.list.array[idx]->criticality = Criticality_ignore;
+ f1ResetMsg->protocolIEs.list.array[idx]->value.present = ResetIEs__value_PR_Cause;
+ f1ResetMsg->protocolIEs.list.array[idx]->value.choice.Cause.present = Cause_PR_radioNetwork;
+ f1ResetMsg->protocolIEs.list.array[idx]->value.choice.Cause.choice.radioNetwork = CauseRadioNetwork_action_desirable_for_radio_reasons;
-uint8_t procDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbItem, LcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd)
-{
- uint8_t ret = ROK;
+ /*Reset Type*/
+ idx++;
+ f1ResetMsg->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_ResetType;
+ f1ResetMsg->protocolIEs.list.array[idx]->criticality = Criticality_reject;
+ f1ResetMsg->protocolIEs.list.array[idx]->value.present = ResetIEs__value_PR_ResetType;
+ f1ResetMsg->protocolIEs.list.array[idx]->value.choice.ResetType.present = ResetType_PR_f1_Interface;
+ f1ResetMsg->protocolIEs.list.array[idx]->value.choice.ResetType.choice.f1_Interface = ResetAll_reset_all;
- /* Filling RLC INFO */
- procRlcLcCfg(drbItem->dRBID, lcId, RB_TYPE_DRB, drbItem->rLCMode, CONFIG_ADD, NULL, rlcLcToAdd);
+ xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
- /* Filling MAC INFO */
- ret = procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_ADD, drbItem, NULL, macLcToAdd);
- if(ret == RFAILED)
- {
- DU_LOG("\nF1AP:Failed at RLC LC Cfg in extractDrbListToSetup()");
- return ret;
- }
+ /* 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);
+
+ /* Encode results */
+ if(encRetVal.encoded == ENCODE_FAIL)
+ {
+ DU_LOG("\nERROR --> F1AP : Could not encode F1Reset structure (at %s)\n",\
+ encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+ break;
+ }
+ else
+ {
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for F1Reset\n");
+ for(idx=0; idx< encBufSize; idx++)
+ {
+ printf("%x",encBuf[idx]);
+ }
+ }
+
+ if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Sending F1 Reset request failed");
+ break;
+ }
+
+ ret = ROK;
+ break;
+ }while(true);
+ FreeF1ResetReq(f1apMsg);
return ret;
}
-
/*******************************************************************
*
- * @brief extract Drb List received by CU
+ * @brief Build And Send F1ResetAck
*
* @details
*
- * Function : extractDrbListToSetup
+ * Function : BuildAndSendF1ResetAck
*
- * Functionality: extract Drb List received by CU
- * for both MAC and RLC
+ * Functionality:
+ * - Build And Send F1ResetRSP
*
- * @params[in] DRBs_ToBeSetup_Item_t pointer
- * DuUeCfg pointer
- * @return ROK/RFAIED
+ * @return ROK - success
+ * RFAILED - failure
*
* ****************************************************************/
-
-uint8_t extractDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_List_t *drbCfg, DuUeCfg *ueCfgDb)
+void FreeF1ResetAck(F1AP_PDU_t *f1apMsg)
{
- uint8_t ret, drbIdx;
- DRBs_ToBeSetup_Item_t *drbItem = NULLP;
+ uint8_t idx;
+ ResetAcknowledge_t *f1ResetAck;
- ret = ROK;
- if(drbCfg)
+ if(f1apMsg)
{
- for(drbIdx = 0; drbIdx < drbCfg->list.count; drbIdx++)
+ if(f1apMsg->choice.successfulOutcome)
{
- drbItem = &drbCfg->list.array[drbIdx]->value.choice.DRBs_ToBeSetup_Item;
- if(ueCfgDb->numMacLcs > MAX_NUM_LC)
- {
- DU_LOG("\nF1AP: MAX LC Reached in MAC ");
- ret = RFAILED;
- break;
- }
- if(ueCfgDb->numRlcLcs > MAX_NUM_LC)
- {
- DU_LOG("\nF1AP: 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 = procDrbListToSetup(lcId, drbItem, &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs],\
- &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs]);
- ueCfgDb->numRlcLcs++;
- ueCfgDb->numMacLcs++;
- if(ret == RFAILED)
+ f1ResetAck= &f1apMsg->choice.successfulOutcome->value.choice.ResetAcknowledge;
+
+ if(f1ResetAck->protocolIEs.list.array)
{
- DU_LOG("\nF1AP: Failed at extractDrbListToSetup()");
- break;
+ for(idx=0; idx<f1ResetAck->protocolIEs.list.count ; idx++)
+ {
+ if(f1ResetAck->protocolIEs.list.array[idx])
+ {
+ DU_FREE(f1ResetAck->protocolIEs.list.array[idx], sizeof(ResetAcknowledgeIEs_t));
+ }
+ }
+ DU_FREE(f1ResetAck->protocolIEs.list.array, f1ResetAck->protocolIEs.list.size );
}
+ DU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
}
+ DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
}
- else
- ret = RFAILED;
-
- return ret;
}
/*******************************************************************
*
- * @brief Process UE context setup request from CU
+ * @brief Build And Send F1ResetAck
*
* @details
*
- * Function : procF1UeContextSetupReq
+ * Function : BuildAndSendF1ResetAck
*
- * Functionality: Process UE context setup request from CU
+ * Functionality:
+ * - Build And Send F1ResetRSP
*
- * @params[in] F1AP message
+ * @params[in]
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
+uint8_t BuildAndSendF1ResetAck()
{
- uint8_t ret, ieIdx, ueIdx, lcId, cellIdx;
- bool ueCbFound = false;
- uint32_t gnbCuUeF1apId, gnbDuUeF1apId;
- DuUeCb *duUeCb = NULLP;
- UEContextSetupRequest_t *ueSetReq = NULLP;
-
- ret = ROK;
-
- ueSetReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextSetupRequest;
- for(ieIdx=0; (ieIdx < ueSetReq->protocolIEs.list.count && ret == ROK); ieIdx++)
- {
- switch(ueSetReq->protocolIEs.list.array[ieIdx]->id)
+ uint8_t idx = 0;
+ uint8_t elementCnt = 0;
+ uint8_t ret = RFAILED;
+ F1AP_PDU_t *f1apMsg = NULL;
+ ResetAcknowledge_t *f1ResetAck = NULLP;
+ asn_enc_rval_t encRetVal;
+ DU_LOG("\nINFO --> F1AP : Building F1 Reset Acknowledgment \n");
+
+ do{
+ /* Allocate the memory for F1ResetRequest_t */
+ DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
+ if(f1apMsg == NULLP)
{
- case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
- {
- 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_ServCellIndex:
- {
- cellIdx = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.ServCellIndex;
- for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
- {
- if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
- (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
- {
- ueCbFound = true;
- duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
- DU_ALLOC(duUeCb->f1UeDb, sizeof(UeContextSetupDb));
- if(duUeCb->f1UeDb)
- {
- memset(duUeCb->f1UeDb, 0, sizeof(UeContextSetupDb));
- duUeCb->f1UeDb->actionType = UE_CTXT_SETUP;
- duUeCb->f1UeDb->cellIdx = cellIdx;
- }
- else
- {
- DU_LOG("\nF1AP: Memory Alloc Failed at procF1UeContextSetupReq()");
- ret = RFAILED;
- }
- }
- else
- ueCbFound = false;
-
- }
- if(!ueCbFound)
- {
- DU_LOG("\nF1AP: DuUeCb is not found at procF1UeContextSetupReq()");
- ret = RFAILED;
- }
- 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.iE_Extensions)
- {
- duUeCb->f1UeDb->cellGrpCfg = extractCellGrpInfo(ueSetReq->protocolIEs.list.array[ieIdx]->\
- value.choice.CUtoDURRCInformation.iE_Extensions, &duUeCb->f1UeDb->duUeCfg);
- if(!duUeCb->f1UeDb->cellGrpCfg)
- {
- DU_LOG("\n F1AP: Failed to extract cell Grp Info");
- //TODO: Update the failure cause in ue context Setup Response
- ret = RFAILED;
- }
- }
- break;
- }
- case ProtocolIE_ID_id_SCell_ToBeSetup_List:
- {
- DU_LOG("\nDU_APP: Received SCell to be added");
- DU_LOG("\nDU_APP: Not processing the SCell_ToBeSetup_List");
+ DU_LOG("\nERROR --> F1AP : Memory allocation for F1AP-PDU failed");
+ break;
+ }
+
+ f1apMsg->present = F1AP_PDU_PR_successfulOutcome;
+
+ DU_ALLOC(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
+ if(f1apMsg->choice.successfulOutcome == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation for F1AP-PDU failed");
+ break;
+ }
+ f1apMsg->choice.successfulOutcome->criticality = Criticality_reject;
+ f1apMsg->choice.successfulOutcome->value.present = SuccessfulOutcome__value_PR_ResetAcknowledge;
+ f1ResetAck = &f1apMsg->choice.successfulOutcome->value.choice.ResetAcknowledge;
+
+ elementCnt = 1;
+
+ f1ResetAck->protocolIEs.list.count = elementCnt;
+ f1ResetAck->protocolIEs.list.size = elementCnt*sizeof(ResetAcknowledgeIEs_t *);
+
+ DU_ALLOC(f1ResetAck->protocolIEs.list.array, f1ResetAck->protocolIEs.list.size );
+ if(f1ResetAck->protocolIEs.list.array == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation for F1ResetAckIEs failed");
+ break;
+ }
+
+ for(idx=0; idx<elementCnt; idx++)
+ {
+ DU_ALLOC(f1ResetAck->protocolIEs.list.array[idx], sizeof(ResetAcknowledgeIEs_t));
+ if(f1ResetAck->protocolIEs.list.array[idx] == NULLP)
+ {
break;
- }
- case ProtocolIE_ID_id_SRBs_ToBeSetup_List:
- {
- if(extractSrbListToSetup(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.SRBs_ToBeSetup_List,\
- &duUeCb->f1UeDb->duUeCfg))
- {
- DU_LOG("\nDU_APP: Failed at extractSrbListToSetup()");
- //TODO: Update the failure cause in ue context Setup Response
- ret = RFAILED;
- }
- break;
- }
- case ProtocolIE_ID_id_DRBs_ToBeSetup_List:
- {
- lcId = getDrbLcId(&duUeCb->drbBitMap);
- if(lcId != RFAILED)
- {
- if(extractDrbListToSetup(lcId, &ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRBs_ToBeSetup_List,\
- &duUeCb->f1UeDb->duUeCfg))
- {
- DU_LOG("\nDU_APP: Failed at extractDrbListToSetup()");
- //TODO: Update the failure cause in ue context Setup Response
- ret = RFAILED;
- }
- }
- else
- ret = RFAILED;
- break;
- }
- case ProtocolIE_ID_id_RRCContainer:
- {
- duUeCb->f1UeDb->rrcMsgLen = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size;
- if(duUeCb->f1UeDb->rrcMsgLen > 0)
- {
- DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->rrcMsg, duUeCb->f1UeDb->rrcMsgLen);
- if(!duUeCb->f1UeDb->rrcMsg)
- {
- DU_LOG("\nDU APP : Memory allocation failed for RRC Msg in procUeCtxtSetupReq");
- ret = RFAILED;
- }
- else
- {
- memcpy(duUeCb->f1UeDb->rrcMsg, ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf,\
- duUeCb->f1UeDb->rrcMsgLen);
- }
- }
- else
- ret = RFAILED;
- break;
- }
- case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
- {
- duUeCb->f1UeDb->deliveryStaReq = true;
- break;
- }
- //TODO: To handle maxAggrBitRate case,
- // Dependency: The protocolIE is not specified in ASN
-#if 0
- case ProtocolIE_ID_id_ULPDUSessionAggregateMaximumBitRate: {
- /* MaximumBitRate Uplink */
- bitRateSize = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.size;
- if(bitRateSize > 0)
- {
- DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->duUeCfg.maxAggrBitRate, bitRateSize);
- if(!duUeCb->f1UeDb->duUeCfg.maxAggrBitRate)
- {
- DU_LOG("\nDU APP : Memory allocation failed for bitRate in procUeCtxtSetupReq");
- ret = RFAILED;
- }
- else
- {
- duUeCb->f1UeDb->duUeCfg.maxAggrBitRate->ulBits =\
- *ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf;
- duUeCb->f1UeDb->duUeCfg.maxAggrBitRate->dlBits = 0;
- }
- }
- else
- ret = RFAILED;
- break;
- }
-#endif
- default:
- {
- break;
- }
+ }
}
- }
- if(ret == RFAILED)
+ /*TransactionID*/
+ idx = 0;
+ f1ResetAck->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_TransactionID;
+ f1ResetAck->protocolIEs.list.array[idx]->criticality = Criticality_reject;
+ f1ResetAck->protocolIEs.list.array[idx]->value.present = ResetAcknowledgeIEs__value_PR_TransactionID;
+ f1ResetAck->protocolIEs.list.array[idx]->value.choice.TransactionID = TRANS_ID;
+
+ xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
+
+ /* Encode the F1SetupRequest type as UPER */
+ memset(encBuf, 0, ENC_BUF_MAX_LEN);
+ encBufSize = 0;
+ encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf, encBuf);
+
+ /* Check encode results */
+ if(encRetVal.encoded == ENCODE_FAIL)
+ {
+ DU_LOG("\nERROR --> F1AP : Could not encode F1ResetAck structure (at %s)\n",\
+ encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+ break;
+ }
+ else
+ {
+ DU_LOG("\nDUBUG --> F1AP : Created APER encoded buffer for F1ResetAck\n");
+ for(int i=0; i< encBufSize; i++)
+ {
+ printf("%x",encBuf[i]);
+ }
+ }
+ /* Sending msg */
+ if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Sending F1 Reset Acknowledgement failed");
+ break;
+ }
+
+ ret = ROK;
+ break;
+ }while(true);
+
+ FreeF1ResetAck(f1apMsg);
+ return ret;
+}
+/******************************************************************
+*
+* @brief free F1 reset msg allocated by aper_decoder
+*
+* @details
+*
+* Function : freeAperDecodeF1ResetMsg
+*
+* Functionality: free F1 reset msg allocated by aper_decoder
+*
+* @params[in] Reset_t *f1ResetMsg
+* @return void
+*
+* ****************************************************************/
+
+void freeAperDecodeF1ResetMsg(Reset_t *f1ResetMsg)
+{
+ uint8_t ieIdx =0;
+ if(f1ResetMsg->protocolIEs.list.array)
{
- /*TODO : Negative case*/
- // BuildAndSendUeContextSetupRsp(ueIdx, cellId);
- DU_LOG("F1AP: Failed to process UE CNTXT SETUP REQ at procF1UeContextSetupReq()");
+ for(ieIdx=0 ;ieIdx < f1ResetMsg->protocolIEs.list.count ; ieIdx++)
+ {
+ if(f1ResetMsg->protocolIEs.list.array[ieIdx])
+ {
+ free(f1ResetMsg->protocolIEs.list.array[ieIdx]);
+ }
+ }
+ free(f1ResetMsg->protocolIEs.list.array);
}
- else
- ret = duProcUeContextSetupRequest(duUeCb);
-
- return ret;
-
}
-/*******************************************************************
- * @brief Free the memory allocated for UE Setup response
+/******************************************************************
+ *
+ * @brief Processes DL RRC Message Transfer sent by CU
*
* @details
*
- * Function : FreeUeContextSetupRsp
+ * Function : procF1ResetReq
*
- * Functionality:
- * Free the memory allocated for UE Setup response
+ * Functionality: Processes DL RRC Message Transfer sent by CU
*
- * @params[in] F1AP PDU for UE setup response
+ * @params[in] F1AP_PDU_t ASN decoded F1AP message
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-void FreeUeContextSetupRsp(F1AP_PDU_t *f1apMsg)
+uint8_t procF1ResetReq(F1AP_PDU_t *f1apMsg)
{
- uint8_t idx;
- UEContextSetupResponse_t *ueSetRsp = NULLP;
+ /* we are currently not supporting Ue release. right now we are supporting only init case of fireset */
+ uint8_t ieIdx = 0;
+ uint8_t ret = ROK;
+ Reset_t *f1ResetMsg = NULLP;
- if(f1apMsg)
+ DU_LOG("\nINFO --> Processing F1 reset request");
+ f1ResetMsg = &f1apMsg->choice.initiatingMessage->value.choice.Reset;
+
+ for(ieIdx=0; ieIdx<f1ResetMsg->protocolIEs.list.count; ieIdx++)
{
- if(f1apMsg->choice.successfulOutcome)
+ switch(f1ResetMsg->protocolIEs.list.array[ieIdx]->id)
{
- ueSetRsp = &f1apMsg->choice.successfulOutcome->value.choice.\
- UEContextSetupResponse;
- if(ueSetRsp->protocolIEs.list.array)
- {
- for(idx = 0; idx < ueSetRsp->protocolIEs.list.count; idx++)
+ case ProtocolIE_ID_id_TransactionID:
+ break;
+
+ case ProtocolIE_ID_id_Cause:
+ break;
+
+ case ProtocolIE_ID_id_ResetType:
{
- 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;
- }
- default:
- DU_LOG("\nDUAPP: Invalid Id %ld at FreeUeContextSetupRsp()", ueSetRsp->protocolIEs.list.array[idx]->id);
- break;
- }
- DU_FREE(ueSetRsp->protocolIEs.list.array[idx],\
- sizeof(UEContextSetupResponseIEs_t));
- }
+ break;
}
- DU_FREE(ueSetRsp->protocolIEs.list.array, \
- ueSetRsp->protocolIEs.list.size);
- }
- DU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
+
+ default:
+ break;
}
- DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
}
+ ret = BuildAndSendF1ResetAck();
+ DU_LOG("\nINFO --> UE release is not supported for now");
+
+ freeAperDecodeF1ResetMsg(f1ResetMsg);
+
+ return ret;
}
/*******************************************************************
*
- * @brief Builds Ue context Setup Rsp DU To CU Info
+ * @brief free the RRC delivery report
*
* @details
*
- * Function : EncodeUeCntxtDuToCuInfo
- *
- * Functionality: Builds Ue context Setup Rsp DU To CU Info
+ * Function : freeRrcDeliveryReport
*
- * @params[in] CellGroupConfig_t *, CellGroupConfigRrc_t *
+ * Functionality: free the RRC delivery report
*
+ * @params[in]
* @return ROK - success
* RFAILED - failure
*
- ******************************************************************/
-
-uint8_t EncodeUeCntxtDuToCuInfo(CellGroupConfig_t *duToCuCellGrp, CellGroupConfigRrc_t *duCellGrpCfg)
+ * ****************************************************************/
+void freeRrcDeliveryReport(F1AP_PDU_t *f1apMsg )
{
- asn_enc_rval_t encRetVal;
+ uint8_t idx=0;
+ RRCDeliveryReport_t *rrcDeliveryReport= NULLP;
- 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);
- /* Encode results */
- if(encRetVal.encoded == ENCODE_FAIL)
+ if(f1apMsg)
{
- DU_LOG( "\n F1AP : Could not encode UeCntxtDuToCuInfo (at %s)\n",\
- encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
- return RFAILED;
+ if(f1apMsg->choice.initiatingMessage)
+ {
+ rrcDeliveryReport = &f1apMsg->choice.initiatingMessage->value.choice.RRCDeliveryReport;
+ if(rrcDeliveryReport->protocolIEs.list.array)
+ {
+ for(idx =0 ;idx <rrcDeliveryReport->protocolIEs.list.count ;
+ idx++)
+ {
+ if(rrcDeliveryReport->protocolIEs.list.array[idx])
+ {
+ DU_FREE(rrcDeliveryReport->protocolIEs.list.array[idx],
+ sizeof(RRCDeliveryReportIEs_t));
+ }
+ }
+ DU_FREE(rrcDeliveryReport->protocolIEs.list.array,
+ rrcDeliveryReport->protocolIEs.list.size);
+ }
+ DU_FREE(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
+ }
+ DU_FREE(f1apMsg,
+ sizeof(F1AP_PDU_t));
}
- else
- {
- DU_LOG("\n F1AP : Created APER encoded buffer for UeCntxtDuToCuInfo\n");
- for(int i=0; i< encBufSize; i++)
+}
+
+/*******************************************************************
+*
+* @brief Builds and sends the RRC delivery report
+*
+* @details
+*
+* Function : BuildAndSendRrcDeliveryReport
+*
+* Functionality: Builds and sends the RRC delivery report
+*
+* @params[in]
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t BuildAndSendRrcDeliveryReport(uint32_t gnbCuUeF1apId, \
+ uint32_t gnbDuUeF1apId, RrcDeliveryReport *rrcDelivery)
+{
+ uint8_t ret = RFAILED;
+ uint8_t idx = 0;
+ uint8_t idx1 = 0;
+ uint8_t elementCnt = 0;
+ F1AP_PDU_t *f1apMsg = NULLP;
+ asn_enc_rval_t encRetVal;
+ RRCDeliveryReport_t *rrcDeliveryReport= NULLP;
+
+ do{
+
+ DU_LOG("\nINFO --> F1AP : Building RRC delivery Message Transfer Message\n");
+ DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
+ if(f1apMsg == NULLP)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for F1AP-PDU failed");
+ break;
+ }
+ f1apMsg->present = F1AP_PDU_PR_initiatingMessage;
+ DU_ALLOC(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
+ if(f1apMsg->choice.initiatingMessage == NULLP)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for F1AP-PDU failed");
+ break;
+ }
+ f1apMsg->choice.initiatingMessage->procedureCode = ProcedureCode_id_RRCDeliveryReport;
+ f1apMsg->choice.initiatingMessage->criticality = Criticality_ignore;
+ f1apMsg->choice.initiatingMessage->value.present = InitiatingMessage__value_PR_RRCDeliveryReport;
+
+ rrcDeliveryReport = &f1apMsg->choice.initiatingMessage->value.choice.RRCDeliveryReport;
+ elementCnt = 4;
+ rrcDeliveryReport->protocolIEs.list.count = elementCnt;
+ rrcDeliveryReport->protocolIEs.list.size = elementCnt * sizeof(RRCDeliveryReportIEs_t *);
+
+ /* Initialize the F1Setup members */
+ DU_ALLOC(rrcDeliveryReport->protocolIEs.list.array, rrcDeliveryReport->protocolIEs.list.size);
+ if(rrcDeliveryReport->protocolIEs.list.array == NULLP)
+ {
+ DU_LOG(" ERROR --> F1AP : Memory allocation for RRC Delivery failed");
+ break;
+ }
+ for(idx =0 ;idx <elementCnt; idx++)
+ {
+ DU_ALLOC(rrcDeliveryReport->protocolIEs.list.array[idx], sizeof(RRCDeliveryReportIEs_t));
+ if(rrcDeliveryReport->protocolIEs.list.array[idx] == NULLP)
+ {
+ break;
+ }
+ }
+
+ idx1 = 0;
+
+ /*GNB CU UE F1AP ID*/
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->value.present = RRCDeliveryReportIEs__value_PR_GNB_CU_UE_F1AP_ID;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.GNB_CU_UE_F1AP_ID = gnbCuUeF1apId;
+
+ /*GNB DU UE F1AP ID*/
+ idx1++;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->value.present = RRCDeliveryReportIEs__value_PR_GNB_DU_UE_F1AP_ID;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.GNB_DU_UE_F1AP_ID = gnbDuUeF1apId;
+
+ /*RRC delivery status*/
+ idx1++;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_RRCDeliveryStatus;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->criticality = Criticality_ignore;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->value.present = RRCDeliveryReportIEs__value_PR_RRCDeliveryStatus;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.RRCDeliveryStatus.delivery_status =\
+ rrcDelivery->rrcDeliveryStatus.deliveryStatus;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.RRCDeliveryStatus.triggering_message =\
+ rrcDelivery->rrcDeliveryStatus.triggeringMessage;
+
+ /* SRB ID */
+ idx1++;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_SRBID;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->criticality = Criticality_ignore;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->value.present = RRCDeliveryReportIEs__value_PR_SRBID;
+ rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.SRBID = rrcDelivery->srbId;
+
+ xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
+
+ /* Encode the RRC DELIVERY REPORT type as APER */
+ memset(encBuf, 0, ENC_BUF_MAX_LEN);
+ encBufSize = 0;
+ encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf,\
+ encBuf);
+
+ /* Encode results */
+ if(encRetVal.encoded == ENCODE_FAIL)
+ {
+ DU_LOG("\nERROR --> F1AP : Could not encode RRC Delivery Msg structure (at %s)\n",\
+ encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+ break;
+ }
+ else
+ {
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for RRC Delivery Msg \n");
+ for(idx=0; idx< encBufSize; idx++)
+ {
+ printf("%x",encBuf[idx]);
+ }
+ }
+
+ /* Sending msg */
+ if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
{
- printf("%x",encBuf[i]);
+ DU_LOG("\nERROR --> F1AP : Sending RRC delivery msg request failed");
+ break;
}
- }
- duToCuCellGrp->size = encBufSize;
- DU_ALLOC(duToCuCellGrp->buf, duToCuCellGrp->size);
- if(!duToCuCellGrp->buf)
- {
- DU_LOG("\nF1AP : Memory allocation failed in UeCntxtDuToCuInfo");
- }
- memcpy(duToCuCellGrp->buf, encBuf, duToCuCellGrp->size);
- return ROK;
+ ret = ROK;
+ break;
+
+ }while(true);
+
+ freeRrcDeliveryReport(f1apMsg);
+ return ret;
}
/*******************************************************************
*
- * @brief Builds and sends the UE Setup Response
+ * @brief Processes cells to be activated
*
* @details
*
- * Function : BuildAndSendUeContextSetupRsp
- *
- * Functionality: Constructs the UE Setup Response and sends
- * it to the DU through SCTP.
+ * Function : extractCellsToBeActivated
*
- * @params[in]
+ * Functionality:
+ * - Processes cells to be activated list received in F1SetupRsp
*
+ * @params[in] void
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildAndSendUeContextSetupRsp(uint8_t ueIdx, uint8_t cellId)
-{
- uint8_t idx, ret, cellIdx, elementCnt;
- uint32_t gnbCuUeF1apId; /* gNB-CU UE F1AP Id */
- uint32_t gnbDuUeF1apId; /* gNB-DU 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 F1AP : Building UE Context Setup Response for cellId %d, ueIdx %d\n", cellId, ueIdx);
+uint8_t extractCellsToBeActivated(Cells_to_be_Activated_List_t cellsToActivate)
+{
+ uint8_t ret = ROK;
+ uint16_t idx, nci, pci = 0;
+ Cells_to_be_Activated_List_Item_t cell;
- while(true)
+ for(idx=0; idx<cellsToActivate.list.count; idx++)
{
- DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
- if(f1apMsg == NULLP)
- {
- DU_LOG(" F1AP : Memory allocation for F1AP-PDU failed");
- ret = RFAILED;
- break;
- }
+ nci = 0;
+ cell = cellsToActivate.list.array[idx]->value.choice.Cells_to_be_Activated_List_Item;
+ bitStringToInt(&cell.nRCGI.nRCellIdentity, &nci);
- f1apMsg->present = F1AP_PDU_PR_successfulOutcome;
- DU_ALLOC(f1apMsg->choice.successfulOutcome,
- sizeof(SuccessfulOutcome_t));
- if(f1apMsg->choice.successfulOutcome == NULLP)
+ if(cell.nRPCI)
{
- DU_LOG(" F1AP : Memory allocation for F1AP-PDU failed");
- ret = RFAILED;
- break;
+ pci = *cell.nRPCI;
}
+ ret = duProcCellsToBeActivated(cell.nRCGI.pLMN_Identity.buf, nci, pci);
+ }
+ return ret;
+}
+/******************************************************************
+*
+* @brief Processes F1 Setup Response allocated by aper_decoder
+*
+* @details
+*
+* Function : freeF1SetupRsp
+*
+* Functionality: free F1 Setup Response allocated by aper_decoder
+*
+* @params[in] F1SetupResponse_t *f1SetRspMsg
+* @return void
+*
+* ****************************************************************/
- f1apMsg->choice.successfulOutcome->procedureCode = \
- ProcedureCode_id_UEContextSetup;
- f1apMsg->choice.successfulOutcome->criticality = Criticality_reject;
- f1apMsg->choice.successfulOutcome->value.present = \
- SuccessfulOutcome__value_PR_UEContextSetupResponse;
-
- ueSetRsp =
- &f1apMsg->choice.successfulOutcome->value.choice.UEContextSetupResponse;
- elementCnt = 3;
- ueSetRsp->protocolIEs.list.count = elementCnt;
- ueSetRsp->protocolIEs.list.size = \
- elementCnt * sizeof(UEContextSetupResponse_t *);
-
- /* Initialize the UESetup members */
- DU_ALLOC(ueSetRsp->protocolIEs.list.array, \
- ueSetRsp->protocolIEs.list.size);
- if(ueSetRsp->protocolIEs.list.array == NULLP)
- {
- DU_LOG(" F1AP : Memory allocation for UE Setup Response failed");
- ret = RFAILED;
- break;
- }
+void freeAperDecodeF1SetupRsp(F1SetupResponse_t *f1SetRspMsg)
+{
+ uint8_t ieIdx =0;
+ uint8_t arrIdx =0;
+ Cells_to_be_Activated_List_t *cellToActivate =NULLP;
+ RRC_Version_t *rrcVer =NULLP;
- for(idx=0; idx<elementCnt; idx++)
+ if(f1SetRspMsg->protocolIEs.list.array)
+ {
+ for(ieIdx=0; ieIdx<f1SetRspMsg->protocolIEs.list.count; ieIdx++)
{
- DU_ALLOC(ueSetRsp->protocolIEs.list.array[idx],\
- sizeof(UEContextSetupResponseIEs_t));
- if(ueSetRsp->protocolIEs.list.array[idx] == NULLP)
+ if(f1SetRspMsg->protocolIEs.list.array[ieIdx])
{
- DU_LOG(" 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];
-
- idx = 0;
- /*GNB CU UE F1AP ID*/
- ueSetRsp->protocolIEs.list.array[idx]->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;
- ueSetRsp->protocolIEs.list.array[idx]->value.choice.GNB_CU_UE_F1AP_ID = gnbCuUeF1apId;
+ switch(f1SetRspMsg->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_ID_id_Cells_to_be_Activated_List:
+ {
+ cellToActivate =
+ &f1SetRspMsg->protocolIEs.list.array[ieIdx]->value.choice.Cells_to_be_Activated_List;
+ if(cellToActivate->list.array)
+ {
+ for(arrIdx=0; arrIdx<cellToActivate->list.count ; arrIdx++)
+ {
+ if(cellToActivate->list.array[arrIdx])
+ {
- /*GNB DU UE F1AP ID*/
- idx++;
- ueSetRsp->protocolIEs.list.array[idx]->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;
- ueSetRsp->protocolIEs.list.array[idx]->value.choice.GNB_DU_UE_F1AP_ID = gnbDuUeF1apId;
+ if(cellToActivate->list.array[0]->value.choice.Cells_to_be_Activated_List_Item.nRCGI.\
+ pLMN_Identity.buf)
+ {
+ if(cellToActivate->list.array[0]->value.choice.\
+ Cells_to_be_Activated_List_Item.nRCGI.nRCellIdentity.buf)
+ {
+ free(cellToActivate->list.array[0]->value.choice.\
+ Cells_to_be_Activated_List_Item.nRCGI.nRCellIdentity.buf);
+ }
+ free(cellToActivate->list.array[0]->value.choice.Cells_to_be_Activated_List_Item.\
+ nRCGI.pLMN_Identity.buf);
+ }
+ free(cellToActivate->list.array[arrIdx]);
+ }
+ }
+ free(cellToActivate->list.array);
+ }
+ break;
+ }
+ case ProtocolIE_ID_id_TransactionID:
+ {
+ break;
+ }
+ case ProtocolIE_ID_id_gNB_CU_Name:
+ {
+ free(f1SetRspMsg->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_Name.buf);
+ break;
+ }
+ case ProtocolIE_ID_id_GNB_CU_RRC_Version:
+ {
+ rrcVer = &f1SetRspMsg->protocolIEs.list.array[ieIdx]->value.choice.RRC_Version;
+ if(rrcVer->latest_RRC_Version.buf)
+ {
+ if(rrcVer->iE_Extensions)
+ {
+ if(rrcVer->iE_Extensions->list.array)
+ {
+ if(rrcVer->iE_Extensions->list.array[0])
+ {
+ if(rrcVer->iE_Extensions->list.\
+ array[0]->extensionValue.choice.Latest_RRC_Version_Enhanced.buf)
+ {
+ free(rrcVer->iE_Extensions->list.\
+ array[0]->extensionValue.choice.Latest_RRC_Version_Enhanced.buf);
+ }
+ free(rrcVer->iE_Extensions->list.array[0]);
+ }
+ free(rrcVer->iE_Extensions->list.array);
+ }
+ free(rrcVer->iE_Extensions);
+ }
+ free(rrcVer->latest_RRC_Version.buf);
+ }
+ break;
- /*DUtoCURRC Information */
- idx++;
- ueSetRsp->protocolIEs.list.array[idx]->id = \
- 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->cellGrpCfg)
- {
- cellGrpCfg = (CellGroupConfigRrc_t*)ueCb->f1UeDb->cellGrpCfg;
- ret = EncodeUeCntxtDuToCuInfo(&ueSetRsp->protocolIEs.list.array[idx]->value.\
- choice.DUtoCURRCInformation.cellGroupConfig, cellGrpCfg);
- /* Free UeContext Db created during Ue context Req */
- freeF1UeDb(ueCb->f1UeDb);
- }
- }
- else
- {
- DU_LOG("\nF1AP: Failed to form DUtoCU RRCInfo at BuildAndSendUeContextSetupRsp()");
- ret = RFAILED;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> DU_APP : Invalid IE received in F1SetupRsp:%ld",
+ f1SetRspMsg->protocolIEs.list.array[ieIdx]->id);
+ }
+ }
+ free(f1SetRspMsg->protocolIEs.list.array[ieIdx]);
+ }
}
- if(ret == RFAILED)
- break;
+ free(f1SetRspMsg->protocolIEs.list.array);
+ }
+}
+/******************************************************************
+ *
+ * @brief Processes F1 Setup Response sent by CU
+ *
+ * @details
+ *
+ * Function : procF1SetupRsp
+ *
+ * Functionality: Processes F1 Setup Response sent by CU
+ *
+ * @params[in] F1AP_PDU_t ASN decoded F1AP message
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t procF1SetupRsp(F1AP_PDU_t *f1apMsg)
+{
+ uint8_t ret = ROK;
+ uint16_t idx =0;
+ F1SetupResponse_t *f1SetRspMsg = NULLP;
+ GNB_CU_Name_t *cuName = NULLP;
+ F1SetupRsp f1SetRspDb;
+ RRC_Version_t *rrcVer =NULLP;
+
+ memset(&f1SetRspDb, 0, sizeof(F1SetupRsp));
- xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
+ DU_LOG("\nINFO --> F1AP : F1 Setup Response received");
+ f1SetRspMsg = &f1apMsg->choice.successfulOutcome->value.choice.F1SetupResponse;
- /* Encode the UE context setup response type as APER */
- memset((uint8_t *)encBuf, 0, ENC_BUF_MAX_LEN);
- encBufSize = 0;
- encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf,\
- encBuf);
- /* Encode results */
- if(encRetVal.encoded == ENCODE_FAIL)
+ for(idx=0; idx<f1SetRspMsg->protocolIEs.list.count; idx++)
+ {
+ switch(f1SetRspMsg->protocolIEs.list.array[idx]->id)
{
- DU_LOG( "\n F1AP : Could not encode UE Context Setup Request structure (at %s)\n",\
- encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
- ret = RFAILED;
- break;
+ case ProtocolIE_ID_id_Cells_to_be_Activated_List:
+ {
+ extractCellsToBeActivated(f1SetRspMsg->protocolIEs.list.array[idx]->\
+ value.choice.Cells_to_be_Activated_List);
+ break;
+ }
+ case ProtocolIE_ID_id_TransactionID:
+ {
+ f1SetRspDb.transId = f1SetRspMsg->protocolIEs.list.array[idx]->\
+ value.choice.TransactionID;
+ break;
+ }
+ case ProtocolIE_ID_id_gNB_CU_Name:
+ {
+ cuName = &f1SetRspMsg->protocolIEs.list.array[idx]->\
+ value.choice.GNB_CU_Name;
+ strcpy(f1SetRspDb.cuName, (const char*)cuName->buf);
+ break;
+ }
+ case ProtocolIE_ID_id_GNB_CU_RRC_Version:
+ {
+ rrcVer = &f1SetRspMsg->protocolIEs.list.array[idx]->value.choice.RRC_Version;
+ strcpy(f1SetRspDb.rrcVersion.rrcVer,
+ (const char*)rrcVer->latest_RRC_Version.buf);
+ break;
+ }
+ default:
+ DU_LOG("\nERROR --> DU_APP : Invalid IE received in F1SetupRsp:%ld",
+ f1SetRspMsg->protocolIEs.list.array[idx]->id);
}
- else
+ duProcF1SetupRsp();
+ }
+
+ freeAperDecodeF1SetupRsp(f1SetRspMsg);
+ return ret;
+}
+/*******************************************************************
+*
+* @brief free GNB DU config update ack
+*
+* @details
+*
+* Function : freeAperDecodeGnbDuAck
+*
+* Functionality: Processes GNB DU config update ack And
+* added free part for the memory allocated by aper_decoder
+*
+* @params[in] F1AP_PDU_t ASN decoded F1AP message
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+void freeAperDecodeGnbDuAck(GNBDUConfigurationUpdateAcknowledge_t *gnbDuAck)
+{
+ uint8_t ieIdx = 0;
+
+ if(gnbDuAck->protocolIEs.list.array)
+ {
+ for(ieIdx=0; ieIdx < gnbDuAck->protocolIEs.list.count; ieIdx++)
{
- DU_LOG("\n F1AP : Created APER encoded buffer for UE Context Setup Request\n");
- for(int i=0; i< encBufSize; i++)
+ if(gnbDuAck->protocolIEs.list.array[ieIdx])
{
- printf("%x",encBuf[i]);
+ free(gnbDuAck->protocolIEs.list.array[ieIdx]);
}
}
-
- /* Sending msg */
- if(SendF1APMsg(DU_APP_MEM_REGION,DU_POOL) != ROK)
+ free(gnbDuAck->protocolIEs.list.array);
+ }
+}
+/*******************************************************************
+*
+* @brief Processes GNB DU config update ack
+*
+* @details
+*
+* Function : procF1GNBDUCfgUpdAck
+*
+* Functionality: added free part for the memory allocated by aper_decoder
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return void
+*
+* ****************************************************************/
+uint8_t procF1GNBDUCfgUpdAck(F1AP_PDU_t *f1apMsg)
+{
+ uint8_t ieIdx;
+ GNBDUConfigurationUpdateAcknowledge_t *gnbDuAck = NULLP;
+
+ DU_LOG("\nINFO --> F1AP : GNB-DU config update acknowledgment");
+ gnbDuAck = &f1apMsg->choice.successfulOutcome->value.choice.GNBDUConfigurationUpdateAcknowledge;
+
+ for(ieIdx=0; ieIdx < gnbDuAck->protocolIEs.list.count; ieIdx++)
+ {
+ switch(gnbDuAck->protocolIEs.list.array[ieIdx]->id)
{
- DU_LOG("\n F1AP : Sending UE Context Setup Request Failed");
- ret = RFAILED;
- break;
+ case ProtocolIE_ID_id_TransactionID:
+ break;
+ case ProtocolIE_ID_id_Cells_to_be_Activated_List:
+ break;
+ default :
+ DU_LOG("\nERROR --> F1AP: Invalid IE Received: %ld, at procF1GNBDUCfgUpdAck()", \
+ gnbDuAck->protocolIEs.list.array[ieIdx]->id);
+ break;
}
- break;
}
- FreeUeContextSetupRsp(f1apMsg);
- return ret;
-}/* End of BuildAndSendUeContextSetupRsp */
-
-
-uint8_t BuildAndSendUeCtxtRsp(uint8_t ueIdx, uint8_t cellId)
-{
- uint8_t cellIdx = 0, actionType = 0;
-
- GET_CELL_IDX(cellId, cellIdx);
- actionType = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].f1UeDb->actionType;
-
- switch(actionType)
+ duProcGnbDuCfgUpdAckMsg();
+#if 0
+ if(BuildAndSendF1ResetReq() != ROK)
{
- case UE_CTXT_SETUP:
- BuildAndSendUeContextSetupRsp(ueIdx, cellId);
- break;
- case UE_CTXT_MOD:
- //TODO: Build Ue context Modification Rsp
- break;
- default:
- DU_LOG("F1AP: Invalid Action Type %d at BuildAndSendUeCtxtRsp()", actionType);
- break;
-
+ return RFAILED;
}
+#endif
+
+ freeAperDecodeGnbDuAck(gnbDuAck);
return ROK;
}
+/******************************************************************
+*
+* @brief free DL RRC Message Transfer allocated by aper_decoder
+*
+* @details
+*
+* Function : freeAperDecodef1DlRrcMsg
+*
+* Functionality: free DL RRC Message Transfer allocated by aper_decoder
+*
+* @params[in] DLRRCMessageTransfer_t *f1DlRrcMsg
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
-/*******************************************************************
- *
- * @brief deallocating the memory of F1reset msg
- *
- * @details
- *
- * Function : FreeF1ResetReq
- *
- * Functionality :
- * - freeing memory of F1reset request msg
- *
- * @params[in]
- * @return void
- *
- *
- * ****************************************************************/
-void FreeF1ResetReq(F1AP_PDU_t *f1apMsg)
+void freeAperDecodef1DlRrcMsg(DLRRCMessageTransfer_t *f1DlRrcMsg)
{
- uint8_t idx =0 ;
- Reset_t *f1ResetMsg;
+ uint8_t ieIdx =0;
+ RRCContainer_t *rrcContainer = NULLP;
- if(f1apMsg)
+ if(f1DlRrcMsg->protocolIEs.list.array)
{
- if(f1apMsg->choice.initiatingMessage)
+ for(ieIdx=0; ieIdx<f1DlRrcMsg->protocolIEs.list.count; ieIdx++)
{
- f1ResetMsg = &f1apMsg->choice.initiatingMessage->value.choice.Reset;
-
- if(f1ResetMsg->protocolIEs.list.array)
+ if(f1DlRrcMsg->protocolIEs.list.array[ieIdx])
{
- for(idx=0 ;idx < f1ResetMsg->protocolIEs.list.count ; idx++)
+ switch(f1DlRrcMsg->protocolIEs.list.array[ieIdx]->id)
{
- if(f1ResetMsg->protocolIEs.list.array[idx])
- {
- DU_FREE(f1ResetMsg->protocolIEs.list.array[idx],sizeof(ResetIEs_t));
- }
+ case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+ break;
+ case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+ break;
+ case ProtocolIE_ID_id_SRBID:
+ break;
+ case ProtocolIE_ID_id_RRCContainer:
+ {
+ rrcContainer =&f1DlRrcMsg->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer;
+ free(rrcContainer->buf);
+ }
+ case ProtocolIE_ID_id_ExecuteDuplication:
+ break;
+ case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
+ break;
+ break;
}
- DU_FREE(f1ResetMsg->protocolIEs.list.array,f1ResetMsg->protocolIEs.list.size);
+ free(f1DlRrcMsg->protocolIEs.list.array[ieIdx]);
}
- DU_FREE(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
}
- DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
+ free(f1DlRrcMsg->protocolIEs.list.array);
}
}
-/*******************************************************************
+/******************************************************************
*
- * @brief Build and Send F1reset request
+ * @brief Processes DL RRC Message Transfer sent by CU
*
* @details
*
- * Function : BuildAndSendF1ResetReq
+ * Function : procF1DlRrcMsgTrans
*
- * Functionality:
- * - Build and Send F1reset request msg
+ * Functionality: Processes DL RRC Message Transfer sent by CU
*
- * @params[in]
+ * @params[in] F1AP_PDU_t ASN decoded F1AP message
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildAndSendF1ResetReq()
+uint8_t procF1DlRrcMsgTrans(F1AP_PDU_t *f1apMsg)
{
- uint8_t elementCnt=0;
- uint8_t idx=0;
- uint8_t ret= RFAILED;
- Reset_t *f1ResetMsg = NULLP;
- F1AP_PDU_t *f1apMsg = NULLP;
- asn_enc_rval_t encRetVal;
- DU_LOG("\nF1AP : Building F1 Reset request \n");
- do
- {
- DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
- if(f1apMsg == NULLP)
- {
- break;
- }
- f1apMsg->present = F1AP_PDU_PR_initiatingMessage;
- DU_ALLOC(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
- if(f1apMsg->choice.initiatingMessage == NULLP)
- {
- break;
- }
- f1apMsg->choice.initiatingMessage->procedureCode = ProcedureCode_id_Reset;
- f1apMsg->choice.initiatingMessage->criticality = Criticality_reject;
- f1apMsg->choice.initiatingMessage->value.present = InitiatingMessage__value_PR_Reset;
+ uint8_t idx, ret;
+ DLRRCMessageTransfer_t *f1DlRrcMsg = NULLP;
+ F1DlRrcMsg dlMsg;
+ memset(&dlMsg, 0, sizeof(F1DlRrcMsg));
- f1ResetMsg = &f1apMsg->choice.initiatingMessage->value.choice.Reset;
+ DU_LOG("\nINFO --> DU_APP : DL RRC message transfer Recevied");
+ f1DlRrcMsg = &f1apMsg->choice.initiatingMessage->value.choice.DLRRCMessageTransfer;
- elementCnt = 3;
- f1ResetMsg->protocolIEs.list.count = elementCnt;
- f1ResetMsg->protocolIEs.list.size = elementCnt * sizeof(ResetIEs_t *);
+ ret = ROK;
- /* Initialize the F1Setup members */
- DU_ALLOC(f1ResetMsg->protocolIEs.list.array,f1ResetMsg->protocolIEs.list.size);
- if(f1ResetMsg->protocolIEs.list.array == NULLP)
- {
- break;
- }
- for(idx=0; idx<elementCnt; idx++)
+ for(idx=0; idx<f1DlRrcMsg->protocolIEs.list.count; idx++)
+ {
+ switch(f1DlRrcMsg->protocolIEs.list.array[idx]->id)
{
- DU_ALLOC(f1ResetMsg->protocolIEs.list.array[idx],sizeof(ResetIEs_t));
- if(f1ResetMsg->protocolIEs.list.array[idx] == NULLP)
- {
+ case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+ {
+ dlMsg.gnbCuUeF1apId = f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.GNB_CU_UE_F1AP_ID;
+ break;
+ }
+ case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+ {
+ dlMsg.gnbDuUeF1apId = f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.GNB_DU_UE_F1AP_ID;
+ break;
+ }
+ case ProtocolIE_ID_id_SRBID:
+ {
+ dlMsg.srbId = f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.SRBID;
+ break;
+ }
+ case ProtocolIE_ID_id_ExecuteDuplication:
+ dlMsg.execDup = true;
break;
- }
- }
-
- /*TransactionID*/
- idx=0;
- f1ResetMsg->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_TransactionID;
- f1ResetMsg->protocolIEs.list.array[idx]->criticality = Criticality_reject;
- f1ResetMsg->protocolIEs.list.array[idx]->value.present = ResetIEs__value_PR_TransactionID;
- f1ResetMsg->protocolIEs.list.array[idx]->value.choice.TransactionID = 1;
- /*Cause*/
- idx++;
- f1ResetMsg->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_Cause;
- f1ResetMsg->protocolIEs.list.array[idx]->criticality = Criticality_ignore;
- f1ResetMsg->protocolIEs.list.array[idx]->value.present = ResetIEs__value_PR_Cause;
- f1ResetMsg->protocolIEs.list.array[idx]->value.choice.Cause.present = Cause_PR_radioNetwork;
- f1ResetMsg->protocolIEs.list.array[idx]->value.choice.Cause.choice.radioNetwork = CauseRadioNetwork_action_desirable_for_radio_reasons;
+ case ProtocolIE_ID_id_RRCContainer:
+ {
+ if(f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.size > 0)
+ {
+ dlMsg.rrcMsgSize = f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.size;
+ DU_ALLOC(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);
+ }
+ }
- /*Reset Type*/
- idx++;
- f1ResetMsg->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_ResetType;
- f1ResetMsg->protocolIEs.list.array[idx]->criticality = Criticality_reject;
- f1ResetMsg->protocolIEs.list.array[idx]->value.present = ResetIEs__value_PR_ResetType;
- f1ResetMsg->protocolIEs.list.array[idx]->value.choice.ResetType.present = ResetType_PR_f1_Interface;
- f1ResetMsg->protocolIEs.list.array[idx]->value.choice.ResetType.choice.f1_Interface = ResetAll_reset_all;
+ ret = duProcDlRrcMsg(&dlMsg);
- xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
+ 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
+*
+* ****************************************************************/
- /* 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);
+uint8_t BuildDrbSetupModList(DRBs_SetupMod_List_t *drbSet , DuUeCfg *ueCfg)
+{
+ uint8_t arrIdx =0;
+ uint8_t drbCnt =0;
+ struct DRBs_SetupMod_ItemIEs *drbItemIe;
- /* Encode results */
- if(encRetVal.encoded == ENCODE_FAIL)
- {
- DU_LOG("\nF1AP : Could not encode F1Reset structure (at %s)\n",\
- encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
- break;
- }
- else
+ drbCnt = 1;
+ drbSet->list.count = drbCnt;
+ drbSet->list.size = drbCnt * sizeof(DRBs_SetupMod_ItemIEs_t *);
+ DU_ALLOC(drbSet->list.array, drbSet->list.size);
+ if(drbSet->list.array == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbToBeSetupModList");
+ return RFAILED;
+ }
+ for(arrIdx=0; arrIdx<drbCnt; arrIdx++)
+ {
+ DU_ALLOC(drbSet->list.array[arrIdx], sizeof(DRBs_SetupMod_ItemIEs_t));
+ if(drbSet->list.array[arrIdx] == NULLP)
{
- DU_LOG("\nF1AP : Created APER encoded buffer for F1Reset\n");
- for(idx=0; idx< encBufSize; idx++)
- {
- printf("%x",encBuf[idx]);
- }
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbToBeSetupModList");
+ return RFAILED;
}
- if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != 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("\nF1AP : Sending F1 Reset request failed");
- break;
+ DU_LOG("\nERROR --> F1AP : Failed to fill DlTnl SetupList in BuildDrbToBeSetupModList");
+ return RFAILED;
}
+
+ }
- ret = ROK;
- break;
- }while(true);
-
- FreeF1ResetReq(f1apMsg);
- return ret;
+ return ROK;
}
/*******************************************************************
- *
- * @brief Build And Send F1ResetAck
- *
- * @details
- *
- * Function : BuildAndSendF1ResetAck
- *
- * Functionality:
- * - Build And Send F1ResetRSP
- *
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-void FreeF1ResetAck(F1AP_PDU_t *f1apMsg)
+* @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 idx;
- ResetAcknowledge_t *f1ResetAck;
+ 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);
+ }
+}
+/*******************************************************************
+* @brief Free the memory allocated for UE Context Mod Response
+*
+* @details
+*
+* Function : FreeUeContextModResp
+*
+* Functionality:
+* Free the memory allocated for UE Context Mod Response
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return void
+*
+* ****************************************************************/
+void FreeUeContextModResp(F1AP_PDU_t *f1apMsg)
+{
+ uint8_t ieIdx;
+ UEContextModificationResponse_t *ueContextModifyRes = NULLP;
if(f1apMsg)
{
if(f1apMsg->choice.successfulOutcome)
{
- f1ResetAck= &f1apMsg->choice.successfulOutcome->value.choice.ResetAcknowledge;
+ ueContextModifyRes =&f1apMsg->choice.successfulOutcome->value.choice.UEContextModificationResponse;
+ if(ueContextModifyRes->protocolIEs.list.array)
+ {
+ for(ieIdx=0 ; ieIdx<ueContextModifyRes->protocolIEs.list.count; ieIdx++)
+ {
+ if(ueContextModifyRes->protocolIEs.list.array[ieIdx])
+ {
+ switch(ueContextModifyRes->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_DRBs_SetupMod_List:
+ {
+ FreeDrbSetupModList(&(ueContextModifyRes->protocolIEs.list.array[ieIdx]->\
+ value.choice.DRBs_SetupMod_List));
+ break;
+ }
+ }
+ DU_FREE(ueContextModifyRes->protocolIEs.list.array[ieIdx], sizeof(UEContextModificationResponse_t));
+ }
- if(f1ResetAck->protocolIEs.list.array)
- {
- for(idx=0; idx<f1ResetAck->protocolIEs.list.count ; idx++)
- {
- if(f1ResetAck->protocolIEs.list.array[idx])
- {
- DU_FREE(f1ResetAck->protocolIEs.list.array[idx], sizeof(ResetAcknowledgeIEs_t));
- }
- }
- DU_FREE(f1ResetAck->protocolIEs.list.array, f1ResetAck->protocolIEs.list.size );
- }
- DU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
+ }
+ DU_FREE(ueContextModifyRes->protocolIEs.list.array, ueContextModifyRes->protocolIEs.list.size);
+ }
+ DU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
}
DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
}
}
-/*******************************************************************
- *
- * @brief Build And Send F1ResetAck
- *
- * @details
- *
- * Function : BuildAndSendF1ResetAck
- *
- * Functionality:
- * - Build And Send F1ResetRSP
- *
- * @params[in]
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-uint8_t BuildAndSendF1ResetAck()
+/*****************************************************************i
+*
+* @brief Creating the ue context modifcation response and sending
+*
+* @details
+*
+* Function : BuildAndSendUeContextModResp
+*
+* Functionality:
+* - Creating the ue context modifcation response
+*
+* @params[in]
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t BuildAndSendUeContextModResp(uint8_t ueIdx, uint8_t cellId)
{
- uint8_t idx = 0;
- uint8_t elementCnt = 0;
- uint8_t ret = RFAILED;
- F1AP_PDU_t *f1apMsg = NULL;
- ResetAcknowledge_t *f1ResetAck = NULLP;
+ uint8_t ieIdx = 0;
+ uint8_t cellIdx =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;
- DU_LOG("\nF1AP : Building F1 Reset Acknowledgment \n");
+ UEContextModificationResponse_t *ueContextModifyRes = NULLP;
+ DuUeCb *ueCb = NULLP;
- do{
- /* Allocate the memory for F1ResetRequest_t */
+ DU_LOG("\nINFO --> F1AP : Building Ue context modification response\n");
+
+ while(1)
+ {
DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
if(f1apMsg == NULLP)
{
- DU_LOG("\nF1AP : Memory allocation for F1AP-PDU failed");
- break;
+ DU_LOG("\nERROR --> F1AP : Memory allocation for F1AP-PDU failed Ue context modification");
+ break;
}
f1apMsg->present = F1AP_PDU_PR_successfulOutcome;
DU_ALLOC(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
if(f1apMsg->choice.successfulOutcome == NULLP)
{
- DU_LOG("\nF1AP : Memory allocation for F1AP-PDU failed");
- break;
+ DU_LOG("\nERROR --> F1AP : Memory allocation for F1AP-PDU failed Ue context modification");
+ break;
}
- f1apMsg->choice.successfulOutcome->criticality = Criticality_reject;
- f1apMsg->choice.successfulOutcome->value.present = SuccessfulOutcome__value_PR_ResetAcknowledge;
- f1ResetAck = &f1apMsg->choice.successfulOutcome->value.choice.ResetAcknowledge;
+ f1apMsg->choice.successfulOutcome->procedureCode = ProcedureCode_id_UEContextModification;
+ f1apMsg->choice.successfulOutcome->criticality = Criticality_reject;
+ f1apMsg->choice.successfulOutcome->value.present = SuccessfulOutcome__value_PR_UEContextModificationResponse;
- elementCnt = 1;
+ ueContextModifyRes =&f1apMsg->choice.successfulOutcome->value.choice.UEContextModificationResponse;
- f1ResetAck->protocolIEs.list.count = elementCnt;
- f1ResetAck->protocolIEs.list.size = elementCnt*sizeof(ResetAcknowledgeIEs_t *);
+ elementCnt = 3;
+ ueContextModifyRes->protocolIEs.list.count = elementCnt;
+ ueContextModifyRes->protocolIEs.list.size = elementCnt*sizeof(UEContextModificationResponse_t*);
- DU_ALLOC(f1ResetAck->protocolIEs.list.array, f1ResetAck->protocolIEs.list.size );
- if(f1ResetAck->protocolIEs.list.array == NULLP)
+ /* Initialize the UE context modification members */
+ DU_ALLOC(ueContextModifyRes->protocolIEs.list.array, ueContextModifyRes->protocolIEs.list.size);
+ if(ueContextModifyRes->protocolIEs.list.array == NULLP)
{
- DU_LOG("\nF1AP : Memory allocation for F1ResetAckIEs failed");
- break;
+ DU_LOG("\nERROR --> F1AP : Memory allocation for UE context modifcation Request failed");
+ break;
}
- for(idx=0; idx<elementCnt; idx++)
+ for(ieIdx=0 ; ieIdx<elementCnt; ieIdx++)
{
- DU_ALLOC(f1ResetAck->protocolIEs.list.array[idx], sizeof(ResetAcknowledgeIEs_t));
- if(f1ResetAck->protocolIEs.list.array[idx] == NULLP)
- {
- break;
- }
+ DU_ALLOC(ueContextModifyRes->protocolIEs.list.array[ieIdx], sizeof(UEContextModificationResponse_t));
+ if(ueContextModifyRes->protocolIEs.list.array[ieIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation for UE context modifcation Request failed");
+ break;
+ }
}
- /*TransactionID*/
- idx = 0;
- f1ResetAck->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_TransactionID;
- f1ResetAck->protocolIEs.list.array[idx]->criticality = Criticality_reject;
- f1ResetAck->protocolIEs.list.array[idx]->value.present = ResetAcknowledgeIEs__value_PR_TransactionID;
- f1ResetAck->protocolIEs.list.array[idx]->value.choice.TransactionID = TRANS_ID;
+ /* 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;
+
+ 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;
+
+ 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)
+ {
+ 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 ");
+ break;
+ }
+ freeF1UeDb(ueCb->f1UeDb);
+ ueCb->f1UeDb = NULLP;
+ }
xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
- /* Encode the F1SetupRequest type as UPER */
+ /* 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);
+ encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf,encBuf);
- /* Check encode results */
+ /* Encode results */
if(encRetVal.encoded == ENCODE_FAIL)
{
- DU_LOG("\nF1AP : Could not encode F1ResetAck structure (at %s)\n",\
- encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
- break;
+ DU_LOG( "\nERROR --> F1AP : Could not encode UE Context Setup Request structure (at %s)\n",\
+ encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+ ret = RFAILED;
+ break;
}
else
{
- DU_LOG("\nF1AP : Created APER encoded buffer for F1SetupResponse\n");
- for(int i=0; i< encBufSize; i++)
- {
- printf("%x",encBuf[i]);
- }
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for UE Context Modification Response\n");
+ for(int i=0; i< encBufSize; i++)
+ {
+ printf("%x",encBuf[i]);
+ }
}
- /* Sending msg */
- if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+
+ /* Sending msg */
+ if(SendF1APMsg(DU_APP_MEM_REGION,DU_POOL) != ROK)
{
- DU_LOG("\nF1AP : Sending F1 Reset Acknowledgement failed");
- break;
+ DU_LOG("\nERROR --> F1AP : Sending UE Context Setup Res Failed");
+ ret = RFAILED;
+ break;
}
-
- ret = ROK;
break;
- }while(true);
-
- FreeF1ResetAck(f1apMsg);
+ }
+ FreeUeContextModResp(f1apMsg);
return ret;
-}
+}
/*******************************************************************
*
- * @brief Processes GNB DU config update ack
+ * @brief Deallocating the memory allocated by the aper decoder
+ * for QOSInfo
*
* @details
*
- * Function : procGNBDUCfgUpdAck
+ * Function : freeAperDecodeQosInfo
*
- * Functionality: Processes GNB DU config update ack
+ * Functionality: Deallocating the memory allocated for QOSInfo
*
- * @params[in] F1AP_PDU_t ASN decoded F1AP message
- * @return ROK - success
- * RFAILED - failure
+ * @params[in] QoSFlowLevelQoSParameters_t *drbQos
+ *
+ * @return void
*
* ****************************************************************/
-uint8_t procGNBDUCfgUpdAck(F1AP_PDU_t *f1apMsg)
+
+void freeAperDecodeQosInfo(QoSFlowLevelQoSParameters_t *drbQos)
{
- DU_LOG("\nF1AP : GNB-DU config update acknowledgment received");
-#if 0
- if(BuildAndSendF1ResetReq() != ROK)
+ if(drbQos->qoS_Characteristics.choice.non_Dynamic_5QI != NULLP)
{
- return RFAILED;
+ if(drbQos->qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow!=NULLP)
+ {
+ if(drbQos->qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume!=NULLP)
+ {
+ free(drbQos->qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume);
+ }
+ free(drbQos->qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow);
+ }
+ free(drbQos->qoS_Characteristics.choice.non_Dynamic_5QI);
}
-#endif
- /* TODO :Check the deallocation */
+}
+/*******************************************************************
+ *
+ * @brief Deallocating the memory allocated by the aper decoder
+ * for UlTnlInfoforDrb
+ *
+ * @details
+ *
+ * Function : freeAperDecodeUlTnlInfoforDrbSetupMod
+ *
+ * Functionality: Deallocating memory allocated for UlTnlInfoforDrb
+ *
+ * @params[in] ULUPTNLInformation_ToBeSetup_List_t *ulInfo
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void freeAperDecodeUlTnlInfoforDrbSetupMod(ULUPTNLInformation_ToBeSetup_List_t *ulInfo)
+{
+ uint8_t arrIdx =0;
-#if 0
- DU_FREE(gNBDuCfgAck->protocolIEs.list.array,(Size)elementCnt * sizeof(GNBDUConfigurationUpdateAcknowledgeIEs_t));
- DU_FREE(f1apMsg->choice.successfulOutcome,(Size)sizeof(SuccessfulOutcome_t));
- DU_FREE(f1apMsg,(Size)sizeof(F1AP_PDU_t));
-#endif
- return ROK;
+ if(ulInfo->list.array)
+ {
+ for(arrIdx=0; arrIdx<ulInfo->list.count ; arrIdx++)
+ {
+ if(ulInfo->list.array[arrIdx])
+ {
+ if(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel )
+ {
+ if(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->transportLayerAddress.buf)
+ {
+ if(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf)
+ {
+ free(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->\
+ gTP_TEID.buf);
+ }
+ free(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->\
+ transportLayerAddress.buf);
+ }
+ free(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel);
+ }
+ free(ulInfo->list.array[arrIdx]);
+ }
+ }
+ free(ulInfo->list.array);
+ }
}
-/******************************************************************
+/*******************************************************************
*
- * @brief Processes DL RRC Message Transfer sent by CU
+ * @brief Deallocating the memory allocated by the aper decoder
+ * for DrbSetupModItem
*
* @details
*
- * Function : procDlRrcMsgTrans
+ * Function : freeAperDecodeDrbSetupModItem
*
- * Functionality: Processes DL RRC Message Transfer sent by CU
+ * Functionality: Deallocating memory allocated for DrbSetupModItem
*
- * @params[in] F1AP_PDU_t ASN decoded F1AP message
- * @return ROK - success
- * RFAILED - failure
+ * @params[in] DRBs_ToBeSetupMod_Item_t *drbItem
+ *
+ * @return void
*
* ****************************************************************/
-uint8_t procF1ResetReq(F1AP_PDU_t *f1apMsg)
+
+void freeAperDecodeDrbSetupModItem(DRBs_ToBeSetupMod_Item_t *drbItem)
{
- /* we are currently not supporting Ue release. right now we are supporting only init case of fireset */
- uint8_t idx = 0;
- uint8_t ret = ROK;
- Reset_t *f1ResetMsg = NULLP;
+ uint8_t arrIdx =0;
+ SNSSAI_t *snssai =NULLP;
+ Flows_Mapped_To_DRB_List_t *flowMap = NULLP;
- DU_LOG("\nProcessing F1 reset request");
- f1ResetMsg = &f1apMsg->choice.initiatingMessage->value.choice.Reset;
+ 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);
+ }
- for(idx=0; idx<f1ResetMsg->protocolIEs.list.count; idx++)
+ free(drbItem->qoSInformation.choice.choice_extension);
+ }
+ break;
+ }
+
+ }
+ freeAperDecodeUlTnlInfoforDrbSetupMod(&drbItem->uLUPTNLInformation_ToBeSetup_List);
+ if(drbItem->uLConfiguration)
{
- switch(f1ResetMsg->protocolIEs.list.array[idx]->id)
- {
- case ProtocolIE_ID_id_TransactionID:
- break;
+ free(drbItem->uLConfiguration);
+ }
+}
- case ProtocolIE_ID_id_Cause:
- break;
+/*******************************************************************
+ *
+ * @brief Deallocating the memory allocated by the aper decoder
+ * for DrbToBeSetupModList
+ *
+ * @details
+ *
+ * Function : freeAperDecodeDrbToBeSetupModList
+ *
+ * Functionality: Deallocating memory allocated for DrbToBeSetupModList
+ *
+ * @params[in] DRBs_ToBeSetupMod_List_t *drbSet
+ *
+ * @return void
+ *
+ * ****************************************************************/
- case ProtocolIE_ID_id_ResetType:
- {
- DU_LOG("\nReceived F1 Reset request");
- break;
- }
+void freeAperDecodeDrbToBeSetupModList(DRBs_ToBeSetupMod_List_t *drbSet)
+{
+ uint8_t arrIdx =0;
+ struct DRBs_ToBeSetupMod_ItemIEs *drbItemIe;
- default:
- break;
+ if(drbSet->list.array)
+ {
+ for(arrIdx=0; arrIdx<drbSet->list.count ; arrIdx++)
+ {
+ if(drbSet->list.array[arrIdx] != NULLP)
+ {
+ if(arrIdx == 0)
+ {
+ drbItemIe = (DRBs_ToBeSetupMod_ItemIEs_t *)drbSet->list.array[arrIdx];
+ freeAperDecodeDrbSetupModItem(&(drbItemIe->value.choice.DRBs_ToBeSetupMod_Item));
+ }
+ free(drbSet->list.array[arrIdx]);
+ }
}
+ free(drbSet->list.array);
}
- ret = BuildAndSendF1ResetAck();
- DU_LOG("\nUE release is not supported for now");
- return ret;
-}
+}
/*******************************************************************
*
- * @brief free the RRC delivery report
+ * @brief Deallocating the memory allocated by the aper decoder
+ * for UeContextModificationReqMsg
*
* @details
*
- * Function : freeRrcDeliveryReport
+ * Function : freeAperDecodeUeContextModificationReqMsg
*
- * Functionality: free the RRC delivery report
+ * Functionality: Deallocating memory allocated for
+ * UeContextModificationReqMsg
*
- * @params[in]
- * @return ROK - success
- * RFAILED - failure
+ * @params[in] UEContextModificationRequest_t *UeContextModifyReq
+ *
+ * @return void
*
* ****************************************************************/
-void freeRrcDeliveryReport(F1AP_PDU_t *f1apMsg )
+void freeAperDecodeUeContextModificationReqMsg(UEContextModificationRequest_t *UeContextModifyReq )
{
- uint8_t idx=0;
- RRCDeliveryReport_t *rrcDeliveryReport= NULLP;
+ uint8_t arrIdx, ieId;
- if(f1apMsg)
+ if(UeContextModifyReq->protocolIEs.list.array)
{
- if(f1apMsg->choice.initiatingMessage)
+ for( arrIdx = 0 ; arrIdx<UeContextModifyReq->protocolIEs.list.count ; arrIdx++)
{
- rrcDeliveryReport = &f1apMsg->choice.initiatingMessage->value.choice.RRCDeliveryReport;
- if(rrcDeliveryReport->protocolIEs.list.array)
- {
- for(idx =0 ;idx <rrcDeliveryReport->protocolIEs.list.count ;
- idx++)
- {
- if(rrcDeliveryReport->protocolIEs.list.array[idx])
- {
- DU_FREE(rrcDeliveryReport->protocolIEs.list.array[idx],
- sizeof(RRCDeliveryReportIEs_t));
- }
- }
- DU_FREE(rrcDeliveryReport->protocolIEs.list.array,
- rrcDeliveryReport->protocolIEs.list.size);
- }
- DU_FREE(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
+ if(UeContextModifyReq->protocolIEs.list.array[arrIdx])
+ {
+ ieId = UeContextModifyReq->protocolIEs.list.array[arrIdx]->id;
+ switch(ieId)
+ {
+ case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+ break;
+ case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+ break;
+ case ProtocolIE_ID_id_DRBs_ToBeSetupMod_List:
+ {
+ freeAperDecodeDrbToBeSetupModList(&UeContextModifyReq->protocolIEs.list.array[arrIdx]->\
+ value.choice.DRBs_ToBeSetupMod_List);
+ break;
+ }
+ }
+ free(UeContextModifyReq->protocolIEs.list.array[arrIdx]);
+ }
}
- DU_FREE(f1apMsg,
- sizeof(F1AP_PDU_t));
+ free(UeContextModifyReq->protocolIEs.list.array);
}
}
-
/*******************************************************************
-*
-* @brief Builds and sends the RRC delivery report
-*
-* @details
-*
-* Function : BuildAndSendRrcDeliveryReport
-*
-* Functionality: Builds and sends the RRC delivery report
-*
-* @params[in]
-*
-* @return ROK - success
-* RFAILED - failure
-*
-* ****************************************************************/
-uint8_t BuildAndSendRrcDeliveryReport(uint32_t gnbCuUeF1apId, \
- uint32_t gnbDuUeF1apId, RrcDeliveryReport *rrcDelivery)
+ *
+ * @brief processing the F1 UeContextModificationReq
+ *
+ * @details
+ *
+ * Function : procF1UeContextModificationReq
+ *
+ * Functionality: processing the F1 UeContextModificationReq
+ *
+ * @params[in] F1AP_PDU_t *f1apMsg
+ *
+ * @return
+ * ****************************************************************/
+uint8_t procF1UeContextModificationReq(F1AP_PDU_t *f1apMsg)
{
- uint8_t ret = RFAILED;
- uint8_t idx = 0;
- uint8_t idx1 = 0;
- uint8_t elementCnt = 0;
- F1AP_PDU_t *f1apMsg = NULLP;
- asn_enc_rval_t encRetVal;
- RRCDeliveryReport_t *rrcDeliveryReport= NULLP;
-
- do{
-
- DU_LOG("\nF1AP : Building RRC delivery Message Transfer Message\n");
- DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
- if(f1apMsg == NULLP)
- {
- DU_LOG(" F1AP : Memory allocation for F1AP-PDU failed");
- break;
- }
- f1apMsg->present = F1AP_PDU_PR_initiatingMessage;
- DU_ALLOC(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
- if(f1apMsg->choice.initiatingMessage == NULLP)
- {
- DU_LOG(" F1AP : Memory allocation for F1AP-PDU failed");
- break;
- }
- f1apMsg->choice.initiatingMessage->procedureCode = ProcedureCode_id_RRCDeliveryReport;
- f1apMsg->choice.initiatingMessage->criticality = Criticality_ignore;
- f1apMsg->choice.initiatingMessage->value.present = InitiatingMessage__value_PR_RRCDeliveryReport;
-
- rrcDeliveryReport = &f1apMsg->choice.initiatingMessage->value.choice.RRCDeliveryReport;
- elementCnt = 4;
- rrcDeliveryReport->protocolIEs.list.count = elementCnt;
- rrcDeliveryReport->protocolIEs.list.size = elementCnt * sizeof(RRCDeliveryReportIEs_t *);
-
- /* Initialize the F1Setup members */
- DU_ALLOC(rrcDeliveryReport->protocolIEs.list.array, rrcDeliveryReport->protocolIEs.list.size);
- if(rrcDeliveryReport->protocolIEs.list.array == NULLP)
- {
- DU_LOG(" F1AP : Memory allocation for RRC Delivery failed");
- break;
- }
- for(idx =0 ;idx <elementCnt; idx++)
- {
- DU_ALLOC(rrcDeliveryReport->protocolIEs.list.array[idx], sizeof(RRCDeliveryReportIEs_t));
- if(rrcDeliveryReport->protocolIEs.list.array[idx] == NULLP)
- {
- break;
- }
- }
-
- idx1 = 0;
-
- /*GNB CU UE F1AP ID*/
- rrcDeliveryReport->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->value.present = RRCDeliveryReportIEs__value_PR_GNB_CU_UE_F1AP_ID;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.GNB_CU_UE_F1AP_ID = gnbCuUeF1apId;
-
- /*GNB DU UE F1AP ID*/
- idx1++;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->value.present = RRCDeliveryReportIEs__value_PR_GNB_DU_UE_F1AP_ID;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.GNB_DU_UE_F1AP_ID = gnbDuUeF1apId;
-
- /*RRC delivery status*/
- idx1++;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_RRCDeliveryStatus;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->criticality = Criticality_ignore;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->value.present = RRCDeliveryReportIEs__value_PR_RRCDeliveryStatus;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.RRCDeliveryStatus.delivery_status =\
- rrcDelivery->rrcDeliveryStatus.deliveryStatus;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.RRCDeliveryStatus.triggering_message =\
- rrcDelivery->rrcDeliveryStatus.triggeringMessage;
-
- /* SRB ID */
- idx1++;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_SRBID;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->criticality = Criticality_ignore;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->value.present = RRCDeliveryReportIEs__value_PR_SRBID;
- rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.SRBID = rrcDelivery->srbId;
-
- xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
-
- /* Encode the RRC DELIVERY REPORT type as APER */
- memset(encBuf, 0, ENC_BUF_MAX_LEN);
- encBufSize = 0;
- encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf,\
- encBuf);
+ UEContextModificationRequest_t *ueContextModifyReq = NULLP;
+ uint8_t ret = ROK, ieIdx = 0, lcId =0,cellIdx=0, ueIdx=0;
+ DuUeCb *duUeCb = NULLP;
+ DRBs_ToBeSetupMod_List_t *drbSetupModCfg;
+ uint32_t gnbCuUeF1apId, gnbDuUeF1apId;
- /* Encode results */
- if(encRetVal.encoded == ENCODE_FAIL)
- {
- DU_LOG("\nF1AP : Could not encode RRC Delivery Msg structure (at %s)\n",\
- encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
- break;
- }
- else
+ ueContextModifyReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextModificationRequest;
+ for(ieIdx=0; (ieIdx < ueContextModifyReq->protocolIEs.list.count && ret == ROK); ieIdx++)
+ {
+ switch(ueContextModifyReq->protocolIEs.list.array[ieIdx]->id)
{
- DU_LOG("\nF1AP : Created APER encoded buffer for RRC Delivery Msg \n");
- for(idx=0; idx< encBufSize; idx++)
- {
- printf("%x",encBuf[idx]);
- }
- }
+ case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+ {
+ gnbCuUeF1apId = ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID;
+ break;
+ }
+ case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+ {
+ gnbDuUeF1apId = ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID;
+ break;
+ }
+ case ProtocolIE_ID_id_DRBs_ToBeSetupMod_List:
+ {
+ for(cellIdx = 0; cellIdx < duCb.numActvCells; cellIdx++)
+ {
+ for(ueIdx = 0; ueIdx < duCb.numUe; ueIdx++)
+ {
+ if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
+ (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
+ {
- /* Sending msg */
- if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
- {
- DU_LOG("\nF1AP : Sending RRC delivery msg request failed");
- break;
+ duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
+ lcId = getDrbLcId(&duUeCb->drbBitMap);
+ if(lcId != RFAILED)
+ {
+ DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
+ if(duUeCb->f1UeDb)
+ {
+ duUeCb->f1UeDb->actionType = UE_CTXT_MOD;
+ drbSetupModCfg = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\
+ choice.DRBs_ToBeSetupMod_List;
+ if(extractDrbListToSetup(lcId, NULL, drbSetupModCfg ,drbSetupModCfg->list.count, \
+ &duUeCb->f1UeDb->duUeCfg))
+ {
+ DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetup()");
+ ret = RFAILED;
+ }
+ }
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : wrong values of gnbCuUeF1apId and gnbDuUeF1apId ");
+ ret = RFAILED;
+ }
+ }
+ }
+ break;
+ }
}
- ret = ROK;
- break;
-
- }while(true);
-
- freeRrcDeliveryReport(f1apMsg);
- return ret;
+ }
+ if(ret != RFAILED)
+ {
+ ret = duProcUeContextModReq(duUeCb);
+ }
+ freeAperDecodeUeContextModificationReqMsg(ueContextModifyReq);
+ return ret;
}
-
/*****************************************************************i
*
* @brief Handles received F1AP message and sends back response
* ****************************************************************/
void F1APMsgHdlr(Buffer *mBuf)
{
- int i;
- char *recvBuf;
- MsgLen copyCnt;
- MsgLen recvBufLen;
- F1AP_PDU_t *f1apMsg;
+ int i =0;
+ char *recvBuf =NULLP;
+ MsgLen copyCnt =0;
+ MsgLen recvBufLen =0;
+ F1AP_PDU_t *f1apMsg =NULLP;
asn_dec_rval_t rval; /* Decoder return value */
F1AP_PDU_t f1apasnmsg ;
-
- DU_LOG("\nF1AP : Received F1AP message buffer");
+ DU_LOG("\nINFO --> F1AP : Received F1AP message buffer");
ODU_PRINT_MSG(mBuf, 0,0);
/* Copy mBuf into char array to decode it */
if(recvBuf == NULLP)
{
- DU_LOG("\nF1AP : Memory allocation failed");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed");
return;
}
if(ODU_COPY_MSG_TO_FIX_BUF(mBuf, 0, recvBufLen, (Data *)recvBuf, ©Cnt) != ROK)
{
- DU_LOG("\nF1AP : Failed while copying %d", copyCnt);
+ DU_LOG("\nERROR --> F1AP : Failed while copying %d", copyCnt);
return;
}
- printf("\nF1AP : Received flat buffer to be decoded : ");
+ printf("\nDEBUG --> F1AP : Received flat buffer to be decoded : ");
for(i=0; i< recvBufLen; i++)
{
printf("%x",recvBuf[i]);
if(rval.code == RC_FAIL || rval.code == RC_WMORE)
{
- DU_LOG("\nF1AP : ASN decode failed");
+ DU_LOG("\nERROR --> F1AP : ASN decode failed");
return;
}
printf("\n");
switch(f1apMsg->present)
{
case F1AP_PDU_PR_successfulOutcome:
- {
- switch(f1apMsg->choice.successfulOutcome->value.present)
- {
- case SuccessfulOutcome__value_PR_ResetAcknowledge:
- {
- DU_LOG("\nF1AP : F1ResetAcknowledge is received successfully ");
- break;
- }
- case SuccessfulOutcome__value_PR_F1SetupResponse:
- {
+ {
+ switch(f1apMsg->choice.successfulOutcome->value.present)
+ {
+ case SuccessfulOutcome__value_PR_ResetAcknowledge:
+ {
+ DU_LOG("\nINFO --> F1AP : F1ResetAcknowledge is received successfully ");
+ break;
+ }
+ case SuccessfulOutcome__value_PR_F1SetupResponse:
+ {
#ifndef ODU_TEST_STUB
- procF1SetupRsp(f1apMsg);
+ procF1SetupRsp(f1apMsg);
#endif
- break;
- }
+ break;
+ }
- case SuccessfulOutcome__value_PR_GNBDUConfigurationUpdateAcknowledge:
- {
- procGNBDUCfgUpdAck(f1apMsg);
- break;
- }
+ case SuccessfulOutcome__value_PR_GNBDUConfigurationUpdateAcknowledge:
+ {
+ procF1GNBDUCfgUpdAck(f1apMsg);
+ break;
+ }
- default:
- {
- DU_LOG("\nF1AP : Invalid type of successful outcome [%d]", f1apMsg->choice.successfulOutcome->value.present);
- return;
- }
- }/* End of switch(successfulOutcome) */
- break;
- }
+ default:
+ {
+ DU_LOG("\nERROR --> F1AP : Invalid type of SuccessfulOutcome__value_PR_ResetAcknowledge [%d]",\
+ f1apMsg->choice.successfulOutcome->value.present);
+ return;
+ }
+ }/* End of switch(successfulOutcome) */
+ free(f1apMsg->choice.successfulOutcome);
+ break;
+ }
case F1AP_PDU_PR_initiatingMessage:
- {
- switch(f1apMsg->choice.initiatingMessage->value.present)
- {
- case InitiatingMessage__value_PR_Reset:
- {
- DU_LOG("\nF1AP : F1 reset request received");
- procF1ResetReq(f1apMsg);
- break;
- }
- case InitiatingMessage__value_PR_DLRRCMessageTransfer:
- {
- procDlRrcMsgTrans(f1apMsg);
- break;
- }
- case InitiatingMessage__value_PR_UEContextSetupRequest:
- {
- procF1UeContextSetupReq(f1apMsg);
- break;
- }
-
- default:
- {
- DU_LOG("\nF1AP : Invalid type of initiating message[%d]",
- f1apMsg->choice.initiatingMessage->value.present);
- return;
- }
- }/* End of switch(initiatingMessage) */
- break;
- }
+ {
+ switch(f1apMsg->choice.initiatingMessage->value.present)
+ {
+ case InitiatingMessage__value_PR_Reset:
+ {
+ procF1ResetReq(f1apMsg);
+ break;
+ }
+ case InitiatingMessage__value_PR_DLRRCMessageTransfer:
+ {
+ procF1DlRrcMsgTrans(f1apMsg);
+ break;
+ }
+ case InitiatingMessage__value_PR_UEContextSetupRequest:
+ {
+ procF1UeContextSetupReq(f1apMsg);
+ break;
+ }
+ case InitiatingMessage__value_PR_UEContextModificationRequest:
+ {
+ procF1UeContextModificationReq(f1apMsg);
+ break;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> F1AP : Invalid type of F1AP_PDU_PR_initiatingMessage [%d]",
+ f1apMsg->choice.initiatingMessage->value.present);
+ return;
+ }
+ }/* End of switch(initiatingMessage) */
+ free(f1apMsg->choice.initiatingMessage);
+ break;
+ }
default:
- {
- DU_LOG("\nF1AP : Invalid type of f1apMsg->present [%d]",f1apMsg->present);
- return;
- }
+ {
+ DU_LOG("\nERROR --> F1AP : Invalid type of f1apMsg->present [%d]",f1apMsg->present);
+ return;
+ }
+ free(f1apMsg);
}/* End of switch(f1apMsg->present) */