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