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