RLC BO, BO response and DL Data handling. [Issue-ID: ODUHIGH-181]
[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_CELL_CFG           1
21 #define EVENT_SCH_CELL_CFG_CFM       2
22 #define EVENT_DL_ALLOC               3 
23 #define EVENT_UL_SCH_INFO            4 
24 #define EVENT_RACH_IND_TO_SCH        5
25 #define EVENT_CRC_IND_TO_SCH         6
26 #define EVENT_DL_RLC_BO_INFO_TO_SCH  7
27 #define EVENT_UE_CREATE_REQ_TO_SCH   8
28 #define EVENT_UE_CREATE_RSP_TO_MAC   9
29 #define EVENT_SLOT_IND_TO_SCH        10
30 #define EVENT_SHORT_BSR              11
31 #define EVENT_UCI_IND_TO_SCH         12
32
33 /*macros*/
34 #define NO_SSB 0
35 #define SSB_TRANSMISSION 1
36 #define SSB_REPEAT 2
37 #define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
38 #define SCH_SSB_MASK_SIZE   1
39
40 #define NO_SIB1 0
41 #define SIB1_TRANSMISSION 1
42 #define SIB1_REPITITION 2
43
44 #define MAX_NUM_PRG     1 /* max value should be later 275 */
45 #define MAX_DIG_BF_INTERFACES 0 /* max value should be later 255 */
46 #define MAX_CODEWORDS  1  /* max should be 2 */
47 #define SCH_HARQ_PROC_ID 1 /* harq proc id */
48 #define SCH_ALLOC_TYPE_1 1 /*sch res alloc type */
49
50 /* Datatype in UL SCH Info */
51 #define SCH_DATATYPE_PUSCH 1
52 #define SCH_DATATYPE_PUSCH_UCI 2
53 #define SCH_DATATYPE_UCI 4
54 #define SCH_DATATYPE_SRS 8
55 #define SCH_DATATYPE_PRACH 16
56
57 #define MAX_NUMBER_OF_CRC_IND_BITS 1
58 #define MAX_NUMBER_OF_UCI_IND_BITS 1
59 #define MAX_SR_BITS_IN_BYTES       1
60 #define MAX_NUM_LOGICAL_CHANNEL_GROUPS 8
61 /* can we have a common numslot numscs between mac sch */
62 #define MAX_SLOTS 10
63 #define MAX_SFN   1024
64 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8   /* Max number of scheduling request config per cell group */
65 #define MAX_NUM_TAGS 4                  /* Max number of timing advance groups */
66 #define MAX_NUM_BWP  4                  /* Max number of BWP per serving cell */
67 #define MAX_NUM_CRSET  3                /* Max number of control resource set in add/modify/release list */
68 #define MAX_NUM_SEARCH_SPC  10          /* Max number of search space in add/modify/release list */
69 #define FREQ_DOM_RSRC_SIZE  6           /* i.e. 6 bytes because Size of frequency domain resource is 45 bits */
70 #define MONITORING_SYMB_WITHIN_SLOT_SIZE 2  /* i.e. 2 bytes because size of monitoring symbols within slot is 14 bits */
71 #define MAX_NUM_DL_ALLOC 16             /* Max number of pdsch time domain downlink allocation */
72 #define MAX_NUM_UL_ALLOC 16             /* Max number of pusch time domain uplink allocation */
73
74 #define SD_SIZE   3
75
76 #define ADD_DELTA_TO_TIME(crntTime, toFill, incr)          \
77 {                                                          \
78    if ((crntTime.slot + incr) > (MAX_SLOTS - 1))           \
79    {                                                       \
80       toFill.sfn = (crntTime.sfn + 1);                     \
81    }                                                       \
82    else                                                    \
83    {                                                       \
84       toFill.sfn = crntTime.sfn;                           \
85    }                                                       \
86    toFill.slot = (crntTime.slot + incr) % MAX_SLOTS;       \
87    if (toFill.sfn >= MAX_SFN)                              \
88    {                                                       \
89       toFill.sfn%=MAX_SFN;                                 \
90    }                                                       \
91 }
92
93 typedef enum
94 {
95    UNSPECIFIED_CAUSE,
96    INVALID_PARAM_VALUE,
97    RESOURCE_UNAVAILABLE,
98    SYSTEM_ERROR
99 }SchFailureCause;
100
101 typedef enum
102 {
103    SR_PROHIBIT_MS1,
104    SR_PROHIBIT_MS2,
105    SR_PROHIBIT_MS4,
106    SR_PROHIBIT_MS8,
107    SR_PROHIBIT_MS16,
108    SR_PROHIBIT_MS32,
109    SR_PROHIBIT_MS64,
110    SR_PROHIBIT_MS128
111 }SchSrProhibitTimer;
112
113 typedef enum
114 {
115    SR_TRANS_MAX_N4,
116    SR_TRANS_MAX_N8,
117    SR_TRANS_MAX_N16,
118    SR_TRANS_MAX_N32,
119    SR_TRANS_MAX_N64,
120    SR_TRANS_MAX_SPARE3,
121    SR_TRANS_MAX_SPARE2,
122    SR_TRANS_MAX_SPARE1
123 }SchSrTransMax;
124
125 typedef enum
126 {
127    TIME_ALIGNMENT_TIMER_MS500,
128    TIME_ALIGNMENT_TIMER_MS750,
129    TIME_ALIGNMENT_TIMER_MS1280,
130    TIME_ALIGNMENT_TIMER_MS1920,
131    TIME_ALIGNMENT_TIMER_MS2560,
132    TIME_ALIGNMENT_TIMER_MS5120,
133    TIME_ALIGNMENT_TIMER_MS10240,
134    TIME_ALIGNMENT_TIMER_INFINITE
135 }SchTimeAlignmentTimer;
136
137 typedef enum
138 {
139    PHR_PERIODIC_TIMER_SF10,
140    PHR_PERIODIC_TIMER_SF20,
141    PHR_PERIODIC_TIMER_SF50,
142    PHR_PERIODIC_TIMER_SF100,
143    PHR_PERIODIC_TIMER_SF200,
144    PHR_PERIODIC_TIMER_SF500,
145    PHR_PERIODIC_TIMER_SF1000,
146    PHR_PERIODIC_TIMER_INFINITE
147 }SchPhrPeriodicTimer;
148
149 typedef enum
150 {
151    PHR_PROHIBIT_TIMER_SF0,
152    PHR_PROHIBIT_TIMER_SF10,
153    PHR_PROHIBIT_TIMER_SF20,
154    PHR_PROHIBIT_TIMER_SF50,
155    PHR_PROHIBIT_TIMER_SF100,
156    PHR_PROHIBIT_TIMER_SF200,
157    PHR_PROHIBIT_TIMER_SF500,
158    PHR_PROHIBIT_TIMER_SF1000
159 }SchPhrProhibitTimer;
160
161 typedef enum
162 {
163    PHR_TX_PWR_FACTOR_CHANGE_DB1,
164    PHR_TX_PWR_FACTOR_CHANGE_DB3,
165    PHR_TX_PWR_FACTOR_CHANGE_DB6,
166    PHR_TX_PWR_FACTOR_CHANGE_INFINITE
167 }SchPhrTxPwrFactorChange;
168
169 typedef enum
170 {
171    PHR_MODE_REAL,
172    PHR_MODE_VIRTUAL
173 }SchPhrModeOtherCG;
174
175 typedef enum
176 {
177    HARQ_ACK_CODEBOOK_SEMISTATIC,
178    HARQ_ACK_CODEBOOK_DYNAMIC
179 }SchPdschHarqAckCodebook;
180
181 typedef enum
182 {
183    NUM_HARQ_PROC_FOR_PDSCH_N2,
184    NUM_HARQ_PROC_FOR_PDSCH_N4,
185    NUM_HARQ_PROC_FOR_PDSCH_N6,
186    NUM_HARQ_PROC_FOR_PDSCH_N10,
187    NUM_HARQ_PROC_FOR_PDSCH_N16
188 }SchNumHarqProcForPdsch;
189
190 typedef enum
191 {
192    MAX_CODE_BLOCK_GROUP_PER_TB_N2,
193    MAX_CODE_BLOCK_GROUP_PER_TB_N4,
194    MAX_CODE_BLOCK_GROUP_PER_TB_N6,
195    MAX_CODE_BLOCK_GROUP_PER_TB_N8
196 }SchMaxCodeBlkGrpPerTB;
197
198 typedef enum
199 {
200    PDSCH_X_OVERHEAD_XOH_6,
201    PDSCH_X_OVERHEAD_XOH_12,
202    PDSCH_X_OVERHEAD_XOH_18
203 }SchPdschXOverhead;
204
205 typedef enum
206 {
207    DMRS_ADDITIONAL_POS0,
208    DMRS_ADDITIONAL_POS1,
209    DMRS_ADDITIONAL_POS3
210 }SchDmrsAdditionPosition;
211
212 typedef enum
213 {
214    RESOURCE_ALLOCTION_TYPE_0,
215    RESOURCE_ALLOCTION_TYPE_1,
216    RESOURCE_ALLOCTION_DYN_SWITCH
217 }SchResourceAllocType;
218
219 typedef enum
220 {
221    TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_A,
222    TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_B
223 }SchTimeDomRsrcAllocMappingType;
224
225 typedef enum
226 {
227    ENABLED_TRANSFORM_PRECODER,
228    DISABLED_TRANSFORM_PRECODER
229 }SchTransformPrecoder;
230
231 typedef enum
232 {
233    INTERLEAVED_CCE_REG_MAPPING,
234    NONINTERLEAVED_CCE_REG_MAPPING
235 }SchREGMappingType;
236
237 typedef enum
238 {
239    SLOT_PERIODICITY_AND_OFFSET_SL_1,
240    SLOT_PERIODICITY_AND_OFFSET_SL_2,
241    SLOT_PERIODICITY_AND_OFFSET_SL_4,
242    SLOT_PERIODICITY_AND_OFFSET_SL_5,
243    SLOT_PERIODICITY_AND_OFFSET_SL_8,
244    SLOT_PERIODICITY_AND_OFFSET_SL_10,
245    SLOT_PERIODICITY_AND_OFFSET_SL_16,
246    SLOT_PERIODICITY_AND_OFFSET_SL_20,
247    SLOT_PERIODICITY_AND_OFFSET_SL_40,
248    SLOT_PERIODICITY_AND_OFFSET_SL_80,
249    SLOT_PERIODICITY_AND_OFFSET_SL_160,
250    SLOT_PERIODICITY_AND_OFFSET_SL_320,
251    SLOT_PERIODICITY_AND_OFFSET_SL_640,
252    SLOT_PERIODICITY_AND_OFFSET_SL_1280,
253    SLOT_PERIODICITY_AND_OFFSET_SL_2560
254 }SchMSlotPeriodAndOffset;
255
256 typedef enum
257 {
258    SAME_AS_REG_BUNDLE,
259    ALL_CONTIGUOUS_RB
260 }SchPrecoderGranul;
261
262 typedef enum
263 {
264    SEARCH_SPACE_TYPE_COMMON,
265    SEARCH_SPACE_TYPE_UE_SPECIFIC
266 }SchSearchSpaceType;
267
268 typedef enum
269 {
270    AGGREGATION_LEVEL_N0,
271    AGGREGATION_LEVEL_N1,
272    AGGREGATION_LEVEL_N2,
273    AGGREGATION_LEVEL_N3,
274    AGGREGATION_LEVEL_N4,
275    AGGREGATION_LEVEL_N5,
276    AGGREGATION_LEVEL_N6,
277    AGGREGATION_LEVEL_N8
278 }SchAggrLevel;
279
280 typedef enum
281 {
282    RBG_SIZE_CONFIG_1,
283    RBG_SIZE_CONFIG_2
284 }SchRBGSize;
285
286 typedef enum
287 {
288    CODE_WORDS_SCHED_BY_DCI_N1,
289    CODE_WORDS_SCHED_BY_DCI_N2
290 }SchCodeWordsSchedByDci;
291
292 typedef enum
293 {
294    STATIC_BUNDLING_TYPE,
295    DYNAMIC_BUNDLING_TYPE
296 }SchBundlingType;
297
298 typedef enum
299 {
300    DUPLEX_MODE_FDD,
301    DUPLEX_MODE_TDD
302 }SchDuplexMode;
303
304 typedef enum
305 {
306    SSB_PRDCTY_MS5,
307    SSB_PRDCTY_MS10,
308    SSB_PRDCTY_MS20,
309    SSB_PRDCTY_MS40,
310    SSB_PRDCTY_MS80,
311    SSB_PRDCTY_MS160
312 }SchSSBPeriod;
313
314 typedef enum
315 {
316    RSP_OK,
317    RSP_NOK
318 }SchMacRsp;
319
320 typedef enum
321 {
322    SHORT_BSR,
323    LONG_BSR,
324    SHORT_TRUNCATED_BSR,
325    LONG_TRUNCATED_BSR
326 }BsrType;
327
328 typedef enum
329 {
330    FORMAT0_0,
331    FORMAT0_1,
332    FORMAT1_0,
333    FORMAT1_1
334 }FormatType;
335
336 /*structures*/
337 typedef struct timeDomainAlloc
338 {
339    uint16_t startSymb;
340    uint16_t numSymb;
341 }TimeDomainAlloc;
342
343 typedef struct freqDomainAlloc
344 {
345    uint16_t startPrb;
346    uint16_t numPrb;
347 }FreqDomainAlloc;
348
349
350 typedef struct
351 {
352    uint32_t    ssbPbchPwr;       /* SSB block power */
353    uint8_t     scsCommon;           /* subcarrier spacing for common [0-3]*/
354    uint8_t     ssbOffsetPointA;  /* SSB sub carrier offset from point A */
355    SchSSBPeriod   ssbPeriod;        /* SSB Periodicity in msec */
356    uint8_t     ssbSubcOffset;    /* Subcarrier Offset(Kssb) */
357    uint32_t    nSSBMask[SCH_SSB_MASK_SIZE];      /* Bitmap for actually transmitted SSB. */
358 }SchSsbCfg;
359
360 typedef struct bwpCfg
361 {
362    uint8_t         subcarrierSpacing;
363    uint8_t         cyclicPrefix;
364    FreqDomainAlloc freqAlloc;   
365 }BwpCfg;
366
367 typedef struct prg
368 {
369    uint16_t pmIdx;
370    uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
371 } Prg;
372
373 typedef struct beamformingInfo
374 {
375    uint16_t numPrgs;
376    uint16_t prgSize;
377    uint8_t  digBfInterfaces;
378    Prg  prg[MAX_NUM_PRG];
379 } BeamformingInfo;
380
381 /* SIB1 PDSCH structures */
382
383 typedef struct codewordinfo
384 {
385    uint16_t targetCodeRate;
386    uint8_t  qamModOrder;
387    uint8_t  mcsIndex;
388    uint8_t  mcsTable;
389    uint8_t  rvIndex;
390    uint32_t tbSize;
391 } CodewordInfo;
392
393 typedef struct dmrsInfo
394 {
395    uint16_t dlDmrsSymbPos;
396    uint8_t  dmrsConfigType;
397    uint16_t dlDmrsScramblingId;
398    uint8_t  scid;
399    uint8_t  numDmrsCdmGrpsNoData;
400    uint16_t dmrsPorts;
401    uint8_t mappingType;
402    uint8_t nrOfDmrsSymbols;
403    uint8_t dmrsAddPos;
404 } DmrsInfo;
405
406 typedef struct pdschFreqAlloc
407 {
408    uint8_t  resourceAllocType;
409    /* since we are using type-1, hence rbBitmap excluded */
410    FreqDomainAlloc freqAlloc;
411    uint8_t  vrbPrbMapping;
412 } PdschFreqAlloc;
413
414 typedef struct pdschTimeAlloc
415 {
416    uint8_t         rowIndex;
417    TimeDomainAlloc timeAlloc;
418 } PdschTimeAlloc;
419
420 typedef struct txPowerPdschInfo
421 {
422    uint8_t powerControlOffset;
423    uint8_t powerControlOffsetSS;
424 } TxPowerPdschInfo;
425
426 typedef struct pdschCfg
427 {
428    uint16_t         pduBitmap;
429    uint16_t         rnti;
430    uint16_t         pduIndex;
431    uint8_t          numCodewords;
432    CodewordInfo     codeword[MAX_CODEWORDS];
433    uint16_t         dataScramblingId;
434    uint8_t          numLayers;
435    uint8_t          transmissionScheme;
436    uint8_t          refPoint;
437    DmrsInfo         dmrs;
438    PdschFreqAlloc   pdschFreqAlloc;
439    PdschTimeAlloc   pdschTimeAlloc;
440    BeamformingInfo  beamPdschInfo;
441    TxPowerPdschInfo txPdschPower;
442 } PdschCfg;
443 /* SIB1 PDSCH structures end */
444
445 /* SIB1 interface structure */
446
447 typedef struct coresetCfg
448 {
449    uint8_t coreSetSize;
450    uint8_t startSymbolIndex;
451    uint8_t durationSymbols;
452    uint8_t freqDomainResource[6];
453    uint8_t cceRegMappingType;
454    uint8_t regBundleSize;
455    uint8_t interleaverSize;
456    uint8_t coreSetType;
457    uint16_t shiftIndex;
458    uint8_t precoderGranularity;
459    uint8_t cceIndex;
460    uint8_t aggregationLevel;
461 } CoresetCfg;
462
463 typedef struct txPowerPdcchInfo
464 {
465    uint8_t powerValue;
466    uint8_t powerControlOffsetSS;
467 } TxPowerPdcchInfo;
468
469 typedef struct dlDCI
470 {
471    uint16_t rnti;
472    uint16_t scramblingId;
473    uint16_t scramblingRnti;
474    uint8_t cceIndex;
475    uint8_t aggregLevel;
476    BeamformingInfo beamPdcchInfo;
477    TxPowerPdcchInfo txPdcchPower;
478    PdschCfg     *pdschCfg;
479 } DlDCI;
480
481 typedef struct pdcchCfg
482 {
483    /* coreset-0 configuration */
484    CoresetCfg coresetCfg;
485
486    uint16_t numDlDci;
487    DlDCI    dci; /* as of now its only one DCI, later it will be numDlCi */
488 } PdcchCfg;
489 /* end of SIB1 PDCCH structures */
490
491 typedef struct
492 {
493    /* parameters recieved from DU-APP */
494    uint16_t sib1PduLen;
495    uint16_t sib1NewTxPeriod;
496    uint16_t sib1RepetitionPeriod;
497    uint8_t  coresetZeroIndex;     /* derived from 4 LSB of pdcchSib1 present in MIB */
498    uint8_t  searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
499    uint16_t sib1Mcs;
500
501    /* parameters derived in scheduler */
502    uint8_t n0;
503    BwpCfg bwp;
504    PdcchCfg sib1PdcchCfg;
505    PdschCfg sib1PdschCfg;
506 }SchSib1Cfg;
507
508 typedef struct schRachCfg
509 {
510    uint8_t      prachCfgIdx;       /* PRACH config idx */
511    uint8_t      prachSubcSpacing;  /* Subcarrier spacing of RACH */
512    uint16_t     msg1FreqStart;     /* Msg1-FrequencyStart */
513    uint8_t      msg1Fdm;           /* PRACH FDM (1,2,4,8) */
514    uint8_t      rootSeqLen;        /* root sequence length */
515    uint16_t     rootSeqIdx;        /* Root sequence index */
516    uint8_t      numRootSeq;        /* Number of root sequences required for FD */
517    uint16_t     k1;                /* Frequency Offset for each FD */
518    uint8_t      ssbPerRach;        /* SSB per RACH occassion */
519    uint8_t      prachMultCarrBand; /* Presence of Multiple carriers in Band */
520    uint8_t      raContResTmr;      /* RA Contention Resoultion Timer */
521    uint8_t      rsrpThreshSsb;     /* RSRP Threshold SSB */
522    uint8_t      raRspWindow;       /* RA Response Window */
523 }SchRachCfg;
524
525 typedef struct schBwpParams
526 {
527    FreqDomainAlloc freqAlloc;
528    uint8_t         scs;
529    uint8_t         cyclicPrefix;
530 }SchBwpParams;
531
532 typedef struct schCandidatesInfo
533 {
534    uint8_t aggLevel1;
535    uint8_t aggLevel2;
536    uint8_t aggLevel4;
537    uint8_t aggLevel8;
538    uint8_t aggLevel16;
539 }SchCandidatesInfo;
540
541 typedef struct schSearchSpaceCfg
542 {
543    uint8_t searchSpaceId;
544    uint8_t coresetId;
545    uint16_t monitoringSlot;
546    uint16_t duration;
547    uint16_t monitoringSymbol;
548    SchCandidatesInfo candidate;
549 }SchSearchSpaceCfg;
550
551 typedef struct schPdcchCfgCmn
552 {
553    SchSearchSpaceCfg commonSearchSpace;
554    uint8_t raSearchSpaceId;
555 }SchPdcchCfgCmn;
556
557 typedef struct schPdschCfgCmn
558 {
559    uint8_t k0;
560    uint8_t mappingType;
561    uint8_t startSymbol;
562    uint8_t lengthSymbol;
563 }SchPdschCfgCmn;
564
565 typedef struct schPucchCfgCmn
566 {
567    uint8_t pucchResourceCommon;
568    uint8_t pucchGroupHopping;
569 }SchPucchCfgCmn;
570
571 typedef struct schPuschCfgCmn
572 {
573    uint8_t k2;
574    uint8_t mappingType;
575    uint8_t startSymbol;
576    uint8_t lengthSymbol;
577 }SchPuschCfgCmn;
578
579 typedef struct schBwpDlCfg
580 {
581    SchBwpParams   bwp;
582    SchPdcchCfgCmn pdcchCommon;
583    SchPdschCfgCmn pdschCommon;
584 }SchBwpDlCfg;
585
586 typedef struct schBwpUlCfg
587 {
588    SchBwpParams   bwp;
589    SchPucchCfgCmn pucchCommon;
590    SchPuschCfgCmn puschCommon;
591 }SchBwpUlCfg;
592
593 typedef struct schCellCfg
594 {
595    uint16_t    cellId;           /* Cell Id */
596    uint16_t    phyCellId;        /* Physical cell id */
597    uint8_t     bandwidth;        /* Supported B/W */
598    SchDuplexMode  dupMode;          /* Duplex type: TDD/FDD */
599    SchSsbCfg   ssbSchCfg;        /* SSB config */
600    SchSib1Cfg  sib1SchCfg;       /* SIB1 config */
601    SchRachCfg  schRachCfg;       /* PRACH config */
602    SchBwpDlCfg schInitialDlBwp;  /* Initial DL BWP */
603    SchBwpUlCfg schInitialUlBwp;  /* Initial UL BWP */
604    uint8_t     puschMu;          /* PUSCH MU */
605 }SchCellCfg;
606
607 typedef struct schCellCfgCfm
608 {
609    uint16_t         cellId;     /* Cell Id */
610    SchMacRsp   rsp;   
611 }SchCellCfgCfm;
612
613 typedef struct ssbInfo
614 {
615    uint8_t         ssbIdx;          /* SSB Index */
616    TimeDomainAlloc tdAlloc; /* Time domain allocation */
617    FreqDomainAlloc fdAlloc; /* Freq domain allocation */
618 }SsbInfo;
619
620 typedef struct sib1AllocInfo
621 {
622    BwpCfg bwp;
623    PdcchCfg sib1PdcchCfg;
624    PdschCfg sib1PdschCfg;
625 } Sib1AllocInfo;
626
627 typedef struct prachSchInfo
628 {
629    uint8_t  numPrachOcas;   /* Num Prach Ocassions */
630    uint8_t  prachFormat;    /* PRACH Format */
631    uint8_t  numRa;          /* Freq domain ocassion */
632    uint8_t  prachStartSymb; /* Freq domain ocassion */
633 }PrachSchInfo;
634
635 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
636 typedef struct dlBrdcstAlloc
637 {
638    /* Ssb transmission is determined as follows:
639     * 0 : No tranamission
640     * 1 : SSB Transmission
641     * 2 : SSB Repetition */
642    uint8_t ssbTrans;
643    uint8_t ssbIdxSupported;
644    SsbInfo ssbInfo[MAX_SSB_IDX];
645    /* Sib1 transmission is determined as follows:
646     * 0 : No tranamission
647     * 1 : SIB1 Transmission
648     * 2 : SIB1 Repetition */
649    uint8_t sib1Trans;
650    Sib1AllocInfo sib1Alloc;
651 }DlBrdcstAlloc;
652
653 typedef struct rarInfo
654 {
655    uint16_t        raRnti;
656    uint8_t         RAPID;
657    uint16_t        ta;
658    FreqDomainAlloc msg3FreqAlloc;
659    uint16_t        tcrnti;
660    uint8_t         rarPdu[8];
661    uint8_t         rarPduLen;
662 }RarInfo;
663
664 typedef struct rarAlloc
665 {
666    RarInfo rarInfo;
667    BwpCfg  bwp;
668    PdcchCfg rarPdcchCfg;
669    PdschCfg rarPdschCfg;
670 }RarAlloc;
671
672 typedef struct dlMsgInfo
673 {
674    uint16_t crnti;
675    uint8_t  ndi;
676    uint8_t  harqProcNum;
677    uint8_t  dlAssignIdx;
678    uint8_t  pucchTpc;
679    uint8_t  pucchResInd;
680    uint8_t  harqFeedbackInd;
681    uint8_t  dciFormatId;
682    bool     isMsg4Pdu;
683    uint16_t  dlMsgPduLen;
684    uint8_t  *dlMsgPdu;
685 }DlMsgInfo;
686
687 typedef struct lcSchInfo
688 {
689    uint8_t   lcId;
690    uint16_t  schBytes; /* Number of scheduled bytes */
691 }LcSchInfo;
692
693 typedef struct dlMsgAlloc
694 {
695    uint16_t   crnti;
696    uint8_t    numLc;
697    LcSchInfo  lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
698    BwpCfg     bwp;
699    PdcchCfg   dlMsgPdcchCfg;
700    PdschCfg   dlMsgPdschCfg;
701    DlMsgInfo  dlMsgInfo;
702 }DlMsgAlloc;
703
704 typedef struct schSlotValue
705 {
706    SlotIndInfo currentTime;
707    SlotIndInfo broadcastTime;
708    SlotIndInfo rarTime;
709    SlotIndInfo dlMsgTime;
710    SlotIndInfo ulDciTime;
711 }SchSlotValue;
712
713 typedef struct format0_0
714 {
715    uint8_t         resourceAllocType;
716    /* since we are using type-1, hence rbBitmap excluded */
717    FreqDomainAlloc freqAlloc;
718    TimeDomainAlloc timeAlloc;
719    uint16_t        rowIndex;
720    uint8_t         mcs;
721    uint8_t         harqProcId;   /* HARQ Process ID */
722    bool            puschHopFlag;
723    bool            freqHopFlag;
724    uint8_t         ndi;    /* NDI */
725    uint8_t         rv;     /* Redundancy Version */
726    uint8_t         tpcCmd;
727    bool            sUlCfgd;
728 }Format0_0;
729
730 typedef struct format0_1
731 {
732 /* TBD */
733
734 }Format0_1;
735
736 typedef struct format1_0
737 {
738 /* TBD */
739
740 }Format1_0;
741
742 typedef struct format1_1
743 {
744 /* TBD */
745 }Format1_1;
746
747 typedef struct dciInfo
748 {
749    uint16_t      cellId;   
750    uint16_t      crnti;          /* CRNI */
751    SlotIndInfo   slotIndInfo;    /* Slot Info: sfn, slot number */
752    BwpCfg        bwpCfg;         /* BWP Cfg */
753    CoresetCfg    coresetCfg;     /* Coreset1 Cfg */
754    FormatType    formatType;     /* DCI Format */
755    union
756    {
757       Format0_0  format0_0;      /* Format 0_0 */
758       Format0_1  format0_1;      /* Format 0_1 */
759       Format1_0  format1_0;      /* Format 1_0 */
760       Format1_1  format1_1;      /* Format 1_1 */
761    }format;
762    DlDCI    dciInfo;
763 }DciInfo;
764
765
766 typedef struct dlSchedInfo
767 {
768    uint16_t cellId;  /* Cell Id */
769    SchSlotValue schSlotValue;
770
771    /* Allocation for broadcast messages */
772    bool isBroadcastPres;
773    DlBrdcstAlloc brdcstAlloc;
774
775    /* Allocation for RAR message */
776    //uint8_t isRarPres;
777    RarAlloc *rarAlloc;
778
779    /* Allocation from MSG4 */
780    //Msg4Alloc *msg4Alloc;
781
782    /* UL grant in response to BSR */
783    DciInfo    *ulGrant;
784
785    /* Allocation from dedicated DL msg */
786    DlMsgAlloc *dlMsgAlloc;
787
788 }DlSchedInfo;
789
790 typedef struct tbInfo
791 {
792    uint8_t  mcs;    /* MCS */
793    uint8_t  ndi;    /* NDI */
794    uint8_t  rv;     /* Redundancy Version */
795    uint16_t tbSize; /* TB Size */
796 }TbInfo;
797
798 typedef struct schPuschInfo
799 {
800    uint16_t         crnti;
801    uint8_t          harqProcId;   /* HARQ Process ID */
802    uint8_t          resAllocType; /* Resource allocation type */
803    FreqDomainAlloc  fdAlloc;      /* Freq domain allocation */
804    TimeDomainAlloc  tdAlloc;      /* Time domain allocation */
805    TbInfo           tbInfo;       /* TB info */
806    uint8_t          dmrsMappingType;
807    uint8_t          nrOfDmrsSymbols;
808    uint8_t          dmrsAddPos;
809 }SchPuschInfo;
810
811 typedef struct schPucchInfo
812 {
813    uint16_t         rnti;
814    uint8_t          pucchFormat;
815    FreqDomainAlloc  fdAlloc;      /* Freq domain allocation */
816    TimeDomainAlloc  tdAlloc;      /* Time domain allocation */
817    uint8_t          srFlag;
818    uint8_t          harqFlag;
819    uint8_t          numHarqBits;
820    uint8_t          uciFlag;
821    uint8_t          numUciBits;
822 }SchPucchInfo;
823
824 typedef struct ulSchedInfo
825 {
826    uint16_t      cellId;         /* Cell Id */
827    uint16_t      crnti;          /* CRNI */
828    SlotIndInfo   slotIndInfo;    /* Slot Info: sfn, slot number */
829    uint8_t       dataType;       /* Type of info being scheduled */
830    PrachSchInfo  prachSchInfo;   /* Prach scheduling info */
831    SchPuschInfo  schPuschInfo;   /* Pusch scheduling info */
832    SchPucchInfo  schPucchInfo;   /* Pusch scheduling info */
833 }UlSchedInfo;
834
835 typedef struct rachIndInfo
836 {
837    uint16_t    cellId;
838    uint16_t    crnti;
839    SlotIndInfo timingInfo;
840    uint8_t     slotIdx;
841    uint8_t     symbolIdx;
842    uint8_t     freqIdx;
843    uint8_t     preambleIdx;
844    uint16_t    timingAdv;
845 }RachIndInfo;
846
847
848 typedef struct crcIndInfo
849 {
850    uint16_t    cellId;
851    uint16_t    crnti;
852    SlotIndInfo timingInfo;
853    uint16_t    numCrcInd;
854    uint8_t     crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
855 }CrcIndInfo;
856
857 typedef struct boInfo
858 {
859    uint8_t   lcId;
860    uint32_t  dataVolume;
861 }BOInfo;
862
863 typedef struct dlRlcBOInfo
864 {
865    uint16_t    cellId;
866    uint16_t    crnti;
867    uint8_t     lcId;
868    uint32_t    dataVolume;
869 }DlRlcBoInfo;
870
871 /* Info of Scheduling Request to Add/Modify */
872 typedef struct schSchedReqInfo
873 {
874    uint8_t              schedReqId;
875    SchSrProhibitTimer   srProhibitTmr;
876    SchSrTransMax        srTransMax;
877 }SchSchedReqInfo;
878
879 /* Scheduling Request Configuration */
880 typedef struct schSchedReqCfg
881 {
882    uint8_t          addModListCount;
883    SchSchedReqInfo  addModList[MAX_NUM_SR_CFG_PER_CELL_GRP];   /* List of Scheduling req to be added/modified */
884    uint8_t          relListCount;
885    uint8_t          relList[MAX_NUM_SR_CFG_PER_CELL_GRP];      /* list of scheduling request Id to be deleted */
886 }SchSchedReqCfg;
887
888 /* Info of Tag to Add/Modify */
889 typedef struct schTagInfo
890 {
891    uint8_t       tagId;
892    SchTimeAlignmentTimer  timeAlignmentTmr;
893 }SchTagInfo;
894
895 /* Timing Advance Group Configuration */
896 typedef struct schTagCfg
897 {
898    uint8_t      addModListCount;
899    SchTagInfo   addModList[MAX_NUM_TAGS];    /* List of Tag to Add/Modify */
900    uint8_t      relListCount;
901    uint8_t      relList[MAX_NUM_TAGS];       /* list of Tag Id to release */
902 }SchTagCfg;
903
904 /* Configuration for Power headroom reporting */
905 typedef struct schPhrCfg
906 {
907    SchPhrPeriodicTimer       periodicTmr;
908    SchPhrProhibitTimer       prohibitTmr;
909    SchPhrTxPwrFactorChange   txpowerFactorChange;
910    bool                      multiplePhr;
911    bool                      dummy;
912    bool                      type2OtherCell;
913    SchPhrModeOtherCG         modeOtherCG;
914 }SchPhrCfg;
915
916 /* MAC cell Group configuration */
917 typedef struct schMacCellGrpCfg
918 {
919    SchSchedReqCfg   schedReqCfg;
920    SchTagCfg        tagCfg;
921    SchPhrCfg        phrCfg;             /* To be used only if phrCfgSetupPres is true */      
922 }SchMacCellGrpCfg;
923
924 /* Physical Cell Group Configuration */
925 typedef struct schPhyCellGrpCfg
926 {
927    SchPdschHarqAckCodebook    pdschHarqAckCodebook;
928    int8_t     pNrFr1;
929 }SchPhyCellGrpCfg;
930
931 /* Control resource set info */
932 typedef struct schControlRsrcSet
933 {
934    uint8_t             cRSetId;                /* Control resource set id */
935    uint8_t             freqDomainRsrc[FREQ_DOM_RSRC_SIZE];  /* Frequency domain resource */
936    uint8_t             duration;
937    SchREGMappingType   cceRegMappingType;
938    SchPrecoderGranul   precoderGranularity;
939    uint16_t            dmrsScramblingId;
940 }SchControlRsrcSet;
941
942 /* Search Space info */
943 typedef struct schSearchSpace
944 {
945    uint8_t                  searchSpaceId;
946    uint8_t                  cRSetId;
947    SchMSlotPeriodAndOffset  mSlotPeriodicityAndOffset;
948    uint8_t                  mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
949    SchAggrLevel             numCandidatesAggLevel1;      /* Number of candidates for aggregation level 1 */
950    SchAggrLevel             numCandidatesAggLevel2;      /* Number of candidates for aggregation level 2 */
951    SchAggrLevel             numCandidatesAggLevel4;      /* Number of candidates for aggregation level 4 */
952    SchAggrLevel             numCandidatesAggLevel8;      /* Number of candidates for aggregation level 8 */
953    SchAggrLevel             numCandidatesAggLevel16;     /* Number of candidates for aggregation level 16 */
954    SchSearchSpaceType       searchSpaceType;
955    uint8_t                  ueSpecificDciFormat;
956 }SchSearchSpace;
957
958 /* PDCCH cofniguration */
959 typedef struct schPdcchConfig
960 {
961    uint8_t           numCRsetToAddMod;
962    SchControlRsrcSet  cRSetToAddModList[MAX_NUM_CRSET];           /* List of control resource set to add/modify */
963    uint8_t           numCRsetToRel;
964    uint8_t           cRSetToRelList[MAX_NUM_CRSET];              /* List of control resource set to release */
965    uint8_t           numSearchSpcToAddMod;
966    SchSearchSpace    searchSpcToAddModList[MAX_NUM_SEARCH_SPC];  /* List of search space to add/modify */
967    uint8_t           numSearchSpcToRel;
968    uint8_t           searchSpcToRelList[MAX_NUM_SEARCH_SPC];     /* List of search space to release */
969 }SchPdcchConfig;
970
971 /* PDSCH time domain resource allocation */
972 typedef struct schPdschTimeDomRsrcAlloc
973 {
974    SchTimeDomRsrcAllocMappingType    mappingType;
975    uint8_t    startSymbol;
976    uint8_t    symbolLength;
977 }SchPdschTimeDomRsrcAlloc;
978
979 /* DMRS downlink configuration */
980 typedef struct schDmrsDlCfg
981 {
982    SchDmrsAdditionPosition   addPos;       /* DMRS additional position */
983 }SchDmrsDlCfg;
984
985 /* PDSCH Configuration */
986 typedef struct schPdschConfig
987 {
988    SchDmrsDlCfg               dmrsDlCfgForPdschMapTypeA;
989    SchResourceAllocType       resourceAllocType;
990    uint8_t                    numTimeDomRsrcAlloc;
991    SchPdschTimeDomRsrcAlloc   timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
992    SchRBGSize                 rbgSize;
993    SchCodeWordsSchedByDci     numCodeWordsSchByDci;                    /* Number of code words scheduled by DCI */
994    SchBundlingType            bundlingType;
995 }SchPdschConfig;
996
997 /* Initial Downlink BWP */
998 typedef struct schInitalDlBwp
999 {
1000    bool             pdcchCfgPres;
1001    SchPdcchConfig   pdcchCfg;
1002    bool             pdschCfgPres;
1003    SchPdschConfig   pdschCfg;
1004 }SchInitalDlBwp;
1005
1006 /* BWP Downlink common */
1007 typedef struct schBwpDlCommon
1008 {
1009 }SchBwpDlCommon;
1010
1011 /* Downlink BWP information */
1012 typedef struct schDlBwpInfo
1013 {
1014    uint8_t          bwpId;
1015 }SchDlBwpInfo;
1016
1017 /* PDCCH Serving Cell configuration */
1018 typedef struct schPdschServCellCfg
1019 {
1020    uint8_t                  *maxMimoLayers;           
1021    SchNumHarqProcForPdsch   numHarqProcForPdsch;
1022    SchMaxCodeBlkGrpPerTB    *maxCodeBlkGrpPerTb;
1023    bool                     *codeBlkGrpFlushInd;
1024    SchPdschXOverhead        *xOverhead;
1025 }SchPdschServCellCfg;
1026
1027 /* PUCCH Configuration */
1028 typedef struct schPucchCfg
1029 {
1030    /* TODO : Not used currently */ 
1031 }SchPucchCfg;
1032
1033 /* Transform precoding disabled */
1034 typedef struct schTransPrecodDisabled
1035 {
1036    uint16_t   scramblingId0;
1037 }SchTransPrecodDisabled;
1038
1039 /* DMRS Uplink configuration */
1040 typedef struct SchDmrsUlCfg
1041 {
1042    SchDmrsAdditionPosition    addPos;               /* DMRS additional position */
1043    SchTransPrecodDisabled     transPrecodDisabled;  /* Transform precoding disabled */
1044 }SchDmrsUlCfg;
1045
1046 /* PUSCH Time Domain Resource Allocation */
1047 typedef struct schPuschTimeDomRsrcAlloc
1048 {
1049    uint8_t   k2;
1050    SchTimeDomRsrcAllocMappingType   mappingType;
1051    uint8_t   startSymbol;
1052    uint8_t   symbolLength;
1053 }SchPuschTimeDomRsrcAlloc;
1054
1055 /* PUSCH Configuration */
1056 typedef struct schPuschCfg
1057 {
1058    SchDmrsUlCfg               dmrsUlCfgForPuschMapTypeA;
1059    SchResourceAllocType       resourceAllocType;
1060    uint8_t                    numTimeDomRsrcAlloc;
1061    SchPuschTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1062    SchTransformPrecoder       transformPrecoder;
1063 }SchPuschCfg;
1064
1065 /* Initial Uplink BWP */
1066 typedef struct schInitialUlBwp
1067 {
1068    bool          pucchCfgPres;
1069    SchPucchCfg   pucchCfg;
1070    bool          puschCfgPres;
1071    SchPuschCfg   puschCfg;
1072 }SchInitialUlBwp;
1073
1074 /* Uplink BWP information */
1075 typedef struct schUlBwpInfo
1076 {
1077    uint8_t        bwpId;
1078 }SchUlBwpInfo;
1079
1080 /* Serving cell configuration */
1081 typedef struct schServCellCfgInfo
1082 {
1083    SchInitalDlBwp        initDlBwp;
1084    uint8_t               numDlBwpToAdd;
1085    SchDlBwpInfo          DlBwpToAddList[MAX_NUM_BWP];
1086    uint8_t               firstActvDlBwpId;
1087    uint8_t               defaultDlBwpId;
1088    uint8_t               *bwpInactivityTmr;
1089    SchPdschServCellCfg   pdschServCellCfg;
1090    SchInitialUlBwp       initUlBwp;
1091    uint8_t               numUlBwpToAdd;
1092    SchUlBwpInfo          UlBwpToAddList[MAX_NUM_BWP];
1093    uint8_t               firstActvUlBwpId;
1094 }SchServCellCfgInfo;
1095
1096 typedef struct schNonDynFiveQi
1097 {
1098    uint16_t   fiveQi;
1099    uint8_t    priorLevel;
1100    uint16_t   avgWindow;
1101    uint16_t   maxDataBurstVol;
1102 }SchNonDynFiveQi;
1103
1104 typedef struct schDynFiveQi
1105 {
1106    uint8_t    priorLevel;
1107    uint16_t   packetDelayBudget;
1108    uint8_t    packetErrRateScalar;
1109    uint8_t    packetErrRateExp;
1110    uint16_t   fiveQi;
1111    uint8_t    delayCritical;
1112    uint16_t   avgWindow;
1113    uint16_t   maxDataBurstVol;
1114 }SchDynFiveQi;
1115
1116 typedef struct schNgRanAllocAndRetPri
1117 {
1118    uint8_t priorityLevel;
1119    uint8_t preEmptionCap;
1120    uint8_t preEmptionVul;
1121 }SchNgRanAllocAndRetPri;
1122
1123 typedef struct schGrbQosFlowInfo
1124 {
1125    uint32_t maxFlowBitRateDl;
1126    uint32_t maxFlowBitRateUl;
1127    uint32_t guarFlowBitRateDl;
1128    uint32_t guarFlowBitRateUl;
1129 }SchGrbQosFlowInfo;
1130
1131 /* DRB QoS */
1132 typedef struct schDrbQos
1133 {
1134    uint8_t  fiveQiType;   /* Dynamic or non-dynamic */ 
1135    union
1136    {
1137       SchNonDynFiveQi   nonDyn5Qi;
1138       SchDynFiveQi      dyn5Qi;
1139    }u;
1140    SchNgRanAllocAndRetPri  ngRanRetPri;
1141    SchGrbQosFlowInfo       grbQosFlowInfo;
1142    uint16_t                pduSessionId;
1143    uint32_t                ulPduSessAggMaxBitRate;   /* UL PDU Session Aggregate max bit rate */
1144 }SchDrbQosInfo;
1145
1146 typedef struct schSnssai
1147 {
1148    uint8_t   sst;
1149    uint8_t   sd[SD_SIZE];
1150 }SchSnssai;
1151
1152 /* Special cell configuration */
1153 typedef struct schSpCellCfg
1154 {
1155    uint8_t           servCellIdx;
1156    SchServCellCfgInfo   servCellCfg;
1157 }SchSpCellCfg;
1158
1159 /* Uplink logical channel configuration */
1160 typedef struct SchUlLcCfg
1161 {
1162    uint8_t priority;
1163    uint8_t lcGroup;
1164    uint8_t schReqId;
1165    uint8_t pbr;        // prioritisedBitRate
1166    uint8_t bsd;        // bucketSizeDuration
1167 }SchUlLcCfg;
1168
1169 /* Downlink logical channel configuration */
1170 typedef struct schDlLcCfg
1171 {
1172    uint8_t lcp;      // logical Channel Prioritization
1173 }SchDlLcCfg;
1174
1175 /* Logical Channel configuration */
1176 typedef struct schLcCfg
1177 {
1178    uint8_t        lcId;
1179    SchDrbQosInfo  *drbQos;
1180    SchSnssai      *snssai;
1181    SchDlLcCfg     dlLcCfg;
1182    SchUlLcCfg     *ulLcCfg;
1183 }SchLcCfg;
1184
1185 /* Aggregate max bit rate */
1186 typedef struct aggrMaxBitRate
1187 {
1188    uint32_t   ulBitRate;
1189    uint32_t   dlBitRate;
1190 }SchAggrMaxBitRate;
1191
1192 /* UE configuration */
1193 typedef struct schUeCfg
1194 {
1195    uint16_t        cellId;
1196    uint16_t        crnti;
1197    SchMacCellGrpCfg   macCellGrpCfg;
1198    SchPhyCellGrpCfg   phyCellGrpCfg;
1199    SchSpCellCfg       spCellCfg;
1200    SchAggrMaxBitRate  *aggrMaxBitRate;
1201    uint8_t            numLc;
1202    SchLcCfg           lcCfgList[MAX_NUM_LC];
1203 }SchUeCfg;
1204
1205 typedef struct schUeCfgRsp
1206 {
1207    uint16_t   ueIdx;
1208    uint16_t   cellId;
1209    uint16_t   crnti;
1210    SchMacRsp  rsp;
1211    SchFailureCause cause;
1212 }SchUeCfgRsp;
1213
1214 typedef struct dataVolInfo
1215 {
1216    uint8_t  lcgId;
1217    uint32_t dataVol;
1218 }DataVolInfo;
1219
1220 typedef struct ulBufferStatusRptInd
1221 {
1222    uint16_t    cellId;
1223    uint16_t    crnti;
1224    BsrType     bsrType;
1225    uint8_t     numLcg;
1226    DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
1227 }UlBufferStatusRptInd;
1228
1229 typedef struct srUciIndInfo
1230 {
1231    uint16_t    cellId;
1232    uint16_t    crnti;
1233    SlotIndInfo slotInd;
1234    uint8_t     numSrBits;
1235    uint8_t     srPayload[MAX_SR_BITS_IN_BYTES];
1236 }SrUciIndInfo;
1237
1238 /* function pointers */
1239
1240 typedef uint8_t (*SchCellCfgCfmFunc)    ARGS((
1241          Pst            *pst,           /* Post Structure */                         
1242          SchCellCfgCfm  *schCellCfgCfm  /* Cell Cfg Cfm */
1243          ));
1244
1245 typedef uint8_t (*SchCellCfgFunc)    ARGS((
1246          Pst         *pst,           /* Post Structure */                         
1247          SchCellCfg  *schCellCfg     /* Cell Cfg  */
1248          ));
1249
1250 typedef uint8_t (*SchMacDlAllocFunc)     ARGS((                     
1251          Pst            *pst,          /* Post Structure */                         
1252          DlSchedInfo    *dlSchedInfo   /* dl allocation Info */                      
1253          ));
1254
1255 typedef uint8_t (*SchMacUlSchInfoFunc)     ARGS((                     
1256          Pst         *pst,           /* Post Structure */                         
1257          UlSchedInfo *ulSchedInfo    /* UL Alloc Sch  Info */                      
1258          ));
1259
1260 typedef uint8_t (*MacSchRachIndFunc) ARGS((
1261          Pst         *pst,         /* Post structure */
1262          RachIndInfo *rachInd));    /* Rach Indication Info */
1263
1264 typedef uint8_t (*MacSchCrcIndFunc) ARGS(( 
1265          Pst         *pst,         /* Post structure */
1266          CrcIndInfo  *crcInd));     /* CRC Info */
1267
1268 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
1269          Pst         *pst,         /* Post structure */
1270          DlRlcBoInfo *dlBoInfo));   /* DL BO Info */
1271
1272 typedef uint8_t (*MacSchUeCreateReqFunc) ARGS((
1273          Pst         *pst,           /* Post structure */
1274          SchUeCfg    *ueCfgToSch));   /* Scheduler UE Cfg */
1275
1276 typedef uint8_t (*SchUeCfgRspFunc) ARGS((
1277          Pst         *pst,           /* Post structure */
1278          SchUeCfgRsp *cfgRsp));       /* Scheduler UE Cfg response */
1279
1280 typedef uint8_t (*MacSchSlotIndFunc) ARGS((
1281          Pst         *pst,          /* Post structure */
1282          SlotIndInfo *slotInd));    /* Slot Info */
1283
1284 typedef uint8_t (*MacSchBsrFunc)       ARGS((
1285    Pst                  *pst,
1286    UlBufferStatusRptInd *bsrInd
1287 ));
1288
1289 typedef uint8_t (*MacSchSrUciIndFunc) ARGS(( 
1290          Pst         *pst,         /* Post structure */
1291          SrUciIndInfo  *uciInd));    /* UCI IND Info */
1292
1293
1294 /* function declarations */
1295 uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
1296 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo  *dlSchedInfo);
1297 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1298 uint8_t packSchCellCfg(Pst *pst, SchCellCfg  *schCellCfg);
1299 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm  *schCellCfgCfm);
1300 uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1301 uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg  *schCellCfg);
1302 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm  *schCellCfgCfm);
1303 uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
1304 uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
1305 uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
1306 uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1307 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1308 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1309 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1310 uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1311 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1312 uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1313 uint8_t packMacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
1314 uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
1315 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1316 uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1317 uint8_t MacSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd));
1318 uint8_t packMacSchSlotInd(Pst * pst, SlotIndInfo * slotInd);
1319 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer  *mBuf);
1320 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1321 uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1322 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1323 uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1324
1325 /**********************************************************************
1326   End of file
1327  **********************************************************************/
1328