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