uint8_t rlcUtlSendUlDataToDu(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *sdu)
{
#ifndef KW_PDCP
- KwuDatIndInfo *datIndInfo; /* Data Indication Information */
+ KwuDatIndInfo *datIndInfo = NULLP; /* Data Indication Information */
KwuDatIndInfo datIndInfoTmp;
#endif
- RlcUlRrcMsgInfo *ulRrcMsgInfo;
- RlcUlUserDatInfo *ulUserDatInfo;
- uint16_t msgLen, copyLen;
+ RlcUlRrcMsgInfo *ulRrcMsgInfo = NULLP;
+ RlcUlUserDatInfo *ulUserDatInfo = NULLP;
+ uint16_t msgLen = 0, copyLen = 0;
Pst pst;
#ifndef KW_PDCP
ulRrcMsgInfo, sizeof(RlcUlRrcMsgInfo));
if (ulRrcMsgInfo)
{
- ulRrcMsgInfo->cellId = rbCb->rlcId.cellId;
- ulRrcMsgInfo->ueIdx = rbCb->rlcId.ueId;
- ulRrcMsgInfo->lcId = rbCb->lch.lChId;
- RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL,
- ulRrcMsgInfo->rrcMsg, msgLen);
- if (ulRrcMsgInfo->rrcMsg)
- {
- ODU_GET_MSG_LEN(sdu, (MsgLen *)&msgLen);
- ODU_COPY_MSG_TO_FIX_BUF(sdu, 0, msgLen, ulRrcMsgInfo->rrcMsg, (MsgLen *)©Len);
- ulRrcMsgInfo->msgLen = msgLen;
-
- /* Sending UL RRC Message transfeer to DU APP */
- memset(&pst, 0, sizeof(Pst));
- FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_UL_RRC_MSG_TRANS_TO_DU);
- rlcSendUlRrcMsgToDu(&pst, ulRrcMsgInfo);
- }
- else
- {
- DU_LOG("\nERROR --> RLC_UL: rlcUtlSendUlDataToDu: Memory allocation failed for rrcMsg");
- RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, ulRrcMsgInfo, sizeof(RlcUlRrcMsgInfo));
- return RFAILED;
- }
+ ulRrcMsgInfo->cellId = rbCb->rlcId.cellId;
+ ulRrcMsgInfo->ueIdx = rbCb->rlcId.ueId;
+ ulRrcMsgInfo->lcId = rbCb->lch.lChId;
+ ODU_GET_MSG_LEN(sdu, (MsgLen *)&msgLen);
+ RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL,
+ ulRrcMsgInfo->rrcMsg, msgLen);
+ if (ulRrcMsgInfo->rrcMsg)
+ {
+ ODU_COPY_MSG_TO_FIX_BUF(sdu, 0, msgLen, ulRrcMsgInfo->rrcMsg, (MsgLen *)©Len);
+ ulRrcMsgInfo->msgLen = msgLen;
+
+ /* Sending UL RRC Message transfeer to DU APP */
+ memset(&pst, 0, sizeof(Pst));
+ FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_UL_RRC_MSG_TRANS_TO_DU);
+ rlcSendUlRrcMsgToDu(&pst, ulRrcMsgInfo);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> RLC_UL: rlcUtlSendUlDataToDu: Memory allocation failed for rrcMsg");
+ RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, ulRrcMsgInfo, sizeof(RlcUlRrcMsgInfo));
+ return RFAILED;
+ }
}
else
{
RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, ulUserDatInfo, sizeof(RlcUlUserDatInfo));
if (ulUserDatInfo)
{
- ulUserDatInfo->cellId = rbCb->rlcId.cellId;
- ulUserDatInfo->ueIdx = rbCb->rlcId.ueId;
+ ulUserDatInfo->cellId = rbCb->rlcId.cellId;
+ ulUserDatInfo->ueIdx = rbCb->rlcId.ueId;
ulUserDatInfo->rbId = rbCb->rlcId.rbId;
- RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, ulUserDatInfo->userData, msgLen);
- if (ulUserDatInfo->userData)
- {
- ODU_GET_MSG_LEN(sdu, (MsgLen *)&msgLen);
- ODU_COPY_MSG_TO_FIX_BUF(sdu, 0, msgLen, ulUserDatInfo->userData, (MsgLen *)©Len);
- ulUserDatInfo->msgLen = msgLen;
-
- /* Sending UL RRC Message transfeer to DU APP */
- memset(&pst, 0, sizeof(Pst));
- FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_UL_USER_DATA_TRANS_TO_DU);
- rlcSendUlUserDataToDu(&pst, ulUserDatInfo);
- }
- else
- {
- DU_LOG("\nERROR --> RLC_UL: rlcUtlSendUlDataToDu: Memory allocation failed for user data");
- RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, ulUserDatInfo, sizeof(RlcUlUserDatInfo));
- return RFAILED;
- }
- }
- else
- {
- DU_LOG("\nERROR --> RLC_UL: rlcUtlSendUlDataToDu: Memory allocation failed for ulUserDatInfo");
- return RFAILED;
- }
+ ODU_GET_MSG_LEN(sdu, (MsgLen *)&msgLen);
+ RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, ulUserDatInfo->userData, msgLen);
+ if (ulUserDatInfo->userData)
+ {
+ ODU_COPY_MSG_TO_FIX_BUF(sdu, 0, msgLen, ulUserDatInfo->userData, (MsgLen *)©Len);
+ ulUserDatInfo->msgLen = msgLen;
+
+ DU_LOG("\nDEBUG --> RLC_UL -> DUAPP : UL DATA [DRB ID:%d]", ulUserDatInfo->rbId);
+
+ /* Sending UL RRC Message transfeer to DU APP */
+ memset(&pst, 0, sizeof(Pst));
+ FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_UL_USER_DATA_TRANS_TO_DU);
+ rlcSendUlUserDataToDu(&pst, ulUserDatInfo);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> RLC_UL: rlcUtlSendUlDataToDu: Memory allocation failed for user data");
+ RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, ulUserDatInfo, sizeof(RlcUlUserDatInfo));
+ return RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> RLC_UL: rlcUtlSendUlDataToDu: Memory allocation failed for ulUserDatInfo");
+ return RFAILED;
+ }
}
return ROK;
} /* rlcUtlSendUlDataToDu */
#define MAX_NUM_CELL 1
#define MAX_NUM_UE 2
#define MAX_NUM_UE_PER_TTI 1
-#define MAX_NUM_LC 11
+#define MAX_NUM_LC 32 /*Spec 38.331: Sec 6.4: maxLC-ID Keyword*/
#define MAX_NUM_SRB 3 /* Max. no of Srbs */
#define MAX_NUM_DRB 29 /* spec 38.331, maxDRB */
#include "odu_common_codec.h"
#include "cu_stub_sctp.h"
#include "cu_f1ap_msg_hdl.h"
+#include "legtp.h"
/*header files needed for Ue Context Setup */
#include<ProtocolIE-Field.h>
#include "ProtocolExtensionField.h"
#include "GBR-QosInformation.h"
#include "DRBs-ToBeSetupMod-List.h"
#include "DRBs-ToBeSetupMod-Item.h"
+#include "DRBs-Setup-Item.h"
+#include "DLUPTNLInformation-ToBeSetup-List.h"
+#include "DLUPTNLInformation-ToBeSetup-Item.h"
+#include "UPTransportLayerInformation.h"
+#include "GTPTunnel.h"
/* MACRO for CUtoDURRCInformation */
#define CELL_GRP_ID 1
#define DMRS_ADDITIONAL_POS 0 /* DMRS Additional poistion */
#define RES_ALLOC_TYPE 1 /* Resource allocation type */
#define FIVE_QI_VALUE 9 /*spec 23.501, Table 5.7.4-1*/
+
/*******************************************************************
*
* @brief Sends F1 msg over SCTP
*
* Functionality: Constructs the UL TnlInfo For DRB list
*
- * @params[in] ULUPTNLInformation_ToBeSetup_List_t *ulInfo
+ * @params[in] UPTNLInformation_ToBeSetup_List_t *ulInfo
*
* @return ROK - success
* RFAILED - failure
* ****************************************************************/
uint8_t BuildDRBSetup(DRBs_ToBeSetup_List_t *drbSet)
{
- uint8_t BuildQOSInforet;
- uint8_t BuildSNSSAIret;
- uint8_t BuildFlowsMapret;
- uint8_t BuildULTnlInforet;
- uint8_t idx;
- uint8_t drbCnt;
+ uint8_t BuildQOSInforet = 0,BuildSNSSAIret = 0, idx = 0;
+ uint8_t BuildFlowsMapret =0, BuildULTnlInforet =0, drbCnt = 0;
DRBs_ToBeSetup_Item_t *drbSetItem;
- drbCnt = 1;
+
+ drbCnt = MAX_DRB_SET;
drbSet->list.count = drbCnt;
drbSet->list.size = drbCnt*sizeof(DRBs_ToBeSetup_ItemIEs_t *);
CU_ALLOC(drbSet->list.array,drbSet->list.size);
CU_ALLOC(drbSet->list.array[idx],sizeof(DRBs_ToBeSetup_ItemIEs_t));
if(drbSet->list.array[idx] == NULLP)
{
- return RFAILED;
+ return RFAILED;
}
- }
- idx = 0;
- drbSet->list.array[idx]->id = ProtocolIE_ID_id_DRBs_ToBeSetup_Item;
- drbSet->list.array[idx]->criticality = Criticality_ignore;
- drbSet->list.array[idx]->value.present = \
- DRBs_ToBeSetup_ItemIEs__value_PR_DRBs_ToBeSetup_Item;
- drbSetItem = &drbSet->list.array[idx]->value.choice.DRBs_ToBeSetup_Item;
- /*dRBID*/
- drbSetItem->dRBID = 1;
- /*qoSInformation*/
- drbSetItem->qoSInformation.present = QoSInformation_PR_choice_extension;
- CU_ALLOC(drbSetItem->qoSInformation.choice.choice_extension,sizeof(QoSInformation_ExtIEs_t));
- if(drbSetItem->qoSInformation.choice.choice_extension == NULLP)
- {
- return RFAILED;
- }
- drbSetItem->qoSInformation.choice.choice_extension->id = \
- ProtocolIE_ID_id_DRB_Information;
- drbSetItem->qoSInformation.choice.choice_extension->criticality = \
- Criticality_ignore;
- drbSetItem->qoSInformation.choice.choice_extension->value.present = \
+
+ drbSet->list.array[idx]->id = ProtocolIE_ID_id_DRBs_ToBeSetup_Item;
+ drbSet->list.array[idx]->criticality = Criticality_ignore;
+ drbSet->list.array[idx]->value.present = \
+ DRBs_ToBeSetup_ItemIEs__value_PR_DRBs_ToBeSetup_Item;
+ drbSetItem = &drbSet->list.array[idx]->value.choice.DRBs_ToBeSetup_Item;
+ /*dRBID*/
+ drbSetItem->dRBID = idx + 1;
+ /*qoSInformation*/
+ drbSetItem->qoSInformation.present = QoSInformation_PR_choice_extension;
+ CU_ALLOC(drbSetItem->qoSInformation.choice.choice_extension,sizeof(QoSInformation_ExtIEs_t));
+ if(drbSetItem->qoSInformation.choice.choice_extension == NULLP)
+ {
+ return RFAILED;
+ }
+ drbSetItem->qoSInformation.choice.choice_extension->id = \
+ ProtocolIE_ID_id_DRB_Information;
+ drbSetItem->qoSInformation.choice.choice_extension->criticality = \
+ Criticality_ignore;
+ drbSetItem->qoSInformation.choice.choice_extension->value.present = \
QoSInformation_ExtIEs__value_PR_DRB_Information;
- BuildQOSInforet = BuildQOSInfo(&drbSetItem->qoSInformation.choice.\
- choice_extension->value.choice.DRB_Information.dRB_QoS);
- if(BuildQOSInforet != ROK)
- {
- return RFAILED;
- }
- /*SNSSAI*/
- BuildSNSSAIret = BuildSNSSAI(&drbSetItem->qoSInformation.choice.\
- choice_extension->value.choice.DRB_Information.sNSSAI);
- if(BuildSNSSAIret != ROK)
- {
- return RFAILED;
- }
- /*Flows mapped to DRB List*/
- BuildFlowsMapret = BuildFlowsMap(&drbSetItem->qoSInformation.choice.\
- choice_extension->value.choice.DRB_Information.flows_Mapped_To_DRB_List);
- if(BuildFlowsMapret != ROK)
- {
- return RFAILED;
- }
- /*ULUPTNLInformation To Be Setup List*/
- BuildULTnlInforet = BuildULTnlInfo(&drbSetItem->uLUPTNLInformation_ToBeSetup_List);
- if(BuildULTnlInforet != ROK)
- {
- return RFAILED;
- }
- /*RLCMode*/
- drbSetItem->rLCMode = RLCMode_rlc_um_bidirectional;
+ BuildQOSInforet = BuildQOSInfo(&drbSetItem->qoSInformation.choice.\
+ choice_extension->value.choice.DRB_Information.dRB_QoS);
+ if(BuildQOSInforet != ROK)
+ {
+ return RFAILED;
+ }
+ /*SNSSAI*/
+ BuildSNSSAIret = BuildSNSSAI(&drbSetItem->qoSInformation.choice.\
+ choice_extension->value.choice.DRB_Information.sNSSAI);
+ if(BuildSNSSAIret != ROK)
+ {
+ return RFAILED;
+ }
+ /*Flows mapped to DRB List*/
+ BuildFlowsMapret = BuildFlowsMap(&drbSetItem->qoSInformation.choice.\
+ choice_extension->value.choice.DRB_Information.flows_Mapped_To_DRB_List);
+ if(BuildFlowsMapret != ROK)
+ {
+ return RFAILED;
+ }
+ /*ULUPTNLInformation To Be Setup List*/
+ BuildULTnlInforet = BuildULTnlInfo(&drbSetItem->uLUPTNLInformation_ToBeSetup_List);
+ if(BuildULTnlInforet != ROK)
+ {
+ return RFAILED;
+ }
+ /*RLCMode*/
+ drbSetItem->rLCMode = RLCMode_rlc_um_bidirectional;
- /*UL Configuration*/
- CU_ALLOC(drbSetItem->uLConfiguration,sizeof(ULConfiguration_t));
- if(drbSetItem->uLConfiguration == NULLP)
- {
- return RFAILED;
- }
- drbSetItem->uLConfiguration->uLUEConfiguration = ULUEConfiguration_no_data;
+ /*UL Configuration*/
+ CU_ALLOC(drbSetItem->uLConfiguration,sizeof(ULConfiguration_t));
+ if(drbSetItem->uLConfiguration == NULLP)
+ {
+ return RFAILED;
+ }
+ drbSetItem->uLConfiguration->uLUEConfiguration = ULUEConfiguration_no_data;
+ }
return ROK;
}/* End of BuildDRBSetup*/
{
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)
- {
- FreeULTnlInfo(&drbSetItem->uLUPTNLInformation_ToBeSetup_List);
- CU_FREE(drbSetItem->uLConfiguration,sizeof(ULConfiguration_t));
-
- CU_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,\
- sizeof(MaxDataBurstVolume_t));
- }
- CU_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,sizeof(AveragingWindow_t));
- }
- CU_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,sizeof(NonDynamic5QIDescriptor_t));
- }
- }
- if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
- DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]!=NULLP)
- {
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
- DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx],sizeof(Flows_Mapped_To_DRB_Item_t));
- }
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.\
- flows_Mapped_To_DRB_List.list.array,drbSetItem->qoSInformation.choice.choice_extension->value.\
- choice.DRB_Information.flows_Mapped_To_DRB_List.list.size);
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD->buf,\
- drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD->size);
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD,\
- sizeof(OCTET_STRING_t));
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.buf,\
- drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.size);
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
- qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume,sizeof(MaxDataBurstVolume_t));
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
- qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow,sizeof(AveragingWindow_t));
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
- qoS_Characteristics.choice.non_Dynamic_5QI, sizeof(NonDynamic5QIDescriptor_t));
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension,sizeof(QoSInformation_ExtIEs_t));
- }
- }
- if(drbSet->list.array[drbidx]!=NULLP)
- {
- CU_FREE(drbSet->list.array[drbidx],sizeof(DRBs_ToBeSetup_ItemIEs_t));
- }
+ if(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)
+ {
+ FreeULTnlInfo(&drbSetItem->uLUPTNLInformation_ToBeSetup_List);
+ CU_FREE(drbSetItem->uLConfiguration,sizeof(ULConfiguration_t));
+
+ CU_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,\
+ sizeof(MaxDataBurstVolume_t));
+ }
+ CU_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,sizeof(AveragingWindow_t));
+ }
+ CU_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,sizeof(NonDynamic5QIDescriptor_t));
+ }
+ }
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]!=NULLP)
+ {
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx],sizeof(Flows_Mapped_To_DRB_Item_t));
+ }
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.\
+ flows_Mapped_To_DRB_List.list.array,drbSetItem->qoSInformation.choice.choice_extension->value.\
+ choice.DRB_Information.flows_Mapped_To_DRB_List.list.size);
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD->buf,\
+ drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD->size);
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD,\
+ sizeof(OCTET_STRING_t));
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.buf,\
+ drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.size);
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume,sizeof(MaxDataBurstVolume_t));
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow,sizeof(AveragingWindow_t));
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI, sizeof(NonDynamic5QIDescriptor_t));
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension,sizeof(QoSInformation_ExtIEs_t));
+ }
+ CU_FREE(drbSet->list.array[drbidx],sizeof(DRBs_ToBeSetup_ItemIEs_t));
+ }
}
CU_FREE(drbSet->list.array,drbSet->list.size);
}
{
if(ueSetReq->protocolIEs.list.array[ieId] != NULLP)
{
- CU_FREE(ueSetReq->protocolIEs.list.array[ieId],sizeof(UEContextSetupRequestIEs_t));
+ CU_FREE(ueSetReq->protocolIEs.list.array[ieId],sizeof(UEContextSetupRequestIEs_t));
}
}
CU_FREE(ueSetReq->protocolIEs.list.array,ueSetReq->protocolIEs.list.size);
}
CU_FREE(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
- }
+ }
CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
}
}
return ret;
}/* End of BuildAndSendUeContextSetupReq*/
+/**********************************************************************
+ * @brief Function to extractTeId received in UE context setup Response
+ *
+ * @details
+ *
+ * Function : extractTeId
+ *
+ * Functionality:
+ * - Function to extract TeId
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ **********************************************************************/
+uint8_t extractTeId(DLUPTNLInformation_ToBeSetup_List_t *dlTnlInfo)
+{
+ uint8_t arrIdx = 0;
+ uint32_t teId = 0;
+ GTPTunnel_t *gtpDl = NULLP;
+
+ for(arrIdx =0; arrIdx < dlTnlInfo->list.count; arrIdx++)
+ {
+ if(dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.present == UPTransportLayerInformation_PR_gTPTunnel)
+ {
+ if(dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel != NULLP)
+ {
+ gtpDl = dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel;
+ if(gtpDl->gTP_TEID.size > 0)
+ {
+ teIdStringToInt(gtpDl->gTP_TEID.buf, &teId);
+ }
+ else
+ DU_LOG("\nERROR --> EGTP: No TeId received");
+ return(teId);
+ }
+ }
+ }
+ return teId;
+}
+
+/****************************************************************
+ * @brief Function to add Drb tunnels
+ *
+ * @details
+ *
+ * Function : addDrbTunnels
+ *
+ * Functionality:
+ * - Function to add Drb tunnels
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t addDrbTunnels(uint8_t teId)
+{
+ uint8_t ret = ROK;
+ EgtpTnlEvt tnlEvt;
+
+ if(teId > MAX_TEID || teId < MIN_TEID)
+ {
+ DU_LOG("\nERROR --> EGTP : TEID(%x) OUT Of Range",teId);
+ }
+ memset(&tnlEvt, 0, sizeof(EgtpTnlEvt));
+ tnlEvt.action = EGTP_TNL_MGMT_ADD;
+ tnlEvt.lclTeid = teId;
+ tnlEvt.remTeid = teId;
+ ret = cuEgtpTnlMgmtReq(tnlEvt);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> EGTP : Tunnel management request failed for teId %x", teId);
+ }
+ return ROK;
+}
+/****************************************************************
+ * @brief Function to process Drb Setup List
+ *
+ * @details
+ *
+ * Function : procDrbSetupList
+ *
+ * Functionality:
+ * - Function to process DRB Setup List
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t procDrbSetupList(DRBs_Setup_List_t *drbSetupList)
+{
+ uint8_t arrIdx = 0;
+ uint32_t teId = 0;
+ DRBs_Setup_ItemIEs_t *drbItemIe = NULLP;
+
+ if(drbSetupList != NULLP)
+ {
+ for(arrIdx = 0; arrIdx < drbSetupList->list.count; arrIdx++)
+ {
+ drbItemIe = ((DRBs_Setup_ItemIEs_t *)drbSetupList->list.array[arrIdx]);
+ if(drbItemIe->value.present == DRBs_Setup_ItemIEs__value_PR_DRBs_Setup_Item)
+ {
+ /* extracting teId */
+ teId = extractTeId(&drbItemIe->value.choice.DRBs_Setup_Item.dLUPTNLInformation_ToBeSetup_List);
+ if(teId > 0)
+ {
+ if(addDrbTunnels(teId)== ROK)
+ {
+ DU_LOG("\nDEBUG --> EGTP: Tunnel Added for TeId %d", teId);
+ }
+ }
+ else
+ return RFAILED;
+ }
+ }
+ }
+ return ROK;
+}
+
+/****************************************************************
+ * @brief Function to process Ue Context Setup Response
+ *
+ * @details
+ *
+ * Function : procUeContextSetupResponse
+ *
+ * Functionality:
+ * - Function to process Ue Context Setup Response
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
uint8_t procUeContextSetupResponse(F1AP_PDU_t *f1apMsg)
{
uint8_t idx, duUeF1apId;
- UEContextSetupResponse_t *ueCtxtSetupRsp;
+ UEContextSetupResponse_t *ueCtxtSetupRsp = NULLP;
ueCtxtSetupRsp = &f1apMsg->choice.successfulOutcome->value.choice.UEContextSetupResponse;
for(idx=0; idx < ueCtxtSetupRsp->protocolIEs.list.count; idx++)
duUeF1apId = ueCtxtSetupRsp->protocolIEs.list.array[idx]->value.choice.GNB_DU_UE_F1AP_ID;
break;
}
+ case ProtocolIE_ID_id_DRBs_Setup_List:
+ {
+ /* Adding Tunnels for successful DRB */
+ procDrbSetupList(&ueCtxtSetupRsp->protocolIEs.list.array[idx]->value.choice.DRBs_Setup_List);
+ break;
+
+ }
}
}
ueCb[duUeF1apId-1].f1apMsgDb.dlRrcMsgCount++; /* keeping DL RRC Msg Count */
+ return ROK;
}
/****************************************************************
#include "DRB-ToAddMod.h"
#include "SDAP-Config.h"
#include "du_log.h"
+#include "cu_stub.h"
#define ENCODE_FAIL -1
#define TRANS_ID 1
#define SRB1 1
#define SRB2 2
#define DRB1 1
-#define DRB2 2
+#define DRB2 6 //Pls Ignore this; to avoid the collision with DRBID=2 in UE COntext setup
#define QCI 9
+#define MAX_DRB_SET 2
#define CU_UE_F1AP_ID 0
#define DU_UE_F1AP_ID 1
#define RRC_RECONFIG 6
#define UE_CONTEXT_MOD_REQ 7
+
typedef struct f1apDb
{
uint8_t dlRrcMsgCount;
cuCfgParams.egtpParams.destIp.ipV4Pres = TRUE;
cuCfgParams.egtpParams.destIp.ipV4Addr = ipv4_du;
cuCfgParams.egtpParams.destPort = DU_EGTP_PORT;
- cuCfgParams.egtpParams.minTunnelId = 0;
+ cuCfgParams.egtpParams.minTunnelId = MIN_TEID;
cuCfgParams.egtpParams.currTunnelId = cuCfgParams.egtpParams.minTunnelId;
- cuCfgParams.egtpParams.maxTunnelId = 10;
+ cuCfgParams.egtpParams.maxTunnelId = MAX_TEID;
} /* End of readCuCfg */
void *cuConsoleHandler(void *args)
{
char ch;
+ uint8_t teId = 0;
+ uint8_t ret = ROK;
+
while(true)
{
/* Send DL user data to CU when user enters 'd' on console */
if((ch = getchar()) == 'd')
{
+
+ uint8_t cnt =0;
+ DU_LOG("\n EGTP --> : Enter TEID id(1..10) where DL Data to be sent\n");
+ scanf("%d",&teId);
+
+ if(teId > MAX_TEID || teId < MIN_TEID)
+ {
+ DU_LOG("\nERROR --> EGTP : TEID(%x) OUT Of Range",teId);
+ printf("\n");
+ continue;
+ }
/* Start Pumping data from CU to DU */
- DU_LOG("\nDEBUG --> EGTP: Sending DL User Data");
- cuEgtpDatReq();
+ DU_LOG("\nDEBUG --> EGTP: Sending DL User Data(teId:%d)\n",teId);
+
+ while(cnt < NUM_DL_PACKETS)
+ {
+ ret = cuEgtpDatReq(teId);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> EGTP: Issue with teid=%d\n",teId);
+ break;
+ }
+ cnt++;
+ }
+ continue;
}
}
}
#define MAX_DU_PORT 2
#define DU_PORT 38472
+/*VALID Tunnel ID*/
+#define MIN_TEID 1 /*[Spec 29.281,Sec 5.1]: All Zero TEIDs are never assigned for setting up GTP-U Tunnel*/
+#define MAX_TEID 10 /*[Spec 29.281]: Max limit is not mentioned but as per GTP-U Header Format, TEID occupies 4 octets */
/* allocate and zero out a static buffer */
+
#define CU_ALLOC(_datPtr, _size) \
{ \
S16 _ret; \
/* This file contains all EGTP related functionality */
#include "common_def.h"
+#include "cu_f1ap_msg_hdl.h"
#include "cu_stub_egtp.h"
#include "du_log.h"
/* Global variable declaration */
EgtpGlobalCb egtpCb;
-
/**************************************************************************
* @brief Task Initiation callback function.
*
{
DU_LOG("\n\nDEBUG --> EGTP : Initializing");
memset (&egtpCb, 0, sizeof(EgtpGlobalCb));
+
+ //Initializing with INVALID value
+ memset(egtpCb.gCntPdu, 0xFF , sizeof(uint8_t)*(MAX_TEID+1));
protType = CM_INET_PROTO_UDP;
return ROK;
}
uint8_t egtpInitReq()
{
uint8_t ret = ROK;
- EgtpTnlEvt tnlEvt;
ret = cuEgtpCfgReq();
if(ret != ROK)
return (ret);
}
- tnlEvt.action = EGTP_TNL_MGMT_ADD;
- tnlEvt.lclTeid = 1;
- tnlEvt.remTeid = 1;
- ret = cuEgtpTnlMgmtReq(tnlEvt);
- if(ret != ROK)
- {
- DU_LOG("\nERROR --> EGTP : Tunnel management request failed");
- return RFAILED;
- }
-
return ret;
} /* egtpInitReq */
preDefHdr.teId = teidCb->remTeId;
preDefHdr.extHdr.pdcpNmb.pres = FALSE;
preDefHdr.extHdr.udpPort.pres = FALSE;
- preDefHdr.nPdu.pres = FALSE;
-
+ preDefHdr.nPdu.pres = TRUE; //Including nPdu when sending data
+ preDefHdr.nPdu.val = 0;
+
cuEgtpEncodeHdr((uint8_t *)teidCb->preEncodedHdr.hdr, &preDefHdr, &(teidCb->preEncodedHdr.cnt));
+ egtpCb.gCntPdu[teidCb->remTeId] = 0;//Resetting the Cnt Value for this DRB which indicates its creation
/* SPutSBuf(CU_APP_MEM_REG, CU_POOL, (Data *)teidCb, (Size)sizeof(EgtpTeIdCb));*/
ODU_REM_PRE_MSG(&extHdrType, mBuf);
}
- DU_LOG("\nDEBUG --> EGTP : Message Buffer after decoding header ");
+ DU_LOG("\nDEBUG --> EGTP : Message Buffer after decoding header [TEID:%d]",egtpMsg.msgHdr.teId);
ODU_PRINT_MSG(mBuf, 0, 0);
return ROK;
} /* End of cuEgtpDecodeHdr */
-S16 cuEgtpDatReq()
+uint16_t cuEgtpDatReq(uint8_t teId)
{
uint8_t ret = ROK, cnt = 0;
EgtpMsg egtpMsg;
+ egtpMsg.msgHdr.teId = teId;
+
+ if(egtpCb.gCntPdu[teId] == 0xFF) //DRB not created
+ {
+ DU_LOG("\nERROR --> EGTP : DRB not created");
+ return RFAILED ;
+ }
/* Build Application message that is supposed to come from app to egtp */
ret = BuildAppMsg(&egtpMsg);
if(ret != ROK)
DU_LOG("\nERROR --> EGTP : Failed to build EGTP Msg");
return RFAILED;
}
- /* Send Message to peer */
- while(cnt < 200)
- {
- DU_LOG("\nDEBUG --> EGTP : Sending message[%d]", cnt+1);
- cuEgtpSendMsg(egtpMsg.msg);
- cnt++;
- //sleep(1);
- }
-
+ cuEgtpSendMsg(egtpMsg.msg);
ODU_PUT_MSG_BUF(egtpMsg.msg);
return ROK;
ret = ODU_ADD_PRE_MSG_MULT(revPkArray, (MsgLen)cnt, mBuf);
egtpMsg->msgHdr.msgType = EGTPU_MSG_GPDU;
- egtpMsg->msgHdr.nPdu.pres = FALSE;
+ egtpMsg->msgHdr.nPdu.pres = TRUE;
+
+ if(egtpCb.gCntPdu[egtpMsg->msgHdr.teId] != NUM_DL_PACKETS)
+ egtpCb.gCntPdu[egtpMsg->msgHdr.teId]++;
+ else
+ egtpCb.gCntPdu[egtpMsg->msgHdr.teId] = 1;
+
+ egtpMsg->msgHdr.nPdu.val = egtpCb.gCntPdu[egtpMsg->msgHdr.teId];
egtpMsg->msgHdr.seqNum.pres = FALSE;
egtpMsg->msgHdr.extHdr.udpPort.pres = FALSE;
egtpMsg->msgHdr.extHdr.pdcpNmb.pres = FALSE;
- egtpMsg->msgHdr.teId = 1;
egtpMsg->msg = mBuf;
return ret;
}
-
S16 BuildEgtpMsg(EgtpMsg *egtpMsg)
{
EgtpTeIdCb *teidCb = NULLP;
teidCb->preEncodedHdr.hdr[EGTP_MAX_HDR_LEN - 1] &= ~(EGTP_MASK_BIT2);
}
- ODU_ADD_PRE_MSG_MULT(&teidCb->preEncodedHdr.hdr[hdrLen], (EGTP_MAX_HDR_LEN - hdrLen), egtpMsg->msg);
-
- DU_LOG("\nDEBUG --> EGTP : Sending message buffer");
- ODU_PRINT_MSG(egtpMsg->msg, 0, 0);
+ /*Update the nPdU number*/
+ if(egtpMsg->msgHdr.nPdu.pres)
+ {
+ teidCb->preEncodedHdr.hdr[EGTP_MAX_HDR_LEN - 1] |= (EGTP_MASK_BIT1);
+ teidCb->preEncodedHdr.hdr[EGTP_MAX_HDR_LEN - 11] = egtpMsg->msgHdr.nPdu.val;
+ }
+ else
+ {
+ teidCb->preEncodedHdr.hdr[EGTP_MAX_HDR_LEN - 1] &= ~(EGTP_MASK_BIT1);
+ }
+ ODU_ADD_PRE_MSG_MULT(&teidCb->preEncodedHdr.hdr[hdrLen], (EGTP_MAX_HDR_LEN - hdrLen), egtpMsg->msg);
return ROK;
}
#define EGTP_MASK_BIT7 0x40
#define EGTP_MASK_BIT8 0x80
+#define NUM_DL_PACKETS 4
+
uint8_t sockType;
uint8_t protType;
EgtpParams egtpCfg; /* EGTP configuration */
EgtpTptSrvr recvTptSrvr; /* Transport server for receiving UDP msg */
EgtpDstCb dstCb; /* Destination endpoint */
+ uint8_t gCntPdu[MAX_TEID+1]; /* Maintaining PDU count for each bearer */
}EgtpGlobalCb;
EgtpGlobalCb egtpCb; /* EGTP global control block */
S16 cuEgtpTnlDel(EgtpTnlEvt tnlEvt);
S16 cuEgtpEncodeHdr(uint8_t *preEncodedHdr, EgtpMsgHdr *preDefHdr, uint8_t *hdrIdx);
S16 cuEgtpHdlRecvMsg(Buffer *mBuf);
-S16 cuEgtpDatReq();
+uint16_t cuEgtpDatReq(uint8_t teId);
S16 BuildAppMsg(EgtpMsg *egtpMsg);
S16 BuildEgtpMsg(EgtpMsg *egtpMsg);
S16 cuEgtpSendMsg(Buffer *mBuf);
pdcchCfg.searchSpcId = PDCCH_SEARCH_SPACE_ID;
pdcchCfg.ctrlRsrcSetId = PDCCH_CTRL_RSRC_SET_ID;
pdcchCfg.monitorSlotPrdAndOffPresent = \
+
SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
//pdcchCfg.monitorSlotPrdAndOff = \
SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
duCfgParam.egtpParams.destIp.ipV4Pres = TRUE;
duCfgParam.egtpParams.destIp.ipV4Addr = ipv4_cu;
duCfgParam.egtpParams.destPort = CU_EGTP_PORT;
- duCfgParam.egtpParams.minTunnelId = 0;
- duCfgParam.egtpParams.maxTunnelId = 10;
+ duCfgParam.egtpParams.minTunnelId = MIN_TEID;
+ duCfgParam.egtpParams.maxTunnelId = MAX_TEID;
duCfgParam.maxUe = 32; //TODO: Check
/* DU Info */
#define PDSCH_MCS_INDEX 20 /* For 64QAM, valid mcs index: 17-28 in 38.214 - Table 5.1.3.1-1*/
#define PUSCH_MCS_INDEX 10 /* For 16QAM, valid mcs index: 10-16 in 38.214 - Table 5.1.3.1-1*/
+/*VALID Tunnel ID*/
+#define MIN_TEID 1 /*[Spec 29.281,Sec 5.1]: All Zero TEIDs are never assigned for setting up GTP-U Tunnel*/
+#define MAX_TEID 10 /*[Spec 29.281]: Max limit is not mentioned but as per GTP-U Header Format, TEID occupies 4 octets */
typedef enum
{
GNBDU,
&recvBuf, (int16_t *)&bufLen, CM_INET_NO_FLAG);
if(ret == ROK && recvBuf != NULLP)
{
- //DU_LOG("\nDEBUG --> EGTP : Received DL Message[%ld]\n", gDlDataRcvdCnt + 1);
+ DU_LOG("\nDEBUG --> EGTP : Received DL Message[%ld]\n", gDlDataRcvdCnt + 1);
//ODU_PRINT_MSG(recvBuf, 0 ,0);
egtpHdlRecvData(recvBuf);
gDlDataRcvdCnt++;
}
(ueCfgDb->numRlcLcs)++;
(ueCfgDb->numMacLcs)++;
+ DU_LOG("\nDEBUG -> DUAPP: extractRlcCfgToAddMod:RBType:%d, DrbID: %d,lcId:%d, [RLC,MAC,NumDrb]:[%x,%x,%x]",\
+ rbType, rbId, lcId, ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs, ueCfgDb->numDrb);
}
//TODO: To send the failure cause in UeContextSetupRsp
return ROK;
&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs]);
ueCfgDb->numRlcLcs++;
ueCfgDb->numMacLcs++;
+ DU_LOG("\nDEBUG --> DUAPP: extractSrbListToSetup: SRBID: %d [RLC,MAC,NumDrb]:[%x,%x,%x]",\
+ srbItem->sRBID, ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs, ueCfgDb->numDrb);
if(ret == RFAILED)
{
DU_LOG("\nERROR --> F1AP: Failed at extractSrbListToSetup()");
*
* ****************************************************************/
-uint8_t extractDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_List_t *drbCfg,DRBs_ToBeSetupMod_List_t *drbSetupModCfg,\
-uint8_t drbCount, DuUeCfg *ueCfgDb)
+uint8_t extractDrbListToSetup(DRBs_ToBeSetup_List_t *drbCfg,DRBs_ToBeSetupMod_List_t *drbSetupModCfg,\
+uint8_t drbCount, DuUeCfg *ueCfgDb, uint32_t *drbBitMap)
{
- uint8_t ret, drbIdx;
+ uint8_t ret, drbIdx, lcId = 0;
DRBs_ToBeSetup_Item_t *drbItem = NULLP;
DRBs_ToBeSetupMod_ItemIEs_t *drbSetupModItem = NULLP;
}
memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(LcCfg));
memset(&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], 0, sizeof(RlcBearerCfg));
-
+
+ lcId = getDrbLcId(drbBitMap);
+ if(lcId == RFAILED)
+ {
+ DU_LOG("\nERROR --> F1AP : InCorrect LCID extractDrbListToSetup()");
+ ret = RFAILED;
+ break;
+ }
if(drbCfg != NULL)
{
drbItem = &drbCfg->list.array[drbIdx]->value.choice.DRBs_ToBeSetup_Item;
ueCfgDb->numRlcLcs++;
ueCfgDb->numMacLcs++;
ueCfgDb->numDrb++;
+
+ DU_LOG("\nDEBUG --> DUAPP: extractDrbListToSetup:lcId:%x ,BitMap:%x, [RLC,MAC,NumDrb]:[%x,%x,%x]",\
+ lcId,*drbBitMap, ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs, ueCfgDb->numDrb);
if(ret == RFAILED)
{
DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetup()");
* ****************************************************************/
uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
{
- uint8_t ret=0, ieIdx=0, ueIdx=0, lcId=0, cellIdx=0;
+ uint8_t ret=0, ieIdx=0, ueIdx=0, cellIdx=0;
bool ueCbFound = false;
uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId=0, bitRateSize=0;
DuUeCb *duUeCb = NULL;
}
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))
+
+ if(extractDrbListToSetup(drbCfg, NULL, drbCfg->list.count, &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap))
{
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:
uint8_t procF1UeContextModificationReq(F1AP_PDU_t *f1apMsg)
{
UEContextModificationRequest_t *ueContextModifyReq = NULLP;
- uint8_t ret = ROK, ieIdx = 0, lcId =0,cellIdx=0, ueIdx=0;
+ uint8_t ret = ROK, ieIdx = 0, cellIdx=0, ueIdx=0;
DuUeCb *duUeCb = NULLP;
DRBs_ToBeSetupMod_List_t *drbSetupModCfg;
uint32_t gnbCuUeF1apId, gnbDuUeF1apId;
{
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))
+ if(extractDrbListToSetup(NULL, drbSetupModCfg ,drbSetupModCfg->list.count, \
+ &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap))
{
DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetup()");
ret = RFAILED;
}
}
- }
break;
}
}
{
/* Filling post structure and sending msg */
FILL_PST_DUAPP_TO_RLC(pst, RLC_DL_INST, EVENT_DL_USER_DATA_TRANS_TO_RLC);
- DU_LOG("\nDEBUG --> DU_APP : Sending User Data Msg to RLC \n");
+ DU_LOG("\nDEBUG --> DU_APP : Sending User Data Msg to RLC [TEID, nPDU]:[%d, %d]\n",\
+ egtpMsg->msgHdr.teId, egtpMsg->msgHdr.nPdu.val);
ret = (*duSendRlcDlUserDataToRlcOpts[pst.selector])(&pst, dlDataMsgInfo);
}
if(ret != ROK)
#define MAX_SFN_VALUE 1023
#define NR_PCI 1
#define SLOT_DELAY 3
+#define NUM_DRB_TO_PUMP_DATA 2
+#define NUM_UL_PACKETS 4
/*UE Ids for RACH IND*/
#define UE_IDX_0 0
#define UE_IDX_1 1
* RFAILED - failure
*
* ****************************************************************/
-uint8_t l1SendUlUserData()
+uint8_t l1SendUlUserData(uint8_t drbId)
{
uint8_t cnt = 0;
fapi_rx_data_indication_t *rxDataInd;
uint16_t byteIdx = 0;
uint32_t msgLen = 0;
uint8_t idx = 0;
+ uint8_t lcId = 0;
MAC_ALLOC(rxDataInd, sizeof(fapi_rx_data_indication_t));
if(!rxDataInd)
/* Below ulMsg supports 12bit SN for UM mode */
/* SI SN */
- uint8_t ulMsg[] = {4, msgLen, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 1, 0, 0, 192, 168, 130, 81, 192, 168, 130, 82, 84, 104,
+ lcId = MIN_DRB_LCID + drbId;
+ uint8_t ulMsg[] = {lcId, msgLen, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 1, 0, 0, 192, 168, 130, 81, 192, 168, 130, 82, 84, 104,
105, 115, 32, 105, 115, 32, 69, 71, 84, 80, 32, 100, 97, 116, 97, 32, 102, 114, 111, 109, 32, 68, 85, 0, 0, 0, 0, 0};
msgLen += 2; /* 2bytes of header */
memcpy(pdu, &ulMsg, msgLen);
fillMsgHeader(&rxDataInd->header, FAPI_RX_DATA_INDICATION, msgLen);
/* Send Message to peer */
- while(cnt < 2)
+ while(cnt < NUM_UL_PACKETS)
{
- DU_LOG("\nDEBUG --> PHY STUB : Sending UL User Data[%d] at sfn %d slot %d", cnt+1, sfnValue, slotValue);
+ DU_LOG("\nDEBUG --> PHY STUB : Sending UL User Data[%d][LCID:%d] at sfn %d slot %d", cnt+1, lcId, sfnValue, slotValue);
/* Sending Rx data indication to MAC */
rxDataInd->sfn = sfnValue;
rxDataInd->slot = slotValue;
void *l1ConsoleHandler(void *args)
{
char ch;
+ uint8_t drbIdx = 0;
+
while(true)
{
/* Send UL user data to DU when user enters 'd' on console */
if((ch = getchar()) == 'd')
{
/* Start Pumping data from PHY stub to DU */
- DU_LOG("\nDEBUG --> PHY STUB: Sending UL User Data");
- l1SendUlUserData();
+ for(drbIdx = 0; drbIdx < NUM_DRB_TO_PUMP_DATA; drbIdx++) //Number of DRB times the loop will run
+ {
+ DU_LOG("\nDEBUG --> PHY STUB: Sending UL User Data[DrbId:%d]",drbIdx);
+ l1SendUlUserData(drbIdx);
+ }
}
else if((ch = getchar()) == 'c')
{
/* Send Control PDU from PHY stub to DU */
- DU_LOG("\nDEBUG --> PHY STUB: Sending Status PDU");
- l1SendStatusPdu();
+ DU_LOG("\nDEBUG --> PHY STUB: Sending Status PDU");
+ l1SendStatusPdu();
}
+ DU_LOG("\n");
+ continue;
}
}