net/sfc/base: import built-in selftest
[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_CHECK_REG
49 /* Verify chip implements accessed registers */
50 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
51 #  error "CHECK_REG requires SIENA or HUNTINGTON or MEDFORD"
52 # endif
53 #endif /* EFSYS_OPT_CHECK_REG */
54
55 #if EFSYS_OPT_DECODE_INTR_FATAL
56 /* Decode fatal errors */
57 # if !EFSYS_OPT_SIENA
58 #  error "INTR_FATAL requires SIENA"
59 # endif
60 #endif /* EFSYS_OPT_DECODE_INTR_FATAL */
61
62 #if EFSYS_OPT_DIAG
63 /* Support diagnostic hardware tests */
64 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
65 #  error "DIAG requires SIENA or HUNTINGTON or MEDFORD"
66 # endif
67 #endif /* EFSYS_OPT_DIAG */
68
69 #ifdef EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE
70 # error "FALCON_NIC_CFG_OVERRIDE is obsolete and is not supported."
71 #endif
72
73 #if EFSYS_OPT_FILTER
74 /* Support hardware packet filters */
75 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
76 #  error "FILTER requires SIENA or HUNTINGTON or MEDFORD"
77 # endif
78 #endif /* EFSYS_OPT_FILTER */
79
80 #if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
81 # if !EFSYS_OPT_FILTER
82 #  error "HUNTINGTON or MEDFORD requires FILTER"
83 # endif
84 #endif /* EFSYS_OPT_HUNTINGTON */
85
86 #ifdef EFSYS_OPT_MAC_FALCON_GMAC
87 # error "MAC_FALCON_GMAC is obsolete and is not supported."
88 #endif
89
90 #ifdef EFSYS_OPT_MAC_FALCON_XMAC
91 # error "MAC_FALCON_XMAC is obsolete and is not supported."
92 #endif
93
94 #if EFSYS_OPT_MCDI
95 /* Support management controller messages */
96 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
97 #  error "MCDI requires SIENA or HUNTINGTON or MEDFORD"
98 # endif
99 #endif /* EFSYS_OPT_MCDI */
100
101 #if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
102 # if !EFSYS_OPT_MCDI
103 #  error "SIENA or HUNTINGTON or MEDFORD requires MCDI"
104 # endif
105 #endif
106
107 #if EFSYS_OPT_MCDI_LOGGING
108 /* Support MCDI logging */
109 # if !EFSYS_OPT_MCDI
110 #  error "MCDI_LOGGING requires MCDI"
111 # endif
112 #endif /* EFSYS_OPT_MCDI_LOGGING */
113
114 #if EFSYS_OPT_MCDI_PROXY_AUTH
115 /* Support MCDI proxy authorization */
116 # if !EFSYS_OPT_MCDI
117 #  error "MCDI_PROXY_AUTH requires MCDI"
118 # endif
119 #endif /* EFSYS_OPT_MCDI_PROXY_AUTH */
120
121 #ifdef EFSYS_OPT_MON_LM87
122 # error "MON_LM87 is obsolete and is not supported."
123 #endif
124
125 #ifdef EFSYS_OPT_MON_MAX6647
126 # error "MON_MAX6647 is obsolete and is not supported."
127 #endif
128
129 #ifdef EFSYS_OPT_MON_NULL
130 # error "MON_NULL is obsolete and is not supported."
131 #endif
132
133 #ifdef EFSYS_OPT_MON_SIENA
134 #  error "MON_SIENA is obsolete (replaced by MON_MCDI)."
135 #endif
136
137 #ifdef EFSYS_OPT_MON_HUNTINGTON
138 #  error "MON_HUNTINGTON is obsolete (replaced by MON_MCDI)."
139 #endif
140
141 #if EFSYS_OPT_NAMES
142 /* Support printable names for statistics */
143 # if !(EFSYS_OPT_LOOPBACK || EFSYS_OPT_MAC_STATS || EFSYS_OPT_MCDI || \
144         EFSYS_MON_STATS || EFSYS_OPT_PHY_STATS || EFSYS_OPT_QSTATS)
145 #  error "NAMES requires LOOPBACK or xxxSTATS or MCDI"
146 # endif
147 #endif /* EFSYS_OPT_NAMES */
148
149 #ifdef EFSYS_OPT_NVRAM_FALCON_BOOTROM
150 # error "NVRAM_FALCON_BOOTROM is obsolete and is not supported."
151 #endif
152
153 #ifdef EFSYS_OPT_NVRAM_SFT9001
154 # error "NVRAM_SFT9001 is obsolete and is not supported."
155 #endif
156
157 #ifdef EFSYS_OPT_NVRAM_SFX7101
158 # error "NVRAM_SFX7101 is obsolete and is not supported."
159 #endif
160
161 #ifdef EFSYS_OPT_PCIE_TUNE
162 # error "PCIE_TUNE is obsolete and is not supported."
163 #endif
164
165 #ifdef EFSYS_OPT_PHY_BIST
166 # error "PHY_BIST is obsolete (replaced by BIST)."
167 #endif
168
169 #ifdef EFSYS_OPT_PHY_NULL
170 # error "PHY_NULL is obsolete and is not supported."
171 #endif
172
173 #ifdef EFSYS_OPT_PHY_PM8358
174 # error "PHY_PM8358 is obsolete and is not supported."
175 #endif
176
177 #ifdef EFSYS_OPT_PHY_PROPS
178 # error "PHY_PROPS is obsolete and is not supported."
179 #endif
180
181 #ifdef EFSYS_OPT_PHY_QT2022C2
182 # error "PHY_QT2022C2 is obsolete and is not supported."
183 #endif
184
185 #ifdef EFSYS_OPT_PHY_QT2025C
186 # error "PHY_QT2025C is obsolete and is not supported."
187 #endif
188
189 #ifdef EFSYS_OPT_PHY_SFT9001
190 # error "PHY_SFT9001 is obsolete and is not supported."
191 #endif
192
193 #ifdef EFSYS_OPT_PHY_SFX7101
194 # error "PHY_SFX7101 is obsolete and is not supported."
195 #endif
196
197 #ifdef EFSYS_OPT_PHY_TXC43128
198 # error "PHY_TXC43128 is obsolete and is not supported."
199 #endif
200
201 #ifdef EFSYS_OPT_RX_HDR_SPLIT
202 # error "RX_HDR_SPLIT is obsolete and is not supported"
203 #endif
204
205 #ifdef EFSYS_OPT_STAT_NAME
206 # error "STAT_NAME is obsolete (replaced by NAMES)."
207 #endif
208
209 #ifdef EFSYS_OPT_WOL
210 # error "WOL is obsolete and is not supported"
211 #endif /* EFSYS_OPT_WOL */
212
213 #ifdef EFSYS_OPT_MCAST_FILTER_LIST
214 #  error "MCAST_FILTER_LIST is obsolete and is not supported"
215 #endif
216
217 #if EFSYS_OPT_BIST
218 /* Support BIST */
219 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
220 #  error "BIST requires SIENA or HUNTINGTON or MEDFORD"
221 # endif
222 #endif /* EFSYS_OPT_BIST */
223
224 #if EFSYS_OPT_ALLOW_UNCONFIGURED_NIC
225 /* Support adapters with missing static config (for factory use only) */
226 # if !EFSYS_OPT_MEDFORD
227 #  error "ALLOW_UNCONFIGURED_NIC requires MEDFORD"
228 # endif
229 #endif /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */
230
231 #endif /* _SYS_EFX_CHECK_H */