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