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