RAR and MSG3 scheduling in TDD [Issue-ID: ODUHIGH-342]
[o-du/l2.git] / src / du_app / du_cfg.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 #ifndef __DU_CONFIG_H_
20 #define __DU_CONFIG_H__
21
22 /* MACROS */
23 #define DU_INST 0
24 #define DU_ID 1
25
26 #ifndef O1_ENABLE
27
28 #define DU_IP_V4_ADDR "192.168.130.81"
29 #define CU_IP_V4_ADDR "192.168.130.82"
30 #define RIC_IP_V4_ADDR "192.168.130.80"
31 #define DU_PORT 38472
32 #define CU_PORT 38472
33 #define RIC_PORT 36421
34 #endif
35
36 #define DU_EGTP_PORT  39001
37 #define CU_EGTP_PORT  39002
38 #define NR_PCI 1
39 #define NR_CELL_ID 1
40
41 #define DU_NAME "ORAN_OAM_DU"
42 #define CELL_TYPE SMALL
43
44 //TODO: while testing for TDD, Mu1 and 100 MHz, this flag must be enabled
45 #ifdef NR_TDD
46 #define DUPLEX_MODE DUP_MODE_TDD
47 #define NR_NUMEROLOGY 1
48 #define NR_DL_ARFCN 623400
49 #define NR_UL_ARFCN 623400
50 #define NR_FREQ_BAND 78
51 #else
52 #define DUPLEX_MODE DUP_MODE_FDD
53 #define NR_NUMEROLOGY 0
54 #define NR_DL_ARFCN 428000
55 #define NR_UL_ARFCN 390000
56 #define NR_FREQ_BAND 1
57 #endif
58
59 #define DU_TAC 1
60 #define PLMN_MCC0 3
61 #define PLMN_MCC1 1
62 #define PLMN_MCC2 1
63 #define PLMN_MNC0 4
64 #define PLMN_MNC1 8
65 #define PLMN_MNC2 0
66 #define PLMN_SIZE 3
67
68 /* Spec 38.104 Table 5.4.2.3-1:Applicable NR-ARFCN per operating band in FR1 */
69 #define SUL_ARFCN 100
70 #define SUL_BAND 2
71
72
73
74 #define TIME_CFG 0
75 #define CARRIER_IDX 1
76 #define NUM_TX_ANT 2
77 #define NUM_RX_ANT 2
78 #define FREQ_SHIFT_7P5KHZ FALSE
79 #define SSB_PBCH_PWR 0
80 #define BCH_PAYLOAD PHY_GEN_TIMING_PBCH_BIT
81 #define NORMAL_CYCLIC_PREFIX 0
82 #define OFFSET_TO_POINT_A 24                     /* PRB Offset to Point A */
83 #define BETA_PSS BETA_PSS_0DB  
84 #define SSB_PERIODICITY_5MS   5
85 #define SSB_PERIODICITY_10MS  10
86 #define SSB_PERIODICITY_20MS  20
87 #define SSB_PERIODICITY_40MS  40
88 #define SSB_PERIODICITY_80MS  80
89 #define SSB_PERIODICITY_160MS 160
90 #define SSB_SUBCARRIER_OFFSET 0               
91 #define SSB_MULT_CARRIER_BAND FALSE
92 #define MULT_CELL_CARRIER FALSE
93 #define FREQ_LOC_BW  28875             /* DL frequency location and bandwidth. Spec 38.508 Table 4.3.1.0B-1*/
94 #define UL_P_MAX  23
95 #define DMRS_TYPE_A_POS 2
96 #define NUM_SYMBOLS_PER_SLOT 14       /* Number of symbols within a slot */
97 #define CORESET0_END_PRB   48
98 #define CORESET1_NUM_PRB   24
99
100 /* MACRO defines for PRACH Configuration */
101 #define PRACH_CONFIG_IDX   88
102 #define PRACH_FREQ_START   0
103 #define PRACH_SEQ_LEN SHORT_SEQUENCE
104 #define PRACH_SUBCARRIER_SPACING 0
105 #define PRACH_RESTRICTED_SET_CFG 0
106 #define NUM_PRACH_FDM 1
107 #define ROOT_SEQ_IDX 0
108 #define NUM_ROOT_SEQ 1
109 #define ZERO_CORRELATION_ZONE_CFG 4
110 #define NUM_UNUSED_ROOT_SEQ 0
111 #define UNUSED_ROOT_SEQ 1
112 #define SSB_PER_RACH 1
113 #define PRACH_MULT_CARRIER_BAND FALSE
114 #define PRACH_PREAMBLE_RCVD_TGT_PWR  -74   
115 #define NUM_RA_PREAMBLE  63
116 #define RSRP_THRESHOLD_SSB   31
117
118 #ifdef NR_TDD
119 #define TDD_PERIODICITY TX_PRDCTY_MS_5 
120 #endif
121
122 #define RSS_MEASUREMENT_UNIT DONT_REPORT_RSSI
123 #define RA_CONT_RES_TIMER 64
124 #define RA_RSP_WINDOW 10
125 #define PRACH_RESTRICTED_SET 0 /* Unrestricted */
126 #define ROOT_SEQ_LEN 139
127
128 /* MACRCO Ddefine for PDCCH Configuration */
129 #define PDCCH_SEARCH_SPACE_ID      1    /* Common search space id */
130 #define PDCCH_CTRL_RSRC_SET_ID     0    /* Control resource set id */
131 #define PDCCH_SEARCH_SPACE_ID_SIB1 1    /* Search space id for sib1 */
132 #define PDCCH_SEARCH_SPACE_ID_PAGING 1  /* Search space id for paging */
133 #define PDCCH_SEARCH_SPACE_ID_RA   1    /* Search spaced id for random access */
134 #define PDCCH_SERACH_SPACE_DCI_FORMAT 0
135 #define PDCCH_CTRL_RSRC_SET_ONE_ID  1
136 #define PDCCH_CTRL_RSRC_SET_ONE_DURATION 2  /* Duration for control resource set id i */
137 #define PDCCH_CTRL_RSRC_SET_ONE_PRECOD_GRANULARITY 1   /* Precoded granularity */
138 #define PDCCH_SRCH_SPC_TWO_ID 2
139 #define PDCCH_SRCH_SPC_TWO_AGG_LVL1_CANDIDATE 7   /* Num of candidate at aggregation level 1 */
140 #define PDCCH_SRCH_SPC_TWO_AGG_LVL2_CANDIDATE 7   /* Num of candidate at aggregation level 2 */
141 #define PDCCH_SRCH_SPC_TWO_AGG_LVL4_CANDIDATE 4   /* Num of candidate at aggregation level 4 */
142 #define PDCCH_SRCH_SPC_TWO_AGG_LVL8_CANDIDATE 2   /* Num of candidate at aggregation level 8 */
143 #define PDCCH_SRCH_SPC_TWO_AGG_LVL16_CANDIDATE 1  /* Num of candidate at aggregation level 16 */
144 #define PDCCH_SRCH_SPC_TWO_UE_SPEC_DCI_FORMAT  0  /* format 0-0 and 1-0 */
145 #define PDCCH_SYMBOL_WITHIN_SLOT 128     /* Symbol within Slot Value */
146
147
148 #define SIB1_VALUE_TAG 10
149
150 /* MACRO Ddefine for PDSCH Configuration */
151 #define PDSCH_K0_CFG1  0
152 #define PDSCH_K0_CFG2  1
153 #define PDSCH_START_SYMBOL  3
154 #define PDSCH_LENGTH_SYMBOL 11
155 #define PDSCH_RES_ALLOC_TYPE       1          /* Resource allocation type */
156 #define PDSCH_MAX_CODEWORD_SCH_BY_DCI 0       /* Max num of codewords scheduled by DCI */
157 #define PDSCH_RBG_SIZE   0                    /* 0: config1 */
158 #define PDSCH_NUM_HARQ_PROC 5
159
160 /* MACRO Define for PUSCH Configuration */
161 #define MAX_UL_ALLOC 16
162 #define PUSCH_K2_CFG1  3
163 #define PUSCH_K2_CFG2  4
164 #define PUSCH_START_SYMBOL  3
165 #define PUSCH_LENGTH_SYMBOL 11
166
167 #define PUSCH_MSG3_DELTA_PREAMBLE 0
168 #define PUSCH_P0_NOMINAL_WITH_GRANT -70
169 #define PUSCH_TRANSFORM_PRECODER    1      /* 1: Disabled */
170 #define PUSCH_MAX_MIMO_LAYERS       1
171 #define PUSCH_PROCESS_TYPE2_ENABLED false
172
173 /* Macro define for PUCCH Configuration */
174 #define PUCCH_RSRC_COMMON  0
175 #define PUCCH_GROUP_HOPPING 2 /* disable */
176 #define PUCCH_P0_NOMINAL   -74
177
178 /* MACRO defines for TDD DL-UL Configuration */
179 #define NUM_DL_SLOTS 7
180 #define NUM_DL_SYMBOLS 12 
181 #define NUM_UL_SLOTS 2
182 #define NUM_UL_SYMBOLS 1
183 #define GUARD_SLOT_IDX 7
184
185 /* MACRO defines for SRC config */
186 #define SRS_RSRC_ID  1
187 #define SRS_RSET_ID  1
188 #define SRS_COMB_OFFSET_N2   0
189 #define SRS_CYCLIC_SHIFT_N2  0
190 #define SRS_FREQ_DOM_POS     0
191 #define SRS_FREQ_DOM_SHIFT   0
192 #define C_SRS 0
193 #define B_SRS 0
194 #define B_HOP 0
195 #define SRS_SEQ_ID 0
196 #define APERIODIC_SRS_RESRC_TRIGGER 1 
197
198 #define DU_PROC  0
199 #define DU_INST 0
200 #define DU_POOL  1
201 #define MAX_DU_PORT 2
202 #define F1_INTERFACE 0
203 #define E2_INTERFACE 1
204
205 #define SCTP_INST 0
206 #define EGTP_INST 0
207
208 /* Events */
209 #define EVTCFG 0
210
211 #ifdef EGTP_TEST
212 /* Macro definitions for EGTP procedures */
213 #define EGTP_LCL_TEID 1     /* EGTP local tunnel id */
214 #define EGTP_REM_TEID 10    /* EGTP remote tinnel id */
215 #endif
216
217
218 /* Macro definitions for F1 procedures */
219 #define CU_DU_NAME_LEN_MAX 30      /* Max length of CU/DU name string */
220 #define MAX_F1_CONNECTIONS 65536    /* Max num of F1 connections */
221 #define MAX_PLMN           1        /* Max num of broadcast PLMN ids */
222 #define MAXNRARFCN         3279165  /* Maximum values of NRAFCN */
223 #define MAXNRCELLBANDS     2       /* Maximum number of frequency bands */
224 #define MAX_NUM_OF_SLICE_ITEMS 1024     /* Maximum number of signalled slice support items */
225 #define MAXBPLMNNRMINUS1   1       /* Maximum number of PLMN Ids broadcast in an NR cell minus 1 */
226 #define MAXNUMOFSIBTYPES   32       /* Maximum number of SIB types */
227 #define MAX_TNL_ASSOC      32       /* Max num of TNL Assoc between CU and DU */
228 #define MAXCELLINENB       256      /* Max num of cells served by eNB */
229 #define MAX_NUM_OF_UE_ID       65536    /* Max num of UEs served by DU */
230 #define MAXNUMOFUACPLMN    12       /* Maximum number of PLMN ids*/
231 #define MAXNUMOFUACPERPLMN 64       /* Maximum number of signalled categories per PLMN */
232 #define NR_RANAC           150      /* RANAC */
233 #define DEFAULT_CELLS      1        /* Max num of broadcast PLMN ids */
234
235
236 /* Macro definitions for MIB/SIB1 */
237 #define SYS_FRAME_NUM 0
238 #define SPARE 0
239 #define SSB_SC_OFFSET 0
240 #define DU_RANAC 1
241 #define CELL_IDENTITY 32
242
243 /* Macro definitions for DUtoCuRrcContainer */
244 #define CELL_GRP_ID 1
245 #define SCH_REQ_ID  0
246 #define SR_PROHIBIT_TMR 5
247 #define SR_TRANS_MAX 2
248 #define PERIODIC_BSR_TMR 2
249 #define RETX_BSR_TMR     5
250 #define SR_DELAY_TMR     6
251 #define TAG_ID 0
252 #define TIME_ALIGNMENT_TMR 7
253 #define PHR_PERIODIC_TMR 7
254 #define PHR_PROHIBHIT_TMR 0
255 #define PHR_PWR_FACTOR_CHANGE 3
256 #define PHR_MODE_OTHER_CG 0
257 #define SN_FIELD_LEN 0
258 #define T_POLL_RETRANSMIT 8       /* Enum for 45ms */ 
259 #define T_POLL_RETRANSMIT_VAL 45  /* Value in ms */
260 #define POLL_PDU 0                /* Enum for 4 pdus */
261 #define POLL_PDU_VAL 4            /* Value of poll pdu */
262 #define POLL_BYTE 43              /* Enum for infinite poll bytes */
263 #define POLL_BYTE_VAL -1          /* Value for infinite poll byte */
264 #define MAX_RETX_THRESHOLD 5      /* Enum for 8 retransmissions */
265 #define MAX_RETX_THRESHOLD_VAL 8  /* Value for 8 retransmissions */
266 #define T_REASSEMBLY 8 /* enum for RE_ASM_40MS  */
267 #define T_REASSEMBLY_VAL 40 /* default re assembly timer */
268 #define T_STATUS_PROHIBHIT 7 /* enum for PROH_35MS */
269 #define T_STATUS_PROHIBHIT_VAL 35 /* default status prohibit timer */
270 #define MAC_LC_PRIORITY 1
271 #define PRIORTISIED_BIT_RATE 15
272 #define BUCKET_SIZE_DURATION 5
273 #define LC_GRP 0
274 #define P_NR_FR1 0
275 #define PDSCH_HARQ_ACK_CODEBOOK 1
276 #define SERV_CELL_IDX 0
277 #define RLM_SYNC_OUT_SYNC_THRESHOLD 0
278 #define ACTIVE_DL_BWP_ID 0
279 #define ACTIVE_UL_BWP_ID 0
280 #define SCRAMBLING_ID  NR_PCI
281 #define DMRS_ADDITIONAL_POS  0          /* DMRS Additional poistion */
282 #define RES_ALLOC_TYPE       1          /* Resource allocation type */
283
284 #ifdef EGTP_TEST
285 #define UE_ID 1
286 #define RB_ID 1
287 #define LC_ID 1
288 #endif
289
290 /* MACRO definitions for modulcation order */
291 #define MOD_ORDER_QPSK  2
292 #define MOD_ORDER_QAM16 4
293 #define MOD_ORDER_QAM64 6
294 #define MOD_ORDER_QAM256 8
295 #define PDSCH_MCS_INDEX 20  /* For 64QAM, valid mcs index: 17-28 in 38.214  - Table 5.1.3.1-1*/
296 #define PUSCH_MCS_INDEX 10  /* For 16QAM, valid mcs index: 10-16 in 38.214  - Table 5.1.3.1-1*/
297
298 typedef enum
299 {
300    GNBDU,
301    GNBCU 
302 }F1Entity;
303
304 typedef enum
305 {
306    SERV_CELL_TO_MODIFY,
307    SERV_CELL_TO_DELETE
308 }ServCellAction;
309
310 typedef enum
311 {
312    UNSPECIFIED,
313    RL_FAILURE_RLC,
314    INVALID_CU_UE_F1AP_ID,
315    INVALID_DU_UE_F1AP_ID,
316    INTERACTION_WITH_OTHER_PROC,
317    INVALID_QCI_VALUE,
318    RADIO_RELATED_REASON,
319    INSUFFICIENT_RADIO_RESOURCE,
320    PROCEDURE_CANCELLED,
321    NORMAL_RELEASE,
322    UNAVAILABLE_CELL,
323    RL_FAILURE_OTHERS,
324    UE_ACCESS_REJECTED,
325    SLICE_RESOURCE_UNAVAILABLE,
326    AMF_ABNORMAL_RELEASE,
327    INVALID_PLMN
328 }RadioNwCause;
329
330 typedef enum
331 {
332    TRANS_CAUSE_UNSPECIFIED,
333    TRANSPORT_RESOURCE_UNAVAIL
334 }TransLayerCause;
335
336 typedef enum
337 {
338    TRANSFER_SYNTAX_ERR,
339    ABSTRACT_SYNTAX_ERR_REJECT,
340    ABSTRACT_SYNTAX_ERR_NOTIFY,
341    INCOMPATIBLE_MESSAGE,
342    SEMANTIC_ERROR,
343    ABSTRACT_SYNTAX_ERR_MSG_CONSTRUCT,
344    PROTOCOL_CAUSE_UNSPECIFIED
345 }ProtocolCause;
346
347 typedef enum
348 {
349    CONTROL_PROC_OVERLOAD,
350    INSUFF_USER_PLANE_RESOURCE,
351    HARDWARE_FAILURE,
352    O_AND_M_INTERVENTION,
353    MISC_CAUSE_UNSPECIFIED
354 }MiscCause;
355
356 typedef enum
357 {
358    ALL
359 }F1ResetAll;
360
361 typedef enum 
362 {
363    IN_SERVICE,
364    OUT_OF_SERVICE
365 }SrvState;
366
367 typedef enum
368 {
369    INITIATING_MSG,
370    SUCCESSFUL_OUTCOME,
371    UNSUCCESSFUL_OUTCOME
372 }F1TriggMsgVal;
373
374 typedef enum
375 {
376    CRIT_REJECT,
377    CRIT_IGNORE,
378    CRIT_NOTIFY
379 }F1ProcCritVal;
380
381 typedef enum
382 {
383    NOT_UNDERSTOOD,
384    MISSING_IE
385 }F1ErrorType;
386
387 typedef enum
388 {
389    SCS_15,
390    SCS_30,
391    SCS_60,
392    SCS_120
393 }F1NrScs;
394
395 typedef enum
396 {
397    NRB_11,
398    NRB_18,
399    NRB_24,
400    NRB_25,
401    NRB_31,
402    NRB_32,
403    NRB_38,
404    NRB_51,
405    NRB_52,
406    NRB_65,
407    NRB_66,
408    NRB_78,
409    NRB_79,
410    NRB_93,
411    NRB_106,
412    NRB_107,
413    NRB_121,
414    NRB_132,
415    NRB_133,
416    NRB_135,
417    NRB_160,
418    NRB_162,
419    NRB_189,
420    NRB_216,
421    NRB_217,
422    NRB_245,
423    NRB_264,
424    NRB_270,
425    NRB_273
426 }F1Nrb;
427
428 typedef enum
429 {
430    VERY_SMALL,
431    SMALL,
432    MEDIUM,
433    LARGE
434 }F1CellType;
435
436 typedef enum
437 {
438    DL,
439    UL,
440    DL_UL
441 }F1CellDir;
442
443 typedef enum
444 {
445    UE_USAGE,
446    NON_UE_USAGE,
447    BOTH
448 }F1AssocUsage;
449
450 typedef enum
451 {
452    BARRED,
453    NOT_BARRED
454 }CellBarred;
455
456 typedef enum
457 {
458    OFFER,
459    EXECUTION
460 }F1ReqType;
461
462 typedef enum
463 {
464    IGNORE_YES,
465    IGNORE_NO
466 }F1IgnoreReq;
467
468 typedef enum
469 {
470    OVERLOADED,
471    NOT_OVERLOADED
472 }F1GnbDuOvrloadInfo;
473
474 typedef enum
475 {
476    REJECT_RRC_CONN_NON_EMERG_MODT,
477    REJECT_RRC_CONN_SIGNALLING,
478    PERMIT_EMERG_SESSION_AND_MOBILE_TERM_SERVICE,
479    PERMIT_HIGH_PRIOR_SESSION_AND_MOBILE_TERM_SERVICE
480 }F1UacStandardAction;
481
482 typedef enum
483 {
484    PDSCH_MAPPING_TYPE_A,
485    PDSCH_MAPPING_TYPE_B,
486 }pdschMappingType;
487
488 typedef enum
489 {
490    PUSCH_MAPPING_TYPE_A,
491    PUSCH_MAPPING_TYPE_B,
492 }puschMappingType;
493
494
495 typedef struct f1RrcVersion
496 {
497    char    rrcVer[30];     /* Latest RRC Version */
498    uint32_t   extRrcVer;  /* Latest RRC version extended */
499 }F1RrcVersion;
500
501 typedef struct f1FailCause
502 {
503    union
504    {
505       RadioNwCause      radioNwCause;     /* Radio Network Layer Cause */
506       TransLayerCause   transLayerCause;  /* Transport Layer Cause */
507       ProtocolCause     protCause;        /* Protocol Cause */
508       MiscCause         miscCause;        /* Miscellaneous Cause */
509    }cause;
510 }F1FailCause;
511
512 typedef struct f1ProcCode
513 {
514    bool   pres;
515    uint8_t     value;
516 }F1ProcCode;
517
518 typedef struct f1TriggMsg
519 {
520    bool   pres;
521    F1TriggMsgVal   value;
522 }F1TriggMsg;
523
524 typedef struct f1ProcCrit
525 {
526    bool   pres;
527    F1ProcCritVal   value;
528 }F1ProcCrit;
529
530 typedef struct f1CritDignosIE
531 {
532    F1ProcCritVal   ieCritVal;
533    uint16_t             ieId;
534    F1ErrorType       type;
535 }F1CritDignosIE;
536
537 typedef struct f1CritDiagnostic
538 {
539    bool         pres;
540    F1ProcCode   procCode;      /* Procedure Code */
541    F1TriggMsg   triggeringMsg; /* Triggering Message */
542    F1ProcCrit   procCrit;      /* Criticality of Triggering msg/proc */
543    uint32_t          transId;
544    F1CritDignosIE diagnosIE;
545 }F1CritDiagnostic;
546
547 typedef struct f1FailureIE
548 {
549    uint32_t                transId;        /* Uniquely identify transaction */
550    F1FailCause        cause;          /* Failure cause */
551    uint8_t                 timeToWait;     /* Seconds to be waited before retry */
552    F1CritDiagnostic   critDiagnostic; /* Critical diagnostics */
553 }F1FailureIE;
554
555 typedef struct f1LogicalConnUeAssoc
556 {
557    uint32_t   gnbCuUeF1apId;
558    uint32_t   gnbDuUeF1apId;
559 }F1LogicalConnUeAssoc;
560
561 typedef struct f1ResetType
562 {
563    union
564    {
565       F1ResetAll             resetAll; /* Reset All */
566       F1LogicalConnUeAssoc   ueAssocLogicalConn[MAX_F1_CONNECTIONS]; /* In case of Partial Reset : UE associated logical F1 conn list*/
567    }type;
568 }F1ResetType;
569
570 typedef struct nrEcgi
571 {
572    Plmn  plmn;
573    uint16_t     cellId;
574 }NrEcgi;
575
576 typedef struct f1SibType
577 {
578    uint8_t   sibType;
579    uint8_t   sibMsg;
580    uint8_t   value;
581 }F1SibType;
582
583 typedef struct f1TxBw
584 {
585    F1NrScs   nrScs; /* NR subcarrier spacing */
586    F1Nrb     nrb;   /* Transmission bandwidth expressed in units of RBs */
587 }F1TxBw;
588
589 typedef struct f1SulInfo
590 {
591    uint32_t      sulArfcn; /* SUL ARFCN */
592    F1TxBw   sulTxBw;  /* SUL transmission bandwidth */ 
593 }F1SulInfo;
594
595 typedef struct f1FreqBand
596 {
597    uint16_t   nrFreqBand;
598    uint16_t   sulBand[MAXNRCELLBANDS];
599 }F1FreqBand;
600
601 typedef struct f1NrFreqInfo
602 {
603    uint32_t        nrArfcn;
604    F1SulInfo  sulInfo;
605    F1FreqBand freqBand[MAXNRCELLBANDS];
606 }F1NrFreqInfo;
607
608 typedef struct f1NrFddInfo
609 {
610    F1NrFreqInfo   ulNrFreqInfo;  /* UL NR Frequency Info */
611    F1NrFreqInfo   dlNrFreqInfo;  /* DL NR Frequency Info */
612    F1TxBw         ulTxBw;        /* UL Transmission bandwidth */
613    F1TxBw         dlTxBw;        /* DL Transmission bandwidth */
614 }F1NrFddInfo;
615
616 typedef struct f1NrTddInfo
617 {
618    F1NrFreqInfo   nrFreqInfo;   /* NR Frequency Info */
619    F1TxBw       nrTxBw;       /* NR Transmission Bandwidth */
620 }F1NrTddInfo;
621
622 typedef struct f1NrModeInfo
623 {
624    union
625    {
626       F1NrFddInfo  fdd;
627       F1NrTddInfo  tdd;
628    }mode;
629 }NrModeInfo;
630
631 typedef struct f1EutraFddInfo
632 {
633    uint16_t   ulOffset;   /* UL offset to Point A */
634    uint16_t   dlOffset;   /* DL offset to Point A */
635 }F1EutraFDDInfo;
636
637 typedef struct f1EutraTddInfo
638 {
639    uint16_t   tddOffset;  /* Offset to Point A */
640 }F1EutraTDDInfo;
641
642 typedef struct f1EutraModeInfo
643 {
644    union
645    {
646       F1EutraFDDInfo  fdd;
647       F1EutraTDDInfo  tdd;
648    }mode;
649 }F1EutraModeInfo;
650
651 typedef struct f1Snsaai
652 {
653    uint8_t   sst;
654    uint32_t  sd;
655 }F1Snsaai;
656
657 typedef struct epIpAddr
658 {
659    char transportAddr[20]; /* Transport Layer Address */
660 }EpIpAddr;
661
662 typedef struct epIpAddrPort
663 {
664    EpIpAddr epIpAddr;
665    char   port[2];
666 }EpIpAddrPort;
667
668 typedef struct f1TaiSliceSuppLst
669 {
670    bool       pres;
671    F1Snsaai   snssai[MAX_NUM_OF_SLICE_ITEMS];   
672 }F1TaiSliceSuppLst;
673
674 typedef struct f1SrvdPlmn
675 {
676    Plmn              plmn;
677    F1TaiSliceSuppLst   taiSliceSuppLst;
678 }F1SrvdPlmn;
679
680 typedef struct f1BrdcstPlmnInfo
681 {
682    Plmn   plmn[MAX_PLMN];     /* PLMN id list */
683    Plmn   extPlmn[MAX_PLMN];   /* Extended PLMN id list */
684    uint16_t      tac;                     /* 5GS-TAC */
685    uint32_t      nrCellId;                /* NR Cell id */
686    uint8_t       ranac;                   /* RAN Area code */
687 }F1BrdcstPlmnInfo;
688
689 typedef struct f1CellInfo
690 {
691    NrEcgi   nrCgi;                   /* Cell global Identity */
692    uint32_t nrPci;                   /* Physical Cell Identity */
693    Plmn   plmn[MAX_PLMN];     /* Available PLMN list */
694    Plmn   extPlmn[MAX_PLMN];  /* Extended available PLMN list */
695 }F1CellInfo;
696
697 typedef struct f1DuCellInfo
698 {
699    F1CellInfo         cellInfo;     /* cell info */
700    uint16_t           tac;          /* tracking area code */
701    uint16_t           epsTac;       /* Configured EPS TAC */
702    NrModeInfo         f1Mode;       /* NR mode info : FDD/TDD */
703    uint8_t            measTimeCfg;  /* Measurement timing configuration */
704    F1CellDir          cellDir;      /* Cell Direction */
705    F1CellType         cellType;     /* Cell Type */
706    F1BrdcstPlmnInfo   brdcstPlmnInfo[MAXBPLMNNRMINUS1]; /* Broadcast PLMN Identity Info List */
707 }F1DuCellInfo;
708
709 typedef struct f1DuSysInfo
710 {
711    uint8_t   *mibMsg;   /* MIB message */
712    uint16_t  mibLen;
713    uint8_t   *sib1Msg;  /* SIB1 message */
714    uint16_t  sib1Len;
715 }F1DuSysInfo;
716
717 typedef struct f1CuSysInfo
718 {
719    F1SibType   sibTypeToUpd[MAXNUMOFSIBTYPES];   /* SIB types to be updated */
720 }F1CuSysInfo;
721
722 typedef struct f1DuSrvdCellInfo
723 {
724    F1DuCellInfo   duCellInfo;   /* gNB-DU served cell info */
725    F1DuSysInfo    duSysInfo;    /* gNB-DU System Information */
726 }F1DuSrvdCellInfo;
727
728 typedef struct f1DuSrvdCellToDel
729 {
730    NrEcgi             oldNrCgi;     /* Old NR CGI */
731    F1DuSrvdCellInfo   srvdCellInfo; /* Info of served cell to be deleted */ 
732 }F1DuSrvdCellToDel;
733
734 typedef struct f1CuActCellInfo
735 {
736    F1CellInfo    cuCellInfo;   /* gNB-CU available cell info */
737    F1CuSysInfo   cuSysInfo;    /* gNB-CU System Information */
738 }F1CuActCellInfo;
739
740 typedef struct f1ActCellFail
741 {
742    NrEcgi        nrCgi;
743    F1FailCause   cause;
744 }F1ActCellFail;
745
746 typedef struct srvStatus
747 {
748    SrvState    state;
749    bool        switchOffOngoing;
750 }SrvStatus;
751
752 typedef struct f1CellStatus
753 {
754    NrEcgi      nrEcgi;
755    SrvStatus   status;   /* Service status */
756 }F1CellStatus;
757
758 typedef struct f1DedSIDelUE
759 {
760    uint32_t      gnbCuUeF1apId;
761    NrEcgi   nrEcgi;
762 }F1DedSIDelUE;
763
764 typedef struct tnlAssocInfo
765 {
766    bool           pres;
767    EpIpAddr       epIpAddr;      /* Endpoint-IP Address */
768    EpIpAddrPort   epIpAddrport;  /* Endpoint-IP Address and Port */
769 }F1TnlAssocAddr;
770
771 typedef struct f1TnlAssocUsage
772 {
773    bool           pres;
774    F1AssocUsage   usage;
775 }F1TnlAssocUsage;
776
777 typedef struct f1TnlAssoc
778 {
779    F1TnlAssocAddr   assocInfo;    /* TNL Assoc Transport Layer Info */
780    F1TnlAssocUsage  assocUsage;   /* TNL Assoc usage */
781 }F1TnlAssoc;
782
783 typedef struct f1TnlAssocToRmv
784 {
785    F1TnlAssocAddr   assocInfoCu;   /* TNL Assoc Transport Layer Info of CU */
786    F1TnlAssocAddr   assocInfoDu;   /* TNL Assoc Transport Layer Info of DU */
787 }F1TnlAssocToRmv;
788
789 typedef struct f1TnlAssocSetupFail
790 {
791    F1TnlAssocAddr   assocInfo;
792    F1FailCause      cause;
793 }F1TnlAssocSetupFail;
794
795
796 typedef struct f1CellBarred
797 {
798    NrEcgi       nrcgi;
799    CellBarred   cellBarred;
800 }F1CellBarred;
801
802 typedef struct f1EutraCell
803 {
804    uint32_t                eutraCellId; /* EUTRA cell id */
805    F1EutraModeInfo    mode;        /* EUTRA mode info : FDD/TDD */
806    uint8_t                 rsrcInd;     /* Protected EUTRA resource Indication */
807 }F1EutraCell;
808
809 typedef struct f1ProtectEUTRARsrc
810 {
811    uint32_t           specShareGrpId;               /* Spectrum sharing group id */
812    F1EutraCell   eutraCellList[MAXCELLINENB];  /* EUTRA cells list */
813 }F1ProtectEUTRARsrc;
814
815 typedef struct f1UacOperatorDefined
816 {
817    uint8_t   accessCategory;
818    uint8_t   accessId; 
819 }F1UacOperatorDefined;
820
821 typedef struct f1UacCategoryType
822 {
823    union
824    {
825       F1UacStandardAction    action;      /* UAC standardized action */
826       F1UacOperatorDefined   operatorDef; /* UAC operator defined */
827    }type;
828 }F1UacCategoryType;
829
830 typedef struct f1UacType
831 {
832    uint8_t                  uacReducInd;     /* Value 0 means no access rate reduction. Value 100 means full access rate reduction */
833    F1UacCategoryType   uacCategoryType; /* UAC Category type */
834 }F1UacType;
835
836 /* Unified Access Class Assistance Information */
837 typedef struct f1UacAssistInfo
838 {
839    Plmn      plmn[MAXNUMOFUACPLMN];        /* UAC PLMN list */
840    F1UacType   uacType[MAXNUMOFUACPERPLMN];  /* UAC Type list */
841 }F1UacAssistInfo;
842
843 /* F1 setup related structures */
844 #if 0
845 typedef struct f1SetupReq
846 {
847    uint32_t                transId;                       /* Uniquely identify transaction */
848    uint32_t                duId;                          /* DU ID */ 
849    char               duName[CU_DU_NAME_LEN_MAX];    /* DU name */
850    F1DuSrvdCellInfo   srvdCellLst[MAX_NUM_CELL];   /* Serving cell list */
851    F1RrcVersion       rrcVersion;                    /* RRC version */
852 }F1SetupReq;
853
854 typedef struct f1setupRsp
855 {
856    uint32_t               transId;                      /* Uniquely identify transaction */
857    char              cuName[CU_DU_NAME_LEN_MAX];   /* CU Name */
858    F1CuActCellInfo   actCellInfo;                  /* cells to be activated */
859    F1RrcVersion      rrcVersion;                   /* RRC version */
860 }F1SetupRsp;
861
862 typedef struct f1SetupFail
863 {
864    F1FailureIE   setupFail;
865 }F1SetupFail;
866
867 /* At reception of the RESET message the gNB-DU shall release all allocated resources on F1 
868  * and radio resources related to the UE association(s) indicated explicitly or implicitly in 
869  * the RESET message and remove the indicated UE contexts including F1AP ID. */
870 typedef struct f1Reset
871 {
872    uint32_t              transId;   /* Uniquely identify transaction */
873    F1FailCause      cause;     /* Failure cause */
874    F1ResetType      resetType; /* type of reset */
875 }F1Reset;
876
877 /* After the gNB-CU has released all assigned F1 resources and the UE F1AP IDs for all indicated
878  * UE associations which can be used for new UE-associated logical F1-connections over the F1 interface,
879  *  the gNB-CU shall respond with the RESET ACKNOWLEDGE message. */
880 typedef struct f1ResetAck
881 {
882    uint32_t                    transId;         /* Uniquely identify transaction */
883    F1LogicalConnUeAssoc   ueAssocLogicalConn[MAX_F1_CONNECTIONS]; /* UE associated logical F1-connection list */
884    F1CritDiagnostic       critDiagnostic;  /* Critical diagnostics */
885 }F1ResetAck;
886
887 typedef struct f1ErrorInd
888 {
889    uint32_t                transId;         /* Uniquely identify transaction */
890    F1Entity           errorOrigin;     /* Specifies if error is originated at DU or CU */
891    F1FailCause        cause;           /* Failure cause */
892    /* If failure is due to Ue related message. */
893    uint32_t                gnbCuUeF1apId;   /* gNB-CU UE F1AP Id */
894    uint32_t                gnbDuUeF1apId;   /* gNB-DU UE F1AP Id */
895    F1CritDiagnostic   critDiagnostic;  /* Critical diagnostics */
896 }F1ErrorInd;
897
898 typedef struct f1GnbDuCfgUpd
899 {
900    uint32_t                 transId;                             /* Uniquely identify transaction */
901    F1DuSrvdCellInfo    srvdCellLstAdd[MAX_NUM_CELL];      /* Served cell list to be added */
902    F1DuSrvdCellToDel   srvdCellLstMod[MAX_NUM_CELL];      /* Served cell list to be modified */
903    NrEcgi              srvdCellLstDel[MAX_NUM_CELL];      /* Served cell list to be deleted */
904    F1CellStatus        cellStatus[MAX_NUM_CELL];          /* Cell status */
905    F1DedSIDelUE        ueLst[MAX_NUM_UE];                     /* Ue list that requires dedicated SI delivery */
906    uint32_t            gnbDuId;
907    F1TnlAssocToRmv     gnbDuTnlAssocRmv[MAX_TNL_ASSOC];  /* TNL Assoc list to remove */ 
908 }F1GnbDuCfgUpd;
909
910 typedef struct f1GnbDuCfgUpdAck
911 {
912    uint32_t           transId;                      /* Uniquely identify transaction */
913    F1CuActCellInfo    cellLstAct[MAX_NUM_CELL];    /* List of cells to be activated */   
914    F1CritDiagnostic   critDiagnostic;               /* Critical diagnostics */
915    NrEcgi             cellLstDeact[MAX_NUM_CELL]; /* List of cells to be deactivated */
916 }F1GnbDuCfgUpdAck;
917
918 typedef struct f1GnbDuCfgUpdFail
919 {
920    F1FailureIE   gnbDuCfgUpdFail;
921 }F1GnbDuCfgUpdFail;
922
923 /* Sent by the gNB-CU to transfer updated information associated to an F1-C interface instance */
924 typedef struct f1GnbCuCfgUpd
925 {
926    uint32_t            transId;                            /* Uniquely identifies transaction */
927    F1CuActCellInfo     cellLstAct[MAX_NUM_CELL];         /* List of cells to be activated */
928    NrEcgi              cellLstDeact[MAX_NUM_CELL];       /* List of cells to be deactivated */
929    F1TnlAssoc          assocLstAdd[MAX_TNL_ASSOC];     /* List of TNL assocs to be added */
930    F1TnlAssoc          assocLstUpd[MAX_TNL_ASSOC];     /* List of TNL assocs to be updated */
931    F1TnlAssocToRmv     assocLstRmv[MAX_TNL_ASSOC];     /* List of TNL assocs to be removed */
932    F1CellBarred        cellToBarList[MAX_NUM_CELL];      /* List of Cells to be barred */
933    F1ProtectEUTRARsrc  protectEutraRsrcList[MAXCELLINENB]; /* List of Protected EUTRA resources */
934 }F1GnbCuCfgUpd;
935
936 /* Sent by a gNB-DU to a gNB-CU to acknowledge update of information
937  * associated to an F1-C interface instance */
938 typedef struct f1GnbCuCfgUpdAck
939 {
940    uint32_t              transId;                              /* Uniquely identify transaction */
941    F1ActCellFail         actCellFailList[MAX_NUM_CELL];      /* Cells failed to be activated list */
942    F1CritDiagnostic      critDiagnostic;                       /* Critical diagnostics */
943    F1TnlAssocAddr        assocSetupList[MAX_TNL_ASSOC];     /* TNL Assoc Setup list */
944    F1TnlAssocSetupFail   assocSetupFailList[MAX_TNL_ASSOC]; /* TNL Assoc Setup fail list */
945    F1DedSIDelUE          dedSiDelUelist[MAX_NUM_OF_UE_ID];          /* Dedicated SI delivery needed UE list */
946 }F1GnbCuCfgUpdAck;
947
948 typedef struct f1GnbCuCfgUpdFail
949 {
950    F1FailureIE   gnbCuCfgUpdFail;
951 }F1GnbCuCfgUpdFail;
952
953 /* This procedure enables coordination of radio resource allocation between a gNB-CU and
954  * a gNB-DU. Coordination request is sent by CU to DU */
955 typedef struct f1GnbDuRsrcCoordReq
956 {
957    uint32_t      transId;              /* Uniquely identifies transaction */
958    F1ReqType     reqType;              /* Request type */
959    uint8_t       cellResCoordReqCont;  /* Container for X2AP E-UTRA - NR cell resource coordination request */
960    F1IgnoreReq   ignoreReq;            /* Ignore coordination request */
961 }F1GnbDuRsrcCoordReq;
962
963 /* This message is sent by a gNB-DU to a gNB-CU, to express the desired resource allocation
964  * for data traffic, as a response to the GNB-DU RESOURCE COORDINATION REQUEST. */
965 typedef struct f1GnbDuRsrcCoordRsp
966 {
967    uint32_t   transId;               /* Uniquely identifies transaction */
968    uint8_t    cellResCoordRspCont;   /* Container for X2AP E-UTRA - NR cell resource coordination response */
969 }F1GnbDuRsrcCoordRsp;
970
971 /* This message is sent by the gNB-DU to indicate to the gNB-CU its status of overload */
972 typedef struct f1GnbDuStatusInd
973 {
974    uint32_t                  transId;      /* Uniquely identifies transaction */
975    F1GnbDuOvrloadInfo   ovrloadInfo;  /* gNB-DU overloaded information */
976 }F1GnbDuStatusInd;
977
978 /* This message is sent by either the gNB-DU or the gNB-CU to intiate the removal
979  * of the interface instance and the related resources */
980 typedef struct f1RmvReq
981 {
982    uint32_t   transId; /* Uniquely identifies transaction */
983 }F1RmvReq;
984
985 /* This message acknowledges the initiation of removal of the interface
986  * instance and the related resources */
987 typedef struct f1RmvRsp
988 {
989    uint32_t           transId;     /* Uniquely identifies transaction */
990    F1CritDiagnostic   critDiagnos; /* Crititcality diagnostics */
991 }F1RmvRsp;
992
993 /* This message indicates that removing the interface instance and the related
994  * resources cannot be accepted */
995 typedef struct f1RmvFail
996 {
997    uint32_t           transId;         /* Uniquely identifies transaction */
998    F1FailCause        cause;          /* Failure cause */
999    F1CritDiagnostic   critDiagnostic; /* Criticality diagnostics */
1000 }F1RmvFail;
1001
1002 /* This message is sent by the gNB-CU to indicate to the gNB-DU a need to reduce
1003  * the rate at which UEs access the network. */
1004 typedef struct f1NwkAccessRateRed
1005 {
1006    uint32_t          transId;        /* Uniquely identifies transaction */
1007    F1UacAssistInfo   uacAssistInfo;  /* UAC Assistance Information */
1008 }F1NwkAccessRateRed;
1009 #endif
1010
1011 typedef struct f1Ipaddr
1012 {
1013    bool ipV4Pres;
1014    uint32_t  ipV4Addr; 
1015 }F1IpAddr;
1016
1017 typedef struct sctpParams
1018 {
1019    F1IpAddr  duIpAddr;
1020    uint16_t       duPort[MAX_DU_PORT];
1021    F1IpAddr  cuIpAddr;
1022    uint16_t       cuPort;
1023    F1IpAddr  ricIpAddr;
1024    uint16_t       ricPort;
1025 }SctpParams;
1026
1027 typedef struct f1EgtpParams
1028 {
1029    F1IpAddr  localIp;      /* Ip address of local node */
1030    uint16_t  localPort;    /* Sender Port at local node */
1031    F1IpAddr  destIp;       /* Ip address of peer node */
1032    uint16_t  destPort;     /* Sender port at peer node */
1033    uint32_t  minTunnelId;
1034    uint32_t  maxTunnelId;
1035 }F1EgtpParams;
1036
1037 typedef struct schedulerCfg
1038 {
1039    uint8_t   numTxAntPorts;    /*!< Number of Tx antenna ports */
1040    uint8_t   ulSchdType;     /*!< Indicates which UL scheduler to use, range
1041                               * is 0..(number of schedulers - 1) */
1042    uint8_t   dlSchdType;     /*!< Indicates which DL scheduler to use, range
1043                               * is 0..(number of schedulers - 1) */
1044    uint8_t   numCells;       /*!< Max number of cells */
1045    uint8_t   maxUlUePerTti;  /*!< Max number of UE in UL per TTI */
1046    uint8_t   maxDlUePerTti;  /*!< Max number of UE in DL per TTI */
1047 }SchedulerCfg;
1048
1049 typedef struct mibParams
1050 {
1051    uint8_t sysFrmNum;
1052    long    subCarrierSpacingCommon;
1053    long    ssb_SubcarrierOffset;
1054    long    dmrs_TypeA_Position;
1055    long    controlResourceSetZero;
1056    long    searchSpaceZero;
1057    long    cellBarred;
1058    long    intraFreqReselection;
1059 }MibParams;
1060
1061 typedef struct siSchedInfo
1062 {
1063    long     winLen;         /* SI Window Length */
1064    long     broadcastSta;   /* Broadcast status */
1065    long     preiodicity;    /* si periodicity */
1066    long     sibType;
1067    long     sibValTag;      /* Value tag */
1068 }SiSchedInfo;
1069
1070 typedef struct pdcchCfgCommon
1071 {
1072    uint8_t  present;
1073    long     ctrlRsrcSetZero;  /* Control resource set zero */
1074    long     searchSpcZero;    /* Search space zero */
1075    long     searchSpcId;      /* Search space id */
1076    long     ctrlRsrcSetId;    /* Control resource set id */
1077    uint8_t  monitorSlotPrdAndOffPresent;
1078    long     monitorSlotPrdAndOff;     /* Monitoring slot periodicity and offset */
1079    uint8_t  monitorSymbolsInSlot[2];  /* Monitoring symbols within slot */
1080    long     numCandAggLvl1;        /* Number of candiates at aggregation level 1 */
1081    long     numCandAggLvl2;        /* Number of candiates at aggregation level 2 */
1082    long     numCandAggLvl4;        /* Number of candiates at aggregation level 4 */
1083    long     numCandAggLvl8;        /* Number of candiates at aggregation level 8 */
1084    long     numCandAggLvl16;       /* Number of candiates at aggregation level 16 */
1085    uint8_t  searchSpcType;        /*  Search Space type */
1086    uint8_t  commSrchSpcDciFrmt;    /* DCI format of common search space type */
1087    long     searchSpcSib1;         /* Id of serch space for SIB1 */
1088    long     pagingSearchSpc;       /* Id of search space for paging */
1089    long     raSearchSpc;           /* Id of search space for Random Access proc */
1090 }PdcchCfgCommon;
1091
1092 typedef struct pdschTimeDomainRsrcAlloc
1093 {
1094    long     k0;
1095    long     mapType;              /* Mapping Type */
1096    uint16_t sliv;  
1097 }PdschTimeDomainRsrcAlloc;
1098
1099 typedef struct pdschCfgCommon
1100 {
1101    uint8_t  present;
1102    uint8_t  numTimeDomRsrcAlloc;
1103    PdschTimeDomainRsrcAlloc timeDomAlloc[MAX_NUM_DL_ALLOC];
1104 }PdschCfgCommon;
1105
1106 typedef struct bcchCfg
1107 {
1108    long   modPrdCoeff;          /* Modification period co-efficient */
1109 }BcchCfg;
1110
1111 typedef struct pcchCfg
1112 {
1113    long   dfltPagingCycle;      /* Default paging cycle */
1114    long   nAndPagingFrmOffPresent;
1115    long   nAndPagingFrmOff;     /* n and Paging Frame offset */
1116    long   numPagingOcc;         /* Number of paging occassions in paging frame */
1117 }PcchCfg;
1118
1119 typedef struct scsSpecCarrier
1120 {
1121    long   scsOffset;    /* Offset to point A considering subcarrier spacing */
1122    long   scs;          /* subcarrier spacing */
1123    long   scsBw;        /* Carrier bandwidth considering subcarrier spacing */
1124
1125 }ScsSpecCarrier;
1126
1127 typedef struct dlCfgCommon
1128 {
1129    long   freqBandInd;  /* Downlink frequency band indicator */
1130    long   offsetToPointA;       /* DL ofset to point A */
1131    long   locAndBw;     /* Frequency location and bandwidth */
1132    ScsSpecCarrier   dlScsCarrier;  /* SCS Specific carrier */
1133    PdcchCfgCommon   pdcchCfg;
1134    PdschCfgCommon   pdschCfg;
1135    BcchCfg          bcchCfg;
1136    PcchCfg          pcchCfg;
1137 }DlCfgCommon;
1138
1139 typedef struct rachCfgCommon
1140 {
1141    uint8_t present;
1142    long   prachCfgIdx;       /* PRACH configuration index */
1143    long   msg1Fdm;           /* Num of PRACH transmission occassions */
1144    long   msg1FreqStart;     /* Offset of lowest msg1 transmission occassion */
1145    long   zeroCorrZoneCfg;   /* Zero correlation zone configuration */
1146    long   preambleRcvdTgtPwr; /* Traget power level */
1147    long   preambleTransMax;  /* Max num of preamble transmission */
1148    long   pwrRampingStep;    /* Power ramping steps for PRACH */
1149    long   raRspWindow;       /* RA response window */
1150    long   numRaPreamble;     /* Total num of preamble used in random access */
1151    uint8_t ssbPerRachOccPresent;
1152    long   numSsbPerRachOcc;  /* Numer of SSBs per RACH Occassion */
1153    long   contResTimer;      /* Contention resolution timer */
1154    long   rsrpThreshSsb;
1155    uint8_t rootSeqIdxPresent;
1156    long   rootSeqIdx;        /* PRACH root sequence index */
1157    long   msg1Scs;           /* Msg1 subcarrier spacing */
1158    long   restrictedSetCfg;  /* Restricted set configuration */
1159 }RachCfgCommon;
1160
1161 typedef struct puschCfgCmnTimeDomAlloc
1162 {
1163    long     k2;
1164    long     mapType;
1165    uint16_t sliv;
1166 }PuschCfgCmnTimeDomAlloc;
1167
1168 typedef struct  puschCfgCommon
1169 {
1170    uint8_t  puschCfgPresent;
1171    uint8_t  numTimeDomRsrcAlloc;
1172    PuschCfgCmnTimeDomAlloc timeDomAllocList[MAX_UL_ALLOC];
1173    long     msg3DeltaPreamble;
1174    long     p0NominalWithGrant;
1175 }PuschCfgCommon;
1176
1177 typedef struct pucchCfgCommon
1178 {
1179    uint8_t present;
1180    long   rsrcComm;
1181    long   grpHop;
1182    long   p0Nominal;
1183 }PucchCfgCommon;
1184
1185 typedef struct ulCfgCommon
1186 {
1187    long   pMax;         /* Max UL transmission power that UE applies */
1188    long   locAndBw;     /* Frequency location and bandwidth */
1189    ScsSpecCarrier   ulScsCarrier; /* SCS Specific carrier */
1190    RachCfgCommon    rachCfg;
1191    PuschCfgCommon   puschCfg;
1192    PucchCfgCommon   pucchCfg;
1193    long   timeAlignTimerComm;
1194 }UlCfgCommon;
1195
1196 typedef struct tddUlDlCfgCommon
1197 {
1198    long   refScs;     /* Reference subcarrier spacing */
1199    long   txPrd;      /* Transmission periodicity */
1200    long   numDlSlots;
1201    long   numDlSymbols;
1202    long   numUlSlots;
1203    long   numUlSymbols;
1204 }TddUlDlCfgCommon;
1205
1206 typedef struct srvCellCfgCommSib
1207
1208    DlCfgCommon        dlCfg;
1209    UlCfgCommon        ulCfg;
1210    uint8_t            ssbPosInBurst;
1211    long               ssbPrdServingCell;
1212    TddUlDlCfgCommon   tddCfg;
1213    long               ssPbchBlockPwr;
1214 }SrvCellCfgCommSib;
1215
1216 typedef struct sib1Params
1217 {
1218    Plmn    plmn;
1219    uint8_t   tac;
1220    long      ranac;
1221    uint8_t   cellIdentity;
1222    long      cellResvdForOpUse;
1223    long      connEstFailCnt;
1224    long      connEstFailOffValidity;
1225    SiSchedInfo           siSchedInfo;
1226    SrvCellCfgCommSib     srvCellCfgCommSib;
1227 }Sib1Params;
1228
1229 typedef struct duCfgParams
1230 {
1231    SctpParams         sctpParams;                  /* SCTP Params */
1232    F1EgtpParams       egtpParams;                  /* EGTP Params */
1233    uint32_t           maxUe;
1234    uint32_t           duId;
1235    uint8_t            duName[CU_DU_NAME_LEN_MAX];
1236    SchedulerCfg       schedCfg;
1237    F1DuSrvdCellInfo   srvdCellLst[MAX_NUM_CELL];  /* Serving cell list *///TODO: this must be removed eventually
1238    F1RrcVersion       rrcVersion;                 /* RRC version */
1239    MacCellCfg          macCellCfg;                    /* MAC cell configuration */
1240    MibParams          mibParams;                  /* MIB Params */
1241    Sib1Params         sib1Params;                 /* SIB1 Params */
1242 }DuCfgParams;
1243
1244 /*function declarations */
1245 void FillSlotConfig();
1246 uint8_t readClCfg();
1247 uint8_t readCfg();
1248 uint8_t duReadCfg(); 
1249 uint16_t calcSliv(uint8_t startSymbol, uint8_t lengthSymbol);
1250
1251 #endif /* __DU_CONFIG_H__ */
1252
1253 /**********************************************************************
1254   End of file
1255  **********************************************************************/