DuProcMacUeResetRsp, /* packing for tightly coupled */
packDuMacUeResetRsp /* packing for light weight loosly coupled */
};
+
+MacDuUeSyncStatusIndFunc macDuUeSyncStatusIndOpts[] =
+{
+ packDuMacUeSyncStatusInd, /* packing for loosely coupled */
+ DuProcMacUeSyncStatusInd, /* packing for tightly coupled */
+ packDuMacUeSyncStatusInd /* packing for light weight loosly coupled */
+};
+
+/*******************************************************************
+*
+* @brief Fill and Send UE Sync Status Indication from MAC to DU APP
+*
+* @details
+*
+* Function : MacSendUeSyncStatusInd
+*
+* Functionality: Fill and Send UE Sync Status Indication from MAC to DUAPP
+*
+* @params[in] uint16_t cellId, uint16_t ueId, SyncStatus status
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t MacSendUeSyncStatusInd(uint16_t cellId, uint16_t ueId, SyncStatus status)
+{
+ MacUeSyncStatusInd *ueSyncStatusInd;
+ Pst rspPst;
+
+ MAC_ALLOC_SHRABL_BUF(ueSyncStatusInd, sizeof(MacUeSyncStatusInd));
+ if(!ueSyncStatusInd)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation for UE Sync Status Indication failed");
+ return RFAILED;
+ }
+
+ /* Filling UE Sync Status Indication */
+ ueSyncStatusInd->cellId = cellId;
+ ueSyncStatusInd->ueId = ueId;
+ ueSyncStatusInd->status = status;
+
+ /* Fill Post structure and send UE Sync Status Indication */
+ memset(&rspPst, 0, sizeof(Pst));
+ FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_UE_SYNC_STATUS_IND);
+ return (*macDuUeSyncStatusIndOpts[rspPst.selector])(&rspPst, ueSyncStatusInd);
+}
+
/*******************************************************************
*
* @brief Fills mac cell group config to be sent to scheduler
uint8_t ret = ROK;
uint16_t cellIdx;
MacUeRecfg *ueRecfg = NULLP;
-
+
#ifdef CALL_FLOW_DEBUG_LOG
switch(pst->event)
{
return RFAILED;
}
+/*******************************************************************
+ *
+ * @brief Pack and send UE Sync Status Indication from MAC to DU APP
+ *
+ * @details
+ *
+ * Function : packDuMacUeSyncStatusInd
+ *
+ * Functionality:
+ * Pack and send UE Sync Status Indication from MAC to DU APP
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packDuMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *SyncStatusInd)
+{
+ 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 packDuMacUeSyncStatusInd");
+ return RFAILED;
+ }
+ /* pack the address of the structure */
+ CMCHKPK(oduPackPointer,(PTR)SyncStatusInd, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeSyncStatusInd");
+ return RFAILED;
+ }
+
+ return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpack UE Config Response from MAC to DU APP
+*
+* @details
+*
+* Function :unpackDuMacUeSyncStatusInd
+*
+* Functionality: Unpack UE Config Response from MAC to DU APP
+*
+* @params[in]
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackDuMacUeSyncStatusInd(MacDuUeSyncStatusIndFunc func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ MacUeSyncStatusInd *ueSyncStatusInd = NULLP;
+
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&ueSyncStatusInd, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, ueSyncStatusInd);
+ }
+
+ ODU_PUT_MSG_BUF(mBuf);
+ return RFAILED;
+}
+
/*******************************************************************
*
* @brief Searches for first unset bit in ueBitMap
#define EVENT_MAC_DL_PCCH_IND 224
#define EVENT_MAC_UE_RESET_REQ 225
#define EVENT_MAC_UE_RESET_RSP 226
+#define EVENT_MAC_UE_SYNC_STATUS_IND 227
#define BSR_PERIODIC_TIMER_SF_10 10
#define BSR_RETX_TIMER_SF_320 320
MAC_DU_APP_RSP_OK
}MacRsp;
+typedef enum
+{
+ IN_SYNC,
+ OUT_OF_SYNC,
+ OUT_OF_SUNC_MAX_RETRIES
+}SyncStatus;
+
typedef enum
{
DUP_MODE_FDD,
CauseOfResult status;
}MacUeResetRsp;
+typedef struct ueSyncStatusInd
+{
+ uint16_t cellId;
+ uint8_t ueId;
+ SyncStatus status;
+}MacUeSyncStatusInd;
+
/* Functions for CellUp Ind from MAC to DU APP*/
typedef uint8_t (*DuMacCellUpInd) ARGS((
Pst *pst,
Pst *pst,
MacUeResetRsp *resetRsp));
+/* UE sync status indication from MAC to DU APP*/
+typedef uint8_t (*MacDuUeSyncStatusIndFunc) ARGS((
+ Pst *pst,
+ MacUeSyncStatusInd *syncStatusInd));
+
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 packDuMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp);
uint8_t DuProcMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp);
uint8_t unpackDuMacUeResetRsp(MacDuUeResetRspFunc func, Pst *pst, Buffer *mBuf);
-
+uint8_t packDuMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd);
+uint8_t DuProcMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd);
+uint8_t unpackDuMacUeSyncStatusInd(MacDuUeSyncStatusIndFunc func, Pst *pst, Buffer *mBuf);
#endif
ret = unpackDuMacSliceCfgRsp(DuProcMacSliceCfgRsp, pst, mBuf);
break;
}
+ case EVENT_MAC_UE_SYNC_STATUS_IND:
+ {
+ ret = unpackDuMacUeSyncStatusInd(DuProcMacUeSyncStatusInd, pst, mBuf);
+ break;
+ }
case EVENT_MAC_SLICE_RECFG_RSP:
{
ret = unpackDuMacSliceRecfgRsp(DuProcMacSliceRecfgRsp, pst, mBuf);
return ret;
}
+/*******************************************************************
+*
+* @brief Handle UE sync status indication from MAC
+*
+* @details
+*
+* Function : DuProcMacUeSyncStatusInd
+*
+* Functionality: Handle UE sync status indication from MAC
+*
+* @params[in] Pointer to MacUeSyncStatusInd and Pst
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t DuProcMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd)
+{
+ uint8_t ret =RFAILED;
+ uint16_t cellIdx=0, crnti = 0;
+ char *status;
+
+ if(ueSyncStatusInd)
+ {
+ GET_CELL_IDX(ueSyncStatusInd->cellId, cellIdx);
+ if(duCb.actvCellLst[cellIdx])
+ {
+ GET_CRNTI(crnti, ueSyncStatusInd->ueId);
+ if(duCb.actvCellLst[cellIdx]->ueCb[ueSyncStatusInd->ueId-1].crnti == crnti)
+ {
+ switch(ueSyncStatusInd->status)
+ {
+ case IN_SYNC:
+ status = "IN_SYNC";
+ break;
+
+ case OUT_OF_SYNC:
+ status = "OUT_OF_SYNC";
+ break;
+
+ case OUT_OF_SUNC_MAX_RETRIES:
+ status = "OUT_OF_SUNC_MAX_RETRIES";
+ break;
+
+ default:
+ status = "INVALID";
+ break;
+
+ }
+ DU_LOG("\nINFO --> DU APP : MAC UE sync status for received UeId %d is %s", ueSyncStatusInd->ueId,status);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeSyncStatusInd(): MAC UE sync status indication : Ue Id [%d] not found",ueSyncStatusInd->cellId);
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeSyncStatusInd(): MAC UE sync status indication : Cell Id [%d] not found",ueSyncStatusInd->cellId);
+ }
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool, ueSyncStatusInd, sizeof(MacUeSyncStatusInd));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeSyncStatusInd(): MAC UE sync status indication is null");
+ }
+ return ret;
+}
/**********************************************************************
End of file
***********************************************************************/