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