uint8_t pduIdx =0;
uint8_t lcIdx = 0;
uint8_t *txPdu =NULLP;
- uint16_t tbSize =0;
+ uint16_t tbSize =0,cellIdx=0;
MacDlData macDlData;
MacDlSlot *currDlSlot = NULLP;
DlRlcBoInfo dlBoInfo;
-
+
memset(&macDlData , 0, sizeof(MacDlData));
DU_LOG("\nDEBUG --> MAC: Received DL data for sfn=%d slot=%d numPdu= %d", \
dlData->slotInfo.sfn, dlData->slotInfo.slot, dlData->numPdu);
macDlData.pduInfo[pduIdx].dlPdu = dlData->pduInfo[pduIdx].pduBuf;
}
+ GET_CELL_IDX(dlData->cellId, cellIdx);
/* Store DL data in the scheduled slot */
- currDlSlot = &macCb.macCell[dlData->cellId -1]->dlSlot[dlData->slotInfo.slot];
- if(currDlSlot)
+ if(macCb.macCell[cellIdx] ==NULLP)
{
- if(currDlSlot->dlInfo.dlMsgAlloc)
+ DU_LOG("\nERROR --> MAC : MacProcRlcDlData(): macCell does not exists");
+ return RFAILED;
+ }
+ currDlSlot = &macCb.macCell[cellIdx]->dlSlot[dlData->slotInfo.slot];
+ if(currDlSlot->dlInfo.dlMsgAlloc)
+ {
+ tbSize = currDlSlot->dlInfo.dlMsgAlloc->dlMsgPdschCfg.codeword[0].tbSize;
+ MAC_ALLOC(txPdu, tbSize);
+ if(!txPdu)
{
- tbSize = currDlSlot->dlInfo.dlMsgAlloc->dlMsgPdschCfg.codeword[0].tbSize;
- MAC_ALLOC(txPdu, tbSize);
- if(!txPdu)
- {
- DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcRlcDlData");
- return RFAILED;
- }
- macMuxPdu(&macDlData, NULLP, txPdu, tbSize);
-
- currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPduLen = tbSize;
- currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu = txPdu;
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcRlcDlData");
+ return RFAILED;
}
+ macMuxPdu(&macDlData, NULLP, txPdu, tbSize);
+
+ currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPduLen = tbSize;
+ currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu = txPdu;
}
for(lcIdx = 0; lcIdx < dlData->numLc; lcIdx++)
for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++)
{
MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData->pduInfo[pduIdx].pduBuf,\
- dlData->pduInfo[pduIdx].pduLen);
+ dlData->pduInfo[pduIdx].pduLen);
}
if(pstInfo->selector == ODU_SELECTOR_LWLC)
{
- MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData, sizeof(RlcData));
+ MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData, sizeof(RlcData));
}
return ROK;
}
DU_LOG("\nINFO --> MAC : Sending cell stop request to Lower Mac");
GET_CELL_IDX(cellId->cellId, cellIdx);
- slotInfo.cellId = cellId->cellId;
- slotInfo.sfn = macCb.macCell[cellIdx]->currTime.sfn;
- slotInfo.slot = macCb.macCell[cellIdx]->currTime.slot;
- sendToLowerMac(FAPI_STOP_REQUEST, 0, &slotInfo);
+ if(macCb.macCell[cellIdx])
+ {
+ slotInfo.cellId = cellId->cellId;
+ slotInfo.sfn = macCb.macCell[cellIdx]->currTime.sfn;
+ slotInfo.slot = macCb.macCell[cellIdx]->currTime.slot;
+ sendToLowerMac(FAPI_STOP_REQUEST, 0, &slotInfo);
+ }
#endif
MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellId, \
uint16_t cellIdx = 0;
GET_CELL_IDX(slotInd.cellId, cellIdx);
-
+
+ if(macCb.macCell[cellIdx] == NULLP)
+ {
+ DU_LOG("ERROR --> MAC : macProcSlotInd(): CellId[%d] does not exist. Error occurred at SFN [%d] Slot [%d]",\
+ slotInd.cellId, slotInd.sfn, slotInd.slot);
+ return RFAILED;
+ }
/* Store current time info */
macCb.macCell[cellIdx]->currTime.cellId = slotInd.cellId;
macCb.macCell[cellIdx]->currTime.slot = slotInd.slot;
/* Filling UE delete response */
deleteRsp->cellId = cellId;
- GET_UE_IDX(crnti,deleteRsp->ueIdx);
+ GET_UE_IDX(crnti,deleteRsp->ueId);
deleteRsp->result = result;
/* Fill Post structure and send UE delete response*/
MacUeCb *ueCb = NULLP;
MacCellCb *cellCb = NULLP;
- DU_LOG("\nINFO --> MAC : UE Delete Request received for ueIdx[%d]", ueDelete->ueIdx);
+ DU_LOG("\nINFO --> MAC : UE Delete Request received for ueId[%d]", ueDelete->ueId);
if(ueDelete)
{
cellCb = macCb.macCell[cellIdx];
if(cellCb)
{
- ueCb = &cellCb->ueCb[ueDelete->ueIdx-1];
+ ueCb = &cellCb->ueCb[ueDelete->ueId-1];
if(ueCb->crnti == ueDelete->crnti)
{
ret = sendUeDelReqToSch(pst, ueDelete);
}
else
{
- DU_LOG("\nERROR --> MAC : MacProcUeDeleteReq(): Failed to find the MacUeCb of UeIdx = %d",ueDelete->ueIdx);
+ DU_LOG("\nERROR --> MAC : MacProcUeDeleteReq(): Failed to find the MacUeCb of UeIdx = %d",ueDelete->ueId);
result = CELLID_INVALID;
}
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.thptPerUe[ueId -1].ueId = ueId;
+ gCb->rlcThpt.thptPerUe[ueId -1].dataVol = 0;
gCb->rlcThpt.numActvUe++;
-
- if((rlcChkTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR)) == FALSE)
- {
- rlcStartTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR);
- }
}
/* Validate LChId for UM and AM modes */
return RFAILED;
}
rlcDbmAddUlUeCb(gCb, cfgTmpData->ueId, cfgTmpData->cellId, cfgTmpData->ueCb);
+ cfgTmpData->ueCb->ueDeleteInfo.ueDelTmr.tmrEvnt = TMR_NONE;
}
else
{
DU_LOG("\nERROR --> RLC_DL : UeId[%u] HashList Insertion Failed",
ueCb->ueId);
}
+ memset(&gCb->rlcThpt.thptPerUe[ueCb->ueId -1], 0, sizeof(RlcThptPerUe));
+ gCb->rlcThpt.numActvUe--;
+
/* kw005.201 ccpu00117318, updating the statistics */
gCb->genSts.numUe--;
else if (tRlcCb->u.ulCb->rlcUlUdxEventType == EVENT_RLC_UE_DELETE_REQ)
{
FILL_PST_RLC_TO_DUAPP(rspPst, RLC_UL_INST, EVENT_RLC_UE_DELETE_RSP);
- if(sendRlcUeDeleteRspToDu(cfgCfm->ueId, cfgCfm->cellId, SUCCESSFUL) != ROK)
+ if(sendRlcUeDeleteRspToDu(cfgCfm->cellId, cfgCfm->ueId, SUCCESSFUL) != ROK)
{
DU_LOG("ERROR --> RLC_UL: rlcUlUdxCfgCfm(): Failed to send UE delete response ");
return RFAILED;
gCb->init.cfgDone = TRUE;
+ /* TODO : make this generic for DL and UL after support for UL throughput calculation is added */
+ if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
+ {
+ /* Starting timer to print throughput */
+ if((rlcChkTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR)) == FALSE)
+ {
+ DU_LOG("\nINFO --> RLC_DL : Starting Throughput timer");
+ rlcStartTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR);
+ }
+ }
+
return (LCM_REASON_NOT_APPL);
}
/* This file stores defines used at RLC interface */
uint8_t fillRlcUeCfgRsp(RlcUeCfgRsp *rlcCfgRsp, RlcCfgCfmInfo *rlcCRsp);
uint8_t SendRlcUeCfgRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp);
-uint8_t sendRlcUeDeleteRspToDu(uint8_t ueIdx, uint16_t cellId, UeDeleteResult result);
+uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId, uint8_t ueId, UeDeleteResult result);
/**********************************************************************
End of file
* Functionality:
* sending UE delete response to DU
*
- * @params[in] uint8_t ueIdx, uint8_t cellId, UeDeleteResult result
+ * @params[in] uint8_t cellId, uint8_t ueIdx, UeDeleteResult result
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t sendRlcUeDeleteRspToDu(uint8_t ueIdx, uint16_t cellId, UeDeleteResult result)
+uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId,uint8_t ueId, UeDeleteResult result)
{
Pst pst;
RlcUeDeleteRsp *ueDeleteRsp = NULLP;
else
{
ueDeleteRsp->cellId = cellId;
- ueDeleteRsp->ueIdx = ueIdx;
+ ueDeleteRsp->ueId = ueId;
ueDeleteRsp->result = result;
if(rlcSendUeDeleteRspToDu(&pst, ueDeleteRsp) == ROK)
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
{
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);
+ DU_LOG("\nDEBUG --> RLC: UE Delete request received. CellID[%d] UEID[%d]",ueDelete->cellId, ueDelete->ueId);
if(ueDelete != NULLP)
{
gRlcCb = RLC_GET_RLCCB(pst->dstInst);
- rlcDbmFetchUlUeCb(gRlcCb,ueDelete->ueIdx, ueDelete->cellId, &ueCb);
+ rlcDbmFetchUlUeCb(gRlcCb,ueDelete->ueId, 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
+ memcpy(&ueCb->ueDeleteInfo.pst, pst, sizeof(Pst));
+ if((rlcChkTmr(gRlcCb, (PTR)ueCb, EVENT_RLC_UE_DELETE_TMR)) == FALSE)
{
- 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;
- }
+ rlcStartTmr(gRlcCb,(PTR)ueCb, EVENT_RLC_UE_DELETE_TMR);
}
}
else
if(result != SUCCESSFUL)
{
- ret = sendRlcUeDeleteRspToDu(ueDelete->ueIdx, ueDelete->cellId, result);
+ ret = sendRlcUeDeleteRspToDu(ueDelete->cellId, ueDelete->ueId, result);
if(ret != ROK)
{
DU_LOG("\nERROR --> RLC: RlcProcUeDeleteReq():Failed to send UE Delete response to DU");
#include "kwu.x" /* KWU */
#include "rgu.x" /* RGU */
+#include "du_app_rlc_inf.h"
#include "rlc_utils.h" /* RLC defines */
#include "rlc_dl_ul_inf.h"
#include "rlc_dl.h"
#include "rlc_ul.h"
+#include "rlc_mgr.h"
+
/**
* @file gp_tmr.c
* @brief RLC Timer Module
/* private function declarations */
static Void rlcBndTmrExpiry(PTR cb);
-void rlcThptTmrExpiry(PTR cb);
/**
* @brief Handler to start timer
arg.max = RLC_MAX_THPT_TMR;
break;
}
+ case EVENT_RLC_UE_DELETE_TMR:
+ {
+ RlcUlUeCb *ulUeCb = (RlcUlUeCb*)cb;
+ RLC_TMR_CALCUATE_WAIT(arg.wait, RLC_UE_DELETE_WAIT_TIME, gCb->genCfg.timeRes);
+ arg.timers = &ulUeCb->ueDeleteInfo.ueDelTmr;
+ arg.max = RLC_MAX_UE_TMR;
+ break;
+ }
default:
{
DU_LOG("\nERROR --> RLC : rlcStartTmr: Invalid tmr Evnt [%d]", tmrEvnt);
arg.timers = &((RlcThpt *)cb)->thptTmr;
arg.max = RLC_MAX_THPT_TMR;
}
+ case EVENT_RLC_UE_DELETE_TMR:
+ {
+ arg.timers = &((RlcUlUeCb*)cb)->ueDeleteInfo.ueDelTmr;
+ arg.max = EVENT_RLC_UE_DELETE_TMR;
+ }
default:
{
DU_LOG("\nERROR --> RLC : rlcStopTmr: Invalid tmr Evnt[%d]", tmrType);
rlcThptTmrExpiry(cb);
break;
}
+ case EVENT_RLC_UE_DELETE_TMR:
+ {
+ rlcUeDeleteTmrExpiry(cb);
+ break;
+ }
default:
{
break;
{
return (((RlcThpt *)cb)->thptTmr.tmrEvnt == EVENT_RLC_THROUGHPUT_TMR);
}
+ case EVENT_RLC_UE_DELETE_TMR:
+ {
+ return (((RlcUlUeCb *)cb)->ueDeleteInfo.ueDelTmr.tmrEvnt == EVENT_RLC_UE_DELETE_TMR);
+ }
default:
{
DU_LOG("\nERROR --> RLC : rlcChkTmr: Invalid tmr Evnt [%d]", tmrEvnt);
* @brief Handler to do processing on expiry of the bind timer
*
* @details
- * This function processes the RLC bind timer expiry. If the number of
- * retries is less than the maximum retry counter, bind request is sent
+ * This function processes the RLC bind timer expiry. If the number of
+ * retries is less than the maximum retry counter, bind request is sent
* again, else an alarm is raised to the layer manager.
- *
+ *
* @param[in] cb Pointer to the Rgu sap
*
* @return Void
*/
static Void rlcBndTmrExpiry(PTR cb)
{
- RlcRguSapCb *rguSapCb;
+ RlcRguSapCb *rguSapCb;
rguSapCb = (RlcRguSapCb *) cb;
{
/* start timer to wait for bind confirm */
rlcStartTmr(RLC_GET_RLCCB(rguSapCb->pst.srcInst),
- (PTR)rguSapCb,
+ (PTR)rguSapCb,
EVENT_RLC_WAIT_BNDCFM);
-
+
/* Send bind request */
rguSapCb->retryCnt++;
RlcLiRguBndReq (&rguSapCb->pst, rguSapCb->suId, rguSapCb->spId);
/* Send alarm to the layer manager */
#ifdef LTE_L2_MEAS
rlcLmmSendAlarm(RLC_GET_RLCCB(rguSapCb->pst.srcInst),
- LCM_CATEGORY_INTERFACE,
+ LCM_CATEGORY_INTERFACE,
LCM_EVENT_BND_FAIL,
- LCM_CAUSE_TMR_EXPIRED,
- 0,
- 0,
+ LCM_CAUSE_TMR_EXPIRED,
+ 0,
+ 0,
0);
#else
rlcLmmSendAlarm(RLC_GET_RLCCB(rguSapCb->pst.srcInst),
- LCM_CATEGORY_INTERFACE,
+ LCM_CATEGORY_INTERFACE,
LCM_EVENT_BND_FAIL,
- LCM_CAUSE_TMR_EXPIRED,
+ LCM_CAUSE_TMR_EXPIRED,
0, /* suId */
0 /* ueId */);
#endif
uint16_t ueIdx;
long double tpt;
RlcThpt *rlcThptCb = (RlcThpt*)cb;
+
+ /* If cell is not up, throughput details cannot be printed */
+ if(gCellStatus != CELL_UP)
+ {
+ /* Restart timer */
+ rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)rlcThptCb, EVENT_RLC_THROUGHPUT_TMR);
+ return;
+ }
- /* Print throughput */
+ /* If cell is up, print throughout for each UE attached to the cell */
DU_LOG("\n===================== DL Throughput ==============================");
DU_LOG("\nNumber of UEs : %d", rlcThptCb->numActvUe);
- for(ueIdx = 0; ueIdx < rlcThptCb->numActvUe; ueIdx++)
+ if(rlcThptCb->numActvUe)
{
- /* Spec 28.552, section 5.1.1.3 :
- * Throughput in kilobits/sec = (dataVol in kiloBits * 1000)/time in milligseconds
- *
- * Since our dataVol is in bytes, multiplying 0.008 to covert into kilobits i.e.
- * Throughput[kbits/sec] = (dataVol * 0.008 * 1000)/time in ms
- */
- tpt = (double)(rlcThptCb->thptPerUe[ueIdx].dataVol * 8)/(double)ODU_THROUGHPUT_PRINT_TIME_INTERVAL;
+ for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
+ {
+ if(rlcThptCb->thptPerUe[ueIdx].ueId)
+ {
+ /* Spec 28.552, section 5.1.1.3 :
+ * Throughput in kilobits/sec = (dataVol in kiloBits * 1000)/time in milligseconds
+ *
+ * Since our dataVol is in bytes, multiplying 0.008 to covert into kilobits i.e.
+ * Throughput[kbits/sec] = (dataVol * 0.008 * 1000)/time in ms
+ */
+ tpt = (double)(rlcThptCb->thptPerUe[ueIdx].dataVol * 8)/(double)ODU_THROUGHPUT_PRINT_TIME_INTERVAL;
- DU_LOG("\nUE Id : %d DL Tpt : %.2Lf", rlcThptCb->thptPerUe[ueIdx].ueIdx, tpt);
- rlcThptCb->thptPerUe[ueIdx].dataVol = 0;
+ DU_LOG("\nUE Id : %d DL Tpt : %.2Lf", rlcThptCb->thptPerUe[ueIdx].ueId, tpt);
+ rlcThptCb->thptPerUe[ueIdx].dataVol = 0;
+ }
+ }
}
DU_LOG("\n==================================================================");
return;
}
+/**
+*
+* @brief filling RLC UE delete configuration
+*
+* @details
+* 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 Handler to do processing on expiry of the UE delete timer
+*
+* @details
+* This function processes the RLC UE delete timer expiry.
+*
+* @param[in] cb Pointer to the RlcUlUeCb
+*
+* @return uint8_t
+*/
+
+uint8_t rlcUeDeleteTmrExpiry(PTR cb)
+{
+ RlcCb *gRlcCb = NULLP;
+ RlcCfgInfo *rlcUeCfg = NULLP;
+ RlcUlUeCb *ueCb = (RlcUlUeCb*)cb;
+
+ gRlcCb = RLC_GET_RLCCB(ueCb->ueDeleteInfo.pst.dstInst);
+ RLC_ALLOC(gRlcCb, rlcUeCfg, sizeof(RlcCfgInfo));
+ if(rlcUeCfg == NULLP)
+ {
+ DU_LOG("\nERROR --> RLC: rlcUeDeleteTmrExpiry(): Failed to allocate memory");
+ return RFAILED;
+ }
+ memset(rlcUeCfg, 0, sizeof(RlcCfgInfo));
+ fillRlcUeDelInfo(ueCb, rlcUeCfg);
+ if(RlcProcCfgReq(&ueCb->ueDeleteInfo.pst, rlcUeCfg) != ROK)
+ {
+ DU_LOG("\nERROR --> RLC: rlcUeDeleteTmrExpiry(): Failed to delete UE");
+ if(sendRlcUeDeleteRspToDu(rlcUeCfg->cellId, rlcUeCfg->ueId, INVALID_UEID) != ROK)
+ {
+ DU_LOG("ERROR --> RLC: rlcUeDeleteTmrExpiry(): Failed to send UE delete response ");
+ return RFAILED;
+ }
+ }
+ return ROK;
+}
\f
/********************************************************************30**
RlcUlRbCb *ulRbCb; /**< Pointer to Uplink RbCb */
}RlcUlLch;
+/**
+* @brief Structure to hold ue delete information
+*
+* @details
+* - pst : Pst
+* - ueDelTmr : Ue delete timer
+*/
+typedef struct rlcUeDeleteInfo
+{
+ Pst pst; /*Pst */
+ CmTimer ueDelTmr; /*Ue delete timer*/
+}RlcUeDeleteInfo;
+
/**
* @brief Structure to hold uplink information about the Cells
*
struct rlcUlUeCb
{
CmHashListEnt ueHlEnt; /**< Hash list entry for UeCb */
- CmLteRnti ueId; /*!< UE Id */
- CmLteCellId cellId; /*!< Cell Id */
- RlcUlRbCb *srbCb[RLC_MAX_SRB_PER_UE]; /**< SRB RbCbs within an UE */
- RlcUlRbCb *drbCb[RLC_MAX_DRB_PER_UE]; /**< DRB RbCbs within an UE */
- RlcUlLch lCh[RLC_MAX_LCH_PER_UE]; /**< Logical channels of an UE*/
+ CmLteRnti ueId; /*!< UE Id */
+ CmLteCellId cellId; /*!< Cell Id */
+ RlcUlRbCb *srbCb[RLC_MAX_SRB_PER_UE]; /**< SRB RbCbs within an UE */
+ RlcUlRbCb *drbCb[RLC_MAX_DRB_PER_UE]; /**< DRB RbCbs within an UE */
+ RlcUlLch lCh[RLC_MAX_LCH_PER_UE]; /**< Logical channels of an UE*/
/* kw005.201 added support for L2 Measurement */
#ifdef LTE_L2_MEAS
- uint32_t firstPacketTTI; /*!< is first packet of the burst */
- uint16_t numActRb[LKW_MAX_QCI]; /**< number of RBs Active */
- Bool isUlBurstActive; /*!<Has the Burst started for UL IP Thrpt meas */
+ uint32_t firstPacketTTI; /*!< is first packet of the burst */
+ uint16_t numActRb[LKW_MAX_QCI]; /**< number of RBs Active */
+ Bool isUlBurstActive; /*!<Has the Burst started for UL IP Thrpt meas */
#endif /* LTE_L2_MEAS */
+ RlcUeDeleteInfo ueDeleteInfo; /*!<Ue Delete Info */
};
/**
#define RLC_MAX_UM_TMR 1
#define RLC_MAX_AM_TMR 3
#define RLC_MAX_THPT_TMR 1
+#define RLC_MAX_UE_TMR 1
/* Timer events */
#define EVENT_RLC_UMUL_REASSEMBLE_TMR 1
-#define EVENT_RLC_AMUL_REASSEMBLE_TMR 2
+#define EVENT_RLC_AMUL_REASSEMBLE_TMR 2
#define EVENT_RLC_AMUL_STA_PROH_TMR 3
#define EVENT_RLC_AMDL_POLL_RETX_TMR 4
#define EVENT_RLC_WAIT_BNDCFM 5
#define EVENT_RLC_L2_TMR 6
#endif /* LTE_L2_MEAS */
#define EVENT_RLC_THROUGHPUT_TMR 7
+#define EVENT_RLC_UE_DELETE_TMR 8
+
+/* Wait time for RLC Timers */
+#define RLC_UE_DELETE_WAIT_TIME 1 /*in milliseconds */
/*******************************************************************************
* DBM Defines
typedef struct rlcThptPerUe
{
- uint16_t ueIdx;
+ uint16_t ueId;
uint64_t dataVol;
}RlcThptPerUe;
bool rlcChkTmr ARGS((RlcCb *gCb,PTR cb, S16 tmrEvnt));
+void rlcThptTmrExpiry(PTR cb);
+
+uint8_t rlcUeDeleteTmrExpiry(PTR cb);
+
#ifdef LTE_L2_MEAS
Void rlcLmmSendAlarm ARGS (( RlcCb *gCb,
uint16_t category,
uint8_t rlcUtlSendToMac(RlcCb *gCb, SuId suId, KwDStaIndInfo *staIndInfo)
{
uint8_t numPdu = 0;
- uint16_t ueIdx;
- uint16_t actvUeIdx;
+ uint16_t ueId;
RlcDlUeCb *ueCb; /* UE control block */
uint32_t count; /* Loop Counter */
uint32_t numTb; /* Number of Tbs */
{
staInd = &staIndInfo->staInd[idx];
/* Fetch Ue control block */
- GET_UE_IDX(staInd->rnti, ueIdx);
- if(ROK != rlcDbmFetchDlUeCb(gCb, ueIdx, staIndInfo->cellId,&ueCb))
+ GET_UE_IDX(staInd->rnti, ueId);
+ if(ROK != rlcDbmFetchDlUeCb(gCb, ueId, staIndInfo->cellId,&ueCb))
{
/* Fetch UeCb failed */
DU_LOG("\nERROR --> RLC_DL : rlcUtlSendToMac: UeId[%u]:ueCb not found",
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)))
{
/* Cosider buffer size for throughput calculation */
- gCb->rlcThpt.thptPerUe[actvUeIdx].dataVol += staIndTb->lchStaInd[count].totBufSize;
+ if(gCb->rlcThpt.thptPerUe[ueId-1].ueId == ueId)
+ gCb->rlcThpt.thptPerUe[ueId-1].dataVol += staIndTb->lchStaInd[count].totBufSize;
staIndSz += staIndTb->lchStaInd[count].totBufSize;
datReq.pduSz = staIndTb->lchStaInd[count].totBufSize;
DU_LOG("\nDEBUG --> SCH : Received RLC BO Status indication");
cell = schCb[inst].cells[inst];
+ if(cell == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : MacSchDlRlcBoInfo(): Cell does not exists");
+ return RFAILED;
+ }
+
GET_UE_IDX(dlBoInfo->crnti, ueIdx);
ueCb = &cell->ueCb[ueIdx-1];
lcId = dlBoInfo->lcId;
if(lcId == SRB1_LCID || lcId == SRB2_LCID || lcId == SRB3_LCID || \
- (lcId >= MIN_DRB_LCID && lcId <= MAX_DRB_LCID))
+ (lcId >= MIN_DRB_LCID && lcId <= MAX_DRB_LCID))
{
SET_ONE_BIT(ueIdx, cell->boIndBitMap);
ueCb->dlInfo.dlLcCtxt[lcId].bo = dlBoInfo->dataVolume;
slotIdx++;
if(slotIdx==cell->numSlots)
{
- DU_LOG("\nERROR --> SCH : No DL Slot available");
- return RFAILED;
+ DU_LOG("\nERROR --> SCH : No DL Slot available");
+ return RFAILED;
}
}
#endif
+
schDlSlotInfo = cell->schDlSlotInfo[slot];
+ if(schDlSlotInfo == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : MacSchDlRlcBoInfo(): schDlSlotInfo does not exists");
+ return RFAILED;
+ }
SCH_ALLOC(schDlSlotInfo->dlMsgInfo, sizeof(DlMsgInfo));
- if(!schDlSlotInfo->dlMsgInfo)
+ if(schDlSlotInfo->dlMsgInfo == NULLP)
{
DU_LOG("\nERROR --> SCH : Memory allocation failed for dlMsgInfo");
schDlSlotInfo = NULL;
return RFAILED;
}
+
schDlSlotInfo->dlMsgInfo->crnti = dlBoInfo->crnti;
schDlSlotInfo->dlMsgInfo->ndi = 1;
schDlSlotInfo->dlMsgInfo->harqProcNum = 0;
dlBrdcstAlloc->sib1Trans = NO_SIB1;
cell = schCb[schInst].cells[schInst];
+ if(cell == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : Cell Does not exist");
+ return RFAILED;
+ }
ssb_rep = cell->cellCfg.ssbSchCfg.ssbPeriod;
memcpy(&cell->slotInfo, slotInd, sizeof(SlotIndInfo));
dlBrdcstAlloc->ssbIdxSupported = 1;
Configuration Confirmation Informatin RLC to RRC */
typedef struct rlcCfgCfmInfo
{
- uint32_t transId; /*!< Transaction Id */
+ uint32_t transId; /*!< Transaction Id */
CmLteRnti ueId; /*!< UE ID */
CmLteCellId cellId; /*!< Cell ID */
- uint8_t numEnt; /*!< Number of entities configured */
+ uint8_t numEnt; /*!< Number of entities configured */
RlcEntCfgCfmInfo entCfgCfm[CKW_MAX_ENT_CFG]; /*!< Array of Entity cfg
confiramations */
}RlcCfgCfmInfo;
SCS_240KHZ
}SCS;
+typedef enum
+{
+ CELL_UP,
+ CELL_DOWN
+}OduCellStatus;
+
typedef struct slotIndInfo
{
uint16_t cellId;
}TDDCfg;
#endif
-
+OduCellStatus gCellStatus;
uint64_t gSlotCount;
uint64_t gDlDataRcvdCnt; /* Number of DL data received at EGTP */
typedef struct ueDelete
{
uint16_t cellId;
- uint8_t ueIdx;
+ uint8_t ueId;
uint16_t crnti;
}MacUeDelete;
typedef struct ueDeleteRsp
{
uint16_t cellId;
- uint8_t ueIdx;
+ uint8_t ueId;
UeDeleteStatus result;
}MacUeDeleteRsp;
typedef struct rlcUeDelete
{
uint16_t cellId;
- uint8_t ueIdx;
+ uint8_t ueId;
}RlcUeDelete;
typedef struct rlcUeDeleteRsp
{
uint16_t cellId;
- uint8_t ueIdx;
+ uint8_t ueId;
UeDeleteResult result;
}RlcUeDeleteRsp;
{
DU_LOG("\nINFO --> DU APP : 5G-NR Cell %d is UP", cellId->cellId);
cellCb->cellStatus = ACTIVATED;
+ gCellStatus = CELL_UP;
#ifdef O1_ENABLE
DU_LOG("\nINFO --> DU APP : Raise cell UP alarm for cell id=%d", cellId->cellId);
if(ret == RFAILED)
{
/*TODO : Negative case*/
- // BuildAndSendUeContextSetupRsp(ueIdx, cellId);
+ // BuildAndSendUeContextSetupRsp(cellId,ueIdx);
DU_LOG("\nERROR --> F1AP: Failed to process UE CNTXT SETUP REQ at procF1UeContextSetupReq()");
}
else
* Functionality: Constructs the UE Setup Response and sends
* it to the DU through SCTP.
*
- * @params[in]
+ * @params[in] uint8_t cellId,uint8_t ueIdx
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildAndSendUeContextSetupRsp(uint8_t ueIdx, uint8_t cellId)
+uint8_t BuildAndSendUeContextSetupRsp(uint8_t cellId,uint8_t ueIdx)
{
uint8_t idx, ret, cellIdx, elementCnt;
uint32_t gnbCuUeF1apId; /* gNB-CU UE F1AP Id */
* failure = RFAILED
*
* ****************************************************************/
-uint8_t BuildAndSendUeCtxtRsp(uint8_t ueIdx, uint8_t cellId)
+uint8_t BuildAndSendUeCtxtRsp(uint8_t cellId, uint8_t ueIdx)
{
uint8_t cellIdx = 0, actionType = 0;
switch(actionType)
{
case UE_CTXT_SETUP:
- BuildAndSendUeContextSetupRsp(ueIdx, cellId);
- break;
+ {
+ BuildAndSendUeContextSetupRsp(cellId,ueIdx);
+ break;
+ }
case UE_CTXT_MOD:
- BuildAndSendUeContextModResp(ueIdx, cellId);
- break;
+ {
+ BuildAndSendUeContextModRsp(cellId, ueIdx);
+ break;
+ }
default:
DU_LOG("ERROR --> F1AP: Invalid Action Type %d at BuildAndSendUeCtxtRsp()", actionType);
break;
*
* @details
*
-* Function : BuildAndSendUeContextModResp
+* Function : BuildAndSendUeContextModRsp
*
* Functionality:
* - Creating the ue context modifcation response
*
-* @params[in]
+* @params[in] uint8_t cellId,uint8_t ueIdx
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildAndSendUeContextModResp(uint8_t ueIdx, uint8_t cellId)
+uint8_t BuildAndSendUeContextModRsp(uint8_t cellId,uint8_t ueIdx)
{
uint8_t ieIdx = 0;
uint8_t cellIdx =0;
* Functionality:
* - Build and Send UE Context Release Complete
*
- * @params[in]
+ * @params[in] cellId, gnbCuUeF1apId, gnbDuUeF1apId
* @return ROK - success
* RFAILED - failure
*
* *************************************************************/
-uint8_t BuildAndSendUeContextReleaseComplete(uint32_t gnbCuUeF1apId, uint32_t gnbDuUeF1apId)
+uint8_t BuildAndSendUeContextReleaseComplete(uint16_t cellId, uint32_t gnbCuUeF1apId, uint32_t gnbDuUeF1apId)
{
bool memAllocFail = false;
uint8_t ieIdx =0, ret = RFAILED, elementCnt = 0;
ret = ROK;
break;
}while(true);
-
+
+ if(ret == ROK)
+ {
+ duCb.actvCellLst[cellId-1]->cellStatus = DELETION_IN_PROGRESS;
+ ret = duSendCellDeletReq(cellId);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP: BuildAndSendUeContextReleaseComplete(): Failed to process cell\
+ Delete req for CellId");
+ }
+ }
FreeUeContextReleaseComplete(f1apMsg);
return ret;
- /*TODO: To add trigger for UE context release complete, once the operations of UE context
- * release command are done*/
}
+
/*******************************************************************
*
* @brief added free part for the memory allocated by aper_decoder
* ****************************************************************/
uint8_t procF1UeContextReleaseCommand(F1AP_PDU_t *f1apMsg)
{
- /*TODO: processing of DL RRC Msg Transfer to RLC->SCH->MAC-LOWER-MAC->PHY, if RRC container is received */
-
+ uint8_t ieIdx=0, ret=ROK, ueIdx=0;
+ uint16_t cellIdx =0;
+ bool ueIdxFound;
+ uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId=0;
+ DuUeCb *duUeCb = NULLP;
+ UEContextReleaseCommand_t *ueContextReleaseCommand = NULLP;
+
+ ueContextReleaseCommand = &f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseCommand;
+
+ if(ueContextReleaseCommand->protocolIEs.list.array)
+ {
+ for(ieIdx=0; ieIdx < ueContextReleaseCommand->protocolIEs.list.count; ieIdx++)
+ {
+ if(ueContextReleaseCommand->protocolIEs.list.array[ieIdx])
+ {
+ switch(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+ {
+ gnbCuUeF1apId= ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->\
+ value.choice.GNB_CU_UE_F1AP_ID;
+ break;
+ }
+
+ case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+ {
+ gnbDuUeF1apId = ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->\
+ value.choice.GNB_DU_UE_F1AP_ID;
+ break;
+ }
+
+ case ProtocolIE_ID_id_Cause:
+ {
+ break;
+ }
+
+ case ProtocolIE_ID_id_RRCContainer:
+ {
+ for(cellIdx = 0; cellIdx < duCb.numActvCells; cellIdx++)
+ {
+ for(ueIdx = 0; ueIdx < duCb.numUe; ueIdx++)
+ {
+ if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
+ (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
+ {
+ duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
+ DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
+ if(duUeCb->f1UeDb)
+ {
+ memset(duUeCb->f1UeDb, 0, sizeof(F1UeContextSetupDb));
+ duUeCb->f1UeDb->actionType = UE_CTXT_RELEASE;
+ duUeCb->f1UeDb->cellIdx = cellIdx;
+ /* Filling Dl RRC Msg Info */
+ DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
+ if(!duUeCb->f1UeDb->dlRrcMsg)
+ {
+ DU_LOG("\nERROR --> DU APP : procF1UeContextReleaseCommand(): \
+ Memory allocation failed ");
+ ret = RFAILED;
+ }
+ else
+ {
+ duUeCb->f1UeDb->dlRrcMsgPres = true;
+ memset(duUeCb->f1UeDb->dlRrcMsg, 0, sizeof(F1DlRrcMsg));
+ ret = extractDlRrcMsg(gnbDuUeF1apId, gnbCuUeF1apId, duUeCb->f1UeDb->dlRrcMsg,\
+ &ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->\
+ value.choice.RRCContainer);
+ }
+
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : procF1UeContextReleaseCommand(): \
+ Memory allocation failed ");
+ ret = RFAILED;
+
+ }
+
+ ueIdxFound = true;
+ break;
+ }
+ }
+ if(ueIdxFound == true)
+ {
+ break;
+ }
+ }
+ if(!ueIdxFound)
+ {
+ DU_LOG("\nERROR --> F1AP: DuUeCb is not found at procF1UeContextSetupReq()");
+ ret = RFAILED;
+ }
+
+
+ break;
+ }
+ default :
+ DU_LOG("\nERROR --> F1AP: freeAperDecodeUeContextReleaseCommand():Invalid IE Received: %ld"\
+ ,ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id);
+ break;
+ }
+ }
+ }
+ }
+ if(ret != RFAILED)
+ {
+ duProcUeContextReleaseCommand(duUeCb);
+ }
freeAperDecodeUeContextReleaseCommand(f1apMsg);
- return ROK;
+ return ret;
}
/**************************************************************
*
uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb ueCb, uint8_t lcId, uint16_t msgLen, uint8_t *rrcMsg);
uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfg, void *cellGrp);
void freeUeReCfgCellGrpInfo(MacUeCfg *macUeCfg);
-uint8_t BuildAndSendUeCtxtRsp(uint8_t ueIdx, uint8_t cellId);
+uint8_t BuildAndSendUeCtxtRsp(uint8_t cellId, uint8_t ueIdx);
uint8_t getDrbLcId(uint32_t *drbBitMap);
void freeMacLcCfg(LcCfg *lcCfg);
void freeRlcLcCfg(RlcBearerCfg *lcCfg);
int8_t getReAsmblTmr(uint8_t reAsmblTmrCfg);
int16_t getStatProhTmr(uint8_t statProhTmrCfg);
uint8_t duProcUeContextModReq(DuUeCb *ueCb);
-uint8_t BuildAndSendUeContextModResp(uint8_t ueIdx, uint8_t cellId);
+uint8_t BuildAndSendUeContextModRsp(uint8_t cellId,uint8_t ueIdx);
uint8_t duBuildAndSendUeContextModReq(uint16_t cellId, uint16_t crnti, DuUeCfg *duUeCfg);
uint8_t BuildAndSendUeContextReleaseReq(uint16_t cellId, uint8_t ueIdx);
-uint8_t BuildAndSendUeContextReleaseComplete(uint32_t gnbCuUeF1apId, uint32_t gnbDuUeF1apId);
+uint8_t BuildAndSendUeContextReleaseComplete(uint16_t cellId, uint32_t gnbCuUeF1apId, uint32_t gnbDuUeF1apId);
+uint8_t duSendCellDeletReq(uint16_t cellId);
+uint8_t duProcUeContextReleaseCommand(DuUeCb *duUeCb);
/**********************************************************************
End of file
**********************************************************************/
{
UE_CTXT_UNKNOWN,
UE_CTXT_SETUP,
- UE_CTXT_MOD
+ UE_CTXT_MOD,
+ UE_CTXT_RELEASE
}UeCtxtActionType;
/** F1AP Msg IE **/
uint8_t duSendEgtpDatInd(Buffer *mBuf);
uint8_t duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm);
uint8_t duBuildAndSendMacCellStart();
-uint8_t duBuildAndSendMacCellStop();
+uint8_t duBuildAndSendMacCellStop(uint16_t cellId);
#endif
/**********************************************************************
for(idx=0; idx< DEFAULT_CELLS; idx++)
{
DuCellCb *cell = NULLP;
- DU_ALLOC(cell, sizeof(DuCellCb))
+ DU_ALLOC(cell, sizeof(DuCellCb));
if(cell == NULLP)
{
- DU_LOG("\nERROR --> DU_APP : Memory Allocation failed in duProcCfgComplete");
- ret = RFAILED;
+ DU_LOG("\nERROR --> DU_APP : Memory Allocation failed in duProcCfgComplete");
+ ret = RFAILED;
}
else
{
- uint8_t idx1=0;
- memset(cell, 0, sizeof(DuCellCb));
- cell->cellId = ++cellId;
- memset(&cell->cellInfo.nrEcgi.plmn, 0, sizeof(Plmn));
- cell->cellInfo.nrEcgi.plmn.mcc[0] = PLMN_MCC0;
- cell->cellInfo.nrEcgi.plmn.mcc[1] = PLMN_MCC1;
- cell->cellInfo.nrEcgi.plmn.mcc[2] = PLMN_MCC2;
- cell->cellInfo.nrEcgi.plmn.mnc[0] = PLMN_MNC0;
- cell->cellInfo.nrEcgi.plmn.mnc[1] = PLMN_MNC1;
- cell->cellInfo.nrEcgi.cellId = NR_CELL_ID;
- cell->cellInfo.nrPci = NR_PCI;
- cell->cellInfo.fiveGsTac = DU_TAC;
- memset(&cell->cellInfo.plmn[idx1], 0, sizeof(Plmn));
- for(idx1=0; idx1<MAX_PLMN; idx1++)
- {
- cell->cellInfo.plmn[idx1].mcc[0] = PLMN_MCC0;
- cell->cellInfo.plmn[idx1].mcc[1] = PLMN_MCC1;
- cell->cellInfo.plmn[idx1].mcc[2] = PLMN_MCC2;
- cell->cellInfo.plmn[idx1].mnc[0] = PLMN_MNC0;
- cell->cellInfo.plmn[idx1].mnc[1] = PLMN_MNC1;
- }
- cell->cellInfo.maxUe = duCfgParam.maxUe;
- cell->cellStatus = CELL_OUT_OF_SERVICE;
-
- duCb.cfgCellLst[duCb.numCfgCells] = cell;
- duCb.numCfgCells++;
+ uint8_t idx1=0;
+ memset(cell, 0, sizeof(DuCellCb));
+ cell->cellId = ++cellId;
+ memset(&cell->cellInfo.nrEcgi.plmn, 0, sizeof(Plmn));
+ cell->cellInfo.nrEcgi.plmn.mcc[0] = PLMN_MCC0;
+ cell->cellInfo.nrEcgi.plmn.mcc[1] = PLMN_MCC1;
+ cell->cellInfo.nrEcgi.plmn.mcc[2] = PLMN_MCC2;
+ cell->cellInfo.nrEcgi.plmn.mnc[0] = PLMN_MNC0;
+ cell->cellInfo.nrEcgi.plmn.mnc[1] = PLMN_MNC1;
+ cell->cellInfo.nrEcgi.cellId = NR_CELL_ID;
+ cell->cellInfo.nrPci = NR_PCI;
+ cell->cellInfo.fiveGsTac = DU_TAC;
+ memset(&cell->cellInfo.plmn[idx1], 0, sizeof(Plmn));
+ for(idx1=0; idx1<MAX_PLMN; idx1++)
+ {
+ cell->cellInfo.plmn[idx1].mcc[0] = PLMN_MCC0;
+ cell->cellInfo.plmn[idx1].mcc[1] = PLMN_MCC1;
+ cell->cellInfo.plmn[idx1].mcc[2] = PLMN_MCC2;
+ cell->cellInfo.plmn[idx1].mnc[0] = PLMN_MNC0;
+ cell->cellInfo.plmn[idx1].mnc[1] = PLMN_MNC1;
+ }
+ cell->cellInfo.maxUe = duCfgParam.maxUe;
+ cell->cellStatus = CELL_OUT_OF_SERVICE;
+ gCellStatus = CELL_DOWN;
+
+ duCb.cfgCellLst[duCb.numCfgCells] = cell;
+ duCb.numCfgCells++;
}
}
if(ret != RFAILED)
* RFAILED - failure
*
* ****************************************************************/
-uint8_t duBuildAndSendMacCellStop()
+uint8_t duBuildAndSendMacCellStop(uint16_t cellId)
{
Pst pst;
- OduCellId *cellId = NULL;
-
+ uint16_t cellIdx=0;
+ OduCellId *oduCellId = NULL;
+
DU_LOG("\nINFO --> DU APP : Building and Sending cell stop request to MAC");
- /* Send Cell Stop Request to MAC */
- DU_ALLOC_SHRABL_BUF(cellId, sizeof(OduCellId));
- if(!cellId)
+ GET_CELL_IDX(cellId, cellIdx);
+ if(duCb.actvCellLst[cellIdx] != NULLP)
{
- DU_LOG("\nERROR --> DU APP : Memory alloc failed while building cell stop request");
- return RFAILED;
- }
- cellId->cellId = duCb.actvCellLst[0]->cellId;
+ /* Send Cell Stop Request to MAC */
+ DU_ALLOC_SHRABL_BUF(oduCellId, sizeof(OduCellId));
+ if(!oduCellId)
+ {
+ DU_LOG("\nERROR --> DU APP : duBuildAndSendMacCellStop(): Memory allocation failed ");
+ return RFAILED;
+ }
- /* Fill Pst */
- FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_STOP);
+ oduCellId->cellId = duCb.actvCellLst[cellIdx]->cellId;
- return (*packMacCellStopOpts[pst.selector])(&pst, cellId);
+ /* Fill Pst */
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_STOP);
+
+ return (*packMacCellStopOpts[pst.selector])(&pst, oduCellId);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : duBuildAndSendMacCellStop(): cellId[%d] doesnot exists", cellId);
+ return RFAILED;
+ }
+ return ROK;
}
/*******************************************************************
macUeCfg.macUeCfgState = UE_RECFG_COMPLETE;
if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
{
- BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
+ BuildAndSendUeCtxtRsp(cfgRsp->cellId, cfgRsp->ueIdx);
}
}
}
rlcUeCfg.rlcUeCfgState = UE_RECFG_COMPLETE;
if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
{
- BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
+ BuildAndSendUeCtxtRsp(cfgRsp->cellId, cfgRsp->ueIdx);
}
}
}
if(ret == RFAILED)
DU_LOG("\nERROR --> DU APP : Failed to process UE Context Mod Request in DuProcRlcDlRrcMsgRsp()");
}
+ if(ueCb->f1UeDb->actionType == UE_CTXT_RELEASE)
+ {
+ ret = duBuildAndSendUeDeleteReq(dlRrcMsg->cellId);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to process UE Context Release Request in DuProcRlcDlRrcMsgRsp()");
+ }
+
+ }
}
}
else
}
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);
+ DU_LOG("\nERROR --> DU APP : deleteUeCfg(): CellIdx[%d] is not found", cellIdx);
return RFAILED;
}
return ROK;
uint8_t DuProcMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp)
{
- uint8_t ueIdx = 0,ret =ROK;
+ uint8_t 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);
+ DU_LOG("\nINFO --> DU APP : MAC UE Delete Response : SUCCESS [UE IDX : %d]", deleteRsp->ueId);
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)
+ duCb.actvCellLst[cellIdx]->ueCb[deleteRsp->ueId -1].macUeCfg.macUeCfgState = UE_DELETE_COMPLETE;
+ if(sendUeDeleteReqToRlc(deleteRsp->cellId, deleteRsp->ueId) == RFAILED)
{
- ret = BuildAndSendUeContextReleaseComplete(gnbCuUeF1apId, gnbDuUeF1apId);
- if(ret !=ROK)
- {
- DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp(): failed to send UE context release complete");
- }
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp():Failed to build UE delete req for RLC ");
+ ret = RFAILED;
}
}
}
else
{
DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp(): MAC UE Delete Response : FAILURE [UE IDX : %d]",\
- deleteRsp->ueIdx);
+ deleteRsp->ueId);
ret = RFAILED;
}
DU_FREE_SHRABL_BUF(pst->region, pst->pool, deleteRsp, sizeof(MacUeDeleteRsp));
uint8_t DuProcRlcUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *delRsp)
{
- uint8_t ueIdx = 0, ret = ROK;
+ uint8_t ueId = 0, ret = ROK;
uint16_t cellIdx = 0;
uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId =0;
if(delRsp)
{
- ueIdx = delRsp->ueIdx;
+ ueId = delRsp->ueId;
GET_CELL_IDX(delRsp->cellId, cellIdx);
if(delRsp->result == SUCCESSFUL)
{
- DU_LOG("\nINFO --> DU_APP: RLC UE Delete Response : SUCCESS [UE IDX:%d]", ueIdx);
+ DU_LOG("\nINFO --> DU_APP: RLC UE Delete Response : SUCCESS [UE IDX:%d]", ueId);
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)
+ duCb.actvCellLst[cellIdx]->ueCb[ueId-1].rlcUeCfg.rlcUeCfgState = UE_DELETE_COMPLETE;
+ gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueId-1].gnbDuUeF1apId;
+ gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueId-1].gnbCuUeF1apId;
+ if(deleteUeCfg(cellIdx, ueId) == ROK)
{
- ret = BuildAndSendUeContextReleaseComplete(gnbCuUeF1apId, gnbDuUeF1apId);
- if(ret != ROK)
- {
- DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp(): failed to send UE context release complete");
- }
+ ret = BuildAndSendUeContextReleaseComplete(delRsp->cellId, 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);
+ DU_LOG("\nERROR --> DU_APP: RLC UE Delete Response : FAILED [UE IDX:%d]", ueId);
ret = RFAILED;
}
DU_FREE_SHRABL_BUF(pst->region, pst->pool, delRsp, sizeof(RlcUeDeleteRsp));
* Functionality:
* sending UE Delete Req To Mac
*
-* @params[in] cellId, ueIdx, crnti
+* @params[in] cellId, ueId, crnti
* @return ROK - success
* RFAILED - failure
*
*****************************************************************/
-uint8_t sendUeDeleteReqToMac(uint16_t cellId, uint8_t ueIdx, uint16_t crnti)
+uint8_t sendUeDeleteReqToMac(uint16_t cellId, uint8_t ueId, uint16_t crnti)
{
Pst pst;
uint8_t ret=ROK;
if(ueDelete)
{
ueDelete->cellId = cellId;
- ueDelete->ueIdx = ueIdx;
+ ueDelete->ueId = ueId;
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)
* Functionality:
* Sending UE Delete Req To Rlc
*
- * @params[in] cellId, ueIdx
+ * @params[in] cellId, ueId
* @return ROK - success
* RFAILED - failure
*
*****************************************************************/
-uint8_t sendUeDeleteReqToRlc(uint16_t cellId, uint8_t ueIdx)
+uint8_t sendUeDeleteReqToRlc(uint16_t cellId, uint8_t ueId)
{
uint8_t ret;
Pst pst;
if(ueDelete !=NULLP)
{
ueDelete->cellId = cellId;
- ueDelete->ueIdx = ueIdx;
+ ueDelete->ueId = ueId;
FILL_PST_DUAPP_TO_RLC(pst, RLC_UL_INST, EVENT_RLC_UE_DELETE_REQ);
ret = (*packRlcUeDeleteReqOpts[pst.selector])(&pst, ueDelete);
*
* @details
*
- * Function : duProcUeDeleteReq
+ * Function : duBuildAndSendUeDeleteReq
*
* Functionality: DU processes UE delete req from CU and sends to MAC
* and RLC
*
* ****************************************************************/
-uint8_t duProcUeDeleteReq(uint16_t cellId)
+uint8_t duBuildAndSendUeDeleteReq(uint16_t cellId)
{
uint8_t ueIdx = 0, ueId =0;
uint16_t cellIdx = 0, crnti = 0;
- DU_LOG("\nDEBUG --> DU_APP: Processing UE Delete Request ");
+ 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);
+ crnti = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].crnti;
+ GET_UE_IDX(crnti,ueId);
if(sendUeDeleteReqToMac(cellId, ueId, crnti) == RFAILED)
{
- DU_LOG("\nERROR --> DU APP : duProcUeDeleteReq(): Failed to build UE delete req for MAC ");
+ DU_LOG("\nERROR --> DU APP : duBuildAndSendUeDeleteReq(): Failed to build UE delete req for MAC ");
return RFAILED;
}
}
}
else
{
- DU_LOG("\nERROR --> DU APP : duProcUeDeleteReq(): Cell Id is not found");
+ DU_LOG("\nERROR --> DU APP : duBuildAndSendUeDeleteReq(): Cell Id is not found");
return RFAILED;
}
if(duCb.actvCellLst[cellIdx]->cellId == deleteRsp->cellId)
{
deleteDuCellCb(duCb.actvCellLst[cellIdx]);
+ gCellStatus = CELL_DOWN;
duCb.numActvCells--;
DU_FREE(duCb.actvCellLst[cellIdx], sizeof(DuCellCb));
}
[CELL IDX : %d]", deleteRsp->cellId);
ret = RFAILED;
}
- DU_FREE_SHRABL_BUF(pst->region, pst->pool, deleteRsp, sizeof(MacUeDeleteRsp));
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool, deleteRsp, sizeof(MacCellDeleteRsp));
}
else
{
*
* @details
*
- * Function : duProcCellDeleteReq
+ * Function : duSendCellDeletReq
*
* Functionality: DU process Cell Delete Req to MAC
*
*
* ****************************************************************/
-uint8_t duProcCellDeleteReq(uint16_t cellId)
+uint8_t duSendCellDeletReq(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(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;
- }
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): CellId[%d] is not found", cellId);
+ return RFAILED;
}
- else
+
+ if(duCb.actvCellLst[cellIdx]->cellId != cellId)
+ {
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): CellId[%d] is not found", cellId);
+ return RFAILED;
+
+ }
+
+ if(duCb.actvCellLst[cellIdx]->cellStatus != DELETION_IN_PROGRESS)
+ {
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): CellStatus[%d] of cellId[%d] is not correct.\
+ Expected CellStatus is DELETION_IN_PROGRESS",duCb.actvCellLst[cellIdx]->cellStatus, cellId);
+ return RFAILED;
+ }
+
+ if(duCb.actvCellLst[cellIdx]->numActvUes)
+ {
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): Active UEs still present in cellId[%d].\
+ Failed to delete cell", cellId);
+ return RFAILED;
+ }
+
+ if(duBuildAndSendMacCellStop(cellId) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): Failed to build and send cell stop request to MAC for\
+ cellId[%d]",cellId);
+ return RFAILED;
+ }
+
+ if(sendCellDeleteReqToMac(cellId) == RFAILED)
{
- DU_LOG("\nERROR --> DU APP : duProcCellDeleteReq(): CellId[%d] is not found", cellId);
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): Failed to send Cell delete req to MAC for\
+ cellId[%d]",cellId);
return RFAILED;
}
return ROK;
}
+/*******************************************************************
+*
+* @brief Du process Ue Context Release Command
+*
+* @details
+*
+* Function : duProcUeContextReleaseCommand
+*
+* Functionality: Du process Ue Context Release Command
+*
+* @params[in] DuUeCb *duUeCb
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t duProcUeContextReleaseCommand(DuUeCb *duUeCb)
+{
+ uint8_t ret =ROK, ueIdx=0;
+ uint16_t cellId=0;
+ if(duUeCb == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand() : duUeCb is null");
+ return RFAILED;
+ }
+ if(duUeCb->f1UeDb == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand() : f1UeDb is null");
+ return RFAILED;
+ }
+
+ cellId = duCb.actvCellLst[duUeCb->f1UeDb->cellIdx]->cellId;
+ /* Send DL RRC msg for RRC release */
+ if(duUeCb->f1UeDb->dlRrcMsg)
+ {
+ if(duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu != NULLP)
+ {
+ ret = duBuildAndSendDlRrcMsgToRlc(cellId, duCb.actvCellLst[duUeCb->f1UeDb->cellIdx]->ueCb[ueIdx].rlcUeCfg,\
+ duUeCb->f1UeDb->dlRrcMsg);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand() : Failed to send DL RRC msg");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu,\
+ duUeCb->f1UeDb->dlRrcMsg->rrcMsgSize);
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, duUeCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
+ }
+ }
+ }
+ else
+ {
+ ret = duBuildAndSendUeDeleteReq(cellId);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand(): Failed to build and send Ue Delete request");
+ }
+ }
+ return ret;
+}
/**********************************************************************
End of file
uint8_t duBuildAndSendUeCreateReqToRlc(uint16_t cellId, uint8_t ueIdx, RlcUeCfg *duRlcUeCfg);
uint8_t duCreateUeCb(UeCcchCtxt *ueCcchCtxt, uint32_t gnbCuUeF1apId);
uint8_t duProcUlCcchInd(UlCcchIndInfo *ulCcchIndInfo);
-uint8_t duProcUeDeleteReq(uint16_t cellId);
+uint8_t duBuildAndSendUeDeleteReq(uint16_t cellId);
void deleteRlcUeCfg(RlcUeCfg *ueCfg);
void freeF1UeDb(F1UeContextSetupDb *f1UeDb);
+uint8_t sendUeDeleteReqToMac(uint16_t cellId, uint8_t ueId, uint16_t crnti);
+uint8_t sendUeDeleteReqToRlc(uint16_t cellId, uint8_t ueId);
#endif
/**********************************************************************