5c0e3e3191e9876b2920d96db5a9c3f41aa0f50f
[o-du/phy.git] / fhi_lib / app / src / config.h
1 /******************************************************************************\r
2 *\r
3 *   Copyright (c) 2019 Intel.\r
4 *\r
5 *   Licensed under the Apache License, Version 2.0 (the "License");\r
6 *   you may not use this file except in compliance with the License.\r
7 *   You may obtain a copy of the License at\r
8 *\r
9 *       http://www.apache.org/licenses/LICENSE-2.0\r
10 *\r
11 *   Unless required by applicable law or agreed to in writing, software\r
12 *   distributed under the License is distributed on an "AS IS" BASIS,\r
13 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14 *   See the License for the specific language governing permissions and\r
15 *   limitations under the License.\r
16 *\r
17 *******************************************************************************/\r
18 \r
19 /**\r
20  * @brief\r
21  * @file\r
22  * @ingroup\r
23  * @author Intel Corporation\r
24  **/\r
25 \r
26 #ifndef _SAMPLEAPP__CONFIG_H_\r
27 #define _SAMPLEAPP__CONFIG_H_\r
28 \r
29 #include <stdint.h>\r
30 #include <rte_ether.h>\r
31 #include "xran_fh_o_du.h"\r
32 \r
33 /** Run time configuration of application */\r
34 typedef struct _RuntimeConfig\r
35 {\r
36     uint8_t appMode;      /**< Application mode: lls-CU or RU  */\r
37     uint8_t xranCat;     /**< xran mode: Categoty A | Category B */\r
38     uint8_t numCC;        /**< Number of CC per ports supported by RU */\r
39     uint8_t numAxc;       /**< Number of Antenna Carriers per CC */\r
40     uint8_t numUlAxc;     /**< Number of Antenna Carriers per CC for UL (Cat B) */\r
41     uint32_t antElmTRx;   /**< Number of antenna elements for TX and RX */\r
42     uint32_t muMimoUEs;   /**< Number of UEs (with 1 RX ant)/beams */\r
43 \r
44     uint32_t DlLayersPerUe; /**< Number of DL layer per UE */\r
45     uint32_t UlLayersPerUe; /**< Number of UL layer per UE */\r
46 \r
47     uint32_t ttiPeriod;   /**< TTI period */\r
48     uint32_t testVect;    /**< Test Signal to send */\r
49     struct ether_addr o_du_addr; /**<  lls-CU Ethernet Mac Address */\r
50     struct ether_addr o_ru_addr; /**<  RU Ethernet Mac Address */\r
51     struct ether_addr tmp_addr; /**<  Temp Ethernet Mac Address */\r
52 \r
53     uint32_t instance_id; /**<  Instance ID of application */\r
54     uint32_t io_core; /**<  Core used for IO */\r
55 \r
56     uint32_t mtu; /**< maximum transmission unit (MTU) is the size of the largest protocol data unit (PDU) that can be communicated in a single\r
57                        xRAN network layer transaction. supported 1500 bytes and 9600 bytes (Jumbo Frame) */\r
58     int numSlots;  /**< number of slots in IQ vector */\r
59     char ant_file[XRAN_MAX_SECTOR_NR*XRAN_MAX_ANTENNA_NR][512]; /**<  file to use for test vector */\r
60     char prach_file[XRAN_MAX_SECTOR_NR*XRAN_MAX_ANTENNA_NR][512]; /**<  file to use for test vector */\r
61 \r
62     char dl_bfw_file [XRAN_MAX_SECTOR_NR*XRAN_MAX_ANTENNA_NR][512]; /**< file with beamforming weights for DL streams */\r
63     char ul_bfw_file [XRAN_MAX_SECTOR_NR*XRAN_MAX_ANTENNA_NR][512]; /**< file with beamforming weights for UL streams */\r
64 \r
65     char ul_srs_file [XRAN_MAX_SECTOR_NR*XRAN_MAX_ANT_ARRAY_ELM_NR][512]; /**< file with SRS content for UL antenna elements */\r
66 \r
67     /* prach config */\r
68     uint8_t enablePrach; /**<  enable PRACH */\r
69     uint8_t prachOffset; /**< Sets the PRACH position in frequency / subcarrier position, n_PRBoffset^RA and is expressed as a physical resource block number.\r
70                               Set by SIB2, prach-FreqOffset in E-UTRA. */\r
71 \r
72     uint8_t prachConfigIndex; /**< TS36.211 - Table 5.7.1-2 : PRACH Configuration Index */\r
73     uint8_t iqswap; /**< do swap of IQ before send to ETH */\r
74     uint8_t nebyteorderswap; /**< do swap of byte order from host byte order to network byte order. ETH */\r
75     uint8_t compression;     /**< enable use case with compression */\r
76 \r
77     uint16_t totalBfWeights; /**< The total number of beamforming weights on RU */\r
78 \r
79     uint8_t enableSrs; /**< enable SRS (valid for Cat B only) */\r
80     uint16_t srsSymMask; /**< SRS symbol mask [014] within S/U slot [0-13] def is  13 */\r
81 \r
82     uint16_t maxFrameId; /**< max value of frame id */\r
83 \r
84     uint16_t Tadv_cp_dl;\r
85     uint16_t T2a_min_cp_dl;\r
86     uint16_t T2a_max_cp_dl;\r
87     uint16_t T2a_min_cp_ul;\r
88     uint16_t T2a_max_cp_ul;\r
89     uint16_t T2a_min_up;\r
90     uint16_t T2a_max_up;\r
91     uint16_t Ta3_min;\r
92     uint16_t Ta3_max;\r
93     uint16_t T1a_min_cp_dl;\r
94     uint16_t T1a_max_cp_dl;\r
95     uint16_t T1a_min_cp_ul;\r
96     uint16_t T1a_max_cp_ul;\r
97     uint16_t T1a_min_up;\r
98     uint16_t T1a_max_up;\r
99     uint16_t Ta4_min;\r
100     uint16_t Ta4_max;\r
101 \r
102     uint8_t enableCP;    /**<  enable C-plane */\r
103     uint8_t cp_vlan_tag; /**<  C-plane vlan tag */\r
104     uint8_t up_vlan_tag; /**<  U-plane vlan tag */\r
105 \r
106     int32_t debugStop;\r
107     int32_t debugStopCount;\r
108     int32_t bbdevMode;\r
109     int32_t DynamicSectionEna;\r
110     int32_t GPS_Alpha;\r
111     int32_t GPS_Beta;\r
112 \r
113     uint8_t  mu_number;       /**< Mu numner as per 3GPP */\r
114     uint32_t nDLAbsFrePointA; /**< Abs Freq Point A of the Carrier Center Frequency for in KHz Value: 450000->52600000 */\r
115     uint32_t nULAbsFrePointA; /**< Abs Freq Point A of the Carrier Center Frequency for in KHz Value: 450000->52600000 */\r
116     uint32_t nDLBandwidth;    /**< Carrier bandwidth for in MHz. Value: 5->400 */\r
117     uint32_t nULBandwidth;    /**< Carrier bandwidth for in MHz. Value: 5->400 */\r
118     uint32_t nDLFftSize;      /**< DL FFT size */\r
119     uint32_t nULFftSize;      /**< UL FFT size */\r
120 \r
121 \r
122     uint8_t nFrameDuplexType;\r
123     uint8_t nTddPeriod;\r
124     struct xran_slot_config sSlotConfig[XRAN_MAX_TDD_PERIODICITY];\r
125     struct xran_prb_map PrbMapDl;\r
126     struct xran_prb_map PrbMapUl;\r
127 } RuntimeConfig;\r
128 \r
129 /**\r
130  * Parse application configuration file.\r
131  *\r
132  * @param filename The name of the configuration file to be parsed.\r
133  * @param config The configuration structure to be filled with parsed data. */\r
134 int parseConfigFile(char *filename, RuntimeConfig *config);\r
135 \r
136 #endif /* _SAMPLEAPP__CONFIG_H_ */\r