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