/* CKW Interface defines */
/* TODO: To verify if CKW_MAX_ENT_CFG represents LC or LCGs */
-#define CKW_MAX_ENT_CFG 11 /*!< Maximum number of entities to configure */
+#define CKW_MAX_ENT_CFG 32 /*!< Maximum number of entities to configure */
/* ckw_h_001.main_3 added support for L2 Measurement */
#ifdef LTE_L2_MEAS
#define CKW_MAX_QCI 10
#ifndef __ODU_COMMON_CODEC_H__
#define __ODU_COMMON_CODEC_H__
-#define ENC_BUF_MAX_LEN 400
+/*Buffer length which is used for allocation of encoded F1AP messages at CU*/
+#define ENC_BUF_MAX_LEN 2000
#define ENCODE_FAIL -1
#define TEID_BIT_SIZE 24
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildUlTnlInfoforSetupMod(uint8_t ueId, ULUPTNLInformation_ToBeSetup_List_t *ulInfo, uint8_t actionType)
+uint8_t BuildUlTnlInfoforSetupMod(uint8_t ueId, uint8_t drbId, ULUPTNLInformation_ToBeSetup_List_t *ulInfo, uint8_t actionType)
{
uint8_t arrIdx;
uint8_t ulCnt;
{
/*TODO: DRB context to be stored in CU STUB so that tunnel Id can be easily
* fetched based on the Drb Id */
- if(ueId == 1)
- {
- /* Tunnel Id for DRB 2 of UE 1 is 2. Hence passing the same TeId */
- ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf[3] = 2;
- }
- else if(ueId == 2)
- {
- /* Tunnel Id for DRB 2 of UE 2 is 5. Hence passing the same TeId */
- ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf[3] = 5;
- }
- else if(ueId == 3)
- {
- /* Tunnel Id for DRB 2 of UE 3 is 8. Hence passing the same TeId */
- ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf[3] = 8;
- }
+ /*For For UE Id=1, DRB=2 is modified. For UE Id = 2, DRB=5 is modified and so on.*/
+ ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf[3]=\
+ (MAX_NUM_DRB_ADDED_PER_UE *(ueId - 1)) + drbId;
}
else
{
uint8_t ret = ROK;
/*Drb Id */
- drbItem->dRBID = arrIdx + DRB3;
+ drbItem->dRBID = arrIdx + DRB_ID_TO_ADD_MOD;
/*qoSInformation*/
drbItem->qoSInformation.present = QoSInformation_PR_choice_extension;
}
/*ULUPTNLInformation To Be Setup List*/
- ret = BuildUlTnlInfoforSetupMod(ueId, &drbItem->uLUPTNLInformation_ToBeSetup_List, \
+ ret = BuildUlTnlInfoforSetupMod(ueId, drbItem->dRBID, &drbItem->uLUPTNLInformation_ToBeSetup_List, \
ProtocolIE_ID_id_DRBs_ToBeSetupMod_Item);
if(ret != ROK)
{
if(drbSet->list.array[arrIdx] == NULLP)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbToBeSetupList for array idx [%d]", arrIdx);
- return RFAILED;
+ return RFAILED;
}
- }
- arrIdx = 0;
- ret = FillDrbItemList(ueId, arrIdx, (DRBs_ToBeSetupMod_ItemIEs_t *)drbSet->list.array[arrIdx]);
- if(ret != ROK)
- {
- DU_LOG("\nERROR --> F1AP : FillDrbItemList failed");
+ ret = FillDrbItemList(ueId, arrIdx, (DRBs_ToBeSetupMod_ItemIEs_t *)drbSet->list.array[arrIdx]);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : FillDrbItemList failed");
+ }
}
return ret;
*
* ****************************************************************/
-uint8_t FillDrbToBeModItem(uint8_t ueId, DRBs_ToBeModified_Item_t *drbItem)
+uint8_t FillDrbToBeModItem(uint8_t ueId, uint8_t arrIdx, DRBs_ToBeModified_Item_t *drbItem)
{
uint8_t ret = ROK;
/*Drb Id */
- drbItem->dRBID = DRB2;
+ drbItem->dRBID = DRB2 + arrIdx;
/*qoSInformation*/
drbItem->qoSInformation = NULLP;
}/* End of QoS */
/*ULUPTNLInformation To Be Setup List*/
- ret = BuildUlTnlInfoforSetupMod(ueId, &drbItem->uLUPTNLInformation_ToBeSetup_List,\
+ ret = BuildUlTnlInfoforSetupMod(ueId, drbItem->dRBID, &drbItem->uLUPTNLInformation_ToBeSetup_List,\
ProtocolIE_ID_id_DRBs_ToBeModified_Item);
if(ret != ROK)
{
*
* ****************************************************************/
-uint8_t FillDrbToBeModItemList(uint8_t ueId, struct DRBs_ToBeModified_ItemIEs *drbItemIe)
+uint8_t FillDrbToBeModItemList(uint8_t ueId, uint8_t arrIdx, struct DRBs_ToBeModified_ItemIEs *drbItemIe)
{
drbItemIe->id = ProtocolIE_ID_id_DRBs_ToBeModified_Item;
drbItemIe->criticality = Criticality_reject;
drbItemIe->value.present = DRBs_ToBeModified_ItemIEs__value_PR_DRBs_ToBeModified_Item;
- if(FillDrbToBeModItem(ueId, &(drbItemIe->value.choice.DRBs_ToBeModified_Item)) != ROK)
+ if(FillDrbToBeModItem(ueId, arrIdx, &(drbItemIe->value.choice.DRBs_ToBeModified_Item)) != ROK)
{
DU_LOG("\nERROR --> F1AP : FillDrbToBeModItem failed");
return RFAILED;
uint8_t arrIdx =0;
uint8_t drbCnt =0;
- drbCnt = 1;
+ drbCnt = MAX_DRB_MODIFIED_UE_MOD_REQ;
drbSet->list.count = drbCnt;
drbSet->list.size = drbCnt * sizeof(DRBs_ToBeModified_ItemIEs_t *);
CU_ALLOC(drbSet->list.array, drbSet->list.size);
if(drbSet->list.array[arrIdx] == NULLP)
{
DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbToBeSetupList");
- return RFAILED;
+ return RFAILED;
}
- }
- arrIdx=0;
- ret = FillDrbToBeModItemList(ueId, (DRBs_ToBeModified_ItemIEs_t *)drbSet->list.array[arrIdx]);
- if(ret != ROK)
- {
- DU_LOG("\nERROR --> F1AP : FillDrbToBeModItemList failed");
+ ret = FillDrbToBeModItemList(ueId, arrIdx, (DRBs_ToBeModified_ItemIEs_t *)drbSet->list.array[arrIdx]);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : FillDrbToBeModItemList failed");
+ }
}
return ret;
#define DRB2 2
#define DRB3 3
#define QCI 9
-#define MAX_DRB_SET_UE_CONTEXT_SETUP_REQ 2
-#define MAX_DRB_SET_UE_CONTEXT_MOD_REQ 1
+#define MAX_DRB_SET_UE_CONTEXT_SETUP_REQ 2 /*Number of DRBs to be added using UE CONTEXT SETUP procedure*/
+#define MAX_DRB_SET_UE_CONTEXT_MOD_REQ 1 /*Number of DRBs to be added/setup via UE CONTEXT MODIFICATION procedure*/
+#define MAX_DRB_MODIFIED_UE_MOD_REQ 1 /*Currently CU trigger Modification of 2DRBs*/
+#define DRB_ID_TO_ADD_MOD MAX_DRB_SET_UE_CONTEXT_SETUP_REQ+1 /*The DRB ID: which will be added using Modification Procedure*/
+
+/*Total num of DRBs added using UE COntext Setup and Modification procedures*/
+#define MAX_NUM_DRB_ADDED_PER_UE MAX_DRB_SET_UE_CONTEXT_SETUP_REQ + MAX_DRB_SET_UE_CONTEXT_MOD_REQ
#define CU_UE_F1AP_ID 0
#define DU_UE_F1AP_ID 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 */
+#define MAX_TEID MAX_NUM_DRB * MAX_NUM_UE /*[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) \
uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId)
{
DuCellCb *cellCb = NULLP;
-
+
+#ifndef O1_ENABLE
+
+ /*Note: Static Configuration, when O1 is not configuring the RRM policy*/
+ RrmPolicy *rrmPolicy;
+ DU_ALLOC(rrmPolicy, sizeof(RrmPolicy));
+ rrmPolicy->rsrcType = RSRC_PRB;
+ rrmPolicy->numMemberList = 1;
+ DU_ALLOC(rrmPolicy->memberList, sizeof(PolicyMemberList *));
+ DU_ALLOC(rrmPolicy->memberList[0], sizeof(PolicyMemberList));
+
+ memset(&rrmPolicy->memberList[0]->plmn, 0, sizeof(Plmn));
+ rrmPolicy->memberList[0]->snssai.sst = 1;
+ rrmPolicy->memberList[0]->snssai.sd[0] = 2;
+ rrmPolicy->memberList[0]->snssai.sd[1] = 3;
+ rrmPolicy->memberList[0]->snssai.sd[2] = 4;
+ rrmPolicy->policyMinRatio = 30;
+ rrmPolicy->policyMaxRatio = 90;
+ rrmPolicy->policyDedicatedRatio = 10;
+#endif
+
if(cellId->cellId <=0 || cellId->cellId > MAX_NUM_CELL)
{
DU_LOG("\nERROR --> DU APP : Invalid Cell Id %d in duHandleCellUpInd()", cellId->cellId);
DU_LOG("\nINFO --> DU APP : 5G-NR Cell %d is UP", cellId->cellId);
cellCb->cellStatus = ACTIVATED;
gCellStatus = CELL_UP;
-
- if(duCfgParam.tempSliceCfg.rrmPolicy)
- BuildAndSendSliceConfigReq(duCfgParam.tempSliceCfg.rrmPolicy, duCfgParam.tempSliceCfg.totalRrmPolicy, duCfgParam.tempSliceCfg.totalSliceCount);
+
#ifdef O1_ENABLE
+ if(duCfgParam.tempSliceCfg.rrmPolicy)
+ BuildAndSendSliceConfigReq(duCfgParam.tempSliceCfg.rrmPolicy, duCfgParam.tempSliceCfg.totalRrmPolicy, duCfgParam.tempSliceCfg.totalSliceCount);
DU_LOG("\nINFO --> DU APP : Raise cell UP alarm for cell id=%d", cellId->cellId);
raiseCellAlrm(CELL_UP_ALARM_ID, cellId->cellId);
setCellOpState(cellId->cellId, ENABLED, ACTIVE);
+#else
+ BuildAndSendSliceConfigReq(&rrmPolicy,1, rrmPolicy->numMemberList);
#endif
+
}
if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC))
Sib1Params sib1;
F1TaiSliceSuppLst *taiSliceSuppLst;
- /* TODO Added these below variable for local testing, once we will receive the
- * configuration from O1 we can remove these variable */
+#ifndef O1_ENABLE
+ /* Note: Added these below variable for local testing*/
Snssai snssai[NUM_OF_SUPPORTED_SLICE] = {{1,{2,3,4}},{5,{6,7,8}}};
+#endif
#ifdef O1_ENABLE
if( getStartupConfig(&g_cfg) != ROK )
/*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 */
+#define MAX_TEID MAX_NUM_DRB * MAX_NUM_UE /*[Spec 29.281]: Max limit is not mentioned but as per GTP-U Header Format, TEID occupies 4 octets */
/* Slice Ratio */
#define MAX_RATIO 30
#define MIN_RATIO 20
#define DEDICATED_RATIO 10
-#define DEDICATED_SLICE_INDEX 1
#define NUM_OF_SUPPORTED_SLICE 2
typedef enum
uint8_t extractDrbListToSetupMod(DRBs_ToBeSetup_List_t *drbCfg, DRBs_ToBeSetupMod_List_t *drbSetupModCfg,\
DRBs_ToBeModified_List_t *drbModCfg, uint8_t drbCount, DuUeCfg *ueCfgDb, uint32_t *drbBitMap, RlcUeCfg *rlcUeCfg)
{
- uint8_t ret, drbIdx, lcId = 0;
+ uint8_t ret, drbIdx = 0, lcId = 0;
DRBs_ToBeSetup_Item_t *drbItem = NULLP;
DRBs_ToBeSetupMod_ItemIEs_t *drbSetupModItem = NULLP;
DRBs_ToBeModified_ItemIEs_t *drbModItem = NULLP;
DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetupMod() for DrbSetupMod List");
break;
}
+ ueCfgDb->numDrbSetupMod++;
}
}
ueCfgDb->numRlcLcs++;
uint8_t drbCnt =0;
struct DRBs_SetupMod_ItemIEs *drbItemIe;
- drbCnt = 1;
+ drbCnt = ueCfg->numDrbSetupMod;
drbSet->list.count = drbCnt;
drbSet->list.size = drbCnt * sizeof(DRBs_SetupMod_ItemIEs_t *);
DU_ALLOC(drbSet->list.array, drbSet->list.size);
{
drbModifiedCfg = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\
choice.DRBs_ToBeModified_List;
- if(extractDrbListToSetupMod(NULL, NULL, drbModifiedCfg, drbSetupModCfg->list.count,\
+ if(extractDrbListToSetupMod(NULL, NULL, drbModifiedCfg, drbModifiedCfg->list.count,\
&duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap, &duUeCb->rlcUeCfg))
{
DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetupMod() for DrbModifiedList");
AmbrCfg *ambrCfg;
uint8_t numDrb;
UpTnlCfg upTnlInfo[MAX_NUM_DRB]; /* User plane TNL Info*/
+ uint8_t numDrbSetupMod; /*No. of DRB Added during Modification*/
MacUeCfg copyOfmacUeCfg;
}DuUeCfg;
DuCellCb* actvCellLst[MAX_NUM_CELL]; /* List of cells activated/to be activated of type DuCellCb */
uint32_t numUe; /* current number of UEs */
UeCcchCtxt ueCcchCtxt[MAX_NUM_UE]; /* mapping of gnbDuUeF1apId to CRNTI required for CCCH processing*/
- uint8_t numDrb; /* current number of DRbs*/
- UpTnlCfg* upTnlCfg[MAX_NUM_DRB]; /* tunnel info for every Drb */
+ uint8_t numTeId; /* current number of TEIDs configured in the system*/
+ UpTnlCfg* upTnlCfg[MAX_TEID]; /* tunnel info for every Drb */
CmLListCp reservedF1apPduList; /*storing F1AP pdu infomation and transId */
SliceCfgState sliceState;
}DuCb;
* ****************************************************************/
uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData)
{
- uint8_t rbIdx;
+ uint8_t teIdx = 0;
EgtpMsg egtpMsg;
Buffer *mBuf;
egtpMsg.msgHdr.extHdr.pdcpNmb.pres = FALSE;
/* Fetch EGTP tunnel info */
- for(rbIdx = 0; rbIdx < duCb.numDrb; rbIdx++)
+ for(teIdx = 0; teIdx < duCb.numTeId; teIdx++)
{
- if((duCb.upTnlCfg[rbIdx] != NULLP) && (duCb.upTnlCfg[rbIdx]->ueIdx == ulUserData->ueIdx) && \
- (duCb.upTnlCfg[rbIdx]->drbId == ulUserData->rbId))
+ /*TODO: If multiple Cell Support is enables then CellId also needs to be validated alongwith ueId and DrbId*/
+ if((duCb.upTnlCfg[teIdx] != NULLP) && (duCb.upTnlCfg[teIdx]->ueIdx == ulUserData->ueIdx) && \
+ (duCb.upTnlCfg[teIdx]->drbId == ulUserData->rbId))
{
- if(duCb.upTnlCfg[rbIdx]->tnlCfg1)
+ if(duCb.upTnlCfg[teIdx]->tnlCfg1)
{
- egtpMsg.msgHdr.teId = duCb.upTnlCfg[rbIdx]->tnlCfg1->teId; /*As we are supporting only 1 tunnel per DRB*/
+ egtpMsg.msgHdr.teId = duCb.upTnlCfg[teIdx]->tnlCfg1->teId; /*As we are supporting only 1 tunnel per DRB*/
break;
}
}
uint8_t fillDlUserDataInfo(uint32_t teId, RlcDlUserDataInfo *dlDataMsgInfo)
{
- uint8_t drbIdx;
+ uint8_t teIdx = 0;
- for(drbIdx = 0; drbIdx < duCb.numDrb; drbIdx++)
+ /*Traversing the duCb to find the CellId, UeId, LCID corresponding to TEID*/
+ for(teIdx = 0; teIdx < duCb.numTeId; teIdx++)
{
- if(duCb.upTnlCfg[drbIdx] && (duCb.upTnlCfg[drbIdx]->tnlCfg1 != NULLP))
+ if(duCb.upTnlCfg[teIdx] && (duCb.upTnlCfg[teIdx]->tnlCfg1 != NULLP))
{
- if(duCb.upTnlCfg[drbIdx]->tnlCfg1->teId == teId)
+ if(duCb.upTnlCfg[teIdx]->tnlCfg1->teId == teId)
{
- dlDataMsgInfo->cellId = duCb.upTnlCfg[drbIdx]->cellId;
- dlDataMsgInfo->ueIdx = duCb.upTnlCfg[drbIdx]->ueIdx;
- dlDataMsgInfo->rbId = duCb.upTnlCfg[drbIdx]->drbId;
+ dlDataMsgInfo->cellId = duCb.upTnlCfg[teIdx]->cellId;
+ dlDataMsgInfo->ueIdx = duCb.upTnlCfg[teIdx]->ueIdx;
+ dlDataMsgInfo->rbId = duCb.upTnlCfg[teIdx]->drbId;
return ROK;
}
}
if(duBuildAndSendDlUserDataToRlc(msgLen, egtpMsg) != ROK)
{
DU_LOG("\nERROR --> DU_APP : Failed to build DL USer Data in duHdlEgtpDlData()");
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, egtpMsg->msg, msgLen);
return RFAILED;
}
return ROK;
{
if(duSendEgtpTnlMgmtReq(EGTP_TNL_MGMT_ADD, NULLP, f1TnlCfg->tnlCfg1) == ROK)
{
- if(fillTnlCfgToAddMod(&duCb.upTnlCfg[duCb.numDrb], f1TnlCfg) == ROK)
+ if(fillTnlCfgToAddMod(&duCb.upTnlCfg[duCb.numTeId], f1TnlCfg) == ROK)
{
- duCb.numDrb++;
+ duCb.numTeId++;
ret = ROK;
}
}
if(duSendEgtpTnlMgmtReq(EGTP_TNL_MGMT_DEL, duTnlCfg->tnlCfg1->teId, f1TnlCfg->tnlCfg1) == ROK)
{
/* Free memory at drbIdx */
- duCb.numDrb--;
- for(delIdx = ueCbIdx; delIdx < duCb.numDrb; delIdx++)
+ duCb.numTeId--;
+ for(delIdx = ueCbIdx; delIdx < duCb.numTeId; delIdx++)
{
/* moving all elements one index ahead */
ret = fillTnlCfgToAddMod(&duCb.upTnlCfg[delIdx], duCb.upTnlCfg[delIdx+1]);
uint8_t duUpdateTunnelCfgDb(uint8_t ueIdx, uint8_t cellId, DuUeCfg *duUeCfg)
{
- uint8_t ret = ROK, drbIdx, duCbDrbIdx;
+ uint8_t ret = ROK, drbIdx, teIdx;
bool drbFound = false;
/*If Add/Mod tunnels request for that DRB is successful in EGTP */
{
duUeCfg->upTnlInfo[drbIdx].cellId = cellId;
duUeCfg->upTnlInfo[drbIdx].ueIdx = ueIdx;
- for(duCbDrbIdx = 0; duCbDrbIdx < duCb.numDrb; duCbDrbIdx++)
+ for(teIdx = 0; teIdx < duCb.numTeId; teIdx++)
{
- if((duCb.upTnlCfg[duCbDrbIdx]->ueIdx == duUeCfg->upTnlInfo[drbIdx].ueIdx) && \
- (duCb.upTnlCfg[duCbDrbIdx]->drbId == duUeCfg->upTnlInfo[drbIdx].drbId))
+ if((duCb.upTnlCfg[teIdx]->ueIdx == duUeCfg->upTnlInfo[drbIdx].ueIdx) && \
+ (duCb.upTnlCfg[teIdx]->drbId == duUeCfg->upTnlInfo[drbIdx].drbId))
{
drbFound = true; /* existing DRB */
- if(duProcEgtpTunnelCfg(duCbDrbIdx, duCb.upTnlCfg[duCbDrbIdx], &duUeCfg->upTnlInfo[drbIdx]) != ROK)
+ if(duProcEgtpTunnelCfg(teIdx, duCb.upTnlCfg[teIdx], &duUeCfg->upTnlInfo[drbIdx]) != ROK)
{
DU_LOG("\nERROR -> DU_APP : duUpdateTunnelCfgDb: Failed to modify tunnel req for Drb id[%d]",
duUeCfg->upTnlInfo[drbIdx].drbId);
{
freeF1UeDb(ueCb->f1UeDb);
}
- for(tnlIdx = 0; tnlIdx < duCb.numDrb; )
+ for(tnlIdx = 0; tnlIdx < duCb.numTeId; )
{
if(duCb.upTnlCfg[tnlIdx]->ueIdx == ueIdx)
{
while(counter)
{
/* Start Pumping data from PHY stub to DU */
- for(drbIdx = 0; drbIdx < NUM_DRB_TO_PUMP_DATA; drbIdx++) //Number of DRB times the loop will run
+ for(ueIdx=0; ueIdx < MAX_NUM_UE; ueIdx++)
{
- for(ueIdx=0; ueIdx<MAX_NUM_UE; ueIdx++)
+ 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] for UEId %d\n",drbIdx,ueIdx);
l1SendUlUserData(drbIdx,ueIdx);