2 * Copyright (c) 2012-2015 Solarflare Communications Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
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.
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.
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.
33 #ifndef _SYS_EFX_CHECK_H
34 #define _SYS_EFX_CHECK_H
39 * Check that the efsys.h header in client code has a valid combination of
40 * EFSYS_OPT_xxx options.
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).
46 #ifdef EFSYS_OPT_FALCON
47 # error "FALCON is obsolete and is not supported."
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)
53 #define EFSYS_OPT_MAC_FALCON_GMAC (0)
54 #define EFSYS_OPT_MAC_FALCON_XMAC (0)
56 #define EFSYS_OPT_MON_LM87 (0)
57 #define EFSYS_OPT_MON_MAX6647 (0)
58 #define EFSYS_OPT_MON_NULL (0)
60 #define EFSYS_OPT_NVRAM_FALCON_BOOTROM (0)
61 #define EFSYS_OPT_NVRAM_SFT9001 (0)
62 #define EFSYS_OPT_NVRAM_SFX7101 (0)
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)
72 /* Support NVRAM based boot config */
75 # error "BOOTCFG requires NVRAM"
77 #endif /* EFSYS_OPT_BOOTCFG */
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"
85 #endif /* EFSYS_OPT_CHECK_REG */
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"
92 #endif /* EFSYS_OPT_DECODE_INTR_FATAL */
94 /* Support diagnostic hardware tests */
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"
100 #endif /* EFSYS_OPT_DIAG */
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"
108 #endif /* EFSYS_OPT_EV_PREFETCH */
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"
115 #endif /* EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE */
117 /* Support hardware packet filters */
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"
123 #endif /* EFSYS_OPT_FILTER */
125 #if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
126 # if !EFSYS_OPT_FILTER
127 # error "HUNTINGTON or MEDFORD requires FILTER"
129 #endif /* EFSYS_OPT_HUNTINGTON */
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"
137 #endif /* EFSYS_OPT_LOOPBACK */
139 /* Support Falcon GMAC */
140 #if EFSYS_OPT_MAC_FALCON_GMAC
141 # if !EFSYS_OPT_FALCON
142 # error "MAC_FALCON_GMAC requires FALCON"
144 #endif /* EFSYS_OPT_MAC_FALCON_GMAC */
146 /* Support Falcon XMAC */
147 #if EFSYS_OPT_MAC_FALCON_XMAC
148 # if !EFSYS_OPT_FALCON
149 # error "MAC_FALCON_XMAC requires FALCON"
151 #endif /* EFSYS_OPT_MAC_FALCON_XMAC */
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"
159 #endif /* EFSYS_OPT_MAC_STATS */
161 /* Support management controller messages */
163 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
164 # error "MCDI requires SIENA or HUNTINGTON or MEDFORD"
166 #endif /* EFSYS_OPT_MCDI */
168 #if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
170 # error "SIENA or HUNTINGTON or MEDFORD requires MCDI"
174 /* Support MCDI logging */
175 #if EFSYS_OPT_MCDI_LOGGING
177 # error "MCDI_LOGGING requires MCDI"
179 #endif /* EFSYS_OPT_MCDI_LOGGING */
181 /* Support MCDI proxy authorization */
182 #if EFSYS_OPT_MCDI_PROXY_AUTH
184 # error "MCDI_PROXY_AUTH requires MCDI"
186 #endif /* EFSYS_OPT_MCDI_PROXY_AUTH */
188 /* Support LM87 monitor */
189 #if EFSYS_OPT_MON_LM87
190 # if !EFSYS_OPT_FALCON
191 # error "MON_LM87 requires FALCON"
193 #endif /* EFSYS_OPT_MON_LM87 */
195 /* Support MAX6647 monitor */
196 #if EFSYS_OPT_MON_MAX6647
197 # if !EFSYS_OPT_FALCON
198 # error "MON_MAX6647 requires FALCON"
200 #endif /* EFSYS_OPT_MON_MAX6647 */
202 /* Support null monitor */
203 #if EFSYS_OPT_MON_NULL
204 # if !EFSYS_OPT_FALCON
205 # error "MON_NULL requires FALCON"
207 #endif /* EFSYS_OPT_MON_NULL */
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*/
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*/
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"
225 #endif /* EFSYS_OPT_MON_STATS */
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"
232 #endif /* EFSYS_OPT_MON_MCDI*/
234 /* Support printable names for statistics */
236 # if !(EFSYS_OPT_LOOPBACK || EFSYS_OPT_MAC_STATS || EFSYS_OPT_MCDI || \
237 EFSYS_MON_STATS || EFSYS_OPT_PHY_PROPS || EFSYS_OPT_PHY_STATS || \
239 # error "NAMES requires LOOPBACK or xxxSTATS or MCDI or PHY_PROPS"
241 #endif /* EFSYS_OPT_NAMES */
243 /* Support non volatile configuration */
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"
249 #endif /* EFSYS_OPT_NVRAM */
251 /* Support Falcon bootrom */
252 #if EFSYS_OPT_NVRAM_FALCON_BOOTROM
253 # if !EFSYS_OPT_NVRAM
254 # error "NVRAM_FALCON_BOOTROM requires NVRAM"
256 # if !EFSYS_OPT_FALCON
257 # error "NVRAM_FALCON_BOOTROM requires FALCON"
259 #endif /* EFSYS_OPT_NVRAM_FALCON_BOOTROM */
261 /* Support NVRAM config for SFT9001 */
262 #if EFSYS_OPT_NVRAM_SFT9001
263 # if !EFSYS_OPT_NVRAM
264 # error "NVRAM_SFT9001 requires NVRAM"
266 # if !EFSYS_OPT_FALCON
267 # error "NVRAM_SFT9001 requires FALCON"
269 #endif /* EFSYS_OPT_NVRAM_SFT9001 */
271 /* Support NVRAM config for SFX7101 */
272 #if EFSYS_OPT_NVRAM_SFX7101
273 # if !EFSYS_OPT_NVRAM
274 # error "NVRAM_SFX7101 requires NVRAM"
276 # if !EFSYS_OPT_FALCON
277 # error "NVRAM_SFX7101 requires FALCON"
279 #endif /* EFSYS_OPT_NVRAM_SFX7101 */
281 #ifdef EFSYS_OPT_PCIE_TUNE
282 # error "PCIE_TUNE is obsolete and is not supported."
285 /* Obsolete option */
286 #ifdef EFSYS_OPT_PHY_BIST
287 # error "PHY_BIST is obsolete (replaced by BIST)."
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"
295 #endif /* EFSYS_OPT_PHY_FLAGS */
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"
302 #endif /* EFSYS_OPT_PHY_LED_CONTROL */
304 /* Support NULL PHY */
305 #if EFSYS_OPT_PHY_NULL
306 # if !EFSYS_OPT_FALCON
307 # error "PHY_NULL requires FALCON"
309 #endif /* EFSYS_OPT_PHY_NULL */
311 /* Obsolete option */
312 #ifdef EFSYS_OPT_PHY_PM8358
313 # error "EFSYS_OPT_PHY_PM8358 is obsolete and is not supported."
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"
321 #endif /* EFSYS_OPT_PHY_PROPS */
323 /* Support QT2022C2 PHY */
324 #if EFSYS_OPT_PHY_QT2022C2
325 # if !EFSYS_OPT_FALCON
326 # error "PHY_QT2022C2 requires FALCON"
328 #endif /* EFSYS_OPT_PHY_QT2022C2 */
330 /* Support QT2025C PHY (Wakefield NIC) */
331 #if EFSYS_OPT_PHY_QT2025C
332 # if !EFSYS_OPT_FALCON
333 # error "PHY_QT2025C requires FALCON"
335 #endif /* EFSYS_OPT_PHY_QT2025C */
337 /* Support SFT9001 PHY (Starbolt NIC) */
338 #if EFSYS_OPT_PHY_SFT9001
339 # if !EFSYS_OPT_FALCON
340 # error "PHY_SFT9001 requires FALCON"
342 #endif /* EFSYS_OPT_PHY_SFT9001 */
344 /* Support SFX7101 PHY (SFE4001 NIC) */
345 #if EFSYS_OPT_PHY_SFX7101
346 # if !EFSYS_OPT_FALCON
347 # error "PHY_SFX7101 requires FALCON"
349 #endif /* EFSYS_OPT_PHY_SFX7101 */
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"
356 #endif /* EFSYS_OPT_PHY_STATS */
358 /* Support TXC43128 PHY (SFE4003 NIC) */
359 #if EFSYS_OPT_PHY_TXC43128
360 # if !EFSYS_OPT_FALCON
361 # error "PHY_TXC43128 requires FALCON"
363 #endif /* EFSYS_OPT_PHY_TXC43128 */
365 /* Support EVQ/RXQ/TXQ statistics */
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"
371 #endif /* EFSYS_OPT_QSTATS */
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 */
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"
384 #endif /* EFSYS_OPT_RX_SCALE */
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"
392 #endif /* EFSYS_OPT_RX_SCATTER */
394 /* Obsolete option */
395 #ifdef EFSYS_OPT_STAT_NAME
396 # error "STAT_NAME is obsolete (replaced by NAMES)."
399 /* Support PCI Vital Product Data (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"
405 #endif /* EFSYS_OPT_VPD */
407 /* Support Wake on LAN */
409 # if !EFSYS_OPT_SIENA
410 # error "WOL requires SIENA"
412 #endif /* EFSYS_OPT_WOL */
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 */
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"
425 #endif /* EFSYS_OPT_BIST */
427 /* Support MCDI licensing API */
428 #if EFSYS_OPT_LICENSING
430 # error "LICENSING requires MCDI"
432 # if !EFSYS_HAS_UINT64
433 # error "LICENSING requires UINT64"
435 #endif /* EFSYS_OPT_LICENSING */
438 #endif /* _SYS_EFX_CHECK_H */