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