Merge "[JIRA ID - ODUHIGH-280] Changes in DU_CFG as per the TDD"
[o-du/l2.git] / src / cm / du_app_mac_inf.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 /* Defines APIs exchanged between du_app and cl module of MAC */
20 #ifndef __MACINT_H__
21 #define __MACINT_H__
22
23 #define NUM_NUMEROLOGY 5  /* Number of numerology */
24 #define MAXIMUM_TDD_PERIODICITY 10
25 #define MAX_SYMB_PER_SLOT 14 
26
27 #define NUM_SSB         1       /* max value is 64 */
28 #define SSB_MASK_SIZE   1       /* SSB mask size is 32bit for sub6 */
29 #define SIB1_NEW_TX_PERIOD      160
30 #define SIB1_REPETITION_PERIOD   20
31 #define CORESET_0_INDEX      0
32 #define CORESET_1_INDEX      1
33 #define CORESET_2_INDEX      2
34 #define CORESET_3_INDEX      3
35 #define CORESET_4_INDEX      4
36 #define SEARCHSPACE_0_INDEX   0
37 #define SEARCHSPACE_1_INDEX   1
38 #define SEARCHSPACE_2_INDEX   2
39 #define SEARCHSPACE_3_INDEX   3
40 #define SEARCHSPACE_4_INDEX   4
41 #define SS_MONITORING_SLOT_SL1   0 /* all slots */
42 #define SS_MONITORING_SYMBOL     0x2000; /* symbol-0, set 14th bit */
43 #define SIB1_MCS  4
44
45 /* Macro for Ue Context */
46 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8   /* Max number of scheduling request config per cell group */
47 #define MAC_NUM_TAGS 4                  /* Max number of timing advance groups */
48 #define MAX_NUM_BWP  4                  /* Max number of BWP per serving cell */
49 #define MAX_NUM_CRSET  3                /* Max number of control resource set in add/modify/release list */
50 #define MAX_NUM_SEARCH_SPC  10          /* Max number of search space in add/modify/release list */
51 #define MONITORING_SYMB_WITHIN_SLOT_SIZE 2  /* i.e. 2 bytes because size of monitoring symbols within slot is 14 bits */
52 #define MAX_NUM_DL_ALLOC 16             /* Max number of pdsch time domain downlink allocation */
53 #define MAX_NUM_UL_ALLOC 16             /* Max number of pusch time domain uplink allocation */
54 #define SD_SIZE   3                     /* Max size of Slice Differentiator in S-NSSAI */
55
56 #define MAX_NUM_SRB    8
57 #define MAX_NUM_DRB    64
58 #define MAX_NUM_SCELL  32
59
60 /* PUCCH Configuration Macro */
61 #define MAX_NUM_PUCCH_RESRC 128
62 #define MAX_NUM_PUCCH_RESRC_SET 4
63 #define MAX_NUM_PUCCH_PER_RESRC_SET 32
64 #define MAX_NUM_SPATIAL_RELATIONS 8
65 #define MAX_NUM_PUCCH_P0_PER_SET 8
66 #define MAX_NUM_PATH_LOSS_REF_RS 4
67 #define MAX_NUM_DL_DATA_TO_UL_ACK 15
68
69 /* Event IDs */
70 #define EVENT_MAC_CELL_CONFIG_REQ    200
71 #define EVENT_MAC_CELL_CONFIG_CFM    201
72 #define EVENT_MAC_CELL_START         202
73 #define EVENT_MAC_CELL_STOP          203
74 #define EVENT_MAC_CELL_UP_IND        204
75 #define EVENT_MAC_STOP_IND           205
76 #define EVENT_MAC_UL_CCCH_IND        206
77 #define EVENT_MAC_DL_CCCH_IND        207
78 #define EVENT_MAC_UE_CREATE_REQ      208
79 #define EVENT_MAC_UE_CREATE_RSP      209
80 #define EVENT_MAC_UE_RECONFIG_REQ    210
81 #define EVENT_MAC_UE_RECONFIG_RSP    211
82
83 #define BSR_PERIODIC_TIMER_SF_10 10
84 #define BSR_RETX_TIMER_SF_320 320
85 #define BSR_SR_DELAY_TMR_2560 2560
86
87 typedef enum
88 {
89    MAC_DU_APP_RSP_NOK,
90    MAC_DU_APP_RSP_OK
91 }MacRsp;
92
93 typedef enum
94 {
95    DUP_MODE_FDD,
96    DUP_MODE_TDD
97 }DuplexMode;
98
99 typedef enum
100 {
101    MAC_GEN_FULL_PBCH_PAYLD,   /* MAC generated the full PBCH Payload */
102    PHY_GEN_TIMING_PBCH_BIT,   /* PHY generates the timing PBCH bits */
103    PHY_GEN_FULL_PBCH_PAYLD    /* PHY generates full PBCH payload */
104 }BchPduOpt;
105
106 typedef enum
107 {
108    LONG_SEQUENCE,
109    SHORT_SEQUENCE
110 }PrachSeqLen;
111
112 typedef enum
113 {
114    UNRESTRICTED,
115    RESTRICTED_SET_TYPE_A,
116    RESTRICTED_SET_TYPE_B
117 }RstSetCfg;
118
119 typedef enum
120 {
121    DONT_REPORT_RSSI,
122    RSSI_UNIT_DBM,
123    RSSI_UNIT_DBFS
124 }RSSIMeasUnit;
125
126 typedef enum
127 {
128    DL_SLOT,
129    UL_SLOT,
130    GUARD_SLOT
131 }SlotConfig;
132
133 typedef enum
134 {
135    TX_PRDCTY_MS_0P5,
136    TX_PRDCTY_MS_0P625,
137    TX_PRDCTY_MS_1,
138    TX_PRDCTY_MS_1P25,
139    TX_PRDCTY_MS_2,
140    TX_PRDCTY_MS_2P5,
141    TX_PRDCTY_MS_5,
142    TX_PRDCTY_MS_10
143 }DlUlTxPeriodicity;
144
145 typedef enum
146 {
147    BETA_PSS_0DB,
148    BETA_PSS_1DB
149 }BetaPss;
150
151 typedef enum 
152 {
153    SSB_PRDCTY_MS_5,
154    SSB_PRDCTY_MS_10,
155    SSB_PRDCTY_MS_20,
156    SSB_PRDCTY_MS_40,
157    SSB_PRDCTY_MS_80,
158    SSB_PRDCTY_MS_160
159 }SSBPeriod;
160
161 typedef enum
162 {
163    RRC_REJECT,
164    RRC_SETUP
165 }DlCcchMsgType;
166
167 /* Enums for Ue Create Request */
168
169 /* SR PROHIBIT TIMER */
170 typedef enum
171 {
172    SR_PROHIBIT_MS_1,
173    SR_PROHIBIT_MS_2,
174    SR_PROHIBIT_MS_4,
175    SR_PROHIBIT_MS_8,
176    SR_PROHIBIT_MS_16,
177    SR_PROHIBIT_MS_32,
178    SR_PROHIBIT_MS_64,
179    SR_PROHIBIT_MS_128
180 }SrProhibitTimer;
181
182 typedef enum
183 {
184    SR_TRANS_MAX_N_4,
185    SR_TRANS_MAX_N_8,
186    SR_TRANS_MAX_N_16,
187    SR_TRANS_MAX_N_32,
188    SR_TRANS_MAX_N_64,
189    SR_TRANS_MAX_spare3,
190    SR_TRANS_MAX_spare2,
191    SR_TRANS_MAX_spare1
192 }SrTransMax;
193
194 typedef enum
195 {
196    TIME_ALIGNMENT_TIMER_MS_500,
197    TIME_ALIGNMENT_TIMER_MS_750,
198    TIME_ALIGNMENT_TIMER_MS_1280,
199    TIME_ALIGNMENT_TIMER_MS_1920,
200    TIME_ALIGNMENT_TIMER_MS_2560,
201    TIME_ALIGNMENT_TIMER_MS_5120,
202    TIME_ALIGNMENT_TIMER_MS_10240,
203    TIME_ALIGNMENT_TIMER_INFINITY
204 }TimeAlignmentTimer;
205
206 typedef enum
207 {
208    PHR_PERIODIC_TIMER_SF_10,
209    PHR_PERIODIC_TIMER_SF_20,
210    PHR_PERIODIC_TIMER_SF_50,
211    PHR_PERIODIC_TIMER_SF_100,
212    PHR_PERIODIC_TIMER_SF_200,
213    PHR_PERIODIC_TIMER_SF_500,
214    PHR_PERIODIC_TIMER_SF_1000,
215    PHR_PERIODIC_TIMER_INFINITY
216 }PhrPeriodicTimer;
217
218 typedef enum
219 {
220    PHR_PROHIBIT_TIMER_SF_0,
221    PHR_PROHIBIT_TIMER_SF_10,
222    PHR_PROHIBIT_TIMER_SF_20,
223    PHR_PROHIBIT_TIMER_SF_50,
224    PHR_PROHIBIT_TIMER_SF_100,
225    PHR_PROHIBIT_TIMER_SF_200,
226    PHR_PROHIBIT_TIMER_SF_500,
227    PHR_PROHIBIT_TIMER_SF_1000
228 }PhrProhibitTimer;
229
230 typedef enum
231 {
232    PHR_TX_PWR_FACTOR_CHANGE_DB_1,
233    PHR_TX_PWR_FACTOR_CHANGE_DB_3,
234    PHR_TX_PWR_FACTOR_CHANGE_DB_6,
235    PHR_TX_PWR_FACTOR_CHANGE_INFINITY
236 }PhrTxPwrFactorChange;
237
238 typedef enum
239 {
240    PHR_MODE_OTHER_CG_REAL,
241    PHR_MODE_OTHER_CG_VIRTUAL
242 }PhrModeOtherCG;
243
244 typedef enum
245 {
246    PDSCH_HARQ_ACK_CODEBOOK_SEMISTATIC,
247    PDSCH_HARQ_ACK_CODEBOOK_DYNAMIC
248 }PdschHarqAckCodebook;
249
250 typedef enum
251 {
252    NUM_HARQ_PROC_FOR_PDSCH_N_2,
253    NUM_HARQ_PROC_FOR_PDSCH_N_4,
254    NUM_HARQ_PROC_FOR_PDSCH_N_6,
255    NUM_HARQ_PROC_FOR_PDSCH_N_10,
256    NUM_HARQ_PROC_FOR_PDSCH_N_16
257 }NumHarqProcForPdsch;
258
259 typedef enum
260 {
261    MAX_CODE_BLOCK_GROUP_PER_TB_N_2,
262    MAX_CODE_BLOCK_GROUP_PER_TB_N_4,
263    MAX_CODE_BLOCK_GROUP_PER_TB_N_6,
264    MAX_CODE_BLOCK_GROUP_PER_TB_N_8
265 }MaxCodeBlkGrpPerTB;
266
267 typedef enum
268 {
269    PDSCH_X_OVERHEAD_6,
270    PDSCH_X_OVERHEAD_12,
271    PDSCH_X_OVERHEAD_18
272 }PdschXOverhead;
273
274 typedef enum
275 {
276    TRANSFORM_PRECODER_ENABLED,
277    TRANSFORM_PRECODER_DISABLED
278 }TransformPrecoder;
279
280 typedef enum 
281 {
282    CCE_REG_MAPPINGTYPE_PR_INTERLEAVED = 1,
283    CCE_REG_MAPPINGTYPE_PR_NONINTERLEAVED
284 }REGMappingType;
285
286 typedef enum
287 {
288    SLOTPERIODICITYANDOFFSET_PR_SL1 = 1,
289    SLOTPERIODICITYANDOFFSET_PR_SL2,
290    SLOTPERIODICITYANDOFFSET_PR_SL4,
291    SLOTPERIODICITYANDOFFSET_PR_SL5,
292    SLOTPERIODICITYANDOFFSET_PR_SL8,
293    SLOTPERIODICITYANDOFFSET_PR_SL10,
294    SLOTPERIODICITYANDOFFSET_PR_SL16,
295    SLOTPERIODICITYANDOFFSET_PR_SL20,
296    SLOTPERIODICITYANDOFFSET_PR_SL40,
297    SLOTPERIODICITYANDOFFSET_PR_SL80,
298    SLOTPERIODICITYANDOFFSET_PR_SL160,
299    SLOTPERIODICITYANDOFFSET_PR_SL320,
300    SLOTPERIODICITYANDOFFSET_PR_SL640,
301    SLOTPERIODICITYANDOFFSET_PR_SL1280,
302    SLOTPERIODICITYANDOFFSET_PR_SL2560
303 }MSlotPeriodAndOffset;
304
305 typedef enum
306 {
307    SAMEASREG_BUNDLE,
308    ALL_CONTIGUOUS_RBS
309 }PrecoderGranul;
310
311 typedef enum
312 {
313    SEARCHSPACETYPE_PR_COMMON = 1,
314    SEARCHSPACETYPE_PR_UE_SPECIFIC
315 }SearchSpaceType;
316
317 typedef enum
318 {
319    QOS_NON_DYNAMIC = 1,
320    QOS_DYNAMIC
321 }QosType;
322
323 typedef enum
324 {
325    AGGREGATIONLEVEL_N0  = 0,  
326    AGGREGATIONLEVEL_N1  = 1,
327    AGGREGATIONLEVEL_N2  = 2,
328    AGGREGATIONLEVEL_N3  = 3,
329    AGGREGATIONLEVEL_N4  = 4,
330    AGGREGATIONLEVEL_N5  = 5,
331    AGGREGATIONLEVEL_N6  = 6,
332    AGGREGATIONLEVEL_N8  = 7
333 }AggrLevel;
334
335 typedef enum
336 {
337    ADDITIONALPOSITION_POS0,
338    ADDITIONALPOSITION_POS1,
339    ADDITIONALPOSITION_POS3
340 }AddPosType;
341
342 typedef enum
343 {
344    MAPPING_TYPEA,
345    MAPPING_TYPEB
346 }CommonMappingType;
347
348 typedef enum
349 {
350    RESOURCEALLOCATION_TYPE0,
351    RESOURCEALLOCATION_TYPE1,
352    RESOURCEALLOCATION_DYNAMICSWITCH
353 }ResAllocType;
354
355 typedef enum
356 {
357    RBG_SIZE_CONFIG1,
358    RBG_SIZE_CONFIG2
359 }RBGSize;
360
361 typedef enum
362 {
363    CODEWORDS_SCHED_BY_DCI_N1,
364    CODEWORDS_SCHED_BY_DCI_N2
365 }CodeWordsSchedDci;
366
367 typedef enum
368 {
369    TYPE_STATIC_BUNDLING = 1,
370    TYPE_DYNAMIC_BUNDLING
371 }BundlingType;
372
373 typedef enum
374 {
375    SET2_SIZE_N4,
376    SET2_SIZE_WIDEBAND
377 }BundlingSizeSet2;
378
379 typedef enum
380 {
381    SET1_SIZE_N4,
382    SET1_SIZE_WIDEBAND,
383    SET1_SIZE_N2_WIDEBAND,
384    SET1_SIZE_N4_WIDEBAND
385 }BundlingSizeSet1;
386
387 typedef enum
388 {
389    LC_PRIORITY_1 = 1,
390    LC_PRIORITY_2,
391    LC_PRIORITY_3
392 }LcPriority;
393
394 typedef enum
395 {
396   PBR_KBPS_0,
397   PBR_KBPS_8,
398   PBR_KBPS_16,
399   PBR_KBPS_32,
400   PBR_KBPS_64,
401   PBR_KBPS_128,
402   PBR_KBPS_256,
403   PBR_KBPS_512,
404   PBR_KBPS_1024,
405   PBR_KBPS_2048,
406   PBR_KBPS_4096,
407   PBR_KBPS_8192,
408   PBR_KBPS_16384,
409   PBR_KBPS_32768,
410   PBR_KBPS_65536,
411   PBR_KBPS_INFINITY
412 }PBitRate;
413
414 typedef enum
415 {
416    BSD_MS_5,
417    BSD_MS_10,
418    BSD_MS_20,
419    BSD_MS_50,
420    BSD_MS_100,
421    BSD_MS_150,
422    BSD_MS_300,
423    BSD_MS_500,
424    BSD_MS_1000,
425    BSD_SPARE_7,
426    BSD_SPARE_6,
427    BSD_SPARE_5,
428    BSD_SPARE_4,
429    BSD_SPARE_3,
430    BSD_SPARE_2,
431    BSD_SPARE_1
432
433 }BucketSizeDur;
434
435 typedef enum
436 {
437    RADIO_NW_LAYER_FAIL,
438    TRANSPORT_LAYER_FAIL,
439    PROTOCOL_FAIL,
440    MISCELLANEOUS
441 }CauseGrp;
442
443 typedef enum
444 {
445    UNSPECIFIED_RADIO_NW_CAUSE,
446    RL_FAIL_RLC,
447    UNKNOWN_GNB_CU_UE_F1AP_ID,
448    ALREADY_ALLOCATED_GNB_CU_UE_F1AP_ID,
449    UNKNOWN_GNB_DU_UE_F1AP_ID,
450    ALREADY_ALLOCATED_GNB_DU_UE_F1AP_ID,
451    UNKNOWN_UE_F1AP_ID_PAIR,
452    INCONSISTENT_UE_F1AP_ID_PAIR,
453    INTERACTION_WITH_OTHER_PROCEDURE,
454    UNSUPPORTED_QCI,
455    ACTION_REQUIRED_FOR_RADIO_REASONS,
456    RADIO_RESOURCES_UNAVAILABLE,
457    CANCELLED_PROCEDURE,
458    RELEASE_NORMAL,
459    CELL_UNAVAILABLE,
460    OTHER_RL_FAILURE,
461    UE_REJECTION,
462    RESOURCES_UNAVAILABLE_FOR_SLICE
463 }RadioNwLyrCause;
464
465 typedef enum
466 {
467    UNSPECIFIED_TRANSPORT_LAYER_CAUSE,
468    TRANSPORT_RESOURCE_UNAVAILABLE
469 }TransLyrCause;
470
471 typedef enum
472 {
473    TRANSFER_SYNTAX_ERROR,
474    ABSTRACT_SYNTAX_ERROR_REJECT,
475    ABSTRACT_SYNTAX_ERROR_IGNORE_AND_REJECT,
476    INCOMPATIBLE_MESSAGE_FOR_RECEIVER_STATE,
477    SEMANTIC_ERR,
478    ABSTRAXCT_SYNTAX_ERROR_FALSELY_CONSTRUCTED_MSG,
479    UNSPECIFIED_PROTOCOL_CAUSE
480 }ProtCause;
481
482 typedef enum
483 {
484    CONTROL_PROCESSING_OVERLOAD,
485    NOT_ENOUGH_USER,
486    PLANE_PROCESSING_RESOURCES,
487    HARDWARE_FAIL,
488    INTERVENTION_BY_O_AND_M,
489    UNSPECIFIED_MISC_CAUSE
490 }MiscFailCause;
491
492 typedef enum
493 {
494    MCS_TABLE_QAM64,
495    MCS_TABLE_QAM256,
496    MCS_TABLE_QAM64_LOW_SE
497 }McsTable;
498
499 typedef struct failureCause
500 {
501    CauseGrp   type;
502    union
503    {
504       RadioNwLyrCause   radioNwCause;
505       TransLyrCause     transportCause;
506       ProtCause         protcolCause;
507       MiscFailCause     miscCause;
508    }u;
509 }FailureCause;
510
511 typedef struct carrierCfg
512 {
513    bool  pres;
514    uint32_t   bw;             /* DL/UL bandwidth */
515    uint32_t   freq;           /* Absolute frequency of DL/UL point A in KHz */
516    uint16_t   k0[NUM_NUMEROLOGY];          /* K0 for DL/UL */
517    uint16_t   gridSize[NUM_NUMEROLOGY];    /* DL/UL Grid size for each numerologies */
518    uint16_t   numAnt;         /* Number of Tx/Rx antennas */
519 }CarrierCfg;
520
521 typedef struct ssbCfg
522 {
523    uint32_t    ssbPbchPwr;       /* SSB block power */
524    BchPduOpt   bchPayloadFlag;   /* Options for generation of payload */
525    uint8_t     scsCmn;           /* subcarrier spacing for common */
526    uint16_t    ssbOffsetPointA;  /* SSB subcarrier offset from point A */
527    BetaPss     betaPss;
528    SSBPeriod   ssbPeriod;        /* SSB Periodicity in msec */
529    uint8_t     ssbScOffset;       /* Subcarrier Offset */
530    uint8_t     mibPdu[3];           /* MIB payload */
531    uint32_t    ssbMask[SSB_MASK_SIZE];      /* Bitmap for actually transmitted SSB. */
532    uint8_t     beamId[NUM_SSB];
533    bool        multCarrBand;     /* Multiple carriers in a band */
534    bool        multCellCarr;     /* Multiple cells in single carrier */
535 }SsbCfg;
536
537 typedef struct fdmInfo
538 {
539    uint16_t   rootSeqIdx;        /* Root sequence index */
540    uint8_t    numRootSeq;        /* Number of root sequences required for FD */
541    uint16_t   k1;                /* Frequency Offset for each FD */
542    uint8_t    zeroCorrZoneCfg;   /* Zero correlation zone cofig */
543    uint8_t    numUnusedRootSeq;  /* Number of unused root sequence */
544    uint8_t    *unsuedRootSeq;     /* Unused root sequence per FD */
545 }PrachFdmInfo;
546
547 typedef struct prachCfg
548 {
549    bool          pres;
550    uint8_t       prachCfgIdx;         /* PRACH Cfg Index */
551    PrachSeqLen   prachSeqLen;         /* RACH Sequence length: Long/short */
552    uint8_t       prachSubcSpacing;    /* Subcarrier spacing of RACH */
553    RstSetCfg     prachRstSetCfg;      /* PRACH restricted set config */
554    uint16_t      msg1FreqStart;       /* Msg1-FrequencyStart */
555    uint8_t       msg1Fdm;             /* PRACH FDM (1,2,4,8) */
556    uint8_t       rootSeqLen;          /* Root sequence length */
557    PrachFdmInfo  fdm[8];              /* FDM info */
558    uint8_t       ssbPerRach;          /* SSB per RACH occassion */
559    bool          prachMultCarrBand;   /* Multiple carriers in Band */
560    uint8_t       prachRestrictedSet; /* Support for PRACH restricted set */
561    uint8_t       raContResTmr;        /* RA Contention Resoultion Timer */
562    uint8_t       rsrpThreshSsb;       /* RSRP Threshold SSB */
563    uint8_t       raRspWindow;         /* RA Response Window */
564 }PrachCfg;
565
566 typedef struct tddCfg
567 {
568    bool               pres;
569    DlUlTxPeriodicity  tddPeriod;      /* DL UL Transmission periodicity */
570    SlotConfig         slotCfg[MAXIMUM_TDD_PERIODICITY][MAX_SYMB_PER_SLOT]; 
571 }TDDCfg;
572
573 typedef struct sib1CellCfg
574 {
575    uint8_t  *sib1Pdu;
576    uint16_t sib1PduLen;
577    uint16_t sib1NewTxPeriod;
578    uint16_t sib1RepetitionPeriod;
579    uint8_t coresetZeroIndex;     /* derived from 4 LSB of pdcchSib1 present in MIB */
580    uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
581    uint16_t sib1Mcs;
582 } Sib1CellCfg; 
583
584 typedef struct bwpParams
585 {
586    uint16_t firstPrb;
587    uint16_t numPrb;
588    uint8_t  scs;
589    uint8_t  cyclicPrefix;
590 }BwpParams;
591
592 typedef struct candidatesInfo
593 {
594    uint8_t aggLevel1;
595    uint8_t aggLevel2;
596    uint8_t aggLevel4;
597    uint8_t aggLevel8;
598    uint8_t aggLevel16;
599 }CandidatesInfo;
600
601 typedef struct searchSpaceCfg
602 {
603    uint8_t searchSpaceId;
604    uint8_t coresetId;
605    uint16_t monitoringSlot;
606    uint16_t duration;
607    uint16_t monitoringSymbol;
608    CandidatesInfo candidate;
609 }SearchSpaceCfg;
610
611 typedef struct pdcchConfigCommon
612 {
613    /* only one search space is configured during SIB1 */
614    SearchSpaceCfg commonSearchSpace;
615    uint8_t raSearchSpaceId;
616 }PdcchConfigCommon;
617
618 typedef struct pdschConfigCommon
619 {
620    uint8_t k0;
621    uint8_t mappingType;
622    uint8_t startSymbol;
623    uint8_t lengthSymbol;
624 }PdschConfigCommon;
625
626 typedef struct pucchConfigCommon
627 {
628    uint8_t pucchResourceCommon;
629    uint8_t pucchGroupHopping;
630 }PucchConfigCommon;
631
632 typedef struct puschConfigCommon
633 {
634    /* PUSCH-TimeDomainResourceAllocation info */
635    uint8_t k2;
636    uint8_t mappingType;
637    uint8_t startSymbol;
638    uint8_t lengthSymbol;
639 }PuschConfigCommon;
640
641 typedef struct bwpDlConfig
642 {
643    BwpParams      bwp;
644    PdcchConfigCommon pdcchCommon;
645    PdschConfigCommon pdschCommon;
646 }BwpDlConfig;
647
648 typedef struct bwpUlConfig
649 {
650    BwpParams      bwp;
651    // rach config common sent in PrachCfg
652    PucchConfigCommon pucchCommon;
653    PuschConfigCommon puschCommon;
654 }BwpUlConfig;
655
656 typedef struct macCellCfg
657 {
658    uint16_t       cellId;           /* Cell Id */
659    uint8_t        carrierId;        /* Carrired Index */
660    uint16_t       phyCellId;        /* Physical cell id */
661    uint8_t        numerology;       /* Supported numerology */
662    DuplexMode     dupType;          /* Duplex type: TDD/FDD */
663    CarrierCfg     dlCarrCfg;        /* DL Carrier configuration */
664    CarrierCfg     ulCarrCfg;        /* UL Carrier configuration */
665    bool           freqShft;         /* Indicates presence of 7.5kHz frequency shift */
666    SsbCfg         ssbCfg;           /* SSB configuration */          
667    PrachCfg       prachCfg;         /* PRACH Configuration */
668    TDDCfg         tddCfg;           /* TDD periodicity and slot configuration */
669    RSSIMeasUnit   rssiUnit;         /* RSSI measurement unit */
670    Sib1CellCfg    sib1Cfg;          /* SIB1 config */
671    BwpDlConfig    initialDlBwp;     /* Initial DL BWP */
672    BwpUlConfig    initialUlBwp;     /* Initial UL BWP */
673    uint8_t        dmrsTypeAPos;     /* DMRS Type A position */
674 }MacCellCfg;
675
676 typedef struct macCellCfgCfm
677 {
678    uint16_t       cellId;
679    uint8_t        rsp; 
680 }MacCellCfgCfm;
681
682 typedef struct ulCcchInd
683 {
684    uint16_t cellId;
685    uint16_t crnti;
686    uint16_t ulCcchMsgLen;
687    uint8_t  *ulCcchMsg;
688 }UlCcchIndInfo;
689
690 typedef struct dlCcchInd
691 {
692    uint16_t      cellId;
693    uint16_t      crnti;
694    DlCcchMsgType msgType;
695    uint16_t      dlCcchMsgLen;
696    uint8_t       *dlCcchMsg;
697 }DlCcchIndInfo;
698
699 typedef struct bsrTmrCfg
700 {
701    uint16_t     periodicTimer;
702    uint16_t     retxTimer;
703    uint16_t     srDelayTimer;
704 }BsrTmrCfg;
705
706
707 /* Info of Scheduling Request to Add/Modify */
708 typedef struct schedReqInfo
709 {
710    uint8_t         schedReqId;
711    SrProhibitTimer srProhibitTmr;
712    SrTransMax      srTransMax;
713 }SchedReqInfo;
714
715 /* Scheduling Request Configuration */
716 typedef struct schedReqCfg
717 {
718    uint8_t       addModListCount;
719    SchedReqInfo  addModList[MAX_NUM_SR_CFG_PER_CELL_GRP];   /* List of Scheduling req to be added/modified */
720    uint8_t       relListCount;
721    uint8_t       relList[MAX_NUM_SR_CFG_PER_CELL_GRP];      /* list of scheduling request Id to be deleted */
722 }SchedReqCfg;
723
724 typedef struct tagInfo
725 {
726    uint8_t tagId;
727    TimeAlignmentTimer timeAlignTimer;
728 }TagInfo;
729
730 typedef struct tagCfg
731 {
732    uint8_t      addModListCount;
733    TagInfo      addModList[MAC_NUM_TAGS];  /* List of Tag to Add/Modify */
734    uint8_t      relListCount;
735    uint8_t      relList[MAC_NUM_TAGS];     /* list of Tag Id to release */
736 }TagCfg;
737
738 typedef struct phrCfg
739 {
740    PhrPeriodicTimer periodicTimer;
741    PhrProhibitTimer prohibitTimer; 
742    PhrTxPwrFactorChange txPowerFactor;
743    bool     multiplePHR;       
744    bool     dummy;
745    bool     phrType2OtherCell;
746    PhrModeOtherCG phrOtherCG;
747 }PhrCfg;
748
749 typedef struct macCellGrpCfg
750 {
751    SchedReqCfg schReqCfg;
752    TagCfg      tagCfg;
753    BsrTmrCfg   bsrTmrCfg;
754    bool        phrCfgSetupPres;   /* true/false: phrCfgSetup/phrCfgRelease */
755    PhrCfg      phrCfg;
756 }MacCellGrpCfg;
757
758 typedef struct phyCellGrpCfg
759 {
760    PdschHarqAckCodebook  pdschHarqAckCodebook;
761    uint8_t    pNrFr1;
762 }PhyCellGrpCfg;
763
764 /* Control resource set info */
765 typedef struct controlRsrcSet
766 {
767    uint8_t     cRSetId;                /* Control resource set id */
768    uint8_t     freqDomainRsrc[FREQ_DOM_RSRC_SIZE];  /* Frequency domain resource */
769    uint8_t     duration;
770    REGMappingType cceRegMappingType;
771    PrecoderGranul precoderGranularity;
772    uint16_t    dmrsScramblingId;
773 }ControlRsrcSet;
774
775 /* Search Space info */
776 typedef struct searchSpace
777 {
778    uint8_t     searchSpaceId;
779    uint8_t     cRSetId;
780    MSlotPeriodAndOffset  mSlotPeriodicityAndOffset;
781    uint8_t     mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
782    AggrLevel   numCandidatesAggLevel1;      /* Number of candidates for aggregation level 1 */
783    AggrLevel   numCandidatesAggLevel2;      /* Number of candidates for aggregation level 2 */
784    AggrLevel   numCandidatesAggLevel4;      /* Number of candidates for aggregation level 4 */
785    AggrLevel   numCandidatesAggLevel8;      /* Number of candidates for aggregation level 8 */
786    AggrLevel   numCandidatesAggLevel16;     /* Number of candidates for aggregation level 16 */
787    SearchSpaceType searchSpaceType;
788    uint8_t     ueSpecificDciFormat;
789 }SearchSpace;
790
791 /* PDCCH cofniguration */
792 typedef struct pdcchConfig
793 {
794    uint8_t           numCRsetToAddMod;
795    ControlRsrcSet    cRSetToAddModList[MAX_NUM_CRSET];           /* List of control resource set to add/modify */
796    uint8_t           numCRsetToRel;
797    uint8_t           cRSetToRelList[MAX_NUM_CRSET];              /* List of control resource set to release */
798    uint8_t           numSearchSpcToAddMod;
799    SearchSpace       searchSpcToAddModList[MAX_NUM_SEARCH_SPC];  /* List of search space to add/modify */
800    uint8_t           numSearchSpcToRel;
801    uint8_t           searchSpcToRelList[MAX_NUM_SEARCH_SPC];     /* List of search space to release */
802 }PdcchConfig;
803
804 /* PDSCH time domain resource allocation */
805 typedef struct pdschTimeDomRsrcAlloc
806 {
807    CommonMappingType mappingType;
808    uint8_t           startSymbol;
809    uint8_t           symbolLength;
810    uint8_t           startSymbolAndLength;
811 }PdschTimeDomRsrcAlloc;
812
813
814 typedef struct pdschBundling
815 {
816    struct staticBundling
817    {
818      BundlingSizeSet2 size;
819    }StaticBundling;
820    struct dynamicBundling
821    {
822      BundlingSizeSet1 sizeSet1;
823      BundlingSizeSet2 sizeSet2;
824    }DynamicBundling;
825 }PdschBundling;
826
827 /* DMRS downlink configuration */
828 typedef struct dmrsDlCfg
829 {
830    AddPosType  addPos;       /* DMRS additional position */
831 }DmrsDlCfg;
832
833 /* PDSCH Configuration */
834 typedef struct pdschConfig
835 {
836    DmrsDlCfg               dmrsDlCfgForPdschMapTypeA;
837    ResAllocType            resourceAllocType;
838    uint8_t                 numTimeDomRsrcAlloc;
839    PdschTimeDomRsrcAlloc   timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
840    RBGSize                 rbgSize;
841    CodeWordsSchedDci       numCodeWordsSchByDci;                    /* Number of code words scheduled by DCI */
842    BundlingType            bundlingType;
843    PdschBundling           bundlingInfo;
844 }PdschConfig;
845
846 /* Initial Downlink BWP */
847 typedef struct initialDlBwp
848 {
849    bool          pdcchPresent;
850    PdcchConfig   pdcchCfg;
851    bool          pdschPresent;
852    PdschConfig   pdschCfg;
853 }InitialDlBwp;
854
855 /* BWP Downlink common */
856 typedef struct bwpDlCommon
857 {
858 }BwpDlCommon;
859
860 /* Downlink BWP information */
861 typedef struct dlBwpInfo
862 {
863    uint8_t          bwpId;
864 }DlBwpInfo;
865
866 /* PDCCH Serving Cell configuration */
867 typedef struct pdschServCellCfg
868 {
869    uint8_t              *maxMimoLayers;           
870    NumHarqProcForPdsch  numHarqProcForPdsch;
871    MaxCodeBlkGrpPerTB   *maxCodeBlkGrpPerTb;
872    bool                 *codeBlkGrpFlushInd;
873    PdschXOverhead       *xOverhead;
874 }PdschServCellCfg;
875
876 /* PUCCH Configuration */
877
878 typedef struct pucchResrcSetInfo
879 {
880    uint8_t resrcSetId;
881    uint8_t resrcListCount;
882    uint8_t resrcList[MAX_NUM_PUCCH_PER_RESRC_SET];
883    uint8_t maxPayLoadSize;
884 }PucchResrcSetInfo;
885
886 typedef struct pucchResrcSetCfg
887 {
888    uint8_t resrcSetToAddModListCount;
889    PucchResrcSetInfo resrcSetToAddModList[MAX_NUM_PUCCH_RESRC_SET];
890    uint8_t resrcSetToRelListCount;
891    uint8_t resrcSetToRelList[MAX_NUM_PUCCH_RESRC];
892 }PucchResrcSetCfg;
893
894 typedef struct pucchFormat0
895 {
896    uint8_t initialCyclicShift;
897    uint8_t numSymbols;
898    uint8_t startSymbolIdx;
899 }PucchFormat0;
900
901 typedef struct pucchFormat1
902 {
903    uint8_t initialCyclicShift;
904    uint8_t numSymbols;
905    uint8_t startSymbolIdx;
906    uint8_t timeDomOCC;
907 }PucchFormat1;
908
909 typedef struct pucchFormat2_3
910 {
911    uint8_t numPrbs;
912    uint8_t numSymbols;
913    uint8_t startSymbolIdx;
914 }PucchFormat2_3;
915
916 typedef struct pucchFormat4
917 {
918    uint8_t numSymbols;
919    uint8_t occLen;
920    uint8_t occIdx;
921    uint8_t startSymbolIdx;
922 }PucchFormat4;
923
924 typedef struct pucchResrcInfo
925 {
926    uint8_t  resrcId;
927    uint16_t startPrb;
928    uint8_t  intraFreqHop;
929    uint16_t secondPrbHop;
930    uint8_t  pucchFormat;
931    union
932    {
933       PucchFormat0   *format0; 
934       PucchFormat1   *format1;
935       PucchFormat2_3 *format2;
936       PucchFormat2_3 *format3;
937       PucchFormat4   *format4;
938    }PucchFormat;
939 }PucchResrcInfo;
940
941 typedef struct pucchResrcCfg
942 {
943    uint8_t resrcToAddModListCount;
944    PucchResrcInfo resrcToAddModList[MAX_NUM_PUCCH_RESRC];
945    uint8_t resrcToRelListCount;
946    uint8_t resrcToRelList[MAX_NUM_PUCCH_RESRC];
947 }PucchResrcCfg;
948
949 typedef struct pucchFormatCfg
950 {
951    uint8_t interSlotFreqHop;
952    uint8_t addDmrs;
953    uint8_t maxCodeRate;
954    uint8_t numSlots;
955    bool    pi2BPSK;
956    bool    harqAckCSI;
957 }PucchFormatCfg;
958
959 typedef struct schedReqResrcInfo
960 {
961    uint8_t resrcId;
962    uint8_t requestId;
963    uint8_t periodicity;
964    uint16_t offset;
965    uint8_t resrc;
966 }SchedReqResrcInfo;
967
968 typedef struct pucchSchedReqCfg
969 {
970    uint8_t           schedAddModListCount;
971    SchedReqResrcInfo schedAddModList[MAX_NUM_SR_CFG_PER_CELL_GRP];
972    uint8_t           schedRelListCount;
973    uint8_t           schedRelList[MAX_NUM_SR_CFG_PER_CELL_GRP];
974 }PucchSchedReqCfg;
975
976 typedef struct spatialRelationInfo
977 {
978    uint8_t spatialRelationId;
979    uint8_t servCellIdx;
980    uint8_t pathLossRefRSId;
981    uint8_t p0PucchId;
982    uint8_t closeLoopIdx;
983 }SpatialRelationInfo;
984
985 typedef struct pucchSpatialCfg
986 {
987    uint8_t spatialAddModListCount;
988    SpatialRelationInfo spatialAddModList[MAX_NUM_SPATIAL_RELATIONS];
989    uint8_t spatialRelListCount;
990    uint8_t spatialRelList[MAX_NUM_SPATIAL_RELATIONS];
991 }PucchSpatialCfg;
992
993 typedef struct p0PucchCfg
994 {
995    uint8_t p0PucchId;
996    int     p0PucchVal;
997 }P0PucchCfg;
998
999 typedef struct pathLossRefRSCfg
1000 {
1001    uint8_t pathLossRefRSId;
1002 }PathLossRefRSCfg;
1003
1004 typedef struct pucchMultiCsiCfg
1005 {
1006    uint8_t  multiCsiResrcListCount;
1007    uint8_t  multiCsiResrcList[MAX_NUM_PUCCH_RESRC-1];
1008 }PucchMultiCsiCfg;
1009
1010 typedef struct pucchDlDataToUlAck
1011 {
1012    uint8_t  dlDataToUlAckListCount;
1013    uint8_t  dlDataToUlAckList[MAX_NUM_DL_DATA_TO_UL_ACK];
1014 }PucchDlDataToUlAck;
1015
1016 typedef struct pucchPowerControl
1017 {
1018    int deltaF_Format0;
1019    int deltaF_Format1;
1020    int deltaF_Format2;
1021    int deltaF_Format3;
1022    int deltaF_Format4;
1023    uint8_t p0SetCount;
1024    P0PucchCfg p0Set[MAX_NUM_PUCCH_P0_PER_SET];
1025    uint8_t pathLossRefRSListCount;
1026    PathLossRefRSCfg pathLossRefRSList[MAX_NUM_PATH_LOSS_REF_RS];
1027 }PucchPowerControl;
1028
1029 typedef struct pucchCfg
1030 {
1031    PucchResrcSetCfg  *resrcSet;
1032    PucchResrcCfg     *resrc;
1033    PucchFormatCfg    *format1; 
1034    PucchFormatCfg    *format2; 
1035    PucchFormatCfg    *format3; 
1036    PucchFormatCfg    *format4;
1037    PucchSchedReqCfg  *schedReq;
1038    PucchMultiCsiCfg  *multiCsiCfg;
1039    PucchSpatialCfg   *spatialInfo;
1040    PucchDlDataToUlAck *dlDataToUlAck;
1041    PucchPowerControl *powerControl;
1042 }PucchCfg;
1043
1044 /* Transform precoding disabled */
1045 typedef struct transPrecodDisabled
1046 {
1047    uint16_t   scramblingId0;
1048 }TransPrecodDisabled;
1049
1050 /* DMRS Uplink configuration */
1051 typedef struct dmrsUlCfg
1052 {
1053    AddPosType            addPos;               /* DMRS additional position */
1054    TransPrecodDisabled   transPrecodDisabled;  /* Transform precoding disabled */
1055 }DmrsUlCfg;
1056
1057 /* PUSCH Time Domain Resource Allocation */
1058 typedef struct puschTimeDomRsrcAlloc
1059 {
1060    uint8_t   k2;
1061    CommonMappingType   mappingType;
1062    uint8_t           startSymbol;
1063    uint8_t           symbolLength;
1064    uint8_t   startSymbolAndLength;
1065 }PuschTimeDomRsrcAlloc;
1066
1067 /* PUSCH Configuration */
1068 typedef struct puschCfg
1069 {
1070    uint8_t                 dataScramblingId;
1071    DmrsUlCfg               dmrsUlCfgForPuschMapTypeA;
1072    ResAllocType            resourceAllocType;
1073    uint8_t                 numTimeDomRsrcAlloc;
1074    PuschTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1075    TransformPrecoder       transformPrecoder;
1076 }PuschCfg;
1077
1078 /* Initial Uplink BWP */
1079 typedef struct initialUlBwp
1080 {
1081    bool       pucchPresent;
1082    PucchCfg   pucchCfg; 
1083    bool       puschPresent;
1084    PuschCfg   puschCfg;
1085 }InitialUlBwp;
1086
1087 /* Uplink BWP information */
1088 typedef struct ulBwpInfo
1089 {
1090    uint8_t        bwpId;
1091 }UlBwpInfo;
1092
1093 /* Serving cell configuration */
1094 typedef struct servCellCfgInfo
1095 {
1096    InitialDlBwp       initDlBwp;
1097    uint8_t            numDlBwpToAdd;
1098    DlBwpInfo          DlBwpToAddList[MAX_NUM_BWP];
1099    uint8_t            firstActvDlBwpId;
1100    uint8_t            defaultDlBwpId;
1101    uint8_t            *bwpInactivityTmr;
1102    PdschServCellCfg   pdschServCellCfg;
1103    InitialUlBwp       initUlBwp;
1104    uint8_t            numUlBwpToAdd;
1105    UlBwpInfo          UlBwpToAddList[MAX_NUM_BWP];
1106    uint8_t            firstActvUlBwpId;
1107 }ServCellCfgInfo;
1108
1109 /* Special cell configuration */
1110 typedef struct spCellCfg
1111 {
1112    uint8_t           servCellIdx;
1113    ServCellCfgInfo   servCellCfg;
1114 }SpCellCfg;
1115
1116 typedef struct ambrCfg
1117 {
1118    uint32_t ulBr;   /* UL Bit rate */
1119    uint32_t dlBr;   /* DL Bit rate */
1120 }AmbrCfg;
1121
1122 /* Single Network Slice Selection assistance Info */
1123 typedef struct snssai
1124 {
1125    uint8_t sst;                /* Slice Type */
1126    uint8_t sd[SD_SIZE];        /* Slice Differentiator */
1127 }Snssai;
1128
1129 typedef struct nonDynFiveQi
1130 {
1131    uint16_t   fiveQi;
1132    uint8_t    priorLevel;
1133    uint16_t   avgWindow;
1134    uint16_t   maxDataBurstVol;
1135 }NonDynFiveQi;
1136
1137 typedef struct dynFiveQi
1138 {
1139    uint8_t    priorLevel;
1140    uint16_t   packetDelayBudget;
1141    uint8_t    packetErrRateScalar;
1142    uint8_t    packetErrRateExp;
1143    uint16_t   fiveQi;
1144    uint8_t    delayCritical;
1145    uint16_t   avgWindow;
1146    uint16_t   maxDataBurstVol;
1147 }DynFiveQi;
1148
1149 typedef struct ngRanAllocAndRetPri
1150 {
1151    uint8_t priorityLevel;
1152    uint8_t preEmptionCap;
1153    uint8_t preEmptionVul;
1154 }NgRanAllocAndRetPri;
1155
1156 typedef struct grbQosInfo
1157 {
1158    uint32_t maxFlowBitRateDl;
1159    uint32_t maxFlowBitRateUl;
1160    uint32_t guarFlowBitRateDl;
1161    uint32_t guarFlowBitRateUl;
1162 }GrbQosInfo;
1163
1164 typedef struct drbQos
1165 {
1166    QosType  fiveQiType;   /* Dynamic or non-dynamic */ 
1167    union
1168    {
1169       NonDynFiveQi   nonDyn5Qi;
1170       DynFiveQi      dyn5Qi;
1171    }u;
1172    NgRanAllocAndRetPri ngRanRetPri;
1173    GrbQosInfo grbQosInfo;
1174    uint16_t             pduSessionId;
1175    uint32_t             ulPduSessAggMaxBitRate;
1176 }DrbQosInfo;
1177
1178 typedef struct ulLcCfg
1179 {
1180    uint8_t priority;
1181    uint8_t lcGroup;
1182    uint8_t schReqId;
1183    PBitRate pbr;        // prioritisedBitRate
1184    BucketSizeDur bsd;        // bucketSizeDuration
1185 }UlLcCfg;
1186
1187 typedef struct duLcCfg
1188 {
1189    LcPriority lcp;      // logical Channel Prioritization
1190 }DlLcCfg;
1191
1192 typedef struct lcCfg
1193 {
1194    ConfigType configType;
1195    uint8_t lcId;
1196    DrbQosInfo *drbQos; 
1197    Snssai  *snssai;
1198    bool ulLcCfgPres;
1199    UlLcCfg ulLcCfg;
1200    DlLcCfg dlLcCfg;
1201 }LcCfg;
1202
1203 typedef struct modulationInfo
1204 {
1205    uint8_t     modOrder;    /* Modulation order */
1206    uint8_t     mcsIndex;    /* MCS Index */
1207    McsTable    mcsTable;    /* MCS table */
1208 }ModulationInfo;
1209
1210 typedef struct macUeCfg
1211 {
1212    uint16_t cellId;
1213    uint8_t  ueIdx;
1214    uint16_t crnti;
1215    MacCellGrpCfg macCellGrpCfg;
1216    PhyCellGrpCfg phyCellGrpCfg;
1217    SpCellCfg spCellCfg;
1218    AmbrCfg   *ambrCfg;
1219    ModulationInfo dlModInfo;    /* DL modulation info */
1220    ModulationInfo ulModInfo;    /* UL modulation info */
1221    uint8_t numLcs;
1222    LcCfg lcCfgList[MAX_NUM_LC];
1223    UeCfgState macUeCfgState;    /* InActive / Completed */
1224 }MacUeCfg;
1225
1226 typedef struct nrcgi
1227 {
1228    Plmn      plmn;
1229    uint16_t  cellId;
1230 }Nrcgi;
1231
1232 typedef struct srbFailInfo
1233 {
1234    uint8_t       srbId;
1235    FailureCause  cause;
1236 }SRBFailInfo;
1237
1238 typedef struct drbFailInfo
1239 {
1240    uint8_t       drbId;
1241    FailureCause  cause;
1242 }DRBFailInfo;
1243
1244 typedef struct sCellFailInfo
1245 {
1246    Nrcgi         nrcgi;
1247    FailureCause  cause;
1248 }SCellFailInfo;
1249
1250 typedef struct ueCfgRsp
1251 {
1252    uint16_t       cellId;
1253    uint16_t       ueIdx;
1254    MacRsp         result;
1255    uint8_t        numSRBFailed;   /* valid values : 0 to MAX_NUM_SRB */ 
1256    SRBFailInfo    *failedSRBlisti;
1257    uint8_t        numDRBFailed;   /* valid values : 0 to MAX_NUM_DRB */
1258    DRBFailInfo    *failedDRBlist;
1259    uint8_t        numSCellFailed; /* valid values : 0 to MAX_NUM_SCELL */
1260    SCellFailInfo  *failedSCellList;
1261 }MacUeCfgRsp;
1262
1263 /* Functions for slot Ind from MAC to DU APP*/
1264 typedef uint8_t (*DuMacCellUpInd) ARGS((
1265          Pst       *pst,
1266          OduCellId *cellId ));
1267
1268 /* Functions for stop Ind from MAC to DU APP*/
1269 typedef uint8_t (*DuMacStopInd) ARGS((
1270          Pst        *pst,
1271          OduCellId  *cellId ));
1272
1273 /* Functions for mac cell start req */
1274 typedef uint8_t (*DuMacCellStart) ARGS((
1275          Pst        *pst, 
1276          OduCellId  *cellId));
1277
1278 /* Functions for mac cell stop request */
1279 typedef uint8_t (*DuMacCellStop) ARGS((
1280          Pst        *pst,
1281          OduCellId  *cellId ));
1282
1283 /* Function pointers for packing macCellCfg Request and Confirm */
1284 typedef uint8_t (*packMacCellCfgReq) ARGS((
1285          Pst           *pst,
1286          MacCellCfg    *macCellCfg ));
1287
1288 typedef uint8_t (*packMacCellCfgConfirm) ARGS((
1289          Pst              *pst,
1290          MacCellCfgCfm    *macCellCfgCfm ));
1291
1292 typedef uint8_t (*DuMacCellCfgReq) ARGS((
1293          Pst        *pst,        
1294          MacCellCfg *macCellCfg));
1295
1296 typedef uint8_t (*DuMacCellCfgCfm) ARGS((
1297          Pst        *pst,        
1298          MacCellCfgCfm *macCellCfgCfm ));
1299
1300 /* Functions for UL CCCH Ind from MAC to DU APP*/
1301 typedef uint8_t (*DuMacUlCcchInd) ARGS((
1302          Pst           *pst,
1303          UlCcchIndInfo *ulCcchIndInfo ));
1304
1305 /* Functions for DL CCCH Ind from DU APP to MAC*/
1306 typedef uint8_t (*DuMacDlCcchInd) ARGS((
1307          Pst           *pst,
1308          DlCcchIndInfo *dlCcchIndInfo ));
1309
1310 /* UE create Request from DU APP to MAC*/
1311 typedef uint8_t (*DuMacUeCreateReq) ARGS((
1312          Pst           *pst,
1313          MacUeCfg      *ueCfg ));
1314
1315 /* UE create Response from MAC to DU APP */
1316 typedef uint8_t (*MacDuUeCfgRspFunc) ARGS((
1317          Pst           *pst, 
1318          MacUeCfgRsp   *cfgRsp));
1319
1320 /* UE Reconfig Request from DU APP to MAC*/
1321 typedef uint8_t (*DuMacUeReconfigReq) ARGS((
1322          Pst           *pst,
1323          MacUeCfg      *ueCfg ));
1324
1325 uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId);
1326 uint8_t unpackMacCellUpInd(DuMacCellUpInd func, Pst *pst, Buffer *mBuf);
1327 uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId);
1328 uint8_t packMacCellStart(Pst *pst, OduCellId *cellId);
1329 uint8_t unpackMacCellStart(DuMacCellStart func, Pst *pst, Buffer *mBuf);
1330 uint8_t MacProcCellStart(Pst *pst, OduCellId *cellId);
1331 uint8_t packMacCellStop(Pst *pst, OduCellId *cellId);
1332 uint8_t unpackMacCellStop(DuMacCellStop func, Pst *pst, Buffer *mBuf);
1333 uint8_t MacProcCellStop(Pst *pst, OduCellId *cellId);
1334 uint8_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
1335 uint8_t unpackDuMacCellCfg(DuMacCellCfgReq func,  Pst *pst,  Buffer *mBuf);
1336 uint8_t MacProcCellCfgReq(Pst *pst, MacCellCfg *macCellCfg);
1337 uint8_t packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
1338 uint8_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf);
1339 uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
1340 uint8_t packMacStopInd(Pst *pst, OduCellId *cellId);
1341 uint8_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf);
1342 uint8_t duHandleStopInd(Pst *pst, OduCellId *cellId);
1343 uint8_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
1344 uint8_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf);
1345 uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
1346 uint8_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
1347 uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf);
1348 uint8_t MacProcDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
1349 uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCfg *ueCfg);
1350 uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf);
1351 uint8_t MacProcUeCreateReq(Pst *pst, MacUeCfg *ueCfg);
1352 uint8_t sendStopIndMacToDuApp(uint16_t cellId);
1353 uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp);
1354 uint8_t unpackDuMacUeCfgRsp(MacDuUeCfgRspFunc func, Pst *pst, Buffer *mBuf);
1355 uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp);
1356 uint8_t packDuMacUeReconfigReq(Pst *pst, MacUeCfg *ueCfg);
1357 uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf);
1358 uint8_t MacProcUeReconfigReq(Pst *pst, MacUeCfg *ueCfg);
1359
1360 #endif
1361
1362 /**********************************************************************
1363   End of file
1364  **********************************************************************/