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 
  31 #ifndef _SYS_EFX_CHECK_H
  32 #define _SYS_EFX_CHECK_H
  33 
  34 #include "efsys.h"
  35 
  36 /*
  37  * Check that the efsys.h header in client code has a valid combination of
  38  * EFSYS_OPT_xxx options.
  39  *
  40  * NOTE: Keep checks for obsolete options here to ensure that they are removed
  41  * from client code (and do not reappear in merges from other branches).
  42  */
  43 
  44 #ifdef EFSYS_OPT_FALCON
  45 # error "FALCON is obsolete and is not supported."
  46 #endif
  47 
  48 /* Support NVRAM based boot config */
  49 #if EFSYS_OPT_BOOTCFG
  50 # if !EFSYS_OPT_NVRAM
  51 #  error "BOOTCFG requires NVRAM"
  52 # endif
  53 #endif /* EFSYS_OPT_BOOTCFG */
  54 
  55 /* Verify chip implements accessed registers */
  56 #if EFSYS_OPT_CHECK_REG
  57 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
  58 #  error "CHECK_REG requires SIENA or HUNTINGTON or MEDFORD"
  59 # endif
  60 #endif /* EFSYS_OPT_CHECK_REG */
  61 
  62 /* Decode fatal errors */
  63 #if EFSYS_OPT_DECODE_INTR_FATAL
  64 # if !EFSYS_OPT_SIENA
  65 #  error "INTR_FATAL requires SIENA"
  66 # endif
  67 #endif /* EFSYS_OPT_DECODE_INTR_FATAL */
  68 
  69 /* Support diagnostic hardware tests */
  70 #if EFSYS_OPT_DIAG
  71 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
  72 #  error "DIAG requires 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_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
  79 #  error "EV_PREFETCH requires SIENA or HUNTINGTON or MEDFORD"
  80 # endif
  81 #endif /* EFSYS_OPT_EV_PREFETCH */
  82 
  83 #ifdef EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE
  84 # error "FALCON_NIC_CFG_OVERRIDE is obsolete and is not supported."
  85 #endif
  86 
  87 /* Support hardware packet filters */
  88 #if EFSYS_OPT_FILTER
  89 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
  90 #  error "FILTER requires SIENA or HUNTINGTON or MEDFORD"
  91 # endif
  92 #endif /* EFSYS_OPT_FILTER */
  93 
  94 #if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
  95 # if !EFSYS_OPT_FILTER
  96 #  error "HUNTINGTON or MEDFORD requires FILTER"
  97 # endif
  98 #endif /* EFSYS_OPT_HUNTINGTON */
  99 
 100 /* Support hardware loopback modes */
 101 #if EFSYS_OPT_LOOPBACK
 102 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 103 #  error "LOOPBACK requires SIENA or HUNTINGTON or MEDFORD"
 104 # endif
 105 #endif /* EFSYS_OPT_LOOPBACK */
 106 
 107 #ifdef EFSYS_OPT_MAC_FALCON_GMAC
 108 # error "MAC_FALCON_GMAC is obsolete and is not supported."
 109 #endif
 110 
 111 #ifdef EFSYS_OPT_MAC_FALCON_XMAC
 112 # error "MAC_FALCON_XMAC is obsolete and is not supported."
 113 #endif
 114 
 115 /* Support MAC statistics */
 116 #if EFSYS_OPT_MAC_STATS
 117 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 118 #  error "MAC_STATS requires SIENA or HUNTINGTON or MEDFORD"
 119 # endif
 120 #endif /* EFSYS_OPT_MAC_STATS */
 121 
 122 /* Support management controller messages */
 123 #if EFSYS_OPT_MCDI
 124 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 125 #  error "MCDI requires SIENA or HUNTINGTON or MEDFORD"
 126 # endif
 127 #endif /* EFSYS_OPT_MCDI */
 128 
 129 #if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 130 # if !EFSYS_OPT_MCDI
 131 #  error "SIENA or HUNTINGTON or MEDFORD requires MCDI"
 132 # endif
 133 #endif
 134 
 135 /* Support MCDI logging */
 136 #if EFSYS_OPT_MCDI_LOGGING
 137 # if !EFSYS_OPT_MCDI
 138 #  error "MCDI_LOGGING requires MCDI"
 139 # endif
 140 #endif /* EFSYS_OPT_MCDI_LOGGING */
 141 
 142 /* Support MCDI proxy authorization */
 143 #if EFSYS_OPT_MCDI_PROXY_AUTH
 144 # if !EFSYS_OPT_MCDI
 145 #  error "MCDI_PROXY_AUTH requires MCDI"
 146 # endif
 147 #endif /* EFSYS_OPT_MCDI_PROXY_AUTH */
 148 
 149 #ifdef EFSYS_OPT_MON_LM87
 150 # error "MON_LM87 is obsolete and is not supported."
 151 #endif
 152 
 153 #ifdef EFSYS_OPT_MON_MAX6647
 154 # error "MON_MAX6647 is obsolete and is not supported."
 155 #endif
 156 
 157 #ifdef EFSYS_OPT_MON_NULL
 158 # error "MON_NULL is obsolete and is not supported."
 159 #endif
 160 
 161 #ifdef EFSYS_OPT_MON_SIENA
 162 #  error "MON_SIENA is obsolete (replaced by MON_MCDI)."
 163 #endif
 164 
 165 #ifdef EFSYS_OPT_MON_HUNTINGTON
 166 #  error "MON_HUNTINGTON is obsolete (replaced by MON_MCDI)."
 167 #endif
 168 
 169 /* Support monitor statistics (voltage/temperature) */
 170 #if EFSYS_OPT_MON_STATS
 171 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 172 #  error "MON_STATS requires SIENA or HUNTINGTON or MEDFORD"
 173 # endif
 174 #endif /* EFSYS_OPT_MON_STATS */
 175 
 176 /* Support Monitor via mcdi */
 177 #if EFSYS_OPT_MON_MCDI
 178 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 179 #  error "MON_MCDI requires SIENA or HUNTINGTON or MEDFORD"
 180 # endif
 181 #endif /* EFSYS_OPT_MON_MCDI*/
 182 
 183 /* Support printable names for statistics */
 184 #if EFSYS_OPT_NAMES
 185 # if !(EFSYS_OPT_LOOPBACK || EFSYS_OPT_MAC_STATS || EFSYS_OPT_MCDI || \
 186         EFSYS_MON_STATS || EFSYS_OPT_PHY_STATS || EFSYS_OPT_QSTATS)
 187 #  error "NAMES requires LOOPBACK or xxxSTATS or MCDI"
 188 # endif
 189 #endif /* EFSYS_OPT_NAMES */
 190 
 191 /* Support non volatile configuration */
 192 #if EFSYS_OPT_NVRAM
 193 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 194 #  error "NVRAM requires SIENA or HUNTINGTON or MEDFORD"
 195 # endif
 196 #endif /* EFSYS_OPT_NVRAM */
 197 
 198 #ifdef EFSYS_OPT_NVRAM_FALCON_BOOTROM
 199 # error "NVRAM_FALCON_BOOTROM is obsolete and is not supported."
 200 #endif
 201 
 202 #ifdef EFSYS_OPT_NVRAM_SFT9001
 203 # error "NVRAM_SFT9001 is obsolete and is not supported."
 204 #endif
 205 
 206 #ifdef EFSYS_OPT_NVRAM_SFX7101
 207 # error "NVRAM_SFX7101 is obsolete and is not supported."
 208 #endif
 209 
 210 #ifdef EFSYS_OPT_PCIE_TUNE
 211 # error "PCIE_TUNE is obsolete and is not supported."
 212 #endif
 213 
 214 #ifdef EFSYS_OPT_PHY_BIST
 215 # error "PHY_BIST is obsolete (replaced by BIST)."
 216 #endif
 217 
 218 /* Support PHY flags */
 219 #if EFSYS_OPT_PHY_FLAGS
 220 # if !EFSYS_OPT_SIENA
 221 #  error "PHY_FLAGS requires SIENA"
 222 # endif
 223 #endif /* EFSYS_OPT_PHY_FLAGS */
 224 
 225 /* Support for PHY LED control */
 226 #if EFSYS_OPT_PHY_LED_CONTROL
 227 # if !EFSYS_OPT_SIENA
 228 #  error "PHY_LED_CONTROL requires SIENA"
 229 # endif
 230 #endif /* EFSYS_OPT_PHY_LED_CONTROL */
 231 
 232 #ifdef EFSYS_OPT_PHY_NULL
 233 # error "PHY_NULL is obsolete and is not supported."
 234 #endif
 235 
 236 #ifdef EFSYS_OPT_PHY_PM8358
 237 # error "PHY_PM8358 is obsolete and is not supported."
 238 #endif
 239 
 240 #ifdef EFSYS_OPT_PHY_PROPS
 241 # error "PHY_PROPS is obsolete and is not supported."
 242 #endif
 243 
 244 #ifdef EFSYS_OPT_PHY_QT2022C2
 245 # error "PHY_QT2022C2 is obsolete and is not supported."
 246 #endif
 247 
 248 #ifdef EFSYS_OPT_PHY_QT2025C
 249 # error "PHY_QT2025C is obsolete and is not supported."
 250 #endif
 251 
 252 #ifdef EFSYS_OPT_PHY_SFT9001
 253 # error "PHY_SFT9001 is obsolete and is not supported."
 254 #endif
 255 
 256 #ifdef EFSYS_OPT_PHY_SFX7101
 257 # error "PHY_SFX7101 is obsolete and is not supported."
 258 #endif
 259 
 260 /* Support PHY statistics */
 261 #if EFSYS_OPT_PHY_STATS
 262 # if !EFSYS_OPT_SIENA
 263 #  error "PHY_STATS requires SIENA"
 264 # endif
 265 #endif /* EFSYS_OPT_PHY_STATS */
 266 
 267 #ifdef EFSYS_OPT_PHY_TXC43128
 268 # error "PHY_TXC43128 is obsolete and is not supported."
 269 #endif
 270 
 271 /* Support EVQ/RXQ/TXQ statistics */
 272 #if EFSYS_OPT_QSTATS
 273 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 274 #  error "QSTATS requires SIENA or HUNTINGTON or MEDFORD"
 275 # endif
 276 #endif /* EFSYS_OPT_QSTATS */
 277 
 278 #ifdef EFSYS_OPT_RX_HDR_SPLIT
 279 # error "RX_HDR_SPLIT is obsolete and is not supported"
 280 #endif
 281 
 282 /* Support receive scaling (RSS) */
 283 #if EFSYS_OPT_RX_SCALE
 284 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 285 #  error "RX_SCALE requires SIENA or HUNTINGTON or MEDFORD"
 286 # endif
 287 #endif /* EFSYS_OPT_RX_SCALE */
 288 
 289 /* Support receive scatter DMA */
 290 #if EFSYS_OPT_RX_SCATTER
 291 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 292 #  error "RX_SCATTER requires SIENA or HUNTINGTON or MEDFORD"
 293 # endif
 294 #endif /* EFSYS_OPT_RX_SCATTER */
 295 
 296 #ifdef EFSYS_OPT_STAT_NAME
 297 # error "STAT_NAME is obsolete (replaced by NAMES)."
 298 #endif
 299 
 300 /* Support PCI Vital Product Data (VPD) */
 301 #if EFSYS_OPT_VPD
 302 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 303 #  error "VPD requires SIENA or HUNTINGTON or MEDFORD"
 304 # endif
 305 #endif /* EFSYS_OPT_VPD */
 306 
 307 /* Support Wake on LAN */
 308 #if EFSYS_OPT_WOL
 309 # if !EFSYS_OPT_SIENA
 310 #  error "WOL requires SIENA"
 311 # endif
 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 
 336 #endif /* _SYS_EFX_CHECK_H */