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