/********************************************************************20**
- Name: LTE RLC file
-
+ Name: NR RLC file
+
Type: C include file
Desc: This file contain the hash definations for RLC
#ifndef __KWH__
#define __KWH__
-#include "rl_interface.h"
-#include "rl_common.h"
#include "du_log.h"
\f
-#define RLCLAYERNAME "LTE RLC" /* Layer Name */
#define EKWxxx 1
#define EMG099 1
#define RLC_TMR_LEN 10
#define RLC_MAX_UM_TMR 1
#define RLC_MAX_AM_TMR 3
+ #define RLC_MAX_THPT_TMR 1
/* Timer events */
#define EVENT_RLC_UMUL_REASSEMBLE_TMR 1
#ifdef LTE_L2_MEAS
#define EVENT_RLC_L2_TMR 6
#endif /* LTE_L2_MEAS */
+ #define EVENT_RLC_THROUGHPUT_TMR 7
/*******************************************************************************
* DBM Defines
/********************************************************************20**
- Name: LTE RLC file
+ Name: NR RLC file
Type: C include file
Desc: This file contains all the data structures and
- prototypes for LTE RLC.
+ prototypes for RLC.
File: kw.x
#endif /* LTE_L2_MEAS */
}RlcUlCb;
+ typedef struct rlcThptPerUe
+ {
+ uint16_t ueIdx;
+ uint64_t dataVol;
+ }RlcThptPerUe;
+
+ /**
+ * @brief Structure to hold information about throughput at RLC
+ *
+ */
+ typedef struct rlcThpt
+ {
+ Inst inst; /* RLC instance */
+ CmTimer thptTmr; /* Throughput Timer */
+ uint8_t numActvUe; /* Number of Active UEs */
+ RlcThptPerUe thptPerUe[MAX_NUM_UE]; /* Throughput calculated per UE */
+ }RlcThpt;
/**
* @brief Structure to hold an information about a RLC instance
RlcDlCb *dlCb; /*!< Dl Control Block */
} u;
uint8_t dlSduId; /*!< Downlink SDU ID */
+ RlcThpt rlcThpt; /*!< Throughput at RLC*/
}RlcCb;
RlcCb *rlcCb[MAX_RLC_INSTANCES]; /*!< RLC global control block */
/********************************************************************20**
- Name: LTE RLC - Configuration Manager file
+ Name: NR RLC - Configuration Manager file
Type: C source file
File: kw_cfg_dl.c
*********************************************************************21*/
-static const char* RLOG_MODULE_NAME="CFG";
-static int RLOG_MODULE_ID=2048;
-static int RLOG_FILE_ID=191;
/** @file kw_cfg_dl.c
@brief RLC Downlink Configuration Module
static S16 rlcCfgFillDlRbCb(RlcCb *gCb,RlcDlRbCb *rbCb,RlcDlUeCb *ueCb,RlcEntCfgInfo *entCfg)
{
- RLOG_ARG3(L_DEBUG,DBG_RBID,entCfg->rbId,
- "rlcCfgFillRbCb(ueId(%d),cellId(%d) rbType(%d))",
+ DU_LOG("\nDEBUG --> RLC_DL : rlcCfgFillRbCb(ueId(%d),cellId(%d) rbType(%d))",
rbCb->rlcId.ueId,
rbCb->rlcId.cellId,
entCfg->rbType);
}
default:
{
- RLOG_ARG2(L_ERROR,DBG_RBID,entCfg->rbId,
- "Invalid RB Mode ueId(%d),cellId(%d)",
+ DU_LOG("\nERROR --> RLC_DL : Invalid RB Mode ueId(%d),cellId(%d)",
rbCb->rlcId.ueId,
rbCb->rlcId.cellId);
return RFAILED;
if (rbCb->mode != entCfg->entMode)
{
- RLOG_ARG4(L_ERROR,DBG_RBID,rbCb->rlcId.rbId,
- "RB Mode Mismatch : exp [%d] rcv [%d] UEID:%d CELLID:%d",
+ DU_LOG("\nERROR --> RLC_DL : RB Mode Mismatch : exp [%d] rcv [%d] UEID:%d CELLID:%d",
rbCb->mode,
entCfg->entMode,
rbCb->rlcId.ueId,
RlcDlRbCb *rlcRbCb; /* KW RB Control Block */
uint8_t reason; /* Rb Identifier */
- RLOG_ARG3(L_DEBUG,DBG_RBID,entCfg->rbId,
- "rlcCfgAddRb(cellId(%d),UEID:%d cfgType(%d))",
+ DU_LOG("\nDEBUG --> RLC_DL : rlcCfgAddRb(cellId(%d),UEID:%d cfgType(%d))",
cellId,
ueId,
entCfg->cfgType);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
CKW_CFG_REAS_CELL_UNKWN);
- RLOG_ARG1(L_ERROR,DBG_RBID,entCfg->rbId,
- "Add DLRb,CellId is 0 for UEID:%d",
+ DU_LOG("\nERROR --> RLC_DL : Add DLRb,CellId is 0 for UEID:%d",
ueId);
return RFAILED;
}
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,
CKW_CFG_CFM_NOK,
CKW_CFG_REAS_RB_UNKWN);
- RLOG_ARG3(L_ERROR,DBG_RBID,entCfg->rbId,
- "Invalid RbId ,Max is [%d] CELLID:%d UEID:%d",
+ DU_LOG("\nERROR --> RLC_DL : Invalid RbId ,Max is [%d] CELLID:%d UEID:%d",
RLC_MAX_RB_PER_CELL,
cellId,
ueId);
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,
CKW_CFG_CFM_NOK,
CKW_CFG_REAS_RB_PRSNT);
- RLOG_ARG2(L_WARNING, DBG_CELLID,cellId,
- "RbId [%d] already exists UEID:%d",
+ DU_LOG("\nERROR --> RLC_DL : RbId [%d] already exists UEID:%d",
entCfg->rbId,
ueId);
return RFAILED;
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,
CKW_CFG_CFM_NOK,
CKW_CFG_REAS_CELL_CREAT_FAIL);
- RLOG_ARG2(L_ERROR,DBG_CELLID,cellId,
- "cellCb Creation failed RBID:%d UEID:%d",
+ DU_LOG("\nERROR --> RLC_DL : cellCb Creation failed RBID:%d UEID:%d",
entCfg->rbId,
ueId);
return RFAILED;
/* Validate LChId */
if(entCfg->lCh[0].lChId <= 0)
{
- RLOG_ARG3(L_ERROR,DBG_LCID,entCfg->lCh[0].lChId ,
- "Invalid LcId CELLID:%d UEID:%d RBID:%d",
+ DU_LOG("\nERROR --> RLC_DL : Invalid LcId CELLID:%d UEID:%d RBID:%d",
cellId,
ueId,
entCfg->rbId);
RLC_ALLOC(gCb,rlcRbCb, sizeof (RlcDlRbCb));
if (!rlcRbCb)
{
- RLOG_ARG2(L_FATAL,DBG_UEID,ueId,
- "Memory allocation failed for rbId:%d CELLID:%d",
+ DU_LOG("\nERROR --> RLC_DL : Memory allocation failed for rbId:%d CELLID:%d",
entCfg->rbId,
ueId);
/* Fill entCfm structure */
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
CKW_CFG_REAS_RB_UNKWN);
- RLOG_ARG2(L_ERROR,DBG_RBID, entCfg->rbId,
- "Invalid RbId for RbType[%d] UEID:%d",
+ DU_LOG("\nERROR --> RLC_DL : Invalid RbId for RbType[%d] UEID:%d",
entCfg->rbType,
ueId);
return RFAILED;
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
CKW_CFG_REAS_RB_PRSNT);
- RLOG_ARG2(L_WARNING, DBG_UEID, ueId,
- "CellId[%u]:rbId [%d] already exists",
+ DU_LOG("\nERROR --> RLC_DL : CellId[%u]:rbId [%d] already exists",
cellId,
entCfg->rbId);
return RFAILED;
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
CKW_CFG_REAS_UE_CREAT_FAIL);
- RLOG_ARG2(L_WARNING, DBG_CELLID,cellId,
- "UeId [%u]:ueCb Creation Failed RBID:%d",
+ DU_LOG("\nERROR --> RLC_DL : UeId [%u]:ueCb Creation Failed RBID:%d",
ueId,
entCfg->rbId);
return RFAILED;
}
+ /* Start throughput calculation for this UE */
+ gCb->rlcThpt.thptPerUe[gCb->rlcThpt.numActvUe].ueIdx = ueId;
+ gCb->rlcThpt.thptPerUe[gCb->rlcThpt.numActvUe].dataVol = 0;
+ gCb->rlcThpt.numActvUe++;
+
+ if((rlcChkTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR)) == FALSE)
+ {
+ printf("\nHLAL Starting Throughput timer");
+ rlcStartTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR);
+ }
}
/* Validate LChId for UM and AM modes */
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,CKW_CFG_CFM_NOK,
CKW_CFG_REAS_RB_CREAT_FAIL);
- RLOG_ARG2(L_FATAL,DBG_UEID,ueId,
- "Memory allocation failed RBID:%d CELLID:%d",
+ DU_LOG("\nERROR --> RLC_DL : Memory allocation failed RBID:%d CELLID:%d",
entCfg->rbId,
cellId);
return RFAILED;
/* Delete RB CB created */
RLC_FREE(gCb,rlcRbCb, sizeof(RlcDlRbCb));
- RLOG_ARG2(L_ERROR,DBG_RBID, entCfg->rbId,
- "Filling of RbCb failed UEID:%d CELLID:%d",
+ DU_LOG("\nERROR --> RLC_DL : Filling of RbCb failed UEID:%d CELLID:%d",
ueId,
cellId);
return RFAILED;
RlcDlUeCb *ueCb; /* Ue Control Block */
uint8_t ret;
- RLOG_ARG3(L_DEBUG,DBG_UEID,ueId,
- "rlcCfgReCfgRb(cellId(%d), cfgType(%d)) RBID:%d",
+ DU_LOG("\nDEBUG --> RLC_DL : rlcCfgReCfgRb(cellId(%d), cfgType(%d)) RBID:%d",
cellId, entCfg->cfgType,entCfg->rbId);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
CKW_CFG_REAS_RB_UNKWN);
- RLOG_ARG3(L_ERROR,DBG_RBID,entCfg->rbId,
- "Invalid RbId , Max is [%d] UEID:%d CELLID:%d",
+ DU_LOG("\nERROR --> RLC_DL : Invalid RbId , Max is [%d] UEID:%d CELLID:%d",
RLC_MAX_RB_PER_CELL,
ueId,
cellId);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
CKW_CFG_REAS_CELL_UNKWN);
- RLOG_ARG3(L_ERROR,DBG_CELLID,cellId,
- "CellCb not found ueId:%d RBID:%d CELLID:%d",
+ DU_LOG("\nERROR --> RLC_DL : CellCb not found ueId:%d RBID:%d CELLID:%d",
ueId,
entCfg->rbId,
cellId);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
CKW_CFG_REAS_RB_UNKWN);
- RLOG_ARG2(L_ERROR,DBG_UEID,ueId,
- "CELLID:%d RBID:%d not found",
+ DU_LOG("\nERROR --> RLC_DL : CELLID:%d RBID:%d not found",
cellId,
entCfg->rbId);
return RFAILED;
CKW_CFG_CFM_NOK,
ret);
- RLOG_ARG2(L_ERROR,DBG_UEID,ueId,
- "CELLID:%u RBID:%d updation failed",
+ DU_LOG("\nERROR --> RLC_DL : CELLID:%u RBID:%d updation failed",
cellId,
entCfg->rbId);
memcpy(rbCb, &tRbCb, sizeof(RlcDlRbCb));
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
CKW_CFG_REAS_RB_UNKWN);
- RLOG_ARG3(L_ERROR,DBG_UEID,ueId,
- "CELLID:%d Invalid RBID:%d for RbType[%d]",
+ DU_LOG("\nERROR --> RLC_DL : CELLID:%d Invalid RBID:%d for RbType[%d]",
cellId,
entCfg->rbId,
entCfg->rbType);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,
CKW_CFG_CFM_NOK, CKW_CFG_REAS_UE_UNKWN);
- RLOG_ARG2(L_ERROR,DBG_CELLID, cellId,
- "UEID:%d UeCb not found RBID:%d",
+ DU_LOG("\nERROR --> RLC_DL : UEID:%d UeCb not found RBID:%d",
ueId,
entCfg->rbId);
return (ret);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
CKW_CFG_REAS_RB_UNKWN);
- RLOG_ARG2(L_ERROR, DBG_UEID,ueId,
- "CELLID:%d RBID:%d not found",
+ DU_LOG("\nERROR --> RLC_DL : CELLID:%d RBID:%d not found",
cellId,
entCfg->rbId);
return (ret);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
ret);
- RLOG_ARG2(L_ERROR,DBG_UEID,ueId,
- "CELLID:%d RBID:%d updation failed",
+ DU_LOG("\nERROR --> RLC_DL : CELLID:%d RBID:%d updation failed",
cellId,
entCfg->rbId);
memcpy(rbCb, &tRbCb, sizeof(RlcDlRbCb));
RlcDlCellCb *cellCb; /* UE Control Block */
RlcDlRbCb *rlcRbCb; /* KW RB Control Block */
- RLOG_ARG3(L_DEBUG,DBG_UEID,ueId,
- "rlcCfgDelRb(RBID(%d), cellId(%d), cfgType(%d))",
+ DU_LOG("\nDEBUG --> RLC_DL : rlcCfgDelRb(RBID(%d), cellId(%d), cfgType(%d))",
entCfg->rbId,
cellId,
entCfg->cfgType);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,
CKW_CFG_CFM_NOK, CKW_CFG_REAS_RB_UNKWN);
- RLOG_ARG3(L_ERROR,DBG_RBID,entCfg->rbId ,
- "Invalid RbId, Max is [%d] UEID:%d CELLID:%d",
+ DU_LOG("\nERROR --> RLC_DL : Invalid RbId, Max is [%d] UEID:%d CELLID:%d",
RLC_MAX_RB_PER_CELL,
ueId,
cellId);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,
CKW_CFG_CFM_NOK, CKW_CFG_REAS_RB_UNKWN);
- RLOG_ARG2(L_ERROR,DBG_CELLID,cellId,
- "CellCb not found UEID:%d RBID:%d",
+ DU_LOG("\nERROR --> RLC_DL : CellCb not found UEID:%d RBID:%d",
ueId,
entCfg->rbId);
return (ret);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,
CKW_CFG_CFM_NOK, CKW_CFG_REAS_RB_UNKWN);
- RLOG_ARG2(L_ERROR, DBG_UEID,ueId,
- "CellId[%u]:RbId[%d] not found",
+ DU_LOG("\nERROR --> RLC_DL : CellId[%u]:RbId[%d] not found",
cellId,
entCfg->rbId);
return (ret);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,
CKW_CFG_CFM_NOK, CKW_CFG_REAS_RB_UNKWN);
- RLOG_ARG3(L_ERROR,DBG_RBID, entCfg->rbId,
- "Invalid RbId for RbType[%d] UEID:%d CELLID:%d",
+ DU_LOG("\nERROR --> RLC_DL : Invalid RbId for RbType[%d] UEID:%d CELLID:%d",
entCfg->rbType,
ueId,
cellId);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,
CKW_CFG_CFM_NOK, CKW_CFG_REAS_UE_UNKWN);
- RLOG_ARG2(L_ERROR,DBG_CELLID, cellId,
- "UeId [%d]: UeCb not found RBID:%d",
+ DU_LOG("\nERROR --> RLC_DL : UeId [%d]: UeCb not found RBID:%d",
ueId,
entCfg->rbId);
return (ret);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
CKW_CFG_REAS_RB_UNKWN);
- RLOG_ARG2(L_ERROR, DBG_UEID,ueId,
- "CellId[%u]:RbId[%d] not found",
+ DU_LOG("\nERROR --> RLC_DL : CellId[%u]:RbId[%d] not found",
cellId,
entCfg->rbId);
return (ret);
RlcDlRbCb *rbCb; /* RB Control Block */
CmLteRlcId rlcId; /* RLC Identifier */
- RLOG_ARG3(L_DEBUG,DBG_RBID,entCfg->rbId,
- "rlcCfgReEstDlRb(ueId(%d), cellId(%d), cfgType(%d))",
+ DU_LOG("\nDEBUG --> RLC_DL : rlcCfgReEstDlRb(ueId(%d), cellId(%d), cfgType(%d))",
ueId,
cellId,
entCfg->cfgType);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, rlcId.rbType, CKW_CFG_CFM_NOK,
CKW_CFG_REAS_RB_UNKWN);
- RLOG_ARG2(L_ERROR, DBG_UEID,ueId,
- "CellId[%u]:RbId[%d] not found",
+ DU_LOG("\nERROR --> RLC_DL : CellId[%u]:RbId[%d] not found",
cellId,
entCfg->rbId);
return RFAILED;
S16 ret; /* Return Value */
RlcDlUeCb *ueCb; /* UE Control Block */
- RLOG_ARG3(L_DEBUG,DBG_RBID,entCfg->rbId,
- "rlcCfgDelUe(ueId(%d), cellId(%d), cfgType(%d))",
+ DU_LOG("\nDEBUG --> RLC_DL : rlcCfgDelUe(ueId(%d), cellId(%d), cfgType(%d))",
ueId,
cellId,
entCfg->cfgType);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,
CKW_CFG_CFM_NOK, CKW_CFG_REAS_UE_UNKWN);
- RLOG_ARG2(L_ERROR,DBG_RBID,entCfg->rbId,
- "ueId(%d), cellId(%d)",
+ DU_LOG("\nERROR --> RLC_DL : ueId(%d), cellId(%d)",
ueId,
cellId);
return RFAILED;
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, entCfg->rbId, entCfg->rbType,
CKW_CFG_CFM_NOK, CKW_CFG_REAS_UE_UNKWN);
- RLOG_ARG2(L_ERROR,DBG_CELLID, cellId,
- "UEID:%d UeCb not found RBID:%d",
+ DU_LOG("\nERROR --> RLC_DL : UEID:%d UeCb not found RBID:%d",
ueId,
entCfg->rbId);
return RFAILED;
RlcDlCellCb *cellCb; /* UE Control Block */
uint8_t rbId; /* RB Identifier */
- RLOG_ARG2(L_DEBUG,DBG_RBID,entCfg->rbId,
- "rlcCfgDelCell( cellId(%d), cfgType(%d)",
+ DU_LOG("\nDEBUG --> RLC_DL : rlcCfgDelCell( cellId(%d), cfgType(%d)",
cellId,
entCfg->cfgType);
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
CKW_CFG_REAS_CELL_UNKWN);
- RLOG_ARG1(L_DEBUG,DBG_RBID,entCfg->rbId,
- "cellId is 0 (%d) ",
+ DU_LOG("\nERROR --> RLC_DL : cellId is 0 (%d) ",
cellId);
return RFAILED;
}
/* Fill entCfm structure */
RLC_CFG_FILL_CFG_CFM(entCfm, rbId, entCfg->rbType, CKW_CFG_CFM_NOK,
CKW_CFG_REAS_CELL_UNKWN);
- RLOG_ARG1(L_ERROR, DBG_CELLID,cellId,
- "CellCb not found for RBID:%d",
+ DU_LOG("\nERROR --> RLC_DL : CellCb not found for RBID:%d",
entCfg->rbId);
return RFAILED;
}
)
{
RlcDlUeCb *ueCb;
-/*kw004.201 Adding of Missing Trace in LTE RLC PDCP*/
+/*kw004.201 Adding of Missing Trace in RLC PDCP*/
if ( (ueInfo->ueId == newUeInfo->ueId) &&
(ueInfo->cellId == newUeInfo->cellId))
{
status->reason = CKW_CFG_REAS_SAME_UEID;
status->status = CKW_CFG_CFM_NOK;
- RLOG_ARG2(L_ERROR,DBG_CELLID,ueInfo->cellId,
- "Old UeId[%d] same as new UeId[%d]",
+ DU_LOG("\nERROR --> RLC_DL : Old UeId[%d] same as new UeId[%d]",
ueInfo->ueId,
newUeInfo->ueId);
return RFAILED;
if(ROK == rlcDbmFetchDlUeCb(gCb,newUeInfo->ueId, newUeInfo->cellId, &ueCb))
{
- RLOG_ARG1(L_ERROR, DBG_CELLID, newUeInfo->cellId,
- "NewUeId[%d]:ueCb already exists",
+ DU_LOG("\nERROR --> RLC_DL : NewUeId[%d]:ueCb already exists",
newUeInfo->ueId);
status->reason = CKW_CFG_REAS_UE_EXISTS;
status->status = CKW_CFG_CFM_NOK;
if(ROK != rlcDbmFetchDlUeCb(gCb,ueInfo->ueId, ueInfo->cellId, &ueCb))
{
- RLOG_ARG1(L_ERROR,DBG_CELLID,ueInfo->cellId,
- "UeId [%d]: UeCb not found",
+ DU_LOG("\nERROR --> RLC_DL : UeId [%d]: UeCb not found",
ueInfo->ueId);
status->reason = CKW_CFG_REAS_UE_UNKWN;
status->status = CKW_CFG_CFM_NOK;
#endif
if(ROK != cmHashListDelete(&(gCb->u.dlCb->ueLstCp), (PTR) ueCb))
{
- RLOG_ARG1(L_ERROR,DBG_CELLID,ueInfo->cellId,
- "UeId[%u] HashList Deletion Failed",
+ DU_LOG("\nERROR --> RLC_DL : UeId[%u] HashList Deletion Failed",
ueInfo->ueId);
status->reason = CKW_CFG_REAS_UE_CREAT_FAIL;
status->status = CKW_CFG_CFM_NOK;
(uint16_t) sizeof(CmLteRnti)))
{
- RLOG_ARG1(L_ERROR,DBG_CELLID,newUeInfo->cellId,
- "UeId[%u] HashList Insertion Failed",
+ DU_LOG("\nERROR --> RLC_DL : UeId[%u] HashList Insertion Failed",
newUeInfo->ueId);
status->reason = CKW_CFG_REAS_UE_CREAT_FAIL;
status->status = CKW_CFG_CFM_NOK;
/********************************************************************20**
- Name: LTE - RLC - Layer Manager file
+ Name: NR RLC - Layer Manager file
Type: C source file
File: kw_lmm.c
*********************************************************************21*/
-static const char* RLOG_MODULE_NAME="LMM";
-static int RLOG_MODULE_ID=2048;
-static int RLOG_FILE_ID=197;
/** @file kw_lmm.c
@brief RLC Layer Manager Module
**/
if(cfg->maxUe > RLC_MAX_UE)
{
#if (ERRCLASS & ERRCLS_INT_PAR)
- RLOG2(L_ERROR, "Invalid maxUe : Max [%lu] Received [%lu]",
+ DU_LOG("\nERROR --> RLC : Invalid maxUe : Max [%lu] Received [%lu]",
RLC_MAX_UE,
cfg->maxUe);
#endif /* ERRCLASS & ERRCLS_INT_PAR */
if(cfg->maxKwuSaps > RLC_MAX_KWUSAPS)
{
#if (ERRCLASS & ERRCLS_INT_PAR)
- RLOG2(L_ERROR, "Invalid maxKwuSaps : Max [%lu] Received [%lu]",
+ DU_LOG("\nERROR --> RLC : Invalid maxKwuSaps : Max [%lu] Received [%lu]",
RLC_MAX_KWUSAPS,
cfg->maxKwuSaps);
#endif /* ERRCLASS & ERRCLS_INT_PAR */
if(cfg->maxUdxSaps > RLC_MAX_UDXSAPS)
{
#if (ERRCLASS & ERRCLS_INT_PAR)
- RLOG2(L_ERROR, "Invalid maxUduSaps : Max [%lu] Received [%lu]",
+ DU_LOG("\nERROR --> RLC : Invalid maxUduSaps : Max [%lu] Received [%lu]",
RLC_MAX_UDXSAPS,
cfg->maxUdxSaps);
#endif /* ERRCLASS & ERRCLS_INT_PAR */
rlcTqCp->tmrLen = RLC_TMR_LEN;
rlcTqCp->nxtEnt = 0;
+ gCb->rlcThpt.inst = gCb->init.inst;
+ gCb->rlcThpt.thptTmr.tmrEvnt = TMR_NONE;
+ gCb->rlcThpt.numActvUe = 0;
+ memset(gCb->rlcThpt.thptPerUe, 0, MAX_NUM_UE * sizeof(RlcThptPerUe));
+
if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
{
RLC_ALLOC(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
if (gCb->u.dlCb == NULLP)
{
- RLOG0(L_FATAL,"Memory Allocation failed");
+ DU_LOG("\nERROR --> RLC : Memory Allocation failed");
return (LCM_REASON_MEM_NOAVAIL);
}
if(gCb->u.dlCb->rlcKwuDlSap == NULLP)
{
RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
- RLOG0(L_FATAL,"Memory Allocation failed");
+ DU_LOG("\nERROR --> RLC : Memory Allocation failed");
return (LCM_REASON_MEM_NOAVAIL);
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
{
RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
- RLOG0(L_FATAL,"Memory Allocation failed");
+ DU_LOG("\nERROR --> RLC : Memory Allocation failed");
return (LCM_REASON_MEM_NOAVAIL);
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
RLC_FREE(gCb,gCb->u.dlCb->rguDlSap, rguSapSize);
RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
- RLOG0(L_FATAL,"RLC DL Initialization failed");
+ DU_LOG("\nERROR --> RLC_DL : RLC DL Initialization failed");
return (LCM_REASON_MEM_NOAVAIL);
}
RLC_ALLOC(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
if (gCb->u.ulCb == NULLP)
{
- RLOG0(L_FATAL,"Memory Allocation failed");
+ DU_LOG("\nERROR --> RLC : Memory Allocation failed");
return (LCM_REASON_MEM_NOAVAIL);
}
if(gCb->u.ulCb->rlcKwuUlSap == NULLP)
{
RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
- RLOG0(L_FATAL,"Memory Allocation failed");
+ DU_LOG("\nERROR --> RLC : Memory Allocation failed");
return (LCM_REASON_MEM_NOAVAIL);
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
{
RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
- RLOG0(L_FATAL,"Memory Allocation failed");
+ DU_LOG("\nERROR --> RLC : Memory Allocation failed");
return (LCM_REASON_MEM_NOAVAIL);
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
RLC_FREE(gCb,gCb->u.ulCb->rlcKwuUlSap, rlcSapSize);
RLC_FREE(gCb,gCb->u.ulCb->rguUlSap, rlcSapSize);
RLC_FREE(gCb,gCb->u.ulCb, sizeof (RlcUlCb));
- RLOG0(L_FATAL,"RLC DL Initialization failed");
+ DU_LOG("\nERROR --> RLC_DL : RLC DL Initialization failed");
}
/* Register the timer */
else
{
#if (ERRCLASS & ERRCLS_INT_PAR)
- RLOG0(L_ERROR, "Received Invalid RLC Mode");
+ DU_LOG("\nERROR --> RLC : Received Invalid RLC Mode");
#endif /* ERRCLASS & ERRCLS_INT_PAR */
return (LCM_REASON_INVALID_PAR_VAL);
break;
default:
#if (ERRCLASS & ERRCLS_INT_PAR)
- RLOG0(L_ERROR, "Received Invalid Message Type");
+ DU_LOG("\nERROR --> RLC : Received Invalid Message Type");
if(!gCb)
{
fflush(stdout);
return (RFAILED);
}
- RLOG1(L_DEBUG, "RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
+ DU_LOG("\nDEBUG --> RLC : RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
switch(cfg->hdr.elmId.elmnt)
{
rlcLmmSendCfm(tRlcCb,pst, cntrl, TCNTRL, &cntrl->hdr);
return (RFAILED);
}
- RLOG1(L_DEBUG, "RlcMiLkwCntrlReq(elmId(%d))", cntrl->hdr.elmId.elmnt);
+ DU_LOG("\nDEBUG --> RLC : RlcMiLkwCntrlReq(elmId(%d))", cntrl->hdr.elmId.elmnt);
/* In normal cases, LCM_REASON_NOT_APPL is returned in cfm.
* In all error cases appropriate reason is returned
return (RFAILED);
}
- RLOG1(L_DEBUG, "Status request for elmId(%d))", sta->hdr.elmId.elmnt);
+ DU_LOG("\nDEBUG --> RLC : Status request for elmId(%d))", sta->hdr.elmId.elmnt);
reason = LCM_REASON_NOT_APPL;
return (RFAILED);
}
- RLOG2(L_DEBUG, "RlcMiLkwStsReq(elmId(%d),action(%d))",
+ DU_LOG("\nDEBUG --> RLC : RlcMiLkwStsReq(elmId(%d),action(%d))",
action,
sts->hdr.elmId.elmnt);
#if (ERRCLASS & ERRCLS_ADD_RES) /* KW_FIX */
if(measEvt == NULLP)
{
- RLOG0(L_FATAL,"Memory Allocation failed");
+ DU_LOG("\nERROR --> RLC : Memory Allocation failed");
return RFAILED;
}
#endif
/* Check for reconfiguration */
if (rlcKwuSapCb->state != RLC_SAP_NOT_CFG)
{
- RLOG2(L_ERROR,"RLC Mode [%d] : Invalid rlckwuSap State [%d]",
+ DU_LOG("\nERROR --> RLC : RLC Mode [%d] : Invalid rlckwuSap State [%d]",
gCb->genCfg.rlcMode, rlcKwuSapCb->state);
/* reconfiguration not allowed */
return (LCM_REASON_RECONFIG_FAIL);
/* Check for reconfiguration */
if(ckwSap->state != RLC_SAP_NOT_CFG)
{
- RLOG1(L_ERROR,"Invalid rlckwuSap State [%d]",ckwSap->state);
+ DU_LOG("\nERROR --> RLC : Invalid rlckwuSap State [%d]",ckwSap->state);
return (LCM_REASON_RECONFIG_FAIL);
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
/* Check for reconfiguration */
if(udxDlSap->state != RLC_SAP_NOT_CFG)
{
- RLOG1(L_ERROR,"Invalid udxDlSap State [%d]",udxDlSap->state);
+ DU_LOG("\nERROR --> RLC : Invalid udxDlSap State [%d]",udxDlSap->state);
return (LCM_REASON_RECONFIG_FAIL);
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
/* Check for reconfiguration */
if(udxUlSap->state != RLC_SAP_NOT_CFG)
{
- RLOG1(L_ERROR,"Invalid udxUlSap State [%d]", udxUlSap->state);
+ DU_LOG("\nERROR --> RLC : Invalid udxUlSap State [%d]", udxUlSap->state);
return (LCM_REASON_RECONFIG_FAIL);
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
/* Check for reconfiguration */
if(rguSap->state != RLC_SAP_NOT_CFG)
{
- RLOG2(L_ERROR,"RLC Mode [%d]: Invalid rguSap State [%d]",
+ DU_LOG("\nERROR --> RLC : RLC Mode [%d]: Invalid rguSap State [%d]",
gCb->genCfg.rlcMode, rguSap->state);
return (LCM_REASON_RECONFIG_FAIL);
}
/* validate SAP */
if(UDX_SAP.state == RLC_SAP_NOT_CFG)
{
- RLOG0(L_ERROR,"udxUlSap not configured yet");
+ DU_LOG("\nERROR --> RLC : udxUlSap not configured yet");
return (LCM_REASON_INVALID_STATE);
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
/* validate SAP */
if(rguSap->state == RLC_SAP_NOT_CFG)
{
- RLOG1(L_ERROR,"RLC Mode [%d]:rguSap not configured yet", gCb->genCfg.rlcMode);
+ DU_LOG("\nERROR --> RLC : RLC Mode [%d]:rguSap not configured yet", gCb->genCfg.rlcMode);
return (LCM_REASON_INVALID_STATE);
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
MsgLen tempCnt;
Pst pst;
- RLOG2(L_DEBUG, "rlcLmmSendTrc(): Trace for event=%d, gCb->trcLen=%d",
+ DU_LOG("\nDEBUG --> RLC : rlcLmmSendTrc(): Trace for event=%d, gCb->trcLen=%d",
event,
gCb->trcLen);
!= ROK)
{
/* rg005.201 removed SPutSBuf on error */
- RLOG0(L_ERROR,"SCpyMsgMsg Failed");
+ DU_LOG("\nERROR --> RLC : SCpyMsgMsg Failed");
return RFAILED;
}
/* Send Trace Indication to Layer manager */
/* Get the length of the recvd message buffer */
if (SFndLenMsg(mBuf, &bufLen) != ROK)
{
- RLOG0(L_ERROR,"SFndLenMsg Failed");
+ DU_LOG("\nERROR --> RLC : SFndLenMsg Failed");
return RFAILED;
}
/* Check if the recvd buffer size is less than request trace len */
if (SCpyMsgMsg(mBuf, pst.region, pst.pool, &dstMbuf)
!= ROK)
{
- RLOG0(L_ERROR,"SCpyMsgMsg Failed");
+ DU_LOG("\nERROR --> RLC : SCpyMsgMsg Failed");
return RFAILED;
}
{
(Void) SPutSMem(RLC_GET_MEM_REGION(gCb), RLC_GET_MEM_POOL(gCb));
- RLOG0(L_FATAL,"Memory Allocation failed");
+ DU_LOG("\nERROR --> RLC : Memory Allocation failed");
return (LCM_REASON_MEM_NOAVAIL);
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
/* Copy trcLen nos of bytes from the recvd message */
if (SCpyMsgFix(mBuf,0,gCb->trcLen,tempBuf,&tempCnt) != ROK)
{
- RLOG0(L_ERROR,"SCpyMsgFix Failed");
+ DU_LOG("\nERROR --> RLC : SCpyMsgFix Failed");
return RFAILED;
}
if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK)
{
- RLOG0(L_FATAL,"Memory Allocation failed");
+ DU_LOG("\nERROR --> RLC : Memory Allocation failed");
return RFAILED;
}
/* Copy the tempBuf data to dst mBuf */
if (SCpyFixMsg(tempBuf,dstMbuf,0,gCb->trcLen,&tempCnt) != ROK)
{
- RLOG0(L_ERROR,"SCpyMsgFix Failed");
+ DU_LOG("\nERROR --> RLC : SCpyMsgFix Failed");
return RFAILED;
}
/**********************************************************************
- Name: LTE-RLC Layer
+ Name: NR RLC Layer
Type: C file
{
uint8_t numPdu = 0;
uint16_t ueIdx;
+ uint16_t actvUeIdx;
RlcDlUeCb *ueCb; /* UE control block */
uint32_t count; /* Loop Counter */
uint32_t numTb; /* Number of Tbs */
/* If ueCb is not found for current rnti then continue to look for next rnti*/
continue;
}
+
+ /* Find ueIdx for throughput calculation */
+ for(actvUeIdx = 0; actvUeIdx < gCb->rlcThpt.numActvUe; actvUeIdx++)
+ {
+ if(gCb->rlcThpt.thptPerUe[actvUeIdx].ueIdx == ueIdx)
+ break;
+ }
+
/* kw002.201 Removed the allocation of RlcDatReq */
/* kw004.201 Used SSI function to initialize the variable */
memset(&datReq, 0, sizeof(RlcDatReq) );
if (rbCb && (!rlcDlUtlIsReestInProgress(rbCb)))
{
- //Debug
+ /* Cosider buffer size for throughput calculation */
+ gCb->rlcThpt.thptPerUe[actvUeIdx].dataVol += staIndTb->lchStaInd[count].totBufSize;
+
staIndSz += staIndTb->lchStaInd[count].totBufSize;
datReq.pduSz = staIndTb->lchStaInd[count].totBufSize;
#ifdef LTE_L2_MEAS
#include "du_app_rlc_inf.h"
#include "rlc_utils.h"
#include "rlc_upr_inf_api.h"
+
/*******************************************************************
*
* @brief Fills RLC UL UE Cfg Rsp from RlcCRsp
if(!datReqInfo)
{
DU_LOG("\nERROR --> RLC_DL : Memory allocation failed for DatReq in RlcProcDlUserDataTransfer()");
- RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlDataMsgInfo->dlMsg, dlDataMsgInfo->msgLen);
+ ODU_PUT_MSG_BUF(dlDataMsgInfo->dlMsg);
RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlDataMsgInfo, sizeof(RlcDlUserDataInfo));
return RFAILED;
}
RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlDataMsgInfo, sizeof(RlcDlUserDataInfo));
return ROK;
}
+
+/*******************************************************************
+ *
+ * @brief sending UE delete response to DU
+ *
+ * @details
+ *
+ * Function : sendRlcUeDeleteRspToDu
+ *
+ * Functionality:
+ * sending UE delete response to DU
+ *
+ * @params[in] uint8_t ueIdx, uint8_t cellId, UeDeleteResult result
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t sendRlcUeDeleteRspToDu(uint8_t ueIdx, uint16_t cellId, UeDeleteResult result)
+{
+ Pst pst;
+ RlcUeDeleteRsp *ueDeleteRsp = NULLP;
+
+ FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_RLC_UE_DELETE_RSP);
+
+ RLC_ALLOC_SHRABL_BUF(pst.region, pst.pool, ueDeleteRsp, sizeof(RlcUeDeleteRsp));
+ if(!ueDeleteRsp)
+ {
+ DU_LOG("\nERROR --> RLC: sendRlcUeDeleteRspToDu(): Memory allocation failed ");
+ return RFAILED;
+ }
+ else
+ {
+ ueDeleteRsp->cellId = cellId;
+ ueDeleteRsp->ueIdx = ueIdx;
+ ueDeleteRsp->result = result;
+
+ if(rlcSendUeDeleteRspToDu(&pst, ueDeleteRsp) == ROK)
+ {
+ DU_LOG("\nDEBUG --> RLC: UE Delete response send successfully");
+ }
+ else
+ {
+ DU_LOG("\nERROR --> RLC: SendRlcUeDeleteRspToDu():Failed to send UE Delete response to DU");
+ RLC_FREE_SHRABL_BUF(pst.region, pst.pool, ueDeleteRsp, sizeof(RlcUeDeleteRsp));
+ return RFAILED;
+ }
+ }
+ return ROK;
+}
+
+/* ****************************************************************
+*
+* @brief filling RLC UE delete configuration
+*
+* @details
+*
+* Function : fillRlcCfgInfo
+*
+* Functionality: filling RLC UE delete configuration
+*
+* @params[in] RlcUlUeCb *ueCb, RlcCfgInfo *rlcUeCfg
+*
+* @return void
+*
+* ****************************************************************/
+
+void fillRlcUeDelInfo(RlcUlUeCb *ueCb, RlcCfgInfo *rlcUeCfg)
+{
+ uint8_t lcIdx;
+
+ rlcUeCfg->ueId = ueCb->ueId;
+ rlcUeCfg->cellId = ueCb->cellId;
+ rlcUeCfg->numEnt = 0;
+ for(lcIdx=0; lcIdx<RLC_MAX_LCH_PER_UE && rlcUeCfg->numEnt < 1; lcIdx++)
+ {
+ if(ueCb->lCh[lcIdx].ulRbCb != NULLP)
+ {
+ rlcUeCfg->entCfg[rlcUeCfg->numEnt].rbId = 0;
+ rlcUeCfg->entCfg[rlcUeCfg->numEnt].rbType = 0;
+ rlcUeCfg->entCfg[rlcUeCfg->numEnt].cfgType = CKW_CFG_DELETE_UE;
+ rlcUeCfg->numEnt++;
+ }
+ }
+}
+
+/*******************************************************************
+*
+* @brief Handles Ue delete Request from DU APP
+*
+* @details
+*
+* Function : RlcProcUeDeleteReq
+*
+* Functionality:
+* Handles Ue delete Request from DU APP
+*
+* @params[in] Post structure pointer
+* RlcUeDelete pointer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t RlcProcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete)
+{
+ uint8_t ret = ROK;
+ RlcCb *gRlcCb = NULLP;
+ RlcCfgInfo *rlcUeCfg = NULLP;
+ RlcUlUeCb *ueCb = NULLP;
+ UeDeleteResult result=SUCCESSFUL;
+
+ DU_LOG("\nDEBUG --> RLC: UE Delete request received. CellID[%d] UEIDX[%d]",ueDelete->cellId, ueDelete->ueIdx);
+
+ if(ueDelete != NULLP)
+ {
+ gRlcCb = RLC_GET_RLCCB(pst->dstInst);
+ rlcDbmFetchUlUeCb(gRlcCb,ueDelete->ueIdx, ueDelete->cellId, &ueCb);
+ if(ueCb != NULLP)
+ {
+ if(ueDelete->cellId == ueCb->cellId)
+ {
+ RLC_ALLOC(gRlcCb, rlcUeCfg, sizeof(RlcCfgInfo));
+ if(rlcUeCfg == NULLP)
+ {
+ DU_LOG("\nERROR --> RLC: deleteRlcUeCb(): Failed to allocate memory");
+ ret = RFAILED;
+ }
+ else
+ {
+ memset(rlcUeCfg, 0, sizeof(RlcCfgInfo));
+ fillRlcUeDelInfo(ueCb, rlcUeCfg);
+ if(RlcProcCfgReq(pst, rlcUeCfg) != ROK)
+ {
+ DU_LOG("\nERROR --> RLC: deleteRlcUeCb(): Failed to delete UE information");
+ result = INVALID_UEID;
+ }
+ }
+ }
+ else
+ {
+ result = INVALID_CELLID;
+ }
+ }
+ else
+ {
+ result = INVALID_UEID;
+ }
+
+ if(result != SUCCESSFUL)
+ {
+ ret = sendRlcUeDeleteRspToDu(ueDelete->ueIdx, ueDelete->cellId, result);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> RLC: RlcProcUeDeleteReq():Failed to send UE Delete response to DU");
+ }
+ }
+ RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueDelete, sizeof(RlcUeDelete));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> RLC: RlcProcUeDeleteReq(): Recieved NULL pointer UE Delete ");
+ ret = RFAILED;
+ }
+ return ret;
+}
+
/**********************************************************************
End of file
**********************************************************************/
#include "cm_lib.x"
#include "du_log.h"
+#define RADIO_FRAME_DURATION 10 /* Time duration of a radio frame in ms */
/* MAX values */
#define MAX_NUM_CELL 1
#define MAX_NUM_UE 1
#define MAX_NUM_DRB 29 /* spec 38.331, maxDRB */
/* 5G ORAN phy delay */
-#define PHY_DELTA 2
+#define PHY_DELTA_DL 1
+#define PHY_DELTA_UL 0
/* SELECTORS */
#define ODU_SELECTOR_LC 0
#define TOTAL_PRB_20MHZ_MU0 106
#define TOTAL_PRB_100MHZ_MU1 273
+ #define ODU_THROUGHPUT_PRINT_TIME_INTERVAL 5 /* in milliseconds */
+
/* Defining macros for common utility functions */
#define ODU_GET_MSG_BUF SGetMsg
#define ODU_PUT_MSG_BUF SPutMsg
typedef enum
{
UE_CFG_INACTIVE,
+ UE_CFG_INPROGRESS,
UE_CREATE_COMPLETE,
+ UE_DELETE_COMPLETE,
UE_RECFG_COMPLETE
}UeCfgState;
/* Supported by SPLIT Architecture */
uint16_t maxUdxSaps; /*!< Maximum Udx SAPs. */
/* Supported by SPLIT Architecture ends */
- Ticks timeRes; /*!< Time resolution. */
+ Ticks timeRes; /*!< Time resolution. */
/* Supported by SPLIT Architecture */
uint8_t rlcMode; /*!< RLC_DL or RLC_UL */
/* Supported by SPLIT Architecture ends */
#endif /* LTE_L2_MEAS */
-/* Control primitives towards LTE RLC */
+/* Control primitives towards NR RLC */
/* Pointer functions to pack/unpack primitives */
typedef uint8_t (*RlcConfigReq) ARGS((Pst *pst, RlcMngmt *cfg));
typedef uint8_t (*RlcConfigCfm) ARGS((Pst *pst, RlcMngmt *cfgCfm));
packRlcDlUserDataToRlc /* Light weight-loose coupling */
};
+DuMacUeDeleteReq packMacUeDeleteReqOpts[] =
+{
+ packDuMacUeDeleteReq, /* Loose coupling */
+ MacProcUeDeleteReq, /* TIght coupling */
+ packDuMacUeDeleteReq /* Light weight-loose coupling */
+};
+
+DuRlcUeDeleteReq packRlcUeDeleteReqOpts[] =
+{
+ packDuRlcUeDeleteReq, /* Loose coupling */
+ RlcProcUeDeleteReq, /* TIght coupling */
+ packDuRlcUeDeleteReq /* Light weight-loose coupling */
+};
+
+DuMacCellDeleteReq packMacCellDeleteReqOpts[] =
+{
+ packDuMacCellDeleteReq, /* Loose coupling */
+ MacProcCellDeleteReq, /* TIght coupling */
+ packDuMacCellDeleteReq /* Light weight-loose coupling */
+};
+
/*******************************************************************
*
* @brief Function to fillDlUserDataInfo
if(ret != ROK)
{
DU_LOG("\nERROR --> DU_APP : Failed to send User Data to RLC in duHdlEgtpDlData()");
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlDataMsgInfo->dlMsg, msgLen);
+ ODU_PUT_MSG_BUF(dlDataMsgInfo->dlMsg);
DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlDataMsgInfo, sizeof(RlcDlUserDataInfo));
}
return ret;
/* Fetching MacDb from DuUeCb */
GET_CELL_IDX(cellId, cellIdx);
duMacDb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].macUeCfg;
+ duMacDb->macUeCfgState = UE_CFG_INPROGRESS;
/* Fetching MaUeCfg List for ADD/MOD/DEL */
macUeCfg->cellId = cellId;
macUeCfg->ueIdx = ueIdx;
}
}
ret = fillAmbr(&macUeCfg->ambrCfg, ueCfgDb->ambrCfg);
-
- duFillModulationDetails(macUeCfg, duMacDb, ueCfgDb->ueNrCapability);
+ if(ueCfgDb->ueNrCapability != NULLP)
+ {
+ duFillModulationDetails(macUeCfg, duMacDb, ueCfgDb->ueNrCapability);
+ }
}
/* Filling LC Context */
/* Fetch RlcDb from DuUeCb */
GET_CELL_IDX(cellId, cellIdx);
duRlcDb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].rlcUeCfg;
+ duRlcDb->rlcUeCfgState = UE_CFG_INPROGRESS;
/*Filling RlcUeCfg */
rlcUeCfg->cellId = cellId;
rlcUeCfg->ueIdx = ueIdx;
for(dbIdx = 0; (dbIdx < ueCfgDb->numRlcLcs && ret == ROK); dbIdx++)
{
- ret = fillDefaultRlcModeCfg(ueCfgDb->rlcLcCfg[dbIdx].rlcMode, &ueCfgDb->rlcLcCfg[dbIdx]);
- if(ret == RFAILED)
- {
- DU_LOG("\n ERROR --> DU APP : Failed to fill Rlc Mode at fillRlcUeCfg()");
- memset(rlcUeCfg, 0, sizeof(RlcUeCfg));
- return ret;
- }
- /* Fill Rlc Ue Cfg List for ADD/MOD/DEL */
- for(lcIdx = 0; lcIdx < duRlcDb->numLcs; lcIdx++)
- {
- if(ueCfgDb->rlcLcCfg[dbIdx].lcId == duRlcDb->rlcLcCfg[lcIdx].lcId)
- {
- lcIdFound = true;
- if((ueCfgDb->rlcLcCfg[dbIdx].configType == CONFIG_UNKNOWN)||
- (ueCfgDb->rlcLcCfg[dbIdx].configType == CONFIG_MOD))
- {
- /* MOD */
- ueCfgDb->rlcLcCfg[dbIdx].configType = CONFIG_MOD; /* update Db for MOD type */
- memcpy(&rlcUeCfg->rlcLcCfg[dbIdx], &ueCfgDb->rlcLcCfg[dbIdx], sizeof(RlcBearerCfg));
- }
- }
- else
- lcIdFound = false;
- }
- if(!lcIdFound)
- {
- /* ADD/ DEL Config Type */
- memcpy(&rlcUeCfg->rlcLcCfg[dbIdx], &ueCfgDb->rlcLcCfg[dbIdx], sizeof(RlcBearerCfg));
- }
- rlcUeCfg->numLcs++;
+ ret = fillDefaultRlcModeCfg(ueCfgDb->rlcLcCfg[dbIdx].rlcMode, &ueCfgDb->rlcLcCfg[dbIdx]);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\n ERROR --> DU APP : Failed to fill Rlc Mode at fillRlcUeCfg()");
+ memset(rlcUeCfg, 0, sizeof(RlcUeCfg));
+ return ret;
+ }
+ /* Fill Rlc Ue Cfg List for ADD/MOD/DEL */
+ for(lcIdx = 0; lcIdx < duRlcDb->numLcs; lcIdx++)
+ {
+ if(ueCfgDb->rlcLcCfg[dbIdx].lcId == duRlcDb->rlcLcCfg[lcIdx].lcId)
+ {
+ lcIdFound = true;
+ if((ueCfgDb->rlcLcCfg[dbIdx].configType == CONFIG_UNKNOWN)||
+ (ueCfgDb->rlcLcCfg[dbIdx].configType == CONFIG_MOD))
+ {
+ /* MOD */
+ ueCfgDb->rlcLcCfg[dbIdx].configType = CONFIG_MOD; /* update Db for MOD type */
+ memcpy(&rlcUeCfg->rlcLcCfg[dbIdx], &ueCfgDb->rlcLcCfg[dbIdx], sizeof(RlcBearerCfg));
+ }
+ }
+ else
+ lcIdFound = false;
+ }
+ if(!lcIdFound)
+ {
+ /* ADD/ DEL Config Type */
+ memcpy(&rlcUeCfg->rlcLcCfg[dbIdx], &ueCfgDb->rlcLcCfg[dbIdx], sizeof(RlcBearerCfg));
+ }
+ rlcUeCfg->numLcs++;
}
}
return ret;
if(macUeCfg)
{
memset(macUeCfg, 0, sizeof(MacUeCfg));
- memcpy(macUeCfg, &duCb.actvCellLst[cellId - 1]->ueCb[ueIdx -1].macUeCfg, sizeof(MacUeCfg));
+ memcpy(macUeCfg, duMacUeCfg, sizeof(MacUeCfg));
DU_LOG("\nDEBUG --> DU_APP: Sending UE create request to MAC");
/* Processing one Ue at a time to MAC */
* ****************************************************************/
uint8_t duUpdateMacCfg(MacUeCfg *macUeCfg, F1UeContextSetupDb *f1UeDb)
{
- uint8_t ret, lcIdx, dbIdx, numLcs, lcDelIdx;
+ uint8_t ret, lcIdx, dbIdx, numLcs, lcDelIdx, cellIdx;
+ MacUeCfg *oldMacUeCfg;
ret = ROK;
/*Filling Cell Group Cfg*/
NULL, &macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg);
}
ret = fillAmbr(&macUeCfg->ambrCfg, f1UeDb->duUeCfg.ambrCfg);
+
+ GET_CELL_IDX(macUeCfg->cellId, cellIdx);
+ oldMacUeCfg = &duCb.actvCellLst[cellIdx]->ueCb[macUeCfg->ueIdx-1].macUeCfg;
+ duFillModulationDetails(macUeCfg, oldMacUeCfg, f1UeDb->duUeCfg.ueNrCapability);
}
+
/* Filling LC Context */
for(dbIdx = 0; (dbIdx < f1UeDb->duUeCfg.numMacLcs && ret == ROK); dbIdx++)
{
if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
{
BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
- duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
- macUeCfg.macUeCfgState = 0;
}
}
}
if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
{
BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
- duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
- rlcUeCfg.rlcUeCfgState = 0;
}
}
}
*
* @details
*
- * Function : duProcUeContextSetupRequest
+ * Function : duProcUeContextSetupRequest
*
* Functionality: Process UE context setup request from CU
*
}
return ROK;
}
+
+/*******************************************************************
+*
+* @brief Function to delete Pdsch ServCellCfg
+*
+* @details
+*
+* Function : deletePdschServCellCfg
+*
+* Functionality: Function to delete Pdsch ServCellCfg
+*
+* @params[in] PdschServCellCfg *pdschServCellCfg
+* @return void
+*
+* ****************************************************************/
+
+void deletePdschServCellCfg(PdschServCellCfg *pdschServCellCfg)
+{
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,pdschServCellCfg->maxMimoLayers, sizeof(uint8_t));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,pdschServCellCfg->maxCodeBlkGrpPerTb, sizeof(MaxCodeBlkGrpPerTB));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,pdschServCellCfg->codeBlkGrpFlushInd, sizeof(bool));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,pdschServCellCfg->xOverhead, sizeof(PdschXOverhead));
+}
+
+/*******************************************************************
+ *
+* @brief delete MacUeCfg from duCb
+*
+* @details
+*
+* Function : deleteMacUeCfg
+*
+* Functionality: delete MacUeCfg from duCb
+*
+* @params[in] Pointer to MacUeCfg
+* @return ROK - success
+* RFAILED - failure
+*
+*******************************************************************/
+
+void deleteMacUeCfg(MacUeCfg *ueCfg)
+{
+ uint8_t lcCfgIdx;
+ uint8_t resrcIdx;
+ ServCellCfgInfo *servCellCfg;
+ PucchResrcInfo *resrcToAddModList;
+
+ if(ueCfg)
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,ueCfg->ambrCfg, sizeof(AmbrCfg));
+ if(ueCfg->spCellCfgPres)
+ {
+ servCellCfg = &ueCfg->spCellCfg.servCellCfg;
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->bwpInactivityTmr, sizeof(uint8_t));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.resrcSet,\
+ sizeof(PucchResrcSetCfg));
+ if(servCellCfg->initUlBwp.pucchCfg.resrc)
+ {
+ /*freeing the PucchResrcCfg*/
+ for(resrcIdx= 0; resrcIdx< servCellCfg->initUlBwp.pucchCfg.resrc->resrcToAddModListCount; resrcIdx++)
+ {
+ resrcToAddModList=&servCellCfg->initUlBwp.pucchCfg.resrc->resrcToAddModList[resrcIdx];
+ switch(resrcToAddModList->pucchFormat)
+ {
+ case PUCCH_FORMAT_0:
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format0 ,\
+ sizeof(PucchFormat0));
+ break;
+ }
+ case PUCCH_FORMAT_1:
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format1 ,\
+ sizeof(PucchFormat1));
+ break;
+ }
+ case PUCCH_FORMAT_2:
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format2 ,\
+ sizeof(PucchFormat2_3));
+ break;
+ }
+ case PUCCH_FORMAT_3:
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format3 ,\
+ sizeof(PucchFormat2_3));
+ break;
+ }
+ case PUCCH_FORMAT_4:
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,resrcToAddModList->PucchFormat.format4 ,\
+ sizeof(PucchFormat4));
+ break;
+ }
+ }
+ }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.resrc,\
+ sizeof(PucchResrcCfg));
+ }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.format1,\
+ sizeof(PucchFormatCfg));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.format2,\
+ sizeof(PucchFormatCfg));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.format3,\
+ sizeof(PucchFormatCfg));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.format4,\
+ sizeof(PucchFormatCfg));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.schedReq,\
+ sizeof(PucchSchedReqCfg));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.multiCsiCfg,\
+ sizeof(PucchMultiCsiCfg));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.spatialInfo,\
+ sizeof(PucchSpatialCfg));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.dlDataToUlAck ,\
+ sizeof(PucchDlDataToUlAck));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,servCellCfg->initUlBwp.pucchCfg.powerControl,\
+ sizeof(PucchPowerControl));
+ deletePdschServCellCfg(&servCellCfg->pdschServCellCfg);
+ }
+ for(lcCfgIdx=0; lcCfgIdx< ueCfg->numLcs; lcCfgIdx++)
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,ueCfg->lcCfgList[lcCfgIdx].drbQos, sizeof(DrbQosInfo));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,ueCfg->lcCfgList[lcCfgIdx].snssai, sizeof(Snssai));
+ }
+ }
+ memset(ueCfg, 0, sizeof(MacUeCfg));
+}
+
+/*******************************************************************
+*
+* @brief delete UE Configuration of a particular UE
+*
+* @details
+*
+* Function : deleteUeCfg
+*
+* Functionality: delete UE Configuration of a particular UE
+*
+* @params[in] uint16_t cellIdx, uint8_t ueIdx
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t deleteUeCfg(uint16_t cellIdx, uint8_t ueIdx)
+{
+ DuUeCb *ueCb = NULLP;
+ if(duCb.actvCellLst[cellIdx] != NULLP)
+ {
+ if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].macUeCfg.macUeCfgState == UE_DELETE_COMPLETE)\
+ &&(duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].rlcUeCfg.rlcUeCfgState == UE_DELETE_COMPLETE))
+ {
+ ueCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1];
+ deleteMacUeCfg(&ueCb->macUeCfg);
+ deleteRlcUeCfg(&ueCb->rlcUeCfg);
+ if(ueCb->f1UeDb !=NULLP)
+ {
+ freeF1UeDb(ueCb->f1UeDb);
+ }
+ duCb.actvCellLst[cellIdx]->numActvUes--;
+ memset(ueCb, 0, sizeof(DuUeCb));
+ }
+ else
+ {
+ DU_LOG("INFO --> DU APP : deleteUeCfg(): MAC or RLC UE configuration state not UE_DELETE_COMPLETE");
+ return RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("ERROR --> DU APP : deleteUeCfg(): CellIdx[%d] is not found", cellIdx);
+ return RFAILED;
+ }
+ return ROK;
+}
+
+
+/*******************************************************************
+*
+* @brief Handle UE delete response from MAC
+*
+* @details
+*
+* Function : DuProcMacUeDeleteRsp
+*
+* Functionality: Handle UE delete response from MAC
+*
+* @params[in] Pointer to MacUeDeleteRsp and Pst
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t DuProcMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp)
+{
+ uint8_t ueIdx = 0,ret =ROK;
+ uint16_t cellIdx=0;
+ uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId =0;
+
+ if(deleteRsp)
+ {
+ if(deleteRsp->result == SUCCESS)
+ {
+ DU_LOG("\nINFO --> DU APP : MAC UE Delete Response : SUCCESS [UE IDX : %d]", deleteRsp->ueIdx);
+ GET_CELL_IDX(deleteRsp->cellId, cellIdx);
+ ueIdx = deleteRsp->ueIdx;
+ if(duCb.actvCellLst[cellIdx])
+ {
+ duCb.actvCellLst[cellIdx]->ueCb[deleteRsp->ueIdx -1].macUeCfg.macUeCfgState = UE_DELETE_COMPLETE;
+ gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbDuUeF1apId;
+ gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbCuUeF1apId;
+ if(deleteUeCfg(cellIdx, ueIdx) == ROK)
+ {
+ ret = BuildAndSendUeContextReleaseComplete(gnbCuUeF1apId, gnbDuUeF1apId);
+ if(ret !=ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp(): failed to send UE context release complete");
+ }
+ }
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp(): MAC UE Delete Response : FAILURE [UE IDX : %d]",\
+ deleteRsp->ueIdx);
+ ret = RFAILED;
+ }
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool, deleteRsp, sizeof(MacUeDeleteRsp));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp(): MAC UE Delete Response is null");
+ ret = RFAILED;
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Processes UE Delete Rsp received from RLC
+ *
+ * @details
+ *
+ * Function : DuProcRlcUeDeleteRsp
+ *
+ * Functionality:
+ * Processes UE Delete Rsp received from RLC
+ *
+ * @params[in] Post structure
+ * Pointer to RlcUeDeleteRsp
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * *****************************************************************/
+
+uint8_t DuProcRlcUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *delRsp)
+{
+ uint8_t ueIdx = 0, ret = ROK;
+ uint16_t cellIdx = 0;
+ uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId =0;
+
+ if(delRsp)
+ {
+ ueIdx = delRsp->ueIdx;
+ GET_CELL_IDX(delRsp->cellId, cellIdx);
+
+ if(delRsp->result == SUCCESSFUL)
+ {
+ DU_LOG("\nINFO --> DU_APP: RLC UE Delete Response : SUCCESS [UE IDX:%d]", ueIdx);
+ if(duCb.actvCellLst[cellIdx]!=NULLP)
+ {
+ duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].rlcUeCfg.rlcUeCfgState = UE_DELETE_COMPLETE;
+ gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbDuUeF1apId;
+ gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbCuUeF1apId;
+ if(deleteUeCfg(cellIdx, ueIdx) == ROK)
+ {
+ ret = BuildAndSendUeContextReleaseComplete(gnbCuUeF1apId, gnbDuUeF1apId);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp(): failed to send UE context release complete");
+ }
+ }
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP: RLC UE Delete Response : FAILED [UE IDX:%d]", ueIdx);
+ ret = RFAILED;
+ }
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool, delRsp, sizeof(RlcUeDeleteRsp));
+
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Sending UE Delete Req To Mac
+*
+* @details
+*
+* Function : sendUeDeleteReqToMac
+*
+* Functionality:
+* sending UE Delete Req To Mac
+*
+* @params[in] cellId, ueIdx, crnti
+* @return ROK - success
+* RFAILED - failure
+*
+*****************************************************************/
+
+uint8_t sendUeDeleteReqToMac(uint16_t cellId, uint8_t ueIdx, uint16_t crnti)
+{
+ Pst pst;
+ uint8_t ret=ROK;
+ MacUeDelete *ueDelete = NULLP;
+
+ DU_ALLOC_SHRABL_BUF(ueDelete, sizeof(MacUeDelete));
+ if(ueDelete)
+ {
+ ueDelete->cellId = cellId;
+ ueDelete->ueIdx = ueIdx;
+ ueDelete->crnti = crnti;
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_UE_DELETE_REQ);
+
+ /* Processing one Ue at a time to MAC */
+ DU_LOG("\nDEBUG --> DU_APP: Sending UE delete Request to MAC ");
+ ret = (*packMacUeDeleteReqOpts[pst.selector])(&pst, ueDelete);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU_APP: sendUeDeleteReqToMac(): Failed to send UE delete Req to MAC");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueDelete, sizeof(MacUeDelete));
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP: sendUeDeleteReqToMac(): Failed to allocate memory");
+ ret = RFAILED;
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Sending UE Delete Req To Rlc
+ *
+ * @details
+ *
+ * Function : sendUeDeleteReqToRlc
+ *
+ * Functionality:
+ * Sending UE Delete Req To Rlc
+ *
+ * @params[in] cellId, ueIdx
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ *****************************************************************/
+
+uint8_t sendUeDeleteReqToRlc(uint16_t cellId, uint8_t ueIdx)
+{
+ uint8_t ret;
+ Pst pst;
+ RlcUeDelete *ueDelete;
+
+ DU_ALLOC_SHRABL_BUF(ueDelete, sizeof(RlcUeDelete));
+ if(ueDelete !=NULLP)
+ {
+ ueDelete->cellId = cellId;
+ ueDelete->ueIdx = ueIdx;
+ FILL_PST_DUAPP_TO_RLC(pst, RLC_UL_INST, EVENT_RLC_UE_DELETE_REQ);
+
+ ret = (*packRlcUeDeleteReqOpts[pst.selector])(&pst, ueDelete);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU_APP : sendUeDeleteReqToRlc():Failed to send UE Delete Req to RLC");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueDelete, sizeof(RlcUeDelete));
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP: sendUeDeleteReqToRlc():Memory allocation failed");
+ ret = RFAILED;
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief DU processes UE delete req from CU and sends to MAC and RLC
+ *
+ * @details
+ *
+ * Function : duProcUeDeleteReq
+ *
+ * Functionality: DU processes UE delete req from CU and sends to MAC
+ * and RLC
+ *
+ * @params[in] cellId, crnti
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t duProcUeDeleteReq(uint16_t cellId)
+{
+ uint8_t ueIdx = 0, ueId =0;
+ uint16_t cellIdx = 0, crnti = 0;
+
+ DU_LOG("\nDEBUG --> DU_APP: Processing UE Delete Request ");
+ GET_CELL_IDX(cellId, cellIdx);
+ GET_CRNTI(crnti,ueIdx);
+
+ if(duCb.actvCellLst[cellIdx] != NULLP)
+ {
+ for(ueIdx =0;ueIdx< duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++)
+ {
+ ueId = ueIdx+1;
+ if(sendUeDeleteReqToRlc(cellId, ueId) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcUeDeleteReq():Failed to build UE delete req for RLC ");
+ return RFAILED;
+ }
+
+ GET_CRNTI(crnti,ueId);
+ if(sendUeDeleteReqToMac(cellId, ueId, crnti) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcUeDeleteReq(): Failed to build UE delete req for MAC ");
+ return RFAILED;
+ }
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : duProcUeDeleteReq(): Cell Id is not found");
+ return RFAILED;
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief delete RlcUeCfg from duCb
+ *
+ * @details
+ *
+ * Function : deleteRlcUeCfg
+ *
+ * Functionality:
+ * delete RlcUeCfg from duCb
+ *
+ * @params[in] RlcUeCfg *ueCfg
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ *****************************************************************/
+
+void deleteRlcUeCfg(RlcUeCfg *ueCfg)
+{
+ uint8_t lcIdx = 0;
+ RlcBearerCfg *lcCfg= NULLP;
+ if(ueCfg)
+ {
+ for(lcIdx =0 ; lcIdx < ueCfg->numLcs ; lcIdx++)
+ {
+ lcCfg = &ueCfg->rlcLcCfg[lcIdx];
+ switch(lcCfg->rlcMode)
+ {
+ case RLC_AM :
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.amCfg, sizeof(AmBearerCfg));
+ break;
+ }
+ case RLC_UM_BI_DIRECTIONAL :
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
+ break;
+ }
+ case RLC_UM_UNI_DIRECTIONAL_UL :
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
+ break;
+ }
+ case RLC_UM_UNI_DIRECTIONAL_DL :
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
+ break;
+ }
+ }
+ }
+ memset(ueCfg, 0, sizeof(RlcUeCfg));
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Delete DU CellCb information
+ *
+ * @details
+ *
+ * Function : deleteDuCellCb
+ *
+ * Functionality: Delete DU CellCb information
+ *
+ * @params[in] DuCellCb *cellCb
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+void deleteDuCellCb(DuCellCb *cellCb)
+{
+
+ if(cellCb->duMacCellCfg)
+ {
+ if(cellCb->duMacCellCfg->prachCfg.fdm[0].unsuedRootSeq)
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cellCb->duMacCellCfg->prachCfg.fdm[0].unsuedRootSeq,\
+ cellCb->duMacCellCfg->prachCfg.fdm[0].numUnusedRootSeq);
+ }
+ if(cellCb->duMacCellCfg->sib1Cfg.sib1Pdu)
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,cellCb->duMacCellCfg->sib1Cfg.sib1Pdu,\
+ cellCb->duMacCellCfg->sib1Cfg.sib1PduLen);
+ }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cellCb->duMacCellCfg, sizeof(MacCellCfg));
+ }
+ memset(cellCb, 0, sizeof(DuCellCb));
+
+}
+
+/*******************************************************************
+ *
+ * @brief Handle Cell delete response from MAC
+ *
+ * @details
+ *
+ * Function : DuProcMacCellDeleteRsp
+ *
+ * Functionality: Handle Cell delete response from MAC
+ *
+ * @params[in] Pointer to MacCellDeleteRsp and Pst
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp)
+{
+ uint8_t ret = ROK;
+ uint16_t cellIdx=0;
+ if(deleteRsp)
+ {
+ if(deleteRsp->result == SUCCESSFUL_RSP)
+ {
+ GET_CELL_IDX(deleteRsp->cellId, cellIdx);
+ DU_LOG("\nINFO --> DU APP : MAC CELL Delete Response : SUCCESS [CELL IDX : %d]", deleteRsp->cellId);
+ if(duCb.actvCellLst[cellIdx]->cellId == deleteRsp->cellId)
+ {
+ deleteDuCellCb(duCb.actvCellLst[cellIdx]);
+ duCb.numActvCells--;
+ DU_FREE(duCb.actvCellLst[cellIdx], sizeof(DuCellCb));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacCellDeleteRsp(): CellId [%d] doesnot exist", deleteRsp->cellId);
+ ret = RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacCellDeleteRsp(): MAC CELL Delete Response : FAILED\
+ [CELL IDX : %d]", deleteRsp->cellId);
+ ret = RFAILED;
+ }
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool, deleteRsp, sizeof(MacUeDeleteRsp));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacCellDeleteRsp(): Received MAC cell delete response is NULL");
+ ret = RFAILED;
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Sending Cell Delete Req To Mac
+ *
+ * @details
+ *
+ * Function : sendCellDeleteReqToMac
+ *
+ * Functionality:
+ * sending Cell Delete Req To Mac
+ *
+ * @params[in] uint16_t cellId
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ *
+ *****************************************************************/
+
+uint8_t sendCellDeleteReqToMac(uint16_t cellId)
+{
+ Pst pst;
+ uint8_t ret=ROK;
+ MacCellDelete *cellDelete = NULLP;
+
+ DU_ALLOC(cellDelete, sizeof(MacCellDelete));
+ if(cellDelete)
+ {
+ cellDelete->cellId = cellId;
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_DELETE_REQ);
+
+ DU_LOG("\nINFO --> DU APP : Sending Cell Delete Request to MAC");
+ /* Processing one Cell at a time to MAC */
+ ret = (*packMacCellDeleteReqOpts[pst.selector])(&pst, cellDelete);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : sendCellDeleteReqToMac(): Failed to send Cell delete Req to MAC");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cellDelete, sizeof(MacCellDelete));
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : sendCellDeleteReqToMac(): Failed to allocate memory");
+ ret = RFAILED;
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief DU preocess Cell Delete Req to MAC
+ *
+ * @details
+ *
+ * Function : duProcCellDeleteReq
+ *
+ * Functionality: DU process Cell Delete Req to MAC
+ *
+ * @params[in] uint16_t cellId
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t duProcCellDeleteReq(uint16_t cellId)
+{
+ uint16_t cellIdx = 0;
+
+ DU_LOG("\nINFO --> DU APP : Processing Cell Delete Request ");
+ GET_CELL_IDX(cellId, cellIdx);
+
+ if(duCb.actvCellLst[cellIdx] != NULLP)
+ {
+ if(duBuildAndSendMacCellStop() == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcCellDeleteReq(): Failed to process Cell delete req for cellId[%d]",cellId);
+ return RFAILED;
+ }
+
+ if(duCb.actvCellLst[cellIdx]->numActvUes)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcCellDeleteReq(): Active UEs present Failed to process cell Delete\
+ Req for cellID[%d]", cellId);
+ return RFAILED;
+ }
+ if(sendCellDeleteReqToMac(cellId) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcCellDeleteReq(): Failed to build and send Cell delete req for MAC for\
+ cellId[%d]",cellId);
+ return RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : duProcCellDeleteReq(): CellId[%d] is not found", cellId);
+ return RFAILED;
+ }
+
+ return ROK;
+}
+
/**********************************************************************
End of file
- ***********************************************************************/
+***********************************************************************/