61131344d0573df85ddc19c45b5497ac914d87d0
[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  * @brief
21  * @file
22  * @ingroup
23  * @author Intel Corporation
24  **/
25
26 #ifndef _SAMPLEAPP__CONFIG_H_
27 #define _SAMPLEAPP__CONFIG_H_
28
29 #include <stdint.h>
30 #include <rte_ether.h>
31 #include "xran_fh_o_du.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 xranCat;     /**< xran mode: Categoty A | Category B */
38     uint8_t numCC;        /**< Number of CC per ports supported by RU */
39     uint8_t numAxc;       /**< Number of Antenna Carriers per CC */
40     uint8_t numUlAxc;     /**< Number of Antenna Carriers per CC for UL (Cat B) */
41     uint32_t antElmTRx;   /**< Number of antenna elements for TX and RX */
42     uint32_t muMimoUEs;   /**< Number of UEs (with 1 RX ant)/beams */
43
44     uint32_t DlLayersPerUe; /**< Number of DL layer per UE */
45     uint32_t UlLayersPerUe; /**< Number of UL layer per UE */
46
47     uint32_t ttiPeriod;   /**< TTI period */
48     uint32_t testVect;    /**< Test Signal to send */
49     struct ether_addr o_du_addr; /**<  lls-CU Ethernet Mac Address */
50     struct ether_addr o_ru_addr; /**<  RU Ethernet Mac Address */
51     struct ether_addr tmp_addr; /**<  Temp Ethernet Mac Address */
52
53     uint32_t instance_id; /**<  Instance ID of application */
54     uint32_t io_core; /**<  Core used for IO */
55     uint64_t system_core; /* <system core ID> */
56     uint64_t pkt_proc_core;
57     uint64_t pkt_aux_core;
58     uint64_t timing_core;
59     
60     uint32_t mtu; /**< maximum transmission unit (MTU) is the size of the largest protocol data unit (PDU) that can be communicated in a single
61                        xRAN network layer transaction. supported 1500 bytes and 9600 bytes (Jumbo Frame) */
62     int numSlots;  /**< number of slots in IQ vector */
63     char ant_file[XRAN_MAX_SECTOR_NR*XRAN_MAX_ANTENNA_NR][512]; /**<  file to use for test vector */
64     char prach_file[XRAN_MAX_SECTOR_NR*XRAN_MAX_ANTENNA_NR][512]; /**<  file to use for test vector */
65
66     char dl_bfw_file [XRAN_MAX_SECTOR_NR*XRAN_MAX_ANTENNA_NR][512]; /**< file with beamforming weights for DL streams */
67     char ul_bfw_file [XRAN_MAX_SECTOR_NR*XRAN_MAX_ANTENNA_NR][512]; /**< file with beamforming weights for UL streams */
68
69     char ul_srs_file [XRAN_MAX_SECTOR_NR*XRAN_MAX_ANT_ARRAY_ELM_NR][512]; /**< file with SRS content for UL antenna elements */
70
71     /* prach config */
72     uint8_t enablePrach; /**<  enable PRACH */
73     uint8_t prachOffset; /**< Sets the PRACH position in frequency / subcarrier position, n_PRBoffset^RA and is expressed as a physical resource block number.
74                               Set by SIB2, prach-FreqOffset in E-UTRA. */
75
76     uint8_t prachConfigIndex; /**< TS36.211 - Table 5.7.1-2 : PRACH Configuration Index */
77     uint8_t iqswap; /**< do swap of IQ before send to ETH */
78     uint8_t nebyteorderswap; /**< do swap of byte order from host byte order to network byte order. ETH */
79     uint8_t compression;     /**< enable use case with compression */
80
81     uint16_t totalBfWeights; /**< The total number of beamforming weights on RU */
82
83     uint8_t enableSrs; /**< enable SRS (valid for Cat B only) */
84     uint16_t srsSymMask; /**< SRS symbol mask [014] within S/U slot [0-13] def is  13 */
85
86     uint16_t maxFrameId; /**< max value of frame id */
87
88     uint16_t Tadv_cp_dl;
89     uint16_t T2a_min_cp_dl;
90     uint16_t T2a_max_cp_dl;
91     uint16_t T2a_min_cp_ul;
92     uint16_t T2a_max_cp_ul;
93     uint16_t T2a_min_up;
94     uint16_t T2a_max_up;
95     uint16_t Ta3_min;
96     uint16_t Ta3_max;
97     uint16_t T1a_min_cp_dl;
98     uint16_t T1a_max_cp_dl;
99     uint16_t T1a_min_cp_ul;
100     uint16_t T1a_max_cp_ul;
101     uint16_t T1a_min_up;
102     uint16_t T1a_max_up;
103     uint16_t Ta4_min;
104     uint16_t Ta4_max;
105
106     uint8_t enableCP;    /**<  enable C-plane */
107     uint8_t cp_vlan_tag; /**<  C-plane vlan tag */
108     uint8_t up_vlan_tag; /**<  U-plane vlan tag */
109
110     int32_t debugStop;
111     int32_t debugStopCount;
112     int32_t bbdevMode;
113     int32_t DynamicSectionEna;
114     int32_t GPS_Alpha;
115     int32_t GPS_Beta;
116
117     uint8_t  mu_number;       /**< Mu numner as per 3GPP */
118     uint32_t nDLAbsFrePointA; /**< Abs Freq Point A of the Carrier Center Frequency for in KHz Value: 450000->52600000 */
119     uint32_t nULAbsFrePointA; /**< Abs Freq Point A of the Carrier Center Frequency for in KHz Value: 450000->52600000 */
120     uint32_t nDLBandwidth;    /**< Carrier bandwidth for in MHz. Value: 5->400 */
121     uint32_t nULBandwidth;    /**< Carrier bandwidth for in MHz. Value: 5->400 */
122     uint32_t nDLFftSize;      /**< DL FFT size */
123     uint32_t nULFftSize;      /**< UL FFT size */
124
125
126     uint8_t nFrameDuplexType;
127     uint8_t nTddPeriod;
128     struct xran_slot_config sSlotConfig[XRAN_MAX_TDD_PERIODICITY];
129     struct xran_prb_map PrbMapDl;
130     struct xran_prb_map PrbMapUl;
131 } RuntimeConfig;
132
133 /**
134  * Parse application configuration file.
135  *
136  * @param filename The name of the configuration file to be parsed.
137  * @param config The configuration structure to be filled with parsed data. */
138 int parseConfigFile(char *filename, RuntimeConfig *config);
139
140 #endif /* _SAMPLEAPP__CONFIG_H_ */