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