New upstream version 18.08
[deb_dpdk.git] / drivers / net / sfc / base / efx_check.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright (c) 2012-2018 Solarflare Communications Inc.
4  * All rights reserved.
5  */
6
7 #ifndef _SYS_EFX_CHECK_H
8 #define _SYS_EFX_CHECK_H
9
10 #include "efsys.h"
11
12 /*
13  * Check that the efsys.h header in client code has a valid combination of
14  * EFSYS_OPT_xxx options.
15  *
16  * NOTE: Keep checks for obsolete options here to ensure that they are removed
17  * from client code (and do not reappear in merges from other branches).
18  */
19
20 #ifdef EFSYS_OPT_FALCON
21 # error "FALCON is obsolete and is not supported."
22 #endif
23
24 #if EFSYS_OPT_BOOTCFG
25 /* Support NVRAM based boot config */
26 # if !EFSYS_OPT_NVRAM
27 #  error "BOOTCFG requires NVRAM"
28 # endif
29 #endif /* EFSYS_OPT_BOOTCFG */
30
31 #if EFSYS_OPT_CHECK_REG
32 /* Verify chip implements accessed registers */
33 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
34         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
35 #  error "CHECK_REG requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
36 # endif
37 #endif /* EFSYS_OPT_CHECK_REG */
38
39 #if EFSYS_OPT_DECODE_INTR_FATAL
40 /* Decode fatal errors */
41 # if !EFSYS_OPT_SIENA
42 #  error "INTR_FATAL requires SIENA"
43 # endif
44 #endif /* EFSYS_OPT_DECODE_INTR_FATAL */
45
46 #if EFSYS_OPT_DIAG
47 /* Support diagnostic hardware tests */
48 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
49         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
50 #  error "DIAG requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
51 # endif
52 #endif /* EFSYS_OPT_DIAG */
53
54 #if EFSYS_OPT_EV_PREFETCH
55 /* Support optimized EVQ data access */
56 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
57         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
58 #  error "EV_PREFETCH requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
59 # endif
60 #endif /* EFSYS_OPT_EV_PREFETCH */
61
62 #ifdef EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE
63 # error "FALCON_NIC_CFG_OVERRIDE is obsolete and is not supported."
64 #endif
65
66 #if EFSYS_OPT_FILTER
67 /* Support hardware packet filters */
68 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
69         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
70 #  error "FILTER requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
71 # endif
72 #endif /* EFSYS_OPT_FILTER */
73
74 #if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
75 # if !EFSYS_OPT_FILTER
76 #  error "HUNTINGTON or MEDFORD or MEDFORD2 requires FILTER"
77 # endif
78 #endif /* EFSYS_OPT_HUNTINGTON */
79
80 #if EFSYS_OPT_LOOPBACK
81 /* Support hardware loopback modes */
82 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
83         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
84 #  error "LOOPBACK requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
85 # endif
86 #endif /* EFSYS_OPT_LOOPBACK */
87
88 #ifdef EFSYS_OPT_MAC_FALCON_GMAC
89 # error "MAC_FALCON_GMAC is obsolete and is not supported."
90 #endif
91
92 #ifdef EFSYS_OPT_MAC_FALCON_XMAC
93 # error "MAC_FALCON_XMAC is obsolete and is not supported."
94 #endif
95
96 #if EFSYS_OPT_MAC_STATS
97 /* Support MAC statistics */
98 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
99         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
100 #  error "MAC_STATS requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
101 # endif
102 #endif /* EFSYS_OPT_MAC_STATS */
103
104 #if EFSYS_OPT_MCDI
105 /* Support management controller messages */
106 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
107         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
108 #  error "MCDI requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
109 # endif
110 #endif /* EFSYS_OPT_MCDI */
111
112 #if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
113         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
114 # if !EFSYS_OPT_MCDI
115 #  error "SIENA or HUNTINGTON or MEDFORD or MEDFORD2 requires MCDI"
116 # endif
117 #endif
118
119 #if EFSYS_OPT_MCDI_LOGGING
120 /* Support MCDI logging */
121 # if !EFSYS_OPT_MCDI
122 #  error "MCDI_LOGGING requires MCDI"
123 # endif
124 #endif /* EFSYS_OPT_MCDI_LOGGING */
125
126 #if EFSYS_OPT_MCDI_PROXY_AUTH
127 /* Support MCDI proxy authorization */
128 # if !EFSYS_OPT_MCDI
129 #  error "MCDI_PROXY_AUTH requires MCDI"
130 # endif
131 #endif /* EFSYS_OPT_MCDI_PROXY_AUTH */
132
133 #ifdef EFSYS_OPT_MON_LM87
134 # error "MON_LM87 is obsolete and is not supported."
135 #endif
136
137 #ifdef EFSYS_OPT_MON_MAX6647
138 # error "MON_MAX6647 is obsolete and is not supported."
139 #endif
140
141 #ifdef EFSYS_OPT_MON_NULL
142 # error "MON_NULL is obsolete and is not supported."
143 #endif
144
145 #ifdef EFSYS_OPT_MON_SIENA
146 #  error "MON_SIENA is obsolete (replaced by MON_MCDI)."
147 #endif
148
149 #ifdef EFSYS_OPT_MON_HUNTINGTON
150 #  error "MON_HUNTINGTON is obsolete (replaced by MON_MCDI)."
151 #endif
152
153 #if EFSYS_OPT_MON_STATS
154 /* Support monitor statistics (voltage/temperature) */
155 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
156         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
157 #  error "MON_STATS requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
158 # endif
159 #endif /* EFSYS_OPT_MON_STATS */
160
161 #if EFSYS_OPT_MON_MCDI
162 /* Support Monitor via mcdi */
163 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
164         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
165 #  error "MON_MCDI requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
166 # endif
167 #endif /* EFSYS_OPT_MON_MCDI*/
168
169 #if EFSYS_OPT_NAMES
170 /* Support printable names for statistics */
171 # if !(EFSYS_OPT_LOOPBACK || EFSYS_OPT_MAC_STATS || EFSYS_OPT_MCDI || \
172         EFSYS_MON_STATS || EFSYS_OPT_PHY_STATS || EFSYS_OPT_QSTATS)
173 #  error "NAMES requires LOOPBACK or xxxSTATS or MCDI"
174 # endif
175 #endif /* EFSYS_OPT_NAMES */
176
177 #if EFSYS_OPT_NVRAM
178 /* Support non volatile configuration */
179 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
180         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
181 #  error "NVRAM requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
182 # endif
183 #endif /* EFSYS_OPT_NVRAM */
184
185 #if EFSYS_OPT_IMAGE_LAYOUT
186 /* Support signed image layout handling */
187 # if !(EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
188 #  error "IMAGE_LAYOUT requires MEDFORD or MEDFORD2"
189 # endif
190 #endif /* EFSYS_OPT_IMAGE_LAYOUT */
191
192 #ifdef EFSYS_OPT_NVRAM_FALCON_BOOTROM
193 # error "NVRAM_FALCON_BOOTROM is obsolete and is not supported."
194 #endif
195
196 #ifdef EFSYS_OPT_NVRAM_SFT9001
197 # error "NVRAM_SFT9001 is obsolete and is not supported."
198 #endif
199
200 #ifdef EFSYS_OPT_NVRAM_SFX7101
201 # error "NVRAM_SFX7101 is obsolete and is not supported."
202 #endif
203
204 #ifdef EFSYS_OPT_PCIE_TUNE
205 # error "PCIE_TUNE is obsolete and is not supported."
206 #endif
207
208 #ifdef EFSYS_OPT_PHY_BIST
209 # error "PHY_BIST is obsolete (replaced by BIST)."
210 #endif
211
212 #if EFSYS_OPT_PHY_FLAGS
213 /* Support PHY flags */
214 # if !EFSYS_OPT_SIENA
215 #  error "PHY_FLAGS requires SIENA"
216 # endif
217 #endif /* EFSYS_OPT_PHY_FLAGS */
218
219 #if EFSYS_OPT_PHY_LED_CONTROL
220 /* Support for PHY LED control */
221 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
222         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
223 #  error "PHY_LED_CONTROL requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
224 # endif
225 #endif /* EFSYS_OPT_PHY_LED_CONTROL */
226
227 #ifdef EFSYS_OPT_PHY_NULL
228 # error "PHY_NULL is obsolete and is not supported."
229 #endif
230
231 #ifdef EFSYS_OPT_PHY_PM8358
232 # error "PHY_PM8358 is obsolete and is not supported."
233 #endif
234
235 #ifdef EFSYS_OPT_PHY_PROPS
236 # error "PHY_PROPS is obsolete and is not supported."
237 #endif
238
239 #ifdef EFSYS_OPT_PHY_QT2022C2
240 # error "PHY_QT2022C2 is obsolete and is not supported."
241 #endif
242
243 #ifdef EFSYS_OPT_PHY_QT2025C
244 # error "PHY_QT2025C is obsolete and is not supported."
245 #endif
246
247 #ifdef EFSYS_OPT_PHY_SFT9001
248 # error "PHY_SFT9001 is obsolete and is not supported."
249 #endif
250
251 #ifdef EFSYS_OPT_PHY_SFX7101
252 # error "PHY_SFX7101 is obsolete and is not supported."
253 #endif
254
255 #if EFSYS_OPT_PHY_STATS
256 /* Support PHY statistics */
257 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
258 #  error "PHY_STATS requires SIENA or HUNTINGTON or MEDFORD"
259 # endif
260 #endif /* EFSYS_OPT_PHY_STATS */
261
262 #ifdef EFSYS_OPT_PHY_TXC43128
263 # error "PHY_TXC43128 is obsolete and is not supported."
264 #endif
265
266 #if EFSYS_OPT_QSTATS
267 /* Support EVQ/RXQ/TXQ statistics */
268 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
269         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
270 #  error "QSTATS requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
271 # endif
272 #endif /* EFSYS_OPT_QSTATS */
273
274 #ifdef EFSYS_OPT_RX_HDR_SPLIT
275 # error "RX_HDR_SPLIT is obsolete and is not supported"
276 #endif
277
278 #if EFSYS_OPT_RX_SCALE
279 /* Support receive scaling (RSS) */
280 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
281         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
282 #  error "RX_SCALE requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
283 # endif
284 #endif /* EFSYS_OPT_RX_SCALE */
285
286 #if EFSYS_OPT_RX_SCATTER
287 /* Support receive scatter DMA */
288 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
289         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
290 #  error "RX_SCATTER requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
291 # endif
292 #endif /* EFSYS_OPT_RX_SCATTER */
293
294 #ifdef EFSYS_OPT_STAT_NAME
295 # error "STAT_NAME is obsolete (replaced by NAMES)."
296 #endif
297
298 #if EFSYS_OPT_VPD
299 /* Support PCI Vital Product Data (VPD) */
300 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
301         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
302 #  error "VPD requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
303 # endif
304 #endif /* EFSYS_OPT_VPD */
305
306 #ifdef EFSYS_OPT_WOL
307 # error "WOL is obsolete and is not supported"
308 #endif /* EFSYS_OPT_WOL */
309
310 #ifdef EFSYS_OPT_MCAST_FILTER_LIST
311 #  error "MCAST_FILTER_LIST is obsolete and is not supported"
312 #endif
313
314 #if EFSYS_OPT_BIST
315 /* Support BIST */
316 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \
317         EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
318 #  error "BIST requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2"
319 # endif
320 #endif /* EFSYS_OPT_BIST */
321
322 #if EFSYS_OPT_LICENSING
323 /* Support MCDI licensing API */
324 # if !EFSYS_OPT_MCDI
325 #  error "LICENSING requires MCDI"
326 # endif
327 # if !EFSYS_HAS_UINT64
328 #  error "LICENSING requires UINT64"
329 # endif
330 #endif /* EFSYS_OPT_LICENSING */
331
332 #if EFSYS_OPT_ALLOW_UNCONFIGURED_NIC
333 /* Support adapters with missing static config (for factory use only) */
334 # if !(EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
335 #  error "ALLOW_UNCONFIGURED_NIC requires MEDFORD or MEDFORD2"
336 # endif
337 #endif /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */
338
339 #if EFSYS_OPT_RX_PACKED_STREAM
340 /* Support packed stream mode */
341 # if !(EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
342 #  error "PACKED_STREAM requires HUNTINGTON or MEDFORD or MEDFORD2"
343 # endif
344 #endif
345
346 #if EFSYS_OPT_RX_ES_SUPER_BUFFER
347 /* Support equal stride super-buffer mode */
348 # if !(EFSYS_OPT_MEDFORD2)
349 #  error "ES_SUPER_BUFFER requires MEDFORD2"
350 # endif
351 #endif
352
353 /* Support hardware assistance for tunnels */
354 #if EFSYS_OPT_TUNNEL
355 # if !(EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
356 #  error "TUNNEL requires MEDFORD or MEDFORD2"
357 # endif
358 #endif /* EFSYS_OPT_TUNNEL */
359
360 #if EFSYS_OPT_FW_SUBVARIANT_AWARE
361 /* Advertise that the driver is firmware subvariant aware */
362 # if !(EFSYS_OPT_MEDFORD2)
363 #  error "FW_SUBVARIANT_AWARE requires MEDFORD2"
364 # endif
365 #endif
366
367 #endif /* _SYS_EFX_CHECK_H */