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