985f29e9d4dabe47336c2338780d536a61d3e70a
[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
41 /* Macro for Ue Context */
42 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8   /* Max number of scheduling request config per cell group */
43 #define MAC_NUM_TAGS 4                  /* Max number of timing advance groups */
44 #define MAX_NUM_BWP  4                  /* Max number of BWP per serving cell */
45 #define MAX_NUM_CRSET  3                /* Max number of control resource set in add/modify/release list */
46 #define MAX_NUM_SEARCH_SPC  10          /* Max number of search space in add/modify/release list */
47 #define MONITORING_SYMB_WITHIN_SLOT_SIZE 2  /* i.e. 2 bytes because size of monitoring symbols within slot is 14 bits */
48 #define MAX_NUM_DL_ALLOC 16             /* Max number of pdsch time domain downlink allocation */
49 #define MAX_NUM_UL_ALLOC 16             /* Max number of pusch time domain uplink allocation */
50 #define MAX_NUM_SCELL  32
51
52 /* PUCCH Configuration Macro */
53 #define MAX_NUM_PUCCH_RESRC 128
54 #define MAX_NUM_PUCCH_RESRC_SET 4
55 #define MAX_NUM_PUCCH_PER_RESRC_SET 32
56 #define MAX_NUM_SPATIAL_RELATIONS 8
57 #define MAX_NUM_PUCCH_P0_PER_SET 8
58 #define MAX_NUM_PATH_LOSS_REF_RS 4
59 #define MAX_NUM_DL_DATA_TO_UL_ACK 15
60
61 /* Event IDs */
62 #define EVENT_MAC_CELL_CONFIG_REQ    200
63 #define EVENT_MAC_CELL_CONFIG_CFM    201
64 #define EVENT_MAC_CELL_START         202
65 #define EVENT_MAC_CELL_STOP          203
66 #define EVENT_MAC_CELL_UP_IND        204
67 #define EVENT_MAC_STOP_IND           205
68 #define EVENT_MAC_UL_CCCH_IND        206
69 #define EVENT_MAC_DL_CCCH_IND        207
70 #define EVENT_MAC_UE_CREATE_REQ      208
71 #define EVENT_MAC_UE_CREATE_RSP      209
72 #define EVENT_MAC_UE_RECONFIG_REQ    210
73 #define EVENT_MAC_UE_RECONFIG_RSP    211
74 #define EVENT_MAC_UE_DELETE_REQ      212
75 #define EVENT_MAC_UE_DELETE_RSP      213
76 #define EVENT_MAC_CELL_DELETE_REQ    214
77 #define EVENT_MAC_CELL_DELETE_RSP    215
78 #define EVENT_MAC_SLICE_CFG_REQ      216
79 #define EVENT_MAC_SLICE_CFG_RSP      217
80 #define EVENT_MAC_SLICE_RECFG_REQ    218
81 #define EVENT_MAC_SLICE_RECFG_RSP    219
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    SLICE_PRESENT,
96    SLICE_NOT_PRESENT
97 }RspReason;
98
99 typedef enum
100 {
101    SUCCESS,
102    CELLID_INVALID,
103    UEID_INVALID
104 }UeDeleteStatus;
105
106 typedef enum
107 {
108    SUCCESSFUL_RSP,
109    CELL_ID_INVALID
110 }CellDeleteStatus;
111
112 typedef enum
113 {
114    DUP_MODE_FDD,
115    DUP_MODE_TDD
116 }DuplexMode;
117
118 typedef enum
119 {
120    MAC_GEN_FULL_PBCH_PAYLD,   /* MAC generated the full PBCH Payload */
121    PHY_GEN_TIMING_PBCH_BIT,   /* PHY generates the timing PBCH bits */
122    PHY_GEN_FULL_PBCH_PAYLD    /* PHY generates full PBCH payload */
123 }BchPduOpt;
124
125 typedef enum
126 {
127    LONG_SEQUENCE,
128    SHORT_SEQUENCE
129 }PrachSeqLen;
130
131 typedef enum
132 {
133    UNRESTRICTED,
134    RESTRICTED_SET_TYPE_A,
135    RESTRICTED_SET_TYPE_B
136 }RstSetCfg;
137
138 typedef enum
139 {
140    DONT_REPORT_RSSI,
141    RSSI_UNIT_DBM,
142    RSSI_UNIT_DBFS
143 }RSSIMeasUnit;
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 enum
500 {
501    RSRC_PRB,
502    RSRC_DRB,
503    RSRC_RRC_CONNECTED_USERS
504 }ResourceType;
505
506 typedef struct failureCause
507 {
508    CauseGrp   type;
509    union
510    {
511       RadioNwLyrCause   radioNwCause;
512       TransLyrCause     transportCause;
513       ProtCause         protcolCause;
514       MiscFailCause     miscCause;
515    }u;
516 }FailureCause;
517
518 typedef struct carrierCfg
519 {
520    bool  pres;
521    uint32_t   bw;             /* DL/UL bandwidth */
522    uint32_t   freq;           /* Absolute frequency of DL/UL point A in KHz */
523    uint16_t   k0[NUM_NUMEROLOGY];          /* K0 for DL/UL */
524    uint16_t   gridSize[NUM_NUMEROLOGY];    /* DL/UL Grid size for each numerologies */
525    uint16_t   numAnt;         /* Number of Tx/Rx antennas */
526 }CarrierCfg;
527
528 typedef struct ssbCfg
529 {
530    uint32_t    ssbPbchPwr;       /* SSB block power */
531    BchPduOpt   bchPayloadFlag;   /* Options for generation of payload */
532    uint8_t     scsCmn;           /* subcarrier spacing for common */
533    uint16_t    ssbOffsetPointA;  /* SSB subcarrier offset from point A */
534    BetaPss     betaPss;
535    SSBPeriod   ssbPeriod;        /* SSB Periodicity in msec */
536    uint8_t     ssbScOffset;       /* Subcarrier Offset */
537    uint8_t     mibPdu[3];           /* MIB payload */
538    uint32_t    ssbMask[SSB_MASK_SIZE];      /* Bitmap for actually transmitted SSB. */
539    uint8_t     beamId[NUM_SSB];
540    bool        multCarrBand;     /* Multiple carriers in a band */
541    bool        multCellCarr;     /* Multiple cells in single carrier */
542 }SsbCfg;
543
544 typedef struct fdmInfo
545 {
546    uint16_t   rootSeqIdx;        /* Root sequence index */
547    uint8_t    numRootSeq;        /* Number of root sequences required for FD */
548    uint16_t   k1;                /* Frequency Offset for each FD */
549    uint8_t    zeroCorrZoneCfg;   /* Zero correlation zone cofig */
550    uint8_t    numUnusedRootSeq;  /* Number of unused root sequence */
551    uint8_t    *unsuedRootSeq;     /* Unused root sequence per FD */
552 }PrachFdmInfo;
553
554 typedef struct prachCfg
555 {
556    bool          pres;
557    uint8_t       prachCfgIdx;         /* PRACH Cfg Index */
558    PrachSeqLen   prachSeqLen;         /* RACH Sequence length: Long/short */
559    uint8_t       prachSubcSpacing;    /* Subcarrier spacing of RACH */
560    RstSetCfg     prachRstSetCfg;      /* PRACH restricted set config */
561    uint16_t      msg1FreqStart;       /* Msg1-FrequencyStart */
562    uint8_t       msg1Fdm;             /* PRACH FDM (1,2,4,8) */
563    uint8_t       rootSeqLen;          /* Root sequence length */
564    PrachFdmInfo  fdm[8];              /* FDM info */
565    uint8_t       ssbPerRach;          /* SSB per RACH occassion */
566    bool          prachMultCarrBand;   /* Multiple carriers in Band */
567    uint8_t       prachRestrictedSet; /* Support for PRACH restricted set */
568    uint8_t       raContResTmr;        /* RA Contention Resoultion Timer */
569    uint8_t       rsrpThreshSsb;       /* RSRP Threshold SSB */
570    uint8_t       raRspWindow;         /* RA Response Window */
571 }PrachCfg;
572
573 typedef struct schPageCfg
574 {
575   uint8_t  numPO;                    /*Derived from Ns*/
576   bool     poPresent;                /*Whether FirstPDCCH-MonitoringPO is present or not*/
577   uint16_t pagingOcc[MAX_PO_PER_PF]; /*FirstPDCCH-Monitoring Paging Occasion*/
578 }SchPageCfg;
579
580 typedef struct sib1CellCfg
581 {
582    uint8_t  *sib1Pdu;
583    uint16_t sib1PduLen;
584    uint16_t sib1RepetitionPeriod;
585    uint8_t coresetZeroIndex;     /* derived from 4 LSB of pdcchSib1 present in MIB */
586    uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
587    uint16_t sib1Mcs;
588    SchPageCfg  pagingCfg;
589 } Sib1CellCfg; 
590
591 typedef struct bwpParams
592 {
593    uint16_t firstPrb;
594    uint16_t numPrb;
595    uint8_t  scs;
596    uint8_t  cyclicPrefix;
597 }BwpParams;
598
599 typedef struct candidatesInfo
600 {
601    uint8_t aggLevel1;
602    uint8_t aggLevel2;
603    uint8_t aggLevel4;
604    uint8_t aggLevel8;
605    uint8_t aggLevel16;
606 }CandidatesInfo;
607
608 typedef struct searchSpaceCfg
609 {
610    uint8_t searchSpaceId;
611    uint8_t coresetId;
612    uint16_t monitoringSlot;
613    uint16_t duration;
614    uint16_t monitoringSymbol;
615    CandidatesInfo candidate;
616 }SearchSpaceCfg;
617
618 typedef struct pdcchConfigCommon
619 {
620    /* only one search space is configured during SIB1 */
621    SearchSpaceCfg commonSearchSpace;
622    uint8_t raSearchSpaceId;
623 }PdcchConfigCommon;
624
625 typedef struct pdschCfgCommTimeDomRsrcAlloc
626 {
627    uint8_t k0;
628    uint8_t mappingType;
629    uint8_t startSymbol;
630    uint8_t lengthSymbol;
631 }PdschCfgCommTimeDomRsrcAlloc;
632
633 typedef struct pdschConfigCommon
634 {
635    uint8_t  numTimeDomAlloc;
636    /* PDSCH time domain DL resource allocation list */
637    PdschCfgCommTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_DL_ALLOC]; 
638 }PdschConfigCommon;
639
640 typedef struct pucchConfigCommon
641 {
642    uint8_t pucchResourceCommon;
643    uint8_t pucchGroupHopping;
644 }PucchConfigCommon;
645
646 /* PUSCH Time Domain Resource Allocation */
647 typedef struct puschTimeDomRsrcAlloc
648 {
649    uint8_t   k2;
650    CommonMappingType   mappingType;
651    uint8_t           startSymbol;
652    uint8_t           symbolLength;
653    uint8_t   startSymbolAndLength;
654 }PuschTimeDomRsrcAlloc;
655
656
657 typedef struct puschConfigCommon
658 {
659    /* PUSCH-TimeDomainResourceAllocation info */
660    uint8_t                 numTimeDomRsrcAlloc;
661    PuschTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
662 }PuschConfigCommon;
663
664 typedef struct bwpDlConfig
665 {
666    BwpParams      bwp;
667    PdcchConfigCommon pdcchCommon;
668    PdschConfigCommon pdschCommon;
669 }BwpDlConfig;
670
671 typedef struct bwpUlConfig
672 {
673    BwpParams      bwp;
674    // rach config common sent in PrachCfg
675    PucchConfigCommon pucchCommon;
676    PuschConfigCommon puschCommon;
677 }BwpUlConfig;
678
679 typedef struct plmnInfoList
680 {
681    Plmn           plmn;
682    uint8_t        numSupportedSlice; /* Total slice supporting */
683    Snssai         **snssai;         /* List of supporting snssai*/
684 }PlmnInfoList;
685
686 typedef struct macCellCfg
687 {
688    uint16_t       cellId;           /* Cell Id */
689    uint8_t        carrierId;        /* Carrired Index */
690    uint16_t       phyCellId;        /* Physical cell id */
691    uint8_t        numerology;       /* Supported numerology */
692    DuplexMode     dupType;          /* Duplex type: TDD/FDD */
693    CarrierCfg     dlCarrCfg;        /* DL Carrier configuration */
694    CarrierCfg     ulCarrCfg;        /* UL Carrier configuration */
695    bool           freqShft;         /* Indicates presence of 7.5kHz frequency shift */
696    SsbCfg         ssbCfg;           /* SSB configuration */          
697    PrachCfg       prachCfg;         /* PRACH Configuration */
698 #ifdef NR_TDD
699    TDDCfg         tddCfg;           /* TDD periodicity and slot configuration */
700 #endif
701    RSSIMeasUnit   rssiUnit;         /* RSSI measurement unit */
702    Sib1CellCfg    sib1Cfg;          /* SIB1 config */
703    BwpDlConfig    initialDlBwp;     /* Initial DL BWP */
704    BwpUlConfig    initialUlBwp;     /* Initial UL BWP */
705    uint8_t        dmrsTypeAPos;     /* DMRS Type A position */
706    PlmnInfoList   plmnInfoList;     /* Consits of PlmnId and Snssai list */
707    //RrmPolicy      *rrmPolicy;       /* RRM policy details */ 
708 }MacCellCfg;
709
710 typedef struct macCellCfgCfm
711 {
712    uint16_t       cellId;
713    uint8_t        rsp; 
714 }MacCellCfgCfm;
715
716 typedef struct ulCcchInd
717 {
718    uint16_t cellId;
719    uint16_t crnti;
720    uint16_t ulCcchMsgLen;
721    uint8_t  *ulCcchMsg;
722 }UlCcchIndInfo;
723
724 typedef struct dlCcchInd
725 {
726    uint16_t      cellId;
727    uint16_t      crnti;
728    DlCcchMsgType msgType;
729    uint16_t      dlCcchMsgLen;
730    uint8_t       *dlCcchMsg;
731 }DlCcchIndInfo;
732
733 typedef struct bsrTmrCfg
734 {
735    uint16_t     periodicTimer;
736    uint16_t     retxTimer;
737    uint16_t     srDelayTimer;
738 }BsrTmrCfg;
739
740
741 /* Info of Scheduling Request to Add/Modify */
742 typedef struct schedReqInfo
743 {
744    uint8_t         schedReqId;
745    SrProhibitTimer srProhibitTmr;
746    SrTransMax      srTransMax;
747 }SchedReqInfo;
748
749 /* Scheduling Request Configuration */
750 typedef struct schedReqCfg
751 {
752    uint8_t       addModListCount;
753    SchedReqInfo  addModList[MAX_NUM_SR_CFG_PER_CELL_GRP];   /* List of Scheduling req to be added/modified */
754    uint8_t       relListCount;
755    uint8_t       relList[MAX_NUM_SR_CFG_PER_CELL_GRP];      /* list of scheduling request Id to be deleted */
756 }SchedReqCfg;
757
758 typedef struct tagInfo
759 {
760    uint8_t tagId;
761    TimeAlignmentTimer timeAlignTimer;
762 }TagInfo;
763
764 typedef struct tagCfg
765 {
766    uint8_t      addModListCount;
767    TagInfo      addModList[MAC_NUM_TAGS];  /* List of Tag to Add/Modify */
768    uint8_t      relListCount;
769    uint8_t      relList[MAC_NUM_TAGS];     /* list of Tag Id to release */
770 }TagCfg;
771
772 typedef struct phrCfg
773 {
774    PhrPeriodicTimer periodicTimer;
775    PhrProhibitTimer prohibitTimer; 
776    PhrTxPwrFactorChange txPowerFactor;
777    bool     multiplePHR;       
778    bool     dummy;
779    bool     phrType2OtherCell;
780    PhrModeOtherCG phrOtherCG;
781 }PhrCfg;
782
783 typedef struct macCellGrpCfg
784 {
785    SchedReqCfg schReqCfg;
786    TagCfg      tagCfg;
787    BsrTmrCfg   bsrTmrCfg;
788    bool        phrCfgSetupPres;   /* true/false: phrCfgSetup/phrCfgRelease */
789    PhrCfg      phrCfg;
790 }MacCellGrpCfg;
791
792 typedef struct phyCellGrpCfg
793 {
794    PdschHarqAckCodebook  pdschHarqAckCodebook;
795    uint8_t    pNrFr1;
796 }PhyCellGrpCfg;
797
798 /* Control resource set info */
799 typedef struct controlRsrcSet
800 {
801    uint8_t     cRSetId;                /* Control resource set id */
802    uint8_t     freqDomainRsrc[FREQ_DOM_RSRC_SIZE];  /* Frequency domain resource */
803    uint8_t     duration;
804    REGMappingType cceRegMappingType;
805    PrecoderGranul precoderGranularity;
806    uint16_t    dmrsScramblingId;
807 }ControlRsrcSet;
808
809 /* Search Space info */
810 typedef struct searchSpace
811 {
812    uint8_t     searchSpaceId;
813    uint8_t     cRSetId;
814    MSlotPeriodAndOffset  mSlotPeriodicityAndOffset;
815    uint8_t     mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
816    AggrLevel   numCandidatesAggLevel1;      /* Number of candidates for aggregation level 1 */
817    AggrLevel   numCandidatesAggLevel2;      /* Number of candidates for aggregation level 2 */
818    AggrLevel   numCandidatesAggLevel4;      /* Number of candidates for aggregation level 4 */
819    AggrLevel   numCandidatesAggLevel8;      /* Number of candidates for aggregation level 8 */
820    AggrLevel   numCandidatesAggLevel16;     /* Number of candidates for aggregation level 16 */
821    SearchSpaceType searchSpaceType;
822    uint8_t     ueSpecificDciFormat;
823 }SearchSpace;
824
825 /* PDCCH cofniguration */
826 typedef struct pdcchConfig
827 {
828    uint8_t           numCRsetToAddMod;
829    ControlRsrcSet    cRSetToAddModList[MAX_NUM_CRSET];           /* List of control resource set to add/modify */
830    uint8_t           numCRsetToRel;
831    uint8_t           cRSetToRelList[MAX_NUM_CRSET];              /* List of control resource set to release */
832    uint8_t           numSearchSpcToAddMod;
833    SearchSpace       searchSpcToAddModList[MAX_NUM_SEARCH_SPC];  /* List of search space to add/modify */
834    uint8_t           numSearchSpcToRel;
835    uint8_t           searchSpcToRelList[MAX_NUM_SEARCH_SPC];     /* List of search space to release */
836 }PdcchConfig;
837
838 /* PDSCH time domain resource allocation */
839 typedef struct pdschTimeDomRsrcAlloc
840 {
841    uint8_t           *k0;
842    CommonMappingType mappingType;
843    uint8_t           startSymbol;
844    uint8_t           symbolLength;
845    uint8_t           startSymbolAndLength;
846 }PdschTimeDomRsrcAlloc;
847
848
849 typedef struct pdschBundling
850 {
851    struct staticBundling
852    {
853      BundlingSizeSet2 size;
854    }StaticBundling;
855    struct dynamicBundling
856    {
857      BundlingSizeSet1 sizeSet1;
858      BundlingSizeSet2 sizeSet2;
859    }DynamicBundling;
860 }PdschBundling;
861
862 /* DMRS downlink configuration */
863 typedef struct dmrsDlCfg
864 {
865    AddPosType  addPos;       /* DMRS additional position */
866 }DmrsDlCfg;
867
868 /* PDSCH Configuration */
869 typedef struct pdschConfig
870 {
871    DmrsDlCfg               dmrsDlCfgForPdschMapTypeA;
872    ResAllocType            resourceAllocType;
873    uint8_t                 numTimeDomRsrcAlloc;
874    PdschTimeDomRsrcAlloc   timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
875    RBGSize                 rbgSize;
876    CodeWordsSchedDci       numCodeWordsSchByDci;                    /* Number of code words scheduled by DCI */
877    BundlingType            bundlingType;
878    PdschBundling           bundlingInfo;
879 }PdschConfig;
880
881 /* Initial Downlink BWP */
882 typedef struct initialDlBwp
883 {
884    bool          pdcchPresent;
885    PdcchConfig   pdcchCfg;
886    bool          pdschPresent;
887    PdschConfig   pdschCfg;
888 }InitialDlBwp;
889
890 /* BWP Downlink common */
891 typedef struct bwpDlCommon
892 {
893 }BwpDlCommon;
894
895 /* Downlink BWP information */
896 typedef struct dlBwpInfo
897 {
898    uint8_t          bwpId;
899 }DlBwpInfo;
900
901 /* PDCCH Serving Cell configuration */
902 typedef struct pdschServCellCfg
903 {
904    uint8_t              *maxMimoLayers;           
905    NumHarqProcForPdsch  numHarqProcForPdsch;
906    MaxCodeBlkGrpPerTB   *maxCodeBlkGrpPerTb;
907    bool                 *codeBlkGrpFlushInd;
908    PdschXOverhead       *xOverhead;
909 }PdschServCellCfg;
910
911 /* PUCCH Configuration */
912
913 typedef struct pucchResrcSetInfo
914 {
915    uint8_t resrcSetId;
916    uint8_t resrcListCount;
917    uint8_t resrcList[MAX_NUM_PUCCH_PER_RESRC_SET];
918    uint8_t maxPayLoadSize;
919 }PucchResrcSetInfo;
920
921 typedef struct pucchResrcSetCfg
922 {
923    uint8_t resrcSetToAddModListCount;
924    PucchResrcSetInfo resrcSetToAddModList[MAX_NUM_PUCCH_RESRC_SET];
925    uint8_t resrcSetToRelListCount;
926    uint8_t resrcSetToRelList[MAX_NUM_PUCCH_RESRC];
927 }PucchResrcSetCfg;
928
929 typedef struct pucchFormat0
930 {
931    uint8_t initialCyclicShift;
932    uint8_t numSymbols;
933    uint8_t startSymbolIdx;
934 }PucchFormat0;
935
936 typedef struct pucchFormat1
937 {
938    uint8_t initialCyclicShift;
939    uint8_t numSymbols;
940    uint8_t startSymbolIdx;
941    uint8_t timeDomOCC;
942 }PucchFormat1;
943
944 typedef struct pucchFormat2_3
945 {
946    uint8_t numPrbs;
947    uint8_t numSymbols;
948    uint8_t startSymbolIdx;
949 }PucchFormat2_3;
950
951 typedef struct pucchFormat4
952 {
953    uint8_t numSymbols;
954    uint8_t occLen;
955    uint8_t occIdx;
956    uint8_t startSymbolIdx;
957 }PucchFormat4;
958
959 typedef struct pucchResrcInfo
960 {
961    uint8_t  resrcId;
962    uint16_t startPrb;
963    uint8_t  intraFreqHop;
964    uint16_t secondPrbHop;
965    uint8_t  pucchFormat;
966    union
967    {
968       PucchFormat0   *format0; 
969       PucchFormat1   *format1;
970       PucchFormat2_3 *format2;
971       PucchFormat2_3 *format3;
972       PucchFormat4   *format4;
973    }PucchFormat;
974 }PucchResrcInfo;
975
976 typedef struct pucchResrcCfg
977 {
978    uint8_t resrcToAddModListCount;
979    PucchResrcInfo resrcToAddModList[MAX_NUM_PUCCH_RESRC];
980    uint8_t resrcToRelListCount;
981    uint8_t resrcToRelList[MAX_NUM_PUCCH_RESRC];
982 }PucchResrcCfg;
983
984 typedef struct pucchFormatCfg
985 {
986    uint8_t interSlotFreqHop;
987    uint8_t addDmrs;
988    uint8_t maxCodeRate;
989    uint8_t numSlots;
990    bool    pi2BPSK;
991    bool    harqAckCSI;
992 }PucchFormatCfg;
993
994 typedef struct schedReqResrcInfo
995 {
996    uint8_t resrcId;
997    uint8_t requestId;
998    uint8_t periodicity;
999    uint16_t offset;
1000    uint8_t resrc;
1001 }SchedReqResrcInfo;
1002
1003 typedef struct pucchSchedReqCfg
1004 {
1005    uint8_t           schedAddModListCount;
1006    SchedReqResrcInfo schedAddModList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1007    uint8_t           schedRelListCount;
1008    uint8_t           schedRelList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1009 }PucchSchedReqCfg;
1010
1011 typedef struct spatialRelationInfo
1012 {
1013    uint8_t spatialRelationId;
1014    uint8_t servCellIdx;
1015    uint8_t pathLossRefRSId;
1016    uint8_t p0PucchId;
1017    uint8_t closeLoopIdx;
1018 }SpatialRelationInfo;
1019
1020 typedef struct pucchSpatialCfg
1021 {
1022    uint8_t spatialAddModListCount;
1023    SpatialRelationInfo spatialAddModList[MAX_NUM_SPATIAL_RELATIONS];
1024    uint8_t spatialRelListCount;
1025    uint8_t spatialRelList[MAX_NUM_SPATIAL_RELATIONS];
1026 }PucchSpatialCfg;
1027
1028 typedef struct p0PucchCfg
1029 {
1030    uint8_t p0PucchId;
1031    int     p0PucchVal;
1032 }P0PucchCfg;
1033
1034 typedef struct pathLossRefRSCfg
1035 {
1036    uint8_t pathLossRefRSId;
1037 }PathLossRefRSCfg;
1038
1039 typedef struct pucchMultiCsiCfg
1040 {
1041    uint8_t  multiCsiResrcListCount;
1042    uint8_t  multiCsiResrcList[MAX_NUM_PUCCH_RESRC-1];
1043 }PucchMultiCsiCfg;
1044
1045 typedef struct pucchDlDataToUlAck
1046 {
1047    uint8_t  dlDataToUlAckListCount;
1048    uint8_t  dlDataToUlAckList[MAX_NUM_DL_DATA_TO_UL_ACK];
1049 }PucchDlDataToUlAck;
1050
1051 typedef struct pucchPowerControl
1052 {
1053    int deltaF_Format0;
1054    int deltaF_Format1;
1055    int deltaF_Format2;
1056    int deltaF_Format3;
1057    int deltaF_Format4;
1058    uint8_t p0SetCount;
1059    P0PucchCfg p0Set[MAX_NUM_PUCCH_P0_PER_SET];
1060    uint8_t pathLossRefRSListCount;
1061    PathLossRefRSCfg pathLossRefRSList[MAX_NUM_PATH_LOSS_REF_RS];
1062 }PucchPowerControl;
1063
1064 typedef struct pucchCfg
1065 {
1066    PucchResrcSetCfg  *resrcSet;
1067    PucchResrcCfg     *resrc;
1068    PucchFormatCfg    *format1; 
1069    PucchFormatCfg    *format2; 
1070    PucchFormatCfg    *format3; 
1071    PucchFormatCfg    *format4;
1072    PucchSchedReqCfg  *schedReq;
1073    PucchMultiCsiCfg  *multiCsiCfg;
1074    PucchSpatialCfg   *spatialInfo;
1075    PucchDlDataToUlAck *dlDataToUlAck;
1076    PucchPowerControl *powerControl;
1077 }PucchCfg;
1078
1079 /* Transform precoding disabled */
1080 typedef struct transPrecodDisabled
1081 {
1082    uint16_t   scramblingId0;
1083 }TransPrecodDisabled;
1084
1085 /* DMRS Uplink configuration */
1086 typedef struct dmrsUlCfg
1087 {
1088    AddPosType            addPos;               /* DMRS additional position */
1089    TransPrecodDisabled   transPrecodDisabled;  /* Transform precoding disabled */
1090 }DmrsUlCfg;
1091
1092 /* PUSCH Configuration */
1093 typedef struct puschCfg
1094 {
1095    uint8_t                 dataScramblingId;
1096    DmrsUlCfg               dmrsUlCfgForPuschMapTypeA;
1097    ResAllocType            resourceAllocType;
1098    uint8_t                 numTimeDomRsrcAlloc;
1099    PuschTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1100    TransformPrecoder       transformPrecoder;
1101 }PuschCfg;
1102
1103 /* Initial Uplink BWP */
1104 typedef struct initialUlBwp
1105 {
1106    bool       pucchPresent;
1107    PucchCfg   pucchCfg; 
1108    bool       puschPresent;
1109    PuschCfg   puschCfg;
1110 }InitialUlBwp;
1111
1112 /* Uplink BWP information */
1113 typedef struct ulBwpInfo
1114 {
1115    uint8_t        bwpId;
1116 }UlBwpInfo;
1117
1118 /* Serving cell configuration */
1119 typedef struct servCellCfgInfo
1120 {
1121    InitialDlBwp       initDlBwp;
1122    uint8_t            numDlBwpToAdd;
1123    DlBwpInfo          DlBwpToAddList[MAX_NUM_BWP];
1124    uint8_t            firstActvDlBwpId;
1125    uint8_t            defaultDlBwpId;
1126    uint8_t            *bwpInactivityTmr;
1127    PdschServCellCfg   pdschServCellCfg;
1128    InitialUlBwp       initUlBwp;
1129    uint8_t            numUlBwpToAdd;
1130    UlBwpInfo          UlBwpToAddList[MAX_NUM_BWP];
1131    uint8_t            firstActvUlBwpId;
1132 }ServCellCfgInfo;
1133
1134 /* Special cell configuration */
1135 typedef struct spCellCfg
1136 {
1137    uint8_t           servCellIdx;
1138    ServCellCfgInfo   servCellCfg;
1139 }SpCellCfg;
1140
1141 typedef struct ambrCfg
1142 {
1143    uint32_t ulBr;   /* UL Bit rate */
1144 }AmbrCfg;
1145
1146 typedef struct nonDynFiveQi
1147 {
1148    uint16_t   fiveQi;
1149    uint8_t    priorLevel;
1150    uint16_t   avgWindow;
1151    uint16_t   maxDataBurstVol;
1152 }NonDynFiveQi;
1153
1154 typedef struct dynFiveQi
1155 {
1156    uint8_t    priorLevel;
1157    uint16_t   packetDelayBudget;
1158    uint8_t    packetErrRateScalar;
1159    uint8_t    packetErrRateExp;
1160    uint16_t   fiveQi;
1161    uint8_t    delayCritical;
1162    uint16_t   avgWindow;
1163    uint16_t   maxDataBurstVol;
1164 }DynFiveQi;
1165
1166 typedef struct ngRanAllocAndRetPri
1167 {
1168    uint8_t priorityLevel;
1169    uint8_t preEmptionCap;
1170    uint8_t preEmptionVul;
1171 }NgRanAllocAndRetPri;
1172
1173 typedef struct grbQosInfo
1174 {
1175    uint32_t maxFlowBitRateDl;
1176    uint32_t maxFlowBitRateUl;
1177    uint32_t guarFlowBitRateDl;
1178    uint32_t guarFlowBitRateUl;
1179 }GrbQosInfo;
1180
1181 typedef struct drbQos
1182 {
1183    QosType  fiveQiType;   /* Dynamic or non-dynamic */ 
1184    union
1185    {
1186       NonDynFiveQi   nonDyn5Qi;
1187       DynFiveQi      dyn5Qi;
1188    }u;
1189    NgRanAllocAndRetPri ngRanRetPri;
1190    GrbQosInfo grbQosInfo;
1191    uint16_t             pduSessionId;
1192    uint32_t             ulPduSessAggMaxBitRate;
1193 }DrbQosInfo;
1194
1195 typedef struct ulLcCfg
1196 {
1197    uint8_t priority;
1198    uint8_t lcGroup;
1199    uint8_t schReqId;
1200    PBitRate pbr;        // prioritisedBitRate
1201    BucketSizeDur bsd;        // bucketSizeDuration
1202 }UlLcCfg;
1203
1204 typedef struct duLcCfg
1205 {
1206    LcPriority lcp;      // logical Channel Prioritization
1207 }DlLcCfg;
1208
1209 typedef struct lcCfg
1210 {
1211    ConfigType configType;
1212    uint8_t lcId;
1213    DrbQosInfo *drbQos; 
1214    Snssai  *snssai;
1215    bool ulLcCfgPres;
1216    UlLcCfg ulLcCfg;
1217    DlLcCfg dlLcCfg;
1218 }LcCfg;
1219
1220 typedef struct modulationInfo
1221 {
1222    uint8_t     modOrder;    /* Modulation order */
1223    uint8_t     mcsIndex;    /* MCS Index */
1224    McsTable    mcsTable;    /* MCS table */
1225 }ModulationInfo;
1226
1227 typedef struct macUeCfg
1228 {
1229    uint16_t cellId;
1230    uint8_t  ueId;
1231    uint16_t crnti;
1232    bool macCellGrpCfgPres;
1233    MacCellGrpCfg macCellGrpCfg;
1234    bool phyCellGrpCfgPres;
1235    PhyCellGrpCfg phyCellGrpCfg;
1236    bool spCellCfgPres;
1237    SpCellCfg spCellCfg;
1238    AmbrCfg   *ambrCfg;
1239    ModulationInfo dlModInfo;    /* DL modulation info */
1240    ModulationInfo ulModInfo;    /* UL modulation info */
1241    uint8_t numLcs;
1242    LcCfg lcCfgList[MAX_NUM_LC];
1243    UeCfgState macUeCfgState;    /* InActive / Completed */
1244 }MacUeCfg;
1245
1246 typedef struct nrcgi
1247 {
1248    Plmn      plmn;
1249    uint16_t  cellId;
1250 }Nrcgi;
1251
1252 typedef struct srbFailInfo
1253 {
1254    uint8_t       srbId;
1255    FailureCause  cause;
1256 }SRBFailInfo;
1257
1258 typedef struct drbFailInfo
1259 {
1260    uint8_t       drbId;
1261    FailureCause  cause;
1262 }DRBFailInfo;
1263
1264 typedef struct sCellFailInfo
1265 {
1266    Nrcgi         nrcgi;
1267    FailureCause  cause;
1268 }SCellFailInfo;
1269
1270 typedef struct ueCfgRsp
1271 {
1272    uint16_t       cellId;
1273    uint16_t       ueId;
1274    MacRsp         result;
1275    uint8_t        numSRBFailed;   /* valid values : 0 to MAX_NUM_SRB */ 
1276    SRBFailInfo    *failedSRBlisti;
1277    uint8_t        numDRBFailed;   /* valid values : 0 to MAX_NUM_DRB */
1278    DRBFailInfo    *failedDRBlist;
1279    uint8_t        numSCellFailed; /* valid values : 0 to MAX_NUM_SCELL */
1280    SCellFailInfo  *failedSCellList;
1281 }MacUeCfgRsp;
1282
1283 typedef struct ueDelete
1284 {
1285     uint16_t cellId;
1286     uint8_t  ueId;
1287     uint16_t crnti;
1288 }MacUeDelete;
1289
1290 typedef struct ueDeleteRsp
1291 {
1292    uint16_t cellId;
1293    uint8_t  ueId;
1294    UeDeleteStatus result;
1295 }MacUeDeleteRsp;
1296
1297 typedef struct macCellDelete
1298 {
1299    uint16_t cellId;
1300 }MacCellDelete;
1301
1302 typedef struct macCellDeleteRsp
1303 {
1304    uint16_t cellId;
1305    CellDeleteStatus result;
1306 }MacCellDeleteRsp;
1307
1308 typedef struct macSliceRsp
1309 {
1310    Snssai     snssai;
1311    MacRsp     rsp;
1312    RspReason  cause;  
1313 }MacSliceRsp;
1314
1315 typedef struct rrmPolicyRatio
1316 {
1317    uint8_t policyMaxRatio;
1318    uint8_t policyMinRatio;
1319    uint8_t policyDedicatedRatio;
1320 }RrmPolicyRatio;
1321
1322 typedef struct macSliceRrmPolicy
1323 {
1324    Snssai  snssai;
1325    RrmPolicyRatio *rrmPolicyRatio;
1326 }MacSliceRrmPolicy;
1327
1328 typedef struct macSliceCfgReq
1329 {
1330    uint8_t  numOfConfiguredSlice;
1331    MacSliceRrmPolicy **listOfSliceCfg;
1332 }MacSliceCfgReq;
1333
1334 typedef struct macSliceCfgRsp
1335 {
1336    uint8_t  numSliceCfgRsp;
1337    MacSliceRsp  **listOfSliceCfgRsp;
1338 }MacSliceCfgRsp;
1339
1340 /* Functions for slot Ind from MAC to DU APP*/
1341 typedef uint8_t (*DuMacCellUpInd) ARGS((
1342          Pst       *pst,
1343          OduCellId *cellId ));
1344
1345 /* Functions for stop Ind from MAC to DU APP*/
1346 typedef uint8_t (*DuMacStopInd) ARGS((
1347          Pst        *pst,
1348          OduCellId  *cellId ));
1349
1350 /* Functions for mac cell start req */
1351 typedef uint8_t (*DuMacCellStart) ARGS((
1352          Pst        *pst, 
1353          OduCellId  *cellId));
1354
1355 /* Functions for mac cell stop request */
1356 typedef uint8_t (*DuMacCellStop) ARGS((
1357          Pst        *pst,
1358          OduCellId  *cellId ));
1359
1360 /* Function pointers for packing macCellCfg Request and Confirm */
1361 typedef uint8_t (*packMacCellCfgReq) ARGS((
1362          Pst           *pst,
1363          MacCellCfg    *macCellCfg ));
1364
1365 typedef uint8_t (*packMacCellCfgConfirm) ARGS((
1366          Pst              *pst,
1367          MacCellCfgCfm    *macCellCfgCfm ));
1368
1369 typedef uint8_t (*DuMacCellCfgReq) ARGS((
1370          Pst        *pst,        
1371          MacCellCfg *macCellCfg));
1372
1373 typedef uint8_t (*DuMacCellCfgCfm) ARGS((
1374          Pst        *pst,        
1375          MacCellCfgCfm *macCellCfgCfm ));
1376
1377 /* Functions for UL CCCH Ind from MAC to DU APP*/
1378 typedef uint8_t (*DuMacUlCcchInd) ARGS((
1379          Pst           *pst,
1380          UlCcchIndInfo *ulCcchIndInfo ));
1381
1382 /* Functions for DL CCCH Ind from DU APP to MAC*/
1383 typedef uint8_t (*DuMacDlCcchInd) ARGS((
1384          Pst           *pst,
1385          DlCcchIndInfo *dlCcchIndInfo ));
1386
1387 /* UE create Request from DU APP to MAC*/
1388 typedef uint8_t (*DuMacUeCreateReq) ARGS((
1389          Pst           *pst,
1390          MacUeCfg      *ueCfg ));
1391
1392 /* UE create Response from MAC to DU APP */
1393 typedef uint8_t (*MacDuUeCfgRspFunc) ARGS((
1394          Pst           *pst, 
1395          MacUeCfgRsp   *cfgRsp));
1396
1397 /* UE Reconfig Request from DU APP to MAC*/
1398 typedef uint8_t (*DuMacUeReconfigReq) ARGS((
1399          Pst           *pst,
1400          MacUeCfg      *ueCfg ));
1401
1402 /* UE Delete Request from DU APP to MAC*/
1403 typedef uint8_t (*DuMacUeDeleteReq) ARGS((
1404      Pst           *pst,
1405      MacUeDelete   *ueDel ));
1406
1407 /* UE Delete Response from MAC to DU APP*/
1408 typedef uint8_t (*MacDuUeDeleteRspFunc) ARGS((
1409      Pst            *pst,
1410      MacUeDeleteRsp *deleteRsp));
1411
1412 /* Cell Delete Request from DU APP to MAC*/
1413 typedef uint8_t (*DuMacCellDeleteReq) ARGS((
1414      Pst           *pst,
1415      MacCellDelete *cellDelete ));
1416
1417 /* Cell Delete Response from MAC to DU APP*/
1418 typedef uint8_t (*MacDuCellDeleteRspFunc) ARGS((
1419      Pst            *pst,
1420      MacCellDeleteRsp *cellDeleteRsp));
1421
1422 /* Slice Cfg Request from DU APP to MAC*/
1423 typedef uint8_t (*DuMacSliceCfgReq) ARGS((
1424      Pst           *pst,
1425      MacSliceCfgReq *CfgReq));
1426
1427 /* Slice Cfg Response from MAC to DU APP */
1428 typedef uint8_t (*MacDuSliceCfgRspFunc) ARGS((
1429          Pst           *pst, 
1430          MacSliceCfgRsp   *cfgRsp));
1431
1432 /* Slice ReReCfg Request from DU APP to MAC*/
1433 typedef uint8_t (*DuMacSliceRecfgReq) ARGS((
1434      Pst           *pst,
1435      MacSliceCfgReq *CfgReq));
1436
1437 /* Slice ReReCfg Response from MAC to DU APP */
1438 typedef uint8_t (*MacDuSliceReCfgRspFunc) ARGS((
1439         Pst           *pst,
1440         MacSliceCfgRsp   *cfgRsp));
1441
1442
1443 uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId);
1444 uint8_t unpackMacCellUpInd(DuMacCellUpInd func, Pst *pst, Buffer *mBuf);
1445 uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId);
1446 uint8_t packMacCellStart(Pst *pst, OduCellId *cellId);
1447 uint8_t unpackMacCellStart(DuMacCellStart func, Pst *pst, Buffer *mBuf);
1448 uint8_t MacProcCellStart(Pst *pst, OduCellId *cellId);
1449 uint8_t packMacCellStop(Pst *pst, OduCellId *cellId);
1450 uint8_t unpackMacCellStop(DuMacCellStop func, Pst *pst, Buffer *mBuf);
1451 uint8_t MacProcCellStop(Pst *pst, OduCellId *cellId);
1452 uint8_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
1453 uint8_t unpackDuMacCellCfg(DuMacCellCfgReq func,  Pst *pst,  Buffer *mBuf);
1454 uint8_t MacProcCellCfgReq(Pst *pst, MacCellCfg *macCellCfg);
1455 uint8_t packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
1456 uint8_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf);
1457 uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
1458 uint8_t packMacStopInd(Pst *pst, OduCellId *cellId);
1459 uint8_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf);
1460 uint8_t duHandleStopInd(Pst *pst, OduCellId *cellId);
1461 uint8_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
1462 uint8_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf);
1463 uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
1464 uint8_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
1465 uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf);
1466 uint8_t MacProcDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
1467 uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCfg *ueCfg);
1468 uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf);
1469 uint8_t MacProcUeCreateReq(Pst *pst, MacUeCfg *ueCfg);
1470 uint8_t sendStopIndMacToDuApp(uint16_t cellId);
1471 uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp);
1472 uint8_t unpackDuMacUeCfgRsp(MacDuUeCfgRspFunc func, Pst *pst, Buffer *mBuf);
1473 uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp);
1474 uint8_t packDuMacUeReconfigReq(Pst *pst, MacUeCfg *ueCfg);
1475 uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf);
1476 uint8_t MacProcUeReconfigReq(Pst *pst, MacUeCfg *ueCfg);
1477 uint8_t packDuMacUeDeleteReq(Pst *pst, MacUeDelete *ueDelete);
1478 uint8_t MacProcUeDeleteReq(Pst *pst,  MacUeDelete *ueDelete);
1479 uint8_t unpackMacUeDeleteReq(DuMacUeDeleteReq func, Pst *pst, Buffer *mBuf);
1480 uint8_t packDuMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp);
1481 uint8_t DuProcMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp);
1482 uint8_t unpackDuMacUeDeleteRsp(MacDuUeDeleteRspFunc func, Pst *pst, Buffer *mBuf);
1483 uint8_t packDuMacCellDeleteReq(Pst *pst, MacCellDelete *cellDelete);
1484 uint8_t MacProcCellDeleteReq(Pst *pst, MacCellDelete *cellDelete);
1485 uint8_t unpackMacCellDeleteReq(DuMacCellDeleteReq func, Pst *pst, Buffer *mBuf);
1486 uint8_t packDuMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp);
1487 uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp);
1488 uint8_t unpackDuMacCellDeleteRsp(MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf);
1489 uint8_t packDuMacSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq);
1490 uint8_t MacProcSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq);
1491 uint8_t unpackMacSliceCfgReq(DuMacSliceCfgReq func, Pst *pst, Buffer *mBuf);
1492 uint8_t DuProcMacSliceCfgRsp(Pst *pst,  MacSliceCfgRsp *cfgRsp);
1493 uint8_t packDuMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp);
1494 uint8_t unpackDuMacSliceCfgRsp(MacDuSliceCfgRspFunc func, Pst *pst, Buffer *mBuf);
1495 uint8_t packDuMacSliceRecfgReq(Pst *pst, MacSliceCfgReq *sliceReCfgReq);
1496 uint8_t MacProcSliceReCfgReq(Pst *pst, MacSliceCfgReq *sliceReCfgReq);
1497 uint8_t unpackMacSliceReCfgReq(DuMacSliceRecfgReq func, Pst *pst, Buffer *mBuf);
1498 uint8_t DuProcMacSliceReCfgRsp(Pst *pst,  MacSliceCfgRsp *cfgRsp);
1499 uint8_t packDuMacSliceReCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp);
1500 uint8_t unpackDuMacSliceReCfgRsp(MacDuSliceReCfgRspFunc func, Pst *pst, Buffer *mBuf);
1501
1502 #endif
1503
1504
1505 /**********************************************************************
1506   End of file
1507  **********************************************************************/