[Epic-ID: ODUHIGH-518] Alignment to latest ORAN WG8 Spec: O-RAN.WG8.AAD.0-R003-v09.00
[o-du/l2.git] / src / cm / du_app_mac_inf.h
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17  *******************************************************************************/
18
19 /* Defines APIs exchanged between du_app and cl module of MAC */
20 #ifndef __MACINT_H__
21 #define __MACINT_H__
22
23 #define NUM_NUMEROLOGY 5  /* Number of numerology */
24 #define MAX_SI_MESSAGE 32 /* As per 138 331 V15.3, RRC Multiplicity and type constraint definitions maxSI-Message = 32 */ 
25 #define NUM_SIB 32         /* As per 138 331 V15.3, RRC Multiplicity and type constraint definitions  maxSIB = 32 */ 
26 #define NUM_SSB         1       /* max value is 64 */
27 #define SSB_MASK_SIZE   1       /* SSB mask size is 32bit for sub6 */
28 #define SIB1_REPETITION_PERIOD   20
29 #define CORESET_0_INDEX      0
30 #define CORESET_1_INDEX      1
31 #define CORESET_2_INDEX      2
32 #define CORESET_3_INDEX      3
33 #define CORESET_4_INDEX      4
34 #define SEARCHSPACE_0_INDEX   0
35 #define SEARCHSPACE_1_INDEX   1
36 #define SEARCHSPACE_2_INDEX   2
37 #define SEARCHSPACE_3_INDEX   3
38 #define SEARCHSPACE_4_INDEX   4
39 #define SS_MONITORING_SLOT_SL1   0 /* all slots */
40 #define SS_MONITORING_SYMBOL     0x2000; /* symbol-0, set 14th bit */
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 #define EVENT_MAC_SLICE_CFG_REQ      216
80 #define EVENT_MAC_SLICE_CFG_RSP      217
81 #define EVENT_MAC_SLICE_RECFG_REQ    218
82 #define EVENT_MAC_SLICE_RECFG_RSP    219
83 #define EVENT_MAC_SLOT_IND           220
84 #define EVENT_MAC_RACH_RESOURCE_REQ  221
85 #define EVENT_MAC_RACH_RESOURCE_RSP  222
86 #define EVENT_MAC_RACH_RESOURCE_REL  223
87 #define EVENT_MAC_DL_PCCH_IND        224
88 #define EVENT_MAC_UE_RESET_REQ       225
89 #define EVENT_MAC_UE_RESET_RSP       226
90 #define EVENT_MAC_UE_SYNC_STATUS_IND 227
91 #define EVENT_MAC_DL_BROADCAST_REQ   228
92
93 #define BSR_PERIODIC_TIMER_SF_10 10
94 #define BSR_RETX_TIMER_SF_320 320
95 #define BSR_SR_DELAY_TMR_2560 2560
96
97 #define PAGING_SCHED_DELTA  4
98 #define MAX_PLMN 2
99
100 typedef enum
101 {
102    SIB_TYPE2,
103    SIB_TYPE3,
104    SIB_TYPE4,
105    SIB_TYPE5,
106    SIB_TYPE6,
107    SIB_TYPE7,
108    SIB_TYPE8,
109    SIB_TYPE9,
110    SPARE
111 }SibType;
112
113 typedef enum
114 {
115    SSB_PER_RACH_OCCASION_ONE_EIGHTH,
116    SSB_PER_RACH_OCCASION_ONE_FOURTH,
117    SSB_PER_RACH_OCCASION_ONE_HALF,
118    SSB_PER_RACH_OCCASION_ONE,
119    SSB_PER_RACH_OCCASION_TWO,
120    SSB_PER_RACH_OCCASION_FOUR,
121    SSB_PER_RACH_OCCASION_EIGHT,
122    SSB_PER_RACH_OCCASION_SIXTEEN
123 }SsbPerRachOccasion;
124
125 typedef enum
126 {
127    BROADCASTING,
128    NOTBROADCASTING,
129 }SiBroadcastStatus;
130
131 typedef enum
132 {
133    RF8,
134    RF16,
135    RF32,
136    RF64,
137    RF128,
138    RF256,
139    RF512
140 }SiPeriodicity;
141
142 typedef enum
143 {
144    S5,
145    S10,
146    S20, 
147    S40, 
148    S80, 
149    S160, 
150    S320, 
151    S640, 
152    S1280
153 }SiWindowLength;
154
155 typedef enum
156 {
157    SI_REQ_PERIOD_1,
158    SI_REQ_PERIOD_2,
159    SI_REQ_PERIOD_4,
160    SI_REQ_PERIOD_6,
161    SI_REQ_PERIOD_8,
162    SI_REQ_PERIOD_10,
163    SI_REQ_PERIOD_12,
164    SI_REQ_PERIOD_16
165 }SiRequestPeriod;
166
167 typedef enum
168 {
169    MAC_DU_APP_RSP_NOK,
170    MAC_DU_APP_RSP_OK
171 }MacRsp;
172
173 typedef enum
174 {
175    IN_SYNC,
176    OUT_OF_SYNC,
177    OUT_OF_SUNC_MAX_RETRIES
178 }SyncStatus;
179
180 typedef enum
181 {
182    DUP_MODE_FDD,
183    DUP_MODE_TDD
184 }DuplexMode;
185
186 typedef enum
187 {
188    MAC_GEN_FULL_PBCH_PAYLD,   /* MAC generated the full PBCH Payload */
189    PHY_GEN_TIMING_PBCH_BIT,   /* PHY generates the timing PBCH bits */
190    PHY_GEN_FULL_PBCH_PAYLD    /* PHY generates full PBCH payload */
191 }BchPduOpt;
192
193 typedef enum
194 {
195    LONG_SEQUENCE,
196    SHORT_SEQUENCE
197 }PrachSeqLen;
198
199 typedef enum
200 {
201    UNRESTRICTED,
202    RESTRICTED_SET_TYPE_A,
203    RESTRICTED_SET_TYPE_B
204 }RstSetCfg;
205
206 typedef enum
207 {
208    DONT_REPORT_RSSI,
209    RSSI_UNIT_DBM,
210    RSSI_UNIT_DBFS
211 }RSSIMeasUnit;
212
213 typedef enum
214 {
215    BETA_PSS_0DB,
216    BETA_PSS_3DB
217 }BetaPss;
218
219 typedef enum 
220 {
221    SSB_PRDCTY_MS_5,
222    SSB_PRDCTY_MS_10,
223    SSB_PRDCTY_MS_20,
224    SSB_PRDCTY_MS_40,
225    SSB_PRDCTY_MS_80,
226    SSB_PRDCTY_MS_160
227 }SSBPeriod;
228
229 typedef enum
230 {
231    RRC_REJECT,
232    RRC_SETUP
233 }DlCcchMsgType;
234
235 /* Enums for Ue Create Request */
236
237 /* SR PROHIBIT TIMER */
238 typedef enum
239 {
240    SR_PROHIBIT_MS_1,
241    SR_PROHIBIT_MS_2,
242    SR_PROHIBIT_MS_4,
243    SR_PROHIBIT_MS_8,
244    SR_PROHIBIT_MS_16,
245    SR_PROHIBIT_MS_32,
246    SR_PROHIBIT_MS_64,
247    SR_PROHIBIT_MS_128
248 }SrProhibitTimer;
249
250 typedef enum
251 {
252    SR_TRANS_MAX_N_4,
253    SR_TRANS_MAX_N_8,
254    SR_TRANS_MAX_N_16,
255    SR_TRANS_MAX_N_32,
256    SR_TRANS_MAX_N_64,
257    SR_TRANS_MAX_spare3,
258    SR_TRANS_MAX_spare2,
259    SR_TRANS_MAX_spare1
260 }SrTransMax;
261
262 typedef enum
263 {
264    TIME_ALIGNMENT_TIMER_MS_500,
265    TIME_ALIGNMENT_TIMER_MS_750,
266    TIME_ALIGNMENT_TIMER_MS_1280,
267    TIME_ALIGNMENT_TIMER_MS_1920,
268    TIME_ALIGNMENT_TIMER_MS_2560,
269    TIME_ALIGNMENT_TIMER_MS_5120,
270    TIME_ALIGNMENT_TIMER_MS_10240,
271    TIME_ALIGNMENT_TIMER_INFINITY
272 }TimeAlignmentTimer;
273
274 typedef enum
275 {
276    PHR_PERIODIC_TIMER_SF_10,
277    PHR_PERIODIC_TIMER_SF_20,
278    PHR_PERIODIC_TIMER_SF_50,
279    PHR_PERIODIC_TIMER_SF_100,
280    PHR_PERIODIC_TIMER_SF_200,
281    PHR_PERIODIC_TIMER_SF_500,
282    PHR_PERIODIC_TIMER_SF_1000,
283    PHR_PERIODIC_TIMER_INFINITY
284 }PhrPeriodicTimer;
285
286 typedef enum
287 {
288    PHR_PROHIBIT_TIMER_SF_0,
289    PHR_PROHIBIT_TIMER_SF_10,
290    PHR_PROHIBIT_TIMER_SF_20,
291    PHR_PROHIBIT_TIMER_SF_50,
292    PHR_PROHIBIT_TIMER_SF_100,
293    PHR_PROHIBIT_TIMER_SF_200,
294    PHR_PROHIBIT_TIMER_SF_500,
295    PHR_PROHIBIT_TIMER_SF_1000
296 }PhrProhibitTimer;
297
298 typedef enum
299 {
300    PHR_TX_PWR_FACTOR_CHANGE_DB_1,
301    PHR_TX_PWR_FACTOR_CHANGE_DB_3,
302    PHR_TX_PWR_FACTOR_CHANGE_DB_6,
303    PHR_TX_PWR_FACTOR_CHANGE_INFINITY
304 }PhrTxPwrFactorChange;
305
306 typedef enum
307 {
308    PHR_MODE_OTHER_CG_REAL,
309    PHR_MODE_OTHER_CG_VIRTUAL
310 }PhrModeOtherCG;
311
312 typedef enum
313 {
314    PDSCH_HARQ_ACK_CODEBOOK_SEMISTATIC,
315    PDSCH_HARQ_ACK_CODEBOOK_DYNAMIC
316 }PdschHarqAckCodebook;
317
318 typedef enum
319 {
320    NUM_HARQ_PROC_FOR_PDSCH_N_2,
321    NUM_HARQ_PROC_FOR_PDSCH_N_4,
322    NUM_HARQ_PROC_FOR_PDSCH_N_6,
323    NUM_HARQ_PROC_FOR_PDSCH_N_10,
324    NUM_HARQ_PROC_FOR_PDSCH_N_16
325 }NumHarqProcForPdsch;
326
327 typedef enum
328 {
329    MAX_CODE_BLOCK_GROUP_PER_TB_N_2,
330    MAX_CODE_BLOCK_GROUP_PER_TB_N_4,
331    MAX_CODE_BLOCK_GROUP_PER_TB_N_6,
332    MAX_CODE_BLOCK_GROUP_PER_TB_N_8
333 }MaxCodeBlkGrpPerTB;
334
335 typedef enum
336 {
337    PDSCH_X_OVERHEAD_6,
338    PDSCH_X_OVERHEAD_12,
339    PDSCH_X_OVERHEAD_18
340 }PdschXOverhead;
341
342 typedef enum
343 {
344    TRANSFORM_PRECODER_ENABLED,
345    TRANSFORM_PRECODER_DISABLED
346 }TransformPrecoder;
347
348 typedef enum 
349 {
350    CCE_REG_MAPPINGTYPE_PR_INTERLEAVED = 1,
351    CCE_REG_MAPPINGTYPE_PR_NONINTERLEAVED
352 }REGMappingType;
353
354 typedef enum
355 {
356    SLOTPERIODICITYANDOFFSET_PR_SL1 = 1,
357    SLOTPERIODICITYANDOFFSET_PR_SL2,
358    SLOTPERIODICITYANDOFFSET_PR_SL4,
359    SLOTPERIODICITYANDOFFSET_PR_SL5,
360    SLOTPERIODICITYANDOFFSET_PR_SL8,
361    SLOTPERIODICITYANDOFFSET_PR_SL10,
362    SLOTPERIODICITYANDOFFSET_PR_SL16,
363    SLOTPERIODICITYANDOFFSET_PR_SL20,
364    SLOTPERIODICITYANDOFFSET_PR_SL40,
365    SLOTPERIODICITYANDOFFSET_PR_SL80,
366    SLOTPERIODICITYANDOFFSET_PR_SL160,
367    SLOTPERIODICITYANDOFFSET_PR_SL320,
368    SLOTPERIODICITYANDOFFSET_PR_SL640,
369    SLOTPERIODICITYANDOFFSET_PR_SL1280,
370    SLOTPERIODICITYANDOFFSET_PR_SL2560
371 }MSlotPeriodAndOffset;
372
373 typedef enum
374 {
375    SAMEASREG_BUNDLE,
376    ALL_CONTIGUOUS_RBS
377 }PrecoderGranul;
378
379 typedef enum
380 {
381    SEARCHSPACETYPE_PR_COMMON = 1,
382    SEARCHSPACETYPE_PR_UE_SPECIFIC
383 }SearchSpaceType;
384
385 typedef enum
386 {
387    QOS_NON_DYNAMIC = 1,
388    QOS_DYNAMIC
389 }QosType;
390
391 typedef enum
392 {
393    AGGREGATIONLEVEL_N0  = 0,  
394    AGGREGATIONLEVEL_N1  = 1,
395    AGGREGATIONLEVEL_N2  = 2,
396    AGGREGATIONLEVEL_N3  = 3,
397    AGGREGATIONLEVEL_N4  = 4,
398    AGGREGATIONLEVEL_N5  = 5,
399    AGGREGATIONLEVEL_N6  = 6,
400    AGGREGATIONLEVEL_N8  = 7
401 }AggrLevel;
402
403 typedef enum
404 {
405    ADDITIONALPOSITION_POS0,
406    ADDITIONALPOSITION_POS1,
407    ADDITIONALPOSITION_POS3
408 }AddPosType;
409
410 typedef enum
411 {
412    MAPPING_TYPEA,
413    MAPPING_TYPEB
414 }CommonMappingType;
415
416 typedef enum
417 {
418    RESOURCEALLOCATION_TYPE0,
419    RESOURCEALLOCATION_TYPE1,
420    RESOURCEALLOCATION_DYNAMICSWITCH
421 }ResAllocType;
422
423 typedef enum
424 {
425    RBG_SIZE_CONFIG1,
426    RBG_SIZE_CONFIG2
427 }RBGSize;
428
429 typedef enum
430 {
431    CODEWORDS_SCHED_BY_DCI_N1,
432    CODEWORDS_SCHED_BY_DCI_N2
433 }CodeWordsSchedDci;
434
435 typedef enum
436 {
437    TYPE_STATIC_BUNDLING = 1,
438    TYPE_DYNAMIC_BUNDLING
439 }BundlingType;
440
441 typedef enum
442 {
443    SET2_SIZE_N4,
444    SET2_SIZE_WIDEBAND
445 }BundlingSizeSet2;
446
447 typedef enum
448 {
449    SET1_SIZE_N4,
450    SET1_SIZE_WIDEBAND,
451    SET1_SIZE_N2_WIDEBAND,
452    SET1_SIZE_N4_WIDEBAND
453 }BundlingSizeSet1;
454
455 typedef enum
456 {
457    LC_PRIORITY_1 = 1,
458    LC_PRIORITY_2,
459    LC_PRIORITY_3
460 }LcPriority;
461
462 typedef enum
463 {
464   PBR_KBPS_0,
465   PBR_KBPS_8,
466   PBR_KBPS_16,
467   PBR_KBPS_32,
468   PBR_KBPS_64,
469   PBR_KBPS_128,
470   PBR_KBPS_256,
471   PBR_KBPS_512,
472   PBR_KBPS_1024,
473   PBR_KBPS_2048,
474   PBR_KBPS_4096,
475   PBR_KBPS_8192,
476   PBR_KBPS_16384,
477   PBR_KBPS_32768,
478   PBR_KBPS_65536,
479   PBR_KBPS_INFINITY
480 }PBitRate;
481
482 typedef enum
483 {
484    BSD_MS_5,
485    BSD_MS_10,
486    BSD_MS_20,
487    BSD_MS_50,
488    BSD_MS_100,
489    BSD_MS_150,
490    BSD_MS_300,
491    BSD_MS_500,
492    BSD_MS_1000,
493    BSD_SPARE_7,
494    BSD_SPARE_6,
495    BSD_SPARE_5,
496    BSD_SPARE_4,
497    BSD_SPARE_3,
498    BSD_SPARE_2,
499    BSD_SPARE_1
500
501 }BucketSizeDur;
502
503 typedef enum
504 {
505    RADIO_NW_LAYER_FAIL,
506    TRANSPORT_LAYER_FAIL,
507    PROTOCOL_FAIL,
508    MISCELLANEOUS
509 }CauseGrp;
510
511 typedef enum
512 {
513    UNSPECIFIED_RADIO_NW_CAUSE,
514    RL_FAIL_RLC,
515    UNKNOWN_GNB_CU_UE_F1AP_ID,
516    ALREADY_ALLOCATED_GNB_CU_UE_F1AP_ID,
517    UNKNOWN_GNB_DU_UE_F1AP_ID,
518    ALREADY_ALLOCATED_GNB_DU_UE_F1AP_ID,
519    UNKNOWN_UE_F1AP_ID_PAIR,
520    INCONSISTENT_UE_F1AP_ID_PAIR,
521    INTERACTION_WITH_OTHER_PROCEDURE,
522    UNSUPPORTED_QCI,
523    ACTION_REQUIRED_FOR_RADIO_REASONS,
524    RADIO_RESOURCES_UNAVAILABLE,
525    CANCELLED_PROCEDURE,
526    RELEASE_NORMAL,
527    CELL_UNAVAILABLE,
528    OTHER_RL_FAILURE,
529    UE_REJECTION,
530    RESOURCES_UNAVAILABLE_FOR_SLICE
531 }RadioNwLyrCause;
532
533 typedef enum
534 {
535    UNSPECIFIED_TRANSPORT_LAYER_CAUSE,
536    TRANSPORT_RESOURCE_UNAVAILABLE
537 }TransLyrCause;
538
539 typedef enum
540 {
541    TRANSFER_SYNTAX_ERROR,
542    ABSTRACT_SYNTAX_ERROR_REJECT,
543    ABSTRACT_SYNTAX_ERROR_IGNORE_AND_REJECT,
544    INCOMPATIBLE_MESSAGE_FOR_RECEIVER_STATE,
545    SEMANTIC_ERR,
546    ABSTRAXCT_SYNTAX_ERROR_FALSELY_CONSTRUCTED_MSG,
547    UNSPECIFIED_PROTOCOL_CAUSE
548 }ProtCause;
549
550 typedef enum
551 {
552    CONTROL_PROCESSING_OVERLOAD,
553    NOT_ENOUGH_USER,
554    PLANE_PROCESSING_RESOURCES,
555    HARDWARE_FAIL,
556    INTERVENTION_BY_O_AND_M,
557    UNSPECIFIED_MISC_CAUSE
558 }MiscFailCause;
559
560 typedef enum
561 {
562    MCS_TABLE_QAM64,
563    MCS_TABLE_QAM256,
564    MCS_TABLE_QAM64_LOW_SE
565 }McsTable;
566
567 typedef enum
568 {
569    RSRC_PRB,
570    RSRC_DRB,
571    RSRC_RRC_CONNECTED_USERS
572 }ResourceType;
573
574 typedef enum
575 {
576    TRANSMISSION_ALLOWED,
577    STOP_TRANSMISSION,
578    RESTART_TRANSMISSION
579 }DataTransmissionAction;
580
581 typedef struct failureCause 
582 {
583    CauseGrp   type;
584    union
585    {
586       RadioNwLyrCause   radioNwResult;
587       TransLyrCause     transportResult;
588       ProtCause         protcolResult;
589       MiscFailCause     miscResult;
590    }u;
591 }FailureCause;
592
593 typedef struct carrierCfg
594 {
595    uint32_t   dlBw;                   /* DL bandwidth */
596    uint32_t   dlFreq;                 /* Absolute frequency of DL point A in KHz */
597    uint32_t   ulBw;                   /* UL bandwidth */
598    uint32_t   ulFreq;                 /* Absolute frequency of UL point A in KHz */
599    uint16_t   numTxAnt;               /* Number of Tx antennas */
600    uint16_t   numRxAnt;               /* Number of Rx antennas */
601 }CarrierCfg;
602
603 typedef enum
604 {
605    OP_DISABLED,     
606    OP_ENABLED,     
607 }MacOpState;
608
609 typedef enum
610 {
611    ADMIN_LOCKED,     
612    ADMIN_UNLOCKED,  
613    ADMIN_SHUTTING_DOWN, 
614 }MacAdminState;
615
616 typedef enum
617 {
618    CELL_IDLE,
619    CELL_INACTIVE,
620    CELL_ACTIVE,
621 }MacCellState;
622
623 /*Spec Ref: 38.331: RadioLinkMonitoringConfig*/
624 typedef enum
625 {
626    BeamFailure,
627    Rlf,
628    Both
629 }PurposeOfFailureDet;
630
631 typedef struct plmnInfoList
632 {
633    Plmn           plmn;
634    uint8_t        numSupportedSlice; /* Total slice supporting */
635    Snssai         **snssai;         /* List of supporting snssai*/
636 }PlmnInfoList;
637
638 typedef struct schPageCfg
639 {
640   uint8_t  numPO;                    /*Derived from Ns*/
641   bool     poPresent;                /*Whether FirstPDCCH-MonitoringPO is present or not*/
642   uint16_t pagingOcc[MAX_PO_PER_PF]; /*FirstPDCCH-Monitoring Paging Occasion*/
643 }SchPageCfg;
644
645 typedef struct pdcchConfigSib1
646 {
647    uint8_t coresetZeroIndex;     /* derived from 4 LSB of pdcchSib1 present in MIB */
648    uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
649 }PdcchConfigSib1;
650
651 typedef struct sib1CellCfg
652 {
653    PdcchConfigSib1  pdcchCfgSib1;  /*Freq pos where UE may find SS/PBCH block with SIB1*/
654    uint8_t          *sib1Pdu;
655    uint16_t         sib1PduLen;
656    SchPageCfg       pagingCfg;
657 } Sib1CellCfg; 
658
659 typedef struct bwpParams
660 {
661    uint16_t firstPrb;
662    uint16_t numPrb;
663    uint8_t  scs;
664    uint8_t  cyclicPrefix;
665 }BwpParams;
666
667 typedef struct candidatesInfo
668 {
669    uint8_t aggLevel1;
670    uint8_t aggLevel2;
671    uint8_t aggLevel4;
672    uint8_t aggLevel8;
673    uint8_t aggLevel16;
674 }CandidatesInfo;
675
676 typedef struct searchSpaceCfg
677 {
678    uint8_t searchSpaceId;
679    uint8_t coresetId;
680    uint16_t monitoringSlot;
681    uint16_t duration;
682    uint16_t monitoringSymbol;
683    CandidatesInfo candidate;
684 }SearchSpaceCfg;
685
686 typedef struct pdcchConfigCommon
687 {
688    /* only one search space is configured during SIB1 */
689    SearchSpaceCfg commonSearchSpace;
690    uint8_t raSearchSpaceId;
691 }PdcchConfigCommon;
692
693 typedef struct pdschCfgCommTimeDomRsrcAlloc
694 {
695    uint8_t k0;
696    uint8_t mappingType;
697    uint8_t startSymbol;
698    uint8_t lengthSymbol;
699 }PdschCfgCommTimeDomRsrcAlloc;
700
701 typedef struct pdschConfigCommon
702 {
703    uint8_t  numTimeDomAlloc;
704    /* PDSCH time domain DL resource allocation list */
705    PdschCfgCommTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_DL_ALLOC]; 
706 }PdschConfigCommon;
707
708 typedef struct pucchConfigCommon
709 {
710    uint8_t pucchResourceCommon;
711    uint8_t pucchGroupHopping;
712 }PucchConfigCommon;
713
714 /* PUSCH Time Domain Resource Allocation */
715 typedef struct puschTimeDomRsrcAlloc
716 {
717    uint8_t             k2;
718    CommonMappingType   mappingType;
719    uint8_t             startSymbol;
720    uint8_t             symbolLength;
721    uint8_t             startSymbolAndLength;
722 }PuschTimeDomRsrcAlloc;
723
724 typedef struct puschConfigCommon
725 {
726    /* PUSCH-TimeDomainResourceAllocation info */
727    uint8_t                 numTimeDomRsrcAlloc;
728    PuschTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
729 }PuschConfigCommon;
730
731 typedef struct bwpDlConfig
732 {
733    BwpParams         bwp;
734    PdcchConfigCommon pdcchCommon;
735    PdschConfigCommon pdschCommon;
736 }BwpDlConfig;
737
738 typedef struct bwpUlConfig
739 {
740    BwpParams         bwp;
741    // rach config common sent in PrachCfg
742    PucchConfigCommon pucchCommon;
743    PuschConfigCommon puschCommon;
744 }BwpUlConfig;
745
746
747 typedef struct cellCfg
748 {
749    MacOpState      opState;
750    MacAdminState   adminState;
751    MacCellState    cellState;
752    PlmnInfoList plmnInfoList[MAX_PLMN];   /* Consits of PlmnId and Snssai list */
753    uint32_t     phyCellId;                /* Physical cell id */
754    uint32_t     tac;
755    uint32_t     ssbFreq;
756    uint16_t     subCarrSpacing;
757    DuplexMode   dupType;          /* Duplex type: TDD/FDD */
758    Sib1CellCfg  sib1Cfg;          /* SIB1 config */
759    BwpDlConfig  initialDlBwp;     /* Initial DL BWP */
760    BwpUlConfig  initialUlBwp;     /* Initial UL BWP */
761 }CellCfg;
762
763 typedef struct ssbCfg
764 {
765    uint32_t    ssbPbchPwr;       /* SSB block power */
766    uint8_t     scsCmn;           /* subcarrier spacing for common */
767    uint16_t    ssbOffsetPointA;  /* SSB subcarrier offset from point A */
768    SSBPeriod   ssbPeriod;        /* SSB Periodicity in msec */
769    uint8_t     ssbScOffset;       /* Subcarrier Offset */
770    uint32_t    ssbMask[SSB_MASK_SIZE];      /* Bitmap for actually transmitted SSB. */
771    uint8_t     beamId[NUM_SSB];
772    BetaPss     betaPss;
773    BchPduOpt   bchPayloadFlag;   /* Options for generation of payload */
774    uint8_t     mibPdu[3];           /* MIB payload */
775    uint8_t     dmrsTypeAPos;     /* DMRS Type A position */
776 }SsbCfg;
777
778 typedef struct fdmInfo
779 {
780    uint16_t   rootSeqIdx;        /* Root sequence index */
781    uint8_t    numRootSeq;        /* Number of root sequences required for FD */
782    uint16_t   k1;                /* Frequency Offset for each FD */
783    uint8_t    zeroCorrZoneCfg;   /* Zero correlation zone cofig */
784 }PrachFdmInfo;
785
786 typedef struct prachCfg
787 {
788    PrachSeqLen   prachSeqLen;         /* RACH Sequence length: Long/short */
789    uint8_t       prachSubcSpacing;    /* Subcarrier spacing of RACH */
790    uint8_t       msg1Fdm;             /* Number of RACH frequency domain occasions/ PRACH FDM (1,2,4,8) */
791    uint8_t       prachCfgIdx;         /* PRACH Cfg Index */
792    PrachFdmInfo  fdm[8];              /* FDM info */
793    RstSetCfg     prachRstSetCfg;      /* PRACH restricted set config */
794    uint8_t       ssbPerRach;          /* SSB per RACH occassion */
795    uint8_t       totalNumRaPreamble;  /* Total number of RA preambles */
796    uint8_t       numCbPreamblePerSsb; /* Number of CB preamble per SSB */
797    uint16_t      msg1FreqStart;       /* Msg1-FrequencyStart */
798    uint8_t       raContResTmr;        /* RA Contention Resoultion Timer */
799    uint8_t       rsrpThreshSsb;       /* RSRP Threshold SSB */
800    uint8_t       raRspWindow;         /* RA Response Window */
801 }PrachCfg;
802
803 #ifdef NR_DRX
804 /* The following list of structures is taken from the DRX-Config section of specification 33.331. */
805 typedef struct drxOnDurationTimer
806 {
807    bool  onDurationTimerValInMs;
808    union
809    {
810       uint8_t  subMilliSeconds;
811       uint16_t milliSeconds;
812    }onDurationtimerValue;
813 }DrxOnDurationTimer;
814
815 typedef struct drxLongCycleStartOffset
816 {
817    uint16_t drxLongCycleStartOffsetChoice;
818    uint16_t drxLongCycleStartOffsetVal;
819 }DrxLongCycleStartOffset;
820
821 typedef struct shortDrx
822 {
823    uint16_t   drxShortCycle;
824    uint8_t    drxShortCycleTimer;
825 }ShortDrx;
826
827 typedef struct drxCfg
828 {
829    DrxOnDurationTimer       drxOnDurationTimer;   
830    uint16_t                 drxInactivityTimer;
831    uint8_t                  drxHarqRttTimerDl;
832    uint8_t                  drxHarqRttTimerUl;
833    uint16_t                 drxRetransmissionTimerDl;
834    uint16_t                 drxRetransmissionTimerUl;
835    DrxLongCycleStartOffset  drxLongCycleStartOffset;
836    bool                     shortDrxPres;
837    ShortDrx                 shortDrx;
838    uint8_t                  drxSlotOffset;
839 }DrxCfg;
840 #endif
841
842 typedef struct precodingConf
843 {
844    uint16_t numLayers;
845    uint16_t numAntPorts;
846 }PrecodingConf;
847
848 typedef struct beamformingConf
849 {    
850    uint16_t numOfBeams;
851    uint16_t numTxRUs;
852    uint16_t beamIdx;
853    uint16_t beamType;
854    uint32_t beamAzimuth;
855    uint32_t beamTilt;
856    uint32_t beamHorizWidth;
857    uint32_t beamVertWidth;
858    uint32_t coverageShape;
859    uint32_t digitalTilt;
860    uint32_t digitalAzimuth;    
861 }BeamformingConf;
862
863 typedef struct csiRsCfg
864 {
865    uint8_t   *csiFreqDomainAlloc;
866    uint8_t    csiNrofPorts;
867    uint8_t    csirsfirstOFDMSymbolInTimeDomain;
868    uint8_t    csirsfirstOFDMSymbolInTimeDomain2;
869    uint8_t    csirscdmType;
870    uint8_t    csirsdensity;
871    uint8_t    csirsdensitydot5;
872    uint8_t    powerControlOffset;
873    uint8_t    powerControlOffsetSS;
874    uint16_t   periodicityAndOffset;
875 }CsiRsCfg;
876
877 typedef struct macCellCfg
878 {
879    uint16_t         cellId;           /* Cell Id */
880    CarrierCfg       carrCfg;          /* Carrier configuration */
881    CellCfg          cellCfg;          /* Cell Configuration*/
882    SsbCfg           ssbCfg;           /* SSB configuration */          
883    CsiRsCfg         csiRsCfg;         /*Reference: 38.331 CSI-MeasConfig*/
884    PrachCfg         prachCfg;         /* PRACH Configuration */
885 #ifdef NR_TDD
886    TDDCfg           tddCfg;           /* TDD periodicity and slot configuration */
887 #endif
888    PrecodingConf    precodingConf;
889    BeamformingConf  beamCfg;
890 }MacCellCfg;
891
892 typedef struct macCellCfgCfm
893 {
894    uint16_t       cellId;
895    uint8_t        rsp; 
896 }MacCellCfgCfm;
897
898 typedef struct ulCcchInd
899 {
900    uint16_t cellId;
901    uint16_t crnti;
902    uint16_t ulCcchMsgLen;
903    uint8_t  *ulCcchMsg;
904 }UlCcchIndInfo;
905
906 typedef struct dlCcchInd
907 {
908    uint16_t      cellId;
909    uint16_t      crnti;
910    DlCcchMsgType msgType;
911    uint16_t      dlCcchMsgLen;
912    uint8_t       *dlCcchMsg;
913 }DlCcchIndInfo;
914
915 typedef struct bsrTmrCfg
916 {
917    uint16_t     periodicTimer;
918    uint16_t     retxTimer;
919    uint16_t     srDelayTimer;
920 }BsrTmrCfg;
921
922
923 /* Info of Scheduling Request to Add/Modify */
924 typedef struct schedReqInfo
925 {
926    uint8_t         schedReqId;
927    SrProhibitTimer srProhibitTmr;
928    SrTransMax      srTransMax;
929 }SchedReqInfo;
930
931 /* Scheduling Request Configuration */
932 typedef struct schedReqCfg
933 {
934    uint8_t       addModListCount;
935    SchedReqInfo  addModList[MAX_NUM_SR_CFG_PER_CELL_GRP];   /* List of Scheduling req to be added/modified */
936    uint8_t       relListCount;
937    uint8_t       relList[MAX_NUM_SR_CFG_PER_CELL_GRP];      /* list of scheduling request Id to be deleted */
938 }SchedReqCfg;
939
940 typedef struct tagInfo
941 {
942    uint8_t tagId;
943    TimeAlignmentTimer timeAlignTimer;
944 }TagInfo;
945
946 typedef struct tagCfg
947 {
948    uint8_t      addModListCount;
949    TagInfo      addModList[MAC_NUM_TAGS];  /* List of Tag to Add/Modify */
950    uint8_t      relListCount;
951    uint8_t      relList[MAC_NUM_TAGS];     /* list of Tag Id to release */
952 }TagCfg;
953
954 typedef struct phrCfg
955 {
956    PhrPeriodicTimer periodicTimer;
957    PhrProhibitTimer prohibitTimer; 
958    PhrTxPwrFactorChange txPowerFactor;
959    bool     multiplePHR;       
960    bool     dummy;
961    bool     phrType2OtherCell;
962    PhrModeOtherCG phrOtherCG;
963 }PhrCfg;
964
965 typedef struct macCellGrpCfg
966 {
967    SchedReqCfg schReqCfg;
968    TagCfg      tagCfg;
969    BsrTmrCfg   bsrTmrCfg;
970    bool        phrCfgSetupPres;   /* true/false: phrCfgSetup/phrCfgRelease */
971    PhrCfg      phrCfg;
972 #ifdef NR_DRX
973    bool        drxCfgPresent;
974    DrxCfg      drxCfg;
975 #endif
976 }MacCellGrpCfg;
977
978 typedef struct phyCellGrpCfg
979 {
980    PdschHarqAckCodebook  pdschHarqAckCodebook;
981    uint8_t    pNrFr1;
982 }PhyCellGrpCfg;
983
984 /* Control resource set info */
985 typedef struct controlRsrcSet
986 {
987    uint8_t     cRSetId;                /* Control resource set id */
988    uint8_t     freqDomainRsrc[FREQ_DOM_RSRC_SIZE];  /* Frequency domain resource */
989    uint8_t     duration;
990    REGMappingType cceRegMappingType;
991    PrecoderGranul precoderGranularity;
992    uint16_t    dmrsScramblingId;
993 }ControlRsrcSet;
994
995 /* Search Space info */
996 typedef struct searchSpace
997 {
998    uint8_t     searchSpaceId;
999    uint8_t     cRSetId;
1000    MSlotPeriodAndOffset  mSlotPeriodicityAndOffset;
1001    uint8_t     mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
1002    AggrLevel   numCandidatesAggLevel1;      /* Number of candidates for aggregation level 1 */
1003    AggrLevel   numCandidatesAggLevel2;      /* Number of candidates for aggregation level 2 */
1004    AggrLevel   numCandidatesAggLevel4;      /* Number of candidates for aggregation level 4 */
1005    AggrLevel   numCandidatesAggLevel8;      /* Number of candidates for aggregation level 8 */
1006    AggrLevel   numCandidatesAggLevel16;     /* Number of candidates for aggregation level 16 */
1007    SearchSpaceType searchSpaceType;
1008    uint8_t     ueSpecificDciFormat;
1009 }SearchSpace;
1010
1011 /* PDCCH cofniguration */
1012 typedef struct pdcchConfig
1013 {
1014    uint8_t           numCRsetToAddMod;
1015    ControlRsrcSet    cRSetToAddModList[MAX_NUM_CRSET];           /* List of control resource set to add/modify */
1016    uint8_t           numCRsetToRel;
1017    uint8_t           cRSetToRelList[MAX_NUM_CRSET];              /* List of control resource set to release */
1018    uint8_t           numSearchSpcToAddMod;
1019    SearchSpace       searchSpcToAddModList[MAX_NUM_SEARCH_SPC];  /* List of search space to add/modify */
1020    uint8_t           numSearchSpcToRel;
1021    uint8_t           searchSpcToRelList[MAX_NUM_SEARCH_SPC];     /* List of search space to release */
1022 }PdcchConfig;
1023
1024 /* PDSCH time domain resource allocation */
1025 typedef struct pdschTimeDomRsrcAlloc
1026 {
1027    uint8_t           *k0;
1028    CommonMappingType mappingType;
1029    uint8_t           startSymbol;
1030    uint8_t           symbolLength;
1031    uint8_t           startSymbolAndLength;
1032 }PdschTimeDomRsrcAlloc;
1033
1034
1035 typedef struct pdschBundling
1036 {
1037    struct staticBundling
1038    {
1039      BundlingSizeSet2 size;
1040    }StaticBundling;
1041    struct dynamicBundling
1042    {
1043      BundlingSizeSet1 sizeSet1;
1044      BundlingSizeSet2 sizeSet2;
1045    }DynamicBundling;
1046 }PdschBundling;
1047
1048 /* DMRS downlink configuration */
1049 typedef struct dmrsDlCfg
1050 {
1051    AddPosType  addPos;       /* DMRS additional position */
1052 }DmrsDlCfg;
1053
1054 /* PDSCH Configuration */
1055 typedef struct pdschConfig
1056 {
1057    DmrsDlCfg               dmrsDlCfgForPdschMapTypeA;
1058    ResAllocType            resourceAllocType;
1059    uint8_t                 numTimeDomRsrcAlloc;
1060    PdschTimeDomRsrcAlloc   timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
1061    RBGSize                 rbgSize;
1062    CodeWordsSchedDci       numCodeWordsSchByDci;                    /* Number of code words scheduled by DCI */
1063    BundlingType            bundlingType;
1064    PdschBundling           bundlingInfo;
1065 }PdschConfig;
1066
1067 /* Initial Downlink BWP */
1068 typedef struct initialDlBwp
1069 {
1070    bool          pdcchPresent;
1071    PdcchConfig   pdcchCfg;
1072    bool          pdschPresent;
1073    PdschConfig   pdschCfg;
1074 }InitialDlBwp;
1075
1076 /*Spec 38.331 "SPS-Config'*/
1077 typedef struct spsConfig
1078 {
1079    uint16_t     periodicity;
1080    uint8_t      numOfHqProcess;
1081    uint8_t      n1PucchAN;
1082    McsTable     mcsTable;
1083 }SpsConfig;
1084
1085 typedef uint8_t RadioLinkMonitoringRsId;
1086
1087 typedef struct radioLinkMonRS
1088 {
1089    RadioLinkMonitoringRsId radioLinkMonitoringRsId;
1090    PurposeOfFailureDet      purpose; 
1091    union
1092    {
1093       uint8_t ssbIndx;
1094       uint8_t nzpCsiRsResId;
1095    }detectionRes;
1096 }RadioLinkMonRS;
1097
1098 typedef struct radioLinkConfig
1099 {
1100    RadioLinkMonRS             failurDetResAddModList[1];
1101    RadioLinkMonitoringRsId   failurDetResRelList[1];
1102    uint8_t                    beamFailureInstanceMaxCount;
1103    uint8_t                    beamFailureDetectionTimer;
1104 }RadioLinkConfig;
1105
1106 /* Spec 38.331, 'BWP-DownlinkDedicated'*/
1107 typedef struct bwpDlCfgDed
1108 {
1109   PdcchConfig     pdcchCfgDed;
1110   PdschConfig     pdschCfgDed;
1111   SpsConfig       spsCfgDed;
1112   RadioLinkConfig radioLnkMonCfgDed;
1113 }BwpDlCfgDed;
1114
1115 /* Downlink BWP information */
1116 typedef struct dlBwpInfo
1117 {
1118    uint8_t          bwpId;
1119    BwpDlConfig      bwpCommon;
1120    BwpDlCfgDed      bwpDedicated;
1121 }DlBwpInfo;
1122
1123 /* PDCCH Serving Cell configuration */
1124 typedef struct pdschServCellCfg
1125 {
1126    uint8_t              *maxMimoLayers;           
1127    NumHarqProcForPdsch  numHarqProcForPdsch;
1128    MaxCodeBlkGrpPerTB   *maxCodeBlkGrpPerTb;
1129    bool                 *codeBlkGrpFlushInd;
1130    PdschXOverhead       *xOverhead;
1131 }PdschServCellCfg;
1132
1133 /* PUCCH Configuration */
1134
1135 typedef struct pucchResrcSetInfo
1136 {
1137    uint8_t resrcSetId;
1138    uint8_t resrcListCount;
1139    uint8_t resrcList[MAX_NUM_PUCCH_PER_RESRC_SET];
1140    uint8_t maxPayLoadSize;
1141 }PucchResrcSetInfo;
1142
1143 typedef struct pucchResrcSetCfg
1144 {
1145    uint8_t resrcSetToAddModListCount;
1146    PucchResrcSetInfo resrcSetToAddModList[MAX_NUM_PUCCH_RESRC_SET];
1147    uint8_t resrcSetToRelListCount;
1148    uint8_t resrcSetToRelList[MAX_NUM_PUCCH_RESRC];
1149 }PucchResrcSetCfg;
1150
1151 typedef struct pucchFormat0
1152 {
1153    uint8_t initialCyclicShift;
1154    uint8_t numSymbols;
1155    uint8_t startSymbolIdx;
1156 }PucchFormat0;
1157
1158 typedef struct pucchFormat1
1159 {
1160    uint8_t initialCyclicShift;
1161    uint8_t numSymbols;
1162    uint8_t startSymbolIdx;
1163    uint8_t timeDomOCC;
1164 }PucchFormat1;
1165
1166 typedef struct pucchFormat2_3
1167 {
1168    uint8_t numPrbs;
1169    uint8_t numSymbols;
1170    uint8_t startSymbolIdx;
1171 }PucchFormat2_3;
1172
1173 typedef struct pucchFormat4
1174 {
1175    uint8_t numSymbols;
1176    uint8_t occLen;
1177    uint8_t occIdx;
1178    uint8_t startSymbolIdx;
1179 }PucchFormat4;
1180
1181 typedef struct pucchResrcInfo
1182 {
1183    uint8_t  resrcId;
1184    uint16_t startPrb;
1185    uint8_t  intraFreqHop;
1186    uint16_t secondPrbHop;
1187    uint8_t  pucchFormat;
1188    union
1189    {
1190       PucchFormat0   *format0; 
1191       PucchFormat1   *format1;
1192       PucchFormat2_3 *format2;
1193       PucchFormat2_3 *format3;
1194       PucchFormat4   *format4;
1195    }PucchFormat;
1196 }PucchResrcInfo;
1197
1198 typedef struct pucchResrcCfg
1199 {
1200    uint8_t resrcToAddModListCount;
1201    PucchResrcInfo resrcToAddModList[MAX_NUM_PUCCH_RESRC];
1202    uint8_t resrcToRelListCount;
1203    uint8_t resrcToRelList[MAX_NUM_PUCCH_RESRC];
1204 }PucchResrcCfg;
1205
1206 typedef struct pucchFormatCfg
1207 {
1208    bool interSlotFreqHop;
1209    bool addDmrs;
1210    uint8_t maxCodeRate;
1211    uint8_t numSlots;
1212    bool    pi2BPSK;
1213    bool    harqAckCSI;
1214 }PucchFormatCfg;
1215
1216 typedef struct schedReqResrcInfo
1217 {
1218    uint8_t resrcId;
1219    uint8_t requestId;
1220    uint8_t periodicity;
1221    uint16_t offset;
1222    uint8_t resrc;
1223 }SchedReqResrcInfo;
1224
1225 typedef struct pucchSchedReqCfg
1226 {
1227    uint8_t           schedAddModListCount;
1228    SchedReqResrcInfo schedAddModList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1229    uint8_t           schedRelListCount;
1230    uint8_t           schedRelList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1231 }PucchSchedReqCfg;
1232
1233 typedef struct spatialRelationInfo
1234 {
1235    uint8_t spatialRelationId;
1236    uint8_t servCellIdx;
1237    uint8_t pathLossRefRSId;
1238    uint8_t p0PucchId;
1239    uint8_t closeLoopIdx;
1240 }SpatialRelationInfo;
1241
1242 typedef struct pucchSpatialCfg
1243 {
1244    uint8_t spatialAddModListCount;
1245    SpatialRelationInfo spatialAddModList[MAX_NUM_SPATIAL_RELATIONS];
1246    uint8_t spatialRelListCount;
1247    uint8_t spatialRelList[MAX_NUM_SPATIAL_RELATIONS];
1248 }PucchSpatialCfg;
1249
1250 typedef struct p0PucchCfg
1251 {
1252    uint8_t p0PucchId;
1253    int     p0PucchVal;
1254 }P0PucchCfg;
1255
1256 typedef struct pathLossRefRSCfg
1257 {
1258    uint8_t pathLossRefRSId;
1259 }PathLossRefRSCfg;
1260
1261 typedef struct pucchMultiCsiCfg
1262 {
1263    uint8_t  multiCsiResrcListCount;
1264    uint8_t  multiCsiResrcList[MAX_NUM_PUCCH_RESRC-1];
1265 }PucchMultiCsiCfg;
1266
1267 typedef struct pucchDlDataToUlAck
1268 {
1269    uint8_t  dlDataToUlAckListCount;
1270    uint8_t  dlDataToUlAckList[MAX_NUM_DL_DATA_TO_UL_ACK];
1271 }PucchDlDataToUlAck;
1272
1273 typedef struct pucchPowerControl
1274 {
1275    int deltaF_Format0;
1276    int deltaF_Format1;
1277    int deltaF_Format2;
1278    int deltaF_Format3;
1279    int deltaF_Format4;
1280    uint8_t p0SetCount;
1281    P0PucchCfg p0Set[MAX_NUM_PUCCH_P0_PER_SET];
1282    uint8_t pathLossRefRSListCount;
1283    PathLossRefRSCfg pathLossRefRSList[MAX_NUM_PATH_LOSS_REF_RS];
1284 }PucchPowerControl;
1285
1286 typedef struct pucchCfg
1287 {
1288    PucchResrcSetCfg  *resrcSet;
1289    PucchResrcCfg     *resrc;
1290    PucchFormatCfg    *format1; 
1291    PucchFormatCfg    *format2; 
1292    PucchFormatCfg    *format3; 
1293    PucchFormatCfg    *format4;
1294    PucchSchedReqCfg  *schedReq;
1295    PucchMultiCsiCfg  *multiCsiCfg;
1296    PucchSpatialCfg   *spatialInfo;
1297    PucchDlDataToUlAck *dlDataToUlAck;
1298    PucchPowerControl *powerControl;
1299 }PucchCfg;
1300
1301 /* Transform precoding disabled */
1302 typedef struct transPrecodDisabled
1303 {
1304    uint16_t   scramblingId0;
1305 }TransPrecodDisabled;
1306
1307 /* DMRS Uplink configuration */
1308 typedef struct dmrsUlCfg
1309 {
1310    AddPosType            addPos;               /* DMRS additional position */
1311    TransPrecodDisabled   transPrecodDisabled;  /* Transform precoding disabled */
1312 }DmrsUlCfg;
1313
1314 /* PUSCH Configuration */
1315 typedef struct puschCfg
1316 {
1317    uint8_t                 dataScramblingId;
1318    DmrsUlCfg               dmrsUlCfgForPuschMapTypeA;
1319    ResAllocType            resourceAllocType;
1320    uint8_t                 numTimeDomRsrcAlloc;
1321    PuschTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1322    TransformPrecoder       transformPrecoder;
1323 }PuschCfg;
1324
1325 /* Initial Uplink BWP */
1326 typedef struct initialUlBwp
1327 {
1328    bool       pucchPresent;
1329    PucchCfg   pucchCfg; 
1330    bool       puschPresent;
1331    PuschCfg   puschCfg;
1332 }InitialUlBwp;
1333
1334 typedef struct bwpUlCfgDed
1335 {
1336    PucchCfg   pucchCfg;
1337    PuschCfg   puschCfg;
1338 }BwpUlCfgDed;
1339
1340 /* Uplink BWP information */
1341 typedef struct ulBwpInfo
1342 {
1343    uint8_t          bwpId;
1344    BwpUlConfig      bwpCommon;
1345    BwpUlCfgDed      bwpDed;
1346 }UlBwpInfo;
1347
1348 typedef struct rachCfgGeneric
1349 {
1350    uint8_t      prachCfgIdx;       /* PRACH config idx */
1351    uint8_t      msg1Fdm;           /* PRACH FDM (1,2,4,8) */
1352    uint16_t     msg1FreqStart;     /* Msg1-FrequencyStart */
1353    uint8_t      zeroCorrZoneCfg;   /* Zero correlation zone cofig */
1354    int16_t      preambleRcvdTargetPower; /*Prach Target power received*/
1355    uint8_t      preambleTransMax;  /*Preamble Transmission Max power*/
1356    uint8_t      pwrRampingStep;    /*Power Ramping Step*/
1357    uint8_t      raRspWindow;       /* RA Response Window */
1358 }RachCfgGeneric;
1359
1360 typedef struct raPrioritization
1361 {
1362    uint8_t powerRampingStepHighPriority;
1363    uint8_t scalingFactorBI;
1364 }RaPrioritization;
1365
1366 typedef struct bfrCsiRsRes
1367 {
1368    uint8_t csrRsIndex;
1369    uint8_t raOccList;
1370    uint8_t raPreambleIndex;
1371 }BfrCsiRsRes;
1372
1373 typedef struct bfrSsbRes
1374 {
1375    uint16_t ssbIndex;
1376    uint8_t raPreambleIndex;
1377 }BfrSsbRes;
1378
1379 typedef struct prachResDedBfr
1380 {
1381    BfrSsbRes    ssb;
1382    BfrCsiRsRes  csiRs;
1383 }PrachResDedBfr;
1384
1385 /*Spec 38.331 'BeamFailureRecoveryConfig' */
1386 typedef struct beamFailRecoveryCfg
1387 {
1388    uint8_t             rootSeqIndexBfr;
1389    RachCfgGeneric      rachCfgBfr;
1390    uint8_t             rsrpThreshSsbBfr;
1391    PrachResDedBfr      candidteBeamRSList;
1392    uint8_t             ssbPerachBfr;
1393    uint8_t             raSsbOccMaskIndex;
1394    uint8_t             recoverySearchSpaceId;
1395    RaPrioritization    raPrioBfr;
1396    uint16_t            bfrTimer;
1397    uint8_t             msg1SubcSpacing;
1398 }BeamFailRecoveryCfg;
1399
1400 /* Serving cell configuration */
1401 typedef struct servCellCfgInfo
1402 {
1403    InitialDlBwp         initDlBwp;
1404    RadioLinkConfig      radioLinkMonConfig;
1405    uint8_t              numDlBwpToAdd;
1406    DlBwpInfo            dlBwpToAddList[MAX_NUM_BWP];
1407    uint8_t              firstActvDlBwpId;
1408    uint8_t              defaultDlBwpId;
1409    uint8_t              *bwpInactivityTmr;
1410    PdschServCellCfg     pdschServCellCfg;
1411    InitialUlBwp         initUlBwp;
1412    BeamFailRecoveryCfg  beamFailureRecoveryCfg;
1413    uint8_t              numUlBwpToAdd;
1414    UlBwpInfo            ulBwpToAddList[MAX_NUM_BWP];
1415    uint8_t              firstActvUlBwpId;
1416 }ServCellCfgInfo;
1417
1418 /* Special cell configuration */
1419 typedef struct spCellCfg
1420 {
1421    uint8_t           servCellIdx;
1422    ServCellCfgInfo   servCellCfg;
1423 }SpCellCfg;
1424
1425 typedef struct bwpRelInfo
1426 {
1427    uint8_t bwpId;
1428 }BwpRelInfo;
1429
1430 /* Serving cell Re-configuration */
1431 typedef struct servCellRecfgInfo
1432 {
1433    InitialDlBwp       initDlBwp;
1434    RadioLinkConfig    radioLinkMonConfig;
1435    uint8_t            numDlBwpToAddOrMod;
1436    DlBwpInfo          dlBwpToAddOrModList[MAX_NUM_BWP];
1437    uint8_t            numDlBwpToRel;
1438    BwpRelInfo         dlBwpToRelList[MAX_NUM_BWP];
1439    uint8_t            firstActvDlBwpId;
1440    uint8_t            defaultDlBwpId;
1441    uint8_t            *bwpInactivityTmr;
1442    PdschServCellCfg   pdschServCellCfg;
1443    InitialUlBwp       initUlBwp;
1444    uint8_t            numUlBwpToAddOrMod;
1445    UlBwpInfo          ulBwpToAddOrModList[MAX_NUM_BWP];
1446    uint8_t            numUlBwpToRel;
1447    BwpRelInfo         ulBwpToRelList[MAX_NUM_BWP];
1448    uint8_t            firstActvUlBwpId;
1449 }ServCellRecfgInfo;
1450
1451 /* Special cell Re-configuration */
1452 typedef struct spCellRecfg 
1453 {
1454    uint8_t             servCellIdx;
1455    ServCellRecfgInfo   servCellCfg;
1456 }SpCellRecfg;
1457
1458 typedef struct ambrCfg
1459 {
1460    uint32_t ulBr;   /* UL Bit rate */
1461 }AmbrCfg;
1462
1463 typedef struct nonDynFiveQi
1464 {
1465    uint16_t   fiveQi;
1466    uint8_t    priorLevel;
1467    uint16_t   avgWindow;
1468    uint16_t   maxDataBurstVol;
1469 }NonDynFiveQi;
1470
1471 typedef struct dynFiveQi
1472 {
1473    uint8_t    priorLevel;
1474    uint16_t   packetDelayBudget;
1475    uint8_t    packetErrRateScalar;
1476    uint8_t    packetErrRateExp;
1477    uint16_t   fiveQi;
1478    uint8_t    delayCritical;
1479    uint16_t   avgWindow;
1480    uint16_t   maxDataBurstVol;
1481 }DynFiveQi;
1482
1483 typedef struct ngRanAllocAndRetPri
1484 {
1485    uint8_t priorityLevel;
1486    uint8_t preEmptionCap;
1487    uint8_t preEmptionVul;
1488 }NgRanAllocAndRetPri;
1489
1490 typedef struct grbQosInfo
1491 {
1492    uint32_t maxFlowBitRateDl;
1493    uint32_t maxFlowBitRateUl;
1494    uint32_t guarFlowBitRateDl;
1495    uint32_t guarFlowBitRateUl;
1496 }GrbQosInfo;
1497
1498 typedef struct drbQos
1499 {
1500    QosType  fiveQiType;   /* Dynamic or non-dynamic */ 
1501    union
1502    {
1503       NonDynFiveQi   nonDyn5Qi;
1504       DynFiveQi      dyn5Qi;
1505    }u;
1506    NgRanAllocAndRetPri ngRanRetPri;
1507    GrbQosInfo grbQosInfo;
1508    uint16_t             pduSessionId;
1509    uint32_t             ulPduSessAggMaxBitRate;
1510 }DrbQosInfo;
1511
1512 typedef struct ulLcCfg
1513 {
1514    uint8_t priority;
1515    uint8_t lcGroup;
1516    uint8_t schReqId;
1517    PBitRate pbr;        // prioritisedBitRate
1518    BucketSizeDur bsd;        // bucketSizeDuration
1519 }UlLcCfg;
1520
1521 typedef struct dlLcCfg
1522 {
1523    LcPriority lcp;      // logical Channel Prioritization
1524 }DlLcCfg;
1525
1526 typedef struct lcCfg
1527 {
1528    uint8_t lcId;
1529    Snssai  *snssai;
1530    DrbQosInfo *drbQos; 
1531    bool ulLcCfgPres;
1532    UlLcCfg ulLcCfg;
1533    DlLcCfg dlLcCfg;
1534 }LcCfg;
1535
1536 typedef struct modulationInfo
1537 {
1538    uint8_t     modOrder;    /* Modulation order */
1539    uint8_t     mcsIndex;    /* MCS Index */
1540    McsTable    mcsTable;    /* MCS table */
1541 }ModulationInfo;
1542
1543 typedef struct macUeCreateReq
1544 {
1545    uint16_t               cellId;
1546    uint8_t                ueId;
1547    uint8_t                beamIdx;
1548    uint16_t               crnti;
1549    bool                   macCellGrpCfgPres;
1550    MacCellGrpCfg          macCellGrpCfg;
1551    bool                   phyCellGrpCfgPres;
1552    PhyCellGrpCfg          phyCellGrpCfg;
1553    bool                   spCellCfgPres;
1554    SpCellCfg              spCellCfg;
1555    AmbrCfg                *ambrCfg;
1556    ModulationInfo         dlModInfo;    /* DL modulation info */ 
1557    ModulationInfo         ulModInfo;    /* UL modulation info */
1558    uint8_t                numLcs;
1559    LcCfg                  lcCfgList[MAX_NUM_LC];
1560 }MacUeCreateReq;
1561
1562 /* UE Re-configuration */
1563 typedef struct macUeRecfg
1564 {
1565    uint16_t        cellId;
1566    uint8_t         ueId;
1567    uint8_t         beamIdx;
1568    uint16_t        crnti;
1569    bool            macCellGrpRecfgPres;
1570    MacCellGrpCfg   macCellGrpRecfg;
1571    bool            phyCellGrpRecfgPres;
1572    PhyCellGrpCfg   phyCellGrpRecfg;
1573    bool            spCellRecfgPres;
1574    SpCellRecfg     spCellRecfg;
1575    AmbrCfg         *ambrRecfg;
1576    ModulationInfo  dlModInfo;
1577    ModulationInfo  ulModInfo;
1578    uint8_t         numLcsToAdd;
1579    LcCfg           lcCfgAdd[MAX_NUM_LC];
1580    uint8_t         numLcsToDel;
1581    uint8_t         lcIdToDel[MAX_NUM_LC];
1582    uint8_t         numLcsToMod;
1583    LcCfg           lcCfgMod[MAX_NUM_LC];
1584    DataTransmissionAction transmissionAction;
1585 #ifdef NR_DRX   
1586    bool            drxConfigIndicatorRelease;
1587 #endif
1588 }MacUeRecfg;
1589
1590 typedef struct nrcgi
1591 {
1592    Plmn      plmn;
1593    uint16_t  cellId;
1594 }Nrcgi;
1595
1596 typedef struct srbFailInfo
1597 {
1598    uint8_t       srbId;
1599    FailureCause  cause;
1600 }SRBFailInfo;
1601
1602 typedef struct drbFailInfo
1603 {
1604    uint8_t       drbId;
1605    FailureCause  cause;
1606 }DRBFailInfo;
1607
1608 typedef struct sCellFailInfo
1609 {
1610    Nrcgi         nrcgi;
1611    FailureCause  cause;
1612 }SCellFailInfo;
1613
1614 typedef struct macUeCreateRsp
1615 {
1616    uint16_t       cellId;
1617    uint16_t       ueId;
1618    MacRsp         result;
1619    uint8_t        numSRBFailed;   /* valid values : 0 to MAX_NUM_SRB */ 
1620    SRBFailInfo    *failedSRBlisti;
1621    uint8_t        numDRBFailed;   /* valid values : 0 to MAX_NUM_DRB */
1622    DRBFailInfo    *failedDRBlist;
1623    uint8_t        numSCellFailed; /* valid values : 0 to MAX_NUM_SCELL */
1624    SCellFailInfo  *failedSCellList;
1625    uint8_t        numDRBModFailed;   /* valid values : 0 to MAX_NUM_DRB */
1626    DRBFailInfo    *failedDRBModlist;
1627 }MacUeCreateRsp;
1628
1629 typedef struct macUeCreateRsp MacUeRecfgRsp;
1630
1631 typedef struct rachRsrcReq
1632 {
1633    uint16_t cellId;
1634    uint16_t ueId;
1635    uint8_t  numSsb;
1636    uint8_t  ssbIdx[MAX_NUM_SSB];
1637 }MacRachRsrcReq;
1638
1639 typedef struct macCfraSsbResource
1640 {
1641    uint8_t  ssbIdx;
1642    uint8_t  raPreambleIdx;
1643 }MacCfraSsbResource;
1644
1645 typedef struct macCfraResource
1646 {
1647    uint8_t   numSsb;
1648    MacCfraSsbResource ssbResource[MAX_NUM_SSB];
1649 }MacCfraResource;
1650
1651 typedef struct macRachRsrcRsp
1652 {
1653    uint16_t   cellId;
1654    uint16_t   ueId;
1655    MacRsp     result;
1656    uint16_t   newCrnti;     /* This parameter maps to 3GPP TS 38.331 newUE-Identity */
1657    MacCfraResource  cfraResource;
1658 }MacRachRsrcRsp;
1659
1660 typedef struct macRachRsrcRel
1661 {
1662    uint16_t cellId;
1663    uint16_t ueId;
1664    uint16_t crnti;
1665 }MacRachRsrcRel;
1666
1667 typedef struct ueDelete
1668 {
1669     uint16_t cellId;
1670     uint8_t  ueId;
1671     uint16_t crnti;
1672 }MacUeDelete;
1673
1674 typedef struct ueDeleteRsp
1675 {
1676    uint16_t cellId;
1677    uint8_t  ueId;
1678    CauseOfResult  status;
1679 }MacUeDeleteRsp;
1680
1681 typedef struct macCellDeleteReq
1682 {
1683    uint16_t cellId;
1684 }MacCellDeleteReq;
1685
1686 typedef struct macCellDeleteRsp
1687 {
1688    uint16_t cellId;
1689    CauseOfResult  status;
1690 }MacCellDeleteRsp;
1691
1692 typedef struct macSliceCfgRsp 
1693 {
1694    Snssai     snssai;
1695    MacRsp     rsp;
1696    CauseOfResult  cause;  
1697 }MacSliceCfgRsp;
1698
1699 typedef struct rrmPolicyRatio
1700 {
1701    uint8_t maxRatio;
1702    uint8_t minRatio;
1703    uint8_t dedicatedRatio;
1704 }RrmPolicyRatio;
1705
1706 typedef struct rrmPolicyMemberList
1707 {
1708    Plmn    plmn;
1709    Snssai  snssai;
1710 }RrmPolicyMemberList;
1711
1712 typedef struct macSliceRrmPolicy
1713 {
1714    ResourceType        resourceType;
1715    uint8_t             numOfRrmPolicyMem;
1716    RrmPolicyMemberList **rRMPolicyMemberList;
1717    RrmPolicyRatio      policyRatio;
1718 }MacSliceRrmPolicy;
1719
1720 typedef struct macSliceCfgReq
1721 {
1722    uint8_t           numOfRrmPolicy;
1723    MacSliceRrmPolicy **listOfRrmPolicy;
1724 }MacSliceCfgReq;
1725
1726 /*As per ORAN-WG8, Slice Cfg and ReCfg are same structures*/
1727 typedef struct macSliceCfgReq MacSliceRecfgReq;
1728 typedef struct macSliceCfgRsp MacSliceRecfgRsp;
1729
1730 /*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.17 DL PCCH Indication */
1731 typedef struct dlPcchInd
1732 {
1733    uint16_t  cellId;
1734    uint16_t  pf;
1735    uint8_t   i_s;
1736    uint16_t  pduLen;
1737    uint8_t  *pcchPdu;
1738 }DlPcchInd;
1739
1740
1741 /*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.1 Cell Start */
1742 typedef struct cellInfo
1743 {
1744     SlotTimingInfo slotInfo;
1745     uint16_t       cellId;
1746 }CellInfo;
1747
1748 typedef struct cellInfo CellStartInfo;
1749 typedef struct cellInfo CellStopInfo;
1750
1751 /*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.12 UE Reset Request */
1752 typedef struct ueReset
1753 {
1754     uint16_t cellId;
1755     uint8_t  ueId;
1756 }MacUeResetReq;
1757
1758 /*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.13 UE Reset Response */
1759 typedef struct ueResetRsp
1760 {
1761    uint16_t cellId;
1762    uint8_t  ueId;
1763    CauseOfResult  status;
1764 }MacUeResetRsp;
1765
1766 /*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.14 UE Sync Status Indication */
1767 typedef struct ueSyncStatusInd
1768 {
1769    uint16_t   cellId;
1770    uint8_t    ueId;
1771    SyncStatus status;
1772 }MacUeSyncStatusInd;
1773
1774 /* The following list of structures is taken from the SI-SchedulingInfo section of specification 33.331. */
1775 typedef struct sibTypeInfo
1776 {
1777    SibType sibType;
1778    uint8_t valueTag;
1779    bool    areaScope;
1780 }SibTypeInfo;
1781
1782 typedef struct sibMappingInfo
1783 {
1784    uint8_t      numSibTypeInfo;
1785    SibTypeInfo  sibTypeInfo[NUM_SIB];
1786 }SibMappingInfo;
1787
1788 typedef struct schedulingInfo 
1789 {
1790    SiBroadcastStatus siBroadcastStatus;
1791    SiPeriodicity     siPeriodicity;
1792    SibMappingInfo    sibMappingInfo;
1793 }SchedulingInfo;
1794
1795 typedef struct rachOccasionsSi
1796 {
1797    RachCfgGeneric     rachConfigSi;
1798    SsbPerRachOccasion ssbPerRachOccasion;
1799 }RachOccasionsSi;
1800
1801 typedef struct siReqRsrc 
1802 {
1803    uint8_t raPreambleStartIndex;
1804    uint8_t raAssociationPeriodIndex;
1805    uint8_t raSsbOccasionMaskIndex; 
1806 }SiReqRsrc;
1807
1808 typedef struct siRequestResource
1809 {
1810    uint8_t    numOfSiReqRsrc;
1811    SiReqRsrc  siReqRsrc[MAX_SI_MESSAGE];
1812 }SiRequestResource;
1813
1814 typedef struct siRequestConfig
1815 {
1816    RachOccasionsSi    rachOccasionsSi;
1817    SiRequestPeriod    siRequestPeriod;
1818    SiRequestResource  siRequestResource;
1819 }SiRequestConfig;
1820
1821 typedef struct schedulingInfoList
1822 {
1823    uint8_t        numSchInfo;
1824    SchedulingInfo schedulingInfo[MAX_SI_MESSAGE];
1825 }SchedulingInfoList;
1826
1827 typedef struct siSchedulingInfo
1828 {
1829    SchedulingInfoList schInfoList;
1830    SiWindowLength     siWindowLength;
1831    SiRequestConfig    siRequestConfig;
1832    SiRequestConfig    siRequestConfigSUL;
1833    uint8_t            *siAreaID;
1834 }SiSchedulingInfo;
1835
1836 /*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.18 DL Broadcast Request  */
1837 typedef struct macDlBroadcastReq
1838 {
1839     uint16_t         cellId;
1840     uint8_t          numSiBlock;
1841     SiSchedulingInfo **siSchedulingInfo;
1842 }MacDlBroadcastReq;
1843
1844 /* DL broadcast req from DU APP to MAC*/
1845 typedef uint8_t (*DuMacDlBroadcastReq) ARGS((
1846          Pst           *pst,
1847          MacDlBroadcastReq *dlBroadcast));
1848
1849 /* Functions for CellUp Ind from MAC to DU APP*/
1850 typedef uint8_t (*DuMacCellUpInd) ARGS((
1851          Pst       *pst,
1852          OduCellId *cellId ));
1853
1854 /* Functions for slot Ind from MAC to DU APP*/
1855 typedef uint8_t (*DuMacSlotInd) ARGS((
1856          Pst       *pst,
1857          SlotTimingInfo *slotIndInfo));
1858
1859 /* Functions for stop Ind from MAC to DU APP*/
1860 typedef uint8_t (*DuMacStopInd) ARGS((
1861          Pst        *pst,
1862          OduCellId  *cellId ));
1863
1864 /* Functions for mac cell start req */
1865 typedef uint8_t (*DuMacCellStart) ARGS((
1866          Pst        *pst, 
1867          CellStartInfo  *cellId));
1868
1869 /* Functions for mac cell stop request */
1870 typedef uint8_t (*DuMacCellStop) ARGS((
1871          Pst        *pst,
1872          CellStopInfo  *cellId ));
1873
1874 /* Function pointers for packing macCellCfg Request and Confirm */
1875 typedef uint8_t (*packMacCellCfgReq) ARGS((
1876          Pst           *pst,
1877          MacCellCfg    *macCellCfg ));
1878
1879 typedef uint8_t (*packMacCellCfgConfirm) ARGS((
1880          Pst              *pst,
1881          MacCellCfgCfm    *macCellCfgCfm ));
1882
1883 typedef uint8_t (*DuMacCellCfgReq) ARGS((
1884          Pst        *pst,        
1885          MacCellCfg *macCellCfg));
1886
1887 typedef uint8_t (*DuMacCellCfgCfm) ARGS((
1888          Pst        *pst,        
1889          MacCellCfgCfm *macCellCfgCfm ));
1890
1891 /* Functions for UL CCCH Ind from MAC to DU APP*/
1892 typedef uint8_t (*DuMacUlCcchInd) ARGS((
1893          Pst           *pst,
1894          UlCcchIndInfo *ulCcchIndInfo ));
1895
1896 /* Functions for DL CCCH Ind from DU APP to MAC*/
1897 typedef uint8_t (*DuMacDlCcchInd) ARGS((
1898          Pst           *pst,
1899          DlCcchIndInfo *dlCcchIndInfo ));
1900
1901 /* UE create Request from DU APP to MAC*/
1902 typedef uint8_t (*DuMacUeCreateReq) ARGS((
1903          Pst           *pst,
1904          MacUeCreateReq      *ueCfg ));
1905
1906 /* UE create Response from MAC to DU APP */
1907 typedef uint8_t (*MacDuUeCreateRspFunc) ARGS((
1908          Pst           *pst, 
1909          MacUeCreateRsp   *cfgRsp));
1910
1911 /* UE Reconfig Request from DU APP to MAC */
1912 typedef uint8_t (*DuMacUeReconfigReq) ARGS((
1913          Pst           *pst,
1914          MacUeRecfg      *ueCfg ));
1915
1916 /* UE Reconfig Response from MAC to DU APP */
1917 typedef uint8_t (*MacDuUeRecfgRspFunc) ARGS((
1918          Pst           *pst, 
1919          MacUeRecfgRsp   *cfgRsp));
1920
1921 /* RACH Resource Request from DU APP to MAC */
1922 typedef uint8_t (*DuMacRachRsrcReq) ARGS((
1923     Pst            *pst,
1924     MacRachRsrcReq *rachRsrcReq));
1925
1926 /* RACH Resource Response from MAC to DU APP */
1927 typedef uint8_t (*MacDuRachRsrcRspFunc) ARGS((
1928     Pst            *pst,
1929     MacRachRsrcRsp *rachRsrcRsp));
1930
1931 /* RACH Resource Release from DU APP to MAC */
1932 typedef uint8_t (*DuMacRachRsrcRel) ARGS((
1933     Pst            *pst,
1934     MacRachRsrcRel *rachRsrcRel));
1935
1936 /* UE Delete Request from DU APP to MAC*/
1937 typedef uint8_t (*DuMacUeDeleteReq) ARGS((
1938      Pst           *pst,
1939      MacUeDelete   *ueDel ));
1940
1941 /* UE Delete Response from MAC to DU APP*/
1942 typedef uint8_t (*MacDuUeDeleteRspFunc) ARGS((
1943      Pst            *pst,
1944      MacUeDeleteRsp *deleteRsp));
1945
1946 /* Cell Delete Request from DU APP to MAC*/
1947 typedef uint8_t (*DuMacCellDeleteReq) ARGS((
1948      Pst           *pst,
1949      MacCellDeleteReq *cellDelete ));
1950
1951 /* Cell Delete Response from MAC to DU APP*/
1952 typedef uint8_t (*MacDuCellDeleteRspFunc) ARGS((
1953      Pst            *pst,
1954      MacCellDeleteRsp *cellDeleteRsp));
1955
1956 /* Slice Cfg Request from DU APP to MAC*/
1957 typedef uint8_t (*DuMacSliceCfgReq) ARGS((
1958      Pst           *pst,
1959      MacSliceCfgReq *CfgReq));
1960
1961 /* Slice Cfg Response from MAC to DU APP */
1962 typedef uint8_t (*MacDuSliceCfgRspFunc) ARGS((
1963          Pst           *pst, 
1964          MacSliceCfgRsp   *cfgRsp));
1965
1966 /* Slice ReReCfg Request from DU APP to MAC*/
1967 typedef uint8_t (*DuMacSliceRecfgReq) ARGS((
1968      Pst           *pst,
1969      MacSliceRecfgReq *CfgReq));
1970
1971 /* Slice ReReCfg Response from MAC to DU APP */
1972 typedef uint8_t (*MacDuSliceRecfgRspFunc) ARGS((
1973         Pst           *pst,
1974         MacSliceRecfgRsp   *cfgRsp));
1975
1976 /* Pcch indication from DU APP to MAC*/
1977 typedef uint8_t (*DuMacDlPcchInd) ARGS((
1978      Pst        *pst,
1979      DlPcchInd *pcchInd));
1980
1981 /* UE Reset Request from DU APP to MAC*/
1982 typedef uint8_t (*DuMacUeResetReq) ARGS((
1983      Pst           *pst,
1984      MacUeResetReq *ueReset ));
1985
1986 /* UE Reset Response from MAC to DU APP*/
1987 typedef uint8_t (*MacDuUeResetRspFunc) ARGS((
1988      Pst            *pst,
1989      MacUeResetRsp *resetRsp));
1990
1991 /* UE sync status indication from MAC to DU APP*/
1992 typedef uint8_t (*MacDuUeSyncStatusIndFunc) ARGS((
1993         Pst            *pst,
1994         MacUeSyncStatusInd *syncStatusInd));
1995
1996 uint64_t ueBitMapPerCell[MAX_NUM_CELL]; /* Bit Map to store used/free UE-IDX per Cell */
1997
1998 uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId);
1999 uint8_t unpackMacCellUpInd(DuMacCellUpInd func, Pst *pst, Buffer *mBuf);
2000 uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId);
2001 uint8_t packMacCellStart(Pst *pst, CellStartInfo *cellStartInfo);
2002 uint8_t unpackMacCellStart(DuMacCellStart func, Pst *pst, Buffer *mBuf);
2003 uint8_t MacProcCellStart(Pst *pst, CellStartInfo *cellStartInfo);
2004 uint8_t packMacCellStop(Pst *pst, CellStopInfo *cellStopInfo);
2005 uint8_t unpackMacCellStop(DuMacCellStop func, Pst *pst, Buffer *mBuf);
2006 uint8_t MacProcCellStop(Pst *pst, CellStopInfo *cellStopInfo);
2007 uint8_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
2008 uint8_t unpackDuMacCellCfg(DuMacCellCfgReq func,  Pst *pst,  Buffer *mBuf);
2009 uint8_t MacProcCellCfgReq(Pst *pst, MacCellCfg *macCellCfg);
2010 uint8_t packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
2011 uint8_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf);
2012 uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
2013 uint8_t packMacStopInd(Pst *pst, OduCellId *cellId);
2014 uint8_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf);
2015 uint8_t duHandleStopInd(Pst *pst, OduCellId *cellId);
2016 uint8_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
2017 uint8_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf);
2018 uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
2019 uint8_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
2020 uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf);
2021 uint8_t MacProcDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
2022 uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg);
2023 uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf);
2024 uint8_t MacProcUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg);
2025 uint8_t sendStopIndMacToDuApp(uint16_t cellId);
2026 uint8_t packDuMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp);
2027 uint8_t unpackDuMacUeCreateRsp(MacDuUeCreateRspFunc func, Pst *pst, Buffer *mBuf);
2028 uint8_t DuProcMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp);
2029 uint8_t packDuMacUeReconfigReq(Pst *pst, MacUeRecfg *ueRecfg);
2030 uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf);
2031 uint8_t MacProcUeReconfigReq(Pst *pst, MacUeRecfg *ueRecfg);
2032 uint8_t packDuMacUeRecfgRsp(Pst *pst, MacUeRecfgRsp *recfgRsp);
2033 uint8_t unpackDuMacUeRecfgRsp(MacDuUeRecfgRspFunc func, Pst *pst, Buffer *mBuf);
2034 uint8_t DuProcMacUeRecfgRsp(Pst *pst, MacUeRecfgRsp *recfgRsp);
2035 uint8_t packDuMacRachRsrcReq(Pst *pst, MacRachRsrcReq *rachRsrcReq);
2036 uint8_t unpackMacRachRsrcReq(DuMacRachRsrcReq func, Pst *pst, Buffer *mBuf);
2037 uint8_t MacProcRachRsrcReq(Pst *pst, MacRachRsrcReq *rachRsrcReq);
2038 uint8_t packDuMacRachRsrcRsp(Pst *pst, MacRachRsrcRsp *rachRsrcRsp);
2039 uint8_t unpackDuMacRachRsrcRsp(MacDuRachRsrcRspFunc func, Pst *pst, Buffer *mBuf);
2040 uint8_t DuProcMacRachRsrcRsp(Pst *pst, MacRachRsrcRsp *rachRsrcRsp);
2041 uint8_t packDuMacRachRsrcRel(Pst *pst, MacRachRsrcRel *rachRsrcRel);
2042 uint8_t unpackMacRachRsrcRel(DuMacRachRsrcRel func, Pst *pst, Buffer *mBuf);
2043 uint8_t MacProcRachRsrcRel(Pst *pst, MacRachRsrcRel *rachRsrcRel);
2044 uint8_t packDuMacUeDeleteReq(Pst *pst, MacUeDelete *ueDelete);
2045 uint8_t MacProcUeDeleteReq(Pst *pst,  MacUeDelete *ueDelete);
2046 uint8_t unpackMacUeDeleteReq(DuMacUeDeleteReq func, Pst *pst, Buffer *mBuf);
2047 uint8_t packDuMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp);
2048 uint8_t DuProcMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp);
2049 uint8_t unpackDuMacUeDeleteRsp(MacDuUeDeleteRspFunc func, Pst *pst, Buffer *mBuf);
2050 uint8_t packDuMacCellDeleteReq(Pst *pst, MacCellDeleteReq *cellDelete);
2051 uint8_t MacProcCellDeleteReq(Pst *pst, MacCellDeleteReq *cellDelete);
2052 uint8_t unpackMacCellDeleteReq(DuMacCellDeleteReq func, Pst *pst, Buffer *mBuf);
2053 uint8_t packDuMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp);
2054 uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp);
2055 uint8_t unpackDuMacCellDeleteRsp(MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf);
2056 uint8_t packDuMacSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq);
2057 uint8_t MacProcSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq);
2058 uint8_t unpackMacSliceCfgReq(DuMacSliceCfgReq func, Pst *pst, Buffer *mBuf);
2059 uint8_t DuProcMacSliceCfgRsp(Pst *pst,  MacSliceCfgRsp *cfgRsp);
2060 uint8_t packDuMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp);
2061 uint8_t unpackDuMacSliceCfgRsp(MacDuSliceCfgRspFunc func, Pst *pst, Buffer *mBuf);
2062 uint8_t packDuMacSliceRecfgReq(Pst *pst, MacSliceRecfgReq *sliceRecfgReq);
2063 uint8_t MacProcSliceRecfgReq(Pst *pst, MacSliceRecfgReq *sliceRecfgReq);
2064 uint8_t unpackMacSliceRecfgReq(DuMacSliceRecfgReq func, Pst *pst, Buffer *mBuf);
2065 uint8_t DuProcMacSliceRecfgRsp(Pst *pst,  MacSliceRecfgRsp *sliceRecfgRsp);
2066 uint8_t packDuMacSliceRecfgRsp(Pst *pst, MacSliceRecfgRsp *sliceRecfgRsp);
2067 uint8_t unpackDuMacSliceRecfgRsp(MacDuSliceRecfgRspFunc func, Pst *pst, Buffer *mBuf);
2068 uint8_t duHandleSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo);
2069 uint8_t packMacSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo);
2070 uint8_t unpackDuMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf);
2071 uint8_t packDuMacDlPcchInd(Pst *pst, DlPcchInd *pcchInd);
2072 uint8_t MacProcDlPcchInd(Pst *pst, DlPcchInd *pcchInd);
2073 uint8_t unpackMacDlPcchInd(DuMacDlPcchInd func, Pst *pst, Buffer *mBuf);
2074 int8_t getFreeBitFromUeBitMap(uint16_t cellId);
2075 void unsetBitInUeBitMap(uint16_t cellId, uint8_t bitPos);
2076 uint8_t packDuMacUeResetReq(Pst *pst, MacUeResetReq *ueReset);
2077 uint8_t MacProcUeResetReq(Pst *pst,  MacUeResetReq *ueReset);
2078 uint8_t unpackMacUeResetReq(DuMacUeResetReq func, Pst *pst, Buffer *mBuf);
2079 uint8_t packDuMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp);
2080 uint8_t DuProcMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp);
2081 uint8_t unpackDuMacUeResetRsp(MacDuUeResetRspFunc func, Pst *pst, Buffer *mBuf);
2082 uint8_t packDuMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd);
2083 uint8_t DuProcMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd);
2084 uint8_t unpackDuMacUeSyncStatusInd(MacDuUeSyncStatusIndFunc func, Pst *pst, Buffer *mBuf);
2085 uint8_t packDuMacDlBroadcastReq(Pst *pst, MacDlBroadcastReq *dlBroadcastReq);
2086 uint8_t MacProcDlBroadcastReq(Pst *pst,  MacDlBroadcastReq *dlBroadcastReq);
2087 uint8_t unpackMacDlBroadcastReq(DuMacDlBroadcastReq func, Pst *pst, Buffer *mBuf);
2088 #endif
2089
2090
2091 /**********************************************************************
2092   End of file
2093  **********************************************************************/