}
return ret;
}
+
+/**
+ * @brief Mac process the downlink Broadcast Req received from DUAPP
+ *
+ * @details
+ *
+ * Function : MacProcDlBroadcastReq
+ *
+ * This function process the downlink Broadcast Req received from DUAPP
+ *
+ * @param[in] Pst *pst
+ * @param[in] DlBroadcastReq *dlBroadcastReq
+ * @return int
+ * -# ROK
+ **/
+uint8_t MacProcDlBroadcastReq(Pst *pst, MacDlBroadcastReq *dlBroadcastReq)
+{
+ uint8_t ret = ROK, idx=0;
+ uint16_t cellIdx = 0;
+
+ if(dlBroadcastReq)
+ {
+ DU_LOG("\nINFO --> MAC : Received DL braodcast req from DU_APP for cellId[%d]", dlBroadcastReq->cellId);
+
+ GET_CELL_IDX(dlBroadcastReq->cellId, cellIdx);
+
+ if(macCb.macCell[cellIdx] == NULLP || macCb.macCell[cellIdx]->cellId != dlBroadcastReq->cellId)
+ {
+ ret = RFAILED;
+ DU_LOG("\nERROR --> MAC : MacProcDlBroadcastReq(): CellId[%d] does not exist", dlBroadcastReq->cellId);
+ }
+ else
+ {
+ /*TODO - Complete the processing of DL Broadcast Request*/
+ }
+ for(idx = 0; idx<dlBroadcastReq->numSiBlock; idx++)
+ {
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, dlBroadcastReq->siSchedulingInfo[idx]->siAreaID, sizeof(uint8_t));
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, dlBroadcastReq->siSchedulingInfo[idx], sizeof(SiSchedulingInfo));
+ }
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, dlBroadcastReq, sizeof(MacDlBroadcastReq));
+ }
+ else
+ {
+ ret = RFAILED;
+ DU_LOG("\nERROR --> MAC : MacProcDlBroadcastReq(): Received Null pointer");
+ }
+ return ret;
+}
/**********************************************************************
End of file
**********************************************************************/
unpackMacDlPcchInd(MacProcDlPcchInd, pst, mBuf);
break;
}
+ case EVENT_MAC_DL_BROADCAST_REQ:
+ {
+ /* Process Dl Broadcast Request */
+ unpackMacDlBroadcastReq(MacProcDlBroadcastReq, pst, mBuf);
+ break;
+ }
+
case EVENT_MAC_UE_RESET_REQ:
{
/* Process UE Reset Request */
return RFAILED;
}
+/*******************************************************************
+*
+* @brief Packs and Sends Dl Broadcast Request from DUAPP to MAC
+*
+* @details
+*
+* Function : packDuMacDlBroadcastReq
+*
+* Functionality:
+* Packs and Sends Dl Broadcast Request from DUAPP to MAC
+*
+*
+* @params[in] Post structure pointer
+* MacDlBroadcastReq pointer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t packDuMacDlBroadcastReq(Pst *pst, MacDlBroadcastReq *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 packDuMacDlBroadcastReq");
+ return RFAILED;
+ }
+ /* pack the address of the structure */
+ CMCHKPK(oduPackPointer,(PTR)ueDel, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacDlBroadcastReq");
+ return RFAILED;
+ }
+ return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpacks Dl Broadcast Request received from DU APP
+*
+* @details
+*
+* Function : unpackMacDlBroadcastReq
+*
+* Functionality:
+* Unpacks Dl Broadcast Request received from DU APP
+*
+* @params[in] Pointer to Handler
+* Post structure pointer
+* Message Buffer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackMacDlBroadcastReq(DuMacDlBroadcastReq func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ MacDlBroadcastReq *dlBroadcast;
+
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&dlBroadcast, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, dlBroadcast);
+ }
+ else
+ {
+ /* Nothing to do for other selectors */
+ DU_LOG("\nERROR --> DU APP : Only LWLC supported for Dl Broadcast Request ");
+ ODU_PUT_MSG_BUF(mBuf);
+ }
+
+ return RFAILED;
+}
/*******************************************************************
*
* @brief Searches for first unset bit in ueBitMap
#define __MACINT_H__
#define NUM_NUMEROLOGY 5 /* Number of numerology */
-
+#define MAX_SI_MESSAGE 32 /* As per 138 331 V15.3, RRC Multiplicity and type constraint definitions maxSI-Message = 32 */
+#define NUM_SIB 32 /* As per 138 331 V15.3, RRC Multiplicity and type constraint definitions maxSIB = 32 */
#define NUM_SSB 1 /* max value is 64 */
#define SSB_MASK_SIZE 1 /* SSB mask size is 32bit for sub6 */
#define SIB1_REPETITION_PERIOD 20
#define EVENT_MAC_UE_RESET_REQ 225
#define EVENT_MAC_UE_RESET_RSP 226
#define EVENT_MAC_UE_SYNC_STATUS_IND 227
+#define EVENT_MAC_DL_BROADCAST_REQ 228
#define BSR_PERIODIC_TIMER_SF_10 10
#define BSR_RETX_TIMER_SF_320 320
#define PAGING_SCHED_DELTA 4
#define MAX_PLMN 2
+typedef enum
+{
+ SIB_TYPE2,
+ SIB_TYPE3,
+ SIB_TYPE4,
+ SIB_TYPE5,
+ SIB_TYPE6,
+ SIB_TYPE7,
+ SIB_TYPE8,
+ SIB_TYPE9,
+ SPARE
+}SibType;
+
+typedef enum
+{
+ SSB_PER_RACH_OCCASION_ONE_EIGHTH,
+ SSB_PER_RACH_OCCASION_ONE_FOURTH,
+ SSB_PER_RACH_OCCASION_ONE_HALF,
+ SSB_PER_RACH_OCCASION_ONE,
+ SSB_PER_RACH_OCCASION_TWO,
+ SSB_PER_RACH_OCCASION_FOUR,
+ SSB_PER_RACH_OCCASION_EIGHT,
+ SSB_PER_RACH_OCCASION_SIXTEEN
+}SsbPerRachOccasion;
+
+typedef enum
+{
+ BROADCASTING,
+ NOTBROADCASTING,
+}SiBroadcastStatus;
+
+typedef enum
+{
+ RF8,
+ RF16,
+ RF32,
+ RF64,
+ RF128,
+ RF256,
+ RF512
+}SiPeriodicity;
+
+typedef enum
+{
+ S5,
+ S10,
+ S20,
+ S40,
+ S80,
+ S160,
+ S320,
+ S640,
+ S1280
+}SiWindowLength;
+
+typedef enum
+{
+ SI_REQ_PERIOD_1,
+ SI_REQ_PERIOD_2,
+ SI_REQ_PERIOD_4,
+ SI_REQ_PERIOD_6,
+ SI_REQ_PERIOD_8,
+ SI_REQ_PERIOD_10,
+ SI_REQ_PERIOD_12,
+ SI_REQ_PERIOD_16
+}SiRequestPeriod;
+
typedef enum
{
MAC_DU_APP_RSP_NOK,
typedef struct macSliceCfgReq MacSliceRecfgReq;
typedef struct macSliceCfgRsp MacSliceRecfgRsp;
+/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.17 DL PCCH Indication */
typedef struct dlPcchInd
{
uint16_t cellId;
uint8_t *pcchPdu;
}DlPcchInd;
+
+/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.1 Cell Start */
typedef struct cellInfo
{
SlotTimingInfo slotInfo;
typedef struct cellInfo CellStartInfo;
typedef struct cellInfo CellStopInfo;
+/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.12 UE Reset Request */
typedef struct ueReset
{
uint16_t cellId;
uint8_t ueId;
}MacUeResetReq;
+/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.13 UE Reset Response */
typedef struct ueResetRsp
{
uint16_t cellId;
CauseOfResult status;
}MacUeResetRsp;
+/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.14 UE Sync Status Indication */
typedef struct ueSyncStatusInd
{
uint16_t cellId;
SyncStatus status;
}MacUeSyncStatusInd;
+/* The following list of structures is taken from the SI-SchedulingInfo section of specification 33.331. */
+typedef struct sibTypeInfo
+{
+ SibType sibType;
+ uint8_t valueTag;
+ bool areaScope;
+}SibTypeInfo;
+
+typedef struct sibMappingInfo
+{
+ uint8_t numSibTypeInfo;
+ SibTypeInfo sibTypeInfo[NUM_SIB];
+}SibMappingInfo;
+
+typedef struct schedulingInfo
+{
+ SiBroadcastStatus siBroadcastStatus;
+ SiPeriodicity siPeriodicity;
+ SibMappingInfo sibMappingInfo;
+}SchedulingInfo;
+
+typedef struct rachOccasionsSi
+{
+ RachCfgGeneric rachConfigSi;
+ SsbPerRachOccasion ssbPerRachOccasion;
+}RachOccasionsSi;
+
+typedef struct siReqRsrc
+{
+ uint8_t raPreambleStartIndex;
+ uint8_t raAssociationPeriodIndex;
+ uint8_t raSsbOccasionMaskIndex;
+}SiReqRsrc;
+
+typedef struct siRequestResource
+{
+ uint8_t numOfSiReqRsrc;
+ SiReqRsrc siReqRsrc[MAX_SI_MESSAGE];
+}SiRequestResource;
+
+typedef struct siRequestConfig
+{
+ RachOccasionsSi rachOccasionsSi;
+ SiRequestPeriod siRequestPeriod;
+ SiRequestResource siRequestResource;
+}SiRequestConfig;
+
+typedef struct schedulingInfoList
+{
+ uint8_t numSchInfo;
+ SchedulingInfo schedulingInfo[MAX_SI_MESSAGE];
+}SchedulingInfoList;
+
+typedef struct siSchedulingInfo
+{
+ SchedulingInfoList schInfoList;
+ SiWindowLength siWindowLength;
+ SiRequestConfig siRequestConfig;
+ SiRequestConfig siRequestConfigSUL;
+ uint8_t *siAreaID;
+}SiSchedulingInfo;
+
+/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.18 DL Broadcast Request */
+typedef struct macDlBroadcastReq
+{
+ uint16_t cellId;
+ uint8_t numSiBlock;
+ SiSchedulingInfo **siSchedulingInfo;
+}MacDlBroadcastReq;
+
+/* DL broadcast req from DU APP to MAC*/
+typedef uint8_t (*DuMacDlBroadcastReq) ARGS((
+ Pst *pst,
+ MacDlBroadcastReq *dlBroadcast));
+
/* Functions for CellUp Ind from MAC to DU APP*/
typedef uint8_t (*DuMacCellUpInd) ARGS((
Pst *pst,
uint8_t packDuMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd);
uint8_t DuProcMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd);
uint8_t unpackDuMacUeSyncStatusInd(MacDuUeSyncStatusIndFunc func, Pst *pst, Buffer *mBuf);
+uint8_t packDuMacDlBroadcastReq(Pst *pst, MacDlBroadcastReq *dlBroadcastReq);
+uint8_t MacProcDlBroadcastReq(Pst *pst, MacDlBroadcastReq *dlBroadcastReq);
+uint8_t unpackMacDlBroadcastReq(DuMacDlBroadcastReq func, Pst *pst, Buffer *mBuf);
#endif
packDuMacDlPcchInd /* Light weight-loose coupling */
};
+DuMacDlBroadcastReq packMacDlBroadcastReqOpts[] =
+{
+ packDuMacDlBroadcastReq, /* Loose coupling */
+ MacProcDlBroadcastReq, /* TIght coupling */
+ packDuMacDlBroadcastReq /* Light weight-loose coupling */
+};
/*******************************************************************
*
* @brief Processes cells to be activated
return ROK;
}
+
+/*******************************************************************
+ *
+ * @brief DU build and send dl broacast req and send it to MAC
+ *
+ * @details
+ *
+ * Function : duBuildAndSendDlBroadcastReq
+ *
+ * Functionality: DU build and send dl broacast req and send to MAC
+ *
+ *
+ * @params[in] cellId, crnti
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t duBuildAndSendDlBroadcastReq()
+{
+ Pst pst;
+ uint8_t ret =ROK;
+ MacDlBroadcastReq *dlBroadcast=NULLP;
+
+ DU_LOG("\nDEBUG --> DU_APP : Building Dl broadcast request");
+
+ DU_ALLOC_SHRABL_BUF(dlBroadcast, sizeof(MacDlBroadcastReq));
+ if(dlBroadcast)
+ {
+ /*TODO - fill MAC DL Broadcast Request*/
+
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_DL_BROADCAST_REQ);
+
+ DU_LOG("\nDEBUG --> DU_APP: Sending Dl broadcast Request to MAC ");
+ ret = (*packMacDlBroadcastReqOpts[pst.selector])(&pst, dlBroadcast);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU_APP: sendDlBroadcastReqToMac(): Failed to send Dl broadcast Req to MAC");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlBroadcast, sizeof(MacDlBroadcastReq));
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP: sendDlBroadcastReqToMac(): Failed to allocate memory");
+ ret = RFAILED;
+ }
+
+ return ret;
+}
+
/**********************************************************************
End of file
**********************************************************************/
DU_LOG("\nERROR --> DU_APP : Invalid IE received in F1SetupRsp:%ld",
f1SetRspMsg->protocolIEs.list.array[idx]->id);
}
- duProcF1SetupRsp();
}
+ duProcF1SetupRsp();
freeAperDecodeF1SetupRsp(f1SetRspMsg);
duCb.f1SetupReqAndRspMsg.f1MsgRspBufSize = recvBufLen;