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