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