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