1e948693eSPhilip Paeps /*- 2718cf2ccSPedro F. Giffuni * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3718cf2ccSPedro F. Giffuni * 4929c7febSAndrew Rybchenko * Copyright (c) 2007-2016 Solarflare Communications Inc. 53c838a9fSAndrew Rybchenko * All rights reserved. 6e948693eSPhilip Paeps * 7e948693eSPhilip Paeps * Redistribution and use in source and binary forms, with or without 83c838a9fSAndrew Rybchenko * modification, are permitted provided that the following conditions are met: 9e948693eSPhilip Paeps * 103c838a9fSAndrew Rybchenko * 1. Redistributions of source code must retain the above copyright notice, 113c838a9fSAndrew Rybchenko * this list of conditions and the following disclaimer. 123c838a9fSAndrew Rybchenko * 2. Redistributions in binary form must reproduce the above copyright notice, 133c838a9fSAndrew Rybchenko * this list of conditions and the following disclaimer in the documentation 143c838a9fSAndrew Rybchenko * and/or other materials provided with the distribution. 153c838a9fSAndrew Rybchenko * 163c838a9fSAndrew Rybchenko * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 173c838a9fSAndrew Rybchenko * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 183c838a9fSAndrew Rybchenko * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 193c838a9fSAndrew Rybchenko * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 203c838a9fSAndrew Rybchenko * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 213c838a9fSAndrew Rybchenko * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 223c838a9fSAndrew Rybchenko * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 233c838a9fSAndrew Rybchenko * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 243c838a9fSAndrew Rybchenko * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 253c838a9fSAndrew Rybchenko * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 263c838a9fSAndrew Rybchenko * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 273c838a9fSAndrew Rybchenko * 283c838a9fSAndrew Rybchenko * The views and conclusions contained in the software and documentation are 293c838a9fSAndrew Rybchenko * those of the authors and should not be interpreted as representing official 303c838a9fSAndrew Rybchenko * policies, either expressed or implied, of the FreeBSD Project. 315dee87d7SPhilip Paeps * 325dee87d7SPhilip Paeps * $FreeBSD$ 33e948693eSPhilip Paeps */ 34e948693eSPhilip Paeps 35e948693eSPhilip Paeps #ifndef _SYS_EFX_IMPL_H 36e948693eSPhilip Paeps #define _SYS_EFX_IMPL_H 37e948693eSPhilip Paeps 38e948693eSPhilip Paeps #include "efx.h" 39e948693eSPhilip Paeps #include "efx_regs.h" 403c838a9fSAndrew Rybchenko #include "efx_regs_ef10.h" 413c838a9fSAndrew Rybchenko 423c838a9fSAndrew Rybchenko /* FIXME: Add definition for driver generated software events */ 433c838a9fSAndrew Rybchenko #ifndef ESE_DZ_EV_CODE_DRV_GEN_EV 443c838a9fSAndrew Rybchenko #define ESE_DZ_EV_CODE_DRV_GEN_EV FSE_AZ_EV_CODE_DRV_GEN_EV 453c838a9fSAndrew Rybchenko #endif 463c838a9fSAndrew Rybchenko 47e948693eSPhilip Paeps 48e948693eSPhilip Paeps #if EFSYS_OPT_SIENA 49e948693eSPhilip Paeps #include "siena_impl.h" 50e948693eSPhilip Paeps #endif /* EFSYS_OPT_SIENA */ 51e948693eSPhilip Paeps 523c838a9fSAndrew Rybchenko #if EFSYS_OPT_HUNTINGTON 533c838a9fSAndrew Rybchenko #include "hunt_impl.h" 543c838a9fSAndrew Rybchenko #endif /* EFSYS_OPT_HUNTINGTON */ 553c838a9fSAndrew Rybchenko 565f5c71ccSAndrew Rybchenko #if EFSYS_OPT_MEDFORD 575f5c71ccSAndrew Rybchenko #include "medford_impl.h" 585f5c71ccSAndrew Rybchenko #endif /* EFSYS_OPT_MEDFORD */ 595f5c71ccSAndrew Rybchenko 605f5c71ccSAndrew Rybchenko #if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) 615f5c71ccSAndrew Rybchenko #include "ef10_impl.h" 625f5c71ccSAndrew Rybchenko #endif /* (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */ 635f5c71ccSAndrew Rybchenko 64e948693eSPhilip Paeps #ifdef __cplusplus 65e948693eSPhilip Paeps extern "C" { 66e948693eSPhilip Paeps #endif 67e948693eSPhilip Paeps 68e948693eSPhilip Paeps #define EFX_MOD_MCDI 0x00000001 69e948693eSPhilip Paeps #define EFX_MOD_PROBE 0x00000002 70e948693eSPhilip Paeps #define EFX_MOD_NVRAM 0x00000004 71e948693eSPhilip Paeps #define EFX_MOD_VPD 0x00000008 72e948693eSPhilip Paeps #define EFX_MOD_NIC 0x00000010 73e948693eSPhilip Paeps #define EFX_MOD_INTR 0x00000020 74e948693eSPhilip Paeps #define EFX_MOD_EV 0x00000040 75e948693eSPhilip Paeps #define EFX_MOD_RX 0x00000080 76e948693eSPhilip Paeps #define EFX_MOD_TX 0x00000100 77e948693eSPhilip Paeps #define EFX_MOD_PORT 0x00000200 78e948693eSPhilip Paeps #define EFX_MOD_MON 0x00000400 79e948693eSPhilip Paeps #define EFX_MOD_FILTER 0x00001000 80908ecfc6SAndrew Rybchenko #define EFX_MOD_LIC 0x00002000 81e948693eSPhilip Paeps 820c909247SAndrew Rybchenko #define EFX_RESET_PHY 0x00000001 830c909247SAndrew Rybchenko #define EFX_RESET_RXQ_ERR 0x00000002 840c909247SAndrew Rybchenko #define EFX_RESET_TXQ_ERR 0x00000004 85e948693eSPhilip Paeps 86e948693eSPhilip Paeps typedef enum efx_mac_type_e { 87e948693eSPhilip Paeps EFX_MAC_INVALID = 0, 88e948693eSPhilip Paeps EFX_MAC_SIENA, 893c838a9fSAndrew Rybchenko EFX_MAC_HUNTINGTON, 90c15d6d21SAndrew Rybchenko EFX_MAC_MEDFORD, 91e948693eSPhilip Paeps EFX_MAC_NTYPES 92e948693eSPhilip Paeps } efx_mac_type_t; 93e948693eSPhilip Paeps 943c838a9fSAndrew Rybchenko typedef struct efx_ev_ops_s { 95460cb568SAndrew Rybchenko efx_rc_t (*eevo_init)(efx_nic_t *); 963c838a9fSAndrew Rybchenko void (*eevo_fini)(efx_nic_t *); 97460cb568SAndrew Rybchenko efx_rc_t (*eevo_qcreate)(efx_nic_t *, unsigned int, 983c838a9fSAndrew Rybchenko efsys_mem_t *, size_t, uint32_t, 99a3fe009aSAndrew Rybchenko uint32_t, uint32_t, efx_evq_t *); 1003c838a9fSAndrew Rybchenko void (*eevo_qdestroy)(efx_evq_t *); 101460cb568SAndrew Rybchenko efx_rc_t (*eevo_qprime)(efx_evq_t *, unsigned int); 1023c838a9fSAndrew Rybchenko void (*eevo_qpost)(efx_evq_t *, uint16_t); 103460cb568SAndrew Rybchenko efx_rc_t (*eevo_qmoderate)(efx_evq_t *, unsigned int); 1043c838a9fSAndrew Rybchenko #if EFSYS_OPT_QSTATS 1053c838a9fSAndrew Rybchenko void (*eevo_qstats_update)(efx_evq_t *, efsys_stat_t *); 1063c838a9fSAndrew Rybchenko #endif 1073c838a9fSAndrew Rybchenko } efx_ev_ops_t; 1083c838a9fSAndrew Rybchenko 1093c838a9fSAndrew Rybchenko typedef struct efx_tx_ops_s { 110460cb568SAndrew Rybchenko efx_rc_t (*etxo_init)(efx_nic_t *); 1113c838a9fSAndrew Rybchenko void (*etxo_fini)(efx_nic_t *); 112460cb568SAndrew Rybchenko efx_rc_t (*etxo_qcreate)(efx_nic_t *, 1133c838a9fSAndrew Rybchenko unsigned int, unsigned int, 1143c838a9fSAndrew Rybchenko efsys_mem_t *, size_t, 1153c838a9fSAndrew Rybchenko uint32_t, uint16_t, 1163c838a9fSAndrew Rybchenko efx_evq_t *, efx_txq_t *, 1173c838a9fSAndrew Rybchenko unsigned int *); 1183c838a9fSAndrew Rybchenko void (*etxo_qdestroy)(efx_txq_t *); 119460cb568SAndrew Rybchenko efx_rc_t (*etxo_qpost)(efx_txq_t *, efx_buffer_t *, 1203c838a9fSAndrew Rybchenko unsigned int, unsigned int, 1213c838a9fSAndrew Rybchenko unsigned int *); 1223c838a9fSAndrew Rybchenko void (*etxo_qpush)(efx_txq_t *, unsigned int, unsigned int); 123460cb568SAndrew Rybchenko efx_rc_t (*etxo_qpace)(efx_txq_t *, unsigned int); 124460cb568SAndrew Rybchenko efx_rc_t (*etxo_qflush)(efx_txq_t *); 1253c838a9fSAndrew Rybchenko void (*etxo_qenable)(efx_txq_t *); 126460cb568SAndrew Rybchenko efx_rc_t (*etxo_qpio_enable)(efx_txq_t *); 1273c838a9fSAndrew Rybchenko void (*etxo_qpio_disable)(efx_txq_t *); 128460cb568SAndrew Rybchenko efx_rc_t (*etxo_qpio_write)(efx_txq_t *, uint8_t *, size_t, 1293c838a9fSAndrew Rybchenko size_t); 130460cb568SAndrew Rybchenko efx_rc_t (*etxo_qpio_post)(efx_txq_t *, size_t, unsigned int, 1313c838a9fSAndrew Rybchenko unsigned int *); 132460cb568SAndrew Rybchenko efx_rc_t (*etxo_qdesc_post)(efx_txq_t *, efx_desc_t *, 1333c838a9fSAndrew Rybchenko unsigned int, unsigned int, 1343c838a9fSAndrew Rybchenko unsigned int *); 1353c838a9fSAndrew Rybchenko void (*etxo_qdesc_dma_create)(efx_txq_t *, efsys_dma_addr_t, 1363c838a9fSAndrew Rybchenko size_t, boolean_t, 1373c838a9fSAndrew Rybchenko efx_desc_t *); 1383c838a9fSAndrew Rybchenko void (*etxo_qdesc_tso_create)(efx_txq_t *, uint16_t, 1393c838a9fSAndrew Rybchenko uint32_t, uint8_t, 1403c838a9fSAndrew Rybchenko efx_desc_t *); 1414ab49369SAndrew Rybchenko void (*etxo_qdesc_tso2_create)(efx_txq_t *, uint16_t, 1424ab49369SAndrew Rybchenko uint32_t, uint16_t, 1434ab49369SAndrew Rybchenko efx_desc_t *, int); 1443c838a9fSAndrew Rybchenko void (*etxo_qdesc_vlantci_create)(efx_txq_t *, uint16_t, 1453c838a9fSAndrew Rybchenko efx_desc_t *); 1463c838a9fSAndrew Rybchenko #if EFSYS_OPT_QSTATS 1473c838a9fSAndrew Rybchenko void (*etxo_qstats_update)(efx_txq_t *, 1483c838a9fSAndrew Rybchenko efsys_stat_t *); 1493c838a9fSAndrew Rybchenko #endif 1503c838a9fSAndrew Rybchenko } efx_tx_ops_t; 1513c838a9fSAndrew Rybchenko 1523c838a9fSAndrew Rybchenko typedef struct efx_rx_ops_s { 153460cb568SAndrew Rybchenko efx_rc_t (*erxo_init)(efx_nic_t *); 1543c838a9fSAndrew Rybchenko void (*erxo_fini)(efx_nic_t *); 1553c838a9fSAndrew Rybchenko #if EFSYS_OPT_RX_SCATTER 156460cb568SAndrew Rybchenko efx_rc_t (*erxo_scatter_enable)(efx_nic_t *, unsigned int); 1573c838a9fSAndrew Rybchenko #endif 1583c838a9fSAndrew Rybchenko #if EFSYS_OPT_RX_SCALE 159460cb568SAndrew Rybchenko efx_rc_t (*erxo_scale_mode_set)(efx_nic_t *, efx_rx_hash_alg_t, 1603c838a9fSAndrew Rybchenko efx_rx_hash_type_t, boolean_t); 161460cb568SAndrew Rybchenko efx_rc_t (*erxo_scale_key_set)(efx_nic_t *, uint8_t *, size_t); 162460cb568SAndrew Rybchenko efx_rc_t (*erxo_scale_tbl_set)(efx_nic_t *, unsigned int *, 1633c838a9fSAndrew Rybchenko size_t); 1640badfd72SAndrew Rybchenko uint32_t (*erxo_prefix_hash)(efx_nic_t *, efx_rx_hash_alg_t, 1650badfd72SAndrew Rybchenko uint8_t *); 1660badfd72SAndrew Rybchenko #endif /* EFSYS_OPT_RX_SCALE */ 1670badfd72SAndrew Rybchenko efx_rc_t (*erxo_prefix_pktlen)(efx_nic_t *, uint8_t *, 1680badfd72SAndrew Rybchenko uint16_t *); 1693c838a9fSAndrew Rybchenko void (*erxo_qpost)(efx_rxq_t *, efsys_dma_addr_t *, size_t, 1703c838a9fSAndrew Rybchenko unsigned int, unsigned int, 1713c838a9fSAndrew Rybchenko unsigned int); 1723c838a9fSAndrew Rybchenko void (*erxo_qpush)(efx_rxq_t *, unsigned int, unsigned int *); 1738e0c4827SAndrew Rybchenko #if EFSYS_OPT_RX_PACKED_STREAM 1748e0c4827SAndrew Rybchenko void (*erxo_qpush_ps_credits)(efx_rxq_t *); 1758e0c4827SAndrew Rybchenko uint8_t * (*erxo_qps_packet_info)(efx_rxq_t *, uint8_t *, 1768e0c4827SAndrew Rybchenko uint32_t, uint32_t, 1778e0c4827SAndrew Rybchenko uint16_t *, uint32_t *, uint32_t *); 1788e0c4827SAndrew Rybchenko #endif 179460cb568SAndrew Rybchenko efx_rc_t (*erxo_qflush)(efx_rxq_t *); 1803c838a9fSAndrew Rybchenko void (*erxo_qenable)(efx_rxq_t *); 181460cb568SAndrew Rybchenko efx_rc_t (*erxo_qcreate)(efx_nic_t *enp, unsigned int, 1823c838a9fSAndrew Rybchenko unsigned int, efx_rxq_type_t, 1833c838a9fSAndrew Rybchenko efsys_mem_t *, size_t, uint32_t, 1843c838a9fSAndrew Rybchenko efx_evq_t *, efx_rxq_t *); 1853c838a9fSAndrew Rybchenko void (*erxo_qdestroy)(efx_rxq_t *); 1863c838a9fSAndrew Rybchenko } efx_rx_ops_t; 1873c838a9fSAndrew Rybchenko 188e948693eSPhilip Paeps typedef struct efx_mac_ops_s { 189460cb568SAndrew Rybchenko efx_rc_t (*emo_poll)(efx_nic_t *, efx_link_mode_t *); 190460cb568SAndrew Rybchenko efx_rc_t (*emo_up)(efx_nic_t *, boolean_t *); 191460cb568SAndrew Rybchenko efx_rc_t (*emo_addr_set)(efx_nic_t *); 19208c5af79SAndrew Rybchenko efx_rc_t (*emo_pdu_set)(efx_nic_t *); 193d8484af2SAndrew Rybchenko efx_rc_t (*emo_pdu_get)(efx_nic_t *, size_t *); 194460cb568SAndrew Rybchenko efx_rc_t (*emo_reconfigure)(efx_nic_t *); 195460cb568SAndrew Rybchenko efx_rc_t (*emo_multicast_list_set)(efx_nic_t *); 196460cb568SAndrew Rybchenko efx_rc_t (*emo_filter_default_rxq_set)(efx_nic_t *, 1973c838a9fSAndrew Rybchenko efx_rxq_t *, boolean_t); 1983c838a9fSAndrew Rybchenko void (*emo_filter_default_rxq_clear)(efx_nic_t *); 199e948693eSPhilip Paeps #if EFSYS_OPT_LOOPBACK 200460cb568SAndrew Rybchenko efx_rc_t (*emo_loopback_set)(efx_nic_t *, efx_link_mode_t, 201e948693eSPhilip Paeps efx_loopback_type_t); 202e948693eSPhilip Paeps #endif /* EFSYS_OPT_LOOPBACK */ 203e948693eSPhilip Paeps #if EFSYS_OPT_MAC_STATS 20458a72cb2SAndrew Rybchenko efx_rc_t (*emo_stats_get_mask)(efx_nic_t *, uint32_t *, size_t); 20531e518b4SAndrew Rybchenko efx_rc_t (*emo_stats_clear)(efx_nic_t *); 206460cb568SAndrew Rybchenko efx_rc_t (*emo_stats_upload)(efx_nic_t *, efsys_mem_t *); 207460cb568SAndrew Rybchenko efx_rc_t (*emo_stats_periodic)(efx_nic_t *, efsys_mem_t *, 208e948693eSPhilip Paeps uint16_t, boolean_t); 209460cb568SAndrew Rybchenko efx_rc_t (*emo_stats_update)(efx_nic_t *, efsys_mem_t *, 210e948693eSPhilip Paeps efsys_stat_t *, uint32_t *); 211e948693eSPhilip Paeps #endif /* EFSYS_OPT_MAC_STATS */ 212e948693eSPhilip Paeps } efx_mac_ops_t; 213e948693eSPhilip Paeps 214e948693eSPhilip Paeps typedef struct efx_phy_ops_s { 215460cb568SAndrew Rybchenko efx_rc_t (*epo_power)(efx_nic_t *, boolean_t); /* optional */ 216460cb568SAndrew Rybchenko efx_rc_t (*epo_reset)(efx_nic_t *); 217460cb568SAndrew Rybchenko efx_rc_t (*epo_reconfigure)(efx_nic_t *); 218460cb568SAndrew Rybchenko efx_rc_t (*epo_verify)(efx_nic_t *); 219460cb568SAndrew Rybchenko efx_rc_t (*epo_oui_get)(efx_nic_t *, uint32_t *); 220e948693eSPhilip Paeps #if EFSYS_OPT_PHY_STATS 221460cb568SAndrew Rybchenko efx_rc_t (*epo_stats_update)(efx_nic_t *, efsys_mem_t *, 222e948693eSPhilip Paeps uint32_t *); 223e948693eSPhilip Paeps #endif /* EFSYS_OPT_PHY_STATS */ 2243c838a9fSAndrew Rybchenko #if EFSYS_OPT_BIST 225460cb568SAndrew Rybchenko efx_rc_t (*epo_bist_enable_offline)(efx_nic_t *); 226460cb568SAndrew Rybchenko efx_rc_t (*epo_bist_start)(efx_nic_t *, efx_bist_type_t); 227460cb568SAndrew Rybchenko efx_rc_t (*epo_bist_poll)(efx_nic_t *, efx_bist_type_t, 2283c838a9fSAndrew Rybchenko efx_bist_result_t *, uint32_t *, 229e948693eSPhilip Paeps unsigned long *, size_t); 2303c838a9fSAndrew Rybchenko void (*epo_bist_stop)(efx_nic_t *, efx_bist_type_t); 2313c838a9fSAndrew Rybchenko #endif /* EFSYS_OPT_BIST */ 232e948693eSPhilip Paeps } efx_phy_ops_t; 233e948693eSPhilip Paeps 2343c838a9fSAndrew Rybchenko #if EFSYS_OPT_FILTER 2353c838a9fSAndrew Rybchenko typedef struct efx_filter_ops_s { 236460cb568SAndrew Rybchenko efx_rc_t (*efo_init)(efx_nic_t *); 2373c838a9fSAndrew Rybchenko void (*efo_fini)(efx_nic_t *); 238460cb568SAndrew Rybchenko efx_rc_t (*efo_restore)(efx_nic_t *); 239460cb568SAndrew Rybchenko efx_rc_t (*efo_add)(efx_nic_t *, efx_filter_spec_t *, 2403c838a9fSAndrew Rybchenko boolean_t may_replace); 241460cb568SAndrew Rybchenko efx_rc_t (*efo_delete)(efx_nic_t *, efx_filter_spec_t *); 24263492ab8SAndrew Rybchenko efx_rc_t (*efo_supported_filters)(efx_nic_t *, uint32_t *, 24363492ab8SAndrew Rybchenko size_t, size_t *); 244460cb568SAndrew Rybchenko efx_rc_t (*efo_reconfigure)(efx_nic_t *, uint8_t const *, boolean_t, 2453c838a9fSAndrew Rybchenko boolean_t, boolean_t, boolean_t, 24647cb5106SAndrew Rybchenko uint8_t const *, uint32_t); 2473c838a9fSAndrew Rybchenko } efx_filter_ops_t; 2483c838a9fSAndrew Rybchenko 249460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 2503c838a9fSAndrew Rybchenko efx_filter_reconfigure( 2513c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 2523c838a9fSAndrew Rybchenko __in_ecount(6) uint8_t const *mac_addr, 2533c838a9fSAndrew Rybchenko __in boolean_t all_unicst, 2543c838a9fSAndrew Rybchenko __in boolean_t mulcst, 2553c838a9fSAndrew Rybchenko __in boolean_t all_mulcst, 2563c838a9fSAndrew Rybchenko __in boolean_t brdcst, 2573c838a9fSAndrew Rybchenko __in_ecount(6*count) uint8_t const *addrs, 25847cb5106SAndrew Rybchenko __in uint32_t count); 2593c838a9fSAndrew Rybchenko 2603c838a9fSAndrew Rybchenko #endif /* EFSYS_OPT_FILTER */ 2613c838a9fSAndrew Rybchenko 2623c838a9fSAndrew Rybchenko 263e948693eSPhilip Paeps typedef struct efx_port_s { 264e948693eSPhilip Paeps efx_mac_type_t ep_mac_type; 265e948693eSPhilip Paeps uint32_t ep_phy_type; 266e948693eSPhilip Paeps uint8_t ep_port; 267e948693eSPhilip Paeps uint32_t ep_mac_pdu; 268e948693eSPhilip Paeps uint8_t ep_mac_addr[6]; 269e948693eSPhilip Paeps efx_link_mode_t ep_link_mode; 2703c838a9fSAndrew Rybchenko boolean_t ep_all_unicst; 2713c838a9fSAndrew Rybchenko boolean_t ep_mulcst; 2723c838a9fSAndrew Rybchenko boolean_t ep_all_mulcst; 273e948693eSPhilip Paeps boolean_t ep_brdcst; 274e948693eSPhilip Paeps unsigned int ep_fcntl; 275e948693eSPhilip Paeps boolean_t ep_fcntl_autoneg; 276e948693eSPhilip Paeps efx_oword_t ep_multicst_hash[2]; 2773c838a9fSAndrew Rybchenko uint8_t ep_mulcst_addr_list[EFX_MAC_ADDR_LEN * 2783c838a9fSAndrew Rybchenko EFX_MAC_MULTICAST_LIST_MAX]; 2793c838a9fSAndrew Rybchenko uint32_t ep_mulcst_addr_count; 280e948693eSPhilip Paeps #if EFSYS_OPT_LOOPBACK 281e948693eSPhilip Paeps efx_loopback_type_t ep_loopback_type; 282e948693eSPhilip Paeps efx_link_mode_t ep_loopback_link_mode; 283e948693eSPhilip Paeps #endif /* EFSYS_OPT_LOOPBACK */ 284e948693eSPhilip Paeps #if EFSYS_OPT_PHY_FLAGS 285e948693eSPhilip Paeps uint32_t ep_phy_flags; 286e948693eSPhilip Paeps #endif /* EFSYS_OPT_PHY_FLAGS */ 287e948693eSPhilip Paeps #if EFSYS_OPT_PHY_LED_CONTROL 288e948693eSPhilip Paeps efx_phy_led_mode_t ep_phy_led_mode; 289e948693eSPhilip Paeps #endif /* EFSYS_OPT_PHY_LED_CONTROL */ 290e948693eSPhilip Paeps efx_phy_media_type_t ep_fixed_port_type; 291e948693eSPhilip Paeps efx_phy_media_type_t ep_module_type; 292e948693eSPhilip Paeps uint32_t ep_adv_cap_mask; 293e948693eSPhilip Paeps uint32_t ep_lp_cap_mask; 294e948693eSPhilip Paeps uint32_t ep_default_adv_cap_mask; 295e948693eSPhilip Paeps uint32_t ep_phy_cap_mask; 296e948693eSPhilip Paeps boolean_t ep_mac_drain; 297e948693eSPhilip Paeps boolean_t ep_mac_stats_pending; 2983c838a9fSAndrew Rybchenko #if EFSYS_OPT_BIST 2993c838a9fSAndrew Rybchenko efx_bist_type_t ep_current_bist; 300e948693eSPhilip Paeps #endif 301ec831f7fSAndrew Rybchenko const efx_mac_ops_t *ep_emop; 302ec831f7fSAndrew Rybchenko const efx_phy_ops_t *ep_epop; 303e948693eSPhilip Paeps } efx_port_t; 304e948693eSPhilip Paeps 305e948693eSPhilip Paeps typedef struct efx_mon_ops_s { 306e948693eSPhilip Paeps #if EFSYS_OPT_MON_STATS 307460cb568SAndrew Rybchenko efx_rc_t (*emo_stats_update)(efx_nic_t *, efsys_mem_t *, 308e948693eSPhilip Paeps efx_mon_stat_value_t *); 309e948693eSPhilip Paeps #endif /* EFSYS_OPT_MON_STATS */ 310e948693eSPhilip Paeps } efx_mon_ops_t; 311e948693eSPhilip Paeps 312e948693eSPhilip Paeps typedef struct efx_mon_s { 313e948693eSPhilip Paeps efx_mon_type_t em_type; 314ec831f7fSAndrew Rybchenko const efx_mon_ops_t *em_emop; 315e948693eSPhilip Paeps } efx_mon_t; 316e948693eSPhilip Paeps 3173c838a9fSAndrew Rybchenko typedef struct efx_intr_ops_s { 318460cb568SAndrew Rybchenko efx_rc_t (*eio_init)(efx_nic_t *, efx_intr_type_t, efsys_mem_t *); 3193c838a9fSAndrew Rybchenko void (*eio_enable)(efx_nic_t *); 3203c838a9fSAndrew Rybchenko void (*eio_disable)(efx_nic_t *); 3213c838a9fSAndrew Rybchenko void (*eio_disable_unlocked)(efx_nic_t *); 322460cb568SAndrew Rybchenko efx_rc_t (*eio_trigger)(efx_nic_t *, unsigned int); 3230c24a07eSAndrew Rybchenko void (*eio_status_line)(efx_nic_t *, boolean_t *, uint32_t *); 3240c24a07eSAndrew Rybchenko void (*eio_status_message)(efx_nic_t *, unsigned int, 3250c24a07eSAndrew Rybchenko boolean_t *); 3260c24a07eSAndrew Rybchenko void (*eio_fatal)(efx_nic_t *); 3273c838a9fSAndrew Rybchenko void (*eio_fini)(efx_nic_t *); 3283c838a9fSAndrew Rybchenko } efx_intr_ops_t; 3293c838a9fSAndrew Rybchenko 330e948693eSPhilip Paeps typedef struct efx_intr_s { 331ec831f7fSAndrew Rybchenko const efx_intr_ops_t *ei_eiop; 332e948693eSPhilip Paeps efsys_mem_t *ei_esmp; 3333c838a9fSAndrew Rybchenko efx_intr_type_t ei_type; 334e948693eSPhilip Paeps unsigned int ei_level; 335e948693eSPhilip Paeps } efx_intr_t; 336e948693eSPhilip Paeps 337e948693eSPhilip Paeps typedef struct efx_nic_ops_s { 338460cb568SAndrew Rybchenko efx_rc_t (*eno_probe)(efx_nic_t *); 339cfa023ebSAndrew Rybchenko efx_rc_t (*eno_board_cfg)(efx_nic_t *); 340460cb568SAndrew Rybchenko efx_rc_t (*eno_set_drv_limits)(efx_nic_t *, efx_drv_limits_t*); 341460cb568SAndrew Rybchenko efx_rc_t (*eno_reset)(efx_nic_t *); 342460cb568SAndrew Rybchenko efx_rc_t (*eno_init)(efx_nic_t *); 343460cb568SAndrew Rybchenko efx_rc_t (*eno_get_vi_pool)(efx_nic_t *, uint32_t *); 344460cb568SAndrew Rybchenko efx_rc_t (*eno_get_bar_region)(efx_nic_t *, efx_nic_region_t, 3453c838a9fSAndrew Rybchenko uint32_t *, size_t *); 346e948693eSPhilip Paeps #if EFSYS_OPT_DIAG 347460cb568SAndrew Rybchenko efx_rc_t (*eno_register_test)(efx_nic_t *); 348e948693eSPhilip Paeps #endif /* EFSYS_OPT_DIAG */ 349e948693eSPhilip Paeps void (*eno_fini)(efx_nic_t *); 350e948693eSPhilip Paeps void (*eno_unprobe)(efx_nic_t *); 351e948693eSPhilip Paeps } efx_nic_ops_t; 352e948693eSPhilip Paeps 3539ab060a7SAndrew Rybchenko #ifndef EFX_TXQ_LIMIT_TARGET 354e948693eSPhilip Paeps #define EFX_TXQ_LIMIT_TARGET 259 3559ab060a7SAndrew Rybchenko #endif 3569ab060a7SAndrew Rybchenko #ifndef EFX_RXQ_LIMIT_TARGET 35775ba9e1eSAndrew Rybchenko #define EFX_RXQ_LIMIT_TARGET 512 3589ab060a7SAndrew Rybchenko #endif 3599ab060a7SAndrew Rybchenko #ifndef EFX_TXQ_DC_SIZE 3609ab060a7SAndrew Rybchenko #define EFX_TXQ_DC_SIZE 1 /* 16 descriptors */ 3619ab060a7SAndrew Rybchenko #endif 3629ab060a7SAndrew Rybchenko #ifndef EFX_RXQ_DC_SIZE 3639ab060a7SAndrew Rybchenko #define EFX_RXQ_DC_SIZE 3 /* 64 descriptors */ 3649ab060a7SAndrew Rybchenko #endif 365e948693eSPhilip Paeps 366e948693eSPhilip Paeps #if EFSYS_OPT_FILTER 367e948693eSPhilip Paeps 368f7aa4b3dSAndrew Rybchenko typedef struct siena_filter_spec_s { 369f7aa4b3dSAndrew Rybchenko uint8_t sfs_type; 370f7aa4b3dSAndrew Rybchenko uint32_t sfs_flags; 371f7aa4b3dSAndrew Rybchenko uint32_t sfs_dmaq_id; 372f7aa4b3dSAndrew Rybchenko uint32_t sfs_dword[3]; 373f7aa4b3dSAndrew Rybchenko } siena_filter_spec_t; 3743c838a9fSAndrew Rybchenko 375f7aa4b3dSAndrew Rybchenko typedef enum siena_filter_type_e { 376f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_RX_TCP_FULL, /* TCP/IPv4 {dIP,dTCP,sIP,sTCP} */ 377f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_RX_TCP_WILD, /* TCP/IPv4 {dIP,dTCP, -, -} */ 378f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_RX_UDP_FULL, /* UDP/IPv4 {dIP,dUDP,sIP,sUDP} */ 379f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_RX_UDP_WILD, /* UDP/IPv4 {dIP,dUDP, -, -} */ 380f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_RX_MAC_FULL, /* Ethernet {dMAC,VLAN} */ 381f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_RX_MAC_WILD, /* Ethernet {dMAC, -} */ 382e948693eSPhilip Paeps 383f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_TX_TCP_FULL, /* TCP/IPv4 {dIP,dTCP,sIP,sTCP} */ 384f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_TX_TCP_WILD, /* TCP/IPv4 { -, -,sIP,sTCP} */ 385f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_TX_UDP_FULL, /* UDP/IPv4 {dIP,dTCP,sIP,sTCP} */ 386f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_TX_UDP_WILD, /* UDP/IPv4 { -, -,sIP,sUDP} */ 387f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_TX_MAC_FULL, /* Ethernet {sMAC,VLAN} */ 388f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_TX_MAC_WILD, /* Ethernet {sMAC, -} */ 389e948693eSPhilip Paeps 390f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_NTYPES 391f7aa4b3dSAndrew Rybchenko } siena_filter_type_t; 392e948693eSPhilip Paeps 393f7aa4b3dSAndrew Rybchenko typedef enum siena_filter_tbl_id_e { 394f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_TBL_RX_IP = 0, 395f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_TBL_RX_MAC, 396f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_TBL_TX_IP, 397f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_TBL_TX_MAC, 398f7aa4b3dSAndrew Rybchenko EFX_SIENA_FILTER_NTBLS 399f7aa4b3dSAndrew Rybchenko } siena_filter_tbl_id_t; 400e948693eSPhilip Paeps 401f7aa4b3dSAndrew Rybchenko typedef struct siena_filter_tbl_s { 402f7aa4b3dSAndrew Rybchenko int sft_size; /* number of entries */ 403f7aa4b3dSAndrew Rybchenko int sft_used; /* active count */ 404f7aa4b3dSAndrew Rybchenko uint32_t *sft_bitmap; /* active bitmap */ 405f7aa4b3dSAndrew Rybchenko siena_filter_spec_t *sft_spec; /* array of saved specs */ 406f7aa4b3dSAndrew Rybchenko } siena_filter_tbl_t; 407e948693eSPhilip Paeps 408f7aa4b3dSAndrew Rybchenko typedef struct siena_filter_s { 409f7aa4b3dSAndrew Rybchenko siena_filter_tbl_t sf_tbl[EFX_SIENA_FILTER_NTBLS]; 410f7aa4b3dSAndrew Rybchenko unsigned int sf_depth[EFX_SIENA_FILTER_NTYPES]; 411f7aa4b3dSAndrew Rybchenko } siena_filter_t; 412e948693eSPhilip Paeps 413e948693eSPhilip Paeps typedef struct efx_filter_s { 414e75412c9SAndrew Rybchenko #if EFSYS_OPT_SIENA 415f7aa4b3dSAndrew Rybchenko siena_filter_t *ef_siena_filter; 416e75412c9SAndrew Rybchenko #endif /* EFSYS_OPT_SIENA */ 4171289fe72SAndrew Rybchenko #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD 4181289fe72SAndrew Rybchenko ef10_filter_table_t *ef_ef10_filter_table; 4191289fe72SAndrew Rybchenko #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ 420e948693eSPhilip Paeps } efx_filter_t; 421e948693eSPhilip Paeps 422e948693eSPhilip Paeps extern void 4231c159dbfSAndrew Rybchenko siena_filter_tbl_clear( 424e948693eSPhilip Paeps __in efx_nic_t *enp, 425f7aa4b3dSAndrew Rybchenko __in siena_filter_tbl_id_t tbl); 426e948693eSPhilip Paeps 427e948693eSPhilip Paeps #endif /* EFSYS_OPT_FILTER */ 428e948693eSPhilip Paeps 4293c838a9fSAndrew Rybchenko #if EFSYS_OPT_MCDI 4303c838a9fSAndrew Rybchenko 4313c838a9fSAndrew Rybchenko typedef struct efx_mcdi_ops_s { 432460cb568SAndrew Rybchenko efx_rc_t (*emco_init)(efx_nic_t *, const efx_mcdi_transport_t *); 433fd7501bfSAndrew Rybchenko void (*emco_send_request)(efx_nic_t *, void *, size_t, 434fd7501bfSAndrew Rybchenko void *, size_t); 435460cb568SAndrew Rybchenko efx_rc_t (*emco_poll_reboot)(efx_nic_t *); 436548ebee5SAndrew Rybchenko boolean_t (*emco_poll_response)(efx_nic_t *); 437548ebee5SAndrew Rybchenko void (*emco_read_response)(efx_nic_t *, void *, size_t, size_t); 4383c838a9fSAndrew Rybchenko void (*emco_fini)(efx_nic_t *); 4398a4fcbd4SAndrew Rybchenko efx_rc_t (*emco_feature_supported)(efx_nic_t *, 4408a4fcbd4SAndrew Rybchenko efx_mcdi_feature_id_t, boolean_t *); 4418a4fcbd4SAndrew Rybchenko void (*emco_get_timeout)(efx_nic_t *, efx_mcdi_req_t *, 4428a4fcbd4SAndrew Rybchenko uint32_t *); 4433c838a9fSAndrew Rybchenko } efx_mcdi_ops_t; 4443c838a9fSAndrew Rybchenko 4453c838a9fSAndrew Rybchenko typedef struct efx_mcdi_s { 446ec831f7fSAndrew Rybchenko const efx_mcdi_ops_t *em_emcop; 4473c838a9fSAndrew Rybchenko const efx_mcdi_transport_t *em_emtp; 4483c838a9fSAndrew Rybchenko efx_mcdi_iface_t em_emip; 4493c838a9fSAndrew Rybchenko } efx_mcdi_t; 4503c838a9fSAndrew Rybchenko 4513c838a9fSAndrew Rybchenko #endif /* EFSYS_OPT_MCDI */ 4523c838a9fSAndrew Rybchenko 453e948693eSPhilip Paeps #if EFSYS_OPT_NVRAM 454e948693eSPhilip Paeps typedef struct efx_nvram_ops_s { 455e948693eSPhilip Paeps #if EFSYS_OPT_DIAG 456460cb568SAndrew Rybchenko efx_rc_t (*envo_test)(efx_nic_t *); 457e948693eSPhilip Paeps #endif /* EFSYS_OPT_DIAG */ 458bce88e31SAndrew Rybchenko efx_rc_t (*envo_type_to_partn)(efx_nic_t *, efx_nvram_type_t, 459bce88e31SAndrew Rybchenko uint32_t *); 46056bd83b0SAndrew Rybchenko efx_rc_t (*envo_partn_size)(efx_nic_t *, uint32_t, size_t *); 4615d846e87SAndrew Rybchenko efx_rc_t (*envo_partn_rw_start)(efx_nic_t *, uint32_t, size_t *); 4620afdf29cSAndrew Rybchenko efx_rc_t (*envo_partn_read)(efx_nic_t *, uint32_t, 4630afdf29cSAndrew Rybchenko unsigned int, caddr_t, size_t); 464b60ff840SAndrew Rybchenko efx_rc_t (*envo_partn_erase)(efx_nic_t *, uint32_t, 465b60ff840SAndrew Rybchenko unsigned int, size_t); 466134c4c4aSAndrew Rybchenko efx_rc_t (*envo_partn_write)(efx_nic_t *, uint32_t, 467134c4c4aSAndrew Rybchenko unsigned int, caddr_t, size_t); 468e9c123a5SAndrew Rybchenko efx_rc_t (*envo_partn_rw_finish)(efx_nic_t *, uint32_t); 46992187119SAndrew Rybchenko efx_rc_t (*envo_partn_get_version)(efx_nic_t *, uint32_t, 47092187119SAndrew Rybchenko uint32_t *, uint16_t *); 4716d0b856cSAndrew Rybchenko efx_rc_t (*envo_partn_set_version)(efx_nic_t *, uint32_t, 4726d0b856cSAndrew Rybchenko uint16_t *); 4735abce2b9SAndrew Rybchenko efx_rc_t (*envo_buffer_validate)(efx_nic_t *, uint32_t, 4745abce2b9SAndrew Rybchenko caddr_t, size_t); 475e948693eSPhilip Paeps } efx_nvram_ops_t; 476e948693eSPhilip Paeps #endif /* EFSYS_OPT_NVRAM */ 477e948693eSPhilip Paeps 478e948693eSPhilip Paeps #if EFSYS_OPT_VPD 479e948693eSPhilip Paeps typedef struct efx_vpd_ops_s { 480460cb568SAndrew Rybchenko efx_rc_t (*evpdo_init)(efx_nic_t *); 481460cb568SAndrew Rybchenko efx_rc_t (*evpdo_size)(efx_nic_t *, size_t *); 482460cb568SAndrew Rybchenko efx_rc_t (*evpdo_read)(efx_nic_t *, caddr_t, size_t); 483460cb568SAndrew Rybchenko efx_rc_t (*evpdo_verify)(efx_nic_t *, caddr_t, size_t); 484460cb568SAndrew Rybchenko efx_rc_t (*evpdo_reinit)(efx_nic_t *, caddr_t, size_t); 485460cb568SAndrew Rybchenko efx_rc_t (*evpdo_get)(efx_nic_t *, caddr_t, size_t, 486460cb568SAndrew Rybchenko efx_vpd_value_t *); 487460cb568SAndrew Rybchenko efx_rc_t (*evpdo_set)(efx_nic_t *, caddr_t, size_t, 488460cb568SAndrew Rybchenko efx_vpd_value_t *); 489460cb568SAndrew Rybchenko efx_rc_t (*evpdo_next)(efx_nic_t *, caddr_t, size_t, 490460cb568SAndrew Rybchenko efx_vpd_value_t *, unsigned int *); 491460cb568SAndrew Rybchenko efx_rc_t (*evpdo_write)(efx_nic_t *, caddr_t, size_t); 492e948693eSPhilip Paeps void (*evpdo_fini)(efx_nic_t *); 493e948693eSPhilip Paeps } efx_vpd_ops_t; 494e948693eSPhilip Paeps #endif /* EFSYS_OPT_VPD */ 495e948693eSPhilip Paeps 4963c838a9fSAndrew Rybchenko #if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM 4973c838a9fSAndrew Rybchenko 498460cb568SAndrew Rybchenko __checkReturn efx_rc_t 4993c838a9fSAndrew Rybchenko efx_mcdi_nvram_partitions( 5003c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 5013c838a9fSAndrew Rybchenko __out_bcount(size) caddr_t data, 5023c838a9fSAndrew Rybchenko __in size_t size, 5033c838a9fSAndrew Rybchenko __out unsigned int *npartnp); 5043c838a9fSAndrew Rybchenko 505460cb568SAndrew Rybchenko __checkReturn efx_rc_t 5063c838a9fSAndrew Rybchenko efx_mcdi_nvram_metadata( 5073c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 5083c838a9fSAndrew Rybchenko __in uint32_t partn, 5093c838a9fSAndrew Rybchenko __out uint32_t *subtypep, 5103c838a9fSAndrew Rybchenko __out_ecount(4) uint16_t version[4], 5113c838a9fSAndrew Rybchenko __out_bcount_opt(size) char *descp, 5123c838a9fSAndrew Rybchenko __in size_t size); 5133c838a9fSAndrew Rybchenko 514460cb568SAndrew Rybchenko __checkReturn efx_rc_t 5153c838a9fSAndrew Rybchenko efx_mcdi_nvram_info( 5163c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 5173c838a9fSAndrew Rybchenko __in uint32_t partn, 5183c838a9fSAndrew Rybchenko __out_opt size_t *sizep, 5193c838a9fSAndrew Rybchenko __out_opt uint32_t *addressp, 5209cb71b16SAndrew Rybchenko __out_opt uint32_t *erase_sizep, 5219cb71b16SAndrew Rybchenko __out_opt uint32_t *write_sizep); 5223c838a9fSAndrew Rybchenko 523460cb568SAndrew Rybchenko __checkReturn efx_rc_t 5243c838a9fSAndrew Rybchenko efx_mcdi_nvram_update_start( 5253c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 5263c838a9fSAndrew Rybchenko __in uint32_t partn); 5273c838a9fSAndrew Rybchenko 528460cb568SAndrew Rybchenko __checkReturn efx_rc_t 5293c838a9fSAndrew Rybchenko efx_mcdi_nvram_read( 5303c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 5313c838a9fSAndrew Rybchenko __in uint32_t partn, 5323c838a9fSAndrew Rybchenko __in uint32_t offset, 5333c838a9fSAndrew Rybchenko __out_bcount(size) caddr_t data, 5349ad7e03fSAndrew Rybchenko __in size_t size, 5359ad7e03fSAndrew Rybchenko __in uint32_t mode); 5363c838a9fSAndrew Rybchenko 537460cb568SAndrew Rybchenko __checkReturn efx_rc_t 5383c838a9fSAndrew Rybchenko efx_mcdi_nvram_erase( 5393c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 5403c838a9fSAndrew Rybchenko __in uint32_t partn, 5413c838a9fSAndrew Rybchenko __in uint32_t offset, 5423c838a9fSAndrew Rybchenko __in size_t size); 5433c838a9fSAndrew Rybchenko 544460cb568SAndrew Rybchenko __checkReturn efx_rc_t 5453c838a9fSAndrew Rybchenko efx_mcdi_nvram_write( 5463c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 5473c838a9fSAndrew Rybchenko __in uint32_t partn, 5483c838a9fSAndrew Rybchenko __in uint32_t offset, 5493c838a9fSAndrew Rybchenko __out_bcount(size) caddr_t data, 5503c838a9fSAndrew Rybchenko __in size_t size); 5513c838a9fSAndrew Rybchenko 552460cb568SAndrew Rybchenko __checkReturn efx_rc_t 5533c838a9fSAndrew Rybchenko efx_mcdi_nvram_update_finish( 5543c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 5553c838a9fSAndrew Rybchenko __in uint32_t partn, 556e9c123a5SAndrew Rybchenko __in boolean_t reboot, 557e9c123a5SAndrew Rybchenko __out_opt uint32_t *resultp); 5583c838a9fSAndrew Rybchenko 5593c838a9fSAndrew Rybchenko #if EFSYS_OPT_DIAG 5603c838a9fSAndrew Rybchenko 561460cb568SAndrew Rybchenko __checkReturn efx_rc_t 5623c838a9fSAndrew Rybchenko efx_mcdi_nvram_test( 5633c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 5643c838a9fSAndrew Rybchenko __in uint32_t partn); 5653c838a9fSAndrew Rybchenko 5663c838a9fSAndrew Rybchenko #endif /* EFSYS_OPT_DIAG */ 5673c838a9fSAndrew Rybchenko 5683c838a9fSAndrew Rybchenko #endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */ 5693c838a9fSAndrew Rybchenko 5700c848230SAndrew Rybchenko #if EFSYS_OPT_LICENSING 5710c848230SAndrew Rybchenko 5720c848230SAndrew Rybchenko typedef struct efx_lic_ops_s { 5730c848230SAndrew Rybchenko efx_rc_t (*elo_update_licenses)(efx_nic_t *); 5740c848230SAndrew Rybchenko efx_rc_t (*elo_get_key_stats)(efx_nic_t *, efx_key_stats_t *); 5750c848230SAndrew Rybchenko efx_rc_t (*elo_app_state)(efx_nic_t *, uint64_t, boolean_t *); 5760c848230SAndrew Rybchenko efx_rc_t (*elo_get_id)(efx_nic_t *, size_t, uint32_t *, 5770c848230SAndrew Rybchenko size_t *, uint8_t *); 578fc3a62cfSAndrew Rybchenko efx_rc_t (*elo_find_start) 579fc3a62cfSAndrew Rybchenko (efx_nic_t *, caddr_t, size_t, uint32_t *); 580fc3a62cfSAndrew Rybchenko efx_rc_t (*elo_find_end)(efx_nic_t *, caddr_t, size_t, 581fc3a62cfSAndrew Rybchenko uint32_t, uint32_t *); 582fc3a62cfSAndrew Rybchenko boolean_t (*elo_find_key)(efx_nic_t *, caddr_t, size_t, 583fc3a62cfSAndrew Rybchenko uint32_t, uint32_t *, uint32_t *); 584fc3a62cfSAndrew Rybchenko boolean_t (*elo_validate_key)(efx_nic_t *, 585fc3a62cfSAndrew Rybchenko caddr_t, uint32_t); 586fc3a62cfSAndrew Rybchenko efx_rc_t (*elo_read_key)(efx_nic_t *, 587fc3a62cfSAndrew Rybchenko caddr_t, size_t, uint32_t, uint32_t, 588fc3a62cfSAndrew Rybchenko caddr_t, size_t, uint32_t *); 589fc3a62cfSAndrew Rybchenko efx_rc_t (*elo_write_key)(efx_nic_t *, 590fc3a62cfSAndrew Rybchenko caddr_t, size_t, uint32_t, 591fc3a62cfSAndrew Rybchenko caddr_t, uint32_t, uint32_t *); 592fc3a62cfSAndrew Rybchenko efx_rc_t (*elo_delete_key)(efx_nic_t *, 593fc3a62cfSAndrew Rybchenko caddr_t, size_t, uint32_t, 594fc3a62cfSAndrew Rybchenko uint32_t, uint32_t, uint32_t *); 595fc3a62cfSAndrew Rybchenko efx_rc_t (*elo_create_partition)(efx_nic_t *, 596fc3a62cfSAndrew Rybchenko caddr_t, size_t); 597fc3a62cfSAndrew Rybchenko efx_rc_t (*elo_finish_partition)(efx_nic_t *, 598fc3a62cfSAndrew Rybchenko caddr_t, size_t); 5990c848230SAndrew Rybchenko } efx_lic_ops_t; 6000c848230SAndrew Rybchenko 6010c848230SAndrew Rybchenko #endif 6020c848230SAndrew Rybchenko 6033c838a9fSAndrew Rybchenko typedef struct efx_drv_cfg_s { 6043c838a9fSAndrew Rybchenko uint32_t edc_min_vi_count; 6053c838a9fSAndrew Rybchenko uint32_t edc_max_vi_count; 6063c838a9fSAndrew Rybchenko 6073c838a9fSAndrew Rybchenko uint32_t edc_max_piobuf_count; 6083c838a9fSAndrew Rybchenko uint32_t edc_pio_alloc_size; 6093c838a9fSAndrew Rybchenko } efx_drv_cfg_t; 6103c838a9fSAndrew Rybchenko 611e948693eSPhilip Paeps struct efx_nic_s { 612e948693eSPhilip Paeps uint32_t en_magic; 613e948693eSPhilip Paeps efx_family_t en_family; 614e948693eSPhilip Paeps uint32_t en_features; 615e948693eSPhilip Paeps efsys_identifier_t *en_esip; 616e948693eSPhilip Paeps efsys_lock_t *en_eslp; 617e948693eSPhilip Paeps efsys_bar_t *en_esbp; 618e948693eSPhilip Paeps unsigned int en_mod_flags; 619e948693eSPhilip Paeps unsigned int en_reset_flags; 620e948693eSPhilip Paeps efx_nic_cfg_t en_nic_cfg; 6213c838a9fSAndrew Rybchenko efx_drv_cfg_t en_drv_cfg; 622e948693eSPhilip Paeps efx_port_t en_port; 623e948693eSPhilip Paeps efx_mon_t en_mon; 624e948693eSPhilip Paeps efx_intr_t en_intr; 625e948693eSPhilip Paeps uint32_t en_ev_qcount; 626e948693eSPhilip Paeps uint32_t en_rx_qcount; 627e948693eSPhilip Paeps uint32_t en_tx_qcount; 628ec831f7fSAndrew Rybchenko const efx_nic_ops_t *en_enop; 629ec831f7fSAndrew Rybchenko const efx_ev_ops_t *en_eevop; 630ec831f7fSAndrew Rybchenko const efx_tx_ops_t *en_etxop; 631ec831f7fSAndrew Rybchenko const efx_rx_ops_t *en_erxop; 632e948693eSPhilip Paeps #if EFSYS_OPT_FILTER 633e948693eSPhilip Paeps efx_filter_t en_filter; 634ec831f7fSAndrew Rybchenko const efx_filter_ops_t *en_efop; 635e948693eSPhilip Paeps #endif /* EFSYS_OPT_FILTER */ 6363c838a9fSAndrew Rybchenko #if EFSYS_OPT_MCDI 6373c838a9fSAndrew Rybchenko efx_mcdi_t en_mcdi; 6383c838a9fSAndrew Rybchenko #endif /* EFSYS_OPT_MCDI */ 639e948693eSPhilip Paeps #if EFSYS_OPT_NVRAM 640e948693eSPhilip Paeps efx_nvram_type_t en_nvram_locked; 641ec831f7fSAndrew Rybchenko const efx_nvram_ops_t *en_envop; 642e948693eSPhilip Paeps #endif /* EFSYS_OPT_NVRAM */ 643e948693eSPhilip Paeps #if EFSYS_OPT_VPD 644ec831f7fSAndrew Rybchenko const efx_vpd_ops_t *en_evpdop; 645e948693eSPhilip Paeps #endif /* EFSYS_OPT_VPD */ 6463c838a9fSAndrew Rybchenko #if EFSYS_OPT_RX_SCALE 6473c838a9fSAndrew Rybchenko efx_rx_hash_support_t en_hash_support; 648*39023729SAndrew Rybchenko efx_rx_scale_context_type_t en_rss_context_type; 6493c838a9fSAndrew Rybchenko uint32_t en_rss_context; 6503c838a9fSAndrew Rybchenko #endif /* EFSYS_OPT_RX_SCALE */ 6513c838a9fSAndrew Rybchenko uint32_t en_vport_id; 6520c848230SAndrew Rybchenko #if EFSYS_OPT_LICENSING 653ec831f7fSAndrew Rybchenko const efx_lic_ops_t *en_elop; 6545df3232cSAndrew Rybchenko boolean_t en_licensing_supported; 6550c848230SAndrew Rybchenko #endif 656e948693eSPhilip Paeps union { 657e948693eSPhilip Paeps #if EFSYS_OPT_SIENA 658e948693eSPhilip Paeps struct { 659e948693eSPhilip Paeps #if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD 660e948693eSPhilip Paeps unsigned int enu_partn_mask; 661e948693eSPhilip Paeps #endif /* EFSYS_OPT_NVRAM || EFSYS_OPT_VPD */ 662e948693eSPhilip Paeps #if EFSYS_OPT_VPD 663e948693eSPhilip Paeps caddr_t enu_svpd; 664e948693eSPhilip Paeps size_t enu_svpd_length; 665e948693eSPhilip Paeps #endif /* EFSYS_OPT_VPD */ 6663c838a9fSAndrew Rybchenko int enu_unused; 667e948693eSPhilip Paeps } siena; 668e948693eSPhilip Paeps #endif /* EFSYS_OPT_SIENA */ 669e7119ad9SAndrew Rybchenko int enu_unused; 670e948693eSPhilip Paeps } en_u; 671e7119ad9SAndrew Rybchenko #if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) 672e7119ad9SAndrew Rybchenko union en_arch { 673e7119ad9SAndrew Rybchenko struct { 674e7119ad9SAndrew Rybchenko int ena_vi_base; 675e7119ad9SAndrew Rybchenko int ena_vi_count; 676426f453bSAndrew Rybchenko int ena_vi_shift; 677e7119ad9SAndrew Rybchenko #if EFSYS_OPT_VPD 678e7119ad9SAndrew Rybchenko caddr_t ena_svpd; 679e7119ad9SAndrew Rybchenko size_t ena_svpd_length; 680e7119ad9SAndrew Rybchenko #endif /* EFSYS_OPT_VPD */ 681e7119ad9SAndrew Rybchenko efx_piobuf_handle_t ena_piobuf_handle[EF10_MAX_PIOBUF_NBUFS]; 682e7119ad9SAndrew Rybchenko uint32_t ena_piobuf_count; 683e7119ad9SAndrew Rybchenko uint32_t ena_pio_alloc_map[EF10_MAX_PIOBUF_NBUFS]; 684e7119ad9SAndrew Rybchenko uint32_t ena_pio_write_vi_base; 685e7119ad9SAndrew Rybchenko /* Memory BAR mapping regions */ 686e7119ad9SAndrew Rybchenko uint32_t ena_uc_mem_map_offset; 687e7119ad9SAndrew Rybchenko size_t ena_uc_mem_map_size; 688e7119ad9SAndrew Rybchenko uint32_t ena_wc_mem_map_offset; 689e7119ad9SAndrew Rybchenko size_t ena_wc_mem_map_size; 690e7119ad9SAndrew Rybchenko } ef10; 691e7119ad9SAndrew Rybchenko } en_arch; 692e7119ad9SAndrew Rybchenko #endif /* (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */ 693e948693eSPhilip Paeps }; 694e948693eSPhilip Paeps 695e948693eSPhilip Paeps 696e948693eSPhilip Paeps #define EFX_NIC_MAGIC 0x02121996 697e948693eSPhilip Paeps 698e948693eSPhilip Paeps typedef boolean_t (*efx_ev_handler_t)(efx_evq_t *, efx_qword_t *, 699e948693eSPhilip Paeps const efx_ev_callbacks_t *, void *); 700e948693eSPhilip Paeps 7013c838a9fSAndrew Rybchenko typedef struct efx_evq_rxq_state_s { 7023c838a9fSAndrew Rybchenko unsigned int eers_rx_read_ptr; 7033c838a9fSAndrew Rybchenko unsigned int eers_rx_mask; 7048e0c4827SAndrew Rybchenko #if EFSYS_OPT_RX_PACKED_STREAM 7058e0c4827SAndrew Rybchenko unsigned int eers_rx_stream_npackets; 7068e0c4827SAndrew Rybchenko boolean_t eers_rx_packed_stream; 7078e0c4827SAndrew Rybchenko unsigned int eers_rx_packed_stream_credits; 7088e0c4827SAndrew Rybchenko #endif 7093c838a9fSAndrew Rybchenko } efx_evq_rxq_state_t; 7103c838a9fSAndrew Rybchenko 711e948693eSPhilip Paeps struct efx_evq_s { 712e948693eSPhilip Paeps uint32_t ee_magic; 713e948693eSPhilip Paeps efx_nic_t *ee_enp; 714e948693eSPhilip Paeps unsigned int ee_index; 715e948693eSPhilip Paeps unsigned int ee_mask; 716e948693eSPhilip Paeps efsys_mem_t *ee_esmp; 717e948693eSPhilip Paeps #if EFSYS_OPT_QSTATS 718e948693eSPhilip Paeps uint32_t ee_stat[EV_NQSTATS]; 719e948693eSPhilip Paeps #endif /* EFSYS_OPT_QSTATS */ 7203c838a9fSAndrew Rybchenko 7213c838a9fSAndrew Rybchenko efx_ev_handler_t ee_rx; 7223c838a9fSAndrew Rybchenko efx_ev_handler_t ee_tx; 7233c838a9fSAndrew Rybchenko efx_ev_handler_t ee_driver; 7243c838a9fSAndrew Rybchenko efx_ev_handler_t ee_global; 7253c838a9fSAndrew Rybchenko efx_ev_handler_t ee_drv_gen; 7263c838a9fSAndrew Rybchenko #if EFSYS_OPT_MCDI 7273c838a9fSAndrew Rybchenko efx_ev_handler_t ee_mcdi; 7283c838a9fSAndrew Rybchenko #endif /* EFSYS_OPT_MCDI */ 7293c838a9fSAndrew Rybchenko 7303c838a9fSAndrew Rybchenko efx_evq_rxq_state_t ee_rxq_state[EFX_EV_RX_NLABELS]; 73182d2a148SAndrew Rybchenko 73282d2a148SAndrew Rybchenko uint32_t ee_flags; 733e948693eSPhilip Paeps }; 734e948693eSPhilip Paeps 735e948693eSPhilip Paeps #define EFX_EVQ_MAGIC 0x08081997 736e948693eSPhilip Paeps 737af9078c3SAndrew Rybchenko #define EFX_EVQ_SIENA_TIMER_QUANTUM_NS 6144 /* 768 cycles */ 738e948693eSPhilip Paeps 739e948693eSPhilip Paeps struct efx_rxq_s { 740e948693eSPhilip Paeps uint32_t er_magic; 741e948693eSPhilip Paeps efx_nic_t *er_enp; 7423c838a9fSAndrew Rybchenko efx_evq_t *er_eep; 743e948693eSPhilip Paeps unsigned int er_index; 7443c838a9fSAndrew Rybchenko unsigned int er_label; 745e948693eSPhilip Paeps unsigned int er_mask; 746e948693eSPhilip Paeps efsys_mem_t *er_esmp; 747e948693eSPhilip Paeps }; 748e948693eSPhilip Paeps 749e948693eSPhilip Paeps #define EFX_RXQ_MAGIC 0x15022005 750e948693eSPhilip Paeps 751e948693eSPhilip Paeps struct efx_txq_s { 752e948693eSPhilip Paeps uint32_t et_magic; 753e948693eSPhilip Paeps efx_nic_t *et_enp; 754e948693eSPhilip Paeps unsigned int et_index; 755e948693eSPhilip Paeps unsigned int et_mask; 756e948693eSPhilip Paeps efsys_mem_t *et_esmp; 7573c838a9fSAndrew Rybchenko #if EFSYS_OPT_HUNTINGTON 7583c838a9fSAndrew Rybchenko uint32_t et_pio_bufnum; 7593c838a9fSAndrew Rybchenko uint32_t et_pio_blknum; 7603c838a9fSAndrew Rybchenko uint32_t et_pio_write_offset; 7613c838a9fSAndrew Rybchenko uint32_t et_pio_offset; 7623c838a9fSAndrew Rybchenko size_t et_pio_size; 7633c838a9fSAndrew Rybchenko #endif 764e948693eSPhilip Paeps #if EFSYS_OPT_QSTATS 765e948693eSPhilip Paeps uint32_t et_stat[TX_NQSTATS]; 766e948693eSPhilip Paeps #endif /* EFSYS_OPT_QSTATS */ 767e948693eSPhilip Paeps }; 768e948693eSPhilip Paeps 769e948693eSPhilip Paeps #define EFX_TXQ_MAGIC 0x05092005 770e948693eSPhilip Paeps 771e948693eSPhilip Paeps #define EFX_MAC_ADDR_COPY(_dst, _src) \ 772e948693eSPhilip Paeps do { \ 773e948693eSPhilip Paeps (_dst)[0] = (_src)[0]; \ 774e948693eSPhilip Paeps (_dst)[1] = (_src)[1]; \ 775e948693eSPhilip Paeps (_dst)[2] = (_src)[2]; \ 776e948693eSPhilip Paeps (_dst)[3] = (_src)[3]; \ 777e948693eSPhilip Paeps (_dst)[4] = (_src)[4]; \ 778e948693eSPhilip Paeps (_dst)[5] = (_src)[5]; \ 779e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 780e948693eSPhilip Paeps } while (B_FALSE) 781e948693eSPhilip Paeps 7823c838a9fSAndrew Rybchenko #define EFX_MAC_BROADCAST_ADDR_SET(_dst) \ 7833c838a9fSAndrew Rybchenko do { \ 7843c838a9fSAndrew Rybchenko uint16_t *_d = (uint16_t *)(_dst); \ 7853c838a9fSAndrew Rybchenko _d[0] = 0xffff; \ 7863c838a9fSAndrew Rybchenko _d[1] = 0xffff; \ 7873c838a9fSAndrew Rybchenko _d[2] = 0xffff; \ 7883c838a9fSAndrew Rybchenko _NOTE(CONSTANTCONDITION) \ 7893c838a9fSAndrew Rybchenko } while (B_FALSE) 7903c838a9fSAndrew Rybchenko 791e948693eSPhilip Paeps #if EFSYS_OPT_CHECK_REG 792e948693eSPhilip Paeps #define EFX_CHECK_REG(_enp, _reg) \ 793e948693eSPhilip Paeps do { \ 7943c838a9fSAndrew Rybchenko const char *name = #_reg; \ 795e948693eSPhilip Paeps char min = name[4]; \ 796e948693eSPhilip Paeps char max = name[5]; \ 797e948693eSPhilip Paeps char rev; \ 798e948693eSPhilip Paeps \ 799e948693eSPhilip Paeps switch ((_enp)->en_family) { \ 800e948693eSPhilip Paeps case EFX_FAMILY_SIENA: \ 801e948693eSPhilip Paeps rev = 'C'; \ 802e948693eSPhilip Paeps break; \ 803e948693eSPhilip Paeps \ 8043c838a9fSAndrew Rybchenko case EFX_FAMILY_HUNTINGTON: \ 8053c838a9fSAndrew Rybchenko rev = 'D'; \ 8063c838a9fSAndrew Rybchenko break; \ 8073c838a9fSAndrew Rybchenko \ 80834f6ea29SAndrew Rybchenko case EFX_FAMILY_MEDFORD: \ 80934f6ea29SAndrew Rybchenko rev = 'E'; \ 81034f6ea29SAndrew Rybchenko break; \ 81134f6ea29SAndrew Rybchenko \ 812e948693eSPhilip Paeps default: \ 813e948693eSPhilip Paeps rev = '?'; \ 814e948693eSPhilip Paeps break; \ 815e948693eSPhilip Paeps } \ 816e948693eSPhilip Paeps \ 817e948693eSPhilip Paeps EFSYS_ASSERT3S(rev, >=, min); \ 818e948693eSPhilip Paeps EFSYS_ASSERT3S(rev, <=, max); \ 819e948693eSPhilip Paeps \ 820e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 821e948693eSPhilip Paeps } while (B_FALSE) 822e948693eSPhilip Paeps #else 823e948693eSPhilip Paeps #define EFX_CHECK_REG(_enp, _reg) do { \ 824e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 825e948693eSPhilip Paeps } while (B_FALSE) 826e948693eSPhilip Paeps #endif 827e948693eSPhilip Paeps 828e948693eSPhilip Paeps #define EFX_BAR_READD(_enp, _reg, _edp, _lock) \ 829e948693eSPhilip Paeps do { \ 830e948693eSPhilip Paeps EFX_CHECK_REG((_enp), (_reg)); \ 831e948693eSPhilip Paeps EFSYS_BAR_READD((_enp)->en_esbp, _reg ## _OFST, \ 832e948693eSPhilip Paeps (_edp), (_lock)); \ 833e948693eSPhilip Paeps EFSYS_PROBE3(efx_bar_readd, const char *, #_reg, \ 834e948693eSPhilip Paeps uint32_t, _reg ## _OFST, \ 835e948693eSPhilip Paeps uint32_t, (_edp)->ed_u32[0]); \ 836e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 837e948693eSPhilip Paeps } while (B_FALSE) 838e948693eSPhilip Paeps 839e948693eSPhilip Paeps #define EFX_BAR_WRITED(_enp, _reg, _edp, _lock) \ 840e948693eSPhilip Paeps do { \ 841e948693eSPhilip Paeps EFX_CHECK_REG((_enp), (_reg)); \ 842e948693eSPhilip Paeps EFSYS_PROBE3(efx_bar_writed, const char *, #_reg, \ 843e948693eSPhilip Paeps uint32_t, _reg ## _OFST, \ 844e948693eSPhilip Paeps uint32_t, (_edp)->ed_u32[0]); \ 845e948693eSPhilip Paeps EFSYS_BAR_WRITED((_enp)->en_esbp, _reg ## _OFST, \ 846e948693eSPhilip Paeps (_edp), (_lock)); \ 847e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 848e948693eSPhilip Paeps } while (B_FALSE) 849e948693eSPhilip Paeps 850e948693eSPhilip Paeps #define EFX_BAR_READQ(_enp, _reg, _eqp) \ 851e948693eSPhilip Paeps do { \ 852e948693eSPhilip Paeps EFX_CHECK_REG((_enp), (_reg)); \ 853e948693eSPhilip Paeps EFSYS_BAR_READQ((_enp)->en_esbp, _reg ## _OFST, \ 854e948693eSPhilip Paeps (_eqp)); \ 855e948693eSPhilip Paeps EFSYS_PROBE4(efx_bar_readq, const char *, #_reg, \ 856e948693eSPhilip Paeps uint32_t, _reg ## _OFST, \ 857e948693eSPhilip Paeps uint32_t, (_eqp)->eq_u32[1], \ 858e948693eSPhilip Paeps uint32_t, (_eqp)->eq_u32[0]); \ 859e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 860e948693eSPhilip Paeps } while (B_FALSE) 861e948693eSPhilip Paeps 862e948693eSPhilip Paeps #define EFX_BAR_WRITEQ(_enp, _reg, _eqp) \ 863e948693eSPhilip Paeps do { \ 864e948693eSPhilip Paeps EFX_CHECK_REG((_enp), (_reg)); \ 865e948693eSPhilip Paeps EFSYS_PROBE4(efx_bar_writeq, const char *, #_reg, \ 866e948693eSPhilip Paeps uint32_t, _reg ## _OFST, \ 867e948693eSPhilip Paeps uint32_t, (_eqp)->eq_u32[1], \ 868e948693eSPhilip Paeps uint32_t, (_eqp)->eq_u32[0]); \ 869e948693eSPhilip Paeps EFSYS_BAR_WRITEQ((_enp)->en_esbp, _reg ## _OFST, \ 870e948693eSPhilip Paeps (_eqp)); \ 871e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 872e948693eSPhilip Paeps } while (B_FALSE) 873e948693eSPhilip Paeps 874e948693eSPhilip Paeps #define EFX_BAR_READO(_enp, _reg, _eop) \ 875e948693eSPhilip Paeps do { \ 876e948693eSPhilip Paeps EFX_CHECK_REG((_enp), (_reg)); \ 877e948693eSPhilip Paeps EFSYS_BAR_READO((_enp)->en_esbp, _reg ## _OFST, \ 878e948693eSPhilip Paeps (_eop), B_TRUE); \ 879e948693eSPhilip Paeps EFSYS_PROBE6(efx_bar_reado, const char *, #_reg, \ 880e948693eSPhilip Paeps uint32_t, _reg ## _OFST, \ 881e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[3], \ 882e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[2], \ 883e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[1], \ 884e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[0]); \ 885e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 886e948693eSPhilip Paeps } while (B_FALSE) 887e948693eSPhilip Paeps 888e948693eSPhilip Paeps #define EFX_BAR_WRITEO(_enp, _reg, _eop) \ 889e948693eSPhilip Paeps do { \ 890e948693eSPhilip Paeps EFX_CHECK_REG((_enp), (_reg)); \ 891e948693eSPhilip Paeps EFSYS_PROBE6(efx_bar_writeo, const char *, #_reg, \ 892e948693eSPhilip Paeps uint32_t, _reg ## _OFST, \ 893e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[3], \ 894e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[2], \ 895e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[1], \ 896e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[0]); \ 897e948693eSPhilip Paeps EFSYS_BAR_WRITEO((_enp)->en_esbp, _reg ## _OFST, \ 898e948693eSPhilip Paeps (_eop), B_TRUE); \ 899e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 900e948693eSPhilip Paeps } while (B_FALSE) 901e948693eSPhilip Paeps 902e948693eSPhilip Paeps #define EFX_BAR_TBL_READD(_enp, _reg, _index, _edp, _lock) \ 903e948693eSPhilip Paeps do { \ 904e948693eSPhilip Paeps EFX_CHECK_REG((_enp), (_reg)); \ 905e948693eSPhilip Paeps EFSYS_BAR_READD((_enp)->en_esbp, \ 906e948693eSPhilip Paeps (_reg ## _OFST + ((_index) * _reg ## _STEP)), \ 907e948693eSPhilip Paeps (_edp), (_lock)); \ 908e948693eSPhilip Paeps EFSYS_PROBE4(efx_bar_tbl_readd, const char *, #_reg, \ 909e948693eSPhilip Paeps uint32_t, (_index), \ 910e948693eSPhilip Paeps uint32_t, _reg ## _OFST, \ 911e948693eSPhilip Paeps uint32_t, (_edp)->ed_u32[0]); \ 912e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 913e948693eSPhilip Paeps } while (B_FALSE) 914e948693eSPhilip Paeps 915e948693eSPhilip Paeps #define EFX_BAR_TBL_WRITED(_enp, _reg, _index, _edp, _lock) \ 916e948693eSPhilip Paeps do { \ 917e948693eSPhilip Paeps EFX_CHECK_REG((_enp), (_reg)); \ 918e948693eSPhilip Paeps EFSYS_PROBE4(efx_bar_tbl_writed, const char *, #_reg, \ 919e948693eSPhilip Paeps uint32_t, (_index), \ 920e948693eSPhilip Paeps uint32_t, _reg ## _OFST, \ 921e948693eSPhilip Paeps uint32_t, (_edp)->ed_u32[0]); \ 922e948693eSPhilip Paeps EFSYS_BAR_WRITED((_enp)->en_esbp, \ 923e948693eSPhilip Paeps (_reg ## _OFST + ((_index) * _reg ## _STEP)), \ 924e948693eSPhilip Paeps (_edp), (_lock)); \ 925e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 926e948693eSPhilip Paeps } while (B_FALSE) 927e948693eSPhilip Paeps 9283c838a9fSAndrew Rybchenko #define EFX_BAR_TBL_WRITED2(_enp, _reg, _index, _edp, _lock) \ 9293c838a9fSAndrew Rybchenko do { \ 9303c838a9fSAndrew Rybchenko EFX_CHECK_REG((_enp), (_reg)); \ 9313c838a9fSAndrew Rybchenko EFSYS_PROBE4(efx_bar_tbl_writed, const char *, #_reg, \ 9323c838a9fSAndrew Rybchenko uint32_t, (_index), \ 9333c838a9fSAndrew Rybchenko uint32_t, _reg ## _OFST, \ 9343c838a9fSAndrew Rybchenko uint32_t, (_edp)->ed_u32[0]); \ 9353c838a9fSAndrew Rybchenko EFSYS_BAR_WRITED((_enp)->en_esbp, \ 9363c838a9fSAndrew Rybchenko (_reg ## _OFST + \ 9373c838a9fSAndrew Rybchenko (2 * sizeof (efx_dword_t)) + \ 9383c838a9fSAndrew Rybchenko ((_index) * _reg ## _STEP)), \ 9393c838a9fSAndrew Rybchenko (_edp), (_lock)); \ 9403c838a9fSAndrew Rybchenko _NOTE(CONSTANTCONDITION) \ 9413c838a9fSAndrew Rybchenko } while (B_FALSE) 9423c838a9fSAndrew Rybchenko 943e948693eSPhilip Paeps #define EFX_BAR_TBL_WRITED3(_enp, _reg, _index, _edp, _lock) \ 944e948693eSPhilip Paeps do { \ 945e948693eSPhilip Paeps EFX_CHECK_REG((_enp), (_reg)); \ 946e948693eSPhilip Paeps EFSYS_PROBE4(efx_bar_tbl_writed, const char *, #_reg, \ 947e948693eSPhilip Paeps uint32_t, (_index), \ 948e948693eSPhilip Paeps uint32_t, _reg ## _OFST, \ 949e948693eSPhilip Paeps uint32_t, (_edp)->ed_u32[0]); \ 950e948693eSPhilip Paeps EFSYS_BAR_WRITED((_enp)->en_esbp, \ 951e948693eSPhilip Paeps (_reg ## _OFST + \ 952e948693eSPhilip Paeps (3 * sizeof (efx_dword_t)) + \ 953e948693eSPhilip Paeps ((_index) * _reg ## _STEP)), \ 954e948693eSPhilip Paeps (_edp), (_lock)); \ 955e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 956e948693eSPhilip Paeps } while (B_FALSE) 957e948693eSPhilip Paeps 958e948693eSPhilip Paeps #define EFX_BAR_TBL_READQ(_enp, _reg, _index, _eqp) \ 959e948693eSPhilip Paeps do { \ 960e948693eSPhilip Paeps EFX_CHECK_REG((_enp), (_reg)); \ 961e948693eSPhilip Paeps EFSYS_BAR_READQ((_enp)->en_esbp, \ 962e948693eSPhilip Paeps (_reg ## _OFST + ((_index) * _reg ## _STEP)), \ 963e948693eSPhilip Paeps (_eqp)); \ 964e948693eSPhilip Paeps EFSYS_PROBE5(efx_bar_tbl_readq, const char *, #_reg, \ 965e948693eSPhilip Paeps uint32_t, (_index), \ 966e948693eSPhilip Paeps uint32_t, _reg ## _OFST, \ 967e948693eSPhilip Paeps uint32_t, (_eqp)->eq_u32[1], \ 968e948693eSPhilip Paeps uint32_t, (_eqp)->eq_u32[0]); \ 969e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 970e948693eSPhilip Paeps } while (B_FALSE) 971e948693eSPhilip Paeps 972e948693eSPhilip Paeps #define EFX_BAR_TBL_WRITEQ(_enp, _reg, _index, _eqp) \ 973e948693eSPhilip Paeps do { \ 974e948693eSPhilip Paeps EFX_CHECK_REG((_enp), (_reg)); \ 975e948693eSPhilip Paeps EFSYS_PROBE5(efx_bar_tbl_writeq, const char *, #_reg, \ 976e948693eSPhilip Paeps uint32_t, (_index), \ 977e948693eSPhilip Paeps uint32_t, _reg ## _OFST, \ 978e948693eSPhilip Paeps uint32_t, (_eqp)->eq_u32[1], \ 979e948693eSPhilip Paeps uint32_t, (_eqp)->eq_u32[0]); \ 980e948693eSPhilip Paeps EFSYS_BAR_WRITEQ((_enp)->en_esbp, \ 981e948693eSPhilip Paeps (_reg ## _OFST + ((_index) * _reg ## _STEP)), \ 982e948693eSPhilip Paeps (_eqp)); \ 983e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 984e948693eSPhilip Paeps } while (B_FALSE) 985e948693eSPhilip Paeps 9863c838a9fSAndrew Rybchenko #define EFX_BAR_TBL_READO(_enp, _reg, _index, _eop, _lock) \ 987e948693eSPhilip Paeps do { \ 988e948693eSPhilip Paeps EFX_CHECK_REG((_enp), (_reg)); \ 989e948693eSPhilip Paeps EFSYS_BAR_READO((_enp)->en_esbp, \ 990e948693eSPhilip Paeps (_reg ## _OFST + ((_index) * _reg ## _STEP)), \ 9913c838a9fSAndrew Rybchenko (_eop), (_lock)); \ 992e948693eSPhilip Paeps EFSYS_PROBE7(efx_bar_tbl_reado, const char *, #_reg, \ 993e948693eSPhilip Paeps uint32_t, (_index), \ 994e948693eSPhilip Paeps uint32_t, _reg ## _OFST, \ 995e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[3], \ 996e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[2], \ 997e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[1], \ 998e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[0]); \ 999e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 1000e948693eSPhilip Paeps } while (B_FALSE) 1001e948693eSPhilip Paeps 10023c838a9fSAndrew Rybchenko #define EFX_BAR_TBL_WRITEO(_enp, _reg, _index, _eop, _lock) \ 1003e948693eSPhilip Paeps do { \ 1004e948693eSPhilip Paeps EFX_CHECK_REG((_enp), (_reg)); \ 1005e948693eSPhilip Paeps EFSYS_PROBE7(efx_bar_tbl_writeo, const char *, #_reg, \ 1006e948693eSPhilip Paeps uint32_t, (_index), \ 1007e948693eSPhilip Paeps uint32_t, _reg ## _OFST, \ 1008e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[3], \ 1009e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[2], \ 1010e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[1], \ 1011e948693eSPhilip Paeps uint32_t, (_eop)->eo_u32[0]); \ 1012e948693eSPhilip Paeps EFSYS_BAR_WRITEO((_enp)->en_esbp, \ 1013e948693eSPhilip Paeps (_reg ## _OFST + ((_index) * _reg ## _STEP)), \ 10143c838a9fSAndrew Rybchenko (_eop), (_lock)); \ 10153c838a9fSAndrew Rybchenko _NOTE(CONSTANTCONDITION) \ 10163c838a9fSAndrew Rybchenko } while (B_FALSE) 10173c838a9fSAndrew Rybchenko 10183c838a9fSAndrew Rybchenko /* 10193c838a9fSAndrew Rybchenko * Allow drivers to perform optimised 128-bit doorbell writes. 10203c838a9fSAndrew Rybchenko * The DMA descriptor pointers (RX_DESC_UPD and TX_DESC_UPD) are 10213c838a9fSAndrew Rybchenko * special-cased in the BIU on the Falcon/Siena and EF10 architectures to avoid 10223c838a9fSAndrew Rybchenko * the need for locking in the host, and are the only ones known to be safe to 10233c838a9fSAndrew Rybchenko * use 128-bites write with. 10243c838a9fSAndrew Rybchenko */ 10253c838a9fSAndrew Rybchenko #define EFX_BAR_TBL_DOORBELL_WRITEO(_enp, _reg, _index, _eop) \ 10263c838a9fSAndrew Rybchenko do { \ 10273c838a9fSAndrew Rybchenko EFX_CHECK_REG((_enp), (_reg)); \ 10283c838a9fSAndrew Rybchenko EFSYS_PROBE7(efx_bar_tbl_doorbell_writeo, \ 10293c838a9fSAndrew Rybchenko const char *, \ 10303c838a9fSAndrew Rybchenko #_reg, \ 10313c838a9fSAndrew Rybchenko uint32_t, (_index), \ 10323c838a9fSAndrew Rybchenko uint32_t, _reg ## _OFST, \ 10333c838a9fSAndrew Rybchenko uint32_t, (_eop)->eo_u32[3], \ 10343c838a9fSAndrew Rybchenko uint32_t, (_eop)->eo_u32[2], \ 10353c838a9fSAndrew Rybchenko uint32_t, (_eop)->eo_u32[1], \ 10363c838a9fSAndrew Rybchenko uint32_t, (_eop)->eo_u32[0]); \ 10373c838a9fSAndrew Rybchenko EFSYS_BAR_DOORBELL_WRITEO((_enp)->en_esbp, \ 10383c838a9fSAndrew Rybchenko (_reg ## _OFST + ((_index) * _reg ## _STEP)), \ 10393c838a9fSAndrew Rybchenko (_eop)); \ 10403c838a9fSAndrew Rybchenko _NOTE(CONSTANTCONDITION) \ 10413c838a9fSAndrew Rybchenko } while (B_FALSE) 10423c838a9fSAndrew Rybchenko 10433c838a9fSAndrew Rybchenko #define EFX_DMA_SYNC_QUEUE_FOR_DEVICE(_esmp, _entries, _wptr, _owptr) \ 10443c838a9fSAndrew Rybchenko do { \ 10453c838a9fSAndrew Rybchenko unsigned int _new = (_wptr); \ 10463c838a9fSAndrew Rybchenko unsigned int _old = (_owptr); \ 10473c838a9fSAndrew Rybchenko \ 10483c838a9fSAndrew Rybchenko if ((_new) >= (_old)) \ 10493c838a9fSAndrew Rybchenko EFSYS_DMA_SYNC_FOR_DEVICE((_esmp), \ 10503c838a9fSAndrew Rybchenko (_old) * sizeof (efx_desc_t), \ 10513c838a9fSAndrew Rybchenko ((_new) - (_old)) * sizeof (efx_desc_t)); \ 10523c838a9fSAndrew Rybchenko else \ 10533c838a9fSAndrew Rybchenko /* \ 10543c838a9fSAndrew Rybchenko * It is cheaper to sync entire map than sync \ 10553c838a9fSAndrew Rybchenko * two parts especially when offset/size are \ 10563c838a9fSAndrew Rybchenko * ignored and entire map is synced in any case.\ 10573c838a9fSAndrew Rybchenko */ \ 10583c838a9fSAndrew Rybchenko EFSYS_DMA_SYNC_FOR_DEVICE((_esmp), \ 10593c838a9fSAndrew Rybchenko 0, \ 10603c838a9fSAndrew Rybchenko (_entries) * sizeof (efx_desc_t)); \ 1061e948693eSPhilip Paeps _NOTE(CONSTANTCONDITION) \ 1062e948693eSPhilip Paeps } while (B_FALSE) 1063e948693eSPhilip Paeps 1064460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 10653c838a9fSAndrew Rybchenko efx_nic_biu_test( 10663c838a9fSAndrew Rybchenko __in efx_nic_t *enp); 10673c838a9fSAndrew Rybchenko 1068460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 1069e948693eSPhilip Paeps efx_mac_select( 1070e948693eSPhilip Paeps __in efx_nic_t *enp); 1071e948693eSPhilip Paeps 10723c838a9fSAndrew Rybchenko extern void 10733c838a9fSAndrew Rybchenko efx_mac_multicast_hash_compute( 10743c838a9fSAndrew Rybchenko __in_ecount(6*count) uint8_t const *addrs, 10753c838a9fSAndrew Rybchenko __in int count, 10763c838a9fSAndrew Rybchenko __out efx_oword_t *hash_low, 10773c838a9fSAndrew Rybchenko __out efx_oword_t *hash_high); 10783c838a9fSAndrew Rybchenko 1079460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 1080e948693eSPhilip Paeps efx_phy_probe( 1081e948693eSPhilip Paeps __in efx_nic_t *enp); 1082e948693eSPhilip Paeps 1083e948693eSPhilip Paeps extern void 1084e948693eSPhilip Paeps efx_phy_unprobe( 1085e948693eSPhilip Paeps __in efx_nic_t *enp); 1086e948693eSPhilip Paeps 1087e948693eSPhilip Paeps #if EFSYS_OPT_VPD 1088e948693eSPhilip Paeps 1089e948693eSPhilip Paeps /* VPD utility functions */ 1090e948693eSPhilip Paeps 1091460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 1092e948693eSPhilip Paeps efx_vpd_hunk_length( 1093e948693eSPhilip Paeps __in_bcount(size) caddr_t data, 1094e948693eSPhilip Paeps __in size_t size, 1095e948693eSPhilip Paeps __out size_t *lengthp); 1096e948693eSPhilip Paeps 1097460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 1098e948693eSPhilip Paeps efx_vpd_hunk_verify( 1099e948693eSPhilip Paeps __in_bcount(size) caddr_t data, 1100e948693eSPhilip Paeps __in size_t size, 1101e948693eSPhilip Paeps __out_opt boolean_t *cksummedp); 1102e948693eSPhilip Paeps 1103460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 1104e948693eSPhilip Paeps efx_vpd_hunk_reinit( 11053c838a9fSAndrew Rybchenko __in_bcount(size) caddr_t data, 1106e948693eSPhilip Paeps __in size_t size, 1107e948693eSPhilip Paeps __in boolean_t wantpid); 1108e948693eSPhilip Paeps 1109460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 1110e948693eSPhilip Paeps efx_vpd_hunk_get( 1111e948693eSPhilip Paeps __in_bcount(size) caddr_t data, 1112e948693eSPhilip Paeps __in size_t size, 1113e948693eSPhilip Paeps __in efx_vpd_tag_t tag, 1114e948693eSPhilip Paeps __in efx_vpd_keyword_t keyword, 1115e948693eSPhilip Paeps __out unsigned int *payloadp, 1116e948693eSPhilip Paeps __out uint8_t *paylenp); 1117e948693eSPhilip Paeps 1118460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 1119e948693eSPhilip Paeps efx_vpd_hunk_next( 1120e948693eSPhilip Paeps __in_bcount(size) caddr_t data, 1121e948693eSPhilip Paeps __in size_t size, 1122e948693eSPhilip Paeps __out efx_vpd_tag_t *tagp, 1123e948693eSPhilip Paeps __out efx_vpd_keyword_t *keyword, 112486ec4b85SAndrew Rybchenko __out_opt unsigned int *payloadp, 1125e948693eSPhilip Paeps __out_opt uint8_t *paylenp, 1126e948693eSPhilip Paeps __inout unsigned int *contp); 1127e948693eSPhilip Paeps 1128460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 1129e948693eSPhilip Paeps efx_vpd_hunk_set( 1130e948693eSPhilip Paeps __in_bcount(size) caddr_t data, 1131e948693eSPhilip Paeps __in size_t size, 1132e948693eSPhilip Paeps __in efx_vpd_value_t *evvp); 1133e948693eSPhilip Paeps 1134e948693eSPhilip Paeps #endif /* EFSYS_OPT_VPD */ 1135e948693eSPhilip Paeps 1136e948693eSPhilip Paeps #if EFSYS_OPT_DIAG 1137e948693eSPhilip Paeps 11383c838a9fSAndrew Rybchenko extern efx_sram_pattern_fn_t __efx_sram_pattern_fns[]; 1139e948693eSPhilip Paeps 1140e948693eSPhilip Paeps typedef struct efx_register_set_s { 1141e948693eSPhilip Paeps unsigned int address; 1142e948693eSPhilip Paeps unsigned int step; 1143e948693eSPhilip Paeps unsigned int rows; 1144e948693eSPhilip Paeps efx_oword_t mask; 1145e948693eSPhilip Paeps } efx_register_set_t; 1146e948693eSPhilip Paeps 1147460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 1148e948693eSPhilip Paeps efx_nic_test_registers( 1149e948693eSPhilip Paeps __in efx_nic_t *enp, 1150e948693eSPhilip Paeps __in efx_register_set_t *rsp, 1151e948693eSPhilip Paeps __in size_t count); 1152e948693eSPhilip Paeps 1153460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 1154e948693eSPhilip Paeps efx_nic_test_tables( 1155e948693eSPhilip Paeps __in efx_nic_t *enp, 1156e948693eSPhilip Paeps __in efx_register_set_t *rsp, 1157e948693eSPhilip Paeps __in efx_pattern_type_t pattern, 1158e948693eSPhilip Paeps __in size_t count); 1159e948693eSPhilip Paeps 1160e948693eSPhilip Paeps #endif /* EFSYS_OPT_DIAG */ 1161e948693eSPhilip Paeps 11623c838a9fSAndrew Rybchenko #if EFSYS_OPT_MCDI 11633c838a9fSAndrew Rybchenko 1164460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 11653c838a9fSAndrew Rybchenko efx_mcdi_set_workaround( 11663c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 11673c838a9fSAndrew Rybchenko __in uint32_t type, 11683c838a9fSAndrew Rybchenko __in boolean_t enabled, 11693c838a9fSAndrew Rybchenko __out_opt uint32_t *flagsp); 11703c838a9fSAndrew Rybchenko 1171460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 11723c838a9fSAndrew Rybchenko efx_mcdi_get_workarounds( 11733c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 11743c838a9fSAndrew Rybchenko __out_opt uint32_t *implementedp, 11753c838a9fSAndrew Rybchenko __out_opt uint32_t *enabledp); 11763c838a9fSAndrew Rybchenko 11773c838a9fSAndrew Rybchenko #endif /* EFSYS_OPT_MCDI */ 11783c838a9fSAndrew Rybchenko 117958a72cb2SAndrew Rybchenko #if EFSYS_OPT_MAC_STATS 118058a72cb2SAndrew Rybchenko 118158a72cb2SAndrew Rybchenko /* 118258a72cb2SAndrew Rybchenko * Closed range of stats (i.e. the first and the last are included). 118358a72cb2SAndrew Rybchenko * The last must be greater or equal (if the range is one item only) to 118458a72cb2SAndrew Rybchenko * the first. 118558a72cb2SAndrew Rybchenko */ 118658a72cb2SAndrew Rybchenko struct efx_mac_stats_range { 118758a72cb2SAndrew Rybchenko efx_mac_stat_t first; 118858a72cb2SAndrew Rybchenko efx_mac_stat_t last; 118958a72cb2SAndrew Rybchenko }; 119058a72cb2SAndrew Rybchenko 119158a72cb2SAndrew Rybchenko extern efx_rc_t 119258a72cb2SAndrew Rybchenko efx_mac_stats_mask_add_ranges( 119358a72cb2SAndrew Rybchenko __inout_bcount(mask_size) uint32_t *maskp, 119458a72cb2SAndrew Rybchenko __in size_t mask_size, 119558a72cb2SAndrew Rybchenko __in_ecount(rng_count) const struct efx_mac_stats_range *rngp, 119658a72cb2SAndrew Rybchenko __in unsigned int rng_count); 119758a72cb2SAndrew Rybchenko 119858a72cb2SAndrew Rybchenko #endif /* EFSYS_OPT_MAC_STATS */ 119958a72cb2SAndrew Rybchenko 1200e948693eSPhilip Paeps #ifdef __cplusplus 1201e948693eSPhilip Paeps } 1202e948693eSPhilip Paeps #endif 1203e948693eSPhilip Paeps 1204e948693eSPhilip Paeps #endif /* _SYS_EFX_IMPL_H */ 1205