Front Haul Interface Library first seed code contribution
[o-du/phy.git] / fhi_lib / app / src / config.h
1 /******************************************************************************
2 *
3 *   Copyright (c) 2019 Intel.
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
20 /**
21  * @brief
22  * @file
23  * @ingroup
24  * @author Intel Corporation
25  **/
26
27 #ifndef _SAMPLEAPP__CONFIG_H_
28 #define _SAMPLEAPP__CONFIG_H_
29
30 #include <stdint.h>
31 #include <rte_ether.h>
32
33 /** Run time configuration of application */
34 typedef struct _RuntimeConfig
35 {
36     uint8_t appMode;      /**< Application mode: lls-CU or RU  */
37     uint8_t xranMode;     /**< xran mode: Categoty A | Category B */
38     uint8_t numCC;        /**< Number of CC per ports supported by RU */
39     uint8_t mu_number;    /**< Mu numner as per 3GPP */
40     uint8_t numAxc;       /**< Number of Antenna Carriers per CC */
41     uint32_t ttiPeriod;   /**< TTI period */
42     uint32_t testVect;    /**< Test Signal to send */
43     struct ether_addr lls_cu_addr; /**<  lls-CU Ethernet Mac Address */
44     struct ether_addr ru_addr; /**<  RU Ethernet Mac Address */
45     char ant_file[16][512] /**<  file to use for test vector */ ;
46
47     /* prach config */
48     uint8_t enablePrach; /**<  enable PRACH */
49     uint8_t prachOffset; /**< Sets the PRACH position in frequency / subcarrier position, n_PRBoffset^RA and is expressed as a physical resource block number.
50                               Set by SIB2, prach-FreqOffset in E-UTRA. */
51
52     uint8_t prachConfigIndex; /**< TS36.211 - Table 5.7.1-2 : PRACH Configuration Index */
53     uint8_t iqswap; /**< do swap of IQ before send to ETH */
54     uint8_t nebyteorderswap; /**< do swap of byte order from host byte order to network byte order. ETH */
55
56     uint16_t Tadv_cp_dl;
57     uint16_t T2a_min_cp_dl;
58     uint16_t T2a_max_cp_dl;
59     uint16_t T2a_min_cp_ul;
60     uint16_t T2a_max_cp_ul;
61     uint16_t T2a_min_up;
62     uint16_t T2a_max_up;
63     uint16_t Ta3_min;
64     uint16_t Ta3_max;
65     uint16_t T1a_min_cp_dl;
66     uint16_t T1a_max_cp_dl;
67     uint16_t T1a_min_cp_ul;
68     uint16_t T1a_max_cp_ul;
69     uint16_t T1a_min_up;
70     uint16_t T1a_max_up;
71     uint16_t Ta4_min;
72     uint16_t Ta4_max;
73
74     uint8_t enableCP;    /**<  enable C-plane */
75     uint8_t cp_vlan_tag; /**<  C-plane vlan tag */
76     uint8_t up_vlan_tag; /**<  U-plane vlan tag */
77
78     int32_t debugStop;
79
80
81 } RuntimeConfig;
82
83 /**
84  * Parse application configuration file.
85  *
86  * @param filename The name of the configuration file to be parsed.
87  * @param config The configuration structure to be filled with parsed data. */
88 int parseConfigFile(char *filename, RuntimeConfig *config);
89
90 #endif /* _SAMPLEAPP__CONFIG_H_ */