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