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