c223b0b074d3607bc54083658747ace56679a4e8
[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 #include "xran_fh_o_du.h"
33
34 /** Run time configuration of application */
35 typedef struct _RuntimeConfig
36 {
37     uint8_t appMode;      /**< Application mode: lls-CU or RU  */
38     uint8_t xranMode;     /**< xran mode: Categoty A | Category B */
39     uint8_t numCC;        /**< Number of CC per ports supported by RU */
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 o_du_addr; /**<  lls-CU Ethernet Mac Address */
44     struct ether_addr o_ru_addr; /**<  RU Ethernet Mac Address */
45     struct ether_addr tmp_addr; /**<  Temp Ethernet Mac Address */
46
47     uint32_t mtu; /**< maximum transmission unit (MTU) is the size of the largest protocol data unit (PDU) that can be communicated in a single
48                        xRAN network layer transaction. supported 1500 bytes and 9600 bytes (Jumbo Frame) */
49     int numSlots;  /**< number of slots in IQ vector */
50     char ant_file[XRAN_MAX_SECTOR_NR*XRAN_MAX_ANTENNA_NR][512] /**<  file to use for test vector */ ;
51     char prach_file[XRAN_MAX_SECTOR_NR*XRAN_MAX_ANTENNA_NR][512] /**<  file to use for test vector */ ;
52
53     /* prach config */
54     uint8_t enablePrach; /**<  enable PRACH */
55     uint8_t prachOffset; /**< Sets the PRACH position in frequency / subcarrier position, n_PRBoffset^RA and is expressed as a physical resource block number.
56                               Set by SIB2, prach-FreqOffset in E-UTRA. */
57
58     uint8_t prachConfigIndex; /**< TS36.211 - Table 5.7.1-2 : PRACH Configuration Index */
59     uint8_t iqswap; /**< do swap of IQ before send to ETH */
60     uint8_t nebyteorderswap; /**< do swap of byte order from host byte order to network byte order. ETH */
61
62     uint16_t Tadv_cp_dl;
63     uint16_t T2a_min_cp_dl;
64     uint16_t T2a_max_cp_dl;
65     uint16_t T2a_min_cp_ul;
66     uint16_t T2a_max_cp_ul;
67     uint16_t T2a_min_up;
68     uint16_t T2a_max_up;
69     uint16_t Ta3_min;
70     uint16_t Ta3_max;
71     uint16_t T1a_min_cp_dl;
72     uint16_t T1a_max_cp_dl;
73     uint16_t T1a_min_cp_ul;
74     uint16_t T1a_max_cp_ul;
75     uint16_t T1a_min_up;
76     uint16_t T1a_max_up;
77     uint16_t Ta4_min;
78     uint16_t Ta4_max;
79
80     uint8_t enableCP;    /**<  enable C-plane */
81     uint8_t cp_vlan_tag; /**<  C-plane vlan tag */
82     uint8_t up_vlan_tag; /**<  U-plane vlan tag */
83
84     int32_t debugStop;
85     int32_t debugStopCount;
86     int32_t bbdevMode;
87     int32_t DynamicSectionEna;
88
89     uint8_t  mu_number;       /**< Mu numner as per 3GPP */
90     uint32_t nDLAbsFrePointA; /**< Abs Freq Point A of the Carrier Center Frequency for in KHz Value: 450000->52600000 */
91     uint32_t nULAbsFrePointA; /**< Abs Freq Point A of the Carrier Center Frequency for in KHz Value: 450000->52600000 */
92     uint32_t nDLBandwidth;    /**< Carrier bandwidth for in MHz. Value: 5->400 */
93     uint32_t nULBandwidth;    /**< Carrier bandwidth for in MHz. Value: 5->400 */
94     uint32_t nDLFftSize;      /**< DL FFT size */
95     uint32_t nULFftSize;      /**< UL FFT size */
96
97
98     uint8_t nFrameDuplexType;
99     uint8_t nTddPeriod;
100     struct xran_slot_config sSlotConfig[XRAN_MAX_TDD_PERIODICITY];
101 } RuntimeConfig;
102
103 /**
104  * Parse application configuration file.
105  *
106  * @param filename The name of the configuration file to be parsed.
107  * @param config The configuration structure to be filled with parsed data. */
108 int parseConfigFile(char *filename, RuntimeConfig *config);
109
110 #endif /* _SAMPLEAPP__CONFIG_H_ */