* RFAILED - failure
*
* ****************************************************************/
-uint8_t MacSendCellDeleteRsp(CellDeleteStatus result, uint8_t cellId)
+uint8_t MacSendCellDeleteRsp(CauseOfResult status, uint8_t cellId)
{
MacCellDeleteRsp *deleteRsp=NULLP;
Pst rspPst;
memset(deleteRsp, 0, sizeof(MacCellDeleteRsp));
deleteRsp->cellId = cellId;
- deleteRsp->result = result;
+ deleteRsp->status = status;
/* Fill Post structure and send CELL delete response*/
memset(&rspPst, 0, sizeof(Pst));
{
uint8_t ret = ROK, sliceIdx = 0, plmnIdx = 0;
uint16_t cellIdx=0;
- CellDeleteStatus status;
+ CauseOfResult cause;
#ifdef CALL_FLOW_DEBUG_LOG
DU_LOG("\nCall Flow: ENTSCH -> ENTMAC : EVENT_CELL_DELETE_RSP_TO_MAC\n");
{
if(macCb.macCell[cellIdx]->cellId == schCellDelRsp->cellId)
{
- status = SUCCESSFUL_RSP;
+ cause = SUCCESSFUL;
for(plmnIdx = 0; plmnIdx < MAX_PLMN; plmnIdx++)
{
if(macCb.macCell[cellIdx]->macCellCfg.cellCfg.plmnInfoList[plmnIdx].snssai)
else
{
DU_LOG("ERROR --> MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
- status = CELL_ID_INVALID;
+ cause = CELLID_INVALID;
ret = RFAILED;
}
}
else
{
DU_LOG("ERROR --> MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
- status = CELL_ID_INVALID;
+ cause = CELLID_INVALID;
ret = RFAILED;
}
}
else
{
DU_LOG("ERROR --> MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
- status = CELL_ID_INVALID;
+ cause = CELLID_INVALID;
ret = RFAILED;
}
- if(MacSendCellDeleteRsp(status, schCellDelRsp->cellId) != ROK)
+ if(MacSendCellDeleteRsp(cause, schCellDelRsp->cellId) != ROK)
{
DU_LOG("\nERROR --> MAC: MacProcSchCellDeleteRsp(): Failed to send CELL delete response");
ret = RFAILED;
if(ret == RFAILED)
{
DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): Sending failure response to DU");
- if(MacSendCellDeleteRsp(CELL_ID_INVALID, cellDelete->cellId) != ROK)
+ if(MacSendCellDeleteRsp(CELLID_INVALID, cellDelete->cellId) != ROK)
{
DU_LOG("\nERROR --> MAC : MacProcCellDeleteReq(): failed to send cell delete rsp for cellID[%d]",\
cellDelete->cellId);
unpackMacDlPcchInd(MacProcDlPcchInd, pst, mBuf);
break;
}
+ case EVENT_MAC_UE_RESET_REQ:
+ {
+ /* Process UE Reset Request */
+ unpackMacUeResetReq(MacProcUeResetReq, pst, mBuf);
+ break;
+ }
default:
RG_FREE_MSG(mBuf);
packDuMacUeDeleteRsp /* packing for light weight loosly coupled */
};
+MacDuUeResetRspFunc macDuUeResetRspOpts[] =
+{
+ packDuMacUeResetRsp, /* packing for loosely coupled */
+ DuProcMacUeResetRsp, /* packing for tightly coupled */
+ packDuMacUeResetRsp /* packing for light weight loosly coupled */
+};
/*******************************************************************
*
* @brief Fills mac cell group config to be sent to scheduler
*
* ****************************************************************/
-uint8_t MacSendUeDeleteRsp(uint16_t cellId, uint16_t crnti, UeDeleteStatus result)
+uint8_t MacSendUeDeleteRsp(uint16_t cellId, uint16_t crnti, CauseOfResult status)
{
MacUeDeleteRsp *deleteRsp;
Pst rspPst;
/* Filling UE delete response */
deleteRsp->cellId = cellId;
GET_UE_ID(crnti, deleteRsp->ueId);
- deleteRsp->result = result;
+ deleteRsp->status = status;
/* Fill Post structure and send UE delete response*/
memset(&rspPst, 0, sizeof(Pst));
uint8_t ueId =0, isCrntiValid = 0, tbIdx =0, idx=0;
uint16_t cellIdx=0;
uint8_t ret = RFAILED;
- UeDeleteStatus result;
+ CauseOfResult status;
DlHarqEnt *dlHarqEnt;
#ifdef CALL_FLOW_DEBUG_LOG
{
/*C-RNTI value is out of Acceptable range*/
DU_LOG("\nERROR --> MAC : MacProcSchUeDeleteRsp(): Invalid crnti[%d] ",schUeDelRsp->crnti);
- result = UEID_INVALID;
+ status = UEID_INVALID;
}
else
{
}
memset(&macCb.macCell[cellIdx]->ueCb[ueId -1], 0, sizeof(MacUeCb));
macCb.macCell[cellIdx]->numActvUe--;
- result = DEL_SUCCESSFUL;
+ status = SUCCESSFUL;
ret = ROK;
}
else
{
DU_LOG("\nERROR --> MAC : MacProcSchUeDeleteRsp(): crnti[%d] does not exist ",schUeDelRsp->crnti);
- result = UEID_INVALID;
+ status = UEID_INVALID;
}
}
}
else
{
DU_LOG("\nERROR --> MAC : MacProcSchUeDeleteRsp(): cellId[%d] does not exist ",schUeDelRsp->cellId);
- result = CELLID_INVALID;
+ status = CELLID_INVALID;
}
}
else
- {
- result = (schUeDelRsp->cause == INVALID_CELLID) ? CELLID_INVALID : UEID_INVALID;
- }
- if(MacSendUeDeleteRsp(schUeDelRsp->cellId, schUeDelRsp->crnti, result) != ROK)
+ status = schUeDelRsp->cause;
+
+ if(MacSendUeDeleteRsp(schUeDelRsp->cellId, schUeDelRsp->crnti, status) != ROK)
{
DU_LOG("\nERROR --> MAC: MacProcSchUeDeleteRsp(): Failed to send UE delete response");
+ ret = RFAILED;
}
}
else
{
uint8_t ret = ROK;
uint8_t cellIdx=0;
- UeDeleteStatus result=DEL_SUCCESSFUL;
+ CauseOfResult status =SUCCESSFUL;
MacUeCb *ueCb = NULLP;
MacCellCb *cellCb = NULLP;
else
{
DU_LOG("\nERROR --> MAC : MacProcUeDeleteReq(): CRNTI is not matched");
- result = UEID_INVALID;
+ status = UEID_INVALID;
}
}
else
{
DU_LOG("\nERROR --> MAC : MacProcUeDeleteReq(): Failed to find the MacUeCb of UeId = %d",ueDelete->ueId);
- result = CELLID_INVALID;
+ status = CELLID_INVALID;
}
- if(result != DEL_SUCCESSFUL)
+ if(status!= SUCCESSFUL)
{
- MacSendUeDeleteRsp(ueDelete->cellId, ueDelete->crnti, result);
+ MacSendUeDeleteRsp(ueDelete->cellId, ueDelete->crnti, status);
MAC_FREE_SHRABL_BUF(pst->region, pst->pool, ueDelete, sizeof(MacUeDelete));
ret = RFAILED;
}
return ret;
}
+/*******************************************************************
+*
+* @brief Fill and Send UE Reset response from MAC to DU APP
+*
+* @details
+*
+* Function : MacSendUeResetRsp
+*
+* Functionality: Fill and Send UE Reset response from MAC to DUAPP
+*
+* @params[in] MAC UE Reset result
+* SCH UE Reset response
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t MacSendUeResetRsp(uint16_t cellId, uint16_t ueId, CauseOfResult status)
+{
+ MacUeResetRsp *ResetRsp;
+ Pst rspPst;
+
+ MAC_ALLOC_SHRABL_BUF(ResetRsp, sizeof(MacUeResetRsp));
+ if(!ResetRsp)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation for UE Reset response failed");
+ return RFAILED;
+ }
+
+ /* Filling UE Reset response */
+ ResetRsp->cellId = cellId;
+ ResetRsp->ueId = ueId;
+ ResetRsp->status = status;
+
+ /* Fill Post structure and send UE Reset response*/
+ memset(&rspPst, 0, sizeof(Pst));
+ FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_UE_RESET_RSP);
+ return (*macDuUeResetRspOpts[rspPst.selector])(&rspPst, ResetRsp);
+}
+
+/*******************************************************************
+ *
+ * @brief Handles UE Reset request from DU APP
+ *
+ * @details
+ *
+ * Function : MacProcUeResetReq
+ *
+ * Functionality: Handles UE Reset requst from DU APP
+ *
+ * @params[in] Pst *pst, MacUeResetReq *ueReset
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t MacProcUeResetReq(Pst *pst, MacUeResetReq *ueReset)
+{
+ uint8_t cellIdx=0;
+ CauseOfResult status =SUCCESSFUL;
+ MacUeCb *ueCb = NULLP;
+ MacCellCb *cellCb = NULLP;
+
+ DU_LOG("\nINFO --> MAC : UE Reset Request received for ueId[%d]", ueReset->ueId);
+
+ if(ueReset)
+ {
+ GET_CELL_IDX(ueReset->cellId, cellIdx);
+ cellCb = macCb.macCell[cellIdx];
+ if(cellCb)
+ {
+ ueCb = &cellCb->ueCb[ueReset->ueId-1];
+ if(ueCb->ueId == ueReset->ueId)
+ {
+ /* TODO := complete the processing of UE reset request*/
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC : MacProcUeResetReq(): UE ID [%d] not found in Cell Id [%d]", ueCb->ueId , ueReset->cellId);
+ status = UEID_INVALID;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC : MacProcUeResetReq(): Cell Id [%d] not found ",ueReset->cellId);
+ status = CELLID_INVALID;
+ }
+
+ MacSendUeResetRsp(ueReset->cellId, ueReset->ueId, status);
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, ueReset, sizeof(MacUeResetReq));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC : MacProcUeResetReq(): MAC UE reset request processing failed");
+ return RFAILED;
+ }
+ return ROK;
+}
/**********************************************************************
End of file
**********************************************************************/
/* 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(uint16_t cellId, uint8_t ueId, UeDeleteResult result);
+uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId, uint8_t ueId, CauseOfResult status);
/**********************************************************************
End of file
* Functionality:
* sending UE delete response to DU
*
- * @params[in] uint8_t cellId, uint8_t ueId, UeDeleteResult result
+ * @params[in] uint8_t cellId, uint8_t ueId, CauseOfResult status
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId,uint8_t ueId, UeDeleteResult result)
+uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId,uint8_t ueId, CauseOfResult status)
{
Pst pst;
RlcUeDeleteRsp *ueDeleteRsp = NULLP;
{
ueDeleteRsp->cellId = cellId;
ueDeleteRsp->ueId = ueId;
- ueDeleteRsp->result = result;
+ ueDeleteRsp->status = status;
if(rlcSendUeDeleteRspToDu(&pst, ueDeleteRsp) == ROK)
{
uint8_t ret = ROK;
RlcCb *gRlcCb = NULLP;
RlcUlUeCb *ueCb = NULLP;
- UeDeleteResult result=SUCCESSFUL;
+ CauseOfResult status =SUCCESSFUL;
DU_LOG("\nDEBUG --> RLC: UE Delete request received. CellID[%d] UEID[%d]",ueDelete->cellId, ueDelete->ueId);
}
else
{
- result = INVALID_CELLID;
+ status = CELLID_INVALID;
}
}
else
{
- result = INVALID_UEID;
+ status = UEID_INVALID;
}
- if(result != SUCCESSFUL)
+ if(status != SUCCESSFUL)
{
- ret = sendRlcUeDeleteRspToDu(ueDelete->cellId, ueDelete->ueId, result);
+ ret = sendRlcUeDeleteRspToDu(ueDelete->cellId, ueDelete->ueId, status);
if(ret != ROK)
{
DU_LOG("\nERROR --> RLC: RlcProcUeDeleteReq():Failed to send UE Delete response to DU");
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)
+ if(sendRlcUeDeleteRspToDu(rlcUeCfg->cellId, rlcUeCfg->ueId, UEID_INVALID) != ROK)
{
DU_LOG("ERROR --> RLC: rlcUeDeleteTmrExpiry(): Failed to send UE delete response ");
return RFAILED;
if(addSliceCfgInSchDb(storedSliceCfg, schSliceCfgReq->listOfSlices[cfgIdx]) == ROK)
{
sliceFound = RSP_OK;
- schSliceCfgRsp.cause = SLICE_CONFIGURED;
+ schSliceCfgRsp.cause = SUCCESSFUL;
}
else
{
DU_LOG("\nERROR --> SCH : Failed to store slice configuration in SchDb");
- schSliceCfgRsp.cause = RESOURCE_NOT_AVAILABLE;
+ schSliceCfgRsp.cause = RESOURCE_UNAVAILABLE;
ret = RFAILED;
}
plmnIdx = MAX_PLMN;
}
}
- if((sliceFound == RSP_NOK) && (schSliceCfgRsp.cause != RESOURCE_NOT_AVAILABLE))
+ if((sliceFound == RSP_NOK) && (schSliceCfgRsp.cause != RESOURCE_UNAVAILABLE))
schSliceCfgRsp.cause = SLICE_NOT_FOUND;
schSliceCfgRsp.snssai = schSliceCfgReq->listOfSlices[cfgIdx]->snssai;
schSliceRecfgRsp.snssai = schSliceRecfgReq->listOfSlices[cfgIdx]->snssai;
schSliceRecfgRsp.rsp = sliceFound;
if(schSliceRecfgRsp.rsp == RSP_OK)
- schSliceRecfgRsp.cause = SLICE_RECONFIGURED;
+ schSliceRecfgRsp.cause = SUCCESSFUL;
else
schSliceRecfgRsp.cause = SLICE_NOT_FOUND;
SchSendSliceRecfgRspToMac(inst, schSliceRecfgRsp);
* Functionality: Fill and send UE delete response to MAC
*
* @params[in] Inst inst, SchUeDelete *ueDelete, SchMacRsp result,
-* ErrorCause cause
+* CauseOfResult cause
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-void SchSendUeDeleteRspToMac(Inst inst, SchUeDelete *ueDelete, SchMacRsp result, ErrorCause cause)
+void SchSendUeDeleteRspToMac(Inst inst, SchUeDelete *ueDelete, SchMacRsp result, CauseOfResult cause)
{
Pst rspPst;
SchUeDeleteRsp delRsp;
* ****************************************************************/
uint8_t SchProcUeDeleteReq(Pst *pst, SchUeDelete *ueDelete)
{
- uint8_t idx=0, ueId=0, ret=ROK;
- ErrorCause result;
- SchCellCb *cellCb = NULLP;
+ uint8_t idx=0, ueId=0, ret=ROK;
+ CauseOfResult cause;
+ SchCellCb *cellCb = NULLP;
Inst inst = pst->dstInst - SCH_INST_START;
if(!ueDelete)
if(cellCb->cellId != ueDelete->cellId)
{
DU_LOG("\nERROR --> SCH : SchProcUeDeleteReq(): cell Id is not available");
- result = INVALID_CELLID;
+ cause = CELLID_INVALID;
}
else
{
cellCb->api->SchUeDeleteReq(&cellCb->ueCb[ueId-1]);
deleteSchUeCb(&cellCb->ueCb[ueId-1]);
cellCb->numActvUe--;
- result = NOT_APPLICABLE;
+ cause = SUCCESSFUL;
}
else
{
DU_LOG("\nERROR --> SCH : SchProcUeDeleteReq(): SchUeCb not found");
- result = INVALID_UEID;
+ cause = UEID_INVALID;
}
}
- if(result == NOT_APPLICABLE)
+ if(cause == SUCCESSFUL)
{
- SchSendUeDeleteRspToMac(inst, ueDelete, RSP_OK, result);
+ SchSendUeDeleteRspToMac(inst, ueDelete, RSP_OK, cause);
}
else
{
- SchSendUeDeleteRspToMac(inst, ueDelete, RSP_NOK, result);
+ SchSendUeDeleteRspToMac(inst, ueDelete, RSP_NOK, cause);
ret = RFAILED;
}
return ret;
_isLcidValid = ((_lcId >= SRB0_LCID && _lcId <= MAX_DRB_LCID) ? 1 : 0);\
}
+typedef enum
+{
+ SUCCESSFUL,
+ CELLID_INVALID,
+ UEID_INVALID,
+ RESOURCE_UNAVAILABLE,
+ SLICE_NOT_FOUND,
+}CauseOfResult ;
+
typedef enum
{
UE_CFG_INACTIVE,
UE_CFG_INPROGRESS,
UE_CREATE_COMPLETE,
UE_DELETE_COMPLETE,
- UE_RECFG_COMPLETE
+ UE_RECFG_COMPLETE,
+ UE_RESET_COMPLETE
}UeCfgState;
typedef enum
return RFAILED;
}
+/*******************************************************************
+*
+* @brief Packs and Sends UE Reset Request from DUAPP to MAC
+*
+* @details
+*
+* Function : packDuMacUeResetReq
+*
+* Functionality:
+* Packs and Sends UE Reset Request from DUAPP to MAC
+*
+*
+* @params[in] Post structure pointer
+* MacUeResetReq pointer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t packDuMacUeResetReq(Pst *pst, MacUeResetReq *ueDel)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeResetReq");
+ return RFAILED;
+ }
+ /* pack the address of the structure */
+ CMCHKPK(oduPackPointer,(PTR)ueDel, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeResetReq");
+ return RFAILED;
+ }
+ return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpacks UE Reset Request received from DU APP
+*
+* @details
+*
+* Function : unpackMacUeResetReq
+*
+* Functionality:
+* Unpacks UE Reset Request received from DU APP
+*
+* @params[in] Pointer to Handler
+* Post structure pointer
+* Message Buffer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackMacUeResetReq(DuMacUeResetReq func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ MacUeResetReq *ueReset;
+
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&ueReset, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, ueReset);
+ }
+ else
+ {
+ /* Nothing to do for other selectors */
+ DU_LOG("\nERROR --> DU APP : Only LWLC supported for UE Reset Request ");
+ ODU_PUT_MSG_BUF(mBuf);
+ }
+
+ return RFAILED;
+}
+
+/*******************************************************************
+ *
+ * @brief Pack and send UE reset response from MAC to DU APP
+ *
+ * @details
+ *
+ * Function : packDuMacUeResetRsp
+ *
+ * Functionality:
+ * Pack and send UE reset response from MAC to DU APP
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packDuMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeResetRsp");
+ return RFAILED;
+ }
+ /* pack the address of the structure */
+ CMCHKPK(oduPackPointer,(PTR)resetRsp, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeResetRsp");
+ return RFAILED;
+ }
+
+ return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpack UE Config Response from MAC to DU APP
+*
+* @details
+*
+* Function :unpackDuMacUeResetRsp
+*
+* Functionality: Unpack UE Config Response from MAC to DU APP
+*
+* @params[in]
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackDuMacUeResetRsp(MacDuUeResetRspFunc func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ MacUeResetRsp *ueResetRsp = NULLP;
+
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&ueResetRsp, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, ueResetRsp);
+ }
+
+ ODU_PUT_MSG_BUF(mBuf);
+ return RFAILED;
+}
+
/*******************************************************************
*
* @brief Searches for first unset bit in ueBitMap
#define EVENT_MAC_RACH_RESOURCE_RSP 222
#define EVENT_MAC_RACH_RESOURCE_REL 223
#define EVENT_MAC_DL_PCCH_IND 224
+#define EVENT_MAC_UE_RESET_REQ 225
+#define EVENT_MAC_UE_RESET_RSP 226
#define BSR_PERIODIC_TIMER_SF_10 10
#define BSR_RETX_TIMER_SF_320 320
MAC_DU_APP_RSP_OK
}MacRsp;
-typedef enum
-{
- SLICE_NOT_PRESENT,
- SLICE_IS_CONFIGURED,
- SLICE_IS_RECONFIGURED,
- RESOURCE_DOES_NOT_AVAILABLE
-}RspReason;
-
-typedef enum
-{
- DEL_SUCCESSFUL,
- CELLID_INVALID,
- UEID_INVALID
-}UeDeleteStatus;
-
-typedef enum
-{
- SUCCESSFUL_RSP,
- CELL_ID_INVALID
-}CellDeleteStatus;
-
typedef enum
{
DUP_MODE_FDD,
RESTART_TRANSMISSION
}DataTransmissionAction;
-typedef struct failureCause
+typedef struct failureCause
{
CauseGrp type;
union
{
- RadioNwLyrCause radioNwCause;
- TransLyrCause transportCause;
- ProtCause protcolCause;
- MiscFailCause miscCause;
+ RadioNwLyrCause radioNwResult;
+ TransLyrCause transportResult;
+ ProtCause protcolResult;
+ MiscFailCause miscResult;
}u;
}FailureCause;
{
uint16_t cellId;
uint8_t ueId;
- UeDeleteStatus result;
+ CauseOfResult status;
}MacUeDeleteRsp;
typedef struct macCellDeleteReq
typedef struct macCellDeleteRsp
{
uint16_t cellId;
- CellDeleteStatus result;
+ CauseOfResult status;
}MacCellDeleteRsp;
typedef struct macSliceCfgRsp
{
Snssai snssai;
MacRsp rsp;
- RspReason cause;
+ CauseOfResult cause;
}MacSliceCfgRsp;
typedef struct rrmPolicyRatio
typedef struct cellInfo CellStartInfo;
typedef struct cellInfo CellStopInfo;
+typedef struct ueReset
+{
+ uint16_t cellId;
+ uint8_t ueId;
+}MacUeResetReq;
+
+typedef struct ueResetRsp
+{
+ uint16_t cellId;
+ uint8_t ueId;
+ CauseOfResult status;
+}MacUeResetRsp;
+
/* Functions for CellUp Ind from MAC to DU APP*/
typedef uint8_t (*DuMacCellUpInd) ARGS((
Pst *pst,
Pst *pst,
DlPcchInd *pcchInd));
+/* UE Reset Request from DU APP to MAC*/
+typedef uint8_t (*DuMacUeResetReq) ARGS((
+ Pst *pst,
+ MacUeResetReq *ueReset ));
+
+/* UE Reset Response from MAC to DU APP*/
+typedef uint8_t (*MacDuUeResetRspFunc) ARGS((
+ Pst *pst,
+ MacUeResetRsp *resetRsp));
+
uint64_t ueBitMapPerCell[MAX_NUM_CELL]; /* Bit Map to store used/free UE-IDX per Cell */
uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId);
uint8_t unpackMacDlPcchInd(DuMacDlPcchInd func, Pst *pst, Buffer *mBuf);
int8_t getFreeBitFromUeBitMap(uint16_t cellId);
void unsetBitInUeBitMap(uint16_t cellId, uint8_t bitPos);
+uint8_t packDuMacUeResetReq(Pst *pst, MacUeResetReq *ueReset);
+uint8_t MacProcUeResetReq(Pst *pst, MacUeResetReq *ueReset);
+uint8_t unpackMacUeResetReq(DuMacUeResetReq func, Pst *pst, Buffer *mBuf);
+uint8_t packDuMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp);
+uint8_t DuProcMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp);
+uint8_t unpackDuMacUeResetRsp(MacDuUeResetRspFunc func, Pst *pst, Buffer *mBuf);
+
#endif
RLC_CFG_REAS_INVALID_RGUSAP /*!< Invalid RGU SAP ID */
}FailureReason;
-typedef enum
-{
- SUCCESSFUL , /*!< No Failure */
- INVALID_CELLID , /*!< CellId not present */
- INVALID_UEID , /*!< UEId not present */
-}UeDeleteResult;
-
typedef enum
{
RLC_AM, //Acknowledged Mode
{
uint16_t cellId;
uint8_t ueId;
- UeDeleteResult result;
+ CauseOfResult status;
}RlcUeDeleteRsp;
/* UL RRC Message from RLC to DU APP */
RRC_CONNECTED_USERS_RSRC
}SchResourceType;
-typedef enum
-{
- SLICE_NOT_FOUND,
- SLICE_CONFIGURED,
- SLICE_RECONFIGURED,
- RESOURCE_NOT_AVAILABLE
-}RspCause;
-
typedef enum
{
NO_TRANSMISSION,
REPEATITION
}PduTxOccsaion;
-typedef enum
-{
- UNSPECIFIED_CAUSE,
- INVALID_PARAM_VALUE,
- RESOURCE_UNAVAILABLE,
- SYSTEM_ERROR
-}SchFailureCause;
-
typedef enum
{
SR_PROHIBIT_MS1,
SR_PROHIBIT_MS128
}SchSrProhibitTimer;
-typedef enum
-{
- NOT_APPLICABLE,
- INVALID_CELLID,
- INVALID_UEID
-}ErrorCause;
-
typedef enum
{
SR_TRANS_MAX_N4,
{
uint16_t cellId; /* Cell Id */
SchMacRsp rsp;
- SchFailureCause cause;
+ CauseOfResult cause;
}SchCellCfgCfm;
/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.4.2.2 Cell Del Req*/
{
uint16_t cellId;
SchMacRsp rsp;
- SchFailureCause cause;
+ CauseOfResult cause;
}SchCellDeleteRsp;
/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.4.2.3*/
{
Snssai snssai;
SchMacRsp rsp;
- RspCause cause;
+ CauseOfResult cause;
}SchSliceCfgRsp;
/*As per ORAN-WG8 V7.0.0 Sec 11.2.4.3.4 , Slice Cfg and Recfg are same structures*/
uint16_t ueId;
uint16_t crnti;
SchMacRsp rsp;
- SchFailureCause cause;
+ CauseOfResult cause;
}SchUeCfgRsp;
/*As per WG8 V7.0.0 Sec 11.2.4.3.6, UE ReCFG and UECFG have same structure definition*/
uint16_t cellId;
uint16_t crnti;
SchMacRsp rsp;
- ErrorCause cause;
+ CauseOfResult cause;
}SchUeDeleteRsp;
/*Spec O-RAN, WG8, V7.0.0, '11.2.4.2.8' DL HARQ Indication*/
if(deleteRsp)
{
- if(deleteRsp->result == SUCCESSFUL_RSP)
+ if(deleteRsp->status == SUCCESSFUL)
{
GET_CELL_IDX(deleteRsp->cellId, cellIdx);
DU_LOG("\nINFO --> DU APP : MAC CELL Delete Response : SUCCESS [CELL IDX : %d]", deleteRsp->cellId);
UE_INACTIVE,
UE_ACTIVE,
UE_HANDIN_IN_PROGRESS,
- UE_DELETION_IN_PROGRESS
+ UE_DELETION_IN_PROGRESS,
+ UE_RESET_IN_PROGRESS
}UeState;
typedef enum
ret = unpackDuMacRachRsrcRsp(DuProcMacRachRsrcRsp, pst, mBuf);
break;
}
+ case EVENT_MAC_UE_RESET_RSP:
+ {
+ ret = unpackDuMacUeResetRsp(DuProcMacUeResetRsp, pst, mBuf);
+ break;
+ }
default:
{
DU_LOG("\nERROR --> DU_APP : Invalid event received at duActvTsk from ENTMAC");
packDuRlcUeDeleteReq /* Light weight-loose coupling */
};
+DuMacUeResetReq packMacUeResetReqOpts[] =
+{
+ packDuMacUeResetReq, /* Loose coupling */
+ MacProcUeResetReq, /* TIght coupling */
+ packDuMacUeResetReq /* Light weight-loose coupling */
+};
/******************************************************************
*
* @brief Function to return Drb LcId
if(deleteRsp)
{
- if(deleteRsp->result == DEL_SUCCESSFUL)
+ if(deleteRsp->status == SUCCESSFUL)
{
DU_LOG("\nINFO --> DU APP : MAC UE Delete Response : SUCCESS [UE IDX : %d]", deleteRsp->ueId);
GET_CELL_IDX(deleteRsp->cellId, cellIdx);
ueId = delRsp->ueId;
GET_CELL_IDX(delRsp->cellId, cellIdx);
- if(delRsp->result == SUCCESSFUL)
+ if(delRsp->status == SUCCESSFUL)
{
DU_LOG("\nINFO --> DU_APP: RLC UE Delete Response : SUCCESS [UE IDX:%d]", ueId);
if(duCb.actvCellLst[cellIdx]!=NULLP)
return ret;
}
+/*******************************************************************
+ *
+ * @brief Sending UE Reset Req To Mac
+*
+* @details
+*
+* Function : sendUeResetReqToMac
+*
+* Functionality:
+* sending UE Reset Req To Mac
+*
+* @params[in] cellId, ueId, crnti
+* @return ROK - success
+* RFAILED - failure
+*
+*****************************************************************/
+
+uint8_t sendUeResetReqToMac(uint16_t cellId, uint8_t ueId)
+{
+ Pst pst;
+ uint8_t ret=ROK;
+ MacUeResetReq *ueReset = NULLP;
+
+ DU_ALLOC_SHRABL_BUF(ueReset, sizeof(MacUeResetReq));
+ if(ueReset)
+ {
+ ueReset->cellId = cellId;
+ ueReset->ueId = ueId;
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_UE_RESET_REQ);
+
+ DU_LOG("\nDEBUG --> DU_APP: Sending UE Reset Request to MAC ");
+ ret = (*packMacUeResetReqOpts[pst.selector])(&pst, ueReset);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU_APP: sendUeResetReqToMac(): Failed to send UE Reset Req to MAC");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueReset, sizeof(MacUeResetReq));
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP: sendUeResetReqToMac(): Failed to allocate memory");
+ ret = RFAILED;
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief DU processes UE reset req and send it to MAC
+ *
+ * @details
+ *
+ * Function : duBuildAndSendUeResetReq
+ *
+ * Functionality: DU processes UE reset req and send to MAC
+ *
+ *
+ * @params[in] cellId, crnti
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t duBuildAndSendUeResetReq(uint16_t cellId, uint16_t crnti)
+{
+ uint8_t ueId =0;
+ uint16_t cellIdx = 0;
+
+ DU_LOG("\nDEBUG --> DU_APP : Building UE reset request");
+ GET_CELL_IDX(cellId, cellIdx);
+ GET_UE_ID(crnti, ueId);
+
+ if(duCb.actvCellLst[cellIdx] != NULLP)
+ {
+ if(crnti != duCb.actvCellLst[cellIdx]->ueCb[ueId - 1].crnti)
+ {
+ DU_LOG("\nERROR --> DU APP : duBuildAndSendUeResetReq(): CRNTI [%d] not found", crnti);
+ return RFAILED;
+ }
+
+ duCb.actvCellLst[cellIdx]->ueCb[ueId - 1].ueState = UE_RESET_IN_PROGRESS;
+ if(sendUeResetReqToMac(cellId, ueId) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeResetRsp(): Failed to build UE reset req for MAC ");
+ return RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : duBuildAndSendUeResetReq(): Cell Id %d not found", cellId);
+ return RFAILED;
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+*
+* @brief Handle UE reset response from MAC
+*
+* @details
+*
+* Function : DuProcMacUeResetRsp
+*
+* Functionality: Handle UE reset response from MAC
+*
+* @params[in] Pointer to MacUeResetRsp and Pst
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t DuProcMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp)
+{
+ uint8_t ret =ROK;
+ uint16_t cellIdx=0;
+
+ if(resetRsp)
+ {
+ if(resetRsp->status == SUCCESSFUL)
+ {
+ DU_LOG("\nINFO --> DU APP : MAC UE Reset Response : SUCCESS [UE IDX : %d]", resetRsp->ueId);
+ GET_CELL_IDX(resetRsp->cellId, cellIdx);
+ if(duCb.actvCellLst[cellIdx])
+ {
+ duCb.actvCellLst[cellIdx]->ueCb[resetRsp->ueId -1].duMacUeCfg.macUeCfgState = UE_RESET_COMPLETE;
+ /*TODO - Complete the processing after receiving successfully reset rsp*/
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeResetRsp(): MAC UE Reset Response : FAILURE [UE IDX : %d]",resetRsp->ueId);
+ ret = RFAILED;
+ }
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool, resetRsp, sizeof(MacUeResetRsp));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeResetRsp(): MAC UE Reset Response is null");
+ ret = RFAILED;
+ }
+ return ret;
+}
+
/**********************************************************************
End of file
***********************************************************************/