49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Copyright (c) 2006-2015 Solarflare Communications Inc.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * All rights reserved.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Redistribution and use in source and binary forms, with or without
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * modification, are permitted provided that the following conditions are met:
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * 1. Redistributions of source code must retain the above copyright notice,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * this list of conditions and the following disclaimer.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * 2. Redistributions in binary form must reproduce the above copyright notice,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * this list of conditions and the following disclaimer in the documentation
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * and/or other materials provided with the distribution.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * The views and conclusions contained in the software and documentation are
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * those of the authors and should not be interpreted as representing official
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * policies, either expressed or implied, of the FreeBSD Project.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* Return codes */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* Chip families */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FAMILY_FALCON, /* Obsolete and not supported */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_DEVID_FALCON 0x0710 /* SFC4000 */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_DEVID_BETHPAGE 0x0803 /* SFC9020 */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_DEVID_SIENA 0x0813 /* SFL9021 */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_DEVID_HUNTINGTON_PF_UNINIT 0x0901
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_DEVID_FARMINGDALE 0x0903 /* SFC9120 PF */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_DEVID_GREENPORT 0x0923 /* SFC9140 PF */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_DEVID_FARMINGDALE_VF 0x1903 /* SFC9120 VF */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_DEVID_GREENPORT_VF 0x1923 /* SFC9140 VF */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_DEVID_MEDFORD_PF_UNINIT 0x0913
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_DEVID_MEDFORD 0x0A03 /* SFC9240 PF */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_DEVID_MEDFORD_VF 0x1A03 /* SFC9240 VF */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* Error codes */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* Calculate the IEEE 802.3 CRC32 of a MAC addr */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* Type prototypes */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_DIAG */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* Huntington and Medford require MCDIv2 commands */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoretypedef struct efx_mcdi_req_s efx_mcdi_req_t;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_MCDI_LOGGING */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore void (*emt_execute)(void *, efx_mcdi_req_t *);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore void (*emt_exception)(void *, efx_mcdi_exception_t);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_MCDI_LOGGING */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore void (*emt_ev_proxy_response)(void *, uint32_t, efx_rc_t);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_MCDI */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* START MKCONFIG GENERATED EfxHeaderMacBlock e323546097fd7c65 */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* END MKCONFIG GENERATED EfxHeaderMacBlock */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_MAC_STATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_MAC_ADDR_IS_MULTICAST(_address) (((uint8_t*)_address)[0] & 0x01)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_MAC_PDU_MAX EFX_MAC_PDU(EFX_MAC_SDU_MAX)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreextern __checkReturn const char *
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_NAMES */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Upload mac statistics supported by the hardware into the given buffer.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * The reference buffer must be at least %EFX_MAC_STATS_SIZE bytes,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * and page aligned.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * The hardware will only DMA statistics that it understands (of course).
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Drivers should not make any assumptions about which statistics are
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * supported, especially when the statistics are generated by firmware.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Thus, drivers should zero this buffer before use, so that not-understood
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * statistics read back as zero.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_MAC_STATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreextern const char *
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_NAMES */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 5d4ee5185e419abe */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_MON_STAT_CONTROLLER_MASTER_VPTAT_EXT_ADC,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP_EXT_ADC,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT_EXT_ADC,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP_EXT_ADC,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* END MKCONFIG GENERATED MonitorHeaderStatsBlock */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreextern const char *
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_NAMES */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore __inout_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_MON_STATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_PHY_LED_CONTROL */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreextern __checkReturn const char *
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_NAMES */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_LOOPBACK */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* Get the type of medium currently used. If the board has ports for
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * modules, a module is present, and we recognise the media type of
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * the module, then this will be the media type of the module.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Otherwise it will be the media type of the port.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* START MKCONFIG GENERATED PhyHeaderStatsBlock 30ed56ad501f8e36 */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* END MKCONFIG GENERATED PhyHeaderStatsBlock */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreextern const char *
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_NAMES */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_PHY_STATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_BIST_TYPE_MC_MEM, /* Test the MC DMEM and IMEM */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_BIST_TYPE_SAT_MEM, /* Test the DMEM and IMEM of satellite cpus*/
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_BIST_TYPE_REG, /* Test the register memories */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Memory BIST specific values. These match to the MC_CMD_BIST_POLL
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * response. */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore __out_ecount_opt(count) unsigned long *valuesp,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_BIST */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_FEATURE_LFSR_HASH_INSERT 0x00000002
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_FEATURE_PERIODIC_MAC_STATS 0x00000008
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_FEATURE_LOOKAHEAD_SPLIT 0x00000040
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_FEATURE_MAC_HEADER_FILTERS 0x00000080
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_FEATURE_TX_SRC_FILTERS 0x00000400
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_FEATURE_FW_ASSISTED_TSO 0x00001000
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_FEATURE_FW_ASSISTED_TSO_V2 0x00002000
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore uint32_t enc_mon_stat_mask[(EFX_MON_NSTATS + 31) / 32];
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore efx_qword_t enc_loopback_types[EFX_LINK_NMODES];
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_LOOPBACK */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_PHY_FLAGS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_PHY_LED_CONTROL */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_PHY_STATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_PHY_STATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_SIENA */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_MON_STATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_BIST */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Maximum number of descriptors completed in an rx event. */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Number of rx descriptors the hardware requires for a push. */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Maximum number of bytes into the packet the TCP header can start for
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * the hardware to apply TSO packet edits.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore uint32_t enc_tx_tso_tcp_header_offset_limit;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Datapath firmware vadapter/vport/vswitch support */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore boolean_t enc_allow_set_mac_with_installed_filters;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* External port identifier */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* VPD may be per-PF or global */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_FUNCTION_IS_VF(_encp) ((_encp)->enc_vf != 0xffff)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (EFX_PCI_FUNCTION_IS_PF(_encp) ? (_encp)->enc_pf : (_encp)->enc_vf)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_PCI_VF_PARENT(_encp) ((_encp)->enc_pf)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* Driver resource limits (minimum required/maximum usable). */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* PIO blocks (sub-allocated from piobuf) */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_REGION_PIO_WRITE_VI, /* Memory BAR WC mapping */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_VPD_KEYWORD(x, y) ((x) | ((y) << 8))
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_VPD */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_DIAG */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_NVRAM */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_BOOTCFG */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore uint8_t mask[EFX_WOL_BITMAP_MASK_SIZE]; /* 1 bit per byte */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore uint8_t value[EFX_WOL_BITMAP_VALUE_SIZE]; /* value to match */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoretypedef union efx_lightsout_offload_param_u {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_WOL */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_DIAG */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* START MKCONFIG GENERATED EfxHeaderEventQueueBlock 6f3843f5fe7cc843 */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* END MKCONFIG GENERATED EfxHeaderEventQueueBlock */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_QSTATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_EVQ_SIZE(_nevs) ((_nevs) * sizeof (efx_qword_t))
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_EVQ_NBUFS(_nevs) (EFX_EVQ_SIZE(_nevs) / EFX_BUF_SIZE)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_EXCEPTION_RX_DSC_ERROR 0x00000002
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_EXCEPTION_TX_DSC_ERROR 0x00000003
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_EXCEPTION_UNKNOWN_SENSOREVT 0x00000004
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_EXCEPTION_FWALERT_SRAM 0x00000005
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_EXCEPTION_UNKNOWN_FWALERT 0x00000006
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_MON_STATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_MAC_STATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore efx_rxq_flush_failed_ev_t eec_rxq_flush_failed;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_MON_STATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_MAC_STATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_EV_PREFETCH */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreextern const char *
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_NAMES */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore __inout_ecount(EV_NQSTATS) efsys_stat_t *stat);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_QSTATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCATTER */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_RX_HASH_UNAVAILABLE = 0, /* Hardware hash not inserted */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_RX_HASH_AVAILABLE /* Insert hash with/without RSS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_RSS_TBL_SIZE 128 /* Rows in RX indirection table */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_MAXRSS 64 /* RX indirection entry range */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_MAXRSS_LEGACY 16 /* See bug16611 and bug17213 */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_RX_SCALE_UNAVAILABLE = 0, /* Not supported */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_RX_SCALE_EXCLUSIVE, /* Writable key/indirection table */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_RX_SCALE_SHARED /* Read-only key/indirection table */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCALE */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t))
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_SIZE)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_RXQ_LIMIT(_ndescs) ((_ndescs) - 16)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_RXQ_DC_NDESCS(_dcsize) (8 << _dcsize)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore __in unsigned int n,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* START MKCONFIG GENERATED EfxHeaderTransmitQueueBlock 12dff8778598b2db */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* END MKCONFIG GENERATED EfxHeaderTransmitQueueBlock */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_QSTATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (((_encp) == NULL) ? 1 : ((_encp)->enc_bug35388_workaround != 0))
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore ((EFX_BUG35388_WORKAROUND(_encp)) ? 2048 : 4096)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t))
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_TXQ_LIMIT(_ndescs) ((_ndescs) - 16)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_TXQ_DC_NDESCS(_dcsize) (8 << _dcsize)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_TXQ_MAX_BUFS 8 /* Maximum independent of EFX_BUG35388_WORKAROUND. */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore __in unsigned int n,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore __in unsigned int n,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* Number of FATSOv2 option descriptors */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* Maximum number of DMA segments per TSO packet (not superframe) */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX 24
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreextern const char *
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_NAMES */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore __inout_ecount(TX_NQSTATS) efsys_stat_t *stat);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_QSTATS */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_FLAG_RX_RSS = 0x01, /* use RSS to spread across
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * multiple queues */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_FLAG_RX_SCATTER = 0x02, /* enable RX scatter */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_FLAG_RX_OVER_AUTO = 0x04, /* Override an automatic filter
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * (priority EFX_FILTER_PRI_AUTO).
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * May only be set by the filter
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * implementation for each type.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * A removal request will
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * restore the automatic filter
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * in its place. */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_FLAG_RX = 0x08, /* Filter is for RX */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_FLAG_TX = 0x10, /* Filter is for TX */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_MATCH_LOC_HOST = 0x0002, /* Match by local IP host
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_MATCH_REM_MAC = 0x0004, /* Match by remote MAC address */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_MATCH_REM_PORT = 0x0008, /* Match by remote TCP/UDP port */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_MATCH_LOC_MAC = 0x0010, /* Match by remote TCP/UDP port */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_MATCH_LOC_PORT = 0x0020, /* Match by local TCP/UDP port */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_MATCH_ETHER_TYPE = 0x0040, /* Match by Ether-type */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_MATCH_INNER_VID = 0x0080, /* Match by inner VLAN ID */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_MATCH_OUTER_VID = 0x0100, /* Match by outer VLAN ID */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_MATCH_IP_PROTO = 0x0200, /* Match by IP transport
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * protocol */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_MATCH_LOC_MAC_IG = 0x0400, /* Match by local MAC address
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * I/G bit. Used for RX default
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * unicast and multicast/
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * broadcast filters. */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_PRI_HINT = 0, /* Performance hint */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_PRI_AUTO, /* Automatic filter based on device
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * address list or hardware
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * requirements. This may only be used
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * by the filter implementation for
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * each NIC type. */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_PRI_MANUAL, /* Manually configured filter */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_FILTER_PRI_REQUIRED, /* Required for correct behaviour of the
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * client (e.g. SR-IOV, HyperV VMQ etc.)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * FIXME: All these fields are assumed to be in little-endian byte order.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * It may be better for some to be big-endian. See bug42804.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* Default values for use in filter specifications */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT 0xffffffff
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#define EFX_FILTER_SPEC_RX_DMAQ_ID_DROP 0xfff
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_FILTER */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* LICENSING */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreextern __checkReturn __success(return != B_FALSE) boolean_t
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreextern __checkReturn __success(return != B_FALSE) boolean_t
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_LICENSING */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* _SYS_EFX_H */