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