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