+ uint8_t priority; /* CG priority */
+ uint32_t dataVol; /* Data volume requested in bytes */
+}BsrInfo;
+
+typedef struct schLcCtxt
+{
+ uint8_t lcId; // logical Channel ID
+ uint8_t lcp; // logical Channel Prioritization
+ SchLcState lcState;
+ uint32_t bo;
+ uint16_t pduSessionId; /*Pdu Session Id*/
+ Snssai *snssai; /*S-NSSAI assoc with LCID*/
+ bool isDedicated; /*Flag containing Dedicated S-NSSAI or not*/
+ uint16_t rsvdDedicatedPRB;
+}SchDlLcCtxt;
+
+typedef struct schDlCb
+{
+ SchDlLcCtxt dlLcCtxt[MAX_NUM_LC];
+}SchDlCb;
+
+typedef struct schUlLcCtxt
+{
+ SchLcState lcState;
+ uint8_t lcId;
+ uint8_t priority;
+ uint8_t lcGroup;
+ uint8_t schReqId;
+ uint8_t pbr; // prioritisedBitRate
+ uint8_t bsd; // bucketSizeDuration
+ uint16_t pduSessionId; /*Pdu Session Id*/
+ Snssai *snssai; /*S-NSSAI assoc with LCID*/
+ bool isDedicated; /*Flag containing Dedicated S-NSSAI or not*/
+ uint16_t rsvdDedicatedPRB;
+}SchUlLcCtxt;
+
+typedef struct schUlCb
+{
+ SchUlLcCtxt ulLcCtxt[MAX_NUM_LC];
+}SchUlCb;
+
+typedef struct schUeCfgCb
+{
+ uint16_t cellId;
+ uint8_t ueId;
+ uint16_t crnti;
+ bool macCellGrpCfgPres;
+ SchMacCellGrpCfg macCellGrpCfg;
+ bool phyCellGrpCfgPres;
+ SchPhyCellGrpCfg phyCellGrpCfg;
+ bool spCellCfgPres;
+ SchSpCellRecfg spCellCfg;
+ SchAmbrCfg *ambrCfg;
+ SchModulationInfo dlModInfo;
+ SchModulationInfo ulModInfo;
+ SchDataTransmission dataTransmissionAction;
+}SchUeCfgCb;
+
+typedef struct schHqDlMap
+{
+ CmLListCp hqList;
+}SchHqDlMap;
+
+typedef struct schHqUlMap
+{
+ CmLListCp hqList;
+}SchHqUlMap;
+
+#ifdef NR_DRX
+typedef struct schDrxUeCb
+{
+ bool drxDlUeActiveStatus; /* Final Dl Ue status which is marked as true if drxDlUeActiveMask or drxDlUeActiveMaskForHarq is present */
+ bool drxUlUeActiveStatus; /* Final Ul Ue status which is marked as true if drxUlUeActiveMask or drxUlUeActiveMaskForHarq is present */
+ uint32_t drxDlUeActiveMask; /* variable is used to store the status about downlink active status of Ue for On-duration, inactive timer*/
+ uint32_t drxUlUeActiveMask; /* variable is used to store the status about uplink active status for on-duration inactive timer*/
+ uint32_t drxDlUeActiveMaskForHarq; /* variable is used to store the status about downlink active status for harq*/
+ uint32_t drxUlUeActiveMaskForHarq; /* variable is used to store the status about uplink active status for harq */
+ uint32_t onDurationLen; /* length of on duration which is received from ue cfg/recfg in form of ms and subms, informs about after how many slots on duration gets expire */
+ uint32_t inActvTimerLen; /* length of inActvTimer value received from ue cfg/recfg in form of ms, informs about after how many slots in active gets expire */
+ uint8_t harqRttDlTimerLen; /* length of harqRttDlTimer received from ue cfg/recfg in form of symbols, inform about after how many slots on the harq drx-HARQ-RTT-TimerDL expire */
+ uint8_t harqRttUlTimerLen; /* length of harqRttUlTimer received from ue cfg/recfg in form of symbols,informs about after how many slots on harq drx-HARQ-RTT-TimerUL expire*/
+ uint32_t retransDlTimerLen; /* length of retransDlTimer received from ue cfg/recfg in form of slot, informs about after how many slots on harq RetransmissionTimer dl timer expire*/
+ uint32_t retransUlTimerLen; /* length of retransUlTimer received from ue cfg/recfg in form of slot, informs about after how many slots on harq RetransmissionTimer ul timer expire*/
+ uint32_t longCycleLen; /* length of long Cycle value received from ue cfg/recfg in form of ms*/
+ bool longCycleToBeUsed; /* long cycle should be used once the short cycle gets expires */
+ uint32_t drxStartOffset; /* length of drxStartOffset value received from ue cfg/recfg in form of ms, which helps in getting on duration start point*/
+ bool shortCyclePresent; /* set this value if shortCycle is Present */
+ uint32_t shortCycleLen; /* length of short Cycle value received from ue cfg/recfg in form of ms*/
+ uint32_t shortCycleTmrLen; /* value shortCycleTmr is the multiple of shortCycle which is received from ue cfg/recfg in form of integer*/
+ uint32_t drxSlotOffset; /* drxSlotOffset value received from ue cfg/recfg which is used to delay before starting the drx-onDuration*/
+ uint32_t onDurationStartIndex; /* Index at which UE is stored in onDuration starts list */
+ uint32_t onDurationExpiryIndex; /* Index at which UE is stored in onDuration expires in the list */
+ uint32_t inActvExpiryIndex; /* Index at which UE is stored in inActvTimer expires in the list */
+ uint32_t shortCycleExpiryIndex; /* Index at which UE is stored in shortCycle expires in the list */
+ int32_t shortCycleDistance; /* Distance after how many slot short cycle tmr gets expire */
+ int32_t onDurationStartDistance;/* Distance after how many slot on Duration Start tmr gets expire */
+ int32_t onDurationExpiryDistance;/* Distance after how many slot on Duration tmr gets expire */
+ int32_t inActiveTmrExpiryDistance;/* Distance after how many slot inActive tmr gets expire */
+ CmLList *onDurationStartNodeInfo; /* Node present in on duration start list*/
+ CmLList *onDurationExpiryNodeInfo;/* Node present in on duration exp list*/
+ CmLList *inActvTimerExpiryNodeInfo; /* Node present in in active exp list*/
+ CmLList *shortCycleTmrExpiryNodeInfo; /* Node present in short cycle exp list*/
+}SchDrxUeCb;
+#endif
+
+typedef struct schPdcchInfo
+{
+ SchControlRsrcSet *cRSetRef; /*Coreset Cfg reference from SchUeCfgCb*/
+ SchSearchSpace *ssRef; /*SearchSpace Cfg reference from SchUeCfgCb*/
+ uint16_t totalPrbs; /*Total PRBs configured for this CORESET*/
+ uint8_t nrOfPRBPerCce; /*CCE Size*/
+ uint8_t totalCceCount; /*Count of CCE in this CORESET*/
+ uint8_t cqiIndxAggLvlMap[MAX_NUM_CQI_IDX];/*Agg Level to be used for each CQI Index*/
+ uint32_t *y; /*Coefficient variable to calculate CCE Index as per 3gpp Spec 38.213 Sec 10.1*/
+}SchPdcchInfo;
+
+/**
+ * @brief
+ * UE control block
+ */
+typedef struct schUeCb
+{
+ uint16_t ueId;
+ uint16_t crnti;
+ SchUeCfgCb ueCfg;
+ SchUeState state;
+ SchCellCb *cellCb;
+ SchCfraResource cfraResource;
+ bool srRcvd;
+ bool bsrRcvd;
+ BsrInfo bsrInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
+ SchUlCb ulInfo;
+ SchDlCb dlInfo;
+ SchUlHqEnt ulHqEnt;
+ SchDlHqEnt dlHqEnt;
+ SchDlHqProcCb *msg4HqProc;
+ SchDlHqProcCb *retxMsg4HqProc;
+ SchHqDlMap **hqDlmap;
+ SchHqUlMap **hqUlmap;
+ void *schSpcUeCb;
+#ifdef NR_DRX
+ bool ueDrxInfoPres;
+ SchDrxUeCb drxUeCb;
+#endif
+ bool k0K1TblPrsnt;
+ SchK0K1TimingInfoTbl k0K1InfoTbl;
+ bool k2TblPrsnt;
+ SchK2TimingInfoTbl k2InfoTbl;
+ SchPdcchInfo pdcchInfo[MAX_NUM_CRSET];
+}SchUeCb;
+
+/**
+ * @brief
+ * RA Request Info
+ */
+typedef struct schRaReq
+{
+ uint32_t raRnti;
+ RachIndInfo *rachInd;
+ bool isCFRA;
+ SchUeCb *ueCb; /* Filled only if isCFRA = true */
+ SlotTimingInfo winStartTime;
+ SlotTimingInfo winEndTime;
+}SchRaReq;
+
+typedef struct schPageInfo
+{
+ uint16_t pf; /*Value of Paging Frame received from DUAPP*/
+ uint8_t i_s; /*Value of Paging Occ Index received from DUAPP*/
+ SlotTimingInfo pageTxTime; /*Start Paging window*/
+ uint8_t mcs; /*MCS index*/
+ uint16_t msgLen; /*Pdu length */
+ uint8_t *pagePdu; /*RRC Page PDU bit string*/
+}SchPageInfo;
+
+typedef struct schPagingOcc
+{
+ uint8_t frameOffset;
+ uint8_t pagingOccSlot;
+}SchPagingOcc;
+
+typedef struct schPageCb
+{
+ CmLListCp pageIndInfoRecord[MAX_SFN]; /*List of Page Records received which are stored per sfn*/
+ SchPagingOcc pagMonOcc[MAX_PO_PER_PF]; /*Paging Occasion Slot/FrameOffset are stored*/
+}SchPageCb;
+
+#ifdef NR_DRX
+typedef struct schDrxCb
+{
+ CmLListCp onDurationStartList; /*!< Tracks the start of onDuration Timer. */
+ CmLListCp onDurationExpiryList; /*!< Tracks the Expiry of onDuration Timer. */
+ CmLListCp inActvTmrExpiryList; /*!< Tracks the Expiry of drx-InactivityTimer. */
+ CmLListCp shortCycleExpiryList; /*!< Tracks the Expiry of DRX Short Cycle. */
+ CmLListCp dlHarqRttExpiryList; /*!< Tracks the Expiry of DL HARQ RTT timer. */
+ CmLListCp dlRetransExpiryList; /*!< Tracks the Expiry of DL Re-Transmission timer. */
+ CmLListCp ulHarqRttExpiryList; /*!< Tracks the Expiry of UL HARQ RTT timer. */
+ CmLListCp ulRetransExpiryList; /*!< Tracks the Expiry of UL Re-Transmission timer. */
+ CmLListCp dlRetransTmrStartList; /*!< It has list of DL harq procs for */
+ CmLListCp ulRetransTmrStartList; /*!< It has list of UL harq procs for */
+}SchDrxCb;
+#endif
+
+typedef struct schAllApis
+{
+ uint8_t (* SchCellCfgReq)(SchCellCb *cellCb);
+ void (* SchCellDeleteReq)(SchCellCb *cellCb);
+ uint8_t (* SchAddUeConfigReq)(SchUeCb *ueCb);
+ void (* SchModUeConfigReq)(SchUeCb *ueCb);
+ void (* SchUeDeleteReq)(SchUeCb *ueCb);
+ void (* SchDlHarqInd)();
+ void (* SchPagingInd)();
+ void (* SchRachRsrcReq)();
+ void (* SchRachRsrcRel)();
+ void (* SchCrcInd)(SchCellCb *cellCb, uint16_t ueId);
+ void (* SchRachInd)(SchCellCb *cellCb, uint16_t ueId);
+ void (* SchDlRlcBoInfo)(SchCellCb *cellCb, uint16_t ueId);
+ void (* SchSrUciInd)(SchCellCb *cellCb, uint16_t ueId);
+ void (* SchBsr)(SchCellCb *cellCb, uint16_t ueId);
+ void (* SchHandleLcList)(void *ptr, CmLList *node, ActionTypeLL action);
+ void (* SchAddToDlHqRetxList)(SchDlHqProcCb *hqP);
+ void (* SchAddToUlHqRetxList)(SchUlHqProcCb *hqP);
+ void (* SchRemoveFrmDlHqRetxList)(SchUeCb *ueCb, CmLList *node);
+ void (* SchRemoveFrmUlHqRetxList)(SchUeCb *ueCb, CmLList *node);
+ uint8_t (* SchAddUeToSchedule)(SchCellCb *cellCb, uint16_t ueId);
+ void (* SchRemoveUeFrmScheduleLst)(SchCellCb *cell, CmLList *node);
+ uint8_t (* SchInitDlHqProcCb)(SchDlHqProcCb *hqP);
+ uint8_t (* SchInitUlHqProcCb)(SchUlHqProcCb *hqP);
+ void (* SchFreeDlHqProcCb)(SchDlHqProcCb *hqP);
+ void (* SchFreeUlHqProcCb)(SchUlHqProcCb *hqP);
+ void (* SchDeleteDlHqProcCb)(SchDlHqProcCb *hqP);
+ void (* SchDeleteUlHqProcCb)(SchUlHqProcCb *hqP);
+ void (* SchScheduleSlot)(SchCellCb *cell, SlotTimingInfo *slotInd, Inst schInst);
+ uint32_t (* SchScheduleDlLc)(SlotTimingInfo pdcchTime, SlotTimingInfo pdschTime, uint8_t pdschNumSymbols, \
+ uint16_t *startPrb, bool isRetx, SchDlHqProcCb **hqP);
+ uint8_t (* SchScheduleUlLc)(SlotTimingInfo dciTime, SlotTimingInfo puschTime, uint8_t startStmb, \
+ uint8_t symbLen, bool isRetx, SchUlHqProcCb **hqP);
+}SchAllApis;
+
+typedef struct schHqCfgParam
+{
+ uint8_t maxDlDataHqTx;
+ uint8_t maxMsg4HqTx;
+ uint8_t maxUlDataHqTx;
+}SchHqCfg;
+
+typedef struct
+{
+ /* parameters derived in scheduler */
+ uint8_t n0;
+ BwpCfg bwp;
+ PdcchCfg sib1PdcchCfg;
+ PdschCfg sib1PdschCfg;
+}SchSib1Cfg;
+
+typedef struct dlTotalPrbUsage
+{
+ uint16_t numPrbUsedForTx;
+ uint16_t totalPrbAvailForTx;
+}TotalPrbUsage;
+
+typedef struct
+{
+ TotalPrbUsage *dlTotalPrbUsage;
+ TotalPrbUsage *ulTotalPrbUsage;
+}SchKpiSupported;
+
+typedef struct
+{
+ CmLListCp dlTotPrbUseList;
+ CmLListCp ulTotPrbUseList;
+}SchKpiActive;
+
+typedef struct schStatsGrp
+{
+ Inst schInst;
+ uint64_t subscriptionId;
+ uint8_t groupId;
+ uint16_t periodicity; /* In milliseconds */
+ CmTimer periodTimer;
+ SchKpiSupported kpiStats;
+}SchStatsGrp;
+
+typedef struct schStatistics
+{
+ CmLListCp statsGrpList;
+ SchKpiActive activeKpiList;
+}SchStatistics;