1e948693eSPhilip Paeps /*- 24d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 3718cf2ccSPedro F. Giffuni * 4929c7febSAndrew Rybchenko * Copyright (c) 2009-2016 Solarflare Communications Inc. 53c838a9fSAndrew Rybchenko * All rights reserved. 6e948693eSPhilip Paeps * 7e948693eSPhilip Paeps * Redistribution and use in source and binary forms, with or without 83c838a9fSAndrew Rybchenko * modification, are permitted provided that the following conditions are met: 9e948693eSPhilip Paeps * 103c838a9fSAndrew Rybchenko * 1. Redistributions of source code must retain the above copyright notice, 113c838a9fSAndrew Rybchenko * this list of conditions and the following disclaimer. 123c838a9fSAndrew Rybchenko * 2. Redistributions in binary form must reproduce the above copyright notice, 133c838a9fSAndrew Rybchenko * this list of conditions and the following disclaimer in the documentation 143c838a9fSAndrew Rybchenko * and/or other materials provided with the distribution. 153c838a9fSAndrew Rybchenko * 163c838a9fSAndrew Rybchenko * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 173c838a9fSAndrew Rybchenko * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 183c838a9fSAndrew Rybchenko * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 193c838a9fSAndrew Rybchenko * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 203c838a9fSAndrew Rybchenko * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 213c838a9fSAndrew Rybchenko * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 223c838a9fSAndrew Rybchenko * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 233c838a9fSAndrew Rybchenko * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 243c838a9fSAndrew Rybchenko * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 253c838a9fSAndrew Rybchenko * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 263c838a9fSAndrew Rybchenko * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 273c838a9fSAndrew Rybchenko * 283c838a9fSAndrew Rybchenko * The views and conclusions contained in the software and documentation are 293c838a9fSAndrew Rybchenko * those of the authors and should not be interpreted as representing official 303c838a9fSAndrew Rybchenko * policies, either expressed or implied, of the FreeBSD Project. 31e948693eSPhilip Paeps */ 32e948693eSPhilip Paeps 33e948693eSPhilip Paeps #ifndef _SYS_SIENA_IMPL_H 34e948693eSPhilip Paeps #define _SYS_SIENA_IMPL_H 35e948693eSPhilip Paeps 36e948693eSPhilip Paeps #include "efx.h" 37e948693eSPhilip Paeps #include "efx_regs.h" 38e948693eSPhilip Paeps #include "efx_mcdi.h" 39e948693eSPhilip Paeps #include "siena_flash.h" 40e948693eSPhilip Paeps 41e948693eSPhilip Paeps #ifdef __cplusplus 42e948693eSPhilip Paeps extern "C" { 43e948693eSPhilip Paeps #endif 44e948693eSPhilip Paeps 452d99dff8SAndrew Rybchenko #ifndef EFX_TXQ_DC_SIZE 462d99dff8SAndrew Rybchenko #define EFX_TXQ_DC_SIZE 1 /* 16 descriptors */ 472d99dff8SAndrew Rybchenko #endif 482d99dff8SAndrew Rybchenko #ifndef EFX_RXQ_DC_SIZE 492d99dff8SAndrew Rybchenko #define EFX_RXQ_DC_SIZE 3 /* 64 descriptors */ 502d99dff8SAndrew Rybchenko #endif 512d99dff8SAndrew Rybchenko #define EFX_TXQ_DC_NDESCS(_dcsize) (8 << (_dcsize)) 522d99dff8SAndrew Rybchenko 53e948693eSPhilip Paeps #define SIENA_NVRAM_CHUNK 0x80 54e948693eSPhilip Paeps 55460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 56e948693eSPhilip Paeps siena_nic_probe( 57e948693eSPhilip Paeps __in efx_nic_t *enp); 58e948693eSPhilip Paeps 59460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 60e948693eSPhilip Paeps siena_nic_reset( 61e948693eSPhilip Paeps __in efx_nic_t *enp); 62e948693eSPhilip Paeps 63460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 64e948693eSPhilip Paeps siena_nic_init( 65e948693eSPhilip Paeps __in efx_nic_t *enp); 66e948693eSPhilip Paeps 67e948693eSPhilip Paeps #if EFSYS_OPT_DIAG 68e948693eSPhilip Paeps 6907542d73SAndrew Rybchenko extern efx_sram_pattern_fn_t __efx_sram_pattern_fns[]; 7007542d73SAndrew Rybchenko 7107542d73SAndrew Rybchenko typedef struct siena_register_set_s { 7207542d73SAndrew Rybchenko unsigned int address; 7307542d73SAndrew Rybchenko unsigned int step; 7407542d73SAndrew Rybchenko unsigned int rows; 7507542d73SAndrew Rybchenko efx_oword_t mask; 7607542d73SAndrew Rybchenko } siena_register_set_t; 7707542d73SAndrew Rybchenko 78460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 79e948693eSPhilip Paeps siena_nic_register_test( 80e948693eSPhilip Paeps __in efx_nic_t *enp); 81e948693eSPhilip Paeps 82e948693eSPhilip Paeps #endif /* EFSYS_OPT_DIAG */ 83e948693eSPhilip Paeps 84e948693eSPhilip Paeps extern void 85e948693eSPhilip Paeps siena_nic_fini( 86e948693eSPhilip Paeps __in efx_nic_t *enp); 87e948693eSPhilip Paeps 88e948693eSPhilip Paeps extern void 89e948693eSPhilip Paeps siena_nic_unprobe( 90e948693eSPhilip Paeps __in efx_nic_t *enp); 91e948693eSPhilip Paeps 92e948693eSPhilip Paeps #define SIENA_SRAM_ROWS 0x12000 93e948693eSPhilip Paeps 94e948693eSPhilip Paeps extern void 95e948693eSPhilip Paeps siena_sram_init( 96e948693eSPhilip Paeps __in efx_nic_t *enp); 97e948693eSPhilip Paeps 98e948693eSPhilip Paeps #if EFSYS_OPT_DIAG 99e948693eSPhilip Paeps 100460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 101e948693eSPhilip Paeps siena_sram_test( 102e948693eSPhilip Paeps __in efx_nic_t *enp, 103e948693eSPhilip Paeps __in efx_sram_pattern_fn_t func); 104e948693eSPhilip Paeps 105e948693eSPhilip Paeps #endif /* EFSYS_OPT_DIAG */ 106e948693eSPhilip Paeps 1073c838a9fSAndrew Rybchenko #if EFSYS_OPT_MCDI 1083c838a9fSAndrew Rybchenko 109460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 1103c838a9fSAndrew Rybchenko siena_mcdi_init( 1113c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 1123c838a9fSAndrew Rybchenko __in const efx_mcdi_transport_t *mtp); 1133c838a9fSAndrew Rybchenko 1143c838a9fSAndrew Rybchenko extern void 115fd7501bfSAndrew Rybchenko siena_mcdi_send_request( 1163c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 1173222b9deSAndrew Rybchenko __in_bcount(hdr_len) void *hdrp, 118fd7501bfSAndrew Rybchenko __in size_t hdr_len, 1193222b9deSAndrew Rybchenko __in_bcount(sdu_len) void *sdup, 120fd7501bfSAndrew Rybchenko __in size_t sdu_len); 1213c838a9fSAndrew Rybchenko 122548ebee5SAndrew Rybchenko extern __checkReturn boolean_t 123548ebee5SAndrew Rybchenko siena_mcdi_poll_response( 124548ebee5SAndrew Rybchenko __in efx_nic_t *enp); 125548ebee5SAndrew Rybchenko 12659bfa22aSAndrew Rybchenko extern void 12759bfa22aSAndrew Rybchenko siena_mcdi_read_response( 12859bfa22aSAndrew Rybchenko __in efx_nic_t *enp, 12986ec4b85SAndrew Rybchenko __out_bcount(length) void *bufferp, 13059bfa22aSAndrew Rybchenko __in size_t offset, 13159bfa22aSAndrew Rybchenko __in size_t length); 13259bfa22aSAndrew Rybchenko 133460cb568SAndrew Rybchenko extern efx_rc_t 1343c838a9fSAndrew Rybchenko siena_mcdi_poll_reboot( 1353c838a9fSAndrew Rybchenko __in efx_nic_t *enp); 1363c838a9fSAndrew Rybchenko 1373c838a9fSAndrew Rybchenko extern void 1383c838a9fSAndrew Rybchenko siena_mcdi_fini( 1393c838a9fSAndrew Rybchenko __in efx_nic_t *enp); 1403c838a9fSAndrew Rybchenko 141460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 142af986c75SAndrew Rybchenko siena_mcdi_feature_supported( 1433c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 144af986c75SAndrew Rybchenko __in efx_mcdi_feature_id_t id, 145d486ce4bSAndrew Rybchenko __out boolean_t *supportedp); 146d486ce4bSAndrew Rybchenko 1478a4fcbd4SAndrew Rybchenko extern void 1488a4fcbd4SAndrew Rybchenko siena_mcdi_get_timeout( 1498a4fcbd4SAndrew Rybchenko __in efx_nic_t *enp, 1508a4fcbd4SAndrew Rybchenko __in efx_mcdi_req_t *emrp, 1518a4fcbd4SAndrew Rybchenko __out uint32_t *timeoutp); 1528a4fcbd4SAndrew Rybchenko 1533c838a9fSAndrew Rybchenko #endif /* EFSYS_OPT_MCDI */ 154e948693eSPhilip Paeps 155e948693eSPhilip Paeps #if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD 156e948693eSPhilip Paeps 157460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 158e948693eSPhilip Paeps siena_nvram_partn_lock( 159e948693eSPhilip Paeps __in efx_nic_t *enp, 1608eea4a0aSAndrew Rybchenko __in uint32_t partn); 161e948693eSPhilip Paeps 162e9c123a5SAndrew Rybchenko extern __checkReturn efx_rc_t 163e948693eSPhilip Paeps siena_nvram_partn_unlock( 164e948693eSPhilip Paeps __in efx_nic_t *enp, 165a21b2f20SAndrew Rybchenko __in uint32_t partn, 166a21b2f20SAndrew Rybchenko __out_opt uint32_t *verify_resultp); 167e948693eSPhilip Paeps 168460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 169e948693eSPhilip Paeps siena_nvram_get_dynamic_cfg( 170e948693eSPhilip Paeps __in efx_nic_t *enp, 1718eea4a0aSAndrew Rybchenko __in uint32_t partn, 172e948693eSPhilip Paeps __in boolean_t vpd, 173e948693eSPhilip Paeps __out siena_mc_dynamic_config_hdr_t **dcfgp, 174e948693eSPhilip Paeps __out size_t *sizep); 175e948693eSPhilip Paeps 176e948693eSPhilip Paeps #endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */ 177e948693eSPhilip Paeps 178e948693eSPhilip Paeps #if EFSYS_OPT_NVRAM 179e948693eSPhilip Paeps 180e948693eSPhilip Paeps #if EFSYS_OPT_DIAG 181e948693eSPhilip Paeps 182460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 183e948693eSPhilip Paeps siena_nvram_test( 184e948693eSPhilip Paeps __in efx_nic_t *enp); 185e948693eSPhilip Paeps 186e948693eSPhilip Paeps #endif /* EFSYS_OPT_DIAG */ 187e948693eSPhilip Paeps 188460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 1893c838a9fSAndrew Rybchenko siena_nvram_get_subtype( 1903c838a9fSAndrew Rybchenko __in efx_nic_t *enp, 1918eea4a0aSAndrew Rybchenko __in uint32_t partn, 1923c838a9fSAndrew Rybchenko __out uint32_t *subtypep); 1933c838a9fSAndrew Rybchenko 194460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 195bce88e31SAndrew Rybchenko siena_nvram_type_to_partn( 196bce88e31SAndrew Rybchenko __in efx_nic_t *enp, 197bce88e31SAndrew Rybchenko __in efx_nvram_type_t type, 198bce88e31SAndrew Rybchenko __out uint32_t *partnp); 199bce88e31SAndrew Rybchenko 20056bd83b0SAndrew Rybchenko extern __checkReturn efx_rc_t 20156bd83b0SAndrew Rybchenko siena_nvram_partn_size( 20256bd83b0SAndrew Rybchenko __in efx_nic_t *enp, 20356bd83b0SAndrew Rybchenko __in uint32_t partn, 20456bd83b0SAndrew Rybchenko __out size_t *sizep); 20556bd83b0SAndrew Rybchenko 2065d846e87SAndrew Rybchenko extern __checkReturn efx_rc_t 2075d846e87SAndrew Rybchenko siena_nvram_partn_rw_start( 2085d846e87SAndrew Rybchenko __in efx_nic_t *enp, 2095d846e87SAndrew Rybchenko __in uint32_t partn, 2105d846e87SAndrew Rybchenko __out size_t *chunk_sizep); 2115d846e87SAndrew Rybchenko 2120afdf29cSAndrew Rybchenko extern __checkReturn efx_rc_t 2130afdf29cSAndrew Rybchenko siena_nvram_partn_read( 2140afdf29cSAndrew Rybchenko __in efx_nic_t *enp, 2150afdf29cSAndrew Rybchenko __in uint32_t partn, 2160afdf29cSAndrew Rybchenko __in unsigned int offset, 2170afdf29cSAndrew Rybchenko __out_bcount(size) caddr_t data, 2180afdf29cSAndrew Rybchenko __in size_t size); 2190afdf29cSAndrew Rybchenko 220b60ff840SAndrew Rybchenko extern __checkReturn efx_rc_t 221b60ff840SAndrew Rybchenko siena_nvram_partn_erase( 222b60ff840SAndrew Rybchenko __in efx_nic_t *enp, 223b60ff840SAndrew Rybchenko __in uint32_t partn, 224b60ff840SAndrew Rybchenko __in unsigned int offset, 225b60ff840SAndrew Rybchenko __in size_t size); 226b60ff840SAndrew Rybchenko 227134c4c4aSAndrew Rybchenko extern __checkReturn efx_rc_t 228134c4c4aSAndrew Rybchenko siena_nvram_partn_write( 229134c4c4aSAndrew Rybchenko __in efx_nic_t *enp, 230134c4c4aSAndrew Rybchenko __in uint32_t partn, 231134c4c4aSAndrew Rybchenko __in unsigned int offset, 232134c4c4aSAndrew Rybchenko __out_bcount(size) caddr_t data, 233134c4c4aSAndrew Rybchenko __in size_t size); 234134c4c4aSAndrew Rybchenko 235e9c123a5SAndrew Rybchenko extern __checkReturn efx_rc_t 236eb9703daSAndrew Rybchenko siena_nvram_partn_rw_finish( 237eb9703daSAndrew Rybchenko __in efx_nic_t *enp, 238a21b2f20SAndrew Rybchenko __in uint32_t partn, 239a21b2f20SAndrew Rybchenko __out_opt uint32_t *verify_resultp); 240eb9703daSAndrew Rybchenko 24192187119SAndrew Rybchenko extern __checkReturn efx_rc_t 24292187119SAndrew Rybchenko siena_nvram_partn_get_version( 24392187119SAndrew Rybchenko __in efx_nic_t *enp, 24492187119SAndrew Rybchenko __in uint32_t partn, 24592187119SAndrew Rybchenko __out uint32_t *subtypep, 24692187119SAndrew Rybchenko __out_ecount(4) uint16_t version[4]); 24792187119SAndrew Rybchenko 2486d0b856cSAndrew Rybchenko extern __checkReturn efx_rc_t 2496d0b856cSAndrew Rybchenko siena_nvram_partn_set_version( 2506d0b856cSAndrew Rybchenko __in efx_nic_t *enp, 2516d0b856cSAndrew Rybchenko __in uint32_t partn, 2526d0b856cSAndrew Rybchenko __in_ecount(4) uint16_t version[4]); 253eb9703daSAndrew Rybchenko 254e948693eSPhilip Paeps #endif /* EFSYS_OPT_NVRAM */ 255e948693eSPhilip Paeps 256e948693eSPhilip Paeps #if EFSYS_OPT_VPD 257e948693eSPhilip Paeps 258460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 259e948693eSPhilip Paeps siena_vpd_init( 260e948693eSPhilip Paeps __in efx_nic_t *enp); 261e948693eSPhilip Paeps 262460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 263e948693eSPhilip Paeps siena_vpd_size( 264e948693eSPhilip Paeps __in efx_nic_t *enp, 265e948693eSPhilip Paeps __out size_t *sizep); 266e948693eSPhilip Paeps 267460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 268e948693eSPhilip Paeps siena_vpd_read( 269e948693eSPhilip Paeps __in efx_nic_t *enp, 270e948693eSPhilip Paeps __out_bcount(size) caddr_t data, 271e948693eSPhilip Paeps __in size_t size); 272e948693eSPhilip Paeps 273460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 274e948693eSPhilip Paeps siena_vpd_verify( 275e948693eSPhilip Paeps __in efx_nic_t *enp, 276e948693eSPhilip Paeps __in_bcount(size) caddr_t data, 277e948693eSPhilip Paeps __in size_t size); 278e948693eSPhilip Paeps 279460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 280e948693eSPhilip Paeps siena_vpd_reinit( 281e948693eSPhilip Paeps __in efx_nic_t *enp, 282e948693eSPhilip Paeps __in_bcount(size) caddr_t data, 283e948693eSPhilip Paeps __in size_t size); 284e948693eSPhilip Paeps 285460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 286e948693eSPhilip Paeps siena_vpd_get( 287e948693eSPhilip Paeps __in efx_nic_t *enp, 288e948693eSPhilip Paeps __in_bcount(size) caddr_t data, 289e948693eSPhilip Paeps __in size_t size, 290e948693eSPhilip Paeps __inout efx_vpd_value_t *evvp); 291e948693eSPhilip Paeps 292460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 293e948693eSPhilip Paeps siena_vpd_set( 294e948693eSPhilip Paeps __in efx_nic_t *enp, 295e948693eSPhilip Paeps __in_bcount(size) caddr_t data, 296e948693eSPhilip Paeps __in size_t size, 297e948693eSPhilip Paeps __in efx_vpd_value_t *evvp); 298e948693eSPhilip Paeps 299460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 300e948693eSPhilip Paeps siena_vpd_next( 301e948693eSPhilip Paeps __in efx_nic_t *enp, 302e948693eSPhilip Paeps __in_bcount(size) caddr_t data, 303e948693eSPhilip Paeps __in size_t size, 304e948693eSPhilip Paeps __out efx_vpd_value_t *evvp, 305e948693eSPhilip Paeps __inout unsigned int *contp); 306e948693eSPhilip Paeps 307460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 308e948693eSPhilip Paeps siena_vpd_write( 309e948693eSPhilip Paeps __in efx_nic_t *enp, 310e948693eSPhilip Paeps __in_bcount(size) caddr_t data, 311e948693eSPhilip Paeps __in size_t size); 312e948693eSPhilip Paeps 313e948693eSPhilip Paeps extern void 314e948693eSPhilip Paeps siena_vpd_fini( 315e948693eSPhilip Paeps __in efx_nic_t *enp); 316e948693eSPhilip Paeps 317e948693eSPhilip Paeps #endif /* EFSYS_OPT_VPD */ 318e948693eSPhilip Paeps 319e948693eSPhilip Paeps typedef struct siena_link_state_s { 320e948693eSPhilip Paeps uint32_t sls_adv_cap_mask; 321e948693eSPhilip Paeps uint32_t sls_lp_cap_mask; 322e948693eSPhilip Paeps unsigned int sls_fcntl; 323e948693eSPhilip Paeps efx_link_mode_t sls_link_mode; 324e948693eSPhilip Paeps #if EFSYS_OPT_LOOPBACK 325e948693eSPhilip Paeps efx_loopback_type_t sls_loopback; 326e948693eSPhilip Paeps #endif 327e948693eSPhilip Paeps boolean_t sls_mac_up; 328e948693eSPhilip Paeps } siena_link_state_t; 329e948693eSPhilip Paeps 330e948693eSPhilip Paeps extern void 331e948693eSPhilip Paeps siena_phy_link_ev( 332e948693eSPhilip Paeps __in efx_nic_t *enp, 333e948693eSPhilip Paeps __in efx_qword_t *eqp, 334e948693eSPhilip Paeps __out efx_link_mode_t *link_modep); 335e948693eSPhilip Paeps 336460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 337e948693eSPhilip Paeps siena_phy_get_link( 338e948693eSPhilip Paeps __in efx_nic_t *enp, 339e948693eSPhilip Paeps __out siena_link_state_t *slsp); 340e948693eSPhilip Paeps 341460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 342e948693eSPhilip Paeps siena_phy_power( 343e948693eSPhilip Paeps __in efx_nic_t *enp, 344e948693eSPhilip Paeps __in boolean_t on); 345e948693eSPhilip Paeps 346460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 347e948693eSPhilip Paeps siena_phy_reconfigure( 348e948693eSPhilip Paeps __in efx_nic_t *enp); 349e948693eSPhilip Paeps 350460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 351e948693eSPhilip Paeps siena_phy_verify( 352e948693eSPhilip Paeps __in efx_nic_t *enp); 353e948693eSPhilip Paeps 354460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 355e948693eSPhilip Paeps siena_phy_oui_get( 356e948693eSPhilip Paeps __in efx_nic_t *enp, 357e948693eSPhilip Paeps __out uint32_t *ouip); 358e948693eSPhilip Paeps 359e948693eSPhilip Paeps #if EFSYS_OPT_PHY_STATS 360e948693eSPhilip Paeps 361e948693eSPhilip Paeps extern void 362e948693eSPhilip Paeps siena_phy_decode_stats( 363e948693eSPhilip Paeps __in efx_nic_t *enp, 364e948693eSPhilip Paeps __in uint32_t vmask, 365e948693eSPhilip Paeps __in_opt efsys_mem_t *esmp, 366e948693eSPhilip Paeps __out_opt uint64_t *smaskp, 3675d4e8a86SAndrew Rybchenko __inout_ecount_opt(EFX_PHY_NSTATS) uint32_t *stat); 368e948693eSPhilip Paeps 369460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 370e948693eSPhilip Paeps siena_phy_stats_update( 371e948693eSPhilip Paeps __in efx_nic_t *enp, 372e948693eSPhilip Paeps __in efsys_mem_t *esmp, 3735d4e8a86SAndrew Rybchenko __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat); 374e948693eSPhilip Paeps 375e948693eSPhilip Paeps #endif /* EFSYS_OPT_PHY_STATS */ 376e948693eSPhilip Paeps 3773c838a9fSAndrew Rybchenko #if EFSYS_OPT_BIST 378e948693eSPhilip Paeps 379460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 380e948693eSPhilip Paeps siena_phy_bist_start( 381e948693eSPhilip Paeps __in efx_nic_t *enp, 3823c838a9fSAndrew Rybchenko __in efx_bist_type_t type); 383e948693eSPhilip Paeps 384460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 385e948693eSPhilip Paeps siena_phy_bist_poll( 386e948693eSPhilip Paeps __in efx_nic_t *enp, 3873c838a9fSAndrew Rybchenko __in efx_bist_type_t type, 3883c838a9fSAndrew Rybchenko __out efx_bist_result_t *resultp, 389e948693eSPhilip Paeps __out_opt __drv_when(count > 0, __notnull) 390e948693eSPhilip Paeps uint32_t *value_maskp, 391e948693eSPhilip Paeps __out_ecount_opt(count) __drv_when(count > 0, __notnull) 392e948693eSPhilip Paeps unsigned long *valuesp, 393e948693eSPhilip Paeps __in size_t count); 394e948693eSPhilip Paeps 395e948693eSPhilip Paeps extern void 396e948693eSPhilip Paeps siena_phy_bist_stop( 397e948693eSPhilip Paeps __in efx_nic_t *enp, 3983c838a9fSAndrew Rybchenko __in efx_bist_type_t type); 399e948693eSPhilip Paeps 4003c838a9fSAndrew Rybchenko #endif /* EFSYS_OPT_BIST */ 401e948693eSPhilip Paeps 402460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 403e948693eSPhilip Paeps siena_mac_poll( 404e948693eSPhilip Paeps __in efx_nic_t *enp, 405e948693eSPhilip Paeps __out efx_link_mode_t *link_modep); 406e948693eSPhilip Paeps 407460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 408e948693eSPhilip Paeps siena_mac_up( 409e948693eSPhilip Paeps __in efx_nic_t *enp, 410e948693eSPhilip Paeps __out boolean_t *mac_upp); 411e948693eSPhilip Paeps 412460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 413e948693eSPhilip Paeps siena_mac_reconfigure( 414e948693eSPhilip Paeps __in efx_nic_t *enp); 415e948693eSPhilip Paeps 416d8484af2SAndrew Rybchenko extern __checkReturn efx_rc_t 417d8484af2SAndrew Rybchenko siena_mac_pdu_get( 418d8484af2SAndrew Rybchenko __in efx_nic_t *enp, 419d8484af2SAndrew Rybchenko __out size_t *pdu); 420d8484af2SAndrew Rybchenko 421e948693eSPhilip Paeps #if EFSYS_OPT_LOOPBACK 422e948693eSPhilip Paeps 423460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 424e948693eSPhilip Paeps siena_mac_loopback_set( 425e948693eSPhilip Paeps __in efx_nic_t *enp, 426e948693eSPhilip Paeps __in efx_link_mode_t link_mode, 427e948693eSPhilip Paeps __in efx_loopback_type_t loopback_type); 428e948693eSPhilip Paeps 429e948693eSPhilip Paeps #endif /* EFSYS_OPT_LOOPBACK */ 430e948693eSPhilip Paeps 431e948693eSPhilip Paeps #if EFSYS_OPT_MAC_STATS 432e948693eSPhilip Paeps 433460cb568SAndrew Rybchenko extern __checkReturn efx_rc_t 43458a72cb2SAndrew Rybchenko siena_mac_stats_get_mask( 43558a72cb2SAndrew Rybchenko __in efx_nic_t *enp, 43658a72cb2SAndrew Rybchenko __inout_bcount(mask_size) uint32_t *maskp, 43758a72cb2SAndrew Rybchenko __in size_t mask_size); 43858a72cb2SAndrew Rybchenko 43958a72cb2SAndrew Rybchenko extern __checkReturn efx_rc_t 440e948693eSPhilip Paeps siena_mac_stats_update( 441e948693eSPhilip Paeps __in efx_nic_t *enp, 442e948693eSPhilip Paeps __in efsys_mem_t *esmp, 443536c03c2SAndrew Rybchenko __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat, 44414c3e490SAndrew Rybchenko __inout_opt uint32_t *generationp); 445e948693eSPhilip Paeps 446e948693eSPhilip Paeps #endif /* EFSYS_OPT_MAC_STATS */ 447e948693eSPhilip Paeps 448e948693eSPhilip Paeps #ifdef __cplusplus 449e948693eSPhilip Paeps } 450e948693eSPhilip Paeps #endif 451e948693eSPhilip Paeps 452e948693eSPhilip Paeps #endif /* _SYS_SIENA_IMPL_H */ 453