]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/dev/sfxge/common/efx_check.h
MFC r299254
[FreeBSD/FreeBSD.git] / sys / dev / sfxge / common / efx_check.h
1 /*-
2  * Copyright (c) 2012-2015 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  * $FreeBSD$
31  */
32
33 #ifndef _SYS_EFX_CHECK_H
34 #define _SYS_EFX_CHECK_H
35
36 #include "efsys.h"
37
38 /*
39  * Check that the efsys.h header in client code has a valid combination of
40  * EFSYS_OPT_xxx options.
41  *
42  * NOTE: Keep checks for obsolete options here to ensure that they are removed
43  * from client code (and do not reappear in merges from other branches).
44  */
45
46 #ifdef EFSYS_OPT_FALCON
47 # error "FALCON is obsolete and is not supported."
48 #else
49 /* FIXME: remove this after Falcon support has been removed */
50 #define EFSYS_OPT_FALCON                        (0)
51 #define EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE       (0)
52
53 #define EFSYS_OPT_MAC_FALCON_GMAC               (0)
54 #define EFSYS_OPT_MAC_FALCON_XMAC               (0)
55
56 #define EFSYS_OPT_MON_LM87                      (0)
57 #define EFSYS_OPT_MON_MAX6647                   (0)
58 #define EFSYS_OPT_MON_NULL                      (0)
59
60 #define EFSYS_OPT_NVRAM_FALCON_BOOTROM          (0)
61 #define EFSYS_OPT_NVRAM_SFT9001                 (0)
62 #define EFSYS_OPT_NVRAM_SFX7101                 (0)
63
64 #define EFSYS_OPT_PHY_NULL                      (0)
65 #define EFSYS_OPT_PHY_QT2022C2                  (0)
66 #define EFSYS_OPT_PHY_QT2025C                   (0)
67 #define EFSYS_OPT_PHY_SFT9001                   (0)
68 #define EFSYS_OPT_PHY_SFX7101                   (0)
69 #define EFSYS_OPT_PHY_TXC43128                  (0)
70 #endif
71
72 /* Support NVRAM based boot config */
73 #if EFSYS_OPT_BOOTCFG
74 # if !EFSYS_OPT_NVRAM
75 #  error "BOOTCFG requires NVRAM"
76 # endif
77 #endif /* EFSYS_OPT_BOOTCFG */
78
79 /* Verify chip implements accessed registers */
80 #if EFSYS_OPT_CHECK_REG
81 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \
82         EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
83 #  error "CHECK_REG requires FALCON or SIENA or HUNTINGTON or MEDFORD"
84 # endif
85 #endif /* EFSYS_OPT_CHECK_REG */
86
87 /* Decode fatal errors */
88 #if EFSYS_OPT_DECODE_INTR_FATAL
89 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
90 #  error "INTR_FATAL requires FALCON or SIENA"
91 # endif
92 #endif /* EFSYS_OPT_DECODE_INTR_FATAL */
93
94 /* Support diagnostic hardware tests */
95 #if EFSYS_OPT_DIAG
96 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \
97         EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
98 #  error "DIAG requires FALCON or SIENA or HUNTINGTON or MEDFORD"
99 # endif
100 #endif /* EFSYS_OPT_DIAG */
101
102 /* Support optimized EVQ data access */
103 #if EFSYS_OPT_EV_PREFETCH
104 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \
105         EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
106 #  error "EV_PREFETCH requires FALCON or SIENA or HUNTINGTON or MEDFORD"
107 # endif
108 #endif /* EFSYS_OPT_EV_PREFETCH */
109
110 /* Support overriding the NVRAM and VPD configuration */
111 #if EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE
112 # if !EFSYS_OPT_FALCON
113 #  error "FALCON_NIC_CFG_OVERRIDE requires FALCON"
114 # endif
115 #endif /* EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE */
116
117 /* Support hardware packet filters */
118 #if EFSYS_OPT_FILTER
119 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \
120         EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
121 #  error "FILTER requires FALCON or SIENA or HUNTINGTON or MEDFORD"
122 # endif
123 #endif /* EFSYS_OPT_FILTER */
124
125 #if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
126 # if !EFSYS_OPT_FILTER
127 #  error "HUNTINGTON or MEDFORD requires FILTER"
128 # endif
129 #endif /* EFSYS_OPT_HUNTINGTON */
130
131 /* Support hardware loopback modes */
132 #if EFSYS_OPT_LOOPBACK
133 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \
134         EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
135 #  error "LOOPBACK requires FALCON or SIENA or HUNTINGTON or MEDFORD"
136 # endif
137 #endif /* EFSYS_OPT_LOOPBACK */
138
139 /* Support Falcon GMAC */
140 #if EFSYS_OPT_MAC_FALCON_GMAC
141 # if !EFSYS_OPT_FALCON
142 #  error "MAC_FALCON_GMAC requires FALCON"
143 # endif
144 #endif /* EFSYS_OPT_MAC_FALCON_GMAC */
145
146 /* Support Falcon XMAC */
147 #if EFSYS_OPT_MAC_FALCON_XMAC
148 # if !EFSYS_OPT_FALCON
149 #  error "MAC_FALCON_XMAC requires FALCON"
150 # endif
151 #endif /* EFSYS_OPT_MAC_FALCON_XMAC */
152
153 /* Support MAC statistics */
154 #if EFSYS_OPT_MAC_STATS
155 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \
156         EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
157 #  error "MAC_STATS requires FALCON or SIENA or HUNTINGTON or MEDFORD"
158 # endif
159 #endif /* EFSYS_OPT_MAC_STATS */
160
161 /* Support management controller messages */
162 #if EFSYS_OPT_MCDI
163 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
164 #  error "MCDI requires SIENA or HUNTINGTON or MEDFORD"
165 # endif
166 #endif /* EFSYS_OPT_MCDI */
167
168 #if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
169 # if !EFSYS_OPT_MCDI
170 #  error "SIENA or HUNTINGTON or MEDFORD requires MCDI"
171 # endif
172 #endif
173
174 /* Support MCDI logging */
175 #if EFSYS_OPT_MCDI_LOGGING
176 # if !EFSYS_OPT_MCDI
177 #  error "MCDI_LOGGING requires MCDI"
178 # endif
179 #endif /* EFSYS_OPT_MCDI_LOGGING */
180
181 /* Support MCDI proxy authorization */
182 #if EFSYS_OPT_MCDI_PROXY_AUTH
183 # if !EFSYS_OPT_MCDI
184 #  error "MCDI_PROXY_AUTH requires MCDI"
185 # endif
186 #endif /* EFSYS_OPT_MCDI_PROXY_AUTH */
187
188 /* Support LM87 monitor */
189 #if EFSYS_OPT_MON_LM87
190 # if !EFSYS_OPT_FALCON
191 #  error "MON_LM87 requires FALCON"
192 # endif
193 #endif /* EFSYS_OPT_MON_LM87 */
194
195 /* Support MAX6647 monitor */
196 #if EFSYS_OPT_MON_MAX6647
197 # if !EFSYS_OPT_FALCON
198 #  error "MON_MAX6647 requires FALCON"
199 # endif
200 #endif /* EFSYS_OPT_MON_MAX6647 */
201
202 /* Support null monitor */
203 #if EFSYS_OPT_MON_NULL
204 # if !EFSYS_OPT_FALCON
205 #  error "MON_NULL requires FALCON"
206 # endif
207 #endif /* EFSYS_OPT_MON_NULL */
208
209 /* Obsolete option */
210 #ifdef EFSYS_OPT_MON_SIENA
211 #  error "MON_SIENA is obsolete (replaced by MON_MCDI)."
212 #endif /* EFSYS_OPT_MON_SIENA*/
213
214 /* Obsolete option */
215 #ifdef EFSYS_OPT_MON_HUNTINGTON
216 #  error "MON_HUNTINGTON is obsolete (replaced by MON_MCDI)."
217 #endif /* EFSYS_OPT_MON_HUNTINGTON*/
218
219 /* Support monitor statistics (voltage/temperature) */
220 #if EFSYS_OPT_MON_STATS
221 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \
222         EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
223 #  error "MON_STATS requires FALCON or SIENA or HUNTINGTON or MEDFORD"
224 # endif
225 #endif /* EFSYS_OPT_MON_STATS */
226
227 /* Support Monitor via mcdi */
228 #if EFSYS_OPT_MON_MCDI
229 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
230 #  error "MON_MCDI requires SIENA or HUNTINGTON or MEDFORD"
231 # endif
232 #endif /* EFSYS_OPT_MON_MCDI*/
233
234 /* Support printable names for statistics */
235 #if EFSYS_OPT_NAMES
236 # if !(EFSYS_OPT_LOOPBACK || EFSYS_OPT_MAC_STATS || EFSYS_OPT_MCDI || \
237         EFSYS_MON_STATS || EFSYS_OPT_PHY_PROPS || EFSYS_OPT_PHY_STATS || \
238         EFSYS_OPT_QSTATS)
239 #  error "NAMES requires LOOPBACK or xxxSTATS or MCDI or PHY_PROPS"
240 # endif
241 #endif /* EFSYS_OPT_NAMES */
242
243 /* Support non volatile configuration */
244 #if EFSYS_OPT_NVRAM
245 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \
246         EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
247 #  error "NVRAM requires FALCON or SIENA or HUNTINGTON or MEDFORD"
248 # endif
249 #endif /* EFSYS_OPT_NVRAM */
250
251 /* Support Falcon bootrom */
252 #if EFSYS_OPT_NVRAM_FALCON_BOOTROM
253 # if !EFSYS_OPT_NVRAM
254 #  error "NVRAM_FALCON_BOOTROM requires NVRAM"
255 # endif
256 # if !EFSYS_OPT_FALCON
257 #  error "NVRAM_FALCON_BOOTROM requires FALCON"
258 # endif
259 #endif /* EFSYS_OPT_NVRAM_FALCON_BOOTROM */
260
261 /* Support NVRAM config for SFT9001 */
262 #if EFSYS_OPT_NVRAM_SFT9001
263 # if !EFSYS_OPT_NVRAM
264 #  error "NVRAM_SFT9001 requires NVRAM"
265 # endif
266 # if !EFSYS_OPT_FALCON
267 #  error "NVRAM_SFT9001 requires FALCON"
268 # endif
269 #endif /* EFSYS_OPT_NVRAM_SFT9001 */
270
271 /* Support NVRAM config for SFX7101 */
272 #if EFSYS_OPT_NVRAM_SFX7101
273 # if !EFSYS_OPT_NVRAM
274 #  error "NVRAM_SFX7101 requires NVRAM"
275 # endif
276 # if !EFSYS_OPT_FALCON
277 #  error "NVRAM_SFX7101 requires FALCON"
278 # endif
279 #endif /* EFSYS_OPT_NVRAM_SFX7101 */
280
281 #ifdef EFSYS_OPT_PCIE_TUNE
282 # error "PCIE_TUNE is obsolete and is not supported."
283 #endif
284
285 /* Obsolete option */
286 #ifdef EFSYS_OPT_PHY_BIST
287 # error "PHY_BIST is obsolete (replaced by BIST)."
288 #endif
289
290 /* Support PHY flags */
291 #if EFSYS_OPT_PHY_FLAGS
292 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
293 #  error "PHY_FLAGS requires FALCON or SIENA"
294 # endif
295 #endif /* EFSYS_OPT_PHY_FLAGS */
296
297 /* Support for PHY LED control */
298 #if EFSYS_OPT_PHY_LED_CONTROL
299 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
300 #  error "PHY_LED_CONTROL requires FALCON or SIENA"
301 # endif
302 #endif /* EFSYS_OPT_PHY_LED_CONTROL */
303
304 /* Support NULL PHY */
305 #if EFSYS_OPT_PHY_NULL
306 # if !EFSYS_OPT_FALCON
307 #  error "PHY_NULL requires FALCON"
308 # endif
309 #endif /* EFSYS_OPT_PHY_NULL */
310
311 /* Obsolete option */
312 #ifdef EFSYS_OPT_PHY_PM8358
313 # error "EFSYS_OPT_PHY_PM8358 is obsolete and is not supported."
314 #endif
315
316 /* Support PHY properties */
317 #if EFSYS_OPT_PHY_PROPS
318 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
319 #  error "PHY_PROPS requires FALCON or SIENA"
320 # endif
321 #endif /* EFSYS_OPT_PHY_PROPS */
322
323 /* Support QT2022C2 PHY */
324 #if EFSYS_OPT_PHY_QT2022C2
325 # if !EFSYS_OPT_FALCON
326 #  error "PHY_QT2022C2 requires FALCON"
327 # endif
328 #endif /* EFSYS_OPT_PHY_QT2022C2 */
329
330 /* Support QT2025C PHY (Wakefield NIC) */
331 #if EFSYS_OPT_PHY_QT2025C
332 # if !EFSYS_OPT_FALCON
333 #  error "PHY_QT2025C requires FALCON"
334 # endif
335 #endif /* EFSYS_OPT_PHY_QT2025C */
336
337 /* Support SFT9001 PHY (Starbolt NIC) */
338 #if EFSYS_OPT_PHY_SFT9001
339 # if !EFSYS_OPT_FALCON
340 #  error "PHY_SFT9001 requires FALCON"
341 # endif
342 #endif /* EFSYS_OPT_PHY_SFT9001 */
343
344 /* Support SFX7101 PHY (SFE4001 NIC) */
345 #if EFSYS_OPT_PHY_SFX7101
346 # if !EFSYS_OPT_FALCON
347 #  error "PHY_SFX7101 requires FALCON"
348 # endif
349 #endif /* EFSYS_OPT_PHY_SFX7101 */
350
351 /* Support PHY statistics */
352 #if EFSYS_OPT_PHY_STATS
353 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
354 #  error "PHY_STATS requires FALCON or SIENA"
355 # endif
356 #endif /* EFSYS_OPT_PHY_STATS */
357
358 /* Support TXC43128 PHY (SFE4003 NIC) */
359 #if EFSYS_OPT_PHY_TXC43128
360 # if !EFSYS_OPT_FALCON
361 #  error "PHY_TXC43128 requires FALCON"
362 # endif
363 #endif /* EFSYS_OPT_PHY_TXC43128 */
364
365 /* Support EVQ/RXQ/TXQ statistics */
366 #if EFSYS_OPT_QSTATS
367 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \
368         EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
369 #  error "QSTATS requires FALCON or SIENA or HUNTINGTON or MEDFORD"
370 # endif
371 #endif /* EFSYS_OPT_QSTATS */
372
373 /* Obsolete option */
374 #ifdef EFSYS_OPT_RX_HDR_SPLIT
375 # error "RX_HDR_SPLIT is obsolete and is not supported"
376 #endif /* EFSYS_OPT_RX_HDR_SPLIT */
377
378 /* Support receive scaling (RSS) */
379 #if EFSYS_OPT_RX_SCALE
380 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \
381         EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
382 #  error "RX_SCALE requires FALCON or SIENA or HUNTINGTON or MEDFORD"
383 # endif
384 #endif /* EFSYS_OPT_RX_SCALE */
385
386 /* Support receive scatter DMA */
387 #if EFSYS_OPT_RX_SCATTER
388 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \
389         EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
390 #  error "RX_SCATTER requires FALCON or SIENA or HUNTINGTON or MEDFORD"
391 # endif
392 #endif /* EFSYS_OPT_RX_SCATTER */
393
394 /* Obsolete option */
395 #ifdef EFSYS_OPT_STAT_NAME
396 # error "STAT_NAME is obsolete (replaced by NAMES)."
397 #endif
398
399 /* Support PCI Vital Product Data (VPD) */
400 #if EFSYS_OPT_VPD
401 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \
402         EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
403 #  error "VPD requires FALCON or SIENA or HUNTINGTON or MEDFORD"
404 # endif
405 #endif /* EFSYS_OPT_VPD */
406
407 /* Support Wake on LAN */
408 #if EFSYS_OPT_WOL
409 # if !EFSYS_OPT_SIENA
410 #  error "WOL requires SIENA"
411 # endif
412 #endif /* EFSYS_OPT_WOL */
413
414 /* Obsolete option */
415 #ifdef EFSYS_OPT_MCAST_FILTER_LIST
416 #  error "MCAST_FILTER_LIST is obsolete and is not supported"
417 #endif /* EFSYS_OPT_MCAST_FILTER_LIST */
418
419 /* Support BIST */
420 #if EFSYS_OPT_BIST
421 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \
422         EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
423 #  error "BIST requires FALCON or SIENA or HUNTINGTON or MEDFORD"
424 # endif
425 #endif /* EFSYS_OPT_BIST */
426
427 /* Support MCDI licensing API */
428 #if EFSYS_OPT_LICENSING
429 # if !EFSYS_OPT_MCDI
430 #  error "LICENSING requires MCDI"
431 # endif
432 # if !EFSYS_HAS_UINT64
433 #  error "LICENSING requires UINT64"
434 # endif
435 #endif /* EFSYS_OPT_LICENSING */
436
437
438 #endif /* _SYS_EFX_CHECK_H */