+typedef struct rarInfo
+{
+ uint8_t RAPID;
+ uint16_t ta;
+ Msg3UlGrant ulGrant;
+ uint16_t tcrnti;
+ uint8_t rarPdu[RAR_PAYLOAD_SIZE];
+ uint8_t rarPduLen;
+}RarInfo;
+
+typedef struct rarAlloc
+{
+ uint16_t raRnti;
+ RarInfo rarInfo;
+ BwpCfg bwp;
+ PdcchCfg *rarPdcchCfg;
+ PdschCfg *rarPdschCfg;
+}RarAlloc;
+
+typedef struct lcSchInfo
+{
+ uint8_t lcId;
+ uint32_t schBytes;
+}LcSchInfo;
+
+typedef struct ceSchInfo
+{
+ uint8_t ceLcId;
+ uint8_t *ceContent;
+}CeSchInfo;
+
+typedef struct freqDomainAlloc
+{
+ uint8_t resAllocType; /* Resource allocation type */
+ union
+ {
+ ResAllocType0 type0;
+ ResAllocType1 type1;
+ }resAlloc;
+}FreqDomainAlloc;
+
+typedef struct transportBlock
+{
+ uint8_t mcs;
+ bool ndi;
+ uint8_t rv;
+ uint16_t tbSize;
+ uint8_t numCe;
+ CeSchInfo ceSchInfo[MAX_NUM_LC];
+ uint8_t numLc;
+ LcSchInfo lcSchInfo[MAX_NUM_LC];
+}TransportBlock;
+
+typedef struct dlMsgSchedInfo
+{
+ uint16_t crnti;
+ uint8_t dciFormatId;
+ uint8_t harqProcNum;
+ bool vrbPrbMapping;
+ uint8_t dlAssignIdx;
+ uint8_t pucchTpc;
+ uint8_t pucchResInd;
+ uint8_t harqFeedbackInd;
+ uint16_t dlMsgPduLen;
+ uint8_t *dlMsgPdu;
+ FreqDomainAlloc freqAlloc;
+ TimeDomainAlloc timeAlloc;
+ uint8_t numOfTbs;
+ TransportBlock transportBlock[2];
+ BwpCfg bwp;
+ PdcchCfg *dlMsgPdcchCfg;
+ PdschCfg *dlMsgPdschCfg;
+}DlMsgSchInfo;
+
+typedef struct schSlotValue
+{
+ SlotTimingInfo currentTime;
+ SlotTimingInfo broadcastTime;
+ SlotTimingInfo rarTime;
+ SlotTimingInfo dlMsgTime;
+ SlotTimingInfo ulDciTime;
+}SchSlotValue;
+
+
+/* Reference -> O-RAN.WG8.AAD.0-v07.00, Table 9-36 DCI Format0_0 Configuration */
+typedef struct format0_0
+{
+ uint8_t resourceAllocType;
+ FreqDomainAlloc freqAlloc;
+ TimeDomainAlloc timeAlloc;
+ uint16_t rowIndex;
+ uint8_t mcs;
+ uint8_t harqProcId;
+ bool freqHopFlag;
+ uint8_t ndi;
+ uint8_t rvIndex;
+ uint8_t tpcCmd;
+ bool sulIndicator;
+}Format0_0;
+
+/* Reference -> O-RAN.WG8.AAD.0-v07.00, Table 9-40 DCI Format 0_1 Configuration */
+typedef struct format0_1
+{
+ uint8_t carrierIndicator;
+ bool sulIndicator;
+ uint8_t bwpIndicator;
+ uint8_t resourceAlloc;
+ FreqDomainRsrc freqAlloc;
+ TimeDomainAlloc timeAlloc;
+ uint16_t rowIndex;
+ uint8_t mcs;
+ uint8_t harqProcId;
+ bool freqHopFlag;
+ uint8_t ndi;
+ uint8_t rvIndex;
+ uint8_t firstDownlinkAssignmentIndex;
+ uint8_t secondDownlinkAssignmentIndex;
+ uint8_t tpcCommand;
+ uint8_t srsResourceSetIndicator;
+ uint8_t srsResourceIndicator;
+ uint8_t tpmi;
+ uint8_t antennaPorts;
+ uint8_t srsRequest;
+ uint8_t csiRequest;
+ uint8_t cbgTransmissionInfo;
+ uint8_t ptrsDmrs;
+ uint8_t betaOffsetIndicator;
+ bool dmrsSequenceInitialization;
+ bool ulschIndicatior;
+}Format0_1;
+
+typedef struct dciFormat
+{
+ FormatType formatType; /* DCI Format */
+ union
+ {
+ Format0_0 format0_0; /* Format 0_0 */
+ Format0_1 format0_1; /* Format 0_1 */
+ }format;
+}DciFormat;
+
+typedef struct dciInfo
+{
+ uint16_t crnti; /* CRNTI */
+ BwpCfg bwpCfg; /* BWP Cfg */
+ CoresetCfg coresetCfg; /* Coreset1 Cfg */
+ DciFormat dciFormatInfo; /* Dci Format */
+ DlDCI dciInfo; /* DlDCI */
+}DciInfo;
+
+
+/* Reference -> O-RAN.WG8.AAD.0-v07.00, Section 11.2.4.3.8 DL Scheduling Information */
+typedef struct dlSchedInfo
+{
+ uint16_t cellId; /* Cell Id */
+ SchSlotValue schSlotValue;
+
+ /* Allocation for broadcast messages */
+ bool isBroadcastPres;
+ DlBrdcstAlloc brdcstAlloc;
+
+ /* Allocation for RAR message */
+ RarAlloc *rarAlloc[MAX_NUM_UE];
+
+ /* UL grant in response to BSR */
+ DciInfo *ulGrant;
+
+ /* Allocation from dedicated DL msg */
+ DlMsgSchInfo *dlMsgAlloc[MAX_NUM_UE];
+
+}DlSchedInfo;
+
+/*Reference: O-RAN.WG8.AAD.v7.0.0, Sec 11.2.4.3.13 Downlink Paging Allocation*/
+typedef struct interleaved_t
+{
+ uint8_t regBundleSize;
+ uint8_t interleaverSize;
+ uint16_t shiftIndex;
+}Interleaved;
+
+typedef struct pageDlDci
+{
+ uint8_t freqDomainResource[6];
+ uint8_t durationSymbols;
+ uint8_t cceRegMappingType;
+ union
+ {
+ Interleaved interleaved;
+ uint8_t nonInterleaved;
+ }cceReg;
+ uint8_t ssStartSymbolIndex;
+ uint8_t cceIndex;
+ uint8_t aggregLevel;
+ uint8_t precoderGranularity;
+ uint8_t coreSetSize;
+}PageDlDci;
+
+typedef struct resAllocType1 PageFreqDomainAlloc;
+
+typedef struct pageTimeDomainAlloc
+{
+ uint8_t mappingType;
+ uint16_t startSymb;
+ uint16_t numSymb;
+}PageTimeDomainAlloc;
+
+typedef struct pageDmrsConfig
+{
+ uint8_t dmrsType;
+ uint8_t dmrsAddPos;
+ uint8_t nrOfDmrsSymbols;
+}PageDmrsConfig;
+
+typedef struct pageTbInfo
+{
+ uint8_t mcs;
+ uint32_t tbSize;
+}PageTbInfo;
+
+typedef struct pageDlSch
+{
+ PageFreqDomainAlloc freqAlloc;
+ PageTimeDomainAlloc timeAlloc;
+ PageDmrsConfig dmrs;
+ uint8_t vrbPrbMapping;
+ PageTbInfo tbInfo;
+ uint8_t tbScaling;
+ uint16_t dlPagePduLen;
+ uint8_t *dlPagePdu;
+}PageDlSch;
+
+typedef struct dlPageAlloc
+{
+ uint16_t cellId;
+ SlotTimingInfo dlPageTime;
+ uint8_t ssbIdx;
+ bool shortMsgInd;
+ uint8_t shortMsg;
+ BwpCfg bwp;
+ PageDlDci pageDlDci;
+ PageDlSch pageDlSch;
+}DlPageAlloc;
+
+typedef struct tbInfo
+{
+ uint8_t mcs; /* MCS */
+ uint8_t ndi; /* NDI */
+ uint8_t rv; /* Redundancy Version */
+ uint16_t tbSize; /* TB Size */
+ uint8_t qamOrder; /* Modulation Order */
+ SchMcsTable mcsTable; /* MCS Table */
+}TbInfo;
+
+typedef struct schPuschInfo
+{
+ uint8_t harqProcId; /* HARQ Process ID */
+ uint16_t crnti;
+ FreqDomainAlloc fdAlloc; /* Freq domain allocation */
+ TimeDomainAlloc tdAlloc; /* Time domain allocation */
+ TbInfo tbInfo; /* TB info */
+#ifdef INTEL_FAPI
+ uint8_t dmrsMappingType;
+ uint8_t nrOfDmrsSymbols;
+ uint8_t dmrsAddPos;
+#endif
+}SchPuschInfo;
+
+typedef struct harqInfo
+{
+ uint16_t harqAckBitLength;
+ uint8_t betaOffsetHarqAck;
+}HarqInfo;
+
+typedef struct csiInfo
+{
+ uint16_t csiBits;
+ uint8_t betaOffsetCsi;
+}CsiInfo;
+
+typedef struct harqFdbkInfo
+{
+ uint16_t harqBitLength;
+}HarqFdbkInfo;
+
+typedef struct csiFdbkInfo
+{
+ uint16_t csiBits;
+}CsiFdbkInfo;
+
+typedef struct schPucchFormatCfg
+{
+ uint8_t interSlotFreqHop;
+ uint8_t addDmrs;
+ uint8_t maxCodeRate;
+ uint8_t numSlots;
+ bool pi2BPSK;
+ bool harqAckCSI;
+}SchPucchFormatCfg;
+
+typedef struct schPucchInfo
+{
+ uint16_t crnti;
+ FreqDomainRsrc fdAlloc;
+ TimeDomainAlloc tdAlloc;
+ uint8_t srFlag;
+ HarqFdbkInfo harqInfo;
+ CsiFdbkInfo csiInfo;
+ BeamformingInfo beamPucchInfo;
+ uint8_t pucchFormat;
+ uint8_t intraFreqHop;
+ uint16_t secondPrbHop;
+ uint8_t initialCyclicShift;
+ uint8_t occLen;
+ uint8_t occIdx;
+ uint8_t timeDomOCC;
+ uint8_t addDmrs;
+ bool pi2BPSK;
+}SchPucchInfo;
+
+typedef struct schPuschUci
+{
+ uint8_t harqProcId; /* HARQ Process ID */
+ uint16_t crnti;
+ FreqDomainAlloc fdAlloc; /* Freq domain allocation */
+ TimeDomainAlloc tdAlloc; /* Time domain allocation */
+ TbInfo tbInfo; /* TB information */
+ HarqInfo harqInfo; /* Harq Information */
+ CsiInfo csiInfo; /* Csi information*/
+}SchPuschUci;
+
+/* Reference -> O-RAN.WG8.AAD.0-v07.00, Section 11.2.4.3.9 UL Scheduling Information */
+typedef struct ulSchedInfo
+{
+ uint16_t cellId; /* Cell Id */
+ SlotTimingInfo slotIndInfo; /* Slot Info: sfn, slot number */
+ uint8_t dataType; /* Type of info being scheduled */
+ SchPrachInfo prachSchInfo; /* Prach scheduling info */
+ SchPuschInfo schPuschInfo[MAX_NUM_UE]; /* Pusch scheduling info */
+ SchPuschUci schPuschUci[MAX_NUM_UE]; /* Pusch Uci */
+ SchPucchInfo schPucchInfo[MAX_NUM_UE]; /* Pucch and Uci scheduling info */
+}UlSchedInfo;
+
+/* Info of Scheduling Request to Add/Modify */
+typedef struct schSchedReqInfo
+{
+ uint8_t schedReqId;
+ SchSrProhibitTimer srProhibitTmr;
+ SchSrTransMax srTransMax;
+}SchSchedReqInfo;
+
+/* Scheduling Request Configuration */
+typedef struct schSchedReqCfg
+{
+ uint8_t addModListCount;
+ SchSchedReqInfo addModList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* List of Scheduling req to be added/modified */
+ uint8_t relListCount;
+ uint8_t relList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* list of scheduling request Id to be deleted */
+}SchSchedReqCfg;
+
+/* Info of Tag to Add/Modify */
+typedef struct schTagInfo
+{
+ uint8_t tagId;
+ SchTimeAlignmentTimer timeAlignmentTmr;
+}SchTagInfo;
+
+/* Timing Advance Group Configuration */
+typedef struct schTagCfg
+{
+ uint8_t addModListCount;
+ SchTagInfo addModList[MAX_NUM_TAGS]; /* List of Tag to Add/Modify */
+ uint8_t relListCount;
+ uint8_t relList[MAX_NUM_TAGS]; /* list of Tag Id to release */
+}SchTagCfg;
+
+/* Configuration for Power headroom reporting */
+typedef struct schPhrCfg
+{
+ SchPhrPeriodicTimer periodicTmr;
+ SchPhrProhibitTimer prohibitTmr;
+ SchPhrTxPwrFactorChange txpowerFactorChange;
+ bool multiplePhr;
+ bool dummy;
+ bool type2OtherCell;
+ SchPhrModeOtherCG modeOtherCG;
+}SchPhrCfg;
+
+/* MAC cell Group configuration */
+typedef struct schMacCellGrpCfg
+{
+ SchSchedReqCfg schedReqCfg;
+ SchTagCfg tagCfg;
+ SchPhrCfg phrCfg; /* To be used only if phrCfgSetupPres is true */
+#ifdef NR_DRX
+ bool drxCfgPresent;
+ SchDrxCfg drxCfg; /* Drx configuration */
+#endif
+}SchMacCellGrpCfg;
+
+/* Physical Cell Group Configuration */
+typedef struct schPhyCellGrpCfg
+{
+ SchPdschHarqAckCodebook pdschHarqAckCodebook;
+ int8_t pNrFr1;
+}SchPhyCellGrpCfg;
+
+/* Control resource set info */
+typedef struct schControlRsrcSet
+{
+ uint8_t cRSetId; /* Control resource set id */
+ uint8_t freqDomainRsrc[FREQ_DOM_RSRC_SIZE]; /* Frequency domain resource */
+ uint8_t duration;
+ SchREGMappingType cceRegMappingType;
+ SchPrecoderGranul precoderGranularity;
+ uint16_t dmrsScramblingId;
+}SchControlRsrcSet;
+
+/*Slot Perioicity and Offset*/
+typedef struct schMSlotPeriodAndOffset
+{
+ SchMSlotPeriodicity mSlotPeriodicity;
+ uint16_t mSlotOffset;
+}SchMSlotPeriodAndOffset;
+
+/* Search Space info */
+typedef struct schSearchSpace
+{
+ uint8_t searchSpaceId;
+ uint8_t cRSetId;
+ SchMSlotPeriodAndOffset mSlotPeriodicityAndOffset;
+ uint8_t mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
+ SchAggrLevel numCandidatesAggLevel1; /* Number of candidates for aggregation level 1 */
+ SchAggrLevel numCandidatesAggLevel2; /* Number of candidates for aggregation level 2 */
+ SchAggrLevel numCandidatesAggLevel4; /* Number of candidates for aggregation level 4 */
+ SchAggrLevel numCandidatesAggLevel8; /* Number of candidates for aggregation level 8 */
+ SchAggrLevel numCandidatesAggLevel16; /* Number of candidates for aggregation level 16 */
+ SchSearchSpaceType searchSpaceType;
+ uint8_t ueSpecificDciFormat;
+}SchSearchSpace;
+
+/* PDCCH cofniguration */
+typedef struct schPdcchConfig
+{
+ uint8_t numCRsetToAddMod;
+ SchControlRsrcSet cRSetToAddModList[MAX_NUM_CRSET]; /* List of control resource set to add/modify */
+ uint8_t numCRsetToRel;
+ uint8_t cRSetToRelList[MAX_NUM_CRSET]; /* List of control resource set to release */
+ uint8_t numSearchSpcToAddMod;
+ SchSearchSpace searchSpcToAddModList[MAX_NUM_SEARCH_SPC]; /* List of search space to add/modify */
+ uint8_t numSearchSpcToRel;
+ uint8_t searchSpcToRelList[MAX_NUM_SEARCH_SPC]; /* List of search space to release */
+}SchPdcchConfig;
+
+/* PDSCH time domain resource allocation */
+typedef struct schPdschTimeDomRsrcAlloc
+{
+ uint8_t *k0;
+ SchTimeDomRsrcAllocMappingType mappingType;
+ uint8_t startSymbol;
+ uint8_t symbolLength;
+}SchPdschTimeDomRsrcAlloc;
+
+
+typedef struct schPdschBundling
+{
+ struct schStaticBundling
+ {
+ SchBundlingSizeSet2 size;
+ }SchStaticBundling;
+ struct schDynamicBundling
+ {
+ SchBundlingSizeSet1 sizeSet1;
+ SchBundlingSizeSet2 sizeSet2;
+ }SchDynamicBundling;
+}SchPdschBundling;
+
+/* DMRS downlink configuration */
+typedef struct schDmrsDlCfg
+{
+ SchDmrsAdditionPosition addPos; /* DMRS additional position */
+}SchDmrsDlCfg;
+
+/* PDSCH Configuration */
+typedef struct schPdschConfig
+{
+ SchDmrsDlCfg dmrsDlCfgForPdschMapTypeA;
+ SchResourceAllocType resourceAllocType;
+ uint8_t numTimeDomRsrcAlloc;
+ SchPdschTimeDomRsrcAlloc timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
+ SchRBGSize rbgSize;
+ SchCodeWordsSchedByDci numCodeWordsSchByDci; /* Number of code words scheduled by DCI */
+ SchBundlingType bundlingType;
+ SchPdschBundling bundlingInfo;
+}SchPdschConfig;
+
+/* Initial Downlink BWP */
+typedef struct schInitalDlBwp
+{
+ bool pdcchCfgPres;
+ SchPdcchConfig pdcchCfg;
+ bool pdschCfgPres;
+ SchPdschConfig pdschCfg;
+}SchInitalDlBwp;
+
+/*Spec 38.331 'RadioLinkMonitoringConfig'*/
+typedef uint8_t SchRadioLinkMonitoringRsId;
+
+typedef struct schRadioLinkMonRS
+{
+ SchRadioLinkMonitoringRsId radioLinkMonitoringRsId;
+ SchPurposeOfFailureDet purpose;
+ union
+ {
+ uint8_t ssbIndx;
+ uint8_t nzpCsiRsResId;
+ }SchDetectionRes;
+}SchRadioLinkMonRS;
+
+typedef struct schRadioLinkConfig
+{
+ SchRadioLinkMonRS failurDetResAddModList[MAX_FAILURE_DET_RESOURCES];
+ SchRadioLinkMonitoringRsId failurDetResRelList[MAX_FAILURE_DET_RESOURCES];
+ uint8_t beamFailureInstanceMaxCount;
+ uint8_t beamFailureDetectionTimer;
+}SchRadioLinkConfig;
+
+/*Spec 38.331 "SPS-Config'*/
+typedef struct schSpsConfig
+{
+ uint16_t periodicity;
+ uint8_t numOfHqProcess;
+ uint8_t n1PucchAN;
+ SchMcsTable mcsTable;
+}SchSpsConfig;
+
+/* Spec 38.331, 'BWP-DownlinkDedicated'*/
+typedef struct schBwpDlCfgDed
+{
+ SchPdcchConfig pdcchCfgDed;
+ SchPdschConfig pdschCfgDed;
+ SchSpsConfig spsCfgDed;
+ SchRadioLinkConfig radioLnkMonCfgDed;
+}SchBwpDlCfgDed;
+
+/* Spec 38.331, 'BWP-Downlink' Downlink BWP information */
+typedef struct schDlBwpInfo
+{
+ uint8_t bwpId;
+ SchBwpDlCfg bwpCommon;
+ SchBwpDlCfgDed bwpDedicated;
+}SchDlBwpInfo;
+
+/* PDCCH Serving Cell configuration */
+typedef struct schPdschServCellCfg
+{
+ uint8_t *maxMimoLayers;
+ SchNumHarqProcForPdsch numHarqProcForPdsch;
+ SchMaxCodeBlkGrpPerTB *maxCodeBlkGrpPerTb;
+ bool *codeBlkGrpFlushInd;
+ SchPdschXOverhead *xOverhead;
+}SchPdschServCellCfg;
+
+typedef struct schRaPrioritization
+{
+ uint8_t powerRampingStepHighPriority;
+ uint8_t scalingFactorBI;
+}SchRaPrioritization;
+
+typedef struct schBfrCsiRsRes
+{
+ uint8_t csrRsIndex;
+ uint8_t raOccList;
+ uint8_t raPreambleIndex;
+}SchBfrCsiRsRes;
+
+typedef struct schBfrSsbRes
+{
+ uint16_t ssbIndex;
+ uint8_t raPreambleIndex;
+}SchBfrSsbRes;
+
+typedef struct schPrachResDedBfr
+{
+ SchBfrSsbRes ssb;
+ SchBfrCsiRsRes csiRs;
+}SchPrachResDedBfr;
+
+/*Spec 38.331 'BeamFailureRecoveryConfig' */
+typedef struct schBeamFailRecoveryCfg
+{
+ uint8_t rootSeqIndexBfr;
+ SchRachCfgGeneric rachCfgBfr;
+ uint8_t rsrpThreshSsbBfr; /* RSRP Threshold SSB */
+ SchPrachResDedBfr candidateBeamRSList;
+ uint8_t ssbPerRachBfr; /* SSB per RACH occassion */
+ uint8_t raSsbOccMaskIndex;
+ uint8_t recoverySearchSpaceId;
+ SchRaPrioritization raPrioBfr;
+ uint16_t bfrTimer;
+ uint8_t msg1SubcSpacing; /* Subcarrier spacing of RACH */
+}SchBeamFailRecoveryCfg;
+
+/* PUCCH Configuration */
+typedef struct schPucchResrcSetInfo
+{
+ uint8_t resrcSetId;
+ uint8_t resrcListCount;
+ uint8_t resrcList[MAX_NUM_PUCCH_PER_RESRC_SET];
+ uint8_t maxPayLoadSize;
+}SchPucchResrcSetInfo;
+
+typedef struct schPucchResrcSetCfg
+{
+ uint8_t resrcSetToAddModListCount;
+ SchPucchResrcSetInfo resrcSetToAddModList[MAX_NUM_PUCCH_RESRC_SET];
+ uint8_t resrcSetToRelListCount;
+ uint8_t resrcSetToRelList[MAX_NUM_PUCCH_RESRC];
+}SchPucchResrcSetCfg;
+
+typedef struct schPucchFormat0
+{
+ uint8_t initialCyclicShift;
+ uint8_t numSymbols;
+ uint8_t startSymbolIdx;
+}SchPucchFormat0;
+
+typedef struct schPucchFormat1
+{
+ uint8_t initialCyclicShift;
+ uint8_t numSymbols;
+ uint8_t startSymbolIdx;
+ uint8_t timeDomOCC;
+}SchPucchFormat1;
+
+typedef struct schPucchFormat2_3
+{
+ uint8_t numPrbs;
+ uint8_t numSymbols;
+ uint8_t startSymbolIdx;
+}SchPucchFormat2_3;
+
+typedef struct schPucchFormat4
+{
+ uint8_t numSymbols;
+ uint8_t occLen;
+ uint8_t occIdx;
+ uint8_t startSymbolIdx;
+}SchPucchFormat4;
+
+typedef struct schPucchResrcInfo
+{
+ uint8_t resrcId;
+ uint16_t startPrb;
+ uint8_t intraFreqHop;
+ uint16_t secondPrbHop;
+ uint8_t pucchFormat;
+ union{
+ SchPucchFormat0 *format0;
+ SchPucchFormat1 *format1;
+ SchPucchFormat2_3 *format2;
+ SchPucchFormat2_3 *format3;
+ SchPucchFormat4 *format4;
+ }SchPucchFormat;
+}SchPucchResrcInfo;
+
+typedef struct schPucchResrcCfg
+{
+ uint8_t resrcToAddModListCount;
+ SchPucchResrcInfo resrcToAddModList[MAX_NUM_PUCCH_RESRC];
+ uint8_t resrcToRelListCount;
+ uint8_t resrcToRelList[MAX_NUM_PUCCH_RESRC];
+}SchPucchResrcCfg;