macCellCfg
[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 #include "du_mgr.h"
23 #include "du_mgr_mac_inf.h"
24 #include "du_log.h"
25 #include "BIT_STRING.h"
26
27 /* MACROS */
28 #define DU_INST 0
29 #define DU_ID 1
30 #define DU_IP_V4_ADDR "10.0.2.20"
31 #define CU_IP_V4_ADDR "10.0.2.25"
32 #define DU_PORT 38472
33 #define CU_PORT 38472
34 #define DU_EGTP_PORT  39001
35 #define CU_EGTP_PORT  39002
36 #define NR_PCI 1
37 #define NR_CELL_ID 1
38 #define DU_NAME "ORAN_OAM_DU"
39 #define CELL_TYPE SMALL
40 #define DUPLEX_MODE DUP_MODE_TDD
41 #define DU_TAC 1
42 #define PLMN_MCC0 3
43 #define PLMN_MCC1 1
44 #define PLMN_MCC2 1
45 #define PLMN_MNC0 4
46 #define PLMN_MNC1 8
47 #define PLMN_MNC2 0
48 #define NR_ARFCN  2079427
49 #define SUL_ARFCN 100
50 #define NR_FREQ_BAND 257
51 #define SUL_BAND 2
52 #define TIME_CFG 0
53 #define CARRIER_IDX 1
54 #define NUM_TX_ANT 2
55 #define NUM_RX_ANT 2
56 #define FREQ_SHIFT_7P5KHZ FALSE
57 #define SSB_PBCH_PWR 0
58 #define BCH_PAYLOAD MAC_GEN_FULL_PBCH_PAYLD
59 #define SUBCARRIER_SPACING 3
60 #define PRB_OFFSET 0
61 #define BETA_PSS BETA_PSS_0DB
62 #define SSB_PERIODICITTY SSB_PRDCTY_MS_20
63 #define SSB_SUBCARRIER_OFFSET 0
64 #define SSB_MULT_CARRIER_BAND FALSE
65 #define MULT_CELL_CARRIER FALSE
66
67 #define PRACH_SEQ_LEN SHORT_SEQUENCE
68 #define PRACH_SUBCARRIER_SPACING 3
69 #define PRACH_RESTRICTED_SET_CFG UNRESTRICTED
70 #define NUM_PRACH_FDM 1
71 #define ROOT_SEQ_IDX 0
72 #define NUM_ROOT_SEQ 1
73 #define ZERO_CORRELATION_ZONE_CFG 2
74 #define NUM_UNUSED_ROOT_SEQ 1
75 #define UNUSED_ROOT_SEQ 1
76 #define SSB_PER_RACH 3
77 #define PRACH_MULT_CARRIER_BAND FALSE
78 #define TDD_PERIODICITY TX_PRDCTY_MS_2P5
79 #define RSS_MEASUREMENT_UNIT DONT_REPORT_RSSI
80
81 #define DU_PROC  0
82 #define DU_INST 0
83 #define DU_POOL  1
84
85 #define SCTP_INST 0
86 #define EGTP_INST 0
87
88 /* Events */
89 #define EVTCFG 0
90
91 /* Selector */
92 #define DU_SELECTOR_LC   0
93 #define DU_SELECTOR_TC   1
94 #define DU_SELECTOR_LWLC 2
95
96 #ifdef EGTP_TEST
97 /* Macro definitions for EGTP procedures */
98 #define EGTP_LCL_TEID 1     /* EGTP local tunnel id */
99 #define EGTP_REM_TEID 10    /* EGTP remote tinnel id */
100 #endif
101
102
103 /* Macro definitions for F1 procedures */
104 #define CU_DU_NAME_LEN_MAX 30      /* Max length of CU/DU name string */
105 #define MAX_F1_CONNECTIONS 65536    /* Max num of F1 connections */
106 #define DU_MAX_CELLS       512      /* Max num of cells served by gNB-DU */
107 #define MAX_PLMN           6        /* Max num of broadcast PLMN ids */
108 #define MAXNRARFCN         3279165  /* Maximum values of NRAFCN */
109 #define MAXNRCELLBANDS     2       /* Maximum number of frequency bands */
110 #define MAXNUMOFSLICEITEMS 1024     /* Maximum number of signalled slice support items */
111 #define MAXBPLMNNRMINUS1   1       /* Maximum number of PLMN Ids broadcast in an NR cell minus 1 */
112 #define MAXNUMOFSIBTYPES   32       /* Maximum number of SIB types */
113 #define MAX_UEID           512      /* Maximum number of UE Ids */
114 #define MAX_TNL_ASSOC      32       /* Max num of TNL Assoc between CU and DU */
115 #define MAXCELLINENB       256      /* Max num of cells served by eNB */
116 #define MAXNUMOFUEID       65536    /* Max num of UEs served by DU */
117 #define MAXNUMOFUACPLMN    12       /* Maximum number of PLMN ids*/
118 #define MAXNUMOFUACPERPLMN 64       /* Maximum number of signalled categories per PLMN */
119 #define DEFAULT_CELLS      1        /* Max num of broadcast PLMN ids */
120
121
122 /* Macro definitions for MIB/SIB1 */
123 #define SYS_FRAME_NUM 0
124 #define SPARE 0
125 #define SSB_SC_OFFSET 8
126 #define CORESET_ZERO 1
127 #define SEARCH_SPACE_ZERO 8
128 #define DU_RANAC 1
129 #define CELL_IDENTITY 1
130
131
132 typedef enum
133 {
134    GNBDU,
135    GNBCU 
136 }F1Entity;
137
138 typedef enum
139 {
140    UNSPECIFIED,
141    RL_FAILURE_RLC,
142    INVALID_CU_UE_F1AP_ID,
143    INVALID_DU_UE_F1AP_ID,
144    INTERACTION_WITH_OTHER_PROC,
145    INVALID_QCI_VALUE,
146    RADIO_RELATED_REASON,
147    INSUFFICIENT_RADIO_RESOURCE,
148    PROCEDURE_CANCELLED,
149    NORMAL_RELEASE,
150    UNAVAILABLE_CELL,
151    RL_FAILURE_OTHERS,
152    UE_ACCESS_REJECTED,
153    SLICE_RESOURCE_UNAVAILABLE,
154    AMF_ABNORMAL_RELEASE,
155    INVALID_PLMN
156 }RadioNwCause;
157
158 typedef enum
159 {
160    TRANS_CAUSE_UNSPECIFIED,
161    TRANSPORT_RESOURCE_UNAVAIL
162 }TransLayerCause;
163
164 typedef enum
165 {
166    TRANSFER_SYNTAX_ERR,
167    ABSTRACT_SYNTAX_ERR_REJECT,
168    ABSTRACT_SYNTAX_ERR_NOTIFY,
169    INCOMPATIBLE_MESSAGE,
170    SEMANTIC_ERROR,
171    ABSTRACT_SYNTAX_ERR_MSG_CONSTRUCT,
172    PROTOCOL_CAUSE_UNSPECIFIED
173 }ProtocolCause;
174
175 typedef enum
176 {
177    CONTROL_PROC_OVERLOAD,
178    INSUFF_USER_PLANE_RESOURCE,
179    HARDWARE_FAILURE,
180    O_AND_M_INTERVENTION,
181    MISC_CAUSE_UNSPECIFIED
182 }MiscCause;
183
184 typedef enum
185 {
186   ALL
187 }F1ResetAll;
188
189 typedef enum 
190 {
191   IN_SERVICE,
192   OUT_OF_SERVICE
193 }SrvState;
194
195 typedef enum
196 {
197    INITIATING_MSG,
198    SUCCESSFUL_OUTCOME,
199    UNSUCCESSFUL_OUTCOME
200 }F1TriggMsgVal;
201
202 typedef enum
203 {
204    CRIT_REJECT,
205    CRIT_IGNORE,
206    CRIT_NOTIFY
207 }F1ProcCritVal;
208
209 typedef enum
210 {
211    NOT_UNDERSTOOD,
212    MISSING_IE
213 }F1ErrorType;
214
215 typedef enum
216 {
217    SCS_15,
218    SCS_30,
219    SCS_60,
220    SCS_120
221 }F1NrScs;
222
223 typedef enum
224 {
225    NRB_11,
226    NRB_18,
227    NRB_24,
228    NRB_25,
229    NRB_31,
230    NRB_32,
231    NRB_38,
232    NRB_51,
233    NRB_52,
234    NRB_65,
235    NRB_66,
236    NRB_78,
237    NRB_79,
238    NRB_93,
239    NRB_106,
240    NRB_107,
241    NRB_121,
242    NRB_132,
243    NRB_133,
244    NRB_135,
245    NRB_160,
246    NRB_162,
247    NRB_189,
248    NRB_216,
249    NRB_217,
250    NRB_245,
251    NRB_264,
252    NRB_270,
253    NRB_273
254 }F1Nrb;
255
256 typedef enum
257 {
258    VERY_SMALL,
259    SMALL,
260    MEDIUM,
261    LARGE
262 }F1CellType;
263
264 typedef enum
265 {
266    DL,
267    UL,
268    DL_UL
269 }F1CellDir;
270
271 typedef enum
272 {
273    UE_USAGE,
274    NON_UE_USAGE,
275    BOTH
276 }F1AssocUsage;
277
278 typedef enum
279 {
280    BARRED,
281    NOT_BARRED
282 }CellBarred;
283
284 typedef enum
285 {
286    OFFER,
287    EXECUTION
288 }F1ReqType;
289
290 typedef enum
291 {
292    IGNORE_YES,
293    IGNORE_NO
294 }F1IgnoreReq;
295
296 typedef enum
297 {
298    OVERLOADED,
299    NOT_OVERLOADED
300 }F1GnbDuOvrloadInfo;
301
302 typedef enum
303 {
304    REJECT_RRC_CONN_NON_EMERG_MODT,
305    REJECT_RRC_CONN_SIGNALLING,
306    PERMIT_EMERG_SESSION_AND_MOBILE_TERM_SERVICE,
307    PERMIT_HIGH_PRIOR_SESSION_AND_MOBILE_TERM_SERVICE
308 }F1UacStandardAction;
309
310 typedef struct f1RrcVersion
311 {
312    char    rrcVer[30];     /* Latest RRC Version */
313    U32   extRrcVer;  /* Latest RRC version extended */
314 }F1RrcVersion;
315
316 typedef struct f1FailCause
317 {
318    union
319    {
320       RadioNwCause      radioNwCause;     /* Radio Network Layer Cause */
321       TransLayerCause   transLayerCause;  /* Transport Layer Cause */
322       ProtocolCause     protCause;        /* Protocol Cause */
323       MiscCause         miscCause;        /* Miscellaneous Cause */
324    }cause;
325 }F1FailCause;
326
327 typedef struct f1ProcCode
328 {
329    Bool   pres;
330    U8     value;
331 }F1ProcCode;
332
333 typedef struct f1TriggMsg
334 {
335    Bool   pres;
336    F1TriggMsgVal   value;
337 }F1TriggMsg;
338
339 typedef struct f1ProcCrit
340 {
341    Bool   pres;
342    F1ProcCritVal   value;
343 }F1ProcCrit;
344
345 typedef struct f1CritDignosIE
346 {
347    F1ProcCritVal   ieCritVal;
348    U16             ieId;
349    F1ErrorType       type;
350 }F1CritDignosIE;
351
352 typedef struct f1CritDiagnostic
353 {
354    Bool         pres;
355    F1ProcCode   procCode;      /* Procedure Code */
356    F1TriggMsg   triggeringMsg; /* Triggering Message */
357    F1ProcCrit   procCrit;      /* Criticality of Triggering msg/proc */
358    U32          transId;
359    F1CritDignosIE diagnosIE;
360 }F1CritDiagnostic;
361
362 typedef struct f1FailureIE
363 {
364    U32                transId;        /* Uniquely identify transaction */
365    F1FailCause        cause;          /* Failure cause */
366    U8                 timeToWait;     /* Seconds to be waited before retry */
367    F1CritDiagnostic   critDiagnostic; /* Critical diagnostics */
368 }F1FailureIE;
369
370 typedef struct f1LogicalConnUeAssoc
371 {
372    U32   gnbCuUeF1apId;
373    U32   gnbDuUeF1apId;
374 }F1LogicalConnUeAssoc;
375
376 typedef struct f1ResetType
377 {
378    union
379    {
380       F1ResetAll             resetAll; /* Reset All */
381       F1LogicalConnUeAssoc   ueAssocLogicalConn[MAX_F1_CONNECTIONS]; /* In case of Partial Reset : UE associated logical F1 conn list*/
382    }type;
383 }F1ResetType;
384
385 typedef struct f1PLMN
386 {
387   U8 mcc[3];
388   U8 mnc[3];
389 }PlmnId;
390
391 typedef struct nrEcgi
392 {
393   PlmnId  plmn;
394   U16     cellId;
395 }NrEcgi;
396
397 typedef struct f1SibType
398 {
399    U8   sibType;
400    U8   sibMsg;
401    U8   value;
402 }F1SibType;
403
404 typedef struct f1TxBw
405 {
406    F1NrScs   nrScs; /* NR subcarrier spacing */
407    F1Nrb     nrb;   /* Transmission bandwidth expressed in units of RBs */
408 }F1TxBw;
409
410 typedef struct f1SulInfo
411 {
412    U32      sulArfcn; /* SUL ARFCN */
413    F1TxBw   sulTxBw;  /* SUL transmission bandwidth */ 
414 }F1SulInfo;
415
416 typedef struct f1FreqBand
417 {
418   U16   nrFreqBand;
419   U16   sulBand[MAXNRCELLBANDS];
420 }F1FreqBand;
421
422 typedef struct f1NrFreqInfo
423 {
424    U32        nrArfcn;
425    F1SulInfo  sulInfo;
426    F1FreqBand freqBand[MAXNRCELLBANDS];
427 }F1NrFreqInfo;
428
429 typedef struct f1NrFddInfo
430 {
431    F1NrFreqInfo   ulNrFreqInfo;  /* UL NR Frequency Info */
432    F1NrFreqInfo   dlNrFreqInfo;  /* DL NR Frequency Info */
433    F1TxBw         ulTxBw;        /* UL Transmission bandwidth */
434    F1TxBw         dlTxBw;        /* DL Transmission bandwidth */
435 }F1NrFddInfo;
436
437 typedef struct f1NrTddInfo
438 {
439    F1NrFreqInfo   nrFreqInfo;   /* NR Frequency Info */
440    F1TxBw       nrTxBw;       /* NR Transmission Bandwidth */
441 }F1NrTddInfo;
442
443 typedef struct f1NrModeInfo
444 {
445    union
446    {
447       F1NrFddInfo  fdd;
448       F1NrTddInfo  tdd;
449    }mode;
450 }NrModeInfo;
451
452 typedef struct f1EutraFddInfo
453 {
454    U16   ulOffset;   /* UL offset to Point A */
455    U16   dlOffset;   /* DL offset to Point A */
456 }F1EutraFDDInfo;
457
458 typedef struct f1EutraTddInfo
459 {
460    U16   tddOffset;  /* Offset to Point A */
461 }F1EutraTDDInfo;
462
463 typedef struct f1EutraModeInfo
464 {
465    union
466    {
467       F1EutraFDDInfo  fdd;
468       F1EutraTDDInfo  tdd;
469    }mode;
470 }F1EutraModeInfo;
471
472 typedef struct f1Snsaai
473 {
474    U8   sst;
475    U32  sd;
476 }F1Snsaai;
477
478 typedef struct epIpAddr
479 {
480    char transportAddr[20]; /* Transport Layer Address */
481 }EpIpAddr;
482
483 typedef struct epIpAddrPort
484 {
485     EpIpAddr epIpAddr;
486     char   port[2];
487 }EpIpAddrPort;
488
489 typedef struct f1TaiSliceSuppLst
490 {
491    Bool       pres;
492    F1Snsaai   snssai[MAXNUMOFSLICEITEMS];   
493 }F1TaiSliceSuppLst;
494
495 typedef struct f1SrvdPlmn
496 {
497    PlmnId              plmn;
498    F1TaiSliceSuppLst   taiSliceSuppLst;
499 }F1SrvdPlmn;
500
501 typedef struct f1BrdcstPlmnInfo
502 {
503    PlmnId   plmn[MAX_PLMN];     /* PLMN id list */
504    PlmnId   extPlmn[MAX_PLMN];   /* Extended PLMN id list */
505    U16      tac;                     /* 5GS-TAC */
506    U32      nrCellId;                /* NR Cell id */
507    U8       ranac;                   /* RAN Area code */
508 }F1BrdcstPlmnInfo;
509
510 typedef struct f1CellInfo
511 {
512    NrEcgi   nrCgi;                   /* Cell global Identity */
513    U32      nrPci;                   /* Physical Cell Identity */
514    PlmnId   plmn[MAX_PLMN];     /* Available PLMN list */
515    PlmnId   extPlmn[MAX_PLMN];  /* Extended available PLMN list */
516 }F1CellInfo;
517
518 typedef struct f1DuCellInfo
519 {
520    F1CellInfo         cellInfo;     /* cell info */
521    U16                tac;          /* tracking area code */
522    U16                epsTac;       /* Configured EPS TAC */
523    NrModeInfo         f1Mode;       /* NR mode info : FDD/TDD */
524    U8                 measTimeCfg;  /* Measurement timing configuration */
525    F1CellDir          cellDir;      /* Cell Direction */
526    F1CellType         cellType;     /* Cell Type */
527    F1BrdcstPlmnInfo   brdcstPlmnInfo[MAXBPLMNNRMINUS1]; /* Broadcast PLMN Identity Info List */
528 }F1DuCellInfo;
529
530 typedef struct f1DuSysInfo
531 {
532    U8   *mibMsg;   /* MIB message */
533    U8   *sib1Msg;  /* SIB1 message */
534 }F1DuSysInfo;
535
536 typedef struct f1CuSysInfo
537 {
538    F1SibType   sibTypeToUpd[MAXNUMOFSIBTYPES];   /* SIB types to be updated */
539 }F1CuSysInfo;
540
541 typedef struct f1DuSrvdCellInfo
542 {
543    F1DuCellInfo   duCellInfo;   /* gNB-DU served cell info */
544    F1DuSysInfo    duSysInfo;    /* gNB-DU System Information */
545 }F1DuSrvdCellInfo;
546
547 typedef struct f1DuSrvdCellToDel
548 {
549    NrEcgi             oldNrCgi;     /* Old NR CGI */
550    F1DuSrvdCellInfo   srvdCellInfo; /* Info of served cell to be deleted */ 
551 }F1DuSrvdCellToDel;
552
553 typedef struct f1CuActCellInfo
554 {
555    F1CellInfo    cuCellInfo;   /* gNB-CU available cell info */
556    F1CuSysInfo   cuSysInfo;    /* gNB-CU System Information */
557 }F1CuActCellInfo;
558
559 typedef struct f1ActCellFail
560 {
561    NrEcgi        nrCgi;
562    F1FailCause   cause;
563 }F1ActCellFail;
564
565 typedef struct srvStatus
566 {
567   SrvState    state;
568   Bool        switchOffOngoing;
569 }SrvStatus;
570
571 typedef struct f1CellStatus
572 {
573    NrEcgi      nrEcgi;
574    SrvStatus   status;   /* Service status */
575 }F1CellStatus;
576
577 typedef struct f1DedSIDelUE
578 {
579    U32      gnbCuUeF1apId;
580    NrEcgi   nrEcgi;
581 }F1DedSIDelUE;
582
583 typedef struct tnlAssocInfo
584 {
585    Bool           pres;
586    EpIpAddr       epIpAddr;      /* Endpoint-IP Address */
587    EpIpAddrPort   epIpAddrport;  /* Endpoint-IP Address and Port */
588 }F1TnlAssocAddr;
589
590 typedef struct f1TnlAssocUsage
591 {
592     Bool           pres;
593     F1AssocUsage   usage;
594 }F1TnlAssocUsage;
595
596 typedef struct f1TnlAssoc
597 {
598    F1TnlAssocAddr   assocInfo;    /* TNL Assoc Transport Layer Info */
599    F1TnlAssocUsage  assocUsage;   /* TNL Assoc usage */
600 }F1TnlAssoc;
601
602 typedef struct f1TnlAssocToRmv
603 {
604    F1TnlAssocAddr   assocInfoCu;   /* TNL Assoc Transport Layer Info of CU */
605    F1TnlAssocAddr   assocInfoDu;   /* TNL Assoc Transport Layer Info of DU */
606 }F1TnlAssocToRmv;
607
608 typedef struct f1TnlAssocSetupFail
609 {
610    F1TnlAssocAddr   assocInfo;
611    F1FailCause      cause;
612 }F1TnlAssocSetupFail;
613
614
615 typedef struct f1CellBarred
616 {
617    NrEcgi       nrcgi;
618    CellBarred   cellBarred;
619 }F1CellBarred;
620
621 typedef struct f1EutraCell
622 {
623    U32                eutraCellId; /* EUTRA cell id */
624    F1EutraModeInfo    mode;        /* EUTRA mode info : FDD/TDD */
625    U8                 rsrcInd;     /* Protected EUTRA resource Indication */
626 }F1EutraCell;
627
628 typedef struct f1ProtectEUTRARsrc
629 {
630    U32           specShareGrpId;               /* Spectrum sharing group id */
631    F1EutraCell   eutraCellList[MAXCELLINENB];  /* EUTRA cells list */
632 }F1ProtectEUTRARsrc;
633
634 typedef struct f1UacOperatorDefined
635 {
636    U8   accessCategory;
637    U8   accessId; 
638 }F1UacOperatorDefined;
639
640 typedef struct f1UacCategoryType
641 {
642    union
643    {
644       F1UacStandardAction    action;      /* UAC standardized action */
645       F1UacOperatorDefined   operatorDef; /* UAC operator defined */
646    }type;
647 }F1UacCategoryType;
648
649 typedef struct f1UacType
650 {
651    U8                  uacReducInd;     /* Value 0 means no access rate reduction. Value 100 means full access rate reduction */
652    F1UacCategoryType   uacCategoryType; /* UAC Category type */
653 }F1UacType;
654
655 /* Unified Access Class Assistance Information */
656 typedef struct f1UacAssistInfo
657 {
658    PlmnId      plmn[MAXNUMOFUACPLMN];        /* UAC PLMN list */
659    F1UacType   uacType[MAXNUMOFUACPERPLMN];  /* UAC Type list */
660 }F1UacAssistInfo;
661
662 /* F1 setup related structures */
663
664 typedef struct f1SetupReq
665 {
666   U32                transId;                       /* Uniquely identify transaction */
667   U32                duId;                          /* DU ID */ 
668   char               duName[CU_DU_NAME_LEN_MAX];    /* DU name */
669   F1DuSrvdCellInfo   srvdCellLst[DU_MAX_CELLS];   /* Serving cell list */
670   F1RrcVersion       rrcVersion;                    /* RRC version */
671 }F1SetupReq;
672
673 typedef struct f1setupRsp
674 {
675   U32               transId;                      /* Uniquely identify transaction */
676   char              cuName[CU_DU_NAME_LEN_MAX];   /* CU Name */
677   F1CuActCellInfo   actCellInfo;                  /* cells to be activated */
678   F1RrcVersion      rrcVersion;                   /* RRC version */
679 }F1SetupRsp;
680
681 typedef struct f1SetupFail
682 {
683    F1FailureIE   setupFail;
684 }F1SetupFail;
685
686 /* At reception of the RESET message the gNB-DU shall release all allocated resources on F1 
687  * and radio resources related to the UE association(s) indicated explicitly or implicitly in 
688  * the RESET message and remove the indicated UE contexts including F1AP ID. */
689 typedef struct f1Reset
690 {
691   U32              transId;   /* Uniquely identify transaction */
692   F1FailCause      cause;     /* Failure cause */
693   F1ResetType      resetType; /* type of reset */
694 }F1Reset;
695
696 /* After the gNB-CU has released all assigned F1 resources and the UE F1AP IDs for all indicated
697  * UE associations which can be used for new UE-associated logical F1-connections over the F1 interface,
698  *  the gNB-CU shall respond with the RESET ACKNOWLEDGE message. */
699 typedef struct f1ResetAck
700 {
701   U32                    transId;         /* Uniquely identify transaction */
702   F1LogicalConnUeAssoc   ueAssocLogicalConn[MAX_F1_CONNECTIONS]; /* UE associated logical F1-connection list */
703   F1CritDiagnostic       critDiagnostic;  /* Critical diagnostics */
704 }F1ResetAck;
705
706 typedef struct f1ErrorInd
707 {
708   U32                transId;         /* Uniquely identify transaction */
709   F1Entity           errorOrigin;     /* Specifies if error is originated at DU or CU */
710   F1FailCause        cause;           /* Failure cause */
711 /* If failure is due to Ue related message. */
712   U32                gnbCuUeF1apId;   /* gNB-CU UE F1AP Id */
713   U32                gnbDuUeF1apId;   /* gNB-DU UE F1AP Id */
714   F1CritDiagnostic   critDiagnostic;  /* Critical diagnostics */
715 }F1ErrorInd;
716
717 typedef struct f1GnbDuCfgUpd
718 {
719   U32                 transId;                             /* Uniquely identify transaction */
720   F1DuSrvdCellInfo    srvdCellLstAdd[DU_MAX_CELLS];      /* Served cell list to be added */
721   F1DuSrvdCellToDel   srvdCellLstMod[DU_MAX_CELLS];      /* Served cell list to be modified */
722   NrEcgi              srvdCellLstDel[DU_MAX_CELLS];      /* Served cell list to be deleted */
723   F1CellStatus        cellStatus[DU_MAX_CELLS];          /* Cell status */
724   F1DedSIDelUE        ueLst[MAX_UEID];                     /* Ue list that requires dedicated SI delivery */
725   U32                 gnbDuId;
726   F1TnlAssocToRmv     gnbDuTnlAssocRmv[MAX_TNL_ASSOC];  /* TNL Assoc list to remove */ 
727 }F1GnbDuCfgUpd;
728
729 typedef struct f1GnbDuCfgUpdAck
730 {
731    U32                transId;                      /* Uniquely identify transaction */
732    F1CuActCellInfo    cellLstAct[DU_MAX_CELLS];    /* List of cells to be activated */   
733    F1CritDiagnostic   critDiagnostic;               /* Critical diagnostics */
734    NrEcgi             cellLstDeact[DU_MAX_CELLS]; /* List of cells to be deactivated */
735 }F1GnbDuCfgUpdAck;
736
737 typedef struct f1GnbDuCfgUpdFail
738 {
739    F1FailureIE   gnbDuCfgUpdFail;
740 }F1GnbDuCfgUpdFail;
741
742 /* Sent by the gNB-CU to transfer updated information associated to an F1-C interface instance */
743 typedef struct f1GnbCuCfgUpd
744 {
745     U32                 transId;                            /* Uniquely identifies transaction */
746     F1CuActCellInfo     cellLstAct[DU_MAX_CELLS];         /* List of cells to be activated */
747     NrEcgi              cellLstDeact[DU_MAX_CELLS];       /* List of cells to be deactivated */
748     F1TnlAssoc          assocLstAdd[MAX_TNL_ASSOC];     /* List of TNL assocs to be added */
749     F1TnlAssoc          assocLstUpd[MAX_TNL_ASSOC];     /* List of TNL assocs to be updated */
750     F1TnlAssocToRmv     assocLstRmv[MAX_TNL_ASSOC];     /* List of TNL assocs to be removed */
751     F1CellBarred        cellToBarList[DU_MAX_CELLS];      /* List of Cells to be barred */
752     F1ProtectEUTRARsrc  protectEutraRsrcList[MAXCELLINENB]; /* List of Protected EUTRA resources */
753 }F1GnbCuCfgUpd;
754
755 /* Sent by a gNB-DU to a gNB-CU to acknowledge update of information
756  * associated to an F1-C interface instance */
757 typedef struct f1GnbCuCfgUpdAck
758 {
759     U32                   transId;                              /* Uniquely identify transaction */
760     F1ActCellFail         actCellFailList[DU_MAX_CELLS];      /* Cells failed to be activated list */
761     F1CritDiagnostic      critDiagnostic;                       /* Critical diagnostics */
762     F1TnlAssocAddr        assocSetupList[MAX_TNL_ASSOC];     /* TNL Assoc Setup list */
763     F1TnlAssocSetupFail   assocSetupFailList[MAX_TNL_ASSOC]; /* TNL Assoc Setup fail list */
764     F1DedSIDelUE          dedSiDelUelist[MAXNUMOFUEID];          /* Dedicated SI delivery needed UE list */
765 }F1GnbCuCfgUpdAck;
766
767 typedef struct f1GnbCuCfgUpdFail
768 {
769     F1FailureIE   gnbCuCfgUpdFail;
770 }F1GnbCuCfgUpdFail;
771
772 /* This procedure enables coordination of radio resource allocation between a gNB-CU and
773  * a gNB-DU. Coordination request is sent by CU to DU */
774 typedef struct f1GnbDuRsrcCoordReq
775 {
776    U32           transId;              /* Uniquely identifies transaction */
777    F1ReqType     reqType;              /* Request type */
778    U8            cellResCoordReqCont;  /* Container for X2AP E-UTRA - NR cell resource coordination request */
779    F1IgnoreReq   ignoreReq;            /* Ignore coordination request */
780 }F1GnbDuRsrcCoordReq;
781
782 /* This message is sent by a gNB-DU to a gNB-CU, to express the desired resource allocation
783  * for data traffic, as a response to the GNB-DU RESOURCE COORDINATION REQUEST. */
784 typedef struct f1GnbDuRsrcCoordRsp
785 {
786     U32   transId;               /* Uniquely identifies transaction */
787     U8    cellResCoordRspCont;   /* Container for X2AP E-UTRA - NR cell resource coordination response */
788 }F1GnbDuRsrcCoordRsp;
789
790 /* This message is sent by the gNB-DU to indicate to the gNB-CU its status of overload */
791 typedef struct f1GnbDuStatusInd
792 {
793    U32                  transId;      /* Uniquely identifies transaction */
794    F1GnbDuOvrloadInfo   ovrloadInfo;  /* gNB-DU overloaded information */
795 }F1GnbDuStatusInd;
796
797 /* This message is sent by either the gNB-DU or the gNB-CU to intiate the removal
798  * of the interface instance and the related resources */
799 typedef struct f1RmvReq
800 {
801    U32   transId; /* Uniquely identifies transaction */
802 }F1RmvReq;
803
804 /* This message acknowledges the initiation of removal of the interface
805  * instance and the related resources */
806 typedef struct f1RmvRsp
807 {
808    U32                transId;     /* Uniquely identifies transaction */
809    F1CritDiagnostic   critDiagnos; /* Crititcality diagnostics */
810 }F1RmvRsp;
811
812 /* This message indicates that removing the interface instance and the related
813  * resources cannot be accepted */
814 typedef struct f1RmvFail
815 {
816    U32                transId;         /* Uniquely identifies transaction */
817    F1FailCause        cause;          /* Failure cause */
818    F1CritDiagnostic   critDiagnostic; /* Criticality diagnostics */
819 }F1RmvFail;
820
821 /* This message is sent by the gNB-CU to indicate to the gNB-DU a need to reduce
822  * the rate at which UEs access the network. */
823 typedef struct f1NwkAccessRateRed
824 {
825    U32               transId;        /* Uniquely identifies transaction */
826    F1UacAssistInfo   uacAssistInfo;  /* UAC Assistance Information */
827 }F1NwkAccessRateRed;
828
829 typedef struct f1Ipaddr
830 {
831  Bool ipV4Pres;
832  U32  ipV4Addr; 
833 }F1IpAddr;
834
835 typedef struct f1SctpParams
836 {
837    F1IpAddr  duIpAddr;
838    U16       duPort;
839    F1IpAddr  cuIpAddr;
840    U16       cuPort;
841 }F1SctpParams;
842
843 typedef struct f1EgtpParams
844 {
845    F1IpAddr  localIp;      /* Ip address of local node */
846    U16       localPort;    /* Sender Port at local node */
847    F1IpAddr  destIp;       /* Ip address of peer node */
848    U16       destPort;     /* Sender port at peer node */
849    U32       minTunnelId;
850    U32       maxTunnelId;
851 }F1EgtpParams;
852
853 typedef struct cellCfgParams
854 {
855    NrEcgi      nrEcgi;         /* ECGI */
856    U16         nrPci;          /* PCI */
857    U16         fiveGsTac;         /* 5gSTac */
858    PlmnId      plmn[MAX_PLMN]; /* List of serving PLMN IDs */
859    U8          ranac;          /* RAN Area Code */
860    U32         maxUe;          /* max UE per slot */
861 }CellCfgParams;
862
863 typedef struct schedulerCfg
864 {
865    U8         numTxAntPorts;    /*!< Number of Tx antenna ports */
866    U8         ulSchdType;     /*!< Indicates which UL scheduler to use, range
867                                * is 0..(number of schedulers - 1) */
868    U8         dlSchdType;     /*!< Indicates which DL scheduler to use, range
869                                * is 0..(number of schedulers - 1) */
870    U8         numCells;       /*!< Max number of cells */
871    U8         maxUlUePerTti;  /*!< Max number of UE in UL per TTI */
872    U8         maxDlUePerTti;  /*!< Max number of UE in DL per TTI */
873 }SchedulerCfg;
874
875 typedef struct mibParams
876 {
877         uint8_t sysFrmNum;
878         long    subCarrierSpacingCommon;
879         long    ssb_SubcarrierOffset;
880         long    dmrs_TypeA_Position;
881         long    controlResourceSetZero;
882         long    searchSpaceZero;
883         long    cellBarred;
884         long    intraFreqReselection;
885 }MibParams;
886
887 typedef struct sib1Params
888 {
889         PlmnId    plmn;
890         uint8_t   tac;
891         long      ranac;
892         U8        cellIdentity;
893         long      cellResvdForOpUse;
894 }Sib1Params;
895
896 typedef struct duCfgParams
897 {
898    F1SctpParams       sctpParams;                    /* SCTP Params */
899    F1EgtpParams       egtpParams;                    /* EGTP Params */
900    U32                maxUe;
901    U32                duId;
902    U8                 duName[CU_DU_NAME_LEN_MAX];
903    SchedulerCfg       schedCfg;
904    CellCfgParams      cellCfg[DU_MAX_CELLS];  /* Cell info config*/
905    F1DuSrvdCellInfo   srvdCellLst[DU_MAX_CELLS];   /* Serving cell list *///TODO: this must be removed eventually
906    F1RrcVersion       rrcVersion;                    /* RRC version */
907
908    MacCellCfg         macCellCfg;       /* MAC cell configuration */
909    MibParams          mibParams;                     /* MIB Params */
910         Sib1Params         sib1Params;                    /* SIB1 Params */
911 }DuCfgParams;
912
913 typedef struct duCellCb
914 {
915    U32            cellId;      /* Internal cell Id */
916    CellCfgParams  cellInfo;    /* Cell info */
917    CellStatus     cellStatus;  /*Cell status */
918 }DuCellCb;
919
920 /*function declarations */
921 void FillSlotConfig();
922 S16 readClCfg();
923 S16 readCfg();
924 S16 duReadCfg(); 
925 S16 bitStringToInt(BIT_STRING_t *bitString, U16 *val);
926
927 #endif /* __DU_CONFIG_H__ */
928
929 /**********************************************************************
930          End of file
931 **********************************************************************/