1*49ef7e06SGarrett D'Amore /* 2*49ef7e06SGarrett D'Amore * Copyright (c) 2006-2015 Solarflare Communications Inc. 3*49ef7e06SGarrett D'Amore * All rights reserved. 4*49ef7e06SGarrett D'Amore * 5*49ef7e06SGarrett D'Amore * Redistribution and use in source and binary forms, with or without 6*49ef7e06SGarrett D'Amore * modification, are permitted provided that the following conditions are met: 7*49ef7e06SGarrett D'Amore * 8*49ef7e06SGarrett D'Amore * 1. Redistributions of source code must retain the above copyright notice, 9*49ef7e06SGarrett D'Amore * this list of conditions and the following disclaimer. 10*49ef7e06SGarrett D'Amore * 2. Redistributions in binary form must reproduce the above copyright notice, 11*49ef7e06SGarrett D'Amore * this list of conditions and the following disclaimer in the documentation 12*49ef7e06SGarrett D'Amore * and/or other materials provided with the distribution. 13*49ef7e06SGarrett D'Amore * 14*49ef7e06SGarrett D'Amore * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15*49ef7e06SGarrett D'Amore * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 16*49ef7e06SGarrett D'Amore * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17*49ef7e06SGarrett D'Amore * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 18*49ef7e06SGarrett D'Amore * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19*49ef7e06SGarrett D'Amore * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20*49ef7e06SGarrett D'Amore * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 21*49ef7e06SGarrett D'Amore * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22*49ef7e06SGarrett D'Amore * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23*49ef7e06SGarrett D'Amore * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 24*49ef7e06SGarrett D'Amore * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25*49ef7e06SGarrett D'Amore * 26*49ef7e06SGarrett D'Amore * The views and conclusions contained in the software and documentation are 27*49ef7e06SGarrett D'Amore * those of the authors and should not be interpreted as representing official 28*49ef7e06SGarrett D'Amore * policies, either expressed or implied, of the FreeBSD Project. 29*49ef7e06SGarrett D'Amore */ 30*49ef7e06SGarrett D'Amore 31*49ef7e06SGarrett D'Amore #ifndef _SYS_EFX_H 32*49ef7e06SGarrett D'Amore #define _SYS_EFX_H 33*49ef7e06SGarrett D'Amore 34*49ef7e06SGarrett D'Amore #include "efsys.h" 35*49ef7e06SGarrett D'Amore #include "efx_check.h" 36*49ef7e06SGarrett D'Amore #include "efx_phy_ids.h" 37*49ef7e06SGarrett D'Amore 38*49ef7e06SGarrett D'Amore #ifdef __cplusplus 39*49ef7e06SGarrett D'Amore extern "C" { 40*49ef7e06SGarrett D'Amore #endif 41*49ef7e06SGarrett D'Amore 42*49ef7e06SGarrett D'Amore #define EFX_STATIC_ASSERT(_cond) \ 43*49ef7e06SGarrett D'Amore ((void)sizeof(char[(_cond) ? 1 : -1])) 44*49ef7e06SGarrett D'Amore 45*49ef7e06SGarrett D'Amore #define EFX_ARRAY_SIZE(_array) \ 46*49ef7e06SGarrett D'Amore (sizeof(_array) / sizeof((_array)[0])) 47*49ef7e06SGarrett D'Amore 48*49ef7e06SGarrett D'Amore #define EFX_FIELD_OFFSET(_type, _field) \ 49*49ef7e06SGarrett D'Amore ((size_t) &(((_type *)0)->_field)) 50*49ef7e06SGarrett D'Amore 51*49ef7e06SGarrett D'Amore /* Return codes */ 52*49ef7e06SGarrett D'Amore 53*49ef7e06SGarrett D'Amore typedef __success(return == 0) int efx_rc_t; 54*49ef7e06SGarrett D'Amore 55*49ef7e06SGarrett D'Amore 56*49ef7e06SGarrett D'Amore /* Chip families */ 57*49ef7e06SGarrett D'Amore 58*49ef7e06SGarrett D'Amore typedef enum efx_family_e { 59*49ef7e06SGarrett D'Amore EFX_FAMILY_INVALID, 60*49ef7e06SGarrett D'Amore EFX_FAMILY_FALCON, /* Obsolete and not supported */ 61*49ef7e06SGarrett D'Amore EFX_FAMILY_SIENA, 62*49ef7e06SGarrett D'Amore EFX_FAMILY_HUNTINGTON, 63*49ef7e06SGarrett D'Amore EFX_FAMILY_MEDFORD, 64*49ef7e06SGarrett D'Amore EFX_FAMILY_NTYPES 65*49ef7e06SGarrett D'Amore } efx_family_t; 66*49ef7e06SGarrett D'Amore 67*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 68*49ef7e06SGarrett D'Amore efx_family( 69*49ef7e06SGarrett D'Amore __in uint16_t venid, 70*49ef7e06SGarrett D'Amore __in uint16_t devid, 71*49ef7e06SGarrett D'Amore __out efx_family_t *efp); 72*49ef7e06SGarrett D'Amore 73*49ef7e06SGarrett D'Amore 74*49ef7e06SGarrett D'Amore #define EFX_PCI_VENID_SFC 0x1924 75*49ef7e06SGarrett D'Amore 76*49ef7e06SGarrett D'Amore #define EFX_PCI_DEVID_FALCON 0x0710 /* SFC4000 */ 77*49ef7e06SGarrett D'Amore 78*49ef7e06SGarrett D'Amore #define EFX_PCI_DEVID_BETHPAGE 0x0803 /* SFC9020 */ 79*49ef7e06SGarrett D'Amore #define EFX_PCI_DEVID_SIENA 0x0813 /* SFL9021 */ 80*49ef7e06SGarrett D'Amore #define EFX_PCI_DEVID_SIENA_F1_UNINIT 0x0810 81*49ef7e06SGarrett D'Amore 82*49ef7e06SGarrett D'Amore #define EFX_PCI_DEVID_HUNTINGTON_PF_UNINIT 0x0901 83*49ef7e06SGarrett D'Amore #define EFX_PCI_DEVID_FARMINGDALE 0x0903 /* SFC9120 PF */ 84*49ef7e06SGarrett D'Amore #define EFX_PCI_DEVID_GREENPORT 0x0923 /* SFC9140 PF */ 85*49ef7e06SGarrett D'Amore 86*49ef7e06SGarrett D'Amore #define EFX_PCI_DEVID_FARMINGDALE_VF 0x1903 /* SFC9120 VF */ 87*49ef7e06SGarrett D'Amore #define EFX_PCI_DEVID_GREENPORT_VF 0x1923 /* SFC9140 VF */ 88*49ef7e06SGarrett D'Amore 89*49ef7e06SGarrett D'Amore #define EFX_PCI_DEVID_MEDFORD_PF_UNINIT 0x0913 90*49ef7e06SGarrett D'Amore #define EFX_PCI_DEVID_MEDFORD 0x0A03 /* SFC9240 PF */ 91*49ef7e06SGarrett D'Amore #define EFX_PCI_DEVID_MEDFORD_VF 0x1A03 /* SFC9240 VF */ 92*49ef7e06SGarrett D'Amore 93*49ef7e06SGarrett D'Amore #define EFX_MEM_BAR 2 94*49ef7e06SGarrett D'Amore 95*49ef7e06SGarrett D'Amore /* Error codes */ 96*49ef7e06SGarrett D'Amore 97*49ef7e06SGarrett D'Amore enum { 98*49ef7e06SGarrett D'Amore EFX_ERR_INVALID, 99*49ef7e06SGarrett D'Amore EFX_ERR_SRAM_OOB, 100*49ef7e06SGarrett D'Amore EFX_ERR_BUFID_DC_OOB, 101*49ef7e06SGarrett D'Amore EFX_ERR_MEM_PERR, 102*49ef7e06SGarrett D'Amore EFX_ERR_RBUF_OWN, 103*49ef7e06SGarrett D'Amore EFX_ERR_TBUF_OWN, 104*49ef7e06SGarrett D'Amore EFX_ERR_RDESQ_OWN, 105*49ef7e06SGarrett D'Amore EFX_ERR_TDESQ_OWN, 106*49ef7e06SGarrett D'Amore EFX_ERR_EVQ_OWN, 107*49ef7e06SGarrett D'Amore EFX_ERR_EVFF_OFLO, 108*49ef7e06SGarrett D'Amore EFX_ERR_ILL_ADDR, 109*49ef7e06SGarrett D'Amore EFX_ERR_SRAM_PERR, 110*49ef7e06SGarrett D'Amore EFX_ERR_NCODES 111*49ef7e06SGarrett D'Amore }; 112*49ef7e06SGarrett D'Amore 113*49ef7e06SGarrett D'Amore /* Calculate the IEEE 802.3 CRC32 of a MAC addr */ 114*49ef7e06SGarrett D'Amore extern __checkReturn uint32_t 115*49ef7e06SGarrett D'Amore efx_crc32_calculate( 116*49ef7e06SGarrett D'Amore __in uint32_t crc_init, 117*49ef7e06SGarrett D'Amore __in_ecount(length) uint8_t const *input, 118*49ef7e06SGarrett D'Amore __in int length); 119*49ef7e06SGarrett D'Amore 120*49ef7e06SGarrett D'Amore 121*49ef7e06SGarrett D'Amore /* Type prototypes */ 122*49ef7e06SGarrett D'Amore 123*49ef7e06SGarrett D'Amore typedef struct efx_rxq_s efx_rxq_t; 124*49ef7e06SGarrett D'Amore 125*49ef7e06SGarrett D'Amore /* NIC */ 126*49ef7e06SGarrett D'Amore 127*49ef7e06SGarrett D'Amore typedef struct efx_nic_s efx_nic_t; 128*49ef7e06SGarrett D'Amore 129*49ef7e06SGarrett D'Amore #define EFX_NIC_FUNC_PRIMARY 0x00000001 130*49ef7e06SGarrett D'Amore #define EFX_NIC_FUNC_LINKCTRL 0x00000002 131*49ef7e06SGarrett D'Amore #define EFX_NIC_FUNC_TRUSTED 0x00000004 132*49ef7e06SGarrett D'Amore 133*49ef7e06SGarrett D'Amore 134*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 135*49ef7e06SGarrett D'Amore efx_nic_create( 136*49ef7e06SGarrett D'Amore __in efx_family_t family, 137*49ef7e06SGarrett D'Amore __in efsys_identifier_t *esip, 138*49ef7e06SGarrett D'Amore __in efsys_bar_t *esbp, 139*49ef7e06SGarrett D'Amore __in efsys_lock_t *eslp, 140*49ef7e06SGarrett D'Amore __deref_out efx_nic_t **enpp); 141*49ef7e06SGarrett D'Amore 142*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 143*49ef7e06SGarrett D'Amore efx_nic_probe( 144*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 145*49ef7e06SGarrett D'Amore 146*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 147*49ef7e06SGarrett D'Amore efx_nic_init( 148*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 149*49ef7e06SGarrett D'Amore 150*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 151*49ef7e06SGarrett D'Amore efx_nic_reset( 152*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 153*49ef7e06SGarrett D'Amore 154*49ef7e06SGarrett D'Amore #if EFSYS_OPT_DIAG 155*49ef7e06SGarrett D'Amore 156*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 157*49ef7e06SGarrett D'Amore efx_nic_register_test( 158*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 159*49ef7e06SGarrett D'Amore 160*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_DIAG */ 161*49ef7e06SGarrett D'Amore 162*49ef7e06SGarrett D'Amore extern void 163*49ef7e06SGarrett D'Amore efx_nic_fini( 164*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 165*49ef7e06SGarrett D'Amore 166*49ef7e06SGarrett D'Amore extern void 167*49ef7e06SGarrett D'Amore efx_nic_unprobe( 168*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 169*49ef7e06SGarrett D'Amore 170*49ef7e06SGarrett D'Amore extern void 171*49ef7e06SGarrett D'Amore efx_nic_destroy( 172*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 173*49ef7e06SGarrett D'Amore 174*49ef7e06SGarrett D'Amore #if EFSYS_OPT_MCDI 175*49ef7e06SGarrett D'Amore 176*49ef7e06SGarrett D'Amore #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD 177*49ef7e06SGarrett D'Amore /* Huntington and Medford require MCDIv2 commands */ 178*49ef7e06SGarrett D'Amore #define WITH_MCDI_V2 1 179*49ef7e06SGarrett D'Amore #endif 180*49ef7e06SGarrett D'Amore 181*49ef7e06SGarrett D'Amore typedef struct efx_mcdi_req_s efx_mcdi_req_t; 182*49ef7e06SGarrett D'Amore 183*49ef7e06SGarrett D'Amore typedef enum efx_mcdi_exception_e { 184*49ef7e06SGarrett D'Amore EFX_MCDI_EXCEPTION_MC_REBOOT, 185*49ef7e06SGarrett D'Amore EFX_MCDI_EXCEPTION_MC_BADASSERT, 186*49ef7e06SGarrett D'Amore } efx_mcdi_exception_t; 187*49ef7e06SGarrett D'Amore 188*49ef7e06SGarrett D'Amore #if EFSYS_OPT_MCDI_LOGGING 189*49ef7e06SGarrett D'Amore typedef enum efx_log_msg_e 190*49ef7e06SGarrett D'Amore { 191*49ef7e06SGarrett D'Amore EFX_LOG_INVALID, 192*49ef7e06SGarrett D'Amore EFX_LOG_MCDI_REQUEST, 193*49ef7e06SGarrett D'Amore EFX_LOG_MCDI_RESPONSE, 194*49ef7e06SGarrett D'Amore } efx_log_msg_t; 195*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_MCDI_LOGGING */ 196*49ef7e06SGarrett D'Amore 197*49ef7e06SGarrett D'Amore typedef struct efx_mcdi_transport_s { 198*49ef7e06SGarrett D'Amore void *emt_context; 199*49ef7e06SGarrett D'Amore efsys_mem_t *emt_dma_mem; 200*49ef7e06SGarrett D'Amore void (*emt_execute)(void *, efx_mcdi_req_t *); 201*49ef7e06SGarrett D'Amore void (*emt_ev_cpl)(void *); 202*49ef7e06SGarrett D'Amore void (*emt_exception)(void *, efx_mcdi_exception_t); 203*49ef7e06SGarrett D'Amore #if EFSYS_OPT_MCDI_LOGGING 204*49ef7e06SGarrett D'Amore void (*emt_logger)(void *, efx_log_msg_t, 205*49ef7e06SGarrett D'Amore void *, size_t, void *, size_t); 206*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_MCDI_LOGGING */ 207*49ef7e06SGarrett D'Amore #if EFSYS_OPT_MCDI_PROXY_AUTH 208*49ef7e06SGarrett D'Amore void (*emt_ev_proxy_response)(void *, uint32_t, efx_rc_t); 209*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ 210*49ef7e06SGarrett D'Amore } efx_mcdi_transport_t; 211*49ef7e06SGarrett D'Amore 212*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 213*49ef7e06SGarrett D'Amore efx_mcdi_init( 214*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 215*49ef7e06SGarrett D'Amore __in const efx_mcdi_transport_t *mtp); 216*49ef7e06SGarrett D'Amore 217*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 218*49ef7e06SGarrett D'Amore efx_mcdi_reboot( 219*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 220*49ef7e06SGarrett D'Amore 221*49ef7e06SGarrett D'Amore void 222*49ef7e06SGarrett D'Amore efx_mcdi_new_epoch( 223*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 224*49ef7e06SGarrett D'Amore 225*49ef7e06SGarrett D'Amore extern void 226*49ef7e06SGarrett D'Amore efx_mcdi_request_start( 227*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 228*49ef7e06SGarrett D'Amore __in efx_mcdi_req_t *emrp, 229*49ef7e06SGarrett D'Amore __in boolean_t ev_cpl); 230*49ef7e06SGarrett D'Amore 231*49ef7e06SGarrett D'Amore extern __checkReturn boolean_t 232*49ef7e06SGarrett D'Amore efx_mcdi_request_poll( 233*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 234*49ef7e06SGarrett D'Amore 235*49ef7e06SGarrett D'Amore extern __checkReturn boolean_t 236*49ef7e06SGarrett D'Amore efx_mcdi_request_abort( 237*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 238*49ef7e06SGarrett D'Amore 239*49ef7e06SGarrett D'Amore extern void 240*49ef7e06SGarrett D'Amore efx_mcdi_fini( 241*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 242*49ef7e06SGarrett D'Amore 243*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_MCDI */ 244*49ef7e06SGarrett D'Amore 245*49ef7e06SGarrett D'Amore /* INTR */ 246*49ef7e06SGarrett D'Amore 247*49ef7e06SGarrett D'Amore #define EFX_NINTR_SIENA 1024 248*49ef7e06SGarrett D'Amore 249*49ef7e06SGarrett D'Amore typedef enum efx_intr_type_e { 250*49ef7e06SGarrett D'Amore EFX_INTR_INVALID = 0, 251*49ef7e06SGarrett D'Amore EFX_INTR_LINE, 252*49ef7e06SGarrett D'Amore EFX_INTR_MESSAGE, 253*49ef7e06SGarrett D'Amore EFX_INTR_NTYPES 254*49ef7e06SGarrett D'Amore } efx_intr_type_t; 255*49ef7e06SGarrett D'Amore 256*49ef7e06SGarrett D'Amore #define EFX_INTR_SIZE (sizeof (efx_oword_t)) 257*49ef7e06SGarrett D'Amore 258*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 259*49ef7e06SGarrett D'Amore efx_intr_init( 260*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 261*49ef7e06SGarrett D'Amore __in efx_intr_type_t type, 262*49ef7e06SGarrett D'Amore __in efsys_mem_t *esmp); 263*49ef7e06SGarrett D'Amore 264*49ef7e06SGarrett D'Amore extern void 265*49ef7e06SGarrett D'Amore efx_intr_enable( 266*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 267*49ef7e06SGarrett D'Amore 268*49ef7e06SGarrett D'Amore extern void 269*49ef7e06SGarrett D'Amore efx_intr_disable( 270*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 271*49ef7e06SGarrett D'Amore 272*49ef7e06SGarrett D'Amore extern void 273*49ef7e06SGarrett D'Amore efx_intr_disable_unlocked( 274*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 275*49ef7e06SGarrett D'Amore 276*49ef7e06SGarrett D'Amore #define EFX_INTR_NEVQS 32 277*49ef7e06SGarrett D'Amore 278*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 279*49ef7e06SGarrett D'Amore efx_intr_trigger( 280*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 281*49ef7e06SGarrett D'Amore __in unsigned int level); 282*49ef7e06SGarrett D'Amore 283*49ef7e06SGarrett D'Amore extern void 284*49ef7e06SGarrett D'Amore efx_intr_status_line( 285*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 286*49ef7e06SGarrett D'Amore __out boolean_t *fatalp, 287*49ef7e06SGarrett D'Amore __out uint32_t *maskp); 288*49ef7e06SGarrett D'Amore 289*49ef7e06SGarrett D'Amore extern void 290*49ef7e06SGarrett D'Amore efx_intr_status_message( 291*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 292*49ef7e06SGarrett D'Amore __in unsigned int message, 293*49ef7e06SGarrett D'Amore __out boolean_t *fatalp); 294*49ef7e06SGarrett D'Amore 295*49ef7e06SGarrett D'Amore extern void 296*49ef7e06SGarrett D'Amore efx_intr_fatal( 297*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 298*49ef7e06SGarrett D'Amore 299*49ef7e06SGarrett D'Amore extern void 300*49ef7e06SGarrett D'Amore efx_intr_fini( 301*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 302*49ef7e06SGarrett D'Amore 303*49ef7e06SGarrett D'Amore /* MAC */ 304*49ef7e06SGarrett D'Amore 305*49ef7e06SGarrett D'Amore #if EFSYS_OPT_MAC_STATS 306*49ef7e06SGarrett D'Amore 307*49ef7e06SGarrett D'Amore /* START MKCONFIG GENERATED EfxHeaderMacBlock e323546097fd7c65 */ 308*49ef7e06SGarrett D'Amore typedef enum efx_mac_stat_e { 309*49ef7e06SGarrett D'Amore EFX_MAC_RX_OCTETS, 310*49ef7e06SGarrett D'Amore EFX_MAC_RX_PKTS, 311*49ef7e06SGarrett D'Amore EFX_MAC_RX_UNICST_PKTS, 312*49ef7e06SGarrett D'Amore EFX_MAC_RX_MULTICST_PKTS, 313*49ef7e06SGarrett D'Amore EFX_MAC_RX_BRDCST_PKTS, 314*49ef7e06SGarrett D'Amore EFX_MAC_RX_PAUSE_PKTS, 315*49ef7e06SGarrett D'Amore EFX_MAC_RX_LE_64_PKTS, 316*49ef7e06SGarrett D'Amore EFX_MAC_RX_65_TO_127_PKTS, 317*49ef7e06SGarrett D'Amore EFX_MAC_RX_128_TO_255_PKTS, 318*49ef7e06SGarrett D'Amore EFX_MAC_RX_256_TO_511_PKTS, 319*49ef7e06SGarrett D'Amore EFX_MAC_RX_512_TO_1023_PKTS, 320*49ef7e06SGarrett D'Amore EFX_MAC_RX_1024_TO_15XX_PKTS, 321*49ef7e06SGarrett D'Amore EFX_MAC_RX_GE_15XX_PKTS, 322*49ef7e06SGarrett D'Amore EFX_MAC_RX_ERRORS, 323*49ef7e06SGarrett D'Amore EFX_MAC_RX_FCS_ERRORS, 324*49ef7e06SGarrett D'Amore EFX_MAC_RX_DROP_EVENTS, 325*49ef7e06SGarrett D'Amore EFX_MAC_RX_FALSE_CARRIER_ERRORS, 326*49ef7e06SGarrett D'Amore EFX_MAC_RX_SYMBOL_ERRORS, 327*49ef7e06SGarrett D'Amore EFX_MAC_RX_ALIGN_ERRORS, 328*49ef7e06SGarrett D'Amore EFX_MAC_RX_INTERNAL_ERRORS, 329*49ef7e06SGarrett D'Amore EFX_MAC_RX_JABBER_PKTS, 330*49ef7e06SGarrett D'Amore EFX_MAC_RX_LANE0_CHAR_ERR, 331*49ef7e06SGarrett D'Amore EFX_MAC_RX_LANE1_CHAR_ERR, 332*49ef7e06SGarrett D'Amore EFX_MAC_RX_LANE2_CHAR_ERR, 333*49ef7e06SGarrett D'Amore EFX_MAC_RX_LANE3_CHAR_ERR, 334*49ef7e06SGarrett D'Amore EFX_MAC_RX_LANE0_DISP_ERR, 335*49ef7e06SGarrett D'Amore EFX_MAC_RX_LANE1_DISP_ERR, 336*49ef7e06SGarrett D'Amore EFX_MAC_RX_LANE2_DISP_ERR, 337*49ef7e06SGarrett D'Amore EFX_MAC_RX_LANE3_DISP_ERR, 338*49ef7e06SGarrett D'Amore EFX_MAC_RX_MATCH_FAULT, 339*49ef7e06SGarrett D'Amore EFX_MAC_RX_NODESC_DROP_CNT, 340*49ef7e06SGarrett D'Amore EFX_MAC_TX_OCTETS, 341*49ef7e06SGarrett D'Amore EFX_MAC_TX_PKTS, 342*49ef7e06SGarrett D'Amore EFX_MAC_TX_UNICST_PKTS, 343*49ef7e06SGarrett D'Amore EFX_MAC_TX_MULTICST_PKTS, 344*49ef7e06SGarrett D'Amore EFX_MAC_TX_BRDCST_PKTS, 345*49ef7e06SGarrett D'Amore EFX_MAC_TX_PAUSE_PKTS, 346*49ef7e06SGarrett D'Amore EFX_MAC_TX_LE_64_PKTS, 347*49ef7e06SGarrett D'Amore EFX_MAC_TX_65_TO_127_PKTS, 348*49ef7e06SGarrett D'Amore EFX_MAC_TX_128_TO_255_PKTS, 349*49ef7e06SGarrett D'Amore EFX_MAC_TX_256_TO_511_PKTS, 350*49ef7e06SGarrett D'Amore EFX_MAC_TX_512_TO_1023_PKTS, 351*49ef7e06SGarrett D'Amore EFX_MAC_TX_1024_TO_15XX_PKTS, 352*49ef7e06SGarrett D'Amore EFX_MAC_TX_GE_15XX_PKTS, 353*49ef7e06SGarrett D'Amore EFX_MAC_TX_ERRORS, 354*49ef7e06SGarrett D'Amore EFX_MAC_TX_SGL_COL_PKTS, 355*49ef7e06SGarrett D'Amore EFX_MAC_TX_MULT_COL_PKTS, 356*49ef7e06SGarrett D'Amore EFX_MAC_TX_EX_COL_PKTS, 357*49ef7e06SGarrett D'Amore EFX_MAC_TX_LATE_COL_PKTS, 358*49ef7e06SGarrett D'Amore EFX_MAC_TX_DEF_PKTS, 359*49ef7e06SGarrett D'Amore EFX_MAC_TX_EX_DEF_PKTS, 360*49ef7e06SGarrett D'Amore EFX_MAC_PM_TRUNC_BB_OVERFLOW, 361*49ef7e06SGarrett D'Amore EFX_MAC_PM_DISCARD_BB_OVERFLOW, 362*49ef7e06SGarrett D'Amore EFX_MAC_PM_TRUNC_VFIFO_FULL, 363*49ef7e06SGarrett D'Amore EFX_MAC_PM_DISCARD_VFIFO_FULL, 364*49ef7e06SGarrett D'Amore EFX_MAC_PM_TRUNC_QBB, 365*49ef7e06SGarrett D'Amore EFX_MAC_PM_DISCARD_QBB, 366*49ef7e06SGarrett D'Amore EFX_MAC_PM_DISCARD_MAPPING, 367*49ef7e06SGarrett D'Amore EFX_MAC_RXDP_Q_DISABLED_PKTS, 368*49ef7e06SGarrett D'Amore EFX_MAC_RXDP_DI_DROPPED_PKTS, 369*49ef7e06SGarrett D'Amore EFX_MAC_RXDP_STREAMING_PKTS, 370*49ef7e06SGarrett D'Amore EFX_MAC_RXDP_HLB_FETCH, 371*49ef7e06SGarrett D'Amore EFX_MAC_RXDP_HLB_WAIT, 372*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_RX_UNICAST_PACKETS, 373*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_RX_UNICAST_BYTES, 374*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_RX_MULTICAST_PACKETS, 375*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_RX_MULTICAST_BYTES, 376*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_RX_BROADCAST_PACKETS, 377*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_RX_BROADCAST_BYTES, 378*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_RX_BAD_PACKETS, 379*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_RX_BAD_BYTES, 380*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_RX_OVERFLOW, 381*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_TX_UNICAST_PACKETS, 382*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_TX_UNICAST_BYTES, 383*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_TX_MULTICAST_PACKETS, 384*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_TX_MULTICAST_BYTES, 385*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_TX_BROADCAST_PACKETS, 386*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_TX_BROADCAST_BYTES, 387*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_TX_BAD_PACKETS, 388*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_TX_BAD_BYTES, 389*49ef7e06SGarrett D'Amore EFX_MAC_VADAPTER_TX_OVERFLOW, 390*49ef7e06SGarrett D'Amore EFX_MAC_NSTATS 391*49ef7e06SGarrett D'Amore } efx_mac_stat_t; 392*49ef7e06SGarrett D'Amore 393*49ef7e06SGarrett D'Amore /* END MKCONFIG GENERATED EfxHeaderMacBlock */ 394*49ef7e06SGarrett D'Amore 395*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_MAC_STATS */ 396*49ef7e06SGarrett D'Amore 397*49ef7e06SGarrett D'Amore typedef enum efx_link_mode_e { 398*49ef7e06SGarrett D'Amore EFX_LINK_UNKNOWN = 0, 399*49ef7e06SGarrett D'Amore EFX_LINK_DOWN, 400*49ef7e06SGarrett D'Amore EFX_LINK_10HDX, 401*49ef7e06SGarrett D'Amore EFX_LINK_10FDX, 402*49ef7e06SGarrett D'Amore EFX_LINK_100HDX, 403*49ef7e06SGarrett D'Amore EFX_LINK_100FDX, 404*49ef7e06SGarrett D'Amore EFX_LINK_1000HDX, 405*49ef7e06SGarrett D'Amore EFX_LINK_1000FDX, 406*49ef7e06SGarrett D'Amore EFX_LINK_10000FDX, 407*49ef7e06SGarrett D'Amore EFX_LINK_40000FDX, 408*49ef7e06SGarrett D'Amore EFX_LINK_NMODES 409*49ef7e06SGarrett D'Amore } efx_link_mode_t; 410*49ef7e06SGarrett D'Amore 411*49ef7e06SGarrett D'Amore #define EFX_MAC_ADDR_LEN 6 412*49ef7e06SGarrett D'Amore 413*49ef7e06SGarrett D'Amore #define EFX_MAC_ADDR_IS_MULTICAST(_address) (((uint8_t*)_address)[0] & 0x01) 414*49ef7e06SGarrett D'Amore 415*49ef7e06SGarrett D'Amore #define EFX_MAC_MULTICAST_LIST_MAX 256 416*49ef7e06SGarrett D'Amore 417*49ef7e06SGarrett D'Amore #define EFX_MAC_SDU_MAX 9202 418*49ef7e06SGarrett D'Amore 419*49ef7e06SGarrett D'Amore #define EFX_MAC_PDU(_sdu) \ 420*49ef7e06SGarrett D'Amore P2ROUNDUP(((_sdu) \ 421*49ef7e06SGarrett D'Amore + /* EtherII */ 14 \ 422*49ef7e06SGarrett D'Amore + /* VLAN */ 4 \ 423*49ef7e06SGarrett D'Amore + /* CRC */ 4 \ 424*49ef7e06SGarrett D'Amore + /* bug16011 */ 16), \ 425*49ef7e06SGarrett D'Amore (1 << 3)) 426*49ef7e06SGarrett D'Amore 427*49ef7e06SGarrett D'Amore #define EFX_MAC_PDU_MIN 60 428*49ef7e06SGarrett D'Amore #define EFX_MAC_PDU_MAX EFX_MAC_PDU(EFX_MAC_SDU_MAX) 429*49ef7e06SGarrett D'Amore 430*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 431*49ef7e06SGarrett D'Amore efx_mac_pdu_set( 432*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 433*49ef7e06SGarrett D'Amore __in size_t pdu); 434*49ef7e06SGarrett D'Amore 435*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 436*49ef7e06SGarrett D'Amore efx_mac_addr_set( 437*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 438*49ef7e06SGarrett D'Amore __in uint8_t *addr); 439*49ef7e06SGarrett D'Amore 440*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 441*49ef7e06SGarrett D'Amore efx_mac_filter_set( 442*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 443*49ef7e06SGarrett D'Amore __in boolean_t all_unicst, 444*49ef7e06SGarrett D'Amore __in boolean_t mulcst, 445*49ef7e06SGarrett D'Amore __in boolean_t all_mulcst, 446*49ef7e06SGarrett D'Amore __in boolean_t brdcst); 447*49ef7e06SGarrett D'Amore 448*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 449*49ef7e06SGarrett D'Amore efx_mac_multicast_list_set( 450*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 451*49ef7e06SGarrett D'Amore __in_ecount(6*count) uint8_t const *addrs, 452*49ef7e06SGarrett D'Amore __in int count); 453*49ef7e06SGarrett D'Amore 454*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 455*49ef7e06SGarrett D'Amore efx_mac_filter_default_rxq_set( 456*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 457*49ef7e06SGarrett D'Amore __in efx_rxq_t *erp, 458*49ef7e06SGarrett D'Amore __in boolean_t using_rss); 459*49ef7e06SGarrett D'Amore 460*49ef7e06SGarrett D'Amore extern void 461*49ef7e06SGarrett D'Amore efx_mac_filter_default_rxq_clear( 462*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 463*49ef7e06SGarrett D'Amore 464*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 465*49ef7e06SGarrett D'Amore efx_mac_drain( 466*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 467*49ef7e06SGarrett D'Amore __in boolean_t enabled); 468*49ef7e06SGarrett D'Amore 469*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 470*49ef7e06SGarrett D'Amore efx_mac_up( 471*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 472*49ef7e06SGarrett D'Amore __out boolean_t *mac_upp); 473*49ef7e06SGarrett D'Amore 474*49ef7e06SGarrett D'Amore #define EFX_FCNTL_RESPOND 0x00000001 475*49ef7e06SGarrett D'Amore #define EFX_FCNTL_GENERATE 0x00000002 476*49ef7e06SGarrett D'Amore 477*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 478*49ef7e06SGarrett D'Amore efx_mac_fcntl_set( 479*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 480*49ef7e06SGarrett D'Amore __in unsigned int fcntl, 481*49ef7e06SGarrett D'Amore __in boolean_t autoneg); 482*49ef7e06SGarrett D'Amore 483*49ef7e06SGarrett D'Amore extern void 484*49ef7e06SGarrett D'Amore efx_mac_fcntl_get( 485*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 486*49ef7e06SGarrett D'Amore __out unsigned int *fcntl_wantedp, 487*49ef7e06SGarrett D'Amore __out unsigned int *fcntl_linkp); 488*49ef7e06SGarrett D'Amore 489*49ef7e06SGarrett D'Amore 490*49ef7e06SGarrett D'Amore #if EFSYS_OPT_MAC_STATS 491*49ef7e06SGarrett D'Amore 492*49ef7e06SGarrett D'Amore #if EFSYS_OPT_NAMES 493*49ef7e06SGarrett D'Amore 494*49ef7e06SGarrett D'Amore extern __checkReturn const char * 495*49ef7e06SGarrett D'Amore efx_mac_stat_name( 496*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 497*49ef7e06SGarrett D'Amore __in unsigned int id); 498*49ef7e06SGarrett D'Amore 499*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_NAMES */ 500*49ef7e06SGarrett D'Amore 501*49ef7e06SGarrett D'Amore #define EFX_MAC_STATS_SIZE 0x400 502*49ef7e06SGarrett D'Amore 503*49ef7e06SGarrett D'Amore /* 504*49ef7e06SGarrett D'Amore * Upload mac statistics supported by the hardware into the given buffer. 505*49ef7e06SGarrett D'Amore * 506*49ef7e06SGarrett D'Amore * The reference buffer must be at least %EFX_MAC_STATS_SIZE bytes, 507*49ef7e06SGarrett D'Amore * and page aligned. 508*49ef7e06SGarrett D'Amore * 509*49ef7e06SGarrett D'Amore * The hardware will only DMA statistics that it understands (of course). 510*49ef7e06SGarrett D'Amore * Drivers should not make any assumptions about which statistics are 511*49ef7e06SGarrett D'Amore * supported, especially when the statistics are generated by firmware. 512*49ef7e06SGarrett D'Amore * 513*49ef7e06SGarrett D'Amore * Thus, drivers should zero this buffer before use, so that not-understood 514*49ef7e06SGarrett D'Amore * statistics read back as zero. 515*49ef7e06SGarrett D'Amore */ 516*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 517*49ef7e06SGarrett D'Amore efx_mac_stats_upload( 518*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 519*49ef7e06SGarrett D'Amore __in efsys_mem_t *esmp); 520*49ef7e06SGarrett D'Amore 521*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 522*49ef7e06SGarrett D'Amore efx_mac_stats_periodic( 523*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 524*49ef7e06SGarrett D'Amore __in efsys_mem_t *esmp, 525*49ef7e06SGarrett D'Amore __in uint16_t period_ms, 526*49ef7e06SGarrett D'Amore __in boolean_t events); 527*49ef7e06SGarrett D'Amore 528*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 529*49ef7e06SGarrett D'Amore efx_mac_stats_update( 530*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 531*49ef7e06SGarrett D'Amore __in efsys_mem_t *esmp, 532*49ef7e06SGarrett D'Amore __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat, 533*49ef7e06SGarrett D'Amore __inout_opt uint32_t *generationp); 534*49ef7e06SGarrett D'Amore 535*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_MAC_STATS */ 536*49ef7e06SGarrett D'Amore 537*49ef7e06SGarrett D'Amore /* MON */ 538*49ef7e06SGarrett D'Amore 539*49ef7e06SGarrett D'Amore typedef enum efx_mon_type_e { 540*49ef7e06SGarrett D'Amore EFX_MON_INVALID = 0, 541*49ef7e06SGarrett D'Amore EFX_MON_SFC90X0, 542*49ef7e06SGarrett D'Amore EFX_MON_SFC91X0, 543*49ef7e06SGarrett D'Amore EFX_MON_SFC92X0, 544*49ef7e06SGarrett D'Amore EFX_MON_NTYPES 545*49ef7e06SGarrett D'Amore } efx_mon_type_t; 546*49ef7e06SGarrett D'Amore 547*49ef7e06SGarrett D'Amore #if EFSYS_OPT_NAMES 548*49ef7e06SGarrett D'Amore 549*49ef7e06SGarrett D'Amore extern const char * 550*49ef7e06SGarrett D'Amore efx_mon_name( 551*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 552*49ef7e06SGarrett D'Amore 553*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_NAMES */ 554*49ef7e06SGarrett D'Amore 555*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 556*49ef7e06SGarrett D'Amore efx_mon_init( 557*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 558*49ef7e06SGarrett D'Amore 559*49ef7e06SGarrett D'Amore #if EFSYS_OPT_MON_STATS 560*49ef7e06SGarrett D'Amore 561*49ef7e06SGarrett D'Amore #define EFX_MON_STATS_PAGE_SIZE 0x100 562*49ef7e06SGarrett D'Amore #define EFX_MON_MASK_ELEMENT_SIZE 32 563*49ef7e06SGarrett D'Amore 564*49ef7e06SGarrett D'Amore /* START MKCONFIG GENERATED MonitorHeaderStatsBlock 5d4ee5185e419abe */ 565*49ef7e06SGarrett D'Amore typedef enum efx_mon_stat_e { 566*49ef7e06SGarrett D'Amore EFX_MON_STAT_2_5V, 567*49ef7e06SGarrett D'Amore EFX_MON_STAT_VCCP1, 568*49ef7e06SGarrett D'Amore EFX_MON_STAT_VCC, 569*49ef7e06SGarrett D'Amore EFX_MON_STAT_5V, 570*49ef7e06SGarrett D'Amore EFX_MON_STAT_12V, 571*49ef7e06SGarrett D'Amore EFX_MON_STAT_VCCP2, 572*49ef7e06SGarrett D'Amore EFX_MON_STAT_EXT_TEMP, 573*49ef7e06SGarrett D'Amore EFX_MON_STAT_INT_TEMP, 574*49ef7e06SGarrett D'Amore EFX_MON_STAT_AIN1, 575*49ef7e06SGarrett D'Amore EFX_MON_STAT_AIN2, 576*49ef7e06SGarrett D'Amore EFX_MON_STAT_INT_COOLING, 577*49ef7e06SGarrett D'Amore EFX_MON_STAT_EXT_COOLING, 578*49ef7e06SGarrett D'Amore EFX_MON_STAT_1V, 579*49ef7e06SGarrett D'Amore EFX_MON_STAT_1_2V, 580*49ef7e06SGarrett D'Amore EFX_MON_STAT_1_8V, 581*49ef7e06SGarrett D'Amore EFX_MON_STAT_3_3V, 582*49ef7e06SGarrett D'Amore EFX_MON_STAT_1_2VA, 583*49ef7e06SGarrett D'Amore EFX_MON_STAT_VREF, 584*49ef7e06SGarrett D'Amore EFX_MON_STAT_VAOE, 585*49ef7e06SGarrett D'Amore EFX_MON_STAT_AOE_TEMP, 586*49ef7e06SGarrett D'Amore EFX_MON_STAT_PSU_AOE_TEMP, 587*49ef7e06SGarrett D'Amore EFX_MON_STAT_PSU_TEMP, 588*49ef7e06SGarrett D'Amore EFX_MON_STAT_FAN0, 589*49ef7e06SGarrett D'Amore EFX_MON_STAT_FAN1, 590*49ef7e06SGarrett D'Amore EFX_MON_STAT_FAN2, 591*49ef7e06SGarrett D'Amore EFX_MON_STAT_FAN3, 592*49ef7e06SGarrett D'Amore EFX_MON_STAT_FAN4, 593*49ef7e06SGarrett D'Amore EFX_MON_STAT_VAOE_IN, 594*49ef7e06SGarrett D'Amore EFX_MON_STAT_IAOE, 595*49ef7e06SGarrett D'Amore EFX_MON_STAT_IAOE_IN, 596*49ef7e06SGarrett D'Amore EFX_MON_STAT_NIC_POWER, 597*49ef7e06SGarrett D'Amore EFX_MON_STAT_0_9V, 598*49ef7e06SGarrett D'Amore EFX_MON_STAT_I0_9V, 599*49ef7e06SGarrett D'Amore EFX_MON_STAT_I1_2V, 600*49ef7e06SGarrett D'Amore EFX_MON_STAT_0_9V_ADC, 601*49ef7e06SGarrett D'Amore EFX_MON_STAT_INT_TEMP2, 602*49ef7e06SGarrett D'Amore EFX_MON_STAT_VREG_TEMP, 603*49ef7e06SGarrett D'Amore EFX_MON_STAT_VREG_0_9V_TEMP, 604*49ef7e06SGarrett D'Amore EFX_MON_STAT_VREG_1_2V_TEMP, 605*49ef7e06SGarrett D'Amore EFX_MON_STAT_INT_VPTAT, 606*49ef7e06SGarrett D'Amore EFX_MON_STAT_INT_ADC_TEMP, 607*49ef7e06SGarrett D'Amore EFX_MON_STAT_EXT_VPTAT, 608*49ef7e06SGarrett D'Amore EFX_MON_STAT_EXT_ADC_TEMP, 609*49ef7e06SGarrett D'Amore EFX_MON_STAT_AMBIENT_TEMP, 610*49ef7e06SGarrett D'Amore EFX_MON_STAT_AIRFLOW, 611*49ef7e06SGarrett D'Amore EFX_MON_STAT_VDD08D_VSS08D_CSR, 612*49ef7e06SGarrett D'Amore EFX_MON_STAT_VDD08D_VSS08D_CSR_EXTADC, 613*49ef7e06SGarrett D'Amore EFX_MON_STAT_HOTPOINT_TEMP, 614*49ef7e06SGarrett D'Amore EFX_MON_STAT_PHY_POWER_SWITCH_PORT0, 615*49ef7e06SGarrett D'Amore EFX_MON_STAT_PHY_POWER_SWITCH_PORT1, 616*49ef7e06SGarrett D'Amore EFX_MON_STAT_MUM_VCC, 617*49ef7e06SGarrett D'Amore EFX_MON_STAT_0V9_A, 618*49ef7e06SGarrett D'Amore EFX_MON_STAT_I0V9_A, 619*49ef7e06SGarrett D'Amore EFX_MON_STAT_0V9_A_TEMP, 620*49ef7e06SGarrett D'Amore EFX_MON_STAT_0V9_B, 621*49ef7e06SGarrett D'Amore EFX_MON_STAT_I0V9_B, 622*49ef7e06SGarrett D'Amore EFX_MON_STAT_0V9_B_TEMP, 623*49ef7e06SGarrett D'Amore EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY, 624*49ef7e06SGarrett D'Amore EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY_EXT_ADC, 625*49ef7e06SGarrett D'Amore EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY, 626*49ef7e06SGarrett D'Amore EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY_EXT_ADC, 627*49ef7e06SGarrett D'Amore EFX_MON_STAT_CONTROLLER_MASTER_VPTAT, 628*49ef7e06SGarrett D'Amore EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP, 629*49ef7e06SGarrett D'Amore EFX_MON_STAT_CONTROLLER_MASTER_VPTAT_EXT_ADC, 630*49ef7e06SGarrett D'Amore EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP_EXT_ADC, 631*49ef7e06SGarrett D'Amore EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT, 632*49ef7e06SGarrett D'Amore EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP, 633*49ef7e06SGarrett D'Amore EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT_EXT_ADC, 634*49ef7e06SGarrett D'Amore EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP_EXT_ADC, 635*49ef7e06SGarrett D'Amore EFX_MON_STAT_SODIMM_VOUT, 636*49ef7e06SGarrett D'Amore EFX_MON_STAT_SODIMM_0_TEMP, 637*49ef7e06SGarrett D'Amore EFX_MON_STAT_SODIMM_1_TEMP, 638*49ef7e06SGarrett D'Amore EFX_MON_STAT_PHY0_VCC, 639*49ef7e06SGarrett D'Amore EFX_MON_STAT_PHY1_VCC, 640*49ef7e06SGarrett D'Amore EFX_MON_STAT_CONTROLLER_TDIODE_TEMP, 641*49ef7e06SGarrett D'Amore EFX_MON_STAT_BOARD_FRONT_TEMP, 642*49ef7e06SGarrett D'Amore EFX_MON_STAT_BOARD_BACK_TEMP, 643*49ef7e06SGarrett D'Amore EFX_MON_NSTATS 644*49ef7e06SGarrett D'Amore } efx_mon_stat_t; 645*49ef7e06SGarrett D'Amore 646*49ef7e06SGarrett D'Amore /* END MKCONFIG GENERATED MonitorHeaderStatsBlock */ 647*49ef7e06SGarrett D'Amore 648*49ef7e06SGarrett D'Amore typedef enum efx_mon_stat_state_e { 649*49ef7e06SGarrett D'Amore EFX_MON_STAT_STATE_OK = 0, 650*49ef7e06SGarrett D'Amore EFX_MON_STAT_STATE_WARNING = 1, 651*49ef7e06SGarrett D'Amore EFX_MON_STAT_STATE_FATAL = 2, 652*49ef7e06SGarrett D'Amore EFX_MON_STAT_STATE_BROKEN = 3, 653*49ef7e06SGarrett D'Amore EFX_MON_STAT_STATE_NO_READING = 4, 654*49ef7e06SGarrett D'Amore } efx_mon_stat_state_t; 655*49ef7e06SGarrett D'Amore 656*49ef7e06SGarrett D'Amore typedef struct efx_mon_stat_value_s { 657*49ef7e06SGarrett D'Amore uint16_t emsv_value; 658*49ef7e06SGarrett D'Amore uint16_t emsv_state; 659*49ef7e06SGarrett D'Amore } efx_mon_stat_value_t; 660*49ef7e06SGarrett D'Amore 661*49ef7e06SGarrett D'Amore #if EFSYS_OPT_NAMES 662*49ef7e06SGarrett D'Amore 663*49ef7e06SGarrett D'Amore extern const char * 664*49ef7e06SGarrett D'Amore efx_mon_stat_name( 665*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 666*49ef7e06SGarrett D'Amore __in efx_mon_stat_t id); 667*49ef7e06SGarrett D'Amore 668*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_NAMES */ 669*49ef7e06SGarrett D'Amore 670*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 671*49ef7e06SGarrett D'Amore efx_mon_stats_update( 672*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 673*49ef7e06SGarrett D'Amore __in efsys_mem_t *esmp, 674*49ef7e06SGarrett D'Amore __inout_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values); 675*49ef7e06SGarrett D'Amore 676*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_MON_STATS */ 677*49ef7e06SGarrett D'Amore 678*49ef7e06SGarrett D'Amore extern void 679*49ef7e06SGarrett D'Amore efx_mon_fini( 680*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 681*49ef7e06SGarrett D'Amore 682*49ef7e06SGarrett D'Amore /* PHY */ 683*49ef7e06SGarrett D'Amore 684*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 685*49ef7e06SGarrett D'Amore efx_phy_verify( 686*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 687*49ef7e06SGarrett D'Amore 688*49ef7e06SGarrett D'Amore #if EFSYS_OPT_PHY_LED_CONTROL 689*49ef7e06SGarrett D'Amore 690*49ef7e06SGarrett D'Amore typedef enum efx_phy_led_mode_e { 691*49ef7e06SGarrett D'Amore EFX_PHY_LED_DEFAULT = 0, 692*49ef7e06SGarrett D'Amore EFX_PHY_LED_OFF, 693*49ef7e06SGarrett D'Amore EFX_PHY_LED_ON, 694*49ef7e06SGarrett D'Amore EFX_PHY_LED_FLASH, 695*49ef7e06SGarrett D'Amore EFX_PHY_LED_NMODES 696*49ef7e06SGarrett D'Amore } efx_phy_led_mode_t; 697*49ef7e06SGarrett D'Amore 698*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 699*49ef7e06SGarrett D'Amore efx_phy_led_set( 700*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 701*49ef7e06SGarrett D'Amore __in efx_phy_led_mode_t mode); 702*49ef7e06SGarrett D'Amore 703*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_PHY_LED_CONTROL */ 704*49ef7e06SGarrett D'Amore 705*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 706*49ef7e06SGarrett D'Amore efx_port_init( 707*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 708*49ef7e06SGarrett D'Amore 709*49ef7e06SGarrett D'Amore #if EFSYS_OPT_LOOPBACK 710*49ef7e06SGarrett D'Amore 711*49ef7e06SGarrett D'Amore typedef enum efx_loopback_type_e { 712*49ef7e06SGarrett D'Amore EFX_LOOPBACK_OFF = 0, 713*49ef7e06SGarrett D'Amore EFX_LOOPBACK_DATA = 1, 714*49ef7e06SGarrett D'Amore EFX_LOOPBACK_GMAC = 2, 715*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XGMII = 3, 716*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XGXS = 4, 717*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XAUI = 5, 718*49ef7e06SGarrett D'Amore EFX_LOOPBACK_GMII = 6, 719*49ef7e06SGarrett D'Amore EFX_LOOPBACK_SGMII = 7, 720*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XGBR = 8, 721*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XFI = 9, 722*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XAUI_FAR = 10, 723*49ef7e06SGarrett D'Amore EFX_LOOPBACK_GMII_FAR = 11, 724*49ef7e06SGarrett D'Amore EFX_LOOPBACK_SGMII_FAR = 12, 725*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XFI_FAR = 13, 726*49ef7e06SGarrett D'Amore EFX_LOOPBACK_GPHY = 14, 727*49ef7e06SGarrett D'Amore EFX_LOOPBACK_PHY_XS = 15, 728*49ef7e06SGarrett D'Amore EFX_LOOPBACK_PCS = 16, 729*49ef7e06SGarrett D'Amore EFX_LOOPBACK_PMA_PMD = 17, 730*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XPORT = 18, 731*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XGMII_WS = 19, 732*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XAUI_WS = 20, 733*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XAUI_WS_FAR = 21, 734*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XAUI_WS_NEAR = 22, 735*49ef7e06SGarrett D'Amore EFX_LOOPBACK_GMII_WS = 23, 736*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XFI_WS = 24, 737*49ef7e06SGarrett D'Amore EFX_LOOPBACK_XFI_WS_FAR = 25, 738*49ef7e06SGarrett D'Amore EFX_LOOPBACK_PHYXS_WS = 26, 739*49ef7e06SGarrett D'Amore EFX_LOOPBACK_PMA_INT = 27, 740*49ef7e06SGarrett D'Amore EFX_LOOPBACK_SD_NEAR = 28, 741*49ef7e06SGarrett D'Amore EFX_LOOPBACK_SD_FAR = 29, 742*49ef7e06SGarrett D'Amore EFX_LOOPBACK_PMA_INT_WS = 30, 743*49ef7e06SGarrett D'Amore EFX_LOOPBACK_SD_FEP2_WS = 31, 744*49ef7e06SGarrett D'Amore EFX_LOOPBACK_SD_FEP1_5_WS = 32, 745*49ef7e06SGarrett D'Amore EFX_LOOPBACK_SD_FEP_WS = 33, 746*49ef7e06SGarrett D'Amore EFX_LOOPBACK_SD_FES_WS = 34, 747*49ef7e06SGarrett D'Amore EFX_LOOPBACK_NTYPES 748*49ef7e06SGarrett D'Amore } efx_loopback_type_t; 749*49ef7e06SGarrett D'Amore 750*49ef7e06SGarrett D'Amore typedef enum efx_loopback_kind_e { 751*49ef7e06SGarrett D'Amore EFX_LOOPBACK_KIND_OFF = 0, 752*49ef7e06SGarrett D'Amore EFX_LOOPBACK_KIND_ALL, 753*49ef7e06SGarrett D'Amore EFX_LOOPBACK_KIND_MAC, 754*49ef7e06SGarrett D'Amore EFX_LOOPBACK_KIND_PHY, 755*49ef7e06SGarrett D'Amore EFX_LOOPBACK_NKINDS 756*49ef7e06SGarrett D'Amore } efx_loopback_kind_t; 757*49ef7e06SGarrett D'Amore 758*49ef7e06SGarrett D'Amore extern void 759*49ef7e06SGarrett D'Amore efx_loopback_mask( 760*49ef7e06SGarrett D'Amore __in efx_loopback_kind_t loopback_kind, 761*49ef7e06SGarrett D'Amore __out efx_qword_t *maskp); 762*49ef7e06SGarrett D'Amore 763*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 764*49ef7e06SGarrett D'Amore efx_port_loopback_set( 765*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 766*49ef7e06SGarrett D'Amore __in efx_link_mode_t link_mode, 767*49ef7e06SGarrett D'Amore __in efx_loopback_type_t type); 768*49ef7e06SGarrett D'Amore 769*49ef7e06SGarrett D'Amore #if EFSYS_OPT_NAMES 770*49ef7e06SGarrett D'Amore 771*49ef7e06SGarrett D'Amore extern __checkReturn const char * 772*49ef7e06SGarrett D'Amore efx_loopback_type_name( 773*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 774*49ef7e06SGarrett D'Amore __in efx_loopback_type_t type); 775*49ef7e06SGarrett D'Amore 776*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_NAMES */ 777*49ef7e06SGarrett D'Amore 778*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_LOOPBACK */ 779*49ef7e06SGarrett D'Amore 780*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 781*49ef7e06SGarrett D'Amore efx_port_poll( 782*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 783*49ef7e06SGarrett D'Amore __out_opt efx_link_mode_t *link_modep); 784*49ef7e06SGarrett D'Amore 785*49ef7e06SGarrett D'Amore extern void 786*49ef7e06SGarrett D'Amore efx_port_fini( 787*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 788*49ef7e06SGarrett D'Amore 789*49ef7e06SGarrett D'Amore typedef enum efx_phy_cap_type_e { 790*49ef7e06SGarrett D'Amore EFX_PHY_CAP_INVALID = 0, 791*49ef7e06SGarrett D'Amore EFX_PHY_CAP_10HDX, 792*49ef7e06SGarrett D'Amore EFX_PHY_CAP_10FDX, 793*49ef7e06SGarrett D'Amore EFX_PHY_CAP_100HDX, 794*49ef7e06SGarrett D'Amore EFX_PHY_CAP_100FDX, 795*49ef7e06SGarrett D'Amore EFX_PHY_CAP_1000HDX, 796*49ef7e06SGarrett D'Amore EFX_PHY_CAP_1000FDX, 797*49ef7e06SGarrett D'Amore EFX_PHY_CAP_10000FDX, 798*49ef7e06SGarrett D'Amore EFX_PHY_CAP_PAUSE, 799*49ef7e06SGarrett D'Amore EFX_PHY_CAP_ASYM, 800*49ef7e06SGarrett D'Amore EFX_PHY_CAP_AN, 801*49ef7e06SGarrett D'Amore EFX_PHY_CAP_40000FDX, 802*49ef7e06SGarrett D'Amore EFX_PHY_CAP_NTYPES 803*49ef7e06SGarrett D'Amore } efx_phy_cap_type_t; 804*49ef7e06SGarrett D'Amore 805*49ef7e06SGarrett D'Amore 806*49ef7e06SGarrett D'Amore #define EFX_PHY_CAP_CURRENT 0x00000000 807*49ef7e06SGarrett D'Amore #define EFX_PHY_CAP_DEFAULT 0x00000001 808*49ef7e06SGarrett D'Amore #define EFX_PHY_CAP_PERM 0x00000002 809*49ef7e06SGarrett D'Amore 810*49ef7e06SGarrett D'Amore extern void 811*49ef7e06SGarrett D'Amore efx_phy_adv_cap_get( 812*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 813*49ef7e06SGarrett D'Amore __in uint32_t flag, 814*49ef7e06SGarrett D'Amore __out uint32_t *maskp); 815*49ef7e06SGarrett D'Amore 816*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 817*49ef7e06SGarrett D'Amore efx_phy_adv_cap_set( 818*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 819*49ef7e06SGarrett D'Amore __in uint32_t mask); 820*49ef7e06SGarrett D'Amore 821*49ef7e06SGarrett D'Amore extern void 822*49ef7e06SGarrett D'Amore efx_phy_lp_cap_get( 823*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 824*49ef7e06SGarrett D'Amore __out uint32_t *maskp); 825*49ef7e06SGarrett D'Amore 826*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 827*49ef7e06SGarrett D'Amore efx_phy_oui_get( 828*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 829*49ef7e06SGarrett D'Amore __out uint32_t *ouip); 830*49ef7e06SGarrett D'Amore 831*49ef7e06SGarrett D'Amore typedef enum efx_phy_media_type_e { 832*49ef7e06SGarrett D'Amore EFX_PHY_MEDIA_INVALID = 0, 833*49ef7e06SGarrett D'Amore EFX_PHY_MEDIA_XAUI, 834*49ef7e06SGarrett D'Amore EFX_PHY_MEDIA_CX4, 835*49ef7e06SGarrett D'Amore EFX_PHY_MEDIA_KX4, 836*49ef7e06SGarrett D'Amore EFX_PHY_MEDIA_XFP, 837*49ef7e06SGarrett D'Amore EFX_PHY_MEDIA_SFP_PLUS, 838*49ef7e06SGarrett D'Amore EFX_PHY_MEDIA_BASE_T, 839*49ef7e06SGarrett D'Amore EFX_PHY_MEDIA_QSFP_PLUS, 840*49ef7e06SGarrett D'Amore EFX_PHY_MEDIA_NTYPES 841*49ef7e06SGarrett D'Amore } efx_phy_media_type_t; 842*49ef7e06SGarrett D'Amore 843*49ef7e06SGarrett D'Amore /* Get the type of medium currently used. If the board has ports for 844*49ef7e06SGarrett D'Amore * modules, a module is present, and we recognise the media type of 845*49ef7e06SGarrett D'Amore * the module, then this will be the media type of the module. 846*49ef7e06SGarrett D'Amore * Otherwise it will be the media type of the port. 847*49ef7e06SGarrett D'Amore */ 848*49ef7e06SGarrett D'Amore extern void 849*49ef7e06SGarrett D'Amore efx_phy_media_type_get( 850*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 851*49ef7e06SGarrett D'Amore __out efx_phy_media_type_t *typep); 852*49ef7e06SGarrett D'Amore 853*49ef7e06SGarrett D'Amore extern efx_rc_t 854*49ef7e06SGarrett D'Amore efx_phy_module_get_info( 855*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 856*49ef7e06SGarrett D'Amore __in uint8_t dev_addr, 857*49ef7e06SGarrett D'Amore __in uint8_t offset, 858*49ef7e06SGarrett D'Amore __in uint8_t len, 859*49ef7e06SGarrett D'Amore __out_bcount(len) uint8_t *data); 860*49ef7e06SGarrett D'Amore 861*49ef7e06SGarrett D'Amore #if EFSYS_OPT_PHY_STATS 862*49ef7e06SGarrett D'Amore 863*49ef7e06SGarrett D'Amore /* START MKCONFIG GENERATED PhyHeaderStatsBlock 30ed56ad501f8e36 */ 864*49ef7e06SGarrett D'Amore typedef enum efx_phy_stat_e { 865*49ef7e06SGarrett D'Amore EFX_PHY_STAT_OUI, 866*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_LINK_UP, 867*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_RX_FAULT, 868*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_TX_FAULT, 869*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_REV_A, 870*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_REV_B, 871*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_REV_C, 872*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_REV_D, 873*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PCS_LINK_UP, 874*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PCS_RX_FAULT, 875*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PCS_TX_FAULT, 876*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PCS_BER, 877*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PCS_BLOCK_ERRORS, 878*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PHY_XS_LINK_UP, 879*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PHY_XS_RX_FAULT, 880*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PHY_XS_TX_FAULT, 881*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PHY_XS_ALIGN, 882*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PHY_XS_SYNC_A, 883*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PHY_XS_SYNC_B, 884*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PHY_XS_SYNC_C, 885*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PHY_XS_SYNC_D, 886*49ef7e06SGarrett D'Amore EFX_PHY_STAT_AN_LINK_UP, 887*49ef7e06SGarrett D'Amore EFX_PHY_STAT_AN_MASTER, 888*49ef7e06SGarrett D'Amore EFX_PHY_STAT_AN_LOCAL_RX_OK, 889*49ef7e06SGarrett D'Amore EFX_PHY_STAT_AN_REMOTE_RX_OK, 890*49ef7e06SGarrett D'Amore EFX_PHY_STAT_CL22EXT_LINK_UP, 891*49ef7e06SGarrett D'Amore EFX_PHY_STAT_SNR_A, 892*49ef7e06SGarrett D'Amore EFX_PHY_STAT_SNR_B, 893*49ef7e06SGarrett D'Amore EFX_PHY_STAT_SNR_C, 894*49ef7e06SGarrett D'Amore EFX_PHY_STAT_SNR_D, 895*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_SIGNAL_A, 896*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_SIGNAL_B, 897*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_SIGNAL_C, 898*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_SIGNAL_D, 899*49ef7e06SGarrett D'Amore EFX_PHY_STAT_AN_COMPLETE, 900*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_REV_MAJOR, 901*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_REV_MINOR, 902*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PMA_PMD_REV_MICRO, 903*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PCS_FW_VERSION_0, 904*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PCS_FW_VERSION_1, 905*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PCS_FW_VERSION_2, 906*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PCS_FW_VERSION_3, 907*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PCS_FW_BUILD_YY, 908*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PCS_FW_BUILD_MM, 909*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PCS_FW_BUILD_DD, 910*49ef7e06SGarrett D'Amore EFX_PHY_STAT_PCS_OP_MODE, 911*49ef7e06SGarrett D'Amore EFX_PHY_NSTATS 912*49ef7e06SGarrett D'Amore } efx_phy_stat_t; 913*49ef7e06SGarrett D'Amore 914*49ef7e06SGarrett D'Amore /* END MKCONFIG GENERATED PhyHeaderStatsBlock */ 915*49ef7e06SGarrett D'Amore 916*49ef7e06SGarrett D'Amore #if EFSYS_OPT_NAMES 917*49ef7e06SGarrett D'Amore 918*49ef7e06SGarrett D'Amore extern const char * 919*49ef7e06SGarrett D'Amore efx_phy_stat_name( 920*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 921*49ef7e06SGarrett D'Amore __in efx_phy_stat_t stat); 922*49ef7e06SGarrett D'Amore 923*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_NAMES */ 924*49ef7e06SGarrett D'Amore 925*49ef7e06SGarrett D'Amore #define EFX_PHY_STATS_SIZE 0x100 926*49ef7e06SGarrett D'Amore 927*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 928*49ef7e06SGarrett D'Amore efx_phy_stats_update( 929*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 930*49ef7e06SGarrett D'Amore __in efsys_mem_t *esmp, 931*49ef7e06SGarrett D'Amore __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat); 932*49ef7e06SGarrett D'Amore 933*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_PHY_STATS */ 934*49ef7e06SGarrett D'Amore 935*49ef7e06SGarrett D'Amore 936*49ef7e06SGarrett D'Amore #if EFSYS_OPT_BIST 937*49ef7e06SGarrett D'Amore 938*49ef7e06SGarrett D'Amore typedef enum efx_bist_type_e { 939*49ef7e06SGarrett D'Amore EFX_BIST_TYPE_UNKNOWN, 940*49ef7e06SGarrett D'Amore EFX_BIST_TYPE_PHY_NORMAL, 941*49ef7e06SGarrett D'Amore EFX_BIST_TYPE_PHY_CABLE_SHORT, 942*49ef7e06SGarrett D'Amore EFX_BIST_TYPE_PHY_CABLE_LONG, 943*49ef7e06SGarrett D'Amore EFX_BIST_TYPE_MC_MEM, /* Test the MC DMEM and IMEM */ 944*49ef7e06SGarrett D'Amore EFX_BIST_TYPE_SAT_MEM, /* Test the DMEM and IMEM of satellite cpus*/ 945*49ef7e06SGarrett D'Amore EFX_BIST_TYPE_REG, /* Test the register memories */ 946*49ef7e06SGarrett D'Amore EFX_BIST_TYPE_NTYPES, 947*49ef7e06SGarrett D'Amore } efx_bist_type_t; 948*49ef7e06SGarrett D'Amore 949*49ef7e06SGarrett D'Amore typedef enum efx_bist_result_e { 950*49ef7e06SGarrett D'Amore EFX_BIST_RESULT_UNKNOWN, 951*49ef7e06SGarrett D'Amore EFX_BIST_RESULT_RUNNING, 952*49ef7e06SGarrett D'Amore EFX_BIST_RESULT_PASSED, 953*49ef7e06SGarrett D'Amore EFX_BIST_RESULT_FAILED, 954*49ef7e06SGarrett D'Amore } efx_bist_result_t; 955*49ef7e06SGarrett D'Amore 956*49ef7e06SGarrett D'Amore typedef enum efx_phy_cable_status_e { 957*49ef7e06SGarrett D'Amore EFX_PHY_CABLE_STATUS_OK, 958*49ef7e06SGarrett D'Amore EFX_PHY_CABLE_STATUS_INVALID, 959*49ef7e06SGarrett D'Amore EFX_PHY_CABLE_STATUS_OPEN, 960*49ef7e06SGarrett D'Amore EFX_PHY_CABLE_STATUS_INTRAPAIRSHORT, 961*49ef7e06SGarrett D'Amore EFX_PHY_CABLE_STATUS_INTERPAIRSHORT, 962*49ef7e06SGarrett D'Amore EFX_PHY_CABLE_STATUS_BUSY, 963*49ef7e06SGarrett D'Amore } efx_phy_cable_status_t; 964*49ef7e06SGarrett D'Amore 965*49ef7e06SGarrett D'Amore typedef enum efx_bist_value_e { 966*49ef7e06SGarrett D'Amore EFX_BIST_PHY_CABLE_LENGTH_A, 967*49ef7e06SGarrett D'Amore EFX_BIST_PHY_CABLE_LENGTH_B, 968*49ef7e06SGarrett D'Amore EFX_BIST_PHY_CABLE_LENGTH_C, 969*49ef7e06SGarrett D'Amore EFX_BIST_PHY_CABLE_LENGTH_D, 970*49ef7e06SGarrett D'Amore EFX_BIST_PHY_CABLE_STATUS_A, 971*49ef7e06SGarrett D'Amore EFX_BIST_PHY_CABLE_STATUS_B, 972*49ef7e06SGarrett D'Amore EFX_BIST_PHY_CABLE_STATUS_C, 973*49ef7e06SGarrett D'Amore EFX_BIST_PHY_CABLE_STATUS_D, 974*49ef7e06SGarrett D'Amore EFX_BIST_FAULT_CODE, 975*49ef7e06SGarrett D'Amore /* Memory BIST specific values. These match to the MC_CMD_BIST_POLL 976*49ef7e06SGarrett D'Amore * response. */ 977*49ef7e06SGarrett D'Amore EFX_BIST_MEM_TEST, 978*49ef7e06SGarrett D'Amore EFX_BIST_MEM_ADDR, 979*49ef7e06SGarrett D'Amore EFX_BIST_MEM_BUS, 980*49ef7e06SGarrett D'Amore EFX_BIST_MEM_EXPECT, 981*49ef7e06SGarrett D'Amore EFX_BIST_MEM_ACTUAL, 982*49ef7e06SGarrett D'Amore EFX_BIST_MEM_ECC, 983*49ef7e06SGarrett D'Amore EFX_BIST_MEM_ECC_PARITY, 984*49ef7e06SGarrett D'Amore EFX_BIST_MEM_ECC_FATAL, 985*49ef7e06SGarrett D'Amore EFX_BIST_NVALUES, 986*49ef7e06SGarrett D'Amore } efx_bist_value_t; 987*49ef7e06SGarrett D'Amore 988*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 989*49ef7e06SGarrett D'Amore efx_bist_enable_offline( 990*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 991*49ef7e06SGarrett D'Amore 992*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 993*49ef7e06SGarrett D'Amore efx_bist_start( 994*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 995*49ef7e06SGarrett D'Amore __in efx_bist_type_t type); 996*49ef7e06SGarrett D'Amore 997*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 998*49ef7e06SGarrett D'Amore efx_bist_poll( 999*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1000*49ef7e06SGarrett D'Amore __in efx_bist_type_t type, 1001*49ef7e06SGarrett D'Amore __out efx_bist_result_t *resultp, 1002*49ef7e06SGarrett D'Amore __out_opt uint32_t *value_maskp, 1003*49ef7e06SGarrett D'Amore __out_ecount_opt(count) unsigned long *valuesp, 1004*49ef7e06SGarrett D'Amore __in size_t count); 1005*49ef7e06SGarrett D'Amore 1006*49ef7e06SGarrett D'Amore extern void 1007*49ef7e06SGarrett D'Amore efx_bist_stop( 1008*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1009*49ef7e06SGarrett D'Amore __in efx_bist_type_t type); 1010*49ef7e06SGarrett D'Amore 1011*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_BIST */ 1012*49ef7e06SGarrett D'Amore 1013*49ef7e06SGarrett D'Amore #define EFX_FEATURE_IPV6 0x00000001 1014*49ef7e06SGarrett D'Amore #define EFX_FEATURE_LFSR_HASH_INSERT 0x00000002 1015*49ef7e06SGarrett D'Amore #define EFX_FEATURE_LINK_EVENTS 0x00000004 1016*49ef7e06SGarrett D'Amore #define EFX_FEATURE_PERIODIC_MAC_STATS 0x00000008 1017*49ef7e06SGarrett D'Amore #define EFX_FEATURE_WOL 0x00000010 1018*49ef7e06SGarrett D'Amore #define EFX_FEATURE_MCDI 0x00000020 1019*49ef7e06SGarrett D'Amore #define EFX_FEATURE_LOOKAHEAD_SPLIT 0x00000040 1020*49ef7e06SGarrett D'Amore #define EFX_FEATURE_MAC_HEADER_FILTERS 0x00000080 1021*49ef7e06SGarrett D'Amore #define EFX_FEATURE_TURBO 0x00000100 1022*49ef7e06SGarrett D'Amore #define EFX_FEATURE_MCDI_DMA 0x00000200 1023*49ef7e06SGarrett D'Amore #define EFX_FEATURE_TX_SRC_FILTERS 0x00000400 1024*49ef7e06SGarrett D'Amore #define EFX_FEATURE_PIO_BUFFERS 0x00000800 1025*49ef7e06SGarrett D'Amore #define EFX_FEATURE_FW_ASSISTED_TSO 0x00001000 1026*49ef7e06SGarrett D'Amore #define EFX_FEATURE_FW_ASSISTED_TSO_V2 0x00002000 1027*49ef7e06SGarrett D'Amore 1028*49ef7e06SGarrett D'Amore typedef struct efx_nic_cfg_s { 1029*49ef7e06SGarrett D'Amore uint32_t enc_board_type; 1030*49ef7e06SGarrett D'Amore uint32_t enc_phy_type; 1031*49ef7e06SGarrett D'Amore #if EFSYS_OPT_NAMES 1032*49ef7e06SGarrett D'Amore char enc_phy_name[21]; 1033*49ef7e06SGarrett D'Amore #endif 1034*49ef7e06SGarrett D'Amore char enc_phy_revision[21]; 1035*49ef7e06SGarrett D'Amore efx_mon_type_t enc_mon_type; 1036*49ef7e06SGarrett D'Amore #if EFSYS_OPT_MON_STATS 1037*49ef7e06SGarrett D'Amore uint32_t enc_mon_stat_dma_buf_size; 1038*49ef7e06SGarrett D'Amore uint32_t enc_mon_stat_mask[(EFX_MON_NSTATS + 31) / 32]; 1039*49ef7e06SGarrett D'Amore #endif 1040*49ef7e06SGarrett D'Amore unsigned int enc_features; 1041*49ef7e06SGarrett D'Amore uint8_t enc_mac_addr[6]; 1042*49ef7e06SGarrett D'Amore uint8_t enc_port; /* PHY port number */ 1043*49ef7e06SGarrett D'Amore uint32_t enc_func_flags; 1044*49ef7e06SGarrett D'Amore uint32_t enc_intr_vec_base; 1045*49ef7e06SGarrett D'Amore uint32_t enc_intr_limit; 1046*49ef7e06SGarrett D'Amore uint32_t enc_evq_limit; 1047*49ef7e06SGarrett D'Amore uint32_t enc_txq_limit; 1048*49ef7e06SGarrett D'Amore uint32_t enc_rxq_limit; 1049*49ef7e06SGarrett D'Amore uint32_t enc_buftbl_limit; 1050*49ef7e06SGarrett D'Amore uint32_t enc_piobuf_limit; 1051*49ef7e06SGarrett D'Amore uint32_t enc_piobuf_size; 1052*49ef7e06SGarrett D'Amore uint32_t enc_piobuf_min_alloc_size; 1053*49ef7e06SGarrett D'Amore uint32_t enc_evq_timer_quantum_ns; 1054*49ef7e06SGarrett D'Amore uint32_t enc_evq_timer_max_us; 1055*49ef7e06SGarrett D'Amore uint32_t enc_clk_mult; 1056*49ef7e06SGarrett D'Amore uint32_t enc_rx_prefix_size; 1057*49ef7e06SGarrett D'Amore uint32_t enc_rx_buf_align_start; 1058*49ef7e06SGarrett D'Amore uint32_t enc_rx_buf_align_end; 1059*49ef7e06SGarrett D'Amore #if EFSYS_OPT_LOOPBACK 1060*49ef7e06SGarrett D'Amore efx_qword_t enc_loopback_types[EFX_LINK_NMODES]; 1061*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_LOOPBACK */ 1062*49ef7e06SGarrett D'Amore #if EFSYS_OPT_PHY_FLAGS 1063*49ef7e06SGarrett D'Amore uint32_t enc_phy_flags_mask; 1064*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_PHY_FLAGS */ 1065*49ef7e06SGarrett D'Amore #if EFSYS_OPT_PHY_LED_CONTROL 1066*49ef7e06SGarrett D'Amore uint32_t enc_led_mask; 1067*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_PHY_LED_CONTROL */ 1068*49ef7e06SGarrett D'Amore #if EFSYS_OPT_PHY_STATS 1069*49ef7e06SGarrett D'Amore uint64_t enc_phy_stat_mask; 1070*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_PHY_STATS */ 1071*49ef7e06SGarrett D'Amore #if EFSYS_OPT_SIENA 1072*49ef7e06SGarrett D'Amore uint8_t enc_mcdi_mdio_channel; 1073*49ef7e06SGarrett D'Amore #if EFSYS_OPT_PHY_STATS 1074*49ef7e06SGarrett D'Amore uint32_t enc_mcdi_phy_stat_mask; 1075*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_PHY_STATS */ 1076*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_SIENA */ 1077*49ef7e06SGarrett D'Amore #if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) 1078*49ef7e06SGarrett D'Amore #if EFSYS_OPT_MON_STATS 1079*49ef7e06SGarrett D'Amore uint32_t *enc_mcdi_sensor_maskp; 1080*49ef7e06SGarrett D'Amore uint32_t enc_mcdi_sensor_mask_size; 1081*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_MON_STATS */ 1082*49ef7e06SGarrett D'Amore #endif /* (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */ 1083*49ef7e06SGarrett D'Amore #if EFSYS_OPT_BIST 1084*49ef7e06SGarrett D'Amore uint32_t enc_bist_mask; 1085*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_BIST */ 1086*49ef7e06SGarrett D'Amore #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD 1087*49ef7e06SGarrett D'Amore uint32_t enc_pf; 1088*49ef7e06SGarrett D'Amore uint32_t enc_vf; 1089*49ef7e06SGarrett D'Amore uint32_t enc_privilege_mask; 1090*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ 1091*49ef7e06SGarrett D'Amore boolean_t enc_bug26807_workaround; 1092*49ef7e06SGarrett D'Amore boolean_t enc_bug35388_workaround; 1093*49ef7e06SGarrett D'Amore boolean_t enc_bug41750_workaround; 1094*49ef7e06SGarrett D'Amore boolean_t enc_rx_batching_enabled; 1095*49ef7e06SGarrett D'Amore /* Maximum number of descriptors completed in an rx event. */ 1096*49ef7e06SGarrett D'Amore uint32_t enc_rx_batch_max; 1097*49ef7e06SGarrett D'Amore /* Number of rx descriptors the hardware requires for a push. */ 1098*49ef7e06SGarrett D'Amore uint32_t enc_rx_push_align; 1099*49ef7e06SGarrett D'Amore /* 1100*49ef7e06SGarrett D'Amore * Maximum number of bytes into the packet the TCP header can start for 1101*49ef7e06SGarrett D'Amore * the hardware to apply TSO packet edits. 1102*49ef7e06SGarrett D'Amore */ 1103*49ef7e06SGarrett D'Amore uint32_t enc_tx_tso_tcp_header_offset_limit; 1104*49ef7e06SGarrett D'Amore boolean_t enc_fw_assisted_tso_enabled; 1105*49ef7e06SGarrett D'Amore boolean_t enc_fw_assisted_tso_v2_enabled; 1106*49ef7e06SGarrett D'Amore boolean_t enc_hw_tx_insert_vlan_enabled; 1107*49ef7e06SGarrett D'Amore /* Datapath firmware vadapter/vport/vswitch support */ 1108*49ef7e06SGarrett D'Amore boolean_t enc_datapath_cap_evb; 1109*49ef7e06SGarrett D'Amore boolean_t enc_rx_disable_scatter_supported; 1110*49ef7e06SGarrett D'Amore boolean_t enc_allow_set_mac_with_installed_filters; 1111*49ef7e06SGarrett D'Amore boolean_t enc_enhanced_set_mac_supported; 1112*49ef7e06SGarrett D'Amore /* External port identifier */ 1113*49ef7e06SGarrett D'Amore uint8_t enc_external_port; 1114*49ef7e06SGarrett D'Amore uint32_t enc_mcdi_max_payload_length; 1115*49ef7e06SGarrett D'Amore /* VPD may be per-PF or global */ 1116*49ef7e06SGarrett D'Amore boolean_t enc_vpd_is_global; 1117*49ef7e06SGarrett D'Amore } efx_nic_cfg_t; 1118*49ef7e06SGarrett D'Amore 1119*49ef7e06SGarrett D'Amore #define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff) 1120*49ef7e06SGarrett D'Amore #define EFX_PCI_FUNCTION_IS_VF(_encp) ((_encp)->enc_vf != 0xffff) 1121*49ef7e06SGarrett D'Amore 1122*49ef7e06SGarrett D'Amore #define EFX_PCI_FUNCTION(_encp) \ 1123*49ef7e06SGarrett D'Amore (EFX_PCI_FUNCTION_IS_PF(_encp) ? (_encp)->enc_pf : (_encp)->enc_vf) 1124*49ef7e06SGarrett D'Amore 1125*49ef7e06SGarrett D'Amore #define EFX_PCI_VF_PARENT(_encp) ((_encp)->enc_pf) 1126*49ef7e06SGarrett D'Amore 1127*49ef7e06SGarrett D'Amore extern const efx_nic_cfg_t * 1128*49ef7e06SGarrett D'Amore efx_nic_cfg_get( 1129*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1130*49ef7e06SGarrett D'Amore 1131*49ef7e06SGarrett D'Amore /* Driver resource limits (minimum required/maximum usable). */ 1132*49ef7e06SGarrett D'Amore typedef struct efx_drv_limits_s 1133*49ef7e06SGarrett D'Amore { 1134*49ef7e06SGarrett D'Amore uint32_t edl_min_evq_count; 1135*49ef7e06SGarrett D'Amore uint32_t edl_max_evq_count; 1136*49ef7e06SGarrett D'Amore 1137*49ef7e06SGarrett D'Amore uint32_t edl_min_rxq_count; 1138*49ef7e06SGarrett D'Amore uint32_t edl_max_rxq_count; 1139*49ef7e06SGarrett D'Amore 1140*49ef7e06SGarrett D'Amore uint32_t edl_min_txq_count; 1141*49ef7e06SGarrett D'Amore uint32_t edl_max_txq_count; 1142*49ef7e06SGarrett D'Amore 1143*49ef7e06SGarrett D'Amore /* PIO blocks (sub-allocated from piobuf) */ 1144*49ef7e06SGarrett D'Amore uint32_t edl_min_pio_alloc_size; 1145*49ef7e06SGarrett D'Amore uint32_t edl_max_pio_alloc_count; 1146*49ef7e06SGarrett D'Amore } efx_drv_limits_t; 1147*49ef7e06SGarrett D'Amore 1148*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1149*49ef7e06SGarrett D'Amore efx_nic_set_drv_limits( 1150*49ef7e06SGarrett D'Amore __inout efx_nic_t *enp, 1151*49ef7e06SGarrett D'Amore __in efx_drv_limits_t *edlp); 1152*49ef7e06SGarrett D'Amore 1153*49ef7e06SGarrett D'Amore typedef enum efx_nic_region_e { 1154*49ef7e06SGarrett D'Amore EFX_REGION_VI, /* Memory BAR UC mapping */ 1155*49ef7e06SGarrett D'Amore EFX_REGION_PIO_WRITE_VI, /* Memory BAR WC mapping */ 1156*49ef7e06SGarrett D'Amore } efx_nic_region_t; 1157*49ef7e06SGarrett D'Amore 1158*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1159*49ef7e06SGarrett D'Amore efx_nic_get_bar_region( 1160*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1161*49ef7e06SGarrett D'Amore __in efx_nic_region_t region, 1162*49ef7e06SGarrett D'Amore __out uint32_t *offsetp, 1163*49ef7e06SGarrett D'Amore __out size_t *sizep); 1164*49ef7e06SGarrett D'Amore 1165*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1166*49ef7e06SGarrett D'Amore efx_nic_get_vi_pool( 1167*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1168*49ef7e06SGarrett D'Amore __out uint32_t *evq_countp, 1169*49ef7e06SGarrett D'Amore __out uint32_t *rxq_countp, 1170*49ef7e06SGarrett D'Amore __out uint32_t *txq_countp); 1171*49ef7e06SGarrett D'Amore 1172*49ef7e06SGarrett D'Amore 1173*49ef7e06SGarrett D'Amore #if EFSYS_OPT_VPD 1174*49ef7e06SGarrett D'Amore 1175*49ef7e06SGarrett D'Amore typedef enum efx_vpd_tag_e { 1176*49ef7e06SGarrett D'Amore EFX_VPD_ID = 0x02, 1177*49ef7e06SGarrett D'Amore EFX_VPD_END = 0x0f, 1178*49ef7e06SGarrett D'Amore EFX_VPD_RO = 0x10, 1179*49ef7e06SGarrett D'Amore EFX_VPD_RW = 0x11, 1180*49ef7e06SGarrett D'Amore } efx_vpd_tag_t; 1181*49ef7e06SGarrett D'Amore 1182*49ef7e06SGarrett D'Amore typedef uint16_t efx_vpd_keyword_t; 1183*49ef7e06SGarrett D'Amore 1184*49ef7e06SGarrett D'Amore typedef struct efx_vpd_value_s { 1185*49ef7e06SGarrett D'Amore efx_vpd_tag_t evv_tag; 1186*49ef7e06SGarrett D'Amore efx_vpd_keyword_t evv_keyword; 1187*49ef7e06SGarrett D'Amore uint8_t evv_length; 1188*49ef7e06SGarrett D'Amore uint8_t evv_value[0x100]; 1189*49ef7e06SGarrett D'Amore } efx_vpd_value_t; 1190*49ef7e06SGarrett D'Amore 1191*49ef7e06SGarrett D'Amore 1192*49ef7e06SGarrett D'Amore #define EFX_VPD_KEYWORD(x, y) ((x) | ((y) << 8)) 1193*49ef7e06SGarrett D'Amore 1194*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1195*49ef7e06SGarrett D'Amore efx_vpd_init( 1196*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1197*49ef7e06SGarrett D'Amore 1198*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1199*49ef7e06SGarrett D'Amore efx_vpd_size( 1200*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1201*49ef7e06SGarrett D'Amore __out size_t *sizep); 1202*49ef7e06SGarrett D'Amore 1203*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1204*49ef7e06SGarrett D'Amore efx_vpd_read( 1205*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1206*49ef7e06SGarrett D'Amore __out_bcount(size) caddr_t data, 1207*49ef7e06SGarrett D'Amore __in size_t size); 1208*49ef7e06SGarrett D'Amore 1209*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1210*49ef7e06SGarrett D'Amore efx_vpd_verify( 1211*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1212*49ef7e06SGarrett D'Amore __in_bcount(size) caddr_t data, 1213*49ef7e06SGarrett D'Amore __in size_t size); 1214*49ef7e06SGarrett D'Amore 1215*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1216*49ef7e06SGarrett D'Amore efx_vpd_reinit( 1217*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1218*49ef7e06SGarrett D'Amore __in_bcount(size) caddr_t data, 1219*49ef7e06SGarrett D'Amore __in size_t size); 1220*49ef7e06SGarrett D'Amore 1221*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1222*49ef7e06SGarrett D'Amore efx_vpd_get( 1223*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1224*49ef7e06SGarrett D'Amore __in_bcount(size) caddr_t data, 1225*49ef7e06SGarrett D'Amore __in size_t size, 1226*49ef7e06SGarrett D'Amore __inout efx_vpd_value_t *evvp); 1227*49ef7e06SGarrett D'Amore 1228*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1229*49ef7e06SGarrett D'Amore efx_vpd_set( 1230*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1231*49ef7e06SGarrett D'Amore __inout_bcount(size) caddr_t data, 1232*49ef7e06SGarrett D'Amore __in size_t size, 1233*49ef7e06SGarrett D'Amore __in efx_vpd_value_t *evvp); 1234*49ef7e06SGarrett D'Amore 1235*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1236*49ef7e06SGarrett D'Amore efx_vpd_next( 1237*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1238*49ef7e06SGarrett D'Amore __inout_bcount(size) caddr_t data, 1239*49ef7e06SGarrett D'Amore __in size_t size, 1240*49ef7e06SGarrett D'Amore __out efx_vpd_value_t *evvp, 1241*49ef7e06SGarrett D'Amore __inout unsigned int *contp); 1242*49ef7e06SGarrett D'Amore 1243*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1244*49ef7e06SGarrett D'Amore efx_vpd_write( 1245*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1246*49ef7e06SGarrett D'Amore __in_bcount(size) caddr_t data, 1247*49ef7e06SGarrett D'Amore __in size_t size); 1248*49ef7e06SGarrett D'Amore 1249*49ef7e06SGarrett D'Amore extern void 1250*49ef7e06SGarrett D'Amore efx_vpd_fini( 1251*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1252*49ef7e06SGarrett D'Amore 1253*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_VPD */ 1254*49ef7e06SGarrett D'Amore 1255*49ef7e06SGarrett D'Amore /* NVRAM */ 1256*49ef7e06SGarrett D'Amore 1257*49ef7e06SGarrett D'Amore #if EFSYS_OPT_NVRAM 1258*49ef7e06SGarrett D'Amore 1259*49ef7e06SGarrett D'Amore typedef enum efx_nvram_type_e { 1260*49ef7e06SGarrett D'Amore EFX_NVRAM_INVALID = 0, 1261*49ef7e06SGarrett D'Amore EFX_NVRAM_BOOTROM, 1262*49ef7e06SGarrett D'Amore EFX_NVRAM_BOOTROM_CFG, 1263*49ef7e06SGarrett D'Amore EFX_NVRAM_MC_FIRMWARE, 1264*49ef7e06SGarrett D'Amore EFX_NVRAM_MC_GOLDEN, 1265*49ef7e06SGarrett D'Amore EFX_NVRAM_PHY, 1266*49ef7e06SGarrett D'Amore EFX_NVRAM_NULLPHY, 1267*49ef7e06SGarrett D'Amore EFX_NVRAM_FPGA, 1268*49ef7e06SGarrett D'Amore EFX_NVRAM_FCFW, 1269*49ef7e06SGarrett D'Amore EFX_NVRAM_CPLD, 1270*49ef7e06SGarrett D'Amore EFX_NVRAM_FPGA_BACKUP, 1271*49ef7e06SGarrett D'Amore EFX_NVRAM_DYNAMIC_CFG, 1272*49ef7e06SGarrett D'Amore EFX_NVRAM_LICENSE, 1273*49ef7e06SGarrett D'Amore EFX_NVRAM_NTYPES, 1274*49ef7e06SGarrett D'Amore } efx_nvram_type_t; 1275*49ef7e06SGarrett D'Amore 1276*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1277*49ef7e06SGarrett D'Amore efx_nvram_init( 1278*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1279*49ef7e06SGarrett D'Amore 1280*49ef7e06SGarrett D'Amore #if EFSYS_OPT_DIAG 1281*49ef7e06SGarrett D'Amore 1282*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1283*49ef7e06SGarrett D'Amore efx_nvram_test( 1284*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1285*49ef7e06SGarrett D'Amore 1286*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_DIAG */ 1287*49ef7e06SGarrett D'Amore 1288*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1289*49ef7e06SGarrett D'Amore efx_nvram_size( 1290*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1291*49ef7e06SGarrett D'Amore __in efx_nvram_type_t type, 1292*49ef7e06SGarrett D'Amore __out size_t *sizep); 1293*49ef7e06SGarrett D'Amore 1294*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1295*49ef7e06SGarrett D'Amore efx_nvram_rw_start( 1296*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1297*49ef7e06SGarrett D'Amore __in efx_nvram_type_t type, 1298*49ef7e06SGarrett D'Amore __out_opt size_t *pref_chunkp); 1299*49ef7e06SGarrett D'Amore 1300*49ef7e06SGarrett D'Amore extern void 1301*49ef7e06SGarrett D'Amore efx_nvram_rw_finish( 1302*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1303*49ef7e06SGarrett D'Amore __in efx_nvram_type_t type); 1304*49ef7e06SGarrett D'Amore 1305*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1306*49ef7e06SGarrett D'Amore efx_nvram_get_version( 1307*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1308*49ef7e06SGarrett D'Amore __in efx_nvram_type_t type, 1309*49ef7e06SGarrett D'Amore __out uint32_t *subtypep, 1310*49ef7e06SGarrett D'Amore __out_ecount(4) uint16_t version[4]); 1311*49ef7e06SGarrett D'Amore 1312*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1313*49ef7e06SGarrett D'Amore efx_nvram_read_chunk( 1314*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1315*49ef7e06SGarrett D'Amore __in efx_nvram_type_t type, 1316*49ef7e06SGarrett D'Amore __in unsigned int offset, 1317*49ef7e06SGarrett D'Amore __out_bcount(size) caddr_t data, 1318*49ef7e06SGarrett D'Amore __in size_t size); 1319*49ef7e06SGarrett D'Amore 1320*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1321*49ef7e06SGarrett D'Amore efx_nvram_set_version( 1322*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1323*49ef7e06SGarrett D'Amore __in efx_nvram_type_t type, 1324*49ef7e06SGarrett D'Amore __in_ecount(4) uint16_t version[4]); 1325*49ef7e06SGarrett D'Amore 1326*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1327*49ef7e06SGarrett D'Amore efx_nvram_validate( 1328*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1329*49ef7e06SGarrett D'Amore __in efx_nvram_type_t type, 1330*49ef7e06SGarrett D'Amore __in_bcount(partn_size) caddr_t partn_data, 1331*49ef7e06SGarrett D'Amore __in size_t partn_size); 1332*49ef7e06SGarrett D'Amore 1333*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1334*49ef7e06SGarrett D'Amore efx_nvram_erase( 1335*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1336*49ef7e06SGarrett D'Amore __in efx_nvram_type_t type); 1337*49ef7e06SGarrett D'Amore 1338*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1339*49ef7e06SGarrett D'Amore efx_nvram_write_chunk( 1340*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1341*49ef7e06SGarrett D'Amore __in efx_nvram_type_t type, 1342*49ef7e06SGarrett D'Amore __in unsigned int offset, 1343*49ef7e06SGarrett D'Amore __in_bcount(size) caddr_t data, 1344*49ef7e06SGarrett D'Amore __in size_t size); 1345*49ef7e06SGarrett D'Amore 1346*49ef7e06SGarrett D'Amore extern void 1347*49ef7e06SGarrett D'Amore efx_nvram_fini( 1348*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1349*49ef7e06SGarrett D'Amore 1350*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_NVRAM */ 1351*49ef7e06SGarrett D'Amore 1352*49ef7e06SGarrett D'Amore #if EFSYS_OPT_BOOTCFG 1353*49ef7e06SGarrett D'Amore 1354*49ef7e06SGarrett D'Amore extern efx_rc_t 1355*49ef7e06SGarrett D'Amore efx_bootcfg_read( 1356*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1357*49ef7e06SGarrett D'Amore __out_bcount(size) caddr_t data, 1358*49ef7e06SGarrett D'Amore __in size_t size); 1359*49ef7e06SGarrett D'Amore 1360*49ef7e06SGarrett D'Amore extern efx_rc_t 1361*49ef7e06SGarrett D'Amore efx_bootcfg_write( 1362*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1363*49ef7e06SGarrett D'Amore __in_bcount(size) caddr_t data, 1364*49ef7e06SGarrett D'Amore __in size_t size); 1365*49ef7e06SGarrett D'Amore 1366*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_BOOTCFG */ 1367*49ef7e06SGarrett D'Amore 1368*49ef7e06SGarrett D'Amore #if EFSYS_OPT_WOL 1369*49ef7e06SGarrett D'Amore 1370*49ef7e06SGarrett D'Amore typedef enum efx_wol_type_e { 1371*49ef7e06SGarrett D'Amore EFX_WOL_TYPE_INVALID, 1372*49ef7e06SGarrett D'Amore EFX_WOL_TYPE_MAGIC, 1373*49ef7e06SGarrett D'Amore EFX_WOL_TYPE_BITMAP, 1374*49ef7e06SGarrett D'Amore EFX_WOL_TYPE_LINK, 1375*49ef7e06SGarrett D'Amore EFX_WOL_NTYPES, 1376*49ef7e06SGarrett D'Amore } efx_wol_type_t; 1377*49ef7e06SGarrett D'Amore 1378*49ef7e06SGarrett D'Amore typedef enum efx_lightsout_offload_type_e { 1379*49ef7e06SGarrett D'Amore EFX_LIGHTSOUT_OFFLOAD_TYPE_INVALID, 1380*49ef7e06SGarrett D'Amore EFX_LIGHTSOUT_OFFLOAD_TYPE_ARP, 1381*49ef7e06SGarrett D'Amore EFX_LIGHTSOUT_OFFLOAD_TYPE_NS, 1382*49ef7e06SGarrett D'Amore } efx_lightsout_offload_type_t; 1383*49ef7e06SGarrett D'Amore 1384*49ef7e06SGarrett D'Amore #define EFX_WOL_BITMAP_MASK_SIZE (48) 1385*49ef7e06SGarrett D'Amore #define EFX_WOL_BITMAP_VALUE_SIZE (128) 1386*49ef7e06SGarrett D'Amore 1387*49ef7e06SGarrett D'Amore typedef union efx_wol_param_u { 1388*49ef7e06SGarrett D'Amore struct { 1389*49ef7e06SGarrett D'Amore uint8_t mac_addr[6]; 1390*49ef7e06SGarrett D'Amore } ewp_magic; 1391*49ef7e06SGarrett D'Amore struct { 1392*49ef7e06SGarrett D'Amore uint8_t mask[EFX_WOL_BITMAP_MASK_SIZE]; /* 1 bit per byte */ 1393*49ef7e06SGarrett D'Amore uint8_t value[EFX_WOL_BITMAP_VALUE_SIZE]; /* value to match */ 1394*49ef7e06SGarrett D'Amore uint8_t value_len; 1395*49ef7e06SGarrett D'Amore } ewp_bitmap; 1396*49ef7e06SGarrett D'Amore } efx_wol_param_t; 1397*49ef7e06SGarrett D'Amore 1398*49ef7e06SGarrett D'Amore typedef union efx_lightsout_offload_param_u { 1399*49ef7e06SGarrett D'Amore struct { 1400*49ef7e06SGarrett D'Amore uint8_t mac_addr[6]; 1401*49ef7e06SGarrett D'Amore uint32_t ip; 1402*49ef7e06SGarrett D'Amore } elop_arp; 1403*49ef7e06SGarrett D'Amore struct { 1404*49ef7e06SGarrett D'Amore uint8_t mac_addr[6]; 1405*49ef7e06SGarrett D'Amore uint32_t solicited_node[4]; 1406*49ef7e06SGarrett D'Amore uint32_t ip[4]; 1407*49ef7e06SGarrett D'Amore } elop_ns; 1408*49ef7e06SGarrett D'Amore } efx_lightsout_offload_param_t; 1409*49ef7e06SGarrett D'Amore 1410*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1411*49ef7e06SGarrett D'Amore efx_wol_init( 1412*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1413*49ef7e06SGarrett D'Amore 1414*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1415*49ef7e06SGarrett D'Amore efx_wol_filter_clear( 1416*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1417*49ef7e06SGarrett D'Amore 1418*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1419*49ef7e06SGarrett D'Amore efx_wol_filter_add( 1420*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1421*49ef7e06SGarrett D'Amore __in efx_wol_type_t type, 1422*49ef7e06SGarrett D'Amore __in efx_wol_param_t *paramp, 1423*49ef7e06SGarrett D'Amore __out uint32_t *filter_idp); 1424*49ef7e06SGarrett D'Amore 1425*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1426*49ef7e06SGarrett D'Amore efx_wol_filter_remove( 1427*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1428*49ef7e06SGarrett D'Amore __in uint32_t filter_id); 1429*49ef7e06SGarrett D'Amore 1430*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1431*49ef7e06SGarrett D'Amore efx_lightsout_offload_add( 1432*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1433*49ef7e06SGarrett D'Amore __in efx_lightsout_offload_type_t type, 1434*49ef7e06SGarrett D'Amore __in efx_lightsout_offload_param_t *paramp, 1435*49ef7e06SGarrett D'Amore __out uint32_t *filter_idp); 1436*49ef7e06SGarrett D'Amore 1437*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1438*49ef7e06SGarrett D'Amore efx_lightsout_offload_remove( 1439*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1440*49ef7e06SGarrett D'Amore __in efx_lightsout_offload_type_t type, 1441*49ef7e06SGarrett D'Amore __in uint32_t filter_id); 1442*49ef7e06SGarrett D'Amore 1443*49ef7e06SGarrett D'Amore extern void 1444*49ef7e06SGarrett D'Amore efx_wol_fini( 1445*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1446*49ef7e06SGarrett D'Amore 1447*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_WOL */ 1448*49ef7e06SGarrett D'Amore 1449*49ef7e06SGarrett D'Amore #if EFSYS_OPT_DIAG 1450*49ef7e06SGarrett D'Amore 1451*49ef7e06SGarrett D'Amore typedef enum efx_pattern_type_t { 1452*49ef7e06SGarrett D'Amore EFX_PATTERN_BYTE_INCREMENT = 0, 1453*49ef7e06SGarrett D'Amore EFX_PATTERN_ALL_THE_SAME, 1454*49ef7e06SGarrett D'Amore EFX_PATTERN_BIT_ALTERNATE, 1455*49ef7e06SGarrett D'Amore EFX_PATTERN_BYTE_ALTERNATE, 1456*49ef7e06SGarrett D'Amore EFX_PATTERN_BYTE_CHANGING, 1457*49ef7e06SGarrett D'Amore EFX_PATTERN_BIT_SWEEP, 1458*49ef7e06SGarrett D'Amore EFX_PATTERN_NTYPES 1459*49ef7e06SGarrett D'Amore } efx_pattern_type_t; 1460*49ef7e06SGarrett D'Amore 1461*49ef7e06SGarrett D'Amore typedef void 1462*49ef7e06SGarrett D'Amore (*efx_sram_pattern_fn_t)( 1463*49ef7e06SGarrett D'Amore __in size_t row, 1464*49ef7e06SGarrett D'Amore __in boolean_t negate, 1465*49ef7e06SGarrett D'Amore __out efx_qword_t *eqp); 1466*49ef7e06SGarrett D'Amore 1467*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1468*49ef7e06SGarrett D'Amore efx_sram_test( 1469*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1470*49ef7e06SGarrett D'Amore __in efx_pattern_type_t type); 1471*49ef7e06SGarrett D'Amore 1472*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_DIAG */ 1473*49ef7e06SGarrett D'Amore 1474*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1475*49ef7e06SGarrett D'Amore efx_sram_buf_tbl_set( 1476*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1477*49ef7e06SGarrett D'Amore __in uint32_t id, 1478*49ef7e06SGarrett D'Amore __in efsys_mem_t *esmp, 1479*49ef7e06SGarrett D'Amore __in size_t n); 1480*49ef7e06SGarrett D'Amore 1481*49ef7e06SGarrett D'Amore extern void 1482*49ef7e06SGarrett D'Amore efx_sram_buf_tbl_clear( 1483*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1484*49ef7e06SGarrett D'Amore __in uint32_t id, 1485*49ef7e06SGarrett D'Amore __in size_t n); 1486*49ef7e06SGarrett D'Amore 1487*49ef7e06SGarrett D'Amore #define EFX_BUF_TBL_SIZE 0x20000 1488*49ef7e06SGarrett D'Amore 1489*49ef7e06SGarrett D'Amore #define EFX_BUF_SIZE 4096 1490*49ef7e06SGarrett D'Amore 1491*49ef7e06SGarrett D'Amore /* EV */ 1492*49ef7e06SGarrett D'Amore 1493*49ef7e06SGarrett D'Amore typedef struct efx_evq_s efx_evq_t; 1494*49ef7e06SGarrett D'Amore 1495*49ef7e06SGarrett D'Amore #if EFSYS_OPT_QSTATS 1496*49ef7e06SGarrett D'Amore 1497*49ef7e06SGarrett D'Amore /* START MKCONFIG GENERATED EfxHeaderEventQueueBlock 6f3843f5fe7cc843 */ 1498*49ef7e06SGarrett D'Amore typedef enum efx_ev_qstat_e { 1499*49ef7e06SGarrett D'Amore EV_ALL, 1500*49ef7e06SGarrett D'Amore EV_RX, 1501*49ef7e06SGarrett D'Amore EV_RX_OK, 1502*49ef7e06SGarrett D'Amore EV_RX_FRM_TRUNC, 1503*49ef7e06SGarrett D'Amore EV_RX_TOBE_DISC, 1504*49ef7e06SGarrett D'Amore EV_RX_PAUSE_FRM_ERR, 1505*49ef7e06SGarrett D'Amore EV_RX_BUF_OWNER_ID_ERR, 1506*49ef7e06SGarrett D'Amore EV_RX_IPV4_HDR_CHKSUM_ERR, 1507*49ef7e06SGarrett D'Amore EV_RX_TCP_UDP_CHKSUM_ERR, 1508*49ef7e06SGarrett D'Amore EV_RX_ETH_CRC_ERR, 1509*49ef7e06SGarrett D'Amore EV_RX_IP_FRAG_ERR, 1510*49ef7e06SGarrett D'Amore EV_RX_MCAST_PKT, 1511*49ef7e06SGarrett D'Amore EV_RX_MCAST_HASH_MATCH, 1512*49ef7e06SGarrett D'Amore EV_RX_TCP_IPV4, 1513*49ef7e06SGarrett D'Amore EV_RX_TCP_IPV6, 1514*49ef7e06SGarrett D'Amore EV_RX_UDP_IPV4, 1515*49ef7e06SGarrett D'Amore EV_RX_UDP_IPV6, 1516*49ef7e06SGarrett D'Amore EV_RX_OTHER_IPV4, 1517*49ef7e06SGarrett D'Amore EV_RX_OTHER_IPV6, 1518*49ef7e06SGarrett D'Amore EV_RX_NON_IP, 1519*49ef7e06SGarrett D'Amore EV_RX_BATCH, 1520*49ef7e06SGarrett D'Amore EV_TX, 1521*49ef7e06SGarrett D'Amore EV_TX_WQ_FF_FULL, 1522*49ef7e06SGarrett D'Amore EV_TX_PKT_ERR, 1523*49ef7e06SGarrett D'Amore EV_TX_PKT_TOO_BIG, 1524*49ef7e06SGarrett D'Amore EV_TX_UNEXPECTED, 1525*49ef7e06SGarrett D'Amore EV_GLOBAL, 1526*49ef7e06SGarrett D'Amore EV_GLOBAL_MNT, 1527*49ef7e06SGarrett D'Amore EV_DRIVER, 1528*49ef7e06SGarrett D'Amore EV_DRIVER_SRM_UPD_DONE, 1529*49ef7e06SGarrett D'Amore EV_DRIVER_TX_DESCQ_FLS_DONE, 1530*49ef7e06SGarrett D'Amore EV_DRIVER_RX_DESCQ_FLS_DONE, 1531*49ef7e06SGarrett D'Amore EV_DRIVER_RX_DESCQ_FLS_FAILED, 1532*49ef7e06SGarrett D'Amore EV_DRIVER_RX_DSC_ERROR, 1533*49ef7e06SGarrett D'Amore EV_DRIVER_TX_DSC_ERROR, 1534*49ef7e06SGarrett D'Amore EV_DRV_GEN, 1535*49ef7e06SGarrett D'Amore EV_MCDI_RESPONSE, 1536*49ef7e06SGarrett D'Amore EV_NQSTATS 1537*49ef7e06SGarrett D'Amore } efx_ev_qstat_t; 1538*49ef7e06SGarrett D'Amore 1539*49ef7e06SGarrett D'Amore /* END MKCONFIG GENERATED EfxHeaderEventQueueBlock */ 1540*49ef7e06SGarrett D'Amore 1541*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_QSTATS */ 1542*49ef7e06SGarrett D'Amore 1543*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1544*49ef7e06SGarrett D'Amore efx_ev_init( 1545*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1546*49ef7e06SGarrett D'Amore 1547*49ef7e06SGarrett D'Amore extern void 1548*49ef7e06SGarrett D'Amore efx_ev_fini( 1549*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1550*49ef7e06SGarrett D'Amore 1551*49ef7e06SGarrett D'Amore #define EFX_EVQ_MAXNEVS 32768 1552*49ef7e06SGarrett D'Amore #define EFX_EVQ_MINNEVS 512 1553*49ef7e06SGarrett D'Amore 1554*49ef7e06SGarrett D'Amore #define EFX_EVQ_SIZE(_nevs) ((_nevs) * sizeof (efx_qword_t)) 1555*49ef7e06SGarrett D'Amore #define EFX_EVQ_NBUFS(_nevs) (EFX_EVQ_SIZE(_nevs) / EFX_BUF_SIZE) 1556*49ef7e06SGarrett D'Amore 1557*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1558*49ef7e06SGarrett D'Amore efx_ev_qcreate( 1559*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1560*49ef7e06SGarrett D'Amore __in unsigned int index, 1561*49ef7e06SGarrett D'Amore __in efsys_mem_t *esmp, 1562*49ef7e06SGarrett D'Amore __in size_t n, 1563*49ef7e06SGarrett D'Amore __in uint32_t id, 1564*49ef7e06SGarrett D'Amore __deref_out efx_evq_t **eepp); 1565*49ef7e06SGarrett D'Amore 1566*49ef7e06SGarrett D'Amore extern void 1567*49ef7e06SGarrett D'Amore efx_ev_qpost( 1568*49ef7e06SGarrett D'Amore __in efx_evq_t *eep, 1569*49ef7e06SGarrett D'Amore __in uint16_t data); 1570*49ef7e06SGarrett D'Amore 1571*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1572*49ef7e06SGarrett D'Amore (*efx_initialized_ev_t)( 1573*49ef7e06SGarrett D'Amore __in_opt void *arg); 1574*49ef7e06SGarrett D'Amore 1575*49ef7e06SGarrett D'Amore #define EFX_PKT_UNICAST 0x0004 1576*49ef7e06SGarrett D'Amore #define EFX_PKT_START 0x0008 1577*49ef7e06SGarrett D'Amore 1578*49ef7e06SGarrett D'Amore #define EFX_PKT_VLAN_TAGGED 0x0010 1579*49ef7e06SGarrett D'Amore #define EFX_CKSUM_TCPUDP 0x0020 1580*49ef7e06SGarrett D'Amore #define EFX_CKSUM_IPV4 0x0040 1581*49ef7e06SGarrett D'Amore #define EFX_PKT_CONT 0x0080 1582*49ef7e06SGarrett D'Amore 1583*49ef7e06SGarrett D'Amore #define EFX_CHECK_VLAN 0x0100 1584*49ef7e06SGarrett D'Amore #define EFX_PKT_TCP 0x0200 1585*49ef7e06SGarrett D'Amore #define EFX_PKT_UDP 0x0400 1586*49ef7e06SGarrett D'Amore #define EFX_PKT_IPV4 0x0800 1587*49ef7e06SGarrett D'Amore 1588*49ef7e06SGarrett D'Amore #define EFX_PKT_IPV6 0x1000 1589*49ef7e06SGarrett D'Amore #define EFX_PKT_PREFIX_LEN 0x2000 1590*49ef7e06SGarrett D'Amore #define EFX_ADDR_MISMATCH 0x4000 1591*49ef7e06SGarrett D'Amore #define EFX_DISCARD 0x8000 1592*49ef7e06SGarrett D'Amore 1593*49ef7e06SGarrett D'Amore #define EFX_EV_RX_NLABELS 32 1594*49ef7e06SGarrett D'Amore #define EFX_EV_TX_NLABELS 32 1595*49ef7e06SGarrett D'Amore 1596*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1597*49ef7e06SGarrett D'Amore (*efx_rx_ev_t)( 1598*49ef7e06SGarrett D'Amore __in_opt void *arg, 1599*49ef7e06SGarrett D'Amore __in uint32_t label, 1600*49ef7e06SGarrett D'Amore __in uint32_t id, 1601*49ef7e06SGarrett D'Amore __in uint32_t size, 1602*49ef7e06SGarrett D'Amore __in uint16_t flags); 1603*49ef7e06SGarrett D'Amore 1604*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1605*49ef7e06SGarrett D'Amore (*efx_tx_ev_t)( 1606*49ef7e06SGarrett D'Amore __in_opt void *arg, 1607*49ef7e06SGarrett D'Amore __in uint32_t label, 1608*49ef7e06SGarrett D'Amore __in uint32_t id); 1609*49ef7e06SGarrett D'Amore 1610*49ef7e06SGarrett D'Amore #define EFX_EXCEPTION_RX_RECOVERY 0x00000001 1611*49ef7e06SGarrett D'Amore #define EFX_EXCEPTION_RX_DSC_ERROR 0x00000002 1612*49ef7e06SGarrett D'Amore #define EFX_EXCEPTION_TX_DSC_ERROR 0x00000003 1613*49ef7e06SGarrett D'Amore #define EFX_EXCEPTION_UNKNOWN_SENSOREVT 0x00000004 1614*49ef7e06SGarrett D'Amore #define EFX_EXCEPTION_FWALERT_SRAM 0x00000005 1615*49ef7e06SGarrett D'Amore #define EFX_EXCEPTION_UNKNOWN_FWALERT 0x00000006 1616*49ef7e06SGarrett D'Amore #define EFX_EXCEPTION_RX_ERROR 0x00000007 1617*49ef7e06SGarrett D'Amore #define EFX_EXCEPTION_TX_ERROR 0x00000008 1618*49ef7e06SGarrett D'Amore #define EFX_EXCEPTION_EV_ERROR 0x00000009 1619*49ef7e06SGarrett D'Amore 1620*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1621*49ef7e06SGarrett D'Amore (*efx_exception_ev_t)( 1622*49ef7e06SGarrett D'Amore __in_opt void *arg, 1623*49ef7e06SGarrett D'Amore __in uint32_t label, 1624*49ef7e06SGarrett D'Amore __in uint32_t data); 1625*49ef7e06SGarrett D'Amore 1626*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1627*49ef7e06SGarrett D'Amore (*efx_rxq_flush_done_ev_t)( 1628*49ef7e06SGarrett D'Amore __in_opt void *arg, 1629*49ef7e06SGarrett D'Amore __in uint32_t rxq_index); 1630*49ef7e06SGarrett D'Amore 1631*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1632*49ef7e06SGarrett D'Amore (*efx_rxq_flush_failed_ev_t)( 1633*49ef7e06SGarrett D'Amore __in_opt void *arg, 1634*49ef7e06SGarrett D'Amore __in uint32_t rxq_index); 1635*49ef7e06SGarrett D'Amore 1636*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1637*49ef7e06SGarrett D'Amore (*efx_txq_flush_done_ev_t)( 1638*49ef7e06SGarrett D'Amore __in_opt void *arg, 1639*49ef7e06SGarrett D'Amore __in uint32_t txq_index); 1640*49ef7e06SGarrett D'Amore 1641*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1642*49ef7e06SGarrett D'Amore (*efx_software_ev_t)( 1643*49ef7e06SGarrett D'Amore __in_opt void *arg, 1644*49ef7e06SGarrett D'Amore __in uint16_t magic); 1645*49ef7e06SGarrett D'Amore 1646*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1647*49ef7e06SGarrett D'Amore (*efx_sram_ev_t)( 1648*49ef7e06SGarrett D'Amore __in_opt void *arg, 1649*49ef7e06SGarrett D'Amore __in uint32_t code); 1650*49ef7e06SGarrett D'Amore 1651*49ef7e06SGarrett D'Amore #define EFX_SRAM_CLEAR 0 1652*49ef7e06SGarrett D'Amore #define EFX_SRAM_UPDATE 1 1653*49ef7e06SGarrett D'Amore #define EFX_SRAM_ILLEGAL_CLEAR 2 1654*49ef7e06SGarrett D'Amore 1655*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1656*49ef7e06SGarrett D'Amore (*efx_wake_up_ev_t)( 1657*49ef7e06SGarrett D'Amore __in_opt void *arg, 1658*49ef7e06SGarrett D'Amore __in uint32_t label); 1659*49ef7e06SGarrett D'Amore 1660*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1661*49ef7e06SGarrett D'Amore (*efx_timer_ev_t)( 1662*49ef7e06SGarrett D'Amore __in_opt void *arg, 1663*49ef7e06SGarrett D'Amore __in uint32_t label); 1664*49ef7e06SGarrett D'Amore 1665*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1666*49ef7e06SGarrett D'Amore (*efx_link_change_ev_t)( 1667*49ef7e06SGarrett D'Amore __in_opt void *arg, 1668*49ef7e06SGarrett D'Amore __in efx_link_mode_t link_mode); 1669*49ef7e06SGarrett D'Amore 1670*49ef7e06SGarrett D'Amore #if EFSYS_OPT_MON_STATS 1671*49ef7e06SGarrett D'Amore 1672*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1673*49ef7e06SGarrett D'Amore (*efx_monitor_ev_t)( 1674*49ef7e06SGarrett D'Amore __in_opt void *arg, 1675*49ef7e06SGarrett D'Amore __in efx_mon_stat_t id, 1676*49ef7e06SGarrett D'Amore __in efx_mon_stat_value_t value); 1677*49ef7e06SGarrett D'Amore 1678*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_MON_STATS */ 1679*49ef7e06SGarrett D'Amore 1680*49ef7e06SGarrett D'Amore #if EFSYS_OPT_MAC_STATS 1681*49ef7e06SGarrett D'Amore 1682*49ef7e06SGarrett D'Amore typedef __checkReturn boolean_t 1683*49ef7e06SGarrett D'Amore (*efx_mac_stats_ev_t)( 1684*49ef7e06SGarrett D'Amore __in_opt void *arg, 1685*49ef7e06SGarrett D'Amore __in uint32_t generation 1686*49ef7e06SGarrett D'Amore ); 1687*49ef7e06SGarrett D'Amore 1688*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_MAC_STATS */ 1689*49ef7e06SGarrett D'Amore 1690*49ef7e06SGarrett D'Amore typedef struct efx_ev_callbacks_s { 1691*49ef7e06SGarrett D'Amore efx_initialized_ev_t eec_initialized; 1692*49ef7e06SGarrett D'Amore efx_rx_ev_t eec_rx; 1693*49ef7e06SGarrett D'Amore efx_tx_ev_t eec_tx; 1694*49ef7e06SGarrett D'Amore efx_exception_ev_t eec_exception; 1695*49ef7e06SGarrett D'Amore efx_rxq_flush_done_ev_t eec_rxq_flush_done; 1696*49ef7e06SGarrett D'Amore efx_rxq_flush_failed_ev_t eec_rxq_flush_failed; 1697*49ef7e06SGarrett D'Amore efx_txq_flush_done_ev_t eec_txq_flush_done; 1698*49ef7e06SGarrett D'Amore efx_software_ev_t eec_software; 1699*49ef7e06SGarrett D'Amore efx_sram_ev_t eec_sram; 1700*49ef7e06SGarrett D'Amore efx_wake_up_ev_t eec_wake_up; 1701*49ef7e06SGarrett D'Amore efx_timer_ev_t eec_timer; 1702*49ef7e06SGarrett D'Amore efx_link_change_ev_t eec_link_change; 1703*49ef7e06SGarrett D'Amore #if EFSYS_OPT_MON_STATS 1704*49ef7e06SGarrett D'Amore efx_monitor_ev_t eec_monitor; 1705*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_MON_STATS */ 1706*49ef7e06SGarrett D'Amore #if EFSYS_OPT_MAC_STATS 1707*49ef7e06SGarrett D'Amore efx_mac_stats_ev_t eec_mac_stats; 1708*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_MAC_STATS */ 1709*49ef7e06SGarrett D'Amore } efx_ev_callbacks_t; 1710*49ef7e06SGarrett D'Amore 1711*49ef7e06SGarrett D'Amore extern __checkReturn boolean_t 1712*49ef7e06SGarrett D'Amore efx_ev_qpending( 1713*49ef7e06SGarrett D'Amore __in efx_evq_t *eep, 1714*49ef7e06SGarrett D'Amore __in unsigned int count); 1715*49ef7e06SGarrett D'Amore 1716*49ef7e06SGarrett D'Amore #if EFSYS_OPT_EV_PREFETCH 1717*49ef7e06SGarrett D'Amore 1718*49ef7e06SGarrett D'Amore extern void 1719*49ef7e06SGarrett D'Amore efx_ev_qprefetch( 1720*49ef7e06SGarrett D'Amore __in efx_evq_t *eep, 1721*49ef7e06SGarrett D'Amore __in unsigned int count); 1722*49ef7e06SGarrett D'Amore 1723*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_EV_PREFETCH */ 1724*49ef7e06SGarrett D'Amore 1725*49ef7e06SGarrett D'Amore extern void 1726*49ef7e06SGarrett D'Amore efx_ev_qpoll( 1727*49ef7e06SGarrett D'Amore __in efx_evq_t *eep, 1728*49ef7e06SGarrett D'Amore __inout unsigned int *countp, 1729*49ef7e06SGarrett D'Amore __in const efx_ev_callbacks_t *eecp, 1730*49ef7e06SGarrett D'Amore __in_opt void *arg); 1731*49ef7e06SGarrett D'Amore 1732*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1733*49ef7e06SGarrett D'Amore efx_ev_qmoderate( 1734*49ef7e06SGarrett D'Amore __in efx_evq_t *eep, 1735*49ef7e06SGarrett D'Amore __in unsigned int us); 1736*49ef7e06SGarrett D'Amore 1737*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1738*49ef7e06SGarrett D'Amore efx_ev_qprime( 1739*49ef7e06SGarrett D'Amore __in efx_evq_t *eep, 1740*49ef7e06SGarrett D'Amore __in unsigned int count); 1741*49ef7e06SGarrett D'Amore 1742*49ef7e06SGarrett D'Amore #if EFSYS_OPT_QSTATS 1743*49ef7e06SGarrett D'Amore 1744*49ef7e06SGarrett D'Amore #if EFSYS_OPT_NAMES 1745*49ef7e06SGarrett D'Amore 1746*49ef7e06SGarrett D'Amore extern const char * 1747*49ef7e06SGarrett D'Amore efx_ev_qstat_name( 1748*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1749*49ef7e06SGarrett D'Amore __in unsigned int id); 1750*49ef7e06SGarrett D'Amore 1751*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_NAMES */ 1752*49ef7e06SGarrett D'Amore 1753*49ef7e06SGarrett D'Amore extern void 1754*49ef7e06SGarrett D'Amore efx_ev_qstats_update( 1755*49ef7e06SGarrett D'Amore __in efx_evq_t *eep, 1756*49ef7e06SGarrett D'Amore __inout_ecount(EV_NQSTATS) efsys_stat_t *stat); 1757*49ef7e06SGarrett D'Amore 1758*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_QSTATS */ 1759*49ef7e06SGarrett D'Amore 1760*49ef7e06SGarrett D'Amore extern void 1761*49ef7e06SGarrett D'Amore efx_ev_qdestroy( 1762*49ef7e06SGarrett D'Amore __in efx_evq_t *eep); 1763*49ef7e06SGarrett D'Amore 1764*49ef7e06SGarrett D'Amore /* RX */ 1765*49ef7e06SGarrett D'Amore 1766*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1767*49ef7e06SGarrett D'Amore efx_rx_init( 1768*49ef7e06SGarrett D'Amore __inout efx_nic_t *enp); 1769*49ef7e06SGarrett D'Amore 1770*49ef7e06SGarrett D'Amore extern void 1771*49ef7e06SGarrett D'Amore efx_rx_fini( 1772*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1773*49ef7e06SGarrett D'Amore 1774*49ef7e06SGarrett D'Amore #if EFSYS_OPT_RX_SCATTER 1775*49ef7e06SGarrett D'Amore __checkReturn efx_rc_t 1776*49ef7e06SGarrett D'Amore efx_rx_scatter_enable( 1777*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1778*49ef7e06SGarrett D'Amore __in unsigned int buf_size); 1779*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_RX_SCATTER */ 1780*49ef7e06SGarrett D'Amore 1781*49ef7e06SGarrett D'Amore #if EFSYS_OPT_RX_SCALE 1782*49ef7e06SGarrett D'Amore 1783*49ef7e06SGarrett D'Amore typedef enum efx_rx_hash_alg_e { 1784*49ef7e06SGarrett D'Amore EFX_RX_HASHALG_LFSR = 0, 1785*49ef7e06SGarrett D'Amore EFX_RX_HASHALG_TOEPLITZ 1786*49ef7e06SGarrett D'Amore } efx_rx_hash_alg_t; 1787*49ef7e06SGarrett D'Amore 1788*49ef7e06SGarrett D'Amore typedef enum efx_rx_hash_type_e { 1789*49ef7e06SGarrett D'Amore EFX_RX_HASH_IPV4 = 0, 1790*49ef7e06SGarrett D'Amore EFX_RX_HASH_TCPIPV4, 1791*49ef7e06SGarrett D'Amore EFX_RX_HASH_IPV6, 1792*49ef7e06SGarrett D'Amore EFX_RX_HASH_TCPIPV6, 1793*49ef7e06SGarrett D'Amore } efx_rx_hash_type_t; 1794*49ef7e06SGarrett D'Amore 1795*49ef7e06SGarrett D'Amore typedef enum efx_rx_hash_support_e { 1796*49ef7e06SGarrett D'Amore EFX_RX_HASH_UNAVAILABLE = 0, /* Hardware hash not inserted */ 1797*49ef7e06SGarrett D'Amore EFX_RX_HASH_AVAILABLE /* Insert hash with/without RSS */ 1798*49ef7e06SGarrett D'Amore } efx_rx_hash_support_t; 1799*49ef7e06SGarrett D'Amore 1800*49ef7e06SGarrett D'Amore #define EFX_RSS_TBL_SIZE 128 /* Rows in RX indirection table */ 1801*49ef7e06SGarrett D'Amore #define EFX_MAXRSS 64 /* RX indirection entry range */ 1802*49ef7e06SGarrett D'Amore #define EFX_MAXRSS_LEGACY 16 /* See bug16611 and bug17213 */ 1803*49ef7e06SGarrett D'Amore 1804*49ef7e06SGarrett D'Amore typedef enum efx_rx_scale_support_e { 1805*49ef7e06SGarrett D'Amore EFX_RX_SCALE_UNAVAILABLE = 0, /* Not supported */ 1806*49ef7e06SGarrett D'Amore EFX_RX_SCALE_EXCLUSIVE, /* Writable key/indirection table */ 1807*49ef7e06SGarrett D'Amore EFX_RX_SCALE_SHARED /* Read-only key/indirection table */ 1808*49ef7e06SGarrett D'Amore } efx_rx_scale_support_t; 1809*49ef7e06SGarrett D'Amore 1810*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1811*49ef7e06SGarrett D'Amore efx_rx_hash_support_get( 1812*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1813*49ef7e06SGarrett D'Amore __out efx_rx_hash_support_t *supportp); 1814*49ef7e06SGarrett D'Amore 1815*49ef7e06SGarrett D'Amore 1816*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1817*49ef7e06SGarrett D'Amore efx_rx_scale_support_get( 1818*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1819*49ef7e06SGarrett D'Amore __out efx_rx_scale_support_t *supportp); 1820*49ef7e06SGarrett D'Amore 1821*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1822*49ef7e06SGarrett D'Amore efx_rx_scale_mode_set( 1823*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1824*49ef7e06SGarrett D'Amore __in efx_rx_hash_alg_t alg, 1825*49ef7e06SGarrett D'Amore __in efx_rx_hash_type_t type, 1826*49ef7e06SGarrett D'Amore __in boolean_t insert); 1827*49ef7e06SGarrett D'Amore 1828*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1829*49ef7e06SGarrett D'Amore efx_rx_scale_tbl_set( 1830*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1831*49ef7e06SGarrett D'Amore __in_ecount(n) unsigned int *table, 1832*49ef7e06SGarrett D'Amore __in size_t n); 1833*49ef7e06SGarrett D'Amore 1834*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1835*49ef7e06SGarrett D'Amore efx_rx_scale_key_set( 1836*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1837*49ef7e06SGarrett D'Amore __in_ecount(n) uint8_t *key, 1838*49ef7e06SGarrett D'Amore __in size_t n); 1839*49ef7e06SGarrett D'Amore 1840*49ef7e06SGarrett D'Amore extern __checkReturn uint32_t 1841*49ef7e06SGarrett D'Amore efx_psuedo_hdr_hash_get( 1842*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1843*49ef7e06SGarrett D'Amore __in efx_rx_hash_alg_t func, 1844*49ef7e06SGarrett D'Amore __in uint8_t *buffer); 1845*49ef7e06SGarrett D'Amore 1846*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_RX_SCALE */ 1847*49ef7e06SGarrett D'Amore 1848*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1849*49ef7e06SGarrett D'Amore efx_psuedo_hdr_pkt_length_get( 1850*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1851*49ef7e06SGarrett D'Amore __in uint8_t *buffer, 1852*49ef7e06SGarrett D'Amore __out uint16_t *pkt_lengthp); 1853*49ef7e06SGarrett D'Amore 1854*49ef7e06SGarrett D'Amore #define EFX_RXQ_MAXNDESCS 4096 1855*49ef7e06SGarrett D'Amore #define EFX_RXQ_MINNDESCS 512 1856*49ef7e06SGarrett D'Amore 1857*49ef7e06SGarrett D'Amore #define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) 1858*49ef7e06SGarrett D'Amore #define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_SIZE) 1859*49ef7e06SGarrett D'Amore #define EFX_RXQ_LIMIT(_ndescs) ((_ndescs) - 16) 1860*49ef7e06SGarrett D'Amore #define EFX_RXQ_DC_NDESCS(_dcsize) (8 << _dcsize) 1861*49ef7e06SGarrett D'Amore 1862*49ef7e06SGarrett D'Amore typedef enum efx_rxq_type_e { 1863*49ef7e06SGarrett D'Amore EFX_RXQ_TYPE_DEFAULT, 1864*49ef7e06SGarrett D'Amore EFX_RXQ_TYPE_SCATTER, 1865*49ef7e06SGarrett D'Amore EFX_RXQ_NTYPES 1866*49ef7e06SGarrett D'Amore } efx_rxq_type_t; 1867*49ef7e06SGarrett D'Amore 1868*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1869*49ef7e06SGarrett D'Amore efx_rx_qcreate( 1870*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1871*49ef7e06SGarrett D'Amore __in unsigned int index, 1872*49ef7e06SGarrett D'Amore __in unsigned int label, 1873*49ef7e06SGarrett D'Amore __in efx_rxq_type_t type, 1874*49ef7e06SGarrett D'Amore __in efsys_mem_t *esmp, 1875*49ef7e06SGarrett D'Amore __in size_t n, 1876*49ef7e06SGarrett D'Amore __in uint32_t id, 1877*49ef7e06SGarrett D'Amore __in efx_evq_t *eep, 1878*49ef7e06SGarrett D'Amore __deref_out efx_rxq_t **erpp); 1879*49ef7e06SGarrett D'Amore 1880*49ef7e06SGarrett D'Amore typedef struct efx_buffer_s { 1881*49ef7e06SGarrett D'Amore efsys_dma_addr_t eb_addr; 1882*49ef7e06SGarrett D'Amore size_t eb_size; 1883*49ef7e06SGarrett D'Amore boolean_t eb_eop; 1884*49ef7e06SGarrett D'Amore } efx_buffer_t; 1885*49ef7e06SGarrett D'Amore 1886*49ef7e06SGarrett D'Amore typedef struct efx_desc_s { 1887*49ef7e06SGarrett D'Amore efx_qword_t ed_eq; 1888*49ef7e06SGarrett D'Amore } efx_desc_t; 1889*49ef7e06SGarrett D'Amore 1890*49ef7e06SGarrett D'Amore extern void 1891*49ef7e06SGarrett D'Amore efx_rx_qpost( 1892*49ef7e06SGarrett D'Amore __in efx_rxq_t *erp, 1893*49ef7e06SGarrett D'Amore __in_ecount(n) efsys_dma_addr_t *addrp, 1894*49ef7e06SGarrett D'Amore __in size_t size, 1895*49ef7e06SGarrett D'Amore __in unsigned int n, 1896*49ef7e06SGarrett D'Amore __in unsigned int completed, 1897*49ef7e06SGarrett D'Amore __in unsigned int added); 1898*49ef7e06SGarrett D'Amore 1899*49ef7e06SGarrett D'Amore extern void 1900*49ef7e06SGarrett D'Amore efx_rx_qpush( 1901*49ef7e06SGarrett D'Amore __in efx_rxq_t *erp, 1902*49ef7e06SGarrett D'Amore __in unsigned int added, 1903*49ef7e06SGarrett D'Amore __inout unsigned int *pushedp); 1904*49ef7e06SGarrett D'Amore 1905*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1906*49ef7e06SGarrett D'Amore efx_rx_qflush( 1907*49ef7e06SGarrett D'Amore __in efx_rxq_t *erp); 1908*49ef7e06SGarrett D'Amore 1909*49ef7e06SGarrett D'Amore extern void 1910*49ef7e06SGarrett D'Amore efx_rx_qenable( 1911*49ef7e06SGarrett D'Amore __in efx_rxq_t *erp); 1912*49ef7e06SGarrett D'Amore 1913*49ef7e06SGarrett D'Amore extern void 1914*49ef7e06SGarrett D'Amore efx_rx_qdestroy( 1915*49ef7e06SGarrett D'Amore __in efx_rxq_t *erp); 1916*49ef7e06SGarrett D'Amore 1917*49ef7e06SGarrett D'Amore /* TX */ 1918*49ef7e06SGarrett D'Amore 1919*49ef7e06SGarrett D'Amore typedef struct efx_txq_s efx_txq_t; 1920*49ef7e06SGarrett D'Amore 1921*49ef7e06SGarrett D'Amore #if EFSYS_OPT_QSTATS 1922*49ef7e06SGarrett D'Amore 1923*49ef7e06SGarrett D'Amore /* START MKCONFIG GENERATED EfxHeaderTransmitQueueBlock 12dff8778598b2db */ 1924*49ef7e06SGarrett D'Amore typedef enum efx_tx_qstat_e { 1925*49ef7e06SGarrett D'Amore TX_POST, 1926*49ef7e06SGarrett D'Amore TX_POST_PIO, 1927*49ef7e06SGarrett D'Amore TX_NQSTATS 1928*49ef7e06SGarrett D'Amore } efx_tx_qstat_t; 1929*49ef7e06SGarrett D'Amore 1930*49ef7e06SGarrett D'Amore /* END MKCONFIG GENERATED EfxHeaderTransmitQueueBlock */ 1931*49ef7e06SGarrett D'Amore 1932*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_QSTATS */ 1933*49ef7e06SGarrett D'Amore 1934*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1935*49ef7e06SGarrett D'Amore efx_tx_init( 1936*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1937*49ef7e06SGarrett D'Amore 1938*49ef7e06SGarrett D'Amore extern void 1939*49ef7e06SGarrett D'Amore efx_tx_fini( 1940*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 1941*49ef7e06SGarrett D'Amore 1942*49ef7e06SGarrett D'Amore #define EFX_BUG35388_WORKAROUND(_encp) \ 1943*49ef7e06SGarrett D'Amore (((_encp) == NULL) ? 1 : ((_encp)->enc_bug35388_workaround != 0)) 1944*49ef7e06SGarrett D'Amore 1945*49ef7e06SGarrett D'Amore #define EFX_TXQ_MAXNDESCS(_encp) \ 1946*49ef7e06SGarrett D'Amore ((EFX_BUG35388_WORKAROUND(_encp)) ? 2048 : 4096) 1947*49ef7e06SGarrett D'Amore 1948*49ef7e06SGarrett D'Amore #define EFX_TXQ_MINNDESCS 512 1949*49ef7e06SGarrett D'Amore 1950*49ef7e06SGarrett D'Amore #define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) 1951*49ef7e06SGarrett D'Amore #define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE) 1952*49ef7e06SGarrett D'Amore #define EFX_TXQ_LIMIT(_ndescs) ((_ndescs) - 16) 1953*49ef7e06SGarrett D'Amore #define EFX_TXQ_DC_NDESCS(_dcsize) (8 << _dcsize) 1954*49ef7e06SGarrett D'Amore 1955*49ef7e06SGarrett D'Amore #define EFX_TXQ_MAX_BUFS 8 /* Maximum independent of EFX_BUG35388_WORKAROUND. */ 1956*49ef7e06SGarrett D'Amore 1957*49ef7e06SGarrett D'Amore #define EFX_TXQ_CKSUM_IPV4 0x0001 1958*49ef7e06SGarrett D'Amore #define EFX_TXQ_CKSUM_TCPUDP 0x0002 1959*49ef7e06SGarrett D'Amore #define EFX_TXQ_FATSOV2 0x0004 1960*49ef7e06SGarrett D'Amore 1961*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1962*49ef7e06SGarrett D'Amore efx_tx_qcreate( 1963*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 1964*49ef7e06SGarrett D'Amore __in unsigned int index, 1965*49ef7e06SGarrett D'Amore __in unsigned int label, 1966*49ef7e06SGarrett D'Amore __in efsys_mem_t *esmp, 1967*49ef7e06SGarrett D'Amore __in size_t n, 1968*49ef7e06SGarrett D'Amore __in uint32_t id, 1969*49ef7e06SGarrett D'Amore __in uint16_t flags, 1970*49ef7e06SGarrett D'Amore __in efx_evq_t *eep, 1971*49ef7e06SGarrett D'Amore __deref_out efx_txq_t **etpp, 1972*49ef7e06SGarrett D'Amore __out unsigned int *addedp); 1973*49ef7e06SGarrett D'Amore 1974*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1975*49ef7e06SGarrett D'Amore efx_tx_qpost( 1976*49ef7e06SGarrett D'Amore __in efx_txq_t *etp, 1977*49ef7e06SGarrett D'Amore __in_ecount(n) efx_buffer_t *eb, 1978*49ef7e06SGarrett D'Amore __in unsigned int n, 1979*49ef7e06SGarrett D'Amore __in unsigned int completed, 1980*49ef7e06SGarrett D'Amore __inout unsigned int *addedp); 1981*49ef7e06SGarrett D'Amore 1982*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1983*49ef7e06SGarrett D'Amore efx_tx_qpace( 1984*49ef7e06SGarrett D'Amore __in efx_txq_t *etp, 1985*49ef7e06SGarrett D'Amore __in unsigned int ns); 1986*49ef7e06SGarrett D'Amore 1987*49ef7e06SGarrett D'Amore extern void 1988*49ef7e06SGarrett D'Amore efx_tx_qpush( 1989*49ef7e06SGarrett D'Amore __in efx_txq_t *etp, 1990*49ef7e06SGarrett D'Amore __in unsigned int added, 1991*49ef7e06SGarrett D'Amore __in unsigned int pushed); 1992*49ef7e06SGarrett D'Amore 1993*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 1994*49ef7e06SGarrett D'Amore efx_tx_qflush( 1995*49ef7e06SGarrett D'Amore __in efx_txq_t *etp); 1996*49ef7e06SGarrett D'Amore 1997*49ef7e06SGarrett D'Amore extern void 1998*49ef7e06SGarrett D'Amore efx_tx_qenable( 1999*49ef7e06SGarrett D'Amore __in efx_txq_t *etp); 2000*49ef7e06SGarrett D'Amore 2001*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2002*49ef7e06SGarrett D'Amore efx_tx_qpio_enable( 2003*49ef7e06SGarrett D'Amore __in efx_txq_t *etp); 2004*49ef7e06SGarrett D'Amore 2005*49ef7e06SGarrett D'Amore extern void 2006*49ef7e06SGarrett D'Amore efx_tx_qpio_disable( 2007*49ef7e06SGarrett D'Amore __in efx_txq_t *etp); 2008*49ef7e06SGarrett D'Amore 2009*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2010*49ef7e06SGarrett D'Amore efx_tx_qpio_write( 2011*49ef7e06SGarrett D'Amore __in efx_txq_t *etp, 2012*49ef7e06SGarrett D'Amore __in_ecount(buf_length) uint8_t *buffer, 2013*49ef7e06SGarrett D'Amore __in size_t buf_length, 2014*49ef7e06SGarrett D'Amore __in size_t pio_buf_offset); 2015*49ef7e06SGarrett D'Amore 2016*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2017*49ef7e06SGarrett D'Amore efx_tx_qpio_post( 2018*49ef7e06SGarrett D'Amore __in efx_txq_t *etp, 2019*49ef7e06SGarrett D'Amore __in size_t pkt_length, 2020*49ef7e06SGarrett D'Amore __in unsigned int completed, 2021*49ef7e06SGarrett D'Amore __inout unsigned int *addedp); 2022*49ef7e06SGarrett D'Amore 2023*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2024*49ef7e06SGarrett D'Amore efx_tx_qdesc_post( 2025*49ef7e06SGarrett D'Amore __in efx_txq_t *etp, 2026*49ef7e06SGarrett D'Amore __in_ecount(n) efx_desc_t *ed, 2027*49ef7e06SGarrett D'Amore __in unsigned int n, 2028*49ef7e06SGarrett D'Amore __in unsigned int completed, 2029*49ef7e06SGarrett D'Amore __inout unsigned int *addedp); 2030*49ef7e06SGarrett D'Amore 2031*49ef7e06SGarrett D'Amore extern void 2032*49ef7e06SGarrett D'Amore efx_tx_qdesc_dma_create( 2033*49ef7e06SGarrett D'Amore __in efx_txq_t *etp, 2034*49ef7e06SGarrett D'Amore __in efsys_dma_addr_t addr, 2035*49ef7e06SGarrett D'Amore __in size_t size, 2036*49ef7e06SGarrett D'Amore __in boolean_t eop, 2037*49ef7e06SGarrett D'Amore __out efx_desc_t *edp); 2038*49ef7e06SGarrett D'Amore 2039*49ef7e06SGarrett D'Amore extern void 2040*49ef7e06SGarrett D'Amore efx_tx_qdesc_tso_create( 2041*49ef7e06SGarrett D'Amore __in efx_txq_t *etp, 2042*49ef7e06SGarrett D'Amore __in uint16_t ipv4_id, 2043*49ef7e06SGarrett D'Amore __in uint32_t tcp_seq, 2044*49ef7e06SGarrett D'Amore __in uint8_t tcp_flags, 2045*49ef7e06SGarrett D'Amore __out efx_desc_t *edp); 2046*49ef7e06SGarrett D'Amore 2047*49ef7e06SGarrett D'Amore /* Number of FATSOv2 option descriptors */ 2048*49ef7e06SGarrett D'Amore #define EFX_TX_FATSOV2_OPT_NDESCS 2 2049*49ef7e06SGarrett D'Amore 2050*49ef7e06SGarrett D'Amore /* Maximum number of DMA segments per TSO packet (not superframe) */ 2051*49ef7e06SGarrett D'Amore #define EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX 24 2052*49ef7e06SGarrett D'Amore 2053*49ef7e06SGarrett D'Amore extern void 2054*49ef7e06SGarrett D'Amore efx_tx_qdesc_tso2_create( 2055*49ef7e06SGarrett D'Amore __in efx_txq_t *etp, 2056*49ef7e06SGarrett D'Amore __in uint16_t ipv4_id, 2057*49ef7e06SGarrett D'Amore __in uint32_t tcp_seq, 2058*49ef7e06SGarrett D'Amore __in uint16_t tcp_mss, 2059*49ef7e06SGarrett D'Amore __out_ecount(count) efx_desc_t *edp, 2060*49ef7e06SGarrett D'Amore __in int count); 2061*49ef7e06SGarrett D'Amore 2062*49ef7e06SGarrett D'Amore extern void 2063*49ef7e06SGarrett D'Amore efx_tx_qdesc_vlantci_create( 2064*49ef7e06SGarrett D'Amore __in efx_txq_t *etp, 2065*49ef7e06SGarrett D'Amore __in uint16_t tci, 2066*49ef7e06SGarrett D'Amore __out efx_desc_t *edp); 2067*49ef7e06SGarrett D'Amore 2068*49ef7e06SGarrett D'Amore #if EFSYS_OPT_QSTATS 2069*49ef7e06SGarrett D'Amore 2070*49ef7e06SGarrett D'Amore #if EFSYS_OPT_NAMES 2071*49ef7e06SGarrett D'Amore 2072*49ef7e06SGarrett D'Amore extern const char * 2073*49ef7e06SGarrett D'Amore efx_tx_qstat_name( 2074*49ef7e06SGarrett D'Amore __in efx_nic_t *etp, 2075*49ef7e06SGarrett D'Amore __in unsigned int id); 2076*49ef7e06SGarrett D'Amore 2077*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_NAMES */ 2078*49ef7e06SGarrett D'Amore 2079*49ef7e06SGarrett D'Amore extern void 2080*49ef7e06SGarrett D'Amore efx_tx_qstats_update( 2081*49ef7e06SGarrett D'Amore __in efx_txq_t *etp, 2082*49ef7e06SGarrett D'Amore __inout_ecount(TX_NQSTATS) efsys_stat_t *stat); 2083*49ef7e06SGarrett D'Amore 2084*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_QSTATS */ 2085*49ef7e06SGarrett D'Amore 2086*49ef7e06SGarrett D'Amore extern void 2087*49ef7e06SGarrett D'Amore efx_tx_qdestroy( 2088*49ef7e06SGarrett D'Amore __in efx_txq_t *etp); 2089*49ef7e06SGarrett D'Amore 2090*49ef7e06SGarrett D'Amore 2091*49ef7e06SGarrett D'Amore /* FILTER */ 2092*49ef7e06SGarrett D'Amore 2093*49ef7e06SGarrett D'Amore #if EFSYS_OPT_FILTER 2094*49ef7e06SGarrett D'Amore 2095*49ef7e06SGarrett D'Amore #define EFX_ETHER_TYPE_IPV4 0x0800 2096*49ef7e06SGarrett D'Amore #define EFX_ETHER_TYPE_IPV6 0x86DD 2097*49ef7e06SGarrett D'Amore 2098*49ef7e06SGarrett D'Amore #define EFX_IPPROTO_TCP 6 2099*49ef7e06SGarrett D'Amore #define EFX_IPPROTO_UDP 17 2100*49ef7e06SGarrett D'Amore 2101*49ef7e06SGarrett D'Amore typedef enum efx_filter_flag_e { 2102*49ef7e06SGarrett D'Amore EFX_FILTER_FLAG_RX_RSS = 0x01, /* use RSS to spread across 2103*49ef7e06SGarrett D'Amore * multiple queues */ 2104*49ef7e06SGarrett D'Amore EFX_FILTER_FLAG_RX_SCATTER = 0x02, /* enable RX scatter */ 2105*49ef7e06SGarrett D'Amore EFX_FILTER_FLAG_RX_OVER_AUTO = 0x04, /* Override an automatic filter 2106*49ef7e06SGarrett D'Amore * (priority EFX_FILTER_PRI_AUTO). 2107*49ef7e06SGarrett D'Amore * May only be set by the filter 2108*49ef7e06SGarrett D'Amore * implementation for each type. 2109*49ef7e06SGarrett D'Amore * A removal request will 2110*49ef7e06SGarrett D'Amore * restore the automatic filter 2111*49ef7e06SGarrett D'Amore * in its place. */ 2112*49ef7e06SGarrett D'Amore EFX_FILTER_FLAG_RX = 0x08, /* Filter is for RX */ 2113*49ef7e06SGarrett D'Amore EFX_FILTER_FLAG_TX = 0x10, /* Filter is for TX */ 2114*49ef7e06SGarrett D'Amore } efx_filter_flag_t; 2115*49ef7e06SGarrett D'Amore 2116*49ef7e06SGarrett D'Amore typedef enum efx_filter_match_flags_e { 2117*49ef7e06SGarrett D'Amore EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host 2118*49ef7e06SGarrett D'Amore * address */ 2119*49ef7e06SGarrett D'Amore EFX_FILTER_MATCH_LOC_HOST = 0x0002, /* Match by local IP host 2120*49ef7e06SGarrett D'Amore * address */ 2121*49ef7e06SGarrett D'Amore EFX_FILTER_MATCH_REM_MAC = 0x0004, /* Match by remote MAC address */ 2122*49ef7e06SGarrett D'Amore EFX_FILTER_MATCH_REM_PORT = 0x0008, /* Match by remote TCP/UDP port */ 2123*49ef7e06SGarrett D'Amore EFX_FILTER_MATCH_LOC_MAC = 0x0010, /* Match by remote TCP/UDP port */ 2124*49ef7e06SGarrett D'Amore EFX_FILTER_MATCH_LOC_PORT = 0x0020, /* Match by local TCP/UDP port */ 2125*49ef7e06SGarrett D'Amore EFX_FILTER_MATCH_ETHER_TYPE = 0x0040, /* Match by Ether-type */ 2126*49ef7e06SGarrett D'Amore EFX_FILTER_MATCH_INNER_VID = 0x0080, /* Match by inner VLAN ID */ 2127*49ef7e06SGarrett D'Amore EFX_FILTER_MATCH_OUTER_VID = 0x0100, /* Match by outer VLAN ID */ 2128*49ef7e06SGarrett D'Amore EFX_FILTER_MATCH_IP_PROTO = 0x0200, /* Match by IP transport 2129*49ef7e06SGarrett D'Amore * protocol */ 2130*49ef7e06SGarrett D'Amore EFX_FILTER_MATCH_LOC_MAC_IG = 0x0400, /* Match by local MAC address 2131*49ef7e06SGarrett D'Amore * I/G bit. Used for RX default 2132*49ef7e06SGarrett D'Amore * unicast and multicast/ 2133*49ef7e06SGarrett D'Amore * broadcast filters. */ 2134*49ef7e06SGarrett D'Amore } efx_filter_match_flags_t; 2135*49ef7e06SGarrett D'Amore 2136*49ef7e06SGarrett D'Amore typedef enum efx_filter_priority_s { 2137*49ef7e06SGarrett D'Amore EFX_FILTER_PRI_HINT = 0, /* Performance hint */ 2138*49ef7e06SGarrett D'Amore EFX_FILTER_PRI_AUTO, /* Automatic filter based on device 2139*49ef7e06SGarrett D'Amore * address list or hardware 2140*49ef7e06SGarrett D'Amore * requirements. This may only be used 2141*49ef7e06SGarrett D'Amore * by the filter implementation for 2142*49ef7e06SGarrett D'Amore * each NIC type. */ 2143*49ef7e06SGarrett D'Amore EFX_FILTER_PRI_MANUAL, /* Manually configured filter */ 2144*49ef7e06SGarrett D'Amore EFX_FILTER_PRI_REQUIRED, /* Required for correct behaviour of the 2145*49ef7e06SGarrett D'Amore * client (e.g. SR-IOV, HyperV VMQ etc.) 2146*49ef7e06SGarrett D'Amore */ 2147*49ef7e06SGarrett D'Amore } efx_filter_priority_t; 2148*49ef7e06SGarrett D'Amore 2149*49ef7e06SGarrett D'Amore /* 2150*49ef7e06SGarrett D'Amore * FIXME: All these fields are assumed to be in little-endian byte order. 2151*49ef7e06SGarrett D'Amore * It may be better for some to be big-endian. See bug42804. 2152*49ef7e06SGarrett D'Amore */ 2153*49ef7e06SGarrett D'Amore 2154*49ef7e06SGarrett D'Amore typedef struct efx_filter_spec_s { 2155*49ef7e06SGarrett D'Amore uint32_t efs_match_flags:12; 2156*49ef7e06SGarrett D'Amore uint32_t efs_priority:2; 2157*49ef7e06SGarrett D'Amore uint32_t efs_flags:6; 2158*49ef7e06SGarrett D'Amore uint32_t efs_dmaq_id:12; 2159*49ef7e06SGarrett D'Amore uint32_t efs_rss_context; 2160*49ef7e06SGarrett D'Amore uint16_t efs_outer_vid; 2161*49ef7e06SGarrett D'Amore uint16_t efs_inner_vid; 2162*49ef7e06SGarrett D'Amore uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; 2163*49ef7e06SGarrett D'Amore uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN]; 2164*49ef7e06SGarrett D'Amore uint16_t efs_ether_type; 2165*49ef7e06SGarrett D'Amore uint8_t efs_ip_proto; 2166*49ef7e06SGarrett D'Amore uint16_t efs_loc_port; 2167*49ef7e06SGarrett D'Amore uint16_t efs_rem_port; 2168*49ef7e06SGarrett D'Amore efx_oword_t efs_rem_host; 2169*49ef7e06SGarrett D'Amore efx_oword_t efs_loc_host; 2170*49ef7e06SGarrett D'Amore } efx_filter_spec_t; 2171*49ef7e06SGarrett D'Amore 2172*49ef7e06SGarrett D'Amore 2173*49ef7e06SGarrett D'Amore /* Default values for use in filter specifications */ 2174*49ef7e06SGarrett D'Amore #define EFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT 0xffffffff 2175*49ef7e06SGarrett D'Amore #define EFX_FILTER_SPEC_RX_DMAQ_ID_DROP 0xfff 2176*49ef7e06SGarrett D'Amore #define EFX_FILTER_SPEC_VID_UNSPEC 0xffff 2177*49ef7e06SGarrett D'Amore 2178*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2179*49ef7e06SGarrett D'Amore efx_filter_init( 2180*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 2181*49ef7e06SGarrett D'Amore 2182*49ef7e06SGarrett D'Amore extern void 2183*49ef7e06SGarrett D'Amore efx_filter_fini( 2184*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 2185*49ef7e06SGarrett D'Amore 2186*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2187*49ef7e06SGarrett D'Amore efx_filter_insert( 2188*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2189*49ef7e06SGarrett D'Amore __inout efx_filter_spec_t *spec); 2190*49ef7e06SGarrett D'Amore 2191*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2192*49ef7e06SGarrett D'Amore efx_filter_remove( 2193*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2194*49ef7e06SGarrett D'Amore __inout efx_filter_spec_t *spec); 2195*49ef7e06SGarrett D'Amore 2196*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2197*49ef7e06SGarrett D'Amore efx_filter_restore( 2198*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 2199*49ef7e06SGarrett D'Amore 2200*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2201*49ef7e06SGarrett D'Amore efx_filter_supported_filters( 2202*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2203*49ef7e06SGarrett D'Amore __out uint32_t *list, 2204*49ef7e06SGarrett D'Amore __out size_t *length); 2205*49ef7e06SGarrett D'Amore 2206*49ef7e06SGarrett D'Amore extern void 2207*49ef7e06SGarrett D'Amore efx_filter_spec_init_rx( 2208*49ef7e06SGarrett D'Amore __out efx_filter_spec_t *spec, 2209*49ef7e06SGarrett D'Amore __in efx_filter_priority_t priority, 2210*49ef7e06SGarrett D'Amore __in efx_filter_flag_t flags, 2211*49ef7e06SGarrett D'Amore __in efx_rxq_t *erp); 2212*49ef7e06SGarrett D'Amore 2213*49ef7e06SGarrett D'Amore extern void 2214*49ef7e06SGarrett D'Amore efx_filter_spec_init_tx( 2215*49ef7e06SGarrett D'Amore __out efx_filter_spec_t *spec, 2216*49ef7e06SGarrett D'Amore __in efx_txq_t *etp); 2217*49ef7e06SGarrett D'Amore 2218*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2219*49ef7e06SGarrett D'Amore efx_filter_spec_set_ipv4_local( 2220*49ef7e06SGarrett D'Amore __inout efx_filter_spec_t *spec, 2221*49ef7e06SGarrett D'Amore __in uint8_t proto, 2222*49ef7e06SGarrett D'Amore __in uint32_t host, 2223*49ef7e06SGarrett D'Amore __in uint16_t port); 2224*49ef7e06SGarrett D'Amore 2225*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2226*49ef7e06SGarrett D'Amore efx_filter_spec_set_ipv4_full( 2227*49ef7e06SGarrett D'Amore __inout efx_filter_spec_t *spec, 2228*49ef7e06SGarrett D'Amore __in uint8_t proto, 2229*49ef7e06SGarrett D'Amore __in uint32_t lhost, 2230*49ef7e06SGarrett D'Amore __in uint16_t lport, 2231*49ef7e06SGarrett D'Amore __in uint32_t rhost, 2232*49ef7e06SGarrett D'Amore __in uint16_t rport); 2233*49ef7e06SGarrett D'Amore 2234*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2235*49ef7e06SGarrett D'Amore efx_filter_spec_set_eth_local( 2236*49ef7e06SGarrett D'Amore __inout efx_filter_spec_t *spec, 2237*49ef7e06SGarrett D'Amore __in uint16_t vid, 2238*49ef7e06SGarrett D'Amore __in const uint8_t *addr); 2239*49ef7e06SGarrett D'Amore 2240*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2241*49ef7e06SGarrett D'Amore efx_filter_spec_set_uc_def( 2242*49ef7e06SGarrett D'Amore __inout efx_filter_spec_t *spec); 2243*49ef7e06SGarrett D'Amore 2244*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2245*49ef7e06SGarrett D'Amore efx_filter_spec_set_mc_def( 2246*49ef7e06SGarrett D'Amore __inout efx_filter_spec_t *spec); 2247*49ef7e06SGarrett D'Amore 2248*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_FILTER */ 2249*49ef7e06SGarrett D'Amore 2250*49ef7e06SGarrett D'Amore /* HASH */ 2251*49ef7e06SGarrett D'Amore 2252*49ef7e06SGarrett D'Amore extern __checkReturn uint32_t 2253*49ef7e06SGarrett D'Amore efx_hash_dwords( 2254*49ef7e06SGarrett D'Amore __in_ecount(count) uint32_t const *input, 2255*49ef7e06SGarrett D'Amore __in size_t count, 2256*49ef7e06SGarrett D'Amore __in uint32_t init); 2257*49ef7e06SGarrett D'Amore 2258*49ef7e06SGarrett D'Amore extern __checkReturn uint32_t 2259*49ef7e06SGarrett D'Amore efx_hash_bytes( 2260*49ef7e06SGarrett D'Amore __in_ecount(length) uint8_t const *input, 2261*49ef7e06SGarrett D'Amore __in size_t length, 2262*49ef7e06SGarrett D'Amore __in uint32_t init); 2263*49ef7e06SGarrett D'Amore 2264*49ef7e06SGarrett D'Amore #if EFSYS_OPT_LICENSING 2265*49ef7e06SGarrett D'Amore 2266*49ef7e06SGarrett D'Amore /* LICENSING */ 2267*49ef7e06SGarrett D'Amore 2268*49ef7e06SGarrett D'Amore typedef struct efx_key_stats_s { 2269*49ef7e06SGarrett D'Amore uint32_t eks_valid; 2270*49ef7e06SGarrett D'Amore uint32_t eks_invalid; 2271*49ef7e06SGarrett D'Amore uint32_t eks_blacklisted; 2272*49ef7e06SGarrett D'Amore uint32_t eks_unverifiable; 2273*49ef7e06SGarrett D'Amore uint32_t eks_wrong_node; 2274*49ef7e06SGarrett D'Amore uint32_t eks_licensed_apps_lo; 2275*49ef7e06SGarrett D'Amore uint32_t eks_licensed_apps_hi; 2276*49ef7e06SGarrett D'Amore uint32_t eks_licensed_features_lo; 2277*49ef7e06SGarrett D'Amore uint32_t eks_licensed_features_hi; 2278*49ef7e06SGarrett D'Amore } efx_key_stats_t; 2279*49ef7e06SGarrett D'Amore 2280*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2281*49ef7e06SGarrett D'Amore efx_lic_init( 2282*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 2283*49ef7e06SGarrett D'Amore 2284*49ef7e06SGarrett D'Amore extern void 2285*49ef7e06SGarrett D'Amore efx_lic_fini( 2286*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 2287*49ef7e06SGarrett D'Amore 2288*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2289*49ef7e06SGarrett D'Amore efx_lic_update_licenses( 2290*49ef7e06SGarrett D'Amore __in efx_nic_t *enp); 2291*49ef7e06SGarrett D'Amore 2292*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2293*49ef7e06SGarrett D'Amore efx_lic_get_key_stats( 2294*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2295*49ef7e06SGarrett D'Amore __out efx_key_stats_t *ksp); 2296*49ef7e06SGarrett D'Amore 2297*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2298*49ef7e06SGarrett D'Amore efx_lic_app_state( 2299*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2300*49ef7e06SGarrett D'Amore __in uint64_t app_id, 2301*49ef7e06SGarrett D'Amore __out boolean_t *licensedp); 2302*49ef7e06SGarrett D'Amore 2303*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2304*49ef7e06SGarrett D'Amore efx_lic_get_id( 2305*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2306*49ef7e06SGarrett D'Amore __in size_t buffer_size, 2307*49ef7e06SGarrett D'Amore __out uint32_t *typep, 2308*49ef7e06SGarrett D'Amore __out size_t *lengthp, 2309*49ef7e06SGarrett D'Amore __out_opt uint8_t *bufferp); 2310*49ef7e06SGarrett D'Amore 2311*49ef7e06SGarrett D'Amore 2312*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2313*49ef7e06SGarrett D'Amore efx_lic_find_start( 2314*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2315*49ef7e06SGarrett D'Amore __in_bcount(buffer_size) 2316*49ef7e06SGarrett D'Amore caddr_t bufferp, 2317*49ef7e06SGarrett D'Amore __in size_t buffer_size, 2318*49ef7e06SGarrett D'Amore __out uint32_t *startp 2319*49ef7e06SGarrett D'Amore ); 2320*49ef7e06SGarrett D'Amore 2321*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2322*49ef7e06SGarrett D'Amore efx_lic_find_end( 2323*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2324*49ef7e06SGarrett D'Amore __in_bcount(buffer_size) 2325*49ef7e06SGarrett D'Amore caddr_t bufferp, 2326*49ef7e06SGarrett D'Amore __in size_t buffer_size, 2327*49ef7e06SGarrett D'Amore __in uint32_t offset, 2328*49ef7e06SGarrett D'Amore __out uint32_t *endp 2329*49ef7e06SGarrett D'Amore ); 2330*49ef7e06SGarrett D'Amore 2331*49ef7e06SGarrett D'Amore extern __checkReturn __success(return != B_FALSE) boolean_t 2332*49ef7e06SGarrett D'Amore efx_lic_find_key( 2333*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2334*49ef7e06SGarrett D'Amore __in_bcount(buffer_size) 2335*49ef7e06SGarrett D'Amore caddr_t bufferp, 2336*49ef7e06SGarrett D'Amore __in size_t buffer_size, 2337*49ef7e06SGarrett D'Amore __in uint32_t offset, 2338*49ef7e06SGarrett D'Amore __out uint32_t *startp, 2339*49ef7e06SGarrett D'Amore __out uint32_t *lengthp 2340*49ef7e06SGarrett D'Amore ); 2341*49ef7e06SGarrett D'Amore 2342*49ef7e06SGarrett D'Amore extern __checkReturn __success(return != B_FALSE) boolean_t 2343*49ef7e06SGarrett D'Amore efx_lic_validate_key( 2344*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2345*49ef7e06SGarrett D'Amore __in_bcount(length) caddr_t keyp, 2346*49ef7e06SGarrett D'Amore __in uint32_t length 2347*49ef7e06SGarrett D'Amore ); 2348*49ef7e06SGarrett D'Amore 2349*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2350*49ef7e06SGarrett D'Amore efx_lic_read_key( 2351*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2352*49ef7e06SGarrett D'Amore __in_bcount(buffer_size) 2353*49ef7e06SGarrett D'Amore caddr_t bufferp, 2354*49ef7e06SGarrett D'Amore __in size_t buffer_size, 2355*49ef7e06SGarrett D'Amore __in uint32_t offset, 2356*49ef7e06SGarrett D'Amore __in uint32_t length, 2357*49ef7e06SGarrett D'Amore __out_bcount_part(key_max_size, *lengthp) 2358*49ef7e06SGarrett D'Amore caddr_t keyp, 2359*49ef7e06SGarrett D'Amore __in size_t key_max_size, 2360*49ef7e06SGarrett D'Amore __out uint32_t *lengthp 2361*49ef7e06SGarrett D'Amore ); 2362*49ef7e06SGarrett D'Amore 2363*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2364*49ef7e06SGarrett D'Amore efx_lic_write_key( 2365*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2366*49ef7e06SGarrett D'Amore __in_bcount(buffer_size) 2367*49ef7e06SGarrett D'Amore caddr_t bufferp, 2368*49ef7e06SGarrett D'Amore __in size_t buffer_size, 2369*49ef7e06SGarrett D'Amore __in uint32_t offset, 2370*49ef7e06SGarrett D'Amore __in_bcount(length) caddr_t keyp, 2371*49ef7e06SGarrett D'Amore __in uint32_t length, 2372*49ef7e06SGarrett D'Amore __out uint32_t *lengthp 2373*49ef7e06SGarrett D'Amore ); 2374*49ef7e06SGarrett D'Amore 2375*49ef7e06SGarrett D'Amore __checkReturn efx_rc_t 2376*49ef7e06SGarrett D'Amore efx_lic_delete_key( 2377*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2378*49ef7e06SGarrett D'Amore __in_bcount(buffer_size) 2379*49ef7e06SGarrett D'Amore caddr_t bufferp, 2380*49ef7e06SGarrett D'Amore __in size_t buffer_size, 2381*49ef7e06SGarrett D'Amore __in uint32_t offset, 2382*49ef7e06SGarrett D'Amore __in uint32_t length, 2383*49ef7e06SGarrett D'Amore __in uint32_t end, 2384*49ef7e06SGarrett D'Amore __out uint32_t *deltap 2385*49ef7e06SGarrett D'Amore ); 2386*49ef7e06SGarrett D'Amore 2387*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2388*49ef7e06SGarrett D'Amore efx_lic_create_partition( 2389*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2390*49ef7e06SGarrett D'Amore __in_bcount(buffer_size) 2391*49ef7e06SGarrett D'Amore caddr_t bufferp, 2392*49ef7e06SGarrett D'Amore __in size_t buffer_size 2393*49ef7e06SGarrett D'Amore ); 2394*49ef7e06SGarrett D'Amore 2395*49ef7e06SGarrett D'Amore extern __checkReturn efx_rc_t 2396*49ef7e06SGarrett D'Amore efx_lic_finish_partition( 2397*49ef7e06SGarrett D'Amore __in efx_nic_t *enp, 2398*49ef7e06SGarrett D'Amore __in_bcount(buffer_size) 2399*49ef7e06SGarrett D'Amore caddr_t bufferp, 2400*49ef7e06SGarrett D'Amore __in size_t buffer_size 2401*49ef7e06SGarrett D'Amore ); 2402*49ef7e06SGarrett D'Amore 2403*49ef7e06SGarrett D'Amore #endif /* EFSYS_OPT_LICENSING */ 2404*49ef7e06SGarrett D'Amore 2405*49ef7e06SGarrett D'Amore 2406*49ef7e06SGarrett D'Amore 2407*49ef7e06SGarrett D'Amore #ifdef __cplusplus 2408*49ef7e06SGarrett D'Amore } 2409*49ef7e06SGarrett D'Amore #endif 2410*49ef7e06SGarrett D'Amore 2411*49ef7e06SGarrett D'Amore #endif /* _SYS_EFX_H */ 2412