bd0a4820445a8c622164f342e6c744fe8b01ad00
[dpdk.git] / drivers / net / sfc / base / efx_check.h
1 /*
2  * Copyright (c) 2012-2016 Solarflare Communications Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  *    this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  *    this list of conditions and the following disclaimer in the documentation
12  *    and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
18  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  *
26  * The views and conclusions contained in the software and documentation are
27  * those of the authors and should not be interpreted as representing official
28  * policies, either expressed or implied, of the FreeBSD Project.
29  */
30
31 #ifndef _SYS_EFX_CHECK_H
32 #define _SYS_EFX_CHECK_H
33
34 #include "efsys.h"
35
36 /*
37  * Check that the efsys.h header in client code has a valid combination of
38  * EFSYS_OPT_xxx options.
39  *
40  * NOTE: Keep checks for obsolete options here to ensure that they are removed
41  * from client code (and do not reappear in merges from other branches).
42  */
43
44 #ifdef EFSYS_OPT_FALCON
45 # error "FALCON is obsolete and is not supported."
46 #endif
47
48 #if EFSYS_OPT_CHECK_REG
49 /* Verify chip implements accessed registers */
50 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
51 #  error "CHECK_REG requires SIENA or HUNTINGTON or MEDFORD"
52 # endif
53 #endif /* EFSYS_OPT_CHECK_REG */
54
55 #if EFSYS_OPT_DECODE_INTR_FATAL
56 /* Decode fatal errors */
57 # if !EFSYS_OPT_SIENA
58 #  error "INTR_FATAL requires SIENA"
59 # endif
60 #endif /* EFSYS_OPT_DECODE_INTR_FATAL */
61
62 #if EFSYS_OPT_DIAG
63 /* Support diagnostic hardware tests */
64 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
65 #  error "DIAG requires SIENA or HUNTINGTON or MEDFORD"
66 # endif
67 #endif /* EFSYS_OPT_DIAG */
68
69 #if EFSYS_OPT_EV_PREFETCH
70 /* Support optimized EVQ data access */
71 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
72 #  error "EV_PREFETCH requires SIENA or HUNTINGTON or MEDFORD"
73 # endif
74 #endif /* EFSYS_OPT_EV_PREFETCH */
75
76 #ifdef EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE
77 # error "FALCON_NIC_CFG_OVERRIDE is obsolete and is not supported."
78 #endif
79
80 #if EFSYS_OPT_FILTER
81 /* Support hardware packet filters */
82 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
83 #  error "FILTER requires SIENA or HUNTINGTON or MEDFORD"
84 # endif
85 #endif /* EFSYS_OPT_FILTER */
86
87 #if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
88 # if !EFSYS_OPT_FILTER
89 #  error "HUNTINGTON or MEDFORD requires FILTER"
90 # endif
91 #endif /* EFSYS_OPT_HUNTINGTON */
92
93 #if EFSYS_OPT_LOOPBACK
94 /* Support hardware loopback modes */
95 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
96 #  error "LOOPBACK requires SIENA or HUNTINGTON or MEDFORD"
97 # endif
98 #endif /* EFSYS_OPT_LOOPBACK */
99
100 #ifdef EFSYS_OPT_MAC_FALCON_GMAC
101 # error "MAC_FALCON_GMAC is obsolete and is not supported."
102 #endif
103
104 #ifdef EFSYS_OPT_MAC_FALCON_XMAC
105 # error "MAC_FALCON_XMAC is obsolete and is not supported."
106 #endif
107
108 #if EFSYS_OPT_MAC_STATS
109 /* Support MAC statistics */
110 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
111 #  error "MAC_STATS requires SIENA or HUNTINGTON or MEDFORD"
112 # endif
113 #endif /* EFSYS_OPT_MAC_STATS */
114
115 #if EFSYS_OPT_MCDI
116 /* Support management controller messages */
117 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
118 #  error "MCDI requires SIENA or HUNTINGTON or MEDFORD"
119 # endif
120 #endif /* EFSYS_OPT_MCDI */
121
122 #if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
123 # if !EFSYS_OPT_MCDI
124 #  error "SIENA or HUNTINGTON or MEDFORD requires MCDI"
125 # endif
126 #endif
127
128 #if EFSYS_OPT_MCDI_LOGGING
129 /* Support MCDI logging */
130 # if !EFSYS_OPT_MCDI
131 #  error "MCDI_LOGGING requires MCDI"
132 # endif
133 #endif /* EFSYS_OPT_MCDI_LOGGING */
134
135 #if EFSYS_OPT_MCDI_PROXY_AUTH
136 /* Support MCDI proxy authorization */
137 # if !EFSYS_OPT_MCDI
138 #  error "MCDI_PROXY_AUTH requires MCDI"
139 # endif
140 #endif /* EFSYS_OPT_MCDI_PROXY_AUTH */
141
142 #ifdef EFSYS_OPT_MON_LM87
143 # error "MON_LM87 is obsolete and is not supported."
144 #endif
145
146 #ifdef EFSYS_OPT_MON_MAX6647
147 # error "MON_MAX6647 is obsolete and is not supported."
148 #endif
149
150 #ifdef EFSYS_OPT_MON_NULL
151 # error "MON_NULL is obsolete and is not supported."
152 #endif
153
154 #ifdef EFSYS_OPT_MON_SIENA
155 #  error "MON_SIENA is obsolete (replaced by MON_MCDI)."
156 #endif
157
158 #ifdef EFSYS_OPT_MON_HUNTINGTON
159 #  error "MON_HUNTINGTON is obsolete (replaced by MON_MCDI)."
160 #endif
161
162 #if EFSYS_OPT_MON_STATS
163 /* Support monitor statistics (voltage/temperature) */
164 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
165 #  error "MON_STATS requires SIENA or HUNTINGTON or MEDFORD"
166 # endif
167 #endif /* EFSYS_OPT_MON_STATS */
168
169 #if EFSYS_OPT_MON_MCDI
170 /* Support Monitor via mcdi */
171 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
172 #  error "MON_MCDI requires SIENA or HUNTINGTON or MEDFORD"
173 # endif
174 #endif /* EFSYS_OPT_MON_MCDI*/
175
176 #if EFSYS_OPT_NAMES
177 /* Support printable names for statistics */
178 # if !(EFSYS_OPT_LOOPBACK || EFSYS_OPT_MAC_STATS || EFSYS_OPT_MCDI || \
179         EFSYS_MON_STATS || EFSYS_OPT_PHY_STATS || EFSYS_OPT_QSTATS)
180 #  error "NAMES requires LOOPBACK or xxxSTATS or MCDI"
181 # endif
182 #endif /* EFSYS_OPT_NAMES */
183
184 #if EFSYS_OPT_NVRAM
185 /* Support non volatile configuration */
186 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
187 #  error "NVRAM requires SIENA or HUNTINGTON or MEDFORD"
188 # endif
189 #endif /* EFSYS_OPT_NVRAM */
190
191 #ifdef EFSYS_OPT_NVRAM_FALCON_BOOTROM
192 # error "NVRAM_FALCON_BOOTROM is obsolete and is not supported."
193 #endif
194
195 #ifdef EFSYS_OPT_NVRAM_SFT9001
196 # error "NVRAM_SFT9001 is obsolete and is not supported."
197 #endif
198
199 #ifdef EFSYS_OPT_NVRAM_SFX7101
200 # error "NVRAM_SFX7101 is obsolete and is not supported."
201 #endif
202
203 #ifdef EFSYS_OPT_PCIE_TUNE
204 # error "PCIE_TUNE is obsolete and is not supported."
205 #endif
206
207 #ifdef EFSYS_OPT_PHY_BIST
208 # error "PHY_BIST is obsolete (replaced by BIST)."
209 #endif
210
211 #if EFSYS_OPT_PHY_FLAGS
212 /* Support PHY flags */
213 # if !EFSYS_OPT_SIENA
214 #  error "PHY_FLAGS requires SIENA"
215 # endif
216 #endif /* EFSYS_OPT_PHY_FLAGS */
217
218 #if EFSYS_OPT_PHY_LED_CONTROL
219 /* Support for PHY LED control */
220 # if !EFSYS_OPT_SIENA
221 #  error "PHY_LED_CONTROL requires SIENA"
222 # endif
223 #endif /* EFSYS_OPT_PHY_LED_CONTROL */
224
225 #ifdef EFSYS_OPT_PHY_NULL
226 # error "PHY_NULL is obsolete and is not supported."
227 #endif
228
229 #ifdef EFSYS_OPT_PHY_PM8358
230 # error "PHY_PM8358 is obsolete and is not supported."
231 #endif
232
233 #ifdef EFSYS_OPT_PHY_PROPS
234 # error "PHY_PROPS is obsolete and is not supported."
235 #endif
236
237 #ifdef EFSYS_OPT_PHY_QT2022C2
238 # error "PHY_QT2022C2 is obsolete and is not supported."
239 #endif
240
241 #ifdef EFSYS_OPT_PHY_QT2025C
242 # error "PHY_QT2025C is obsolete and is not supported."
243 #endif
244
245 #ifdef EFSYS_OPT_PHY_SFT9001
246 # error "PHY_SFT9001 is obsolete and is not supported."
247 #endif
248
249 #ifdef EFSYS_OPT_PHY_SFX7101
250 # error "PHY_SFX7101 is obsolete and is not supported."
251 #endif
252
253 #if EFSYS_OPT_PHY_STATS
254 /* Support PHY statistics */
255 # if !EFSYS_OPT_SIENA
256 #  error "PHY_STATS requires SIENA"
257 # endif
258 #endif /* EFSYS_OPT_PHY_STATS */
259
260 #ifdef EFSYS_OPT_PHY_TXC43128
261 # error "PHY_TXC43128 is obsolete and is not supported."
262 #endif
263
264 #if EFSYS_OPT_QSTATS
265 /* Support EVQ/RXQ/TXQ statistics */
266 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
267 #  error "QSTATS requires SIENA or HUNTINGTON or MEDFORD"
268 # endif
269 #endif /* EFSYS_OPT_QSTATS */
270
271 #ifdef EFSYS_OPT_RX_HDR_SPLIT
272 # error "RX_HDR_SPLIT is obsolete and is not supported"
273 #endif
274
275 #if EFSYS_OPT_RX_SCALE
276 /* Support receive scaling (RSS) */
277 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
278 #  error "RX_SCALE requires SIENA or HUNTINGTON or MEDFORD"
279 # endif
280 #endif /* EFSYS_OPT_RX_SCALE */
281
282 #if EFSYS_OPT_RX_SCATTER
283 /* Support receive scatter DMA */
284 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
285 #  error "RX_SCATTER requires SIENA or HUNTINGTON or MEDFORD"
286 # endif
287 #endif /* EFSYS_OPT_RX_SCATTER */
288
289 #ifdef EFSYS_OPT_STAT_NAME
290 # error "STAT_NAME is obsolete (replaced by NAMES)."
291 #endif
292
293 #if EFSYS_OPT_VPD
294 /* Support PCI Vital Product Data (VPD) */
295 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
296 #  error "VPD requires SIENA or HUNTINGTON or MEDFORD"
297 # endif
298 #endif /* EFSYS_OPT_VPD */
299
300 #ifdef EFSYS_OPT_WOL
301 # error "WOL is obsolete and is not supported"
302 #endif /* EFSYS_OPT_WOL */
303
304 #ifdef EFSYS_OPT_MCAST_FILTER_LIST
305 #  error "MCAST_FILTER_LIST is obsolete and is not supported"
306 #endif
307
308 #if EFSYS_OPT_BIST
309 /* Support BIST */
310 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
311 #  error "BIST requires SIENA or HUNTINGTON or MEDFORD"
312 # endif
313 #endif /* EFSYS_OPT_BIST */
314
315 #if EFSYS_OPT_ALLOW_UNCONFIGURED_NIC
316 /* Support adapters with missing static config (for factory use only) */
317 # if !EFSYS_OPT_MEDFORD
318 #  error "ALLOW_UNCONFIGURED_NIC requires MEDFORD"
319 # endif
320 #endif /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */
321
322 #if EFSYS_OPT_RX_PACKED_STREAM
323 /* Support packed stream mode */
324 # if !(EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
325 #  error "PACKED_STREAM requires HUNTINGTON or MEDFORD"
326 # endif
327 #endif
328
329 #endif /* _SYS_EFX_CHECK_H */