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