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