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