ec2c5a8420c1714f3d5e7e9f7ef9006156085e16
[o-du/l2.git] / src / cm / mac_sch_interface.h
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17  *******************************************************************************/
18
19 /* events */
20 #define EVENT_SCH_GEN_CFG            1
21 #define EVENT_SCH_CELL_CFG           2
22 #define EVENT_SCH_CELL_CFG_CFM       3
23 #define EVENT_DL_SCH_INFO            4 
24 #define EVENT_UL_SCH_INFO            5 
25 #define EVENT_RACH_IND_TO_SCH        6
26 #define EVENT_CRC_IND_TO_SCH         7
27 #define EVENT_DL_RLC_BO_INFO_TO_SCH  8
28 #define EVENT_ADD_UE_CONFIG_REQ_TO_SCH   9
29 #define EVENT_UE_CONFIG_RSP_TO_MAC   10
30 #define EVENT_SLOT_IND_TO_SCH        11
31 #define EVENT_SHORT_BSR              12
32 #define EVENT_UCI_IND_TO_SCH         13
33 #define EVENT_MODIFY_UE_CONFIG_REQ_TO_SCH 14
34 #define EVENT_UE_RECONFIG_RSP_TO_MAC 15
35 #define EVENT_UE_DELETE_REQ_TO_SCH   16
36 #define EVENT_UE_DELETE_RSP_TO_MAC   17
37 #define EVENT_CELL_DELETE_REQ_TO_SCH 18
38 #define EVENT_CELL_DELETE_RSP_TO_MAC 19
39 #define EVENT_LONG_BSR               20
40 #define EVENT_SLICE_CFG_REQ_TO_SCH   21
41 #define EVENT_SLICE_CFG_RSP_TO_MAC   22
42 #define EVENT_SLICE_RECFG_REQ_TO_SCH 23
43 #define EVENT_SLICE_RECFG_RSP_TO_MAC 24
44 #define EVENT_RACH_RESOURCE_REQUEST_TO_SCH  25
45 #define EVENT_RACH_RESOURCE_RESPONSE_TO_MAC 26
46 #define EVENT_RACH_RESOURCE_RELEASE_TO_SCH  27
47 #define EVENT_PAGING_IND_TO_SCH      28
48 #define EVENT_DL_PAGING_ALLOC        29
49 #define EVENT_DL_REL_HQ_PROC         30 
50 #define EVENT_DL_HARQ_IND_TO_SCH     31
51 /*macros*/
52 #define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
53 #define SCH_SSB_MASK_SIZE   1
54
55 #define MAX_NUM_PRG     1 /* max value should be later 275 */
56 #define MAX_DIG_BF_INTERFACES 0 /* max value should be later 255 */
57 #define MAX_CODEWORDS  1  /* max should be 2 */
58 #define SCH_HARQ_PROC_ID 1 /* harq proc id */
59 #define SCH_ALLOC_TYPE_1 1 /*sch res alloc type */
60
61 /* Datatype in UL SCH Info */
62 #define SCH_DATATYPE_PUSCH 1
63 #define SCH_DATATYPE_PUSCH_UCI 2
64 #define SCH_DATATYPE_UCI 4
65 #define SCH_DATATYPE_SRS 8
66 #define SCH_DATATYPE_PRACH 16
67
68 #define MAX_NUMBER_OF_CRC_IND_BITS 1
69 #define MAX_NUMBER_OF_UCI_IND_BITS 1
70 #define MAX_SR_BITS_IN_BYTES       1
71 #define MAX_HARQ_BITS_IN_BYTES     1
72 #define MAX_NUM_LOGICAL_CHANNEL_GROUPS 8
73 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8   /* Max number of scheduling request config per cell group */
74 #define MAX_NUM_TAGS 4                  /* Max number of timing advance groups */
75 #define MAX_NUM_BWP  4                  /* Max number of BWP per serving cell */
76 #define MAX_NUM_CRSET  3                /* Max number of control resource set in add/modify/release list */
77 #define MAX_NUM_SEARCH_SPC  10          /* Max number of search space in add/modify/release list */
78 #define FREQ_DOM_RSRC_SIZE  6           /* i.e. 6 bytes because Size of frequency domain resource is 45 bits */
79 #define MONITORING_SYMB_WITHIN_SLOT_SIZE 2  /* i.e. 2 bytes because size of monitoring symbols within slot is 14 bits */
80 #define MAX_NUM_DL_ALLOC 16             /* Max number of pdsch time domain downlink allocation */
81 #define MAX_NUM_UL_ALLOC 16             /* Max number of pusch time domain uplink allocation */
82
83 /* PUCCH Configuration Macro */
84 #define MAX_NUM_PUCCH_RESRC 128
85 #define MAX_NUM_PUCCH_RESRC_SET 4
86 #define MAX_NUM_PUCCH_PER_RESRC_SET 32
87 #define MAX_NUM_SPATIAL_RELATIONS 8
88 #define MAX_NUM_PUCCH_P0_PER_SET 8
89 #define MAX_NUM_PATH_LOSS_REF_RS 4
90 #define MAX_NUM_DL_DATA_TO_UL_ACK 15
91 #define QPSK_MODULATION 2
92
93 #define RAR_PAYLOAD_SIZE 10             /* As per spec 38.321, sections 6.1.5 and 6.2.3, RAR PDU is 8 bytes long and 2 bytes of padding */
94 #define TX_PAYLOAD_HDR_LEN 32           /* Intel L1 requires adding a 32 byte header to transmitted payload */
95 #define UL_TX_BUFFER_SIZE 5
96
97 #define MAX_NUM_CONFIG_SLOTS 160  /*Max number of slots as per the numerology*/
98 #define MAX_NUM_K0_IDX 16 /* Max number of pdsch time domain downlink allocation */
99 #define MAX_NUM_K1_IDX 8  /* As per spec 38.213 section 9.2.3 Max number of PDSCH-to-HARQ resource indication */
100 #define MIN_NUM_K1_IDX 4  /* Min K1 values */
101 #define MAX_NUM_K2_IDX 16 /* PUSCH time domain UL resource allocation list */
102 #define DEFAULT_K0_VALUE 0 /* As per 38.331, PDSCH-TimeDomainResourceAllocation field descriptions */
103 /* As per 38.331, PUSCH-TimeDomainResourceAllocationList field descriptions */
104 #define DEFAULT_K2_VALUE_FOR_SCS15  1 
105 #define DEFAULT_K2_VALUE_FOR_SCS30  1 
106 #define DEFAULT_K2_VALUE_FOR_SCS60  2
107 #define DEFAULT_K2_VALUE_FOR_SCS120 3 
108
109 #define ADD_DELTA_TO_TIME(crntTime, toFill, incr, numOfSlot)          \
110 {                                                          \
111    if ((crntTime.slot + incr) > (numOfSlot - 1))           \
112    {                                                       \
113       toFill.sfn = (crntTime.sfn + 1);                     \
114    }                                                       \
115    else                                                    \
116    {                                                       \
117       toFill.sfn = crntTime.sfn;                           \
118    }                                                       \
119    toFill.slot = (crntTime.slot + incr) % numOfSlot;       \
120    if (toFill.sfn >= MAX_SFN)                              \
121    {                                                       \
122       toFill.sfn%=MAX_SFN;                                 \
123    }                                                       \
124 }
125
126 typedef enum
127 {
128    PRB_RSRC,
129    DRB_RSRC,
130    RRC_CONNECTED_USERS_RSRC
131 }SchResourceType;
132
133 typedef enum
134 {
135    SLICE_FOUND,
136    SLICE_NOT_FOUND
137 }RspCause;
138
139 typedef enum
140 {
141    NO_TRANSMISSION,
142    NEW_TRANSMISSION,
143    REPEATITION 
144 }PduTxOccsaion;
145
146 typedef enum
147 {
148    UNSPECIFIED_CAUSE,
149    INVALID_PARAM_VALUE,
150    RESOURCE_UNAVAILABLE,
151    SYSTEM_ERROR
152 }SchFailureCause;
153
154 typedef enum
155 {
156    SR_PROHIBIT_MS1,
157    SR_PROHIBIT_MS2,
158    SR_PROHIBIT_MS4,
159    SR_PROHIBIT_MS8,
160    SR_PROHIBIT_MS16,
161    SR_PROHIBIT_MS32,
162    SR_PROHIBIT_MS64,
163    SR_PROHIBIT_MS128
164 }SchSrProhibitTimer;
165
166 typedef enum
167 {
168    NOT_APPLICABLE,
169    INVALID_CELLID,
170    INVALID_UEID
171 }ErrorCause;
172
173 typedef enum
174 {
175    SR_TRANS_MAX_N4,
176    SR_TRANS_MAX_N8,
177    SR_TRANS_MAX_N16,
178    SR_TRANS_MAX_N32,
179    SR_TRANS_MAX_N64,
180    SR_TRANS_MAX_SPARE3,
181    SR_TRANS_MAX_SPARE2,
182    SR_TRANS_MAX_SPARE1
183 }SchSrTransMax;
184
185 typedef enum
186 {
187    TIME_ALIGNMENT_TIMER_MS500,
188    TIME_ALIGNMENT_TIMER_MS750,
189    TIME_ALIGNMENT_TIMER_MS1280,
190    TIME_ALIGNMENT_TIMER_MS1920,
191    TIME_ALIGNMENT_TIMER_MS2560,
192    TIME_ALIGNMENT_TIMER_MS5120,
193    TIME_ALIGNMENT_TIMER_MS10240,
194    TIME_ALIGNMENT_TIMER_INFINITE
195 }SchTimeAlignmentTimer;
196
197 typedef enum
198 {
199    PHR_PERIODIC_TIMER_SF10,
200    PHR_PERIODIC_TIMER_SF20,
201    PHR_PERIODIC_TIMER_SF50,
202    PHR_PERIODIC_TIMER_SF100,
203    PHR_PERIODIC_TIMER_SF200,
204    PHR_PERIODIC_TIMER_SF500,
205    PHR_PERIODIC_TIMER_SF1000,
206    PHR_PERIODIC_TIMER_INFINITE
207 }SchPhrPeriodicTimer;
208
209 typedef enum
210 {
211    PHR_PROHIBIT_TIMER_SF0,
212    PHR_PROHIBIT_TIMER_SF10,
213    PHR_PROHIBIT_TIMER_SF20,
214    PHR_PROHIBIT_TIMER_SF50,
215    PHR_PROHIBIT_TIMER_SF100,
216    PHR_PROHIBIT_TIMER_SF200,
217    PHR_PROHIBIT_TIMER_SF500,
218    PHR_PROHIBIT_TIMER_SF1000
219 }SchPhrProhibitTimer;
220
221 typedef enum
222 {
223    PHR_TX_PWR_FACTOR_CHANGE_DB1,
224    PHR_TX_PWR_FACTOR_CHANGE_DB3,
225    PHR_TX_PWR_FACTOR_CHANGE_DB6,
226    PHR_TX_PWR_FACTOR_CHANGE_INFINITE
227 }SchPhrTxPwrFactorChange;
228
229 typedef enum
230 {
231    PHR_MODE_REAL,
232    PHR_MODE_VIRTUAL
233 }SchPhrModeOtherCG;
234
235 typedef enum
236 {
237    HARQ_ACK_CODEBOOK_SEMISTATIC,
238    HARQ_ACK_CODEBOOK_DYNAMIC
239 }SchPdschHarqAckCodebook;
240
241 typedef enum
242 {
243    NUM_HARQ_PROC_FOR_PDSCH_N2,
244    NUM_HARQ_PROC_FOR_PDSCH_N4,
245    NUM_HARQ_PROC_FOR_PDSCH_N6,
246    NUM_HARQ_PROC_FOR_PDSCH_N10,
247    NUM_HARQ_PROC_FOR_PDSCH_N16
248 }SchNumHarqProcForPdsch;
249
250 typedef enum
251 {
252    MAX_CODE_BLOCK_GROUP_PER_TB_N2,
253    MAX_CODE_BLOCK_GROUP_PER_TB_N4,
254    MAX_CODE_BLOCK_GROUP_PER_TB_N6,
255    MAX_CODE_BLOCK_GROUP_PER_TB_N8
256 }SchMaxCodeBlkGrpPerTB;
257
258 typedef enum
259 {
260    PDSCH_X_OVERHEAD_XOH_6,
261    PDSCH_X_OVERHEAD_XOH_12,
262    PDSCH_X_OVERHEAD_XOH_18
263 }SchPdschXOverhead;
264
265 typedef enum
266 {
267    DMRS_ADDITIONAL_POS0,
268    DMRS_ADDITIONAL_POS1,
269    DMRS_ADDITIONAL_POS3
270 }SchDmrsAdditionPosition;
271
272 typedef enum
273 {
274    RESOURCE_ALLOCTION_TYPE_0,
275    RESOURCE_ALLOCTION_TYPE_1,
276    RESOURCE_ALLOCTION_DYN_SWITCH
277 }SchResourceAllocType;
278
279 typedef enum
280 {
281    TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_A,
282    TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_B
283 }SchTimeDomRsrcAllocMappingType;
284
285 typedef enum
286 {
287    ENABLED_TRANSFORM_PRECODER,
288    DISABLED_TRANSFORM_PRECODER
289 }SchTransformPrecoder;
290
291 typedef enum
292 {
293    INTERLEAVED_CCE_REG_MAPPING = 1,
294    NONINTERLEAVED_CCE_REG_MAPPING
295 }SchREGMappingType;
296
297 typedef enum
298 {
299    SLOT_PERIODICITY_AND_OFFSET_SL_1 = 1,
300    SLOT_PERIODICITY_AND_OFFSET_SL_2,
301    SLOT_PERIODICITY_AND_OFFSET_SL_4,
302    SLOT_PERIODICITY_AND_OFFSET_SL_5,
303    SLOT_PERIODICITY_AND_OFFSET_SL_8,
304    SLOT_PERIODICITY_AND_OFFSET_SL_10,
305    SLOT_PERIODICITY_AND_OFFSET_SL_16,
306    SLOT_PERIODICITY_AND_OFFSET_SL_20,
307    SLOT_PERIODICITY_AND_OFFSET_SL_40,
308    SLOT_PERIODICITY_AND_OFFSET_SL_80,
309    SLOT_PERIODICITY_AND_OFFSET_SL_160,
310    SLOT_PERIODICITY_AND_OFFSET_SL_320,
311    SLOT_PERIODICITY_AND_OFFSET_SL_640,
312    SLOT_PERIODICITY_AND_OFFSET_SL_1280,
313    SLOT_PERIODICITY_AND_OFFSET_SL_2560
314 }SchMSlotPeriodAndOffset;
315
316 typedef enum
317 {
318    SAME_AS_REG_BUNDLE,
319    ALL_CONTIGUOUS_RB
320 }SchPrecoderGranul;
321
322 typedef enum
323 {
324    SEARCH_SPACE_TYPE_COMMON = 1,
325    SEARCH_SPACE_TYPE_UE_SPECIFIC
326 }SchSearchSpaceType;
327
328 typedef enum
329 {
330    SCH_QOS_NON_DYNAMIC = 1,
331    SCH_QOS_DYNAMIC
332 }SchQosType;
333
334 typedef enum
335 {
336    AGGREGATION_LEVEL_N0,
337    AGGREGATION_LEVEL_N1,
338    AGGREGATION_LEVEL_N2,
339    AGGREGATION_LEVEL_N3,
340    AGGREGATION_LEVEL_N4,
341    AGGREGATION_LEVEL_N5,
342    AGGREGATION_LEVEL_N6,
343    AGGREGATION_LEVEL_N8
344 }SchAggrLevel;
345
346 typedef enum
347 {
348    RBG_SIZE_CONFIG_1,
349    RBG_SIZE_CONFIG_2
350 }SchRBGSize;
351
352 typedef enum
353 {
354    CODE_WORDS_SCHED_BY_DCI_N1,
355    CODE_WORDS_SCHED_BY_DCI_N2
356 }SchCodeWordsSchedByDci;
357
358 typedef enum
359 {
360    STATIC_BUNDLING_TYPE = 1,
361    DYNAMIC_BUNDLING_TYPE
362 }SchBundlingType;
363
364 typedef enum
365 {
366    SCH_SET1_SIZE_N4,
367    SCH_SET1_SIZE_WIDEBAND,
368    SCH_SET1_SIZE_N2_WIDEBAND,
369    SCH_SET1_SIZE_N4_WIDEBAND
370 }SchBundlingSizeSet1;
371
372 typedef enum
373 {
374    SCH_SET2_SIZE_N4,
375    SCH_SET2_SIZE_WIDEBAND
376 }SchBundlingSizeSet2;
377
378 typedef enum
379 {
380    DUPLEX_MODE_FDD,
381    DUPLEX_MODE_TDD
382 }SchDuplexMode;
383
384 typedef enum
385 {
386    SSB_PRDCTY_MS5,
387    SSB_PRDCTY_MS10,
388    SSB_PRDCTY_MS20,
389    SSB_PRDCTY_MS40,
390    SSB_PRDCTY_MS80,
391    SSB_PRDCTY_MS160
392 }SchSSBPeriod;
393
394 typedef enum
395 {
396    RSP_OK,
397    RSP_NOK
398 }SchMacRsp;
399
400 typedef enum
401 {
402    SHORT_BSR,
403    LONG_BSR,
404    SHORT_TRUNCATED_BSR,
405    LONG_TRUNCATED_BSR
406 }BsrType;
407
408 typedef enum
409 {
410    FORMAT0_0,
411    FORMAT0_1,
412    FORMAT1_0,
413    FORMAT1_1
414 }FormatType;
415
416 typedef enum
417 {
418    SCH_MCS_TABLE_QAM_64,
419    SCH_MCS_TABLE_QAM_256,
420    SCH_MCS_TABLE_QAM_64_LOW_SE
421 }SchMcsTable;
422
423 typedef enum
424 {
425    NONE,
426    PDCCH_PDU,
427    PDSCH_PDU,
428    BOTH
429 }DlPduType;
430
431 typedef enum
432 {
433    DATA_TRANSMISSION_ALLOWED,
434    STOP_DATA_TRANSMISSION,
435    RESTART_DATA_TRANSMISSION
436 }SchDataTransmission;
437
438 /*structures*/
439 typedef struct timeDomainAlloc
440 {
441    uint16_t startSymb;
442    uint16_t numSymb;
443 }TimeDomainAlloc;
444
445 typedef struct freqDomainAlloc
446 {
447    uint16_t startPrb;
448    uint16_t numPrb;
449 }FreqDomainAlloc;
450
451
452 typedef struct
453 {
454    uint32_t    ssbPbchPwr;       /* SSB block power */
455    uint8_t     scsCommon;           /* subcarrier spacing for common [0-3]*/
456    uint8_t     ssbOffsetPointA;  /* SSB sub carrier offset from point A */
457    SchSSBPeriod   ssbPeriod;        /* SSB Periodicity in msec */
458    uint8_t     ssbSubcOffset;    /* Subcarrier Offset(Kssb) */
459    uint32_t    nSSBMask[SCH_SSB_MASK_SIZE];      /* Bitmap for actually transmitted SSB. */
460    
461    /*Ref:Spec 38.331 "ssb-PositionsInBurst", Value 0 in Bitmap => corresponding SS/PBCH block is not transmitted
462     *value 1 => corresponding SS/PBCH block is transmitted*/
463    uint8_t     totNumSsb;       /*S = Total Number of Actual SSB transmitted*/
464 }SchSsbCfg;
465
466 typedef struct bwpCfg
467 {
468    uint8_t         subcarrierSpacing;
469    uint8_t         cyclicPrefix;
470    FreqDomainAlloc freqAlloc;   
471 }BwpCfg;
472
473 typedef struct prg
474 {
475    uint16_t pmIdx;
476    uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
477 } Prg;
478
479 typedef struct beamformingInfo
480 {
481    uint16_t numPrgs;
482    uint16_t prgSize;
483    uint8_t  digBfInterfaces;
484    Prg  prg[MAX_NUM_PRG];
485 } BeamformingInfo;
486
487 /* SIB1 PDSCH structures */
488
489 typedef struct codewordinfo
490 {
491    uint16_t targetCodeRate;
492    uint8_t  qamModOrder;
493    uint8_t  mcsIndex;
494    uint8_t  mcsTable;
495    uint8_t  rvIndex;
496    uint32_t tbSize;
497 } CodewordInfo;
498
499 typedef struct dmrsInfo
500 {
501    uint16_t dlDmrsSymbPos;
502    uint8_t  dmrsConfigType;
503    uint16_t dlDmrsScramblingId;
504    uint8_t  scid;
505    uint8_t  numDmrsCdmGrpsNoData;
506    uint16_t dmrsPorts;
507    uint8_t mappingType;
508    uint8_t nrOfDmrsSymbols;
509    uint8_t dmrsAddPos;
510 } DmrsInfo;
511
512 typedef struct pdschFreqAlloc
513 {
514    uint8_t  resourceAllocType;
515    /* since we are using type-1, rbBitmap excluded */
516    FreqDomainAlloc freqAlloc;
517    uint8_t  vrbPrbMapping;
518 } PdschFreqAlloc;
519
520 typedef struct pdschTimeAlloc
521 {
522    uint8_t         rowIndex;
523    TimeDomainAlloc timeAlloc;
524 } PdschTimeAlloc;
525
526 typedef struct txPowerPdschInfo
527 {
528    uint8_t powerControlOffset;
529    uint8_t powerControlOffsetSS;
530 } TxPowerPdschInfo;
531
532 typedef struct pdschCfg
533 {
534    uint16_t         pduBitmap;
535    uint16_t         rnti;
536    uint16_t         pduIndex;
537    uint8_t          numCodewords;
538    CodewordInfo     codeword[MAX_CODEWORDS];
539    uint16_t         dataScramblingId;
540    uint8_t          numLayers;
541    uint8_t          transmissionScheme;
542    uint8_t          refPoint;
543    DmrsInfo         dmrs;
544    PdschFreqAlloc   pdschFreqAlloc;
545    PdschTimeAlloc   pdschTimeAlloc;
546    BeamformingInfo  beamPdschInfo;
547    TxPowerPdschInfo txPdschPower;
548 } PdschCfg;
549 /* SIB1 PDSCH structures end */
550
551 /* SIB1 interface structure */
552
553 typedef struct coresetCfg
554 {
555    uint8_t coreSetSize;
556    uint8_t startSymbolIndex;
557    uint8_t durationSymbols;
558    uint8_t freqDomainResource[6];
559    uint8_t cceRegMappingType;
560    uint8_t regBundleSize;
561    uint8_t interleaverSize;
562    uint8_t coreSetType;
563    uint16_t shiftIndex;
564    uint8_t precoderGranularity;
565    uint8_t cceIndex;
566    uint8_t aggregationLevel;
567 } CoresetCfg;
568
569 typedef struct txPowerPdcchInfo
570 {
571    uint8_t powerValue;
572    uint8_t powerControlOffsetSS;
573 } TxPowerPdcchInfo;
574
575 typedef struct dlDCI
576 {
577    uint16_t rnti;
578    uint16_t scramblingId;
579    uint16_t scramblingRnti;
580    uint8_t cceIndex;
581    uint8_t aggregLevel;
582    BeamformingInfo beamPdcchInfo;
583    TxPowerPdcchInfo txPdcchPower;
584    PdschCfg     *pdschCfg;
585 } DlDCI;
586
587 typedef struct pdcchCfg
588 {
589    /* coreset-0 configuration */
590    CoresetCfg coresetCfg;
591
592    uint16_t numDlDci;
593    DlDCI    dci; /* as of now its only one DCI, later it will be numDlCi */
594 } PdcchCfg;
595 /* end of SIB1 PDCCH structures */
596
597 typedef struct pageCfg
598 {
599    uint8_t  numPO;                    /*Derived from Ns*/
600    bool     poPresent;                /*FirstPDCCH-MonitoringPO is present or not*/
601    uint16_t pagingOcc[MAX_PO_PER_PF]; /*FirstPDCCH-Monitoring Paging Occasion*/
602 }PageCfg;
603
604 typedef struct
605 {
606    /* parameters recieved from DU-APP */
607    uint16_t sib1PduLen;
608    uint16_t sib1RepetitionPeriod;
609    uint8_t  coresetZeroIndex;     /* derived from 4 LSB of pdcchSib1 present in MIB */
610    uint8_t  searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
611    uint16_t sib1Mcs;
612
613    /* parameters derived in scheduler */
614    uint8_t   n0;
615    BwpCfg    bwp;
616    PdcchCfg  sib1PdcchCfg;
617    PdschCfg  sib1PdschCfg;
618    PageCfg   pageCfg;         /*Config of Paging*/
619 }SchSib1Cfg;
620
621 typedef struct schRachCfg
622 {
623    uint8_t      prachCfgIdx;       /* PRACH config idx */
624    uint8_t      prachSubcSpacing;  /* Subcarrier spacing of RACH */
625    uint16_t     msg1FreqStart;     /* Msg1-FrequencyStart */
626    uint8_t      msg1Fdm;           /* PRACH FDM (1,2,4,8) */
627    uint8_t      rootSeqLen;        /* root sequence length */
628    uint16_t     rootSeqIdx;        /* Root sequence index */
629    uint8_t      numRootSeq;        /* Number of root sequences required for FD */
630    uint16_t     k1;                /* Frequency Offset for each FD */
631    uint8_t      totalNumRaPreamble; /* Total number of RA preambles */
632    uint8_t      ssbPerRach;        /* SSB per RACH occassion */
633    uint8_t      numCbPreamblePerSsb; /* Number of CB preamble per SSB */
634    uint8_t      prachMultCarrBand; /* Presence of Multiple carriers in Band */
635    uint8_t      raContResTmr;      /* RA Contention Resoultion Timer */
636    uint8_t      rsrpThreshSsb;     /* RSRP Threshold SSB */
637    uint8_t      raRspWindow;       /* RA Response Window */
638    uint8_t      maxMsg3Tx;         /* MAximum num of msg3 tx*/
639 }SchRachCfg;
640
641 typedef struct schBwpParams
642 {
643    FreqDomainAlloc freqAlloc;
644    uint8_t         scs;
645    uint8_t         cyclicPrefix;
646 }SchBwpParams;
647
648 typedef struct schCandidatesInfo
649 {
650    uint8_t aggLevel1;
651    uint8_t aggLevel2;
652    uint8_t aggLevel4;
653    uint8_t aggLevel8;
654    uint8_t aggLevel16;
655 }SchCandidatesInfo;
656
657 typedef struct schSearchSpaceCfg
658 {
659    uint8_t  searchSpaceId;
660    uint8_t  coresetId;
661    uint8_t  freqDomainRsrc[FREQ_DOM_RSRC_SIZE];  /* Frequency domain resource */
662    uint16_t monitoringSlot;
663    uint16_t duration;
664    uint16_t monitoringSymbol;
665    SchCandidatesInfo candidate;
666 }SchSearchSpaceCfg;
667
668 typedef struct schPdcchCfgCmn
669 {
670    SchSearchSpaceCfg commonSearchSpace;
671    uint8_t raSearchSpaceId;
672 }SchPdcchCfgCmn;
673
674 typedef struct schPdschCfgCmnTimeDomRsrcAlloc
675 {
676    uint8_t k0;
677    uint8_t mappingType;
678    uint8_t startSymbol;
679    uint8_t lengthSymbol;
680 }SchPdschCfgCmnTimeDomRsrcAlloc;
681
682 typedef struct schPdschCfgCmn
683 {
684    uint8_t   numTimeDomAlloc;
685    SchPdschCfgCmnTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_DL_ALLOC];
686 }SchPdschCfgCmn;
687
688 typedef struct schPucchCfgCmn
689 {
690    uint8_t pucchResourceCommon;
691    uint8_t pucchGroupHopping;
692 }SchPucchCfgCmn;
693
694 /* PUSCH Time Domain Resource Allocation */
695 typedef struct schPuschTimeDomRsrcAlloc
696 {
697    uint8_t   k2;
698    SchTimeDomRsrcAllocMappingType   mappingType;
699    uint8_t   startSymbol;
700    uint8_t   symbolLength;
701 }SchPuschTimeDomRsrcAlloc;
702
703 typedef struct schPuschCfgCmn
704 {
705    uint8_t                    numTimeDomRsrcAlloc;
706    SchPuschTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
707 }SchPuschCfgCmn;
708
709 typedef struct schK1TimingInfo
710 {
711    uint8_t numK1;
712    uint8_t k1Indexes[MAX_NUM_K1_IDX];
713 }SchK1TimingInfo;
714
715 typedef struct schK0TimingInfo
716 {
717    uint8_t k0Index;
718    SchK1TimingInfo k1TimingInfo;
719 }SchK0TimingInfo;
720
721 typedef struct schK0K1TimingInfo
722 {
723    uint8_t numK0;
724    SchK0TimingInfo k0Indexes[MAX_NUM_K0_IDX];
725 }SchK0K1TimingInfo;
726
727 typedef struct schK0K1TimingInfoTbl
728 {
729    uint16_t tblSize;
730    SchK0K1TimingInfo k0k1TimingInfo[MAX_NUM_CONFIG_SLOTS];
731 }SchK0K1TimingInfoTbl;
732
733 typedef struct schBwpDlCfg
734 {
735    SchBwpParams   bwp;
736    SchPdcchCfgCmn pdcchCommon;
737    SchPdschCfgCmn pdschCommon;
738    SchK0K1TimingInfoTbl k0K1InfoTbl;
739 }SchBwpDlCfg;
740
741 typedef struct schK2TimingInfo
742 {
743    uint8_t numK2; 
744    uint8_t k2Indexes[MAX_NUM_K2_IDX]; 
745 }SchK2TimingInfo;
746
747 typedef struct schK2TimingInfoTbl
748 {
749    uint16_t tblSize; 
750    SchK2TimingInfo k2TimingInfo[MAX_NUM_CONFIG_SLOTS]; 
751 }SchK2TimingInfoTbl;
752
753 typedef struct schBwpUlCfg
754 {
755    SchBwpParams   bwp;
756    SchPucchCfgCmn pucchCommon;
757    SchPuschCfgCmn puschCommon;
758    SchK2TimingInfoTbl msg3K2InfoTbl;
759    SchK2TimingInfoTbl k2InfoTbl;
760 }SchBwpUlCfg;
761
762 typedef struct schPlmnInfoList
763 {
764    Plmn           plmn;
765    uint8_t        numSliceSupport; /* Total slice supporting */
766    Snssai         **snssai;         /* List of supporting snssai*/
767 }SchPlmnInfoList;
768
769 typedef struct schHqCfgParam
770 {
771    uint8_t maxDlDataHqTx;
772    uint8_t maxMsg4HqTx;
773    uint8_t maxUlDataHqTx;
774 }SchHqCfg;
775
776 #ifdef NR_DRX
777 /* The following list of structures is taken from the DRX-Config section of specification 33.331. */
778
779 typedef struct schDrxOnDurationTimer
780 {
781    bool     onDurationTimerValInMs;
782    union
783    {
784       uint8_t  subMilliSeconds;
785       uint16_t milliSeconds;
786    }onDurationtimerValue;
787 }SchDrxOnDurationTimer;
788
789 typedef struct schDrxLongCycleStartOffset
790 {
791    uint16_t drxLongCycleStartOffsetChoice;
792    uint16_t drxLongCycleStartOffsetVal;
793 }SchDrxLongCycleStartOffset;
794
795 typedef struct schShortDrx
796 {
797    uint16_t   drxShortCycle;
798    uint8_t    drxShortCycleTimer;
799 }SchShortDrx;
800
801 typedef struct schDrxCfg
802 {
803    SchDrxOnDurationTimer       drxOnDurationTimer;
804    uint16_t                    drxInactivityTimer;
805    uint8_t                     drxHarqRttTimerDl;
806    uint8_t                     drxHarqRttTimerUl;
807    uint16_t                    drxRetransmissionTimerDl;
808    uint16_t                    drxRetransmissionTimerUl;
809    SchDrxLongCycleStartOffset  drxLongCycleStartOffset;
810    bool                        shortDrxPres;
811    SchShortDrx                 shortDrx;
812    uint8_t                     drxSlotOffset;
813 }SchDrxCfg;
814 #endif
815
816 typedef struct schCellCfg
817 {
818    uint16_t       cellId;           /* Cell Id */
819    uint16_t       phyCellId;        /* Physical cell id */
820    uint8_t        numerology;       /* Supported numerology */
821    SchDuplexMode  dupMode;          /* Duplex type: TDD/FDD */
822    uint8_t        bandwidth;        /* Supported B/W */
823    uint32_t       dlFreq;           /* DL Frequency */
824    uint32_t       ulFreq;           /* UL Frequency */
825    SchSsbCfg      ssbSchCfg;        /* SSB config */
826    SchSib1Cfg     sib1SchCfg;       /* SIB1 config */
827    SchRachCfg     schRachCfg;       /* PRACH config */
828    SchBwpDlCfg    schInitialDlBwp;  /* Initial DL BWP */
829    SchBwpUlCfg    schInitialUlBwp;  /* Initial UL BWP */
830    SchPlmnInfoList plmnInfoList;     /* Consits of PlmnId and Snssai list */
831    SchHqCfg       schHqCfg;
832 #ifdef NR_TDD
833    TDDCfg         tddCfg;           /* TDD Cfg */ 
834 #endif 
835 }SchCellCfg;
836
837 typedef struct schCellCfgCfm
838 {
839    uint16_t         cellId;     /* Cell Id */
840    SchMacRsp        rsp;   
841    SchFailureCause  cause;
842 }SchCellCfgCfm;
843
844 typedef struct ssbInfo
845 {
846    uint8_t         ssbIdx;          /* SSB Index */
847    TimeDomainAlloc tdAlloc; /* Time domain allocation */
848    FreqDomainAlloc fdAlloc; /* Freq domain allocation */
849 }SsbInfo;
850
851 typedef struct sib1AllocInfo
852 {
853    BwpCfg bwp;
854    PdcchCfg sib1PdcchCfg;
855    PdschCfg sib1PdschCfg;
856 } Sib1AllocInfo;
857
858 typedef struct prachSchInfo
859 {
860    uint8_t  numPrachOcas;   /* Num Prach Ocassions */
861    uint8_t  prachFormat;    /* PRACH Format */
862    uint8_t  numRa;          /* Freq domain ocassion */
863    uint8_t  prachStartSymb; /* Freq domain ocassion */
864 }PrachSchInfo;
865
866 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
867 typedef struct dlBrdcstAlloc
868 {
869    /* Ssb transmission is determined as follows:
870     * 0 : No tranamission
871     * 1 : SSB Transmission
872     * 2 : SSB Repetition */
873    uint8_t ssbTrans;
874    uint8_t ssbIdxSupported;
875    SsbInfo ssbInfo[MAX_SSB_IDX];
876    /* Sib1 transmission is determined as follows:
877     * 0 : No tranamission
878     * 1 : SIB1 Transmission
879     * 2 : SIB1 Repetition */
880    uint8_t sib1Trans;
881    Sib1AllocInfo sib1Alloc;
882 }DlBrdcstAlloc;
883
884 typedef struct msg3UlGrant
885 {
886    uint8_t         freqHopFlag;
887    uint16_t        bwpSize;
888    FreqDomainAlloc msg3FreqAlloc;
889    uint8_t         k2Index;
890    uint8_t         mcs;
891    uint8_t         tpc;
892    uint8_t         csiReq;
893 }Msg3UlGrant;
894
895 typedef struct rarInfo
896 {
897    uint16_t        raRnti;
898    uint8_t         RAPID;
899    uint16_t        ta;
900    Msg3UlGrant     ulGrant;
901    uint16_t        tcrnti;
902    uint8_t         rarPdu[RAR_PAYLOAD_SIZE];
903    uint8_t         rarPduLen;
904 }RarInfo;
905
906 typedef struct rarAlloc
907 {
908    DlPduType  pduPres;
909    uint8_t    pdschSlot;
910    RarInfo rarInfo;
911    BwpCfg  bwp;
912    PdcchCfg rarPdcchCfg;
913    PdschCfg rarPdschCfg;
914 }RarAlloc;
915
916 typedef struct dlMsgInfo
917 {
918    uint16_t crnti;
919    uint8_t  ndi;
920    uint8_t  harqProcNum;
921    uint8_t  dlAssignIdx;
922    uint8_t  pucchTpc;
923    uint8_t  pucchResInd;
924    uint8_t  harqFeedbackInd;
925    uint8_t  dciFormatId;
926    bool     isMsg4Pdu;
927    uint16_t  dlMsgPduLen;
928    uint8_t  *dlMsgPdu;
929 }DlMsgInfo;
930
931 typedef struct lcSchInfo
932 {
933    uint8_t   lcId;
934    uint32_t  schBytes; /* Number of scheduled bytes */
935 }LcSchInfo;
936
937 typedef struct dlMsgSchedInfo
938 {
939    bool       isRetx;
940    uint8_t    numLc;
941    LcSchInfo  lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
942    BwpCfg     bwp;
943    PdcchCfg   dlMsgPdcchCfg;
944    PdschCfg   dlMsgPdschCfg;
945    DlPduType  pduPres;
946    uint8_t    pdschSlot;
947    DlMsgInfo  dlMsgInfo;
948 }DlMsgSchInfo;
949
950 typedef struct dlMsgAlloc
951 {
952    uint16_t     crnti;
953    uint8_t      numSchedInfo;
954    DlMsgSchInfo dlMsgSchedInfo[2];
955 }DlMsgAlloc;
956
957 typedef struct schSlotValue
958 {
959    SlotTimingInfo currentTime;
960    SlotTimingInfo broadcastTime;
961    SlotTimingInfo rarTime;
962    SlotTimingInfo dlMsgTime;
963    SlotTimingInfo ulDciTime;
964 }SchSlotValue;
965
966 typedef struct format0_0
967 {
968    uint8_t         resourceAllocType;
969    /* since we are using type-1, hence rbBitmap excluded */
970    FreqDomainAlloc freqAlloc;
971    TimeDomainAlloc timeAlloc;
972    uint16_t        rowIndex;
973    uint8_t         mcs;
974    uint8_t         harqProcId;   /* HARQ Process ID */
975    bool            puschHopFlag;
976    bool            freqHopFlag;
977    uint8_t         ndi;    /* NDI */
978    uint8_t         rv;     /* Redundancy Version */
979    uint8_t         tpcCmd;
980    bool            sUlCfgd;
981 }Format0_0;
982
983 typedef struct format0_1
984 {
985 /* TBD */
986
987 }Format0_1;
988
989 typedef struct format1_0
990 {
991 /* TBD */
992
993 }Format1_0;
994
995 typedef struct format1_1
996 {
997 /* TBD */
998 }Format1_1;
999
1000 typedef struct dciInfo
1001 {
1002    uint16_t      cellId;   
1003    uint16_t      crnti;          /* CRNI */
1004    SlotTimingInfo   slotIndInfo;    /* Slot Info: sfn, slot number */
1005    BwpCfg        bwpCfg;         /* BWP Cfg */
1006    CoresetCfg    coresetCfg;     /* Coreset1 Cfg */
1007    FormatType    formatType;     /* DCI Format */
1008    union
1009    {
1010       Format0_0  format0_0;      /* Format 0_0 */
1011       Format0_1  format0_1;      /* Format 0_1 */
1012       Format1_0  format1_0;      /* Format 1_0 */
1013       Format1_1  format1_1;      /* Format 1_1 */
1014    }format;
1015    DlDCI    dciInfo;
1016 }DciInfo;
1017
1018
1019 typedef struct dlSchedInfo
1020 {
1021    uint16_t cellId;  /* Cell Id */
1022    SchSlotValue schSlotValue;
1023
1024    /* Allocation for broadcast messages */
1025    bool isBroadcastPres;
1026    DlBrdcstAlloc brdcstAlloc;
1027
1028    /* Allocation for RAR message */
1029    RarAlloc *rarAlloc[MAX_NUM_UE];
1030
1031    /* UL grant in response to BSR */
1032    DciInfo    *ulGrant;
1033
1034    /* Allocation from dedicated DL msg */
1035    DlMsgAlloc *dlMsgAlloc[MAX_NUM_UE];
1036
1037 }DlSchedInfo;
1038
1039 typedef struct dlPageAlloc
1040 {
1041    uint16_t       cellId;
1042    SlotTimingInfo dlPageTime;
1043    uint8_t        ssbIdx;
1044    bool           shortMsgInd;
1045    uint8_t        shortMsg;
1046    BwpCfg         bwp;
1047    PdcchCfg       pagePdcchCfg;
1048    PdschCfg       pagePdschCfg;
1049    uint16_t       dlPagePduLen;
1050    uint8_t        *dlPagePdu;
1051 }DlPageAlloc;
1052
1053 typedef struct tbInfo
1054 {
1055    uint8_t  qamOrder;  /* Modulation Order */
1056    uint8_t  mcs;       /* MCS */
1057    SchMcsTable  mcsTable;  /* MCS Table */
1058    uint8_t  ndi;       /* NDI */
1059    uint8_t  rv;        /* Redundancy Version */
1060    uint16_t tbSize;    /* TB Size */
1061 }TbInfo;
1062
1063 typedef struct schPuschInfo
1064 {
1065    uint16_t         crnti;
1066    uint8_t          harqProcId;   /* HARQ Process ID */
1067    uint8_t          resAllocType; /* Resource allocation type */
1068    FreqDomainAlloc  fdAlloc;      /* Freq domain allocation */
1069    TimeDomainAlloc  tdAlloc;      /* Time domain allocation */
1070    TbInfo           tbInfo;       /* TB info */
1071    uint8_t          dmrsMappingType;
1072    uint8_t          nrOfDmrsSymbols;
1073    uint8_t          dmrsAddPos;
1074 }SchPuschInfo;
1075
1076 typedef struct schPucchFormatCfg
1077 {
1078    uint8_t interSlotFreqHop;
1079    uint8_t addDmrs;
1080    uint8_t maxCodeRate;
1081    uint8_t numSlots;
1082    bool    pi2BPSK;
1083    bool    harqAckCSI;
1084 }SchPucchFormatCfg;
1085
1086 typedef struct schPucchInfo
1087 {
1088    uint16_t         rnti;
1089    uint8_t          pucchFormat;
1090    FreqDomainAlloc  fdAlloc;      /* Freq domain allocation */
1091    TimeDomainAlloc  tdAlloc;      /* Time domain allocation */
1092    uint8_t          srFlag;
1093    uint8_t          harqFlag;
1094    uint8_t          numHarqBits;
1095    uint8_t          uciFlag;
1096    uint8_t          numUciBits;
1097    uint8_t          intraFreqHop;
1098    uint16_t         secondPrbHop;
1099    uint8_t          initialCyclicShift;
1100    uint8_t          occLen;
1101    uint8_t          occIdx;
1102    uint8_t          timeDomOCC;
1103    SchPucchFormatCfg cmnFormatCfg;
1104 }SchPucchInfo;
1105
1106 typedef struct ulSchedInfo
1107 {
1108    uint16_t      cellId;         /* Cell Id */
1109    uint16_t      crnti;          /* CRNI */
1110    SlotTimingInfo   slotIndInfo;    /* Slot Info: sfn, slot number */
1111    uint8_t       dataType;       /* Type of info being scheduled */
1112    PrachSchInfo  prachSchInfo;   /* Prach scheduling info */
1113    SchPuschInfo  schPuschInfo;   /* Pusch scheduling info */
1114    SchPucchInfo  schPucchInfo;   /* Pusch scheduling info */
1115 }UlSchedInfo;
1116
1117 typedef struct rachIndInfo
1118 {
1119    uint16_t    cellId;
1120    uint16_t    crnti;
1121    SlotTimingInfo timingInfo;
1122    uint8_t     slotIdx;
1123    uint8_t     symbolIdx;
1124    uint8_t     freqIdx;
1125    uint8_t     preambleIdx;
1126    uint16_t    timingAdv;
1127 }RachIndInfo;
1128
1129
1130 typedef struct crcIndInfo
1131 {
1132    uint16_t    cellId;
1133    uint16_t    crnti;
1134    SlotTimingInfo timingInfo;
1135    uint16_t    numCrcInd;
1136    uint8_t     crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
1137 }CrcIndInfo;
1138
1139 typedef struct boInfo
1140 {
1141    uint8_t   lcId;
1142    uint32_t  dataVolume;
1143 }BOInfo;
1144
1145 typedef struct dlRlcBOInfo
1146 {
1147    uint16_t    cellId;
1148    uint16_t    crnti;
1149    uint8_t     lcId;
1150    uint32_t    dataVolume;
1151 }DlRlcBoInfo;
1152
1153 /* Info of Scheduling Request to Add/Modify */
1154 typedef struct schSchedReqInfo
1155 {
1156    uint8_t              schedReqId;
1157    SchSrProhibitTimer   srProhibitTmr;
1158    SchSrTransMax        srTransMax;
1159 }SchSchedReqInfo;
1160
1161 /* Scheduling Request Configuration */
1162 typedef struct schSchedReqCfg
1163 {
1164    uint8_t          addModListCount;
1165    SchSchedReqInfo  addModList[MAX_NUM_SR_CFG_PER_CELL_GRP];   /* List of Scheduling req to be added/modified */
1166    uint8_t          relListCount;
1167    uint8_t          relList[MAX_NUM_SR_CFG_PER_CELL_GRP];      /* list of scheduling request Id to be deleted */
1168 }SchSchedReqCfg;
1169
1170 /* Info of Tag to Add/Modify */
1171 typedef struct schTagInfo
1172 {
1173    uint8_t       tagId;
1174    SchTimeAlignmentTimer  timeAlignmentTmr;
1175 }SchTagInfo;
1176
1177 /* Timing Advance Group Configuration */
1178 typedef struct schTagCfg
1179 {
1180    uint8_t      addModListCount;
1181    SchTagInfo   addModList[MAX_NUM_TAGS];    /* List of Tag to Add/Modify */
1182    uint8_t      relListCount;
1183    uint8_t      relList[MAX_NUM_TAGS];       /* list of Tag Id to release */
1184 }SchTagCfg;
1185
1186 /* Configuration for Power headroom reporting */
1187 typedef struct schPhrCfg
1188 {
1189    SchPhrPeriodicTimer       periodicTmr;
1190    SchPhrProhibitTimer       prohibitTmr;
1191    SchPhrTxPwrFactorChange   txpowerFactorChange;
1192    bool                      multiplePhr;
1193    bool                      dummy;
1194    bool                      type2OtherCell;
1195    SchPhrModeOtherCG         modeOtherCG;
1196 }SchPhrCfg;
1197
1198 /* MAC cell Group configuration */
1199 typedef struct schMacCellGrpCfg
1200 {
1201    SchSchedReqCfg   schedReqCfg;
1202    SchTagCfg        tagCfg;
1203    SchPhrCfg        phrCfg;             /* To be used only if phrCfgSetupPres is true */      
1204 #ifdef NR_DRX
1205    bool             drxCfgPresent;
1206    SchDrxCfg        drxCfg;          /* Drx configuration */
1207 #endif
1208 }SchMacCellGrpCfg;
1209
1210 /* Physical Cell Group Configuration */
1211 typedef struct schPhyCellGrpCfg
1212 {
1213    SchPdschHarqAckCodebook    pdschHarqAckCodebook;
1214    int8_t     pNrFr1;
1215 }SchPhyCellGrpCfg;
1216
1217 /* Control resource set info */
1218 typedef struct schControlRsrcSet
1219 {
1220    uint8_t             cRSetId;                /* Control resource set id */
1221    uint8_t             freqDomainRsrc[FREQ_DOM_RSRC_SIZE];  /* Frequency domain resource */
1222    uint8_t             duration;
1223    SchREGMappingType   cceRegMappingType;
1224    SchPrecoderGranul   precoderGranularity;
1225    uint16_t            dmrsScramblingId;
1226 }SchControlRsrcSet;
1227
1228 /* Search Space info */
1229 typedef struct schSearchSpace
1230 {
1231    uint8_t                  searchSpaceId;
1232    uint8_t                  cRSetId;
1233    SchMSlotPeriodAndOffset  mSlotPeriodicityAndOffset;
1234    uint8_t                  mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
1235    SchAggrLevel             numCandidatesAggLevel1;      /* Number of candidates for aggregation level 1 */
1236    SchAggrLevel             numCandidatesAggLevel2;      /* Number of candidates for aggregation level 2 */
1237    SchAggrLevel             numCandidatesAggLevel4;      /* Number of candidates for aggregation level 4 */
1238    SchAggrLevel             numCandidatesAggLevel8;      /* Number of candidates for aggregation level 8 */
1239    SchAggrLevel             numCandidatesAggLevel16;     /* Number of candidates for aggregation level 16 */
1240    SchSearchSpaceType       searchSpaceType;
1241    uint8_t                  ueSpecificDciFormat;
1242 }SchSearchSpace;
1243
1244 /* PDCCH cofniguration */
1245 typedef struct schPdcchConfig
1246 {
1247    uint8_t           numCRsetToAddMod;
1248    SchControlRsrcSet  cRSetToAddModList[MAX_NUM_CRSET];           /* List of control resource set to add/modify */
1249    uint8_t           numCRsetToRel;
1250    uint8_t           cRSetToRelList[MAX_NUM_CRSET];              /* List of control resource set to release */
1251    uint8_t           numSearchSpcToAddMod;
1252    SchSearchSpace    searchSpcToAddModList[MAX_NUM_SEARCH_SPC];  /* List of search space to add/modify */
1253    uint8_t           numSearchSpcToRel;
1254    uint8_t           searchSpcToRelList[MAX_NUM_SEARCH_SPC];     /* List of search space to release */
1255 }SchPdcchConfig;
1256
1257 /* PDSCH time domain resource allocation */
1258 typedef struct schPdschTimeDomRsrcAlloc
1259 {
1260    uint8_t    *k0;
1261    SchTimeDomRsrcAllocMappingType    mappingType;
1262    uint8_t    startSymbol;
1263    uint8_t    symbolLength;
1264 }SchPdschTimeDomRsrcAlloc;
1265
1266
1267 typedef struct schPdschBundling
1268 {
1269    struct schStaticBundling
1270    {
1271      SchBundlingSizeSet2 size;
1272    }SchStaticBundling;
1273    struct schDynamicBundling
1274    {
1275      SchBundlingSizeSet1 sizeSet1;
1276      SchBundlingSizeSet2 sizeSet2;
1277    }SchDynamicBundling;
1278 }SchPdschBundling;
1279
1280 /* DMRS downlink configuration */
1281 typedef struct schDmrsDlCfg
1282 {
1283    SchDmrsAdditionPosition   addPos;       /* DMRS additional position */
1284 }SchDmrsDlCfg;
1285
1286 /* PDSCH Configuration */
1287 typedef struct schPdschConfig
1288 {
1289    SchDmrsDlCfg               dmrsDlCfgForPdschMapTypeA;
1290    SchResourceAllocType       resourceAllocType;
1291    uint8_t                    numTimeDomRsrcAlloc;
1292    SchPdschTimeDomRsrcAlloc   timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
1293    SchRBGSize                 rbgSize;
1294    SchCodeWordsSchedByDci     numCodeWordsSchByDci;                    /* Number of code words scheduled by DCI */
1295    SchBundlingType            bundlingType;
1296    SchPdschBundling           bundlingInfo;
1297 }SchPdschConfig;
1298
1299 /* Initial Downlink BWP */
1300 typedef struct schInitalDlBwp
1301 {
1302    bool             pdcchCfgPres;
1303    SchPdcchConfig   pdcchCfg;
1304    bool             pdschCfgPres;
1305    SchPdschConfig   pdschCfg;
1306    bool             k0K1TblPrsnt;
1307    SchK0K1TimingInfoTbl k0K1InfoTbl;
1308 }SchInitalDlBwp;
1309
1310 /* BWP Downlink common */
1311 typedef struct schBwpDlCommon
1312 {
1313 }SchBwpDlCommon;
1314
1315 /* Downlink BWP information */
1316 typedef struct schDlBwpInfo
1317 {
1318    uint8_t          bwpId;
1319 }SchDlBwpInfo;
1320
1321 /* PDCCH Serving Cell configuration */
1322 typedef struct schPdschServCellCfg
1323 {
1324    uint8_t                  *maxMimoLayers;           
1325    SchNumHarqProcForPdsch   numHarqProcForPdsch;
1326    SchMaxCodeBlkGrpPerTB    *maxCodeBlkGrpPerTb;
1327    bool                     *codeBlkGrpFlushInd;
1328    SchPdschXOverhead        *xOverhead;
1329 }SchPdschServCellCfg;
1330
1331 /* PUCCH Configuration */
1332 typedef struct schPucchResrcSetInfo
1333 {
1334    uint8_t resrcSetId;
1335    uint8_t resrcListCount;
1336    uint8_t resrcList[MAX_NUM_PUCCH_PER_RESRC_SET];
1337    uint8_t maxPayLoadSize;
1338 }SchPucchResrcSetInfo;
1339
1340 typedef struct schPucchResrcSetCfg
1341 {
1342    uint8_t resrcSetToAddModListCount;
1343    SchPucchResrcSetInfo resrcSetToAddModList[MAX_NUM_PUCCH_RESRC_SET];
1344    uint8_t resrcSetToRelListCount;
1345    uint8_t resrcSetToRelList[MAX_NUM_PUCCH_RESRC];
1346 }SchPucchResrcSetCfg;
1347
1348 typedef struct schPucchFormat0
1349 {
1350    uint8_t initialCyclicShift;
1351    uint8_t numSymbols;
1352    uint8_t startSymbolIdx;
1353 }SchPucchFormat0;
1354
1355 typedef struct schPucchFormat1
1356 {
1357    uint8_t initialCyclicShift;
1358    uint8_t numSymbols;
1359    uint8_t startSymbolIdx;
1360    uint8_t timeDomOCC;
1361 }SchPucchFormat1;
1362
1363 typedef struct schPucchFormat2_3
1364 {
1365    uint8_t numPrbs;
1366    uint8_t numSymbols;
1367    uint8_t startSymbolIdx;
1368 }SchPucchFormat2_3;
1369
1370 typedef struct schPucchFormat4
1371 {
1372    uint8_t numSymbols;
1373    uint8_t occLen;
1374    uint8_t occIdx;
1375    uint8_t startSymbolIdx;
1376 }SchPucchFormat4;
1377
1378 typedef struct schPucchResrcInfo
1379 {
1380    uint8_t  resrcId;
1381    uint16_t startPrb;
1382    uint8_t  intraFreqHop;
1383    uint16_t secondPrbHop;
1384    uint8_t  pucchFormat;
1385    union{
1386       SchPucchFormat0   *format0; 
1387       SchPucchFormat1   *format1;
1388       SchPucchFormat2_3 *format2;
1389       SchPucchFormat2_3 *format3;
1390       SchPucchFormat4   *format4;
1391    }SchPucchFormat;
1392 }SchPucchResrcInfo;
1393
1394 typedef struct schPucchResrcCfg
1395 {
1396    uint8_t resrcToAddModListCount;
1397    SchPucchResrcInfo resrcToAddModList[MAX_NUM_PUCCH_RESRC];
1398    uint8_t resrcToRelListCount;
1399    uint8_t resrcToRelList[MAX_NUM_PUCCH_RESRC];
1400 }SchPucchResrcCfg;
1401
1402
1403 typedef struct schSchedReqResrcInfo
1404 {
1405    uint8_t resrcId;
1406    uint8_t requestId;
1407    uint8_t periodicity;
1408    uint16_t offset;
1409    uint8_t resrc;
1410 }SchSchedReqResrcInfo;
1411
1412 typedef struct schPucchSchedReqCfg
1413 {
1414    uint8_t           schedAddModListCount;
1415    SchSchedReqResrcInfo schedAddModList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1416    uint8_t           schedRelListCount;
1417    uint8_t           schedRelList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1418 }SchPucchSchedReqCfg;
1419
1420 typedef struct schSpatialRelationInfo
1421 {
1422    uint8_t spatialRelationId;
1423    uint8_t servCellIdx;
1424    uint8_t pathLossRefRSId;
1425    uint8_t p0PucchId;
1426    uint8_t closeLoopIdx;
1427 }SchSpatialRelationInfo;
1428
1429 typedef struct schPucchSpatialCfg
1430 {
1431    uint8_t spatialAddModListCount;
1432    SchSpatialRelationInfo spatialAddModList[MAX_NUM_SPATIAL_RELATIONS];
1433    uint8_t spatialRelListCount;
1434    uint8_t spatialRelList[MAX_NUM_SPATIAL_RELATIONS];
1435 }SchPucchSpatialCfg;
1436
1437 typedef struct schP0PucchCfg
1438 {
1439    uint8_t p0PucchId;
1440    int     p0PucchVal;
1441 }SchP0PucchCfg;
1442
1443 typedef struct schPathLossRefRSCfg
1444 {
1445    uint8_t pathLossRefRSId;
1446 }SchPathLossRefRSCfg;
1447
1448 typedef struct schPucchMultiCsiCfg
1449 {
1450    uint8_t  multiCsiResrcListCount;
1451    uint8_t  multiCsiResrcList[MAX_NUM_PUCCH_RESRC-1];
1452 }SchPucchMultiCsiCfg;
1453
1454 typedef struct schPucchDlDataToUlAck
1455 {
1456    uint8_t  dlDataToUlAckListCount;
1457    uint8_t  dlDataToUlAckList[MAX_NUM_DL_DATA_TO_UL_ACK];
1458 }SchPucchDlDataToUlAck;
1459
1460 typedef struct schPucchPowerControl
1461 {
1462    int deltaF_Format0;
1463    int deltaF_Format1;
1464    int deltaF_Format2;
1465    int deltaF_Format3;
1466    int deltaF_Format4;
1467    uint8_t p0SetCount;
1468    SchP0PucchCfg p0Set[MAX_NUM_PUCCH_P0_PER_SET];
1469    uint8_t pathLossRefRSListCount;
1470    SchPathLossRefRSCfg pathLossRefRSList[MAX_NUM_PATH_LOSS_REF_RS];
1471 }SchPucchPowerControl;
1472
1473 typedef struct schPucchCfg
1474 {
1475    SchPucchResrcSetCfg   *resrcSet;
1476    SchPucchResrcCfg      *resrc;
1477    SchPucchFormatCfg     *format1; 
1478    SchPucchFormatCfg     *format2; 
1479    SchPucchFormatCfg     *format3; 
1480    SchPucchFormatCfg     *format4;
1481    SchPucchSchedReqCfg   *schedReq;
1482    SchPucchMultiCsiCfg   *multiCsiCfg;
1483    SchPucchSpatialCfg    *spatialInfo;
1484    SchPucchDlDataToUlAck *dlDataToUlAck;
1485    SchPucchPowerControl  *powerControl;
1486 }SchPucchCfg;
1487
1488 /* Transform precoding disabled */
1489 typedef struct schTransPrecodDisabled
1490 {
1491    uint16_t   scramblingId0;
1492 }SchTransPrecodDisabled;
1493
1494 /* DMRS Uplink configuration */
1495 typedef struct SchDmrsUlCfg
1496 {
1497    SchDmrsAdditionPosition    addPos;               /* DMRS additional position */
1498    SchTransPrecodDisabled     transPrecodDisabled;  /* Transform precoding disabled */
1499 }SchDmrsUlCfg;
1500
1501 /* PUSCH Configuration */
1502 typedef struct schPuschCfg
1503 {
1504    uint8_t                    dataScramblingId;
1505    SchDmrsUlCfg               dmrsUlCfgForPuschMapTypeA;
1506    SchResourceAllocType       resourceAllocType;
1507    uint8_t                    numTimeDomRsrcAlloc;
1508    SchPuschTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1509    SchTransformPrecoder       transformPrecoder;
1510 }SchPuschCfg;
1511
1512 /* Initial Uplink BWP */
1513 typedef struct schInitialUlBwp
1514 {
1515    bool          pucchCfgPres;
1516    SchPucchCfg   pucchCfg;
1517    bool          puschCfgPres;
1518    SchPuschCfg   puschCfg;
1519    bool          k2TblPrsnt;
1520    SchK2TimingInfoTbl k2InfoTbl;
1521 }SchInitialUlBwp;
1522
1523 /* Uplink BWP information */
1524 typedef struct schUlBwpInfo
1525 {
1526    uint8_t        bwpId;
1527 }SchUlBwpInfo;
1528
1529 /* Serving cell configuration */
1530 typedef struct schServCellRecfgInfo
1531 {
1532    SchInitalDlBwp        initDlBwp;
1533    uint8_t               numDlBwpToAddOrMod;
1534    SchDlBwpInfo          dlBwpToAddOrModList[MAX_NUM_BWP];
1535    uint8_t               numDlBwpToRel;
1536    SchDlBwpInfo          dlBwpToRelList[MAX_NUM_BWP];
1537    uint8_t               firstActvDlBwpId;
1538    uint8_t               defaultDlBwpId;
1539    uint8_t               *bwpInactivityTmr;
1540    SchPdschServCellCfg   pdschServCellCfg;
1541    SchInitialUlBwp       initUlBwp;
1542    uint8_t               numUlBwpToAddOrMod;
1543    SchUlBwpInfo          ulBwpToAddOrModList[MAX_NUM_BWP];
1544    uint8_t               numUlBwpToRel;
1545    SchUlBwpInfo          ulBwpToRelList[MAX_NUM_BWP];
1546    uint8_t               firstActvUlBwpId;
1547 }SchServCellRecfgInfo;
1548
1549 /* Serving cell configuration */
1550 typedef struct schServCellCfgInfo
1551 {
1552    SchInitalDlBwp        initDlBwp;
1553    uint8_t               numDlBwpToAdd;
1554    SchDlBwpInfo          dlBwpToAddList[MAX_NUM_BWP];
1555    uint8_t               firstActvDlBwpId;
1556    uint8_t               defaultDlBwpId;
1557    uint8_t               *bwpInactivityTmr;
1558    SchPdschServCellCfg   pdschServCellCfg;
1559    SchInitialUlBwp       initUlBwp;
1560    uint8_t               numUlBwpToAdd;
1561    SchUlBwpInfo          ulBwpToAddList[MAX_NUM_BWP];
1562    uint8_t               firstActvUlBwpId;
1563 }SchServCellCfgInfo;
1564
1565 typedef struct schNonDynFiveQi
1566 {
1567    uint16_t   fiveQi;
1568    uint8_t    priorLevel;
1569    uint16_t   avgWindow;
1570    uint16_t   maxDataBurstVol;
1571 }SchNonDynFiveQi;
1572
1573 typedef struct schDynFiveQi
1574 {
1575    uint8_t    priorLevel;
1576    uint16_t   packetDelayBudget;
1577    uint8_t    packetErrRateScalar;
1578    uint8_t    packetErrRateExp;
1579    uint16_t   fiveQi;
1580    uint8_t    delayCritical;
1581    uint16_t   avgWindow;
1582    uint16_t   maxDataBurstVol;
1583 }SchDynFiveQi;
1584
1585 typedef struct schNgRanAllocAndRetPri
1586 {
1587    uint8_t priorityLevel;
1588    uint8_t preEmptionCap;
1589    uint8_t preEmptionVul;
1590 }SchNgRanAllocAndRetPri;
1591
1592 typedef struct schGrbQosFlowInfo
1593 {
1594    uint32_t maxFlowBitRateDl;
1595    uint32_t maxFlowBitRateUl;
1596    uint32_t guarFlowBitRateDl;
1597    uint32_t guarFlowBitRateUl;
1598 }SchGrbQosFlowInfo;
1599
1600 /* DRB QoS */
1601 typedef struct schDrbQos
1602 {
1603    SchQosType  fiveQiType;   /* Dynamic or non-dynamic */ 
1604    union
1605    {
1606       SchNonDynFiveQi   nonDyn5Qi;
1607       SchDynFiveQi      dyn5Qi;
1608    }u;
1609    SchNgRanAllocAndRetPri  ngRanRetPri;
1610    SchGrbQosFlowInfo       grbQosFlowInfo;
1611    uint16_t                pduSessionId;
1612    uint32_t                ulPduSessAggMaxBitRate;   /* UL PDU Session Aggregate max bit rate */
1613 }SchDrbQosInfo;
1614
1615 /* Special cell configuration */
1616 typedef struct schSpCellCfg
1617 {
1618    uint8_t           servCellIdx;
1619    SchServCellCfgInfo   servCellCfg;
1620 }SchSpCellCfg;
1621
1622 /* Special cell Reconfiguration */
1623 typedef struct schSpCellRecfg
1624 {
1625    uint8_t           servCellIdx;
1626    SchServCellRecfgInfo   servCellRecfg;
1627 }SchSpCellRecfg;
1628
1629 /* Uplink logical channel configuration */
1630 typedef struct SchUlLcCfg
1631 {
1632    uint8_t priority;
1633    uint8_t lcGroup;
1634    uint8_t schReqId;
1635    uint8_t pbr;        // prioritisedBitRate
1636    uint8_t bsd;        // bucketSizeDuration
1637 }SchUlLcCfg;
1638
1639 /* Downlink logical channel configuration */
1640 typedef struct schDlLcCfg
1641 {
1642    uint8_t lcp;      // logical Channel Prioritization
1643 }SchDlLcCfg;
1644
1645 /* Logical Channel configuration */
1646 typedef struct schLcCfg
1647 {
1648    uint8_t        lcId;
1649    Snssai         *snssai;
1650    SchDrbQosInfo  *drbQos;
1651    SchDlLcCfg     dlLcCfg;
1652    SchUlLcCfg     ulLcCfg;
1653 }SchLcCfg;
1654
1655 /* Aggregate max bit rate */
1656 typedef struct schAmbrCfg
1657 {
1658    uint32_t   ulBr;   /* Ul BitRate */
1659 }SchAmbrCfg;
1660
1661 typedef struct schModulationInfo
1662 {
1663    uint8_t      modOrder;
1664    uint8_t      mcsIndex;
1665    SchMcsTable  mcsTable;
1666 }SchModulationInfo;
1667
1668 /* UE configuration */
1669 typedef struct schUeCfgReq
1670 {
1671    uint16_t        cellId;
1672    uint8_t         ueId;
1673    uint8_t         beamIdx; 
1674    uint16_t        crnti;
1675    bool macCellGrpCfgPres;
1676    SchMacCellGrpCfg   macCellGrpCfg;
1677    bool phyCellGrpCfgPres;
1678    SchPhyCellGrpCfg   phyCellGrpCfg;
1679    bool spCellCfgPres;
1680    SchSpCellCfg       spCellCfg;
1681    SchAmbrCfg         *ambrCfg;
1682    SchModulationInfo  dlModInfo;
1683    SchModulationInfo  ulModInfo;
1684    uint8_t            numLcsToAdd;
1685    SchLcCfg           schLcCfg[MAX_NUM_LC];
1686 }SchUeCfgReq;
1687
1688 /* UE Re-configuration */
1689 typedef struct schUeRecfgReq
1690 {
1691    uint16_t         cellId;
1692    uint8_t          ueId;
1693    uint8_t          beamIdx;
1694    uint16_t         crnti;
1695    bool             macCellGrpRecfgPres;
1696    SchMacCellGrpCfg macCellGrpRecfg;
1697    bool             phyCellGrpRecfgPres;
1698    SchPhyCellGrpCfg phyCellGrpRecfg;
1699    bool             spCellRecfgPres;
1700    SchSpCellRecfg   spCellRecfg;
1701    SchAmbrCfg       *ambrRecfg;
1702    SchModulationInfo  dlModInfo;
1703    SchModulationInfo  ulModInfo;
1704    uint8_t            numLcsToAdd;
1705    SchLcCfg           schLcCfgAdd[MAX_NUM_LC];
1706    uint8_t            numLcsToDel;
1707    uint8_t            lcIdToDel[MAX_NUM_LC];
1708    uint8_t            numLcsToMod;
1709    SchLcCfg           schLcCfgMod[MAX_NUM_LC];
1710    SchDataTransmission dataTransmissionInfo;
1711 #ifdef NR_DRX   
1712    bool     drxConfigIndicatorRelease;
1713 #endif
1714 }SchUeRecfgReq;
1715
1716 typedef struct schUeCfgRsp
1717 {
1718    uint16_t   cellId;
1719    uint8_t    beamIdx;
1720    uint16_t   ueId;
1721    uint16_t   crnti;
1722    SchMacRsp  rsp;
1723    SchFailureCause cause;
1724 }SchUeCfgRsp;
1725
1726 /*As per WG8, UE ReCFG and UECFG have same structure definition*/
1727 typedef struct schUeCfgRsp SchUeRecfgRsp;
1728
1729 typedef struct schRachRsrcReq
1730 {
1731    SlotTimingInfo slotInd;
1732    uint16_t       cellId;
1733    uint16_t       crnti;
1734    uint8_t        numSsb;
1735    uint8_t        ssbIdx[MAX_NUM_SSB];
1736 }SchRachRsrcReq;
1737
1738 typedef struct schCfraSsbResource
1739 {
1740    uint8_t  ssbIdx;
1741    uint8_t  raPreambleIdx;
1742 }SchCfraSsbResource;
1743
1744 typedef struct schCfraRsrc
1745 {
1746    uint8_t   numSsb;
1747    SchCfraSsbResource ssbResource[MAX_NUM_SSB];
1748 }SchCfraResource;
1749
1750 typedef struct schRachRsrcRsp
1751 {
1752    uint16_t   cellId;
1753    uint16_t   crnti;
1754    SchMacRsp  result;
1755    SchCfraResource  cfraResource;
1756 }SchRachRsrcRsp;
1757
1758 typedef struct schRachRsrcRel
1759 {
1760    SlotTimingInfo slotInd;
1761    uint16_t   cellId;
1762    uint16_t   crnti;
1763    SchCfraResource  cfraResource;
1764 }SchRachRsrcRel;
1765
1766 typedef struct schUeDelete
1767 {
1768    uint16_t   cellId;
1769    uint16_t   crnti;
1770 }SchUeDelete;
1771
1772 typedef struct schUeDeleteRsp
1773 {
1774    uint16_t   cellId;
1775    uint16_t   crnti;
1776    SchMacRsp  rsp;
1777    ErrorCause cause;
1778 }SchUeDeleteRsp;
1779
1780 typedef struct schCellDeleteReq 
1781 {
1782    uint16_t   cellId;
1783 }SchCellDeleteReq;
1784
1785
1786 typedef struct schCellDeleteRsp
1787 {
1788    uint16_t        cellId;
1789    SchMacRsp       rsp;
1790    SchFailureCause cause;
1791 }SchCellDeleteRsp;
1792
1793 typedef struct dataVolInfo
1794 {
1795    uint8_t  lcgId;
1796    uint32_t dataVol;
1797 }DataVolInfo;
1798
1799 typedef struct ulBufferStatusRptInd
1800 {
1801    uint16_t    cellId;
1802    uint16_t    crnti;
1803    BsrType     bsrType;
1804    uint8_t     numLcg;
1805    DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
1806 }UlBufferStatusRptInd;
1807
1808 typedef struct srUciIndInfo
1809 {
1810    uint16_t    cellId;
1811    uint16_t    crnti;
1812    SlotTimingInfo slotInd;
1813    uint8_t     numSrBits;
1814    uint8_t     srPayload[MAX_SR_BITS_IN_BYTES];
1815 }SrUciIndInfo;
1816
1817 typedef struct dlHarqInd
1818 {
1819    uint16_t    cellId;
1820    uint16_t    crnti;
1821    SlotTimingInfo slotInd;
1822    uint8_t     numHarq;
1823    uint8_t     harqPayload[MAX_HARQ_BITS_IN_BYTES];
1824 }DlHarqInd;
1825
1826 typedef struct schRrmPolicyRatio
1827 {
1828    uint8_t maxRatio;
1829    uint8_t minRatio;
1830    uint8_t dedicatedRatio;
1831 }SchRrmPolicyRatio;
1832
1833 typedef struct schRrmPolicyOfSlice
1834 {
1835    Snssai  snssai;
1836    SchRrmPolicyRatio rrmPolicyRatioInfo;
1837 }SchRrmPolicyOfSlice;
1838
1839 typedef struct schSliceCfgReq
1840 {
1841    uint8_t  numOfConfiguredSlice;
1842    SchRrmPolicyOfSlice **listOfSlices;
1843 }SchSliceCfgReq;
1844
1845 typedef struct sliceRsp
1846 {
1847    Snssai     snssai;
1848    SchMacRsp  rsp;
1849    RspCause   cause;
1850 }SliceRsp;
1851
1852 typedef struct schSliceCfgRsp
1853 {
1854    uint8_t    numSliceCfgRsp;
1855    SliceRsp   **listOfSliceCfgRsp;
1856 }SchSliceCfgRsp;
1857
1858 /*As per ORAN-WG8, Slice Cfg and Recfg are same structures*/
1859 typedef struct schSliceCfgReq SchSliceRecfgReq;
1860 typedef struct schSliceCfgRsp SchSliceRecfgRsp;
1861
1862 typedef struct schPageInd
1863 {
1864    uint16_t  cellId;
1865    uint16_t  pf;
1866    uint8_t   i_s;
1867    uint16_t  pduLen;
1868    uint8_t  *pagePdu;
1869 }SchPageInd;
1870
1871 typedef struct schUeHqInfo
1872 {
1873    uint16_t  crnti;
1874    uint8_t   hqProcId;
1875 }SchUeHqInfo;
1876
1877 typedef struct schRlsHqInfo
1878 {
1879    uint16_t     cellId;
1880    uint8_t      numUes;
1881    SchUeHqInfo  *ueHqInfo;
1882 }SchRlsHqInfo;
1883
1884 /* function pointers */
1885 typedef uint8_t (*SchCellCfgCfmFunc)    ARGS((
1886          Pst            *pst,           /* Post Structure */                         
1887          SchCellCfgCfm  *schCellCfgCfm  /* Cell Cfg Cfm */
1888          ));
1889
1890 typedef uint8_t (*SchCellCfgFunc)    ARGS((
1891          Pst         *pst,           /* Post Structure */                         
1892          SchCellCfg  *schCellCfg     /* Cell Cfg  */
1893          ));
1894
1895 typedef uint8_t (*SchMacDlAllocFunc)     ARGS((                     
1896          Pst            *pst,          /* Post Structure */                         
1897          DlSchedInfo    *dlSchedInfo   /* dl allocation Info */                      
1898          ));
1899
1900 typedef uint8_t (*SchMacDlPageAllocFunc)     ARGS(( 
1901          Pst            *pst,          /* Post Structure */
1902          DlPageAlloc *dlPageAlloc      /* dl Page allocation Info */
1903          ));
1904
1905 typedef uint8_t (*SchMacUlSchInfoFunc)     ARGS((                     
1906          Pst         *pst,           /* Post Structure */                         
1907          UlSchedInfo *ulSchedInfo    /* UL Alloc Sch  Info */                      
1908          ));
1909
1910 typedef uint8_t (*MacSchRachIndFunc) ARGS((
1911          Pst         *pst,         /* Post structure */
1912          RachIndInfo *rachInd));    /* Rach Indication Info */
1913
1914 typedef uint8_t (*MacSchCrcIndFunc) ARGS(( 
1915          Pst         *pst,         /* Post structure */
1916          CrcIndInfo  *crcInd));     /* CRC Info */
1917
1918 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
1919          Pst         *pst,         /* Post structure */
1920          DlRlcBoInfo *dlBoInfo));   /* DL BO Info */
1921
1922 typedef uint8_t (*MacSchAddUeConfigReqFunc) ARGS((
1923          Pst         *pst,           /* Post structure */
1924          SchUeCfgReq    *ueCfgToSch));   /* Scheduler UE Cfg */
1925
1926 typedef uint8_t (*SchUeCfgRspFunc) ARGS((
1927          Pst         *pst,           /* Post structure */
1928          SchUeCfgRsp *cfgRsp));       /* Scheduler UE Cfg response */
1929
1930 typedef uint8_t (*MacSchSlotIndFunc) ARGS((
1931          Pst         *pst,          /* Post structure */
1932          SlotTimingInfo *slotInd));    /* Slot Info */
1933
1934 typedef uint8_t (*MacSchBsrFunc)       ARGS((
1935    Pst                  *pst,
1936    UlBufferStatusRptInd *bsrInd
1937 ));
1938
1939 typedef uint8_t (*MacSchDlHarqIndFunc) ARGS((
1940          Pst         *pst,         /* Post structure */
1941          DlHarqInd  *dlHarqInd));  /* Dl HARQ IND Info */
1942
1943 typedef uint8_t (*MacSchSrUciIndFunc) ARGS(( 
1944          Pst         *pst,         /* Post structure */
1945          SrUciIndInfo  *uciInd));    /* UCI IND Info */
1946
1947 typedef uint8_t (*MacSchModUeConfigReqFunc) ARGS((
1948          Pst         *pst,           /* Post structure */
1949          SchUeRecfgReq    *ueRecfgToSch));   /* Scheduler UE Recfg */
1950
1951 typedef uint8_t (*SchUeRecfgRspFunc) ARGS((
1952          Pst         *pst,           /* Post structure */
1953          SchUeRecfgRsp *recfgRsp));       /* Scheduler UE Cfg response */
1954
1955 typedef uint8_t (*MacSchRachRsrcReqFunc) ARGS((
1956     Pst         *pst,                    /* Post structure */
1957     SchRachRsrcReq *schRachRsrcReq));    /* RACH resource request to SCH */
1958
1959 typedef uint8_t (*SchRachRsrcRspFunc) ARGS((
1960    Pst            *pst,                 /* Post structure */
1961    SchRachRsrcRsp *schRachRsrcRsp));    /* RACH resource request to MAC */
1962
1963 typedef uint8_t (*MacSchRachRsrcRelFunc) ARGS((
1964    Pst         *pst,                    /* Post structure */
1965    SchRachRsrcRel *schRachRsrcRel));    /* RACH resource release to SCH */
1966
1967 typedef uint8_t (*MacSchUeDeleteReqFunc) ARGS((
1968    Pst         *pst,           /* Post structure */
1969    SchUeDelete *schUeDel)); /*Scheduler UE Del*/
1970
1971 typedef uint8_t (*SchUeDeleteRspFunc) ARGS((
1972    Pst          *pst,           /* Post structure */
1973    SchUeDeleteRsp *delRsp));       /* Scheduler UE delete response */
1974
1975 typedef uint8_t (*MacSchCellDeleteReqFunc) ARGS((
1976    Pst         *pst,           /* Post structure */
1977    SchCellDeleteReq *schCellDelete)); /*Scheduler UE Del*/
1978
1979 typedef uint8_t (*SchCellDeleteRspFunc) ARGS((
1980    Pst          *pst,           /* Post structure */
1981    SchCellDeleteRsp *schCellDeleteRsp));       /* Scheduler UE delete response */
1982
1983 typedef uint8_t (*MacSchSliceCfgReqFunc) ARGS((
1984    Pst          *pst,           /* Post structure */
1985    SchSliceCfgReq *schSliceCfgReq));  /* Scheduler Slice Cfg Req */
1986
1987 typedef uint8_t (*SchSliceCfgRspFunc)    ARGS((
1988          Pst            *pst,            /* Post Structure */                         
1989          SchSliceCfgRsp  *schSliceCfgRsp /* Cell Cfg Cfm */
1990          ));
1991
1992 typedef uint8_t (*MacSchSliceRecfgReqFunc) ARGS((
1993    Pst          *pst,           /* Post structure */
1994    SchSliceRecfgReq *schSliceRecfgReq));  /* Scheduler Slice Recfg Req */
1995
1996 typedef uint8_t (*SchSliceRecfgRspFunc)    ARGS((
1997          Pst            *pst,            /* Post Structure */                         
1998          SchSliceRecfgRsp  *schSliceRecfgRsp /* Cell Recfg Cfm */
1999          ));
2000
2001 typedef uint8_t (*MacSchPagingIndFunc) ARGS((
2002    Pst         *pst,           /* Post structure */
2003    SchPageInd *schPagingInd)); /* Paging Indication */
2004
2005 typedef uint8_t (*SchMacDlReleaseHarqFunc) ARGS((
2006    Pst         *pst,           /* Post structure */
2007    SchRlsHqInfo *rlsHqInfo)); /* Release Harq proc */
2008
2009 /* function declarations */
2010 uint8_t packMacSchSlotInd(Pst *pst, SlotTimingInfo *slotInd);
2011 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo  *dlSchedInfo);
2012 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
2013 uint8_t packSchCellCfg(Pst *pst, SchCellCfg  *schCellCfg);
2014 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm  *schCellCfgCfm);
2015 uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
2016 uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg  *schCellCfg);
2017 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm  *schCellCfgCfm);
2018 uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
2019 uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
2020 uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
2021 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
2022 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
2023 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
2024 uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
2025 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
2026 uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
2027 uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfgReq *ueCfgToSch);
2028 uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfgReq *ueCfgToSch);
2029 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
2030 uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
2031 uint8_t packSchUeRecfgRsp(Pst *pst, SchUeRecfgRsp *cfgRsp);
2032 uint8_t MacProcSchUeRecfgRsp(Pst *pst, SchUeRecfgRsp *reCfgRsp);
2033 uint8_t MacSchSlotInd ARGS((Pst * pst, SlotTimingInfo * slotInd));
2034 uint8_t packMacSchSlotInd(Pst * pst, SlotTimingInfo * slotInd);
2035 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer  *mBuf);
2036 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
2037 uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
2038 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
2039 uint8_t packMacSchDlHarqInd(Pst *pst, DlHarqInd *dlHarqInd);
2040 uint8_t MacSchDlHarqInd(Pst *pst, DlHarqInd *dlHarqInd);
2041 uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
2042 uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeRecfgReq *ueRecfgToSch);
2043 uint8_t MacSchModUeConfigReq(Pst *pst, SchUeRecfgReq *ueRecfgToSch);
2044 uint8_t packSchUeReconfigRsp(Pst *pst, SchUeRecfgRsp *recfgRsp);
2045 uint8_t MacProcSchUeReconfigRsp(Pst *pst, SchUeRecfgRsp *recfgRsp);
2046 uint8_t packMacSchRachRsrcReq(Pst *pst, SchRachRsrcReq *schRachRsrcReq);
2047 uint8_t MacSchRachRsrcReq(Pst *pst, SchRachRsrcReq *schRachRsrcReq);
2048 uint8_t packSchRachRsrcRsp(Pst *pst, SchRachRsrcRsp *schRachRsrcRsp);
2049 uint8_t MacProcSchRachRsrcRsp(Pst *pst, SchRachRsrcRsp *schRachRsrcRsp);
2050 uint8_t packMacSchRachRsrcRel(Pst *pst, SchRachRsrcRel *schRachRsrcRel);
2051 uint8_t MacSchRachRsrcRel(Pst *pst, SchRachRsrcRel *schRachRsrcRel);
2052 uint8_t packMacSchUeDeleteReq(Pst *pst,  SchUeDelete *schUeDel);
2053 uint8_t MacSchUeDeleteReq(Pst *pst, SchUeDelete  *ueDelete);
2054 uint8_t packSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp  *delRsp);
2055 uint8_t MacProcSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *schUeDelRsp);
2056 uint8_t packMacSchCellDeleteReq(Pst *pst,  SchCellDeleteReq *schCellDelete);
2057 uint8_t MacSchCellDeleteReq(Pst *pst, SchCellDeleteReq  *schCellDelete);
2058 uint8_t packSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp  *schCellDeleteRsp);
2059 uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDeleteRsp);
2060 uint8_t packMacSchSliceCfgReq(Pst *pst, SchSliceCfgReq *cfgReq);
2061 uint8_t MacSchSliceCfgReq(Pst *pst, SchSliceCfgReq *schSliceCfgReq);
2062 uint8_t packSchSliceCfgRsp(Pst *pst, SchSliceCfgRsp *cfgRsp);
2063 uint8_t MacProcSchSliceCfgRsp(Pst *pst, SchSliceCfgRsp *cfgRsp);
2064 uint8_t packMacSchSliceRecfgReq(Pst *pst, SchSliceRecfgReq *recfgReq);
2065 uint8_t MacSchSliceRecfgReq(Pst *pst, SchSliceRecfgReq *schSliceRecfgReq);
2066 uint8_t packSchSliceRecfgRsp(Pst *pst, SchSliceRecfgRsp *schSliceRecfgRsp);
2067 uint8_t MacProcSchSliceRecfgRsp(Pst *pst, SchSliceRecfgRsp *sliceRecfgrsp);
2068 uint8_t packMacSchPagingInd(Pst *pst,  SchPageInd *pageInd);
2069 uint8_t MacSchPagingInd(Pst *pst,  SchPageInd *pageInd);
2070 uint8_t packSchMacDlPageAlloc(Pst *pst, DlPageAlloc *dlPageAlloc);
2071 uint8_t MacProcDlPageAlloc(Pst *pst, DlPageAlloc *dlPageAlloc);
2072 uint8_t packSchMacDlReleaseHarq(Pst *pst, SchRlsHqInfo *rlsHqInfo);
2073 uint8_t MacSchReleaseDlHarqProc(Pst *pst, SchRlsHqInfo *rlsHqInfo);
2074 /**********************************************************************
2075   End of file
2076  **********************************************************************/
2077