Merge "[Epic-ID: ODUHIGH-488][Task-ID: ODUHIGH-501] Ue Create and Rsp correction...
[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
660 typedef struct cellCfg
661 {
662    MacOpState      opState;
663    MacAdminState   adminState;
664    MacCellState    cellState;
665    PlmnInfoList plmnInfoList[MAX_PLMN];   /* Consits of PlmnId and Snssai list */
666    uint32_t     phyCellId;                /* Physical cell id */
667    uint32_t     tac;
668    uint32_t     ssbFreq;
669    uint16_t     subCarrSpacing;
670    DuplexMode   dupType;          /* Duplex type: TDD/FDD */
671    uint8_t      numerology;       /* Supported numerology */
672    Sib1CellCfg  sib1Cfg;          /* SIB1 config */
673 }CellCfg;
674
675 typedef struct ssbCfg
676 {
677    uint32_t    ssbPbchPwr;       /* SSB block power */
678    uint8_t     scsCmn;           /* subcarrier spacing for common */
679    uint16_t    ssbOffsetPointA;  /* SSB subcarrier offset from point A */
680    SSBPeriod   ssbPeriod;        /* SSB Periodicity in msec */
681    uint8_t     ssbScOffset;       /* Subcarrier Offset */
682    uint32_t    ssbMask[SSB_MASK_SIZE];      /* Bitmap for actually transmitted SSB. */
683    uint8_t     beamId[NUM_SSB];
684    BetaPss     betaPss;
685    BchPduOpt   bchPayloadFlag;   /* Options for generation of payload */
686    uint8_t     mibPdu[3];           /* MIB payload */
687    uint8_t     dmrsTypeAPos;     /* DMRS Type A position */
688 }SsbCfg;
689
690 typedef struct fdmInfo
691 {
692    uint16_t   rootSeqIdx;        /* Root sequence index */
693    uint8_t    numRootSeq;        /* Number of root sequences required for FD */
694    uint16_t   k1;                /* Frequency Offset for each FD */
695    uint8_t    zeroCorrZoneCfg;   /* Zero correlation zone cofig */
696 }PrachFdmInfo;
697
698 typedef struct prachCfg
699 {
700    PrachSeqLen   prachSeqLen;         /* RACH Sequence length: Long/short */
701    uint8_t       prachSubcSpacing;    /* Subcarrier spacing of RACH */
702    uint8_t       msg1Fdm;             /* Number of RACH frequency domain occasions/ PRACH FDM (1,2,4,8) */
703    uint8_t       prachCfgIdx;         /* PRACH Cfg Index */
704    PrachFdmInfo  fdm[8];              /* FDM info */
705    RstSetCfg     prachRstSetCfg;      /* PRACH restricted set config */
706    uint8_t       ssbPerRach;          /* SSB per RACH occassion */
707    uint8_t       totalNumRaPreamble;  /* Total number of RA preambles */
708    uint8_t       numCbPreamblePerSsb; /* Number of CB preamble per SSB */
709    uint16_t      msg1FreqStart;       /* Msg1-FrequencyStart */
710    uint8_t       raContResTmr;        /* RA Contention Resoultion Timer */
711    uint8_t       rsrpThreshSsb;       /* RSRP Threshold SSB */
712    uint8_t       raRspWindow;         /* RA Response Window */
713 }PrachCfg;
714
715 typedef struct bwpParams
716 {
717    uint16_t firstPrb;
718    uint16_t numPrb;
719    uint8_t  scs;
720    uint8_t  cyclicPrefix;
721 }BwpParams;
722
723 typedef struct candidatesInfo
724 {
725    uint8_t aggLevel1;
726    uint8_t aggLevel2;
727    uint8_t aggLevel4;
728    uint8_t aggLevel8;
729    uint8_t aggLevel16;
730 }CandidatesInfo;
731
732 typedef struct searchSpaceCfg
733 {
734    uint8_t searchSpaceId;
735    uint8_t coresetId;
736    uint16_t monitoringSlot;
737    uint16_t duration;
738    uint16_t monitoringSymbol;
739    CandidatesInfo candidate;
740 }SearchSpaceCfg;
741
742 typedef struct pdcchConfigCommon
743 {
744    /* only one search space is configured during SIB1 */
745    SearchSpaceCfg commonSearchSpace;
746    uint8_t raSearchSpaceId;
747 }PdcchConfigCommon;
748
749 typedef struct pdschCfgCommTimeDomRsrcAlloc
750 {
751    uint8_t k0;
752    uint8_t mappingType;
753    uint8_t startSymbol;
754    uint8_t lengthSymbol;
755 }PdschCfgCommTimeDomRsrcAlloc;
756
757 typedef struct pdschConfigCommon
758 {
759    uint8_t  numTimeDomAlloc;
760    /* PDSCH time domain DL resource allocation list */
761    PdschCfgCommTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_DL_ALLOC]; 
762 }PdschConfigCommon;
763
764 typedef struct pucchConfigCommon
765 {
766    uint8_t pucchResourceCommon;
767    uint8_t pucchGroupHopping;
768 }PucchConfigCommon;
769
770 /* PUSCH Time Domain Resource Allocation */
771 typedef struct puschTimeDomRsrcAlloc
772 {
773    uint8_t             k2;
774    CommonMappingType   mappingType;
775    uint8_t             startSymbol;
776    uint8_t             symbolLength;
777    uint8_t             startSymbolAndLength;
778 }PuschTimeDomRsrcAlloc;
779
780
781 typedef struct puschConfigCommon
782 {
783    /* PUSCH-TimeDomainResourceAllocation info */
784    uint8_t                 numTimeDomRsrcAlloc;
785    PuschTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
786 }PuschConfigCommon;
787
788 typedef struct bwpDlConfig
789 {
790    BwpParams         bwp;
791    PdcchConfigCommon pdcchCommon;
792    PdschConfigCommon pdschCommon;
793 }BwpDlConfig;
794
795 typedef struct bwpUlConfig
796 {
797    BwpParams         bwp;
798    // rach config common sent in PrachCfg
799    PucchConfigCommon pucchCommon;
800    PuschConfigCommon puschCommon;
801 }BwpUlConfig;
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 macCellCfg
864 {
865    uint16_t         cellId;           /* Cell Id */
866    CarrierCfg       carrCfg;          /* Carrier configuration */
867    CellCfg          cellCfg;          /* Cell Configuration*/
868    SsbCfg           ssbCfg;           /* SSB configuration */          
869    PrachCfg         prachCfg;         /* PRACH Configuration */
870 #ifdef NR_TDD
871    TDDCfg           tddCfg;           /* TDD periodicity and slot configuration */
872 #endif
873    BwpDlConfig      initialDlBwp;     /* Initial DL BWP */
874    BwpUlConfig      initialUlBwp;     /* Initial UL BWP */
875    PrecodingConf    precodingConf;
876    BeamformingConf  beamCfg;
877 }MacCellCfg;
878
879 typedef struct macCellCfgCfm
880 {
881    uint16_t       cellId;
882    uint8_t        rsp; 
883 }MacCellCfgCfm;
884
885 typedef struct ulCcchInd
886 {
887    uint16_t cellId;
888    uint16_t crnti;
889    uint16_t ulCcchMsgLen;
890    uint8_t  *ulCcchMsg;
891 }UlCcchIndInfo;
892
893 typedef struct dlCcchInd
894 {
895    uint16_t      cellId;
896    uint16_t      crnti;
897    DlCcchMsgType msgType;
898    uint16_t      dlCcchMsgLen;
899    uint8_t       *dlCcchMsg;
900 }DlCcchIndInfo;
901
902 typedef struct bsrTmrCfg
903 {
904    uint16_t     periodicTimer;
905    uint16_t     retxTimer;
906    uint16_t     srDelayTimer;
907 }BsrTmrCfg;
908
909
910 /* Info of Scheduling Request to Add/Modify */
911 typedef struct schedReqInfo
912 {
913    uint8_t         schedReqId;
914    SrProhibitTimer srProhibitTmr;
915    SrTransMax      srTransMax;
916 }SchedReqInfo;
917
918 /* Scheduling Request Configuration */
919 typedef struct schedReqCfg
920 {
921    uint8_t       addModListCount;
922    SchedReqInfo  addModList[MAX_NUM_SR_CFG_PER_CELL_GRP];   /* List of Scheduling req to be added/modified */
923    uint8_t       relListCount;
924    uint8_t       relList[MAX_NUM_SR_CFG_PER_CELL_GRP];      /* list of scheduling request Id to be deleted */
925 }SchedReqCfg;
926
927 typedef struct tagInfo
928 {
929    uint8_t tagId;
930    TimeAlignmentTimer timeAlignTimer;
931 }TagInfo;
932
933 typedef struct tagCfg
934 {
935    uint8_t      addModListCount;
936    TagInfo      addModList[MAC_NUM_TAGS];  /* List of Tag to Add/Modify */
937    uint8_t      relListCount;
938    uint8_t      relList[MAC_NUM_TAGS];     /* list of Tag Id to release */
939 }TagCfg;
940
941 typedef struct phrCfg
942 {
943    PhrPeriodicTimer periodicTimer;
944    PhrProhibitTimer prohibitTimer; 
945    PhrTxPwrFactorChange txPowerFactor;
946    bool     multiplePHR;       
947    bool     dummy;
948    bool     phrType2OtherCell;
949    PhrModeOtherCG phrOtherCG;
950 }PhrCfg;
951
952 typedef struct macCellGrpCfg
953 {
954    SchedReqCfg schReqCfg;
955    TagCfg      tagCfg;
956    BsrTmrCfg   bsrTmrCfg;
957    bool        phrCfgSetupPres;   /* true/false: phrCfgSetup/phrCfgRelease */
958    PhrCfg      phrCfg;
959 #ifdef NR_DRX
960    bool        drxCfgPresent;
961    DrxCfg      drxCfg;
962 #endif
963 }MacCellGrpCfg;
964
965 typedef struct phyCellGrpCfg
966 {
967    PdschHarqAckCodebook  pdschHarqAckCodebook;
968    uint8_t    pNrFr1;
969 }PhyCellGrpCfg;
970
971 /* Control resource set info */
972 typedef struct controlRsrcSet
973 {
974    uint8_t     cRSetId;                /* Control resource set id */
975    uint8_t     freqDomainRsrc[FREQ_DOM_RSRC_SIZE];  /* Frequency domain resource */
976    uint8_t     duration;
977    REGMappingType cceRegMappingType;
978    PrecoderGranul precoderGranularity;
979    uint16_t    dmrsScramblingId;
980 }ControlRsrcSet;
981
982 /* Search Space info */
983 typedef struct searchSpace
984 {
985    uint8_t     searchSpaceId;
986    uint8_t     cRSetId;
987    MSlotPeriodAndOffset  mSlotPeriodicityAndOffset;
988    uint8_t     mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
989    AggrLevel   numCandidatesAggLevel1;      /* Number of candidates for aggregation level 1 */
990    AggrLevel   numCandidatesAggLevel2;      /* Number of candidates for aggregation level 2 */
991    AggrLevel   numCandidatesAggLevel4;      /* Number of candidates for aggregation level 4 */
992    AggrLevel   numCandidatesAggLevel8;      /* Number of candidates for aggregation level 8 */
993    AggrLevel   numCandidatesAggLevel16;     /* Number of candidates for aggregation level 16 */
994    SearchSpaceType searchSpaceType;
995    uint8_t     ueSpecificDciFormat;
996 }SearchSpace;
997
998 /* PDCCH cofniguration */
999 typedef struct pdcchConfig
1000 {
1001    uint8_t           numCRsetToAddMod;
1002    ControlRsrcSet    cRSetToAddModList[MAX_NUM_CRSET];           /* List of control resource set to add/modify */
1003    uint8_t           numCRsetToRel;
1004    uint8_t           cRSetToRelList[MAX_NUM_CRSET];              /* List of control resource set to release */
1005    uint8_t           numSearchSpcToAddMod;
1006    SearchSpace       searchSpcToAddModList[MAX_NUM_SEARCH_SPC];  /* List of search space to add/modify */
1007    uint8_t           numSearchSpcToRel;
1008    uint8_t           searchSpcToRelList[MAX_NUM_SEARCH_SPC];     /* List of search space to release */
1009 }PdcchConfig;
1010
1011 /* PDSCH time domain resource allocation */
1012 typedef struct pdschTimeDomRsrcAlloc
1013 {
1014    uint8_t           *k0;
1015    CommonMappingType mappingType;
1016    uint8_t           startSymbol;
1017    uint8_t           symbolLength;
1018    uint8_t           startSymbolAndLength;
1019 }PdschTimeDomRsrcAlloc;
1020
1021
1022 typedef struct pdschBundling
1023 {
1024    struct staticBundling
1025    {
1026      BundlingSizeSet2 size;
1027    }StaticBundling;
1028    struct dynamicBundling
1029    {
1030      BundlingSizeSet1 sizeSet1;
1031      BundlingSizeSet2 sizeSet2;
1032    }DynamicBundling;
1033 }PdschBundling;
1034
1035 /* DMRS downlink configuration */
1036 typedef struct dmrsDlCfg
1037 {
1038    AddPosType  addPos;       /* DMRS additional position */
1039 }DmrsDlCfg;
1040
1041 /* PDSCH Configuration */
1042 typedef struct pdschConfig
1043 {
1044    DmrsDlCfg               dmrsDlCfgForPdschMapTypeA;
1045    ResAllocType            resourceAllocType;
1046    uint8_t                 numTimeDomRsrcAlloc;
1047    PdschTimeDomRsrcAlloc   timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
1048    RBGSize                 rbgSize;
1049    CodeWordsSchedDci       numCodeWordsSchByDci;                    /* Number of code words scheduled by DCI */
1050    BundlingType            bundlingType;
1051    PdschBundling           bundlingInfo;
1052 }PdschConfig;
1053
1054 /* Initial Downlink BWP */
1055 typedef struct initialDlBwp
1056 {
1057    bool          pdcchPresent;
1058    PdcchConfig   pdcchCfg;
1059    bool          pdschPresent;
1060    PdschConfig   pdschCfg;
1061 }InitialDlBwp;
1062
1063 /*Spec 38.331 "SPS-Config'*/
1064 typedef struct spsConfig
1065 {
1066    uint16_t     periodicity;
1067    uint8_t      numOfHqProcess;
1068    uint8_t      n1PucchAN;
1069    McsTable     mcsTable;
1070 }SpsConfig;
1071
1072 typedef uint8_t RadioLinkMonitoringRsId;
1073
1074 typedef struct radioLinkMonRS
1075 {
1076    RadioLinkMonitoringRsId radioLinkMonitoringRsId;
1077    PurposeOfFailureDet      purpose; 
1078    union
1079    {
1080       uint8_t ssbIndx;
1081       uint8_t nzpCsiRsResId;
1082    }detectionRes;
1083 }RadioLinkMonRS;
1084
1085 typedef struct radioLinkConfig
1086 {
1087    RadioLinkMonRS             failurDetResAddModList[1];
1088    RadioLinkMonitoringRsId   failurDetResRelList[1];
1089    uint8_t                    beamFailureInstanceMaxCount;
1090    uint8_t                    beamFailureDetectionTimer;
1091 }RadioLinkConfig;
1092
1093 /* Spec 38.331, 'BWP-DownlinkDedicated'*/
1094 typedef struct bwpDlCfgDed
1095 {
1096   PdcchConfig     pdcchCfgDed;
1097   PdschConfig     pdschCfgDed;
1098   SpsConfig       spsCfgDed;
1099   RadioLinkConfig radioLnkMonCfgDed;
1100 }BwpDlCfgDed;
1101
1102 /* Downlink BWP information */
1103 typedef struct dlBwpInfo
1104 {
1105    uint8_t          bwpId;
1106    BwpDlConfig      bwpCommon;
1107    BwpDlCfgDed      bwpDedicated;
1108 }DlBwpInfo;
1109
1110 /* PDCCH Serving Cell configuration */
1111 typedef struct pdschServCellCfg
1112 {
1113    uint8_t              *maxMimoLayers;           
1114    NumHarqProcForPdsch  numHarqProcForPdsch;
1115    MaxCodeBlkGrpPerTB   *maxCodeBlkGrpPerTb;
1116    bool                 *codeBlkGrpFlushInd;
1117    PdschXOverhead       *xOverhead;
1118 }PdschServCellCfg;
1119
1120 /* PUCCH Configuration */
1121
1122 typedef struct pucchResrcSetInfo
1123 {
1124    uint8_t resrcSetId;
1125    uint8_t resrcListCount;
1126    uint8_t resrcList[MAX_NUM_PUCCH_PER_RESRC_SET];
1127    uint8_t maxPayLoadSize;
1128 }PucchResrcSetInfo;
1129
1130 typedef struct pucchResrcSetCfg
1131 {
1132    uint8_t resrcSetToAddModListCount;
1133    PucchResrcSetInfo resrcSetToAddModList[MAX_NUM_PUCCH_RESRC_SET];
1134    uint8_t resrcSetToRelListCount;
1135    uint8_t resrcSetToRelList[MAX_NUM_PUCCH_RESRC];
1136 }PucchResrcSetCfg;
1137
1138 typedef struct pucchFormat0
1139 {
1140    uint8_t initialCyclicShift;
1141    uint8_t numSymbols;
1142    uint8_t startSymbolIdx;
1143 }PucchFormat0;
1144
1145 typedef struct pucchFormat1
1146 {
1147    uint8_t initialCyclicShift;
1148    uint8_t numSymbols;
1149    uint8_t startSymbolIdx;
1150    uint8_t timeDomOCC;
1151 }PucchFormat1;
1152
1153 typedef struct pucchFormat2_3
1154 {
1155    uint8_t numPrbs;
1156    uint8_t numSymbols;
1157    uint8_t startSymbolIdx;
1158 }PucchFormat2_3;
1159
1160 typedef struct pucchFormat4
1161 {
1162    uint8_t numSymbols;
1163    uint8_t occLen;
1164    uint8_t occIdx;
1165    uint8_t startSymbolIdx;
1166 }PucchFormat4;
1167
1168 typedef struct pucchResrcInfo
1169 {
1170    uint8_t  resrcId;
1171    uint16_t startPrb;
1172    uint8_t  intraFreqHop;
1173    uint16_t secondPrbHop;
1174    uint8_t  pucchFormat;
1175    union
1176    {
1177       PucchFormat0   *format0; 
1178       PucchFormat1   *format1;
1179       PucchFormat2_3 *format2;
1180       PucchFormat2_3 *format3;
1181       PucchFormat4   *format4;
1182    }PucchFormat;
1183 }PucchResrcInfo;
1184
1185 typedef struct pucchResrcCfg
1186 {
1187    uint8_t resrcToAddModListCount;
1188    PucchResrcInfo resrcToAddModList[MAX_NUM_PUCCH_RESRC];
1189    uint8_t resrcToRelListCount;
1190    uint8_t resrcToRelList[MAX_NUM_PUCCH_RESRC];
1191 }PucchResrcCfg;
1192
1193 typedef struct pucchFormatCfg
1194 {
1195    bool interSlotFreqHop;
1196    bool addDmrs;
1197    uint8_t maxCodeRate;
1198    uint8_t numSlots;
1199    bool    pi2BPSK;
1200    bool    harqAckCSI;
1201 }PucchFormatCfg;
1202
1203 typedef struct schedReqResrcInfo
1204 {
1205    uint8_t resrcId;
1206    uint8_t requestId;
1207    uint8_t periodicity;
1208    uint16_t offset;
1209    uint8_t resrc;
1210 }SchedReqResrcInfo;
1211
1212 typedef struct pucchSchedReqCfg
1213 {
1214    uint8_t           schedAddModListCount;
1215    SchedReqResrcInfo schedAddModList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1216    uint8_t           schedRelListCount;
1217    uint8_t           schedRelList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1218 }PucchSchedReqCfg;
1219
1220 typedef struct spatialRelationInfo
1221 {
1222    uint8_t spatialRelationId;
1223    uint8_t servCellIdx;
1224    uint8_t pathLossRefRSId;
1225    uint8_t p0PucchId;
1226    uint8_t closeLoopIdx;
1227 }SpatialRelationInfo;
1228
1229 typedef struct pucchSpatialCfg
1230 {
1231    uint8_t spatialAddModListCount;
1232    SpatialRelationInfo spatialAddModList[MAX_NUM_SPATIAL_RELATIONS];
1233    uint8_t spatialRelListCount;
1234    uint8_t spatialRelList[MAX_NUM_SPATIAL_RELATIONS];
1235 }PucchSpatialCfg;
1236
1237 typedef struct p0PucchCfg
1238 {
1239    uint8_t p0PucchId;
1240    int     p0PucchVal;
1241 }P0PucchCfg;
1242
1243 typedef struct pathLossRefRSCfg
1244 {
1245    uint8_t pathLossRefRSId;
1246 }PathLossRefRSCfg;
1247
1248 typedef struct pucchMultiCsiCfg
1249 {
1250    uint8_t  multiCsiResrcListCount;
1251    uint8_t  multiCsiResrcList[MAX_NUM_PUCCH_RESRC-1];
1252 }PucchMultiCsiCfg;
1253
1254 typedef struct pucchDlDataToUlAck
1255 {
1256    uint8_t  dlDataToUlAckListCount;
1257    uint8_t  dlDataToUlAckList[MAX_NUM_DL_DATA_TO_UL_ACK];
1258 }PucchDlDataToUlAck;
1259
1260 typedef struct pucchPowerControl
1261 {
1262    int deltaF_Format0;
1263    int deltaF_Format1;
1264    int deltaF_Format2;
1265    int deltaF_Format3;
1266    int deltaF_Format4;
1267    uint8_t p0SetCount;
1268    P0PucchCfg p0Set[MAX_NUM_PUCCH_P0_PER_SET];
1269    uint8_t pathLossRefRSListCount;
1270    PathLossRefRSCfg pathLossRefRSList[MAX_NUM_PATH_LOSS_REF_RS];
1271 }PucchPowerControl;
1272
1273 typedef struct pucchCfg
1274 {
1275    PucchResrcSetCfg  *resrcSet;
1276    PucchResrcCfg     *resrc;
1277    PucchFormatCfg    *format1; 
1278    PucchFormatCfg    *format2; 
1279    PucchFormatCfg    *format3; 
1280    PucchFormatCfg    *format4;
1281    PucchSchedReqCfg  *schedReq;
1282    PucchMultiCsiCfg  *multiCsiCfg;
1283    PucchSpatialCfg   *spatialInfo;
1284    PucchDlDataToUlAck *dlDataToUlAck;
1285    PucchPowerControl *powerControl;
1286 }PucchCfg;
1287
1288 /* Transform precoding disabled */
1289 typedef struct transPrecodDisabled
1290 {
1291    uint16_t   scramblingId0;
1292 }TransPrecodDisabled;
1293
1294 /* DMRS Uplink configuration */
1295 typedef struct dmrsUlCfg
1296 {
1297    AddPosType            addPos;               /* DMRS additional position */
1298    TransPrecodDisabled   transPrecodDisabled;  /* Transform precoding disabled */
1299 }DmrsUlCfg;
1300
1301 /* PUSCH Configuration */
1302 typedef struct puschCfg
1303 {
1304    uint8_t                 dataScramblingId;
1305    DmrsUlCfg               dmrsUlCfgForPuschMapTypeA;
1306    ResAllocType            resourceAllocType;
1307    uint8_t                 numTimeDomRsrcAlloc;
1308    PuschTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1309    TransformPrecoder       transformPrecoder;
1310 }PuschCfg;
1311
1312 /* Initial Uplink BWP */
1313 typedef struct initialUlBwp
1314 {
1315    bool       pucchPresent;
1316    PucchCfg   pucchCfg; 
1317    bool       puschPresent;
1318    PuschCfg   puschCfg;
1319 }InitialUlBwp;
1320
1321 typedef struct bwpUlCfgDed
1322 {
1323    PucchCfg   pucchCfg;
1324    PuschCfg   puschCfg;
1325 }BwpUlCfgDed;
1326
1327 /* Uplink BWP information */
1328 typedef struct ulBwpInfo
1329 {
1330    uint8_t          bwpId;
1331    BwpUlConfig      bwpCommon;
1332    BwpUlCfgDed      bwpDed;
1333 }UlBwpInfo;
1334
1335 typedef struct rachCfgGeneric
1336 {
1337    uint8_t      prachCfgIdx;       /* PRACH config idx */
1338    uint8_t      msg1Fdm;           /* PRACH FDM (1,2,4,8) */
1339    uint16_t     msg1FreqStart;     /* Msg1-FrequencyStart */
1340    uint8_t      zeroCorrZoneCfg;   /* Zero correlation zone cofig */
1341    int16_t      preambleRcvdTargetPower; /*Prach Target power received*/
1342    uint8_t      preambleTransMax;  /*Preamble Transmission Max power*/
1343    uint8_t      pwrRampingStep;    /*Power Ramping Step*/
1344    uint8_t      raRspWindow;       /* RA Response Window */
1345 }RachCfgGeneric;
1346
1347 typedef struct raPrioritization
1348 {
1349    uint8_t powerRampingStepHighPriority;
1350    uint8_t scalingFactorBI;
1351 }RaPrioritization;
1352
1353 typedef struct bfrCsiRsRes
1354 {
1355    uint8_t csrRsIndex;
1356    uint8_t raOccList;
1357    uint8_t raPreambleIndex;
1358 }BfrCsiRsRes;
1359
1360 typedef struct bfrSsbRes
1361 {
1362    uint16_t ssbIndex;
1363    uint8_t raPreambleIndex;
1364 }BfrSsbRes;
1365
1366 typedef struct prachResDedBfr
1367 {
1368    BfrSsbRes    ssb;
1369    BfrCsiRsRes  csiRs;
1370 }PrachResDedBfr;
1371
1372 /*Spec 38.331 'BeamFailureRecoveryConfig' */
1373 typedef struct beamFailRecoveryCfg
1374 {
1375    uint8_t             rootSeqIndexBfr;
1376    RachCfgGeneric      rachCfgBfr;
1377    uint8_t             rsrpThreshSsbBfr;
1378    PrachResDedBfr      candidteBeamRSList;
1379    uint8_t             ssbPerachBfr;
1380    uint8_t             raSsbOccMaskIndex;
1381    uint8_t             recoverySearchSpaceId;
1382    RaPrioritization    raPrioBfr;
1383    uint16_t            bfrTimer;
1384    uint8_t             msg1SubcSpacing;
1385 }BeamFailRecoveryCfg;
1386
1387 /* Serving cell configuration */
1388 typedef struct servCellCfgInfo
1389 {
1390    InitialDlBwp         initDlBwp;
1391    RadioLinkConfig      radioLinkMonConfig;
1392    uint8_t              numDlBwpToAdd;
1393    DlBwpInfo            dlBwpToAddList[MAX_NUM_BWP];
1394    uint8_t              firstActvDlBwpId;
1395    uint8_t              defaultDlBwpId;
1396    uint8_t              *bwpInactivityTmr;
1397    PdschServCellCfg     pdschServCellCfg;
1398    InitialUlBwp         initUlBwp;
1399    BeamFailRecoveryCfg  beamFailureRecoveryCfg;
1400    uint8_t              numUlBwpToAdd;
1401    UlBwpInfo            ulBwpToAddList[MAX_NUM_BWP];
1402    uint8_t              firstActvUlBwpId;
1403 }ServCellCfgInfo;
1404
1405 /* Special cell configuration */
1406 typedef struct spCellCfg
1407 {
1408    uint8_t           servCellIdx;
1409    ServCellCfgInfo   servCellCfg;
1410 }SpCellCfg;
1411
1412 typedef struct bwpRelInfo
1413 {
1414    uint8_t bwpId;
1415 }BwpRelInfo;
1416
1417 /* Serving cell Re-configuration */
1418 typedef struct servCellRecfgInfo
1419 {
1420    InitialDlBwp       initDlBwp;
1421    RadioLinkConfig    radioLinkMonConfig;
1422    uint8_t            numDlBwpToAddOrMod;
1423    DlBwpInfo          dlBwpToAddOrModList[MAX_NUM_BWP];
1424    uint8_t            numDlBwpToRel;
1425    BwpRelInfo         dlBwpToRelList[MAX_NUM_BWP];
1426    uint8_t            firstActvDlBwpId;
1427    uint8_t            defaultDlBwpId;
1428    uint8_t            *bwpInactivityTmr;
1429    PdschServCellCfg   pdschServCellCfg;
1430    InitialUlBwp       initUlBwp;
1431    uint8_t            numUlBwpToAddOrMod;
1432    UlBwpInfo          ulBwpToAddOrModList[MAX_NUM_BWP];
1433    uint8_t            numUlBwpToRel;
1434    BwpRelInfo         ulBwpToRelList[MAX_NUM_BWP];
1435    uint8_t            firstActvUlBwpId;
1436 }ServCellRecfgInfo;
1437
1438 /* Special cell Re-configuration */
1439 typedef struct spCellRecfg 
1440 {
1441    uint8_t             servCellIdx;
1442    ServCellRecfgInfo   servCellCfg;
1443 }SpCellRecfg;
1444
1445 typedef struct ambrCfg
1446 {
1447    uint32_t ulBr;   /* UL Bit rate */
1448 }AmbrCfg;
1449
1450 typedef struct nonDynFiveQi
1451 {
1452    uint16_t   fiveQi;
1453    uint8_t    priorLevel;
1454    uint16_t   avgWindow;
1455    uint16_t   maxDataBurstVol;
1456 }NonDynFiveQi;
1457
1458 typedef struct dynFiveQi
1459 {
1460    uint8_t    priorLevel;
1461    uint16_t   packetDelayBudget;
1462    uint8_t    packetErrRateScalar;
1463    uint8_t    packetErrRateExp;
1464    uint16_t   fiveQi;
1465    uint8_t    delayCritical;
1466    uint16_t   avgWindow;
1467    uint16_t   maxDataBurstVol;
1468 }DynFiveQi;
1469
1470 typedef struct ngRanAllocAndRetPri
1471 {
1472    uint8_t priorityLevel;
1473    uint8_t preEmptionCap;
1474    uint8_t preEmptionVul;
1475 }NgRanAllocAndRetPri;
1476
1477 typedef struct grbQosInfo
1478 {
1479    uint32_t maxFlowBitRateDl;
1480    uint32_t maxFlowBitRateUl;
1481    uint32_t guarFlowBitRateDl;
1482    uint32_t guarFlowBitRateUl;
1483 }GrbQosInfo;
1484
1485 typedef struct drbQos
1486 {
1487    QosType  fiveQiType;   /* Dynamic or non-dynamic */ 
1488    union
1489    {
1490       NonDynFiveQi   nonDyn5Qi;
1491       DynFiveQi      dyn5Qi;
1492    }u;
1493    NgRanAllocAndRetPri ngRanRetPri;
1494    GrbQosInfo grbQosInfo;
1495    uint16_t             pduSessionId;
1496    uint32_t             ulPduSessAggMaxBitRate;
1497 }DrbQosInfo;
1498
1499 typedef struct ulLcCfg
1500 {
1501    uint8_t priority;
1502    uint8_t lcGroup;
1503    uint8_t schReqId;
1504    PBitRate pbr;        // prioritisedBitRate
1505    BucketSizeDur bsd;        // bucketSizeDuration
1506 }UlLcCfg;
1507
1508 typedef struct dlLcCfg
1509 {
1510    LcPriority lcp;      // logical Channel Prioritization
1511 }DlLcCfg;
1512
1513 typedef struct lcCfg
1514 {
1515    uint8_t lcId;
1516    Snssai  *snssai;
1517    DrbQosInfo *drbQos; 
1518    bool ulLcCfgPres;
1519    UlLcCfg ulLcCfg;
1520    DlLcCfg dlLcCfg;
1521 }LcCfg;
1522
1523 typedef struct modulationInfo
1524 {
1525    uint8_t     modOrder;    /* Modulation order */
1526    uint8_t     mcsIndex;    /* MCS Index */
1527    McsTable    mcsTable;    /* MCS table */
1528 }ModulationInfo;
1529
1530 typedef struct macUeCreateReq
1531 {
1532    uint16_t               cellId;
1533    uint8_t                ueId;
1534    uint8_t                beamIdx; 
1535    uint16_t               crnti;
1536    bool                   macCellGrpCfgPres;
1537    MacCellGrpCfg          macCellGrpCfg;
1538    bool                   phyCellGrpCfgPres;
1539    PhyCellGrpCfg          phyCellGrpCfg;
1540    bool                   spCellCfgPres;
1541    SpCellCfg              spCellCfg;
1542    AmbrCfg                *ambrCfg;
1543    ModulationInfo         dlModInfo;    /* DL modulation info */ 
1544    ModulationInfo         ulModInfo;    /* UL modulation info */
1545    uint8_t                numLcs;
1546    LcCfg                  lcCfgList[MAX_NUM_LC];
1547 }MacUeCreateReq;
1548
1549 /* UE Re-configuration */
1550 typedef struct macUeRecfg
1551 {
1552    uint16_t        cellId;
1553    uint8_t         ueId;
1554    uint8_t         beamIdx;
1555    uint16_t        crnti;
1556    bool            macCellGrpRecfgPres;
1557    MacCellGrpCfg   macCellGrpRecfg;
1558    bool            phyCellGrpRecfgPres;
1559    PhyCellGrpCfg   phyCellGrpRecfg;
1560    bool            spCellRecfgPres;
1561    SpCellRecfg     spCellRecfg;
1562    AmbrCfg         *ambrRecfg;
1563    ModulationInfo  dlModInfo;
1564    ModulationInfo  ulModInfo;
1565    uint8_t         numLcsToAdd;
1566    LcCfg           lcCfgAdd[MAX_NUM_LC];
1567    uint8_t         numLcsToDel;
1568    uint8_t         lcIdToDel[MAX_NUM_LC];
1569    uint8_t         numLcsToMod;
1570    LcCfg           lcCfgMod[MAX_NUM_LC];
1571    DataTransmissionAction transmissionAction;
1572 #ifdef NR_DRX   
1573    bool            drxConfigIndicatorRelease;
1574 #endif
1575 }MacUeRecfg;
1576
1577 typedef struct nrcgi
1578 {
1579    Plmn      plmn;
1580    uint16_t  cellId;
1581 }Nrcgi;
1582
1583 typedef struct srbFailInfo
1584 {
1585    uint8_t       srbId;
1586    FailureCause  cause;
1587 }SRBFailInfo;
1588
1589 typedef struct drbFailInfo
1590 {
1591    uint8_t       drbId;
1592    FailureCause  cause;
1593 }DRBFailInfo;
1594
1595 typedef struct sCellFailInfo
1596 {
1597    Nrcgi         nrcgi;
1598    FailureCause  cause;
1599 }SCellFailInfo;
1600
1601 typedef struct macUeCreateRsp
1602 {
1603    uint16_t       cellId;
1604    uint16_t       ueId;
1605    MacRsp         result;
1606    uint8_t        numSRBFailed;   /* valid values : 0 to MAX_NUM_SRB */ 
1607    SRBFailInfo    *failedSRBlisti;
1608    uint8_t        numDRBFailed;   /* valid values : 0 to MAX_NUM_DRB */
1609    DRBFailInfo    *failedDRBlist;
1610    uint8_t        numSCellFailed; /* valid values : 0 to MAX_NUM_SCELL */
1611    SCellFailInfo  *failedSCellList;
1612    uint8_t        numDRBModFailed;   /* valid values : 0 to MAX_NUM_DRB */
1613    DRBFailInfo    *failedDRBModlist;
1614 }MacUeCreateRsp;
1615
1616 typedef struct macUeCreateRsp MacUeRecfgRsp;
1617
1618 typedef struct rachRsrcReq
1619 {
1620    uint16_t cellId;
1621    uint16_t ueId;
1622    uint8_t  numSsb;
1623    uint8_t  ssbIdx[MAX_NUM_SSB];
1624 }MacRachRsrcReq;
1625
1626 typedef struct macCfraSsbResource
1627 {
1628    uint8_t  ssbIdx;
1629    uint8_t  raPreambleIdx;
1630 }MacCfraSsbResource;
1631
1632 typedef struct macCfraResource
1633 {
1634    uint8_t   numSsb;
1635    MacCfraSsbResource ssbResource[MAX_NUM_SSB];
1636 }MacCfraResource;
1637
1638 typedef struct macRachRsrcRsp
1639 {
1640    uint16_t   cellId;
1641    uint16_t   ueId;
1642    MacRsp     result;
1643    uint16_t   newCrnti;     /* This parameter maps to 3GPP TS 38.331 newUE-Identity */
1644    MacCfraResource  cfraResource;
1645 }MacRachRsrcRsp;
1646
1647 typedef struct macRachRsrcRel
1648 {
1649    uint16_t cellId;
1650    uint16_t ueId;
1651    uint16_t crnti;
1652 }MacRachRsrcRel;
1653
1654 typedef struct ueDelete
1655 {
1656     uint16_t cellId;
1657     uint8_t  ueId;
1658     uint16_t crnti;
1659 }MacUeDelete;
1660
1661 typedef struct ueDeleteRsp
1662 {
1663    uint16_t cellId;
1664    uint8_t  ueId;
1665    CauseOfResult  status;
1666 }MacUeDeleteRsp;
1667
1668 typedef struct macCellDeleteReq
1669 {
1670    uint16_t cellId;
1671 }MacCellDeleteReq;
1672
1673 typedef struct macCellDeleteRsp
1674 {
1675    uint16_t cellId;
1676    CauseOfResult  status;
1677 }MacCellDeleteRsp;
1678
1679 typedef struct macSliceCfgRsp 
1680 {
1681    Snssai     snssai;
1682    MacRsp     rsp;
1683    CauseOfResult  cause;  
1684 }MacSliceCfgRsp;
1685
1686 typedef struct rrmPolicyRatio
1687 {
1688    uint8_t maxRatio;
1689    uint8_t minRatio;
1690    uint8_t dedicatedRatio;
1691 }RrmPolicyRatio;
1692
1693 typedef struct rrmPolicyMemberList
1694 {
1695    Plmn    plmn;
1696    Snssai  snssai;
1697 }RrmPolicyMemberList;
1698
1699 typedef struct macSliceRrmPolicy
1700 {
1701    ResourceType        resourceType;
1702    uint8_t             numOfRrmPolicyMem;
1703    RrmPolicyMemberList **rRMPolicyMemberList;
1704    RrmPolicyRatio      policyRatio;
1705 }MacSliceRrmPolicy;
1706
1707 typedef struct macSliceCfgReq
1708 {
1709    uint8_t           numOfRrmPolicy;
1710    MacSliceRrmPolicy **listOfRrmPolicy;
1711 }MacSliceCfgReq;
1712
1713 /*As per ORAN-WG8, Slice Cfg and ReCfg are same structures*/
1714 typedef struct macSliceCfgReq MacSliceRecfgReq;
1715 typedef struct macSliceCfgRsp MacSliceRecfgRsp;
1716
1717 /*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.17 DL PCCH Indication */
1718 typedef struct dlPcchInd
1719 {
1720    uint16_t  cellId;
1721    uint16_t  pf;
1722    uint8_t   i_s;
1723    uint16_t  pduLen;
1724    uint8_t  *pcchPdu;
1725 }DlPcchInd;
1726
1727
1728 /*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.1 Cell Start */
1729 typedef struct cellInfo
1730 {
1731     SlotTimingInfo slotInfo;
1732     uint16_t       cellId;
1733 }CellInfo;
1734
1735 typedef struct cellInfo CellStartInfo;
1736 typedef struct cellInfo CellStopInfo;
1737
1738 /*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.12 UE Reset Request */
1739 typedef struct ueReset
1740 {
1741     uint16_t cellId;
1742     uint8_t  ueId;
1743 }MacUeResetReq;
1744
1745 /*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.13 UE Reset Response */
1746 typedef struct ueResetRsp
1747 {
1748    uint16_t cellId;
1749    uint8_t  ueId;
1750    CauseOfResult  status;
1751 }MacUeResetRsp;
1752
1753 /*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.14 UE Sync Status Indication */
1754 typedef struct ueSyncStatusInd
1755 {
1756    uint16_t   cellId;
1757    uint8_t    ueId;
1758    SyncStatus status;
1759 }MacUeSyncStatusInd;
1760
1761 /* The following list of structures is taken from the SI-SchedulingInfo section of specification 33.331. */
1762 typedef struct sibTypeInfo
1763 {
1764    SibType sibType;
1765    uint8_t valueTag;
1766    bool    areaScope;
1767 }SibTypeInfo;
1768
1769 typedef struct sibMappingInfo
1770 {
1771    uint8_t      numSibTypeInfo;
1772    SibTypeInfo  sibTypeInfo[NUM_SIB];
1773 }SibMappingInfo;
1774
1775 typedef struct schedulingInfo 
1776 {
1777    SiBroadcastStatus siBroadcastStatus;
1778    SiPeriodicity     siPeriodicity;
1779    SibMappingInfo    sibMappingInfo;
1780 }SchedulingInfo;
1781
1782 typedef struct rachOccasionsSi
1783 {
1784    RachCfgGeneric     rachConfigSi;
1785    SsbPerRachOccasion ssbPerRachOccasion;
1786 }RachOccasionsSi;
1787
1788 typedef struct siReqRsrc 
1789 {
1790    uint8_t raPreambleStartIndex;
1791    uint8_t raAssociationPeriodIndex;
1792    uint8_t raSsbOccasionMaskIndex; 
1793 }SiReqRsrc;
1794
1795 typedef struct siRequestResource
1796 {
1797    uint8_t    numOfSiReqRsrc;
1798    SiReqRsrc  siReqRsrc[MAX_SI_MESSAGE];
1799 }SiRequestResource;
1800
1801 typedef struct siRequestConfig
1802 {
1803    RachOccasionsSi    rachOccasionsSi;
1804    SiRequestPeriod    siRequestPeriod;
1805    SiRequestResource  siRequestResource;
1806 }SiRequestConfig;
1807
1808 typedef struct schedulingInfoList
1809 {
1810    uint8_t        numSchInfo;
1811    SchedulingInfo schedulingInfo[MAX_SI_MESSAGE];
1812 }SchedulingInfoList;
1813
1814 typedef struct siSchedulingInfo
1815 {
1816    SchedulingInfoList schInfoList;
1817    SiWindowLength     siWindowLength;
1818    SiRequestConfig    siRequestConfig;
1819    SiRequestConfig    siRequestConfigSUL;
1820    uint8_t            *siAreaID;
1821 }SiSchedulingInfo;
1822
1823 /*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.18 DL Broadcast Request  */
1824 typedef struct macDlBroadcastReq
1825 {
1826     uint16_t         cellId;
1827     uint8_t          numSiBlock;
1828     SiSchedulingInfo **siSchedulingInfo;
1829 }MacDlBroadcastReq;
1830
1831 /* DL broadcast req from DU APP to MAC*/
1832 typedef uint8_t (*DuMacDlBroadcastReq) ARGS((
1833          Pst           *pst,
1834          MacDlBroadcastReq *dlBroadcast));
1835
1836 /* Functions for CellUp Ind from MAC to DU APP*/
1837 typedef uint8_t (*DuMacCellUpInd) ARGS((
1838          Pst       *pst,
1839          OduCellId *cellId ));
1840
1841 /* Functions for slot Ind from MAC to DU APP*/
1842 typedef uint8_t (*DuMacSlotInd) ARGS((
1843          Pst       *pst,
1844          SlotTimingInfo *slotIndInfo));
1845
1846 /* Functions for stop Ind from MAC to DU APP*/
1847 typedef uint8_t (*DuMacStopInd) ARGS((
1848          Pst        *pst,
1849          OduCellId  *cellId ));
1850
1851 /* Functions for mac cell start req */
1852 typedef uint8_t (*DuMacCellStart) ARGS((
1853          Pst        *pst, 
1854          CellStartInfo  *cellId));
1855
1856 /* Functions for mac cell stop request */
1857 typedef uint8_t (*DuMacCellStop) ARGS((
1858          Pst        *pst,
1859          CellStopInfo  *cellId ));
1860
1861 /* Function pointers for packing macCellCfg Request and Confirm */
1862 typedef uint8_t (*packMacCellCfgReq) ARGS((
1863          Pst           *pst,
1864          MacCellCfg    *macCellCfg ));
1865
1866 typedef uint8_t (*packMacCellCfgConfirm) ARGS((
1867          Pst              *pst,
1868          MacCellCfgCfm    *macCellCfgCfm ));
1869
1870 typedef uint8_t (*DuMacCellCfgReq) ARGS((
1871          Pst        *pst,        
1872          MacCellCfg *macCellCfg));
1873
1874 typedef uint8_t (*DuMacCellCfgCfm) ARGS((
1875          Pst        *pst,        
1876          MacCellCfgCfm *macCellCfgCfm ));
1877
1878 /* Functions for UL CCCH Ind from MAC to DU APP*/
1879 typedef uint8_t (*DuMacUlCcchInd) ARGS((
1880          Pst           *pst,
1881          UlCcchIndInfo *ulCcchIndInfo ));
1882
1883 /* Functions for DL CCCH Ind from DU APP to MAC*/
1884 typedef uint8_t (*DuMacDlCcchInd) ARGS((
1885          Pst           *pst,
1886          DlCcchIndInfo *dlCcchIndInfo ));
1887
1888 /* UE create Request from DU APP to MAC*/
1889 typedef uint8_t (*DuMacUeCreateReq) ARGS((
1890          Pst           *pst,
1891          MacUeCreateReq      *ueCfg ));
1892
1893 /* UE create Response from MAC to DU APP */
1894 typedef uint8_t (*MacDuUeCreateRspFunc) ARGS((
1895          Pst           *pst, 
1896          MacUeCreateRsp   *cfgRsp));
1897
1898 /* UE Reconfig Request from DU APP to MAC */
1899 typedef uint8_t (*DuMacUeReconfigReq) ARGS((
1900          Pst           *pst,
1901          MacUeRecfg      *ueCfg ));
1902
1903 /* UE Reconfig Response from MAC to DU APP */
1904 typedef uint8_t (*MacDuUeRecfgRspFunc) ARGS((
1905          Pst           *pst, 
1906          MacUeRecfgRsp   *cfgRsp));
1907
1908 /* RACH Resource Request from DU APP to MAC */
1909 typedef uint8_t (*DuMacRachRsrcReq) ARGS((
1910     Pst            *pst,
1911     MacRachRsrcReq *rachRsrcReq));
1912
1913 /* RACH Resource Response from MAC to DU APP */
1914 typedef uint8_t (*MacDuRachRsrcRspFunc) ARGS((
1915     Pst            *pst,
1916     MacRachRsrcRsp *rachRsrcRsp));
1917
1918 /* RACH Resource Release from DU APP to MAC */
1919 typedef uint8_t (*DuMacRachRsrcRel) ARGS((
1920     Pst            *pst,
1921     MacRachRsrcRel *rachRsrcRel));
1922
1923 /* UE Delete Request from DU APP to MAC*/
1924 typedef uint8_t (*DuMacUeDeleteReq) ARGS((
1925      Pst           *pst,
1926      MacUeDelete   *ueDel ));
1927
1928 /* UE Delete Response from MAC to DU APP*/
1929 typedef uint8_t (*MacDuUeDeleteRspFunc) ARGS((
1930      Pst            *pst,
1931      MacUeDeleteRsp *deleteRsp));
1932
1933 /* Cell Delete Request from DU APP to MAC*/
1934 typedef uint8_t (*DuMacCellDeleteReq) ARGS((
1935      Pst           *pst,
1936      MacCellDeleteReq *cellDelete ));
1937
1938 /* Cell Delete Response from MAC to DU APP*/
1939 typedef uint8_t (*MacDuCellDeleteRspFunc) ARGS((
1940      Pst            *pst,
1941      MacCellDeleteRsp *cellDeleteRsp));
1942
1943 /* Slice Cfg Request from DU APP to MAC*/
1944 typedef uint8_t (*DuMacSliceCfgReq) ARGS((
1945      Pst           *pst,
1946      MacSliceCfgReq *CfgReq));
1947
1948 /* Slice Cfg Response from MAC to DU APP */
1949 typedef uint8_t (*MacDuSliceCfgRspFunc) ARGS((
1950          Pst           *pst, 
1951          MacSliceCfgRsp   *cfgRsp));
1952
1953 /* Slice ReReCfg Request from DU APP to MAC*/
1954 typedef uint8_t (*DuMacSliceRecfgReq) ARGS((
1955      Pst           *pst,
1956      MacSliceRecfgReq *CfgReq));
1957
1958 /* Slice ReReCfg Response from MAC to DU APP */
1959 typedef uint8_t (*MacDuSliceRecfgRspFunc) ARGS((
1960         Pst           *pst,
1961         MacSliceRecfgRsp   *cfgRsp));
1962
1963 /* Pcch indication from DU APP to MAC*/
1964 typedef uint8_t (*DuMacDlPcchInd) ARGS((
1965      Pst        *pst,
1966      DlPcchInd *pcchInd));
1967
1968 /* UE Reset Request from DU APP to MAC*/
1969 typedef uint8_t (*DuMacUeResetReq) ARGS((
1970      Pst           *pst,
1971      MacUeResetReq *ueReset ));
1972
1973 /* UE Reset Response from MAC to DU APP*/
1974 typedef uint8_t (*MacDuUeResetRspFunc) ARGS((
1975      Pst            *pst,
1976      MacUeResetRsp *resetRsp));
1977
1978 /* UE sync status indication from MAC to DU APP*/
1979 typedef uint8_t (*MacDuUeSyncStatusIndFunc) ARGS((
1980         Pst            *pst,
1981         MacUeSyncStatusInd *syncStatusInd));
1982
1983 uint64_t ueBitMapPerCell[MAX_NUM_CELL]; /* Bit Map to store used/free UE-IDX per Cell */
1984
1985 uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId);
1986 uint8_t unpackMacCellUpInd(DuMacCellUpInd func, Pst *pst, Buffer *mBuf);
1987 uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId);
1988 uint8_t packMacCellStart(Pst *pst, CellStartInfo *cellStartInfo);
1989 uint8_t unpackMacCellStart(DuMacCellStart func, Pst *pst, Buffer *mBuf);
1990 uint8_t MacProcCellStart(Pst *pst, CellStartInfo *cellStartInfo);
1991 uint8_t packMacCellStop(Pst *pst, CellStopInfo *cellStopInfo);
1992 uint8_t unpackMacCellStop(DuMacCellStop func, Pst *pst, Buffer *mBuf);
1993 uint8_t MacProcCellStop(Pst *pst, CellStopInfo *cellStopInfo);
1994 uint8_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
1995 uint8_t unpackDuMacCellCfg(DuMacCellCfgReq func,  Pst *pst,  Buffer *mBuf);
1996 uint8_t MacProcCellCfgReq(Pst *pst, MacCellCfg *macCellCfg);
1997 uint8_t packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
1998 uint8_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf);
1999 uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
2000 uint8_t packMacStopInd(Pst *pst, OduCellId *cellId);
2001 uint8_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf);
2002 uint8_t duHandleStopInd(Pst *pst, OduCellId *cellId);
2003 uint8_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
2004 uint8_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf);
2005 uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
2006 uint8_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
2007 uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf);
2008 uint8_t MacProcDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
2009 uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg);
2010 uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf);
2011 uint8_t MacProcUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg);
2012 uint8_t sendStopIndMacToDuApp(uint16_t cellId);
2013 uint8_t packDuMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp);
2014 uint8_t unpackDuMacUeCreateRsp(MacDuUeCreateRspFunc func, Pst *pst, Buffer *mBuf);
2015 uint8_t DuProcMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp);
2016 uint8_t packDuMacUeReconfigReq(Pst *pst, MacUeRecfg *ueRecfg);
2017 uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf);
2018 uint8_t MacProcUeReconfigReq(Pst *pst, MacUeRecfg *ueRecfg);
2019 uint8_t packDuMacUeRecfgRsp(Pst *pst, MacUeRecfgRsp *recfgRsp);
2020 uint8_t unpackDuMacUeRecfgRsp(MacDuUeRecfgRspFunc func, Pst *pst, Buffer *mBuf);
2021 uint8_t DuProcMacUeRecfgRsp(Pst *pst, MacUeRecfgRsp *recfgRsp);
2022 uint8_t packDuMacRachRsrcReq(Pst *pst, MacRachRsrcReq *rachRsrcReq);
2023 uint8_t unpackMacRachRsrcReq(DuMacRachRsrcReq func, Pst *pst, Buffer *mBuf);
2024 uint8_t MacProcRachRsrcReq(Pst *pst, MacRachRsrcReq *rachRsrcReq);
2025 uint8_t packDuMacRachRsrcRsp(Pst *pst, MacRachRsrcRsp *rachRsrcRsp);
2026 uint8_t unpackDuMacRachRsrcRsp(MacDuRachRsrcRspFunc func, Pst *pst, Buffer *mBuf);
2027 uint8_t DuProcMacRachRsrcRsp(Pst *pst, MacRachRsrcRsp *rachRsrcRsp);
2028 uint8_t packDuMacRachRsrcRel(Pst *pst, MacRachRsrcRel *rachRsrcRel);
2029 uint8_t unpackMacRachRsrcRel(DuMacRachRsrcRel func, Pst *pst, Buffer *mBuf);
2030 uint8_t MacProcRachRsrcRel(Pst *pst, MacRachRsrcRel *rachRsrcRel);
2031 uint8_t packDuMacUeDeleteReq(Pst *pst, MacUeDelete *ueDelete);
2032 uint8_t MacProcUeDeleteReq(Pst *pst,  MacUeDelete *ueDelete);
2033 uint8_t unpackMacUeDeleteReq(DuMacUeDeleteReq func, Pst *pst, Buffer *mBuf);
2034 uint8_t packDuMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp);
2035 uint8_t DuProcMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp);
2036 uint8_t unpackDuMacUeDeleteRsp(MacDuUeDeleteRspFunc func, Pst *pst, Buffer *mBuf);
2037 uint8_t packDuMacCellDeleteReq(Pst *pst, MacCellDeleteReq *cellDelete);
2038 uint8_t MacProcCellDeleteReq(Pst *pst, MacCellDeleteReq *cellDelete);
2039 uint8_t unpackMacCellDeleteReq(DuMacCellDeleteReq func, Pst *pst, Buffer *mBuf);
2040 uint8_t packDuMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp);
2041 uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp);
2042 uint8_t unpackDuMacCellDeleteRsp(MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf);
2043 uint8_t packDuMacSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq);
2044 uint8_t MacProcSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq);
2045 uint8_t unpackMacSliceCfgReq(DuMacSliceCfgReq func, Pst *pst, Buffer *mBuf);
2046 uint8_t DuProcMacSliceCfgRsp(Pst *pst,  MacSliceCfgRsp *cfgRsp);
2047 uint8_t packDuMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp);
2048 uint8_t unpackDuMacSliceCfgRsp(MacDuSliceCfgRspFunc func, Pst *pst, Buffer *mBuf);
2049 uint8_t packDuMacSliceRecfgReq(Pst *pst, MacSliceRecfgReq *sliceRecfgReq);
2050 uint8_t MacProcSliceRecfgReq(Pst *pst, MacSliceRecfgReq *sliceRecfgReq);
2051 uint8_t unpackMacSliceRecfgReq(DuMacSliceRecfgReq func, Pst *pst, Buffer *mBuf);
2052 uint8_t DuProcMacSliceRecfgRsp(Pst *pst,  MacSliceRecfgRsp *sliceRecfgRsp);
2053 uint8_t packDuMacSliceRecfgRsp(Pst *pst, MacSliceRecfgRsp *sliceRecfgRsp);
2054 uint8_t unpackDuMacSliceRecfgRsp(MacDuSliceRecfgRspFunc func, Pst *pst, Buffer *mBuf);
2055 uint8_t duHandleSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo);
2056 uint8_t packMacSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo);
2057 uint8_t unpackDuMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf);
2058 uint8_t packDuMacDlPcchInd(Pst *pst, DlPcchInd *pcchInd);
2059 uint8_t MacProcDlPcchInd(Pst *pst, DlPcchInd *pcchInd);
2060 uint8_t unpackMacDlPcchInd(DuMacDlPcchInd func, Pst *pst, Buffer *mBuf);
2061 int8_t getFreeBitFromUeBitMap(uint16_t cellId);
2062 void unsetBitInUeBitMap(uint16_t cellId, uint8_t bitPos);
2063 uint8_t packDuMacUeResetReq(Pst *pst, MacUeResetReq *ueReset);
2064 uint8_t MacProcUeResetReq(Pst *pst,  MacUeResetReq *ueReset);
2065 uint8_t unpackMacUeResetReq(DuMacUeResetReq func, Pst *pst, Buffer *mBuf);
2066 uint8_t packDuMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp);
2067 uint8_t DuProcMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp);
2068 uint8_t unpackDuMacUeResetRsp(MacDuUeResetRspFunc func, Pst *pst, Buffer *mBuf);
2069 uint8_t packDuMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd);
2070 uint8_t DuProcMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd);
2071 uint8_t unpackDuMacUeSyncStatusInd(MacDuUeSyncStatusIndFunc func, Pst *pst, Buffer *mBuf);
2072 uint8_t packDuMacDlBroadcastReq(Pst *pst, MacDlBroadcastReq *dlBroadcastReq);
2073 uint8_t MacProcDlBroadcastReq(Pst *pst,  MacDlBroadcastReq *dlBroadcastReq);
2074 uint8_t unpackMacDlBroadcastReq(DuMacDlBroadcastReq func, Pst *pst, Buffer *mBuf);
2075 #endif
2076
2077
2078 /**********************************************************************
2079   End of file
2080  **********************************************************************/