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