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