PLTFRM_FLAGS+=-DSS_USE_WLS_MEM -DINTEL_WLS_MEM -DDEBUG_MODE
ifeq ($(PHY_MODE),TIMER)
PLTFRM_FLAGS+=-DINTEL_TIMER_MODE
-else
- #TODO: Remove below flag for testing RACH.indication onward
- PLTFRM_FLAGS+=-DTEMP_INTG_FLAG
endif
endif
D. How to Clean and Build:
--------------------------
-1. Building ODU binary:
+1. Build commands:
+ a. odu - Builds all components of ODU
+ b. cu_stub - Builds all CU Stub
+ c. ric_stub - Builds all RIC_Stub
+ d. clean_odu - clean up ODU
+ e. clean_cu - clean up CU Stub
+ f. clean_ric - clean up RIC Stub
+ g. clean_all - cleanup everything
+ h. options:
+ i. MACHINE=BIT64/BIT32 - Specify underlying machine type. Default is BIT32
+ ii. NODE=TEST_STUB - Specify if it is a test node. Mandatory for cu_stub/ric_stub. Must not be used for odu
+ iii. MODE=FDD/TDD - Specify duplex mode. Default is FDD
+ iv. PHY=INTEL_L1 - Specify type of phy. If not specified, PHY stub is used
+ v. PHY_MODE=TIMER - Specify mode of phy. Used only if PHY=INTEL_L1. Default is radio mode
+ vi. O1_ENABLE=YES - Specify if O1 interface is enabled. If not specified, it is disabled
+
+2. Building ODU binary:
a. Build folder
cd l2/build/odu
b. Building ODU binary
- make odu MACHINE=BIT64 MODE=FDD
+ make odu MACHINE=<refer section D.1.h> MODE=<refer section D.1.h>
c. Cleaning ODU binary
- make clean_odu MACHINE=BIT64 MODE=FDD
+ make clean_odu MACHINE=<refer section D.1.h> MODE=<refer section D.1.h>
-2. Building CU Stub binary:
+3. Building CU Stub binary:
a. Build folder
cd l2/build/odu
b. Building CU Stub binary
- make cu_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
+ make cu_stub NODE=<refer section D.1.h> MACHINE=<refer section D.1.h> MODE=<refer section D.1.h>
c. Cleaning CU Stub binary
- make clean_cu NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
+ make clean_cu NODE=<refer section D.1.h> MACHINE=<refer section D.1.h> MODE=<refer section D.1.h>
-3. Building RIC Stub binary:
+4. Building RIC Stub binary:
a. Build folder
cd l2/build/odu
b. Building RIC Stub binary
- make ric_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
+ make ric_stub NODE=<refer section D.1.h> MACHINE=<refer section D.1.h> MODE=<refer section D.1.h>
c. Cleaning RIC Stub binary
- make clean_ric NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
+ make clean_ric NODE=<refer section D.1.h> MACHINE=<refer section D.1.h> MODE=<refer section D.1.h>
-4. Cleaning ODU, CU Stub and RIC Stub:
+5. Cleaning ODU, CU Stub and RIC Stub:
make clean_all
a. Build folder
cd l2/build/odu
b. Building ODU binary
- make odu MACHINE=BIT64 MODE=FDD O1_ENABLE=YES
+ make odu MACHINE=<refer section D.1.h> MODE=<refer section D.1.h> O1_ENABLE=<refer section D.1.h>
c. Cleaning ODU binary
- make clean_odu MACHINE=BIT64 MODE=FDD O1_ENABLE=YES
+ make clean_odu MACHINE=<refer section D.1.h> MODE=<refer section D.1.h> O1_ENABLE=<refer section D.1.h>
2. Building CU Stub binary:
a. Build folder
cd l2/build/odu
b. Building CU Stub binary
- make cu_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD O1_ENABLE=YES
+ make cu_stub NODE=<refer section D.1.h> MACHINE=<refer section D.1.h> MODE=<refer section D.1.h> O1_ENABLE=<refer section D.1.h>
c. Cleaning CU Stub binary
- make clean_cu NODE=TEST_STUB MACHINE=BIT64 MODE=FDD O1_ENABLE=YES
+ make clean_cu NODE=<refer section D.1.h> MACHINE=<refer section D.1.h> MODE=<refer section D.1.h> O1_ENABLE=<refer section D.1.h>
3. Building RIC Stub binary:
a. Build folder
cd l2/build/odu
b. Building RIC Stub binary
- make ric_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD O1_ENABLE=YES
+ make ric_stub NODE=<refer section D.1.h> MACHINE=<refer section D.1.h> MODE=<refer section D.1.h> O1_ENABLE=<refer section D.1.h>
c. Cleaning RIC Stub binary
- make clean_ric NODE=TEST_STUB MACHINE=BIT64 MODE=FDD O1_ENABLE=YES
+ make clean_ric NODE=<refer section D.1.h> MACHINE=<refer section D.1.h> MODE=<refer section D.1.h> O1_ENABLE=<refer section D.1.h>
4. Cleaning ODU, CU Stub and RIC Stub:
make clean_all
c. Build folder
cd l2/build/odu
d. Build ODU Binary:
- make odu PHY=INTEL_L1 PHY_MODE=TIMER MACHINE=BIT64 MODE=FDD
+ make odu PHY=<refer section D.1.h> PHY_MODE=<refer section D.1.h> MACHINE=<refer section D.1.h> MODE=<refer section D.1.h>
2. Build CU Stub and RIC Stub:
- a. Execute steps in sections D.2 and D.3.
+ a. Execute steps in sections D.3 and D.4
II. Execution
- 1. Execute L1:
+ 1. Refer to below link for assumptions, dependencies, pre-requisites etc for ODU-Low execution
+ https://docs.o-ran-sc.org/projects/o-ran-sc-o-du-phy/en/latest/
+
+ 2. Execute L1:
a. Setup environment:
cd <intel_directory>/phy/
source ./setupenv.sh
b. Run L1 binary :
cd <intel_directory>/FlexRAN/l1/bin/nr5g/gnb/l1
- To run in timer mode : ./l1.sh -e
+ To run
+ i. In timer mode : ./l1.sh -e
+ ii. In radio mode : ./l1.sh -xran
L1 is up when console prints follow:
Non BBU threads in application
PHY>welcome to application console
- 2. Execute FAPI Translator:
+ 3. Execute FAPI Translator:
a. Setup environment:
cd <intel_directory>/phy/
source ./setupenv.sh
cd <intel_directory>/phy/fapi_5g/bin/
./oran_5g_fapi --cfg=oran_5g_fapi.cfg
- 3. Execute CU Stub and RIC Stub:
+ 4. Execute CU Stub and RIC Stub:
a. Run steps in sections E.1-E.3
- 4. Execute DU:
+ 5. Execute DU:
a. DU execution folder
cd l2/bin/odu
b. Export WLS library path
* ****************************************************************/
uint8_t procRachInd(fapi_rach_indication_t *fapiRachInd)
{
-/* TODO : Remove the following #ifndef TEMP_INTG_FLAG, when testing
- * RACH.indication in radio mode integration */
-#ifndef TEMP_INTG_FLAG
Pst pst;
uint8_t pduIdx;
uint8_t prmbleIdx;
MAC_ALLOC_SHRABL_BUF(rachInd, sizeof(RachInd));
if(!rachInd)
{
- DU_LOG("\nERROR --> LWR_MAC: Memory Allocation failed in procRachInd");
+ DU_LOG("\nERROR --> LWR_MAC : Memory Allocation failed in procRachInd");
return RFAILED;
}
+ if(!fapiRachInd->numPdus)
+ {
+ DU_LOG("\nDEBUG --> LWR_MAC : No PDU in RACH.indication at [%d, %d]", fapiRachInd->sfn, fapiRachInd->slot);
+ return ROK;
+ }
rachInd->cellId = lwrMacCb.cellCb[0].cellId;
rachInd->timingInfo.sfn = fapiRachInd->sfn;
/* Fill post and sent to MAC */
FILL_PST_LWR_MAC_TO_MAC(pst, EVENT_RACH_IND_TO_MAC);
return (*sendRachIndOpts[pst.selector])(&pst, rachInd);
-#else
- return ROK;
-#endif
}/* handleRachInd */
/*******************************************************************
MAC_ALLOC_SHRABL_BUF(crcInd, sizeof(CrcInd));
if(!crcInd)
{
- DU_LOG("\nERROR --> LWR_MAC: Memory Allocation failed in procCrcInd");
+ DU_LOG("\nERROR --> LWR_MAC : Memory Allocation failed in procCrcInd");
return RFAILED;
}
+ if(!fapiCrcInd->numCrcs)
+ {
+ DU_LOG("\nDEBUG --> LWR_MAC : No CRC PDUs in CRC.indication at [%d, %d]", fapiCrcInd->sfn, fapiCrcInd->slot);
+ return ROK;
+ }
crcInd->cellId = lwrMacCb.cellCb[0].cellId;
crcInd->timingInfo.sfn = fapiCrcInd->sfn;
MAC_ALLOC_SHRABL_BUF(rxDataInd, sizeof(RxDataInd));
if(!rxDataInd)
{
- DU_LOG("\nERROR --> LWR_MAC: Memory Allocation failed in procRxDataInd");
+ DU_LOG("\nERROR --> LWR_MAC : Memory Allocation failed in procRxDataInd");
return RFAILED;
}
+ if(!fapiRxDataInd->numPdus)
+ {
+ DU_LOG("\nDEBUG --> LWR_MAC : No PDU in RX_Data.indication at [%d, %d]", fapiRxDataInd->sfn, fapiRxDataInd->slot);
+ return ROK;
+ }
rxDataInd->cellId = lwrMacCb.cellCb[0].cellId;
rxDataInd->timingInfo.sfn = fapiRxDataInd->sfn;
continue;
}
- DU_LOG("\nDEBUG --> LWR_MAC : numMsgToGet %d", numMsgToGet);
while(numMsgToGet--)
{
currElem = NULLP;
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, \
if(dlCcchIndInfo->msgType == RRC_SETUP)
{
dlBoInfo.lcId = SRB0_LCID; // SRB ID 0 for msg4
- dlBoInfo.dataVolume = dlCcchIndInfo->dlCcchMsgLen;
+ /* (MSG4 pdu + 3 bytes sub-header) + (Contention resolution id MAC CE + 1b byte sub-header) */
+ dlBoInfo.dataVolume = (dlCcchIndInfo->dlCcchMsgLen + 3) + (MAX_CRI_SIZE + 1);
/* storing Msg4 Pdu in raCb */
GET_UE_IDX(dlBoInfo.crnti, ueIdx);
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)
- {
- printf("\nHLAL Starting Throughput timer");
- 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;
schDlSlotInfo->dlMsgInfo->harqFeedbackInd = 0;
schDlSlotInfo->dlMsgInfo->dciFormatId = 1;
if(lcId == SRB0_LCID)
+ {
schDlSlotInfo->dlMsgInfo->isMsg4Pdu = true;
-
+ schDlSlotInfo->dlMsgInfo->dlMsgPduLen = dlBoInfo->dataVolume;
+ }
return ROK;
}
#define BO_DELTA 1
#define RAR_DELAY 2
#define MSG4_DELAY 1
+#define PDSCH_START_RB 10
#define PUSCH_START_RB 15
#define PUCCH_NUM_PRB_FORMAT_0_1_4 1 /* number of PRBs in freq domain, spec 38.213 - 9.2.1 */
#define SI_RNTI 0xFFFF
#define DMRS_ADDITIONAL_POS 0
#define SCH_DEFAULT_K1 1
#define SCH_TQ_SIZE 10
+#define SCH_RAR_PAYLOAD_SIZE 10 /* As per spec 38.321, sections 6.1.5 and 6.2.3, RAR PDU is 8 bytes long and 2 bytes of padding */
#define CRC_FAILED 0
#define CRC_PASSED 1
uint8_t schBroadcastAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc,uint16_t slot);
uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst inst);
uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst);
-uint8_t schDlRsrcAllocMsg4(DlMsgAlloc *msg4Alloc, SchCellCb *cell, uint16_t slot);
+uint8_t schDlRsrcAllocMsg4(DlMsgAlloc *msg4Alloc, SchCellCb *cell, uint16_t slot, bool ssbPresent, bool sib1Present);
uint16_t schCalcTbSize(uint32_t payLoadSize);
uint16_t schCalcNumPrb(uint16_t tbSize, uint16_t mcs, uint8_t numSymbols);
uint16_t schAllocPucchResource(SchCellCb *cell, uint16_t crnti, uint16_t slot);
uint8_t schDlRsrcAllocDlMsg(DlMsgAlloc *dlMsgAlloc, SchCellCb *cell, uint16_t crnti,
uint32_t *accumalatedSize, uint16_t slot);
uint16_t schAccumalateLcBoSize(SchCellCb *cell, uint16_t ueIdx);
+uint8_t schFillRar(RarAlloc *rarAlloc, uint16_t raRnti, uint16_t pci, uint8_t offsetPointA, bool ssbPresent, bool sib1Present);
/**********************************************************************
End of file
{
/* prach ocassion present in this subframe */
#ifdef NR_TDD
- if(UL_SLOT != schGetSlotSymbFrmt(prachOccasionTimingInfo.slot, cell->slotFrmtBitMap))
+ if(UL_SLOT != schGetSlotSymbFrmt(prachOccasionTimingInfo.slot%cell->numSlotsInPeriodicity,\
+ cell->slotFrmtBitMap))
{
DU_LOG("\nERROR --> SCH : PrachCfgIdx %d doesn't support UL slot", prachCfgIdx);
}
* RFAILED - failure
*
* ****************************************************************/
-uint8_t schDlRsrcAllocMsg4(DlMsgAlloc *msg4Alloc, SchCellCb *cell, uint16_t slot)
+uint8_t schDlRsrcAllocMsg4(DlMsgAlloc *msg4Alloc, SchCellCb *cell, uint16_t slot, bool ssbPresent, bool sib1Present)
{
uint8_t coreset0Idx = 0;
uint8_t numRbs = 0;
uint8_t offsetPointA;
uint8_t FreqDomainResource[6] = {0};
uint16_t tbSize = 0;
- uint8_t numPdschSymbols = 12; /* considering pdsch region from 2 to 13 */
- uint8_t mcs = 4; /* MCS fixed to 4 */
+ uint8_t numPdschSymbols = 11; /* considering pdsch region from 3 to 13 */
+ uint8_t mcs = 4; /* MCS fixed to 4 */
SchBwpDlCfg *initialBwp;
+ FreqDomainAlloc *sib1PdschFreqAlloc = NULL;
PdcchCfg *pdcch = &msg4Alloc->dlMsgPdcchCfg;
PdschCfg *pdsch = &msg4Alloc->dlMsgPdschCfg;
pdsch->codeword[cwCount].mcsIndex = mcs; /* mcs configured to 4 */
pdsch->codeword[cwCount].mcsTable = 0; /* notqam256 */
pdsch->codeword[cwCount].rvIndex = 0;
- /* 38.214: Table 5.1.3.2-1, divided by 8 to get the value in bytes */
- /* TODO : Calculate tbSize based of DL CCCH msg size */
- tbSize = schCalcTbSize(2664/8); /* send this value to the func in bytes when considering msg4 size */
+ tbSize = schCalcTbSize(msg4Alloc->dlMsgInfo.dlMsgPduLen + TX_PAYLOAD_HDR_LEN); /* MSG4 size + FAPI header size*/
pdsch->codeword[cwCount].tbSize = tbSize;
}
pdsch->dataScramblingId = cell->cellCfg.phyCellId;
pdsch->numLayers = 1;
pdsch->transmissionScheme = 0;
pdsch->refPoint = 0;
- pdsch->dmrs.dlDmrsSymbPos = 2;
+ pdsch->dmrs.dlDmrsSymbPos = 4; /* Bitmap value 00000000000100 i.e. using 3rd symbol for PDSCH DMRS */
pdsch->dmrs.dmrsConfigType = 0; /* type-1 */
pdsch->dmrs.dlDmrsScramblingId = cell->cellCfg.phyCellId;
pdsch->dmrs.scid = 0;
pdsch->dmrs.nrOfDmrsSymbols = NUM_DMRS_SYMBOLS;
pdsch->dmrs.dmrsAddPos = DMRS_ADDITIONAL_POS;
pdsch->pdschFreqAlloc.resourceAllocType = 1; /* RAT type-1 RIV format */
- /* the RB numbering starts from coreset0, and PDSCH is always above SSB */
- pdsch->pdschFreqAlloc.freqAlloc.startPrb = offset + SCH_SSB_NUM_PRB;
- pdsch->pdschFreqAlloc.freqAlloc.numPrb = schCalcNumPrb(tbSize,mcs,numPdschSymbols);
+ /* The RB numbering starts from coreset0 */
+ pdsch->pdschFreqAlloc.freqAlloc.startPrb = PDSCH_START_RB;
+ if(ssbPresent)
+ {
+ /* PDSCH is always above SSB */
+ pdsch->pdschFreqAlloc.freqAlloc.startPrb = offsetPointA + SCH_SSB_NUM_PRB + 1;
+ }
+ if(sib1Present)
+ {
+ /* Must not overlap with SIB1 */
+ sib1PdschFreqAlloc = &cell->cellCfg.sib1SchCfg.sib1PdschCfg.pdschFreqAlloc.freqAlloc;
+ pdsch->pdschFreqAlloc.freqAlloc.startPrb = sib1PdschFreqAlloc->startPrb + sib1PdschFreqAlloc->numPrb + 1;
+ }
+ pdsch->pdschFreqAlloc.freqAlloc.numPrb = schCalcNumPrb(tbSize, mcs, numPdschSymbols);
pdsch->pdschFreqAlloc.vrbPrbMapping = 0; /* non-interleaved */
- pdsch->pdschTimeAlloc.timeAlloc.startSymb = 2; /* spec-38.214, Table 5.1.2.1-1 */
- pdsch->pdschTimeAlloc.timeAlloc.numSymb = 12;
+ pdsch->pdschTimeAlloc.timeAlloc.startSymb = 3; /* spec-38.214, Table 5.1.2.1-1 */
+ pdsch->pdschTimeAlloc.timeAlloc.numSymb = numPdschSymbols;
pdsch->beamPdschInfo.numPrgs = 1;
pdsch->beamPdschInfo.prgSize = 1;
pdsch->beamPdschInfo.digBfInterfaces = 0;
{
uint8_t ueIdx;
uint16_t tbSize = 0;
- uint8_t numPdschSymbols = 12; /* considering pdsch region from 2 to 13 */
PdcchCfg *pdcch = NULLP;
PdschCfg *pdsch = NULLP;
BwpCfg *bwp = NULLP;
pdsch->codeword[cwCount].mcsIndex = ueCb.ueCfg.dlModInfo.mcsIndex;
pdsch->codeword[cwCount].mcsTable = ueCb.ueCfg.dlModInfo.mcsTable;
pdsch->codeword[cwCount].rvIndex = 0;
- tbSize = schCalcTbSize(*accumalatedSize);
+ tbSize = schCalcTbSize(*accumalatedSize + TX_PAYLOAD_HDR_LEN);
if(tbSize < *accumalatedSize)
*accumalatedSize = tbSize;
pdsch->codeword[cwCount].tbSize = tbSize;
pdsch->numLayers = 1;
pdsch->transmissionScheme = 0;
pdsch->refPoint = 0;
- pdsch->dmrs.dlDmrsSymbPos = 2;
+ pdsch->dmrs.dlDmrsSymbPos = 4; /* Bitmap value 00000000000100 i.e. using 3rd symbol for PDSCH DMRS */
pdsch->dmrs.dmrsConfigType = 0; /* type-1 */
pdsch->dmrs.dlDmrsScramblingId = cell->cellCfg.phyCellId;
pdsch->dmrs.scid = 0;
pdsch->dmrs.nrOfDmrsSymbols = NUM_DMRS_SYMBOLS;
pdsch->dmrs.dmrsAddPos = pdschCfg.dmrsDlCfgForPdschMapTypeA.addPos;
pdsch->pdschFreqAlloc.resourceAllocType = 1; /* RAT type-1 RIV format */
- pdsch->pdschFreqAlloc.freqAlloc.startPrb = 1;
- pdsch->pdschFreqAlloc.freqAlloc.numPrb = schCalcNumPrb(tbSize, ueCb.ueCfg.dlModInfo.mcsIndex, numPdschSymbols);
+ pdsch->pdschFreqAlloc.freqAlloc.startPrb = PDSCH_START_RB;
+ pdsch->pdschFreqAlloc.freqAlloc.numPrb = schCalcNumPrb(tbSize, ueCb.ueCfg.dlModInfo.mcsIndex, \
+ pdschCfg.timeDomRsrcAllociList[0].symbolLength);
pdsch->pdschFreqAlloc.vrbPrbMapping = 0; /* non-interleaved */
pdsch->pdschTimeAlloc.timeAlloc.startSymb = pdschCfg.timeDomRsrcAllociList[0].startSymbol;
pdsch->pdschTimeAlloc.timeAlloc.numSymb = pdschCfg.timeDomRsrcAllociList[0].symbolLength;
* @param[in] offset to pointA to determine freq alloc
* @return ROK
**/
-uint8_t schFillRar(RarAlloc *rarAlloc, uint16_t raRnti, uint16_t pci, uint8_t offsetPointA)
+uint8_t schFillRar(RarAlloc *rarAlloc, uint16_t raRnti, uint16_t pci, uint8_t offsetPointA, \
+bool ssbPresent, bool sib1Present)
{
Inst inst = 0;
uint8_t coreset0Idx = 0;
uint8_t offset = 0;
uint8_t FreqDomainResource[6] = {0};
uint16_t tbSize = 0;
- uint8_t numPdschSymbols = 12; /* considering pdsch region from 2 to 13 */
uint8_t mcs = 4; /* MCS fixed to 4 */
SchBwpDlCfg *initialBwp = &schCb[inst].cells[inst]->cellCfg.schInitialDlBwp;
-
PdcchCfg *pdcch = &rarAlloc->rarPdcchCfg;
PdschCfg *pdsch = &rarAlloc->rarPdschCfg;
BwpCfg *bwp = &rarAlloc->bwp;
+ FreqDomainAlloc *sib1PdschFreqAlloc = NULL;
coreset0Idx = initialBwp->pdcchCommon.commonSearchSpace.coresetId;
pdsch->codeword[cwCount].mcsIndex = mcs; /* mcs configured to 4 */
pdsch->codeword[cwCount].mcsTable = 0; /* notqam256 */
pdsch->codeword[cwCount].rvIndex = 0;
- tbSize = schCalcTbSize(10); /* 8 bytes RAR and 2 bytes padding */
+ /* RAR PDU length and FAPI payload header length */
+ tbSize = schCalcTbSize(SCH_RAR_PAYLOAD_SIZE + TX_PAYLOAD_HDR_LEN);
pdsch->codeword[cwCount].tbSize = tbSize;
}
pdsch->dataScramblingId = pci;
pdsch->numLayers = 1;
pdsch->transmissionScheme = 0;
pdsch->refPoint = 0;
- pdsch->dmrs.dlDmrsSymbPos = 2;
+ pdsch->dmrs.dlDmrsSymbPos = 4; /* Bitmap value 00000000000100 i.e. using 3rd symbol for PDSCH DMRS */
pdsch->dmrs.dmrsConfigType = 0; /* type-1 */
pdsch->dmrs.dlDmrsScramblingId = pci;
pdsch->dmrs.scid = 0;
pdsch->dmrs.nrOfDmrsSymbols = NUM_DMRS_SYMBOLS;
pdsch->dmrs.dmrsAddPos = DMRS_ADDITIONAL_POS;
pdsch->pdschFreqAlloc.resourceAllocType = 1; /* RAT type-1 RIV format */
- pdsch->pdschFreqAlloc.freqAlloc.startPrb = offset + SCH_SSB_NUM_PRB; /* the RB numbering starts from coreset0, and PDSCH is always above SSB */
- pdsch->pdschFreqAlloc.freqAlloc.numPrb = schCalcNumPrb(tbSize,mcs,numPdschSymbols);
+ /* The RB numbering starts from coreset0 */
+ pdsch->pdschFreqAlloc.freqAlloc.startPrb = PDSCH_START_RB;
+ if(ssbPresent)
+ {
+ /* PDSCH is always above SSB */
+ pdsch->pdschFreqAlloc.freqAlloc.startPrb = offsetPointA + SCH_SSB_NUM_PRB + 1;
+ }
+ if(sib1Present)
+ {
+ /* Must not overlap with SIB1 */
+ sib1PdschFreqAlloc = &schCb[inst].cells[inst]->cellCfg.sib1SchCfg.sib1PdschCfg.pdschFreqAlloc.freqAlloc;
+ pdsch->pdschFreqAlloc.freqAlloc.startPrb = sib1PdschFreqAlloc->startPrb + sib1PdschFreqAlloc->numPrb + 1;
+ }
+ pdsch->pdschFreqAlloc.freqAlloc.numPrb = schCalcNumPrb(tbSize, mcs, initialBwp->pdschCommon.lengthSymbol);
pdsch->pdschFreqAlloc.vrbPrbMapping = 0; /* non-interleaved */
pdsch->pdschTimeAlloc.timeAlloc.startSymb = initialBwp->pdschCommon.startSymbol;
pdsch->pdschTimeAlloc.timeAlloc.numSymb = initialBwp->pdschCommon.lengthSymbol;
};
SchCb schCb[SCH_MAX_INST];
-int schFillRar(RarAlloc *rarAlloc, uint16_t raRnti, uint16_t pci, uint8_t
- offsetPointA);
/*******************************************************************
*
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;
schFillRar(rarAlloc,
cell->schDlSlotInfo[slot]->rarInfo->raRnti,
cell->cellCfg.phyCellId,
- cell->cellCfg.ssbSchCfg.ssbOffsetPointA);
+ cell->cellCfg.ssbSchCfg.ssbOffsetPointA,
+ dlBrdcstAlloc->ssbTrans,
+ dlBrdcstAlloc->sib1Trans);
SCH_FREE(cell->schDlSlotInfo[slot]->rarInfo,sizeof(RarAlloc));
cell->schDlSlotInfo[slot]->rarInfo = NULLP;
sizeof(DlMsgInfo));
/* pdcch and pdsch data is filled */
- schDlRsrcAllocMsg4(msg4Alloc, cell, dlSchedInfo.schSlotValue.dlMsgTime.slot);
+ schDlRsrcAllocMsg4(msg4Alloc, cell, dlSchedInfo.schSlotValue.dlMsgTime.slot, dlBrdcstAlloc->ssbTrans, dlBrdcstAlloc->sib1Trans);
/* PUCCH resource */
schAllocPucchResource(cell, msg4Alloc->dlMsgInfo.crnti, dlSchedInfo.schSlotValue.dlMsgTime.slot);
uint16_t puschSlot = 0;
uint16_t startRb = 0;
uint8_t numRb = 0;
- uint8_t numPdschSymbols= 14;
uint16_t tbSize = 0;
uint8_t buffer = 5;
uint8_t idx = 0;
SchCellCb *cellCb = ueCb->cellCb;
SchUlSlotInfo *schUlSlotInfo = NULLP;
- uint8_t k2=0, startSymb=0 , symbLen=0;
+ uint8_t k2=0, startSymb=0 , symbLen=11;
if(ueCb->ueCfg.spCellCfgPres == true)
{
startRb = cellCb->schUlSlotInfo[puschSlot]->puschCurrentPrb;
tbSize = schCalcTbSize(dataVol + buffer); /* 2 bytes header + some buffer */
- numRb = schCalcNumPrb(tbSize, ueCb->ueCfg.ulModInfo.mcsIndex, numPdschSymbols);
+ numRb = schCalcNumPrb(tbSize, ueCb->ueCfg.ulModInfo.mcsIndex, symbLen);
/* increment PUSCH PRB */
cellCb->schUlSlotInfo[puschSlot]->puschCurrentPrb += numRb;
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;
* ****************************************************************/
uint8_t packRlcDlUserDataToRlc(Pst *pst, RlcDlUserDataInfo *dlUserData)
{
- Buffer *mBuf = NULLP;
-
if(pst->selector == ODU_SELECTOR_LWLC)
{
- if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
- {
- DU_LOG("\nERROR --> RLC DL: Memory allocation failed at packRlcDlUserDataToRlc");
- return RFAILED;
- }
/* pack the address of the structure */
- CMCHKPK(oduPackPointer,(PTR)dlUserData, mBuf);
- return ODU_POST_TASK(pst,mBuf);
+ CMCHKPK(oduPackPointer,(PTR)dlUserData, dlUserData->dlMsg);
+ return ODU_POST_TASK(pst,dlUserData->dlMsg);
}
else
{
RlcDlUserDataInfo *dlUserData;
/* unpack the address of the structure */
CMCHKUNPK(oduUnpackPointer, (PTR *)&dlUserData, mBuf);
- ODU_PUT_MSG_BUF(mBuf);
return (*func)(pst, dlUserData);
}
else
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;
timeDomAlloc->k0 = NULLP;
timeDomAlloc->mappingType = PDSCH_MAPPING_TYPE_A;
- timeDomAlloc->startSymbolAndLength = 53;
+ timeDomAlloc->startSymbolAndLength = 66;
return ROK;
}
}
*(timeDomAlloc->k2) = PUSCH_K2;
timeDomAlloc->mappingType = PUSCH_MAPPING_TYPE_A;
- timeDomAlloc->startSymbolAndLength = 27;
+ timeDomAlloc->startSymbolAndLength = 66;
return ROK;
}
{
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);
/* MACRO Ddefine for PDSCH Configuration */
#define PDSCH_K0 0
-#define PDSCH_START_SYMBOL 2
-#define PDSCH_LENGTH_SYMBOL 12
+#define PDSCH_START_SYMBOL 3
+#define PDSCH_LENGTH_SYMBOL 11
#define PDSCH_RES_ALLOC_TYPE 1 /* Resource allocation type */
#define PDSCH_MAX_CODEWORD_SCH_BY_DCI 0 /* Max num of codewords scheduled by DCI */
#define PDSCH_RBG_SIZE 0 /* 0: config1 */
/* MACRO Define for PUSCH Configuration */
#define PUSCH_K2 3
-#define PUSCH_START_SYMBOL 0
-#define PUSCH_LENGTH_SYMBOL 14
+#define PUSCH_START_SYMBOL 3
+#define PUSCH_LENGTH_SYMBOL 11
#define PUSCH_MSG3_DELTA_PREAMBLE 0
#define PUSCH_P0_NOMINAL_WITH_GRANT -70
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;
}
/*******************************************************************
return RFAILED;
}
memset(dlDataMsgInfo, 0, sizeof(RlcDlUserDataInfo));
- if(ODU_GET_MSG_BUF(DU_APP_MEM_REGION, DU_POOL, &dlDataMsgInfo->dlMsg) != ROK)
- {
- DU_LOG("\nERROR --> DU_APP : Memory allocation failed for dlMsg in duHdlEgtpDlData()");
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlDataMsgInfo, sizeof(RlcDlUserDataInfo));
- return RFAILED;
- }
dlDataMsgInfo->dlMsg = egtpMsg->msg;
dlDataMsgInfo->msgLen = msgLen;
*
* Functionality: Fills Sp Cell Group Info
*
- * @params[in] SpCellCfg *spCell
+ * @params[in] MacUeCfg *macUeCfg
* @return void
*
*****************************************************************/
-void fillDefaultSpCellGrpInfo(SpCellCfg *spCell)
+void fillDefaultSpCellGrpInfo(MacUeCfg *macUeCfg)
{
+ SpCellCfg *spCell = NULL;
+
+ if(macUeCfg)
+ spCell = &macUeCfg->spCellCfg;
+
if(spCell)
{
+ macUeCfg->spCellCfgPres = true;
+
spCell->servCellIdx = SERV_CELL_IDX;
/* Filling Initial Dl Bwp */
fillDefaultInitDlBwp(&spCell->servCellCfg.initDlBwp);
*
* Functionality: Fills Physical Cell Group Info
*
- * @params[in] PhyCellGrpCfg *cellGrp
+ * @params[in] MacUeCfg *macUeCfg
* @return void
*
*****************************************************************/
-void fillDefaultPhyCellGrpInfo(PhyCellGrpCfg *cellGrp)
+void fillDefaultPhyCellGrpInfo(MacUeCfg *macUeCfg)
{
+ PhyCellGrpCfg *cellGrp = NULL;
+
+ if(macUeCfg)
+ cellGrp = &macUeCfg->phyCellGrpCfg;
+
if(cellGrp)
{
+ macUeCfg->phyCellGrpCfgPres = true;
cellGrp->pdschHarqAckCodebook = PDSCH_HARQ_ACK_CODEBOOK_DYNAMIC;
cellGrp->pNrFr1 = P_NR_FR1;
}
*
* Functionality: Fills Mac Cell Group Info
*
- * @params[in] MacCellGrpCfg *cellGrp
+ * @params[in] MacUeCfg *macUeCfg
* @return void
*
*****************************************************************/
-void fillDefaultMacCellGrpInfo(MacCellGrpCfg *cellGrp)
+void fillDefaultMacCellGrpInfo(MacUeCfg *macUeCfg)
{
uint8_t idx;
+ MacCellGrpCfg *cellGrp = NULL;
+
+ if(macUeCfg)
+ cellGrp = &macUeCfg->macCellGrpCfg;
if(cellGrp)
{
+ macUeCfg->macCellGrpCfgPres = true;
+
/* Filling Scheduling Request Config */
cellGrp->schReqCfg.addModListCount = 1;
if(cellGrp->schReqCfg.addModListCount <= MAX_NUM_SR_CFG_PER_CELL_GRP)
macUeCfg->cellId = cellId;
macUeCfg->ueIdx = ueIdx;
macUeCfg->crnti = crnti;
- fillDefaultMacCellGrpInfo(&macUeCfg->macCellGrpCfg);
- fillDefaultPhyCellGrpInfo(&macUeCfg->phyCellGrpCfg);
- fillDefaultSpCellGrpInfo(&macUeCfg->spCellCfg);
+
+ fillDefaultMacCellGrpInfo(macUeCfg);
+ fillDefaultPhyCellGrpInfo(macUeCfg);
+ fillDefaultSpCellGrpInfo(macUeCfg);
macUeCfg->ambrCfg = NULLP;
- fillMacSrb1LcCfg(&macUeCfg->lcCfgList[0]);
fillDefaultModulation(macUeCfg);
+ fillMacSrb1LcCfg(&macUeCfg->lcCfgList[0]);
macUeCfg->numLcs++;
}
else
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 : duProcCellDeleteReq(): CellId[%d] is not found", 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 : 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
/**********************************************************************