#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_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 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
typedef enum
{
- MAC_DU_APP_RSP_NOK,
- MAC_DU_APP_RSP_OK
-}MacRsp;
+ 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
{
- SLICE_NOT_PRESENT,
- SLICE_IS_CONFIGURED,
- SLICE_IS_RECONFIGURED,
- RESOURCE_DOES_NOT_AVAILABLE
-}RspReason;
+ 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
{
- DEL_SUCCESSFUL,
- CELLID_INVALID,
- UEID_INVALID
-}UeDeleteStatus;
+ MAC_DU_APP_RSP_NOK,
+ MAC_DU_APP_RSP_OK
+}MacRsp;
typedef enum
{
- SUCCESSFUL_RSP,
- CELL_ID_INVALID
-}CellDeleteStatus;
+ IN_SYNC,
+ OUT_OF_SYNC,
+ OUT_OF_SUNC_MAX_RETRIES
+}SyncStatus;
typedef enum
{
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;
CELL_ACTIVE,
}MacCellState;
+/*Spec Ref: 38.331: RadioLinkMonitoringConfig*/
+typedef enum
+{
+ BeamFailure,
+ Rlf,
+ Both
+}PurposeOfFailureDet;
+
typedef struct plmnInfoList
{
Plmn plmn;
PdschConfig pdschCfg;
}InitialDlBwp;
-/* BWP Downlink common */
-typedef struct bwpDlCommon
+/*Spec 38.331 "SPS-Config'*/
+typedef struct spsConfig
{
-}BwpDlCommon;
+ uint16_t periodicity;
+ uint8_t numOfHqProcess;
+ uint8_t n1PucchAN;
+ McsTable mcsTable;
+}SpsConfig;
+
+typedef uint8_t RadioLinkMonitoringRsId;
+
+typedef struct radioLinkMonRS
+{
+ RadioLinkMonitoringRsId radioLinkMonitoringRsId;
+ PurposeOfFailureDet purpose;
+ union
+ {
+ uint8_t ssbIndx;
+ uint8_t nzpCsiRsResId;
+ }detectionRes;
+}RadioLinkMonRS;
+
+typedef struct radioLinkConfig
+{
+ RadioLinkMonRS failurDetResAddModList[1];
+ RadioLinkMonitoringRsId failurDetResRelList[1];
+ uint8_t beamFailureInstanceMaxCount;
+ uint8_t beamFailureDetectionTimer;
+}RadioLinkConfig;
+
+/* Spec 38.331, 'BWP-DownlinkDedicated'*/
+typedef struct bwpDlCfgDed
+{
+ PdcchConfig pdcchCfgDed;
+ PdschConfig pdschCfgDed;
+ SpsConfig spsCfgDed;
+ RadioLinkConfig radioLnkMonCfgDed;
+}BwpDlCfgDed;
/* Downlink BWP information */
typedef struct dlBwpInfo
{
uint8_t bwpId;
+ BwpDlConfig bwpCommon;
+ BwpDlCfgDed bwpDedicated;
}DlBwpInfo;
/* PDCCH Serving Cell configuration */
PuschCfg puschCfg;
}InitialUlBwp;
+typedef struct bwpUlCfgDed
+{
+ PucchCfg pucchCfg;
+ PuschCfg puschCfg;
+}BwpUlCfgDed;
+
/* Uplink BWP information */
typedef struct ulBwpInfo
{
- uint8_t bwpId;
+ uint8_t bwpId;
+ BwpUlConfig bwpCommon;
+ BwpUlCfgDed bwpDed;
}UlBwpInfo;
+typedef struct rachCfgGeneric
+{
+ uint8_t prachCfgIdx; /* PRACH config idx */
+ uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
+ uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
+ uint8_t zeroCorrZoneCfg; /* Zero correlation zone cofig */
+ int16_t preambleRcvdTargetPower; /*Prach Target power received*/
+ uint8_t preambleTransMax; /*Preamble Transmission Max power*/
+ uint8_t pwrRampingStep; /*Power Ramping Step*/
+ uint8_t raRspWindow; /* RA Response Window */
+}RachCfgGeneric;
+
+typedef struct raPrioritization
+{
+ uint8_t powerRampingStepHighPriority;
+ uint8_t scalingFactorBI;
+}RaPrioritization;
+
+typedef struct bfrCsiRsRes
+{
+ uint8_t csrRsIndex;
+ uint8_t raOccList;
+ uint8_t raPreambleIndex;
+}BfrCsiRsRes;
+
+typedef struct bfrSsbRes
+{
+ uint16_t ssbIndex;
+ uint8_t raPreambleIndex;
+}BfrSsbRes;
+
+typedef struct prachResDedBfr
+{
+ BfrSsbRes ssb;
+ BfrCsiRsRes csiRs;
+}PrachResDedBfr;
+
+/*Spec 38.331 'BeamFailureRecoveryConfig' */
+typedef struct beamFailRecoveryCfg
+{
+ uint8_t rootSeqIndexBfr;
+ RachCfgGeneric rachCfgBfr;
+ uint8_t rsrpThreshSsbBfr;
+ PrachResDedBfr candidteBeamRSList;
+ uint8_t ssbPerachBfr;
+ uint8_t raSsbOccMaskIndex;
+ uint8_t recoverySearchSpaceId;
+ RaPrioritization raPrioBfr;
+ uint16_t bfrTimer;
+ uint8_t msg1SubcSpacing;
+}BeamFailRecoveryCfg;
+
/* Serving cell configuration */
typedef struct servCellCfgInfo
{
- InitialDlBwp initDlBwp;
- uint8_t numDlBwpToAdd;
- DlBwpInfo dlBwpToAddList[MAX_NUM_BWP];
- uint8_t firstActvDlBwpId;
- uint8_t defaultDlBwpId;
- uint8_t *bwpInactivityTmr;
- PdschServCellCfg pdschServCellCfg;
- InitialUlBwp initUlBwp;
- uint8_t numUlBwpToAdd;
- UlBwpInfo ulBwpToAddList[MAX_NUM_BWP];
- uint8_t firstActvUlBwpId;
+ InitialDlBwp initDlBwp;
+ RadioLinkConfig radioLinkMonConfig;
+ uint8_t numDlBwpToAdd;
+ DlBwpInfo dlBwpToAddList[MAX_NUM_BWP];
+ uint8_t firstActvDlBwpId;
+ uint8_t defaultDlBwpId;
+ uint8_t *bwpInactivityTmr;
+ PdschServCellCfg pdschServCellCfg;
+ InitialUlBwp initUlBwp;
+ BeamFailRecoveryCfg beamFailureRecoveryCfg;
+ uint8_t numUlBwpToAdd;
+ UlBwpInfo ulBwpToAddList[MAX_NUM_BWP];
+ uint8_t firstActvUlBwpId;
}ServCellCfgInfo;
/* Special cell configuration */
ServCellCfgInfo servCellCfg;
}SpCellCfg;
+typedef struct bwpRelInfo
+{
+ uint8_t bwpId;
+}BwpRelInfo;
+
/* Serving cell Re-configuration */
typedef struct servCellRecfgInfo
{
InitialDlBwp initDlBwp;
+ RadioLinkConfig radioLinkMonConfig;
uint8_t numDlBwpToAddOrMod;
DlBwpInfo dlBwpToAddOrModList[MAX_NUM_BWP];
uint8_t numDlBwpToRel;
- DlBwpInfo dlBwpToRelList[MAX_NUM_BWP];
+ BwpRelInfo dlBwpToRelList[MAX_NUM_BWP];
uint8_t firstActvDlBwpId;
uint8_t defaultDlBwpId;
uint8_t *bwpInactivityTmr;
uint8_t numUlBwpToAddOrMod;
UlBwpInfo ulBwpToAddOrModList[MAX_NUM_BWP];
uint8_t numUlBwpToRel;
- UlBwpInfo ulBwpToRelList[MAX_NUM_BWP];
+ BwpRelInfo ulBwpToRelList[MAX_NUM_BWP];
uint8_t firstActvUlBwpId;
}ServCellRecfgInfo;
McsTable mcsTable; /* MCS table */
}ModulationInfo;
-typedef struct macUeCfg
+typedef struct macUeCreateReq
{
uint16_t cellId;
uint8_t ueId;
+ uint8_t beamIdx;
uint16_t crnti;
bool macCellGrpCfgPres;
MacCellGrpCfg macCellGrpCfg;
ModulationInfo ulModInfo; /* UL modulation info */
uint8_t numLcs;
LcCfg lcCfgList[MAX_NUM_LC];
-}MacUeCfg;
+}MacUeCreateReq;
/* UE Re-configuration */
typedef struct macUeRecfg
FailureCause cause;
}SCellFailInfo;
-typedef struct ueCfgRsp
+typedef struct macUeCreateRsp
{
uint16_t cellId;
uint16_t ueId;
SCellFailInfo *failedSCellList;
uint8_t numDRBModFailed; /* valid values : 0 to MAX_NUM_DRB */
DRBFailInfo *failedDRBModlist;
-}MacUeCfgRsp;
+}MacUeCreateRsp;
-typedef struct ueCfgRsp MacUeRecfgRsp;
+typedef struct macUeCreateRsp MacUeRecfgRsp;
typedef struct rachRsrcReq
{
{
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 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;
+ uint8_t ueId;
+ CauseOfResult status;
+}MacUeResetRsp;
+
+/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.14 UE Sync Status Indication */
+typedef struct ueSyncStatusInd
+{
+ uint16_t cellId;
+ uint8_t ueId;
+ 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,
/* UE create Request from DU APP to MAC*/
typedef uint8_t (*DuMacUeCreateReq) ARGS((
Pst *pst,
- MacUeCfg *ueCfg ));
+ MacUeCreateReq *ueCfg ));
/* UE create Response from MAC to DU APP */
-typedef uint8_t (*MacDuUeCfgRspFunc) ARGS((
+typedef uint8_t (*MacDuUeCreateRspFunc) ARGS((
Pst *pst,
- MacUeCfgRsp *cfgRsp));
+ MacUeCreateRsp *cfgRsp));
/* UE Reconfig Request from DU APP to MAC */
typedef uint8_t (*DuMacUeReconfigReq) ARGS((
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));
+
+/* 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 packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf);
uint8_t MacProcDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
-uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCfg *ueCfg);
+uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg);
uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf);
-uint8_t MacProcUeCreateReq(Pst *pst, MacUeCfg *ueCfg);
+uint8_t MacProcUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg);
uint8_t sendStopIndMacToDuApp(uint16_t cellId);
-uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp);
-uint8_t unpackDuMacUeCfgRsp(MacDuUeCfgRspFunc func, Pst *pst, Buffer *mBuf);
-uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp);
+uint8_t packDuMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp);
+uint8_t unpackDuMacUeCreateRsp(MacDuUeCreateRspFunc func, Pst *pst, Buffer *mBuf);
+uint8_t DuProcMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp);
uint8_t packDuMacUeReconfigReq(Pst *pst, MacUeRecfg *ueRecfg);
uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf);
uint8_t MacProcUeReconfigReq(Pst *pst, MacUeRecfg *ueRecfg);
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);
+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