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