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