161ae650dSJack F Vogel /****************************************************************************** 261ae650dSJack F Vogel 3f4cc2d17SEric Joyner Copyright (c) 2013-2018, Intel Corporation 461ae650dSJack F Vogel All rights reserved. 561ae650dSJack F Vogel 661ae650dSJack F Vogel Redistribution and use in source and binary forms, with or without 761ae650dSJack F Vogel modification, are permitted provided that the following conditions are met: 861ae650dSJack F Vogel 961ae650dSJack F Vogel 1. Redistributions of source code must retain the above copyright notice, 1061ae650dSJack F Vogel this list of conditions and the following disclaimer. 1161ae650dSJack F Vogel 1261ae650dSJack F Vogel 2. Redistributions in binary form must reproduce the above copyright 1361ae650dSJack F Vogel notice, this list of conditions and the following disclaimer in the 1461ae650dSJack F Vogel documentation and/or other materials provided with the distribution. 1561ae650dSJack F Vogel 1661ae650dSJack F Vogel 3. Neither the name of the Intel Corporation nor the names of its 1761ae650dSJack F Vogel contributors may be used to endorse or promote products derived from 1861ae650dSJack F Vogel this software without specific prior written permission. 1961ae650dSJack F Vogel 2061ae650dSJack F Vogel THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 2161ae650dSJack F Vogel AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2261ae650dSJack F Vogel IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2361ae650dSJack F Vogel ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 2461ae650dSJack F Vogel LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2561ae650dSJack F Vogel CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2661ae650dSJack F Vogel SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2761ae650dSJack F Vogel INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2861ae650dSJack F Vogel CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2961ae650dSJack F Vogel ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 3061ae650dSJack F Vogel POSSIBILITY OF SUCH DAMAGE. 3161ae650dSJack F Vogel 3261ae650dSJack F Vogel ******************************************************************************/ 3361ae650dSJack F Vogel 3461ae650dSJack F Vogel 3561ae650dSJack F Vogel #ifndef _IXL_PF_H_ 3661ae650dSJack F Vogel #define _IXL_PF_H_ 3761ae650dSJack F Vogel 38b4a7ce06SEric Joyner #include "i40e_dcb.h" 39b4a7ce06SEric Joyner 404294f337SSean Bruno #include "ixl.h" 414294f337SSean Bruno #include "ixl_pf_qmgr.h" 424294f337SSean Bruno 4356c2c47bSJack F Vogel #define VF_FLAG_ENABLED 0x01 4456c2c47bSJack F Vogel #define VF_FLAG_SET_MAC_CAP 0x02 4556c2c47bSJack F Vogel #define VF_FLAG_VLAN_CAP 0x04 4656c2c47bSJack F Vogel #define VF_FLAG_PROMISC_CAP 0x08 4756c2c47bSJack F Vogel #define VF_FLAG_MAC_ANTI_SPOOF 0x10 4856c2c47bSJack F Vogel 491031d839SEric Joyner #define IXL_ICR0_CRIT_ERR_MASK \ 501031d839SEric Joyner (I40E_PFINT_ICR0_PCI_EXCEPTION_MASK | \ 511031d839SEric Joyner I40E_PFINT_ICR0_ECC_ERR_MASK | \ 521031d839SEric Joyner I40E_PFINT_ICR0_PE_CRITERR_MASK) 531031d839SEric Joyner 541031d839SEric Joyner /* VF Interrupts */ 551031d839SEric Joyner #define IXL_VPINT_LNKLSTN_REG(hw, vector, vf_num) \ 561031d839SEric Joyner I40E_VPINT_LNKLSTN(((vector) - 1) + \ 571031d839SEric Joyner (((hw)->func_caps.num_msix_vectors_vf - 1) * (vf_num))) 581031d839SEric Joyner 591031d839SEric Joyner #define IXL_VFINT_DYN_CTLN_REG(hw, vector, vf_num) \ 601031d839SEric Joyner I40E_VFINT_DYN_CTLN(((vector) - 1) + \ 611031d839SEric Joyner (((hw)->func_caps.num_msix_vectors_vf - 1) * (vf_num))) 621031d839SEric Joyner 63b4a7ce06SEric Joyner enum ixl_fw_mode { 64b4a7ce06SEric Joyner IXL_FW_MODE_NORMAL, 65b4a7ce06SEric Joyner IXL_FW_MODE_RECOVERY, 66b4a7ce06SEric Joyner IXL_FW_MODE_UEMPR 67b4a7ce06SEric Joyner }; 68b4a7ce06SEric Joyner 69b4a7ce06SEric Joyner enum ixl_i2c_access_method_t { 70b4a7ce06SEric Joyner IXL_I2C_ACCESS_METHOD_BEST_AVAILABLE = 0, 71b4a7ce06SEric Joyner IXL_I2C_ACCESS_METHOD_BIT_BANG_I2CPARAMS = 1, 72b4a7ce06SEric Joyner IXL_I2C_ACCESS_METHOD_REGISTER_I2CCMD = 2, 73b4a7ce06SEric Joyner IXL_I2C_ACCESS_METHOD_AQ = 3, 74b4a7ce06SEric Joyner IXL_I2C_ACCESS_METHOD_TYPE_LENGTH = 4 75b4a7ce06SEric Joyner }; 76b4a7ce06SEric Joyner 771031d839SEric Joyner /* Used in struct ixl_pf's state field */ 78b8f51b8cSPiotr Kubaj enum ixl_state { 79b8f51b8cSPiotr Kubaj IXL_STATE_RECOVERY_MODE = 0, 80b8f51b8cSPiotr Kubaj IXL_STATE_RESETTING = 1, 81b8f51b8cSPiotr Kubaj IXL_STATE_MDD_PENDING = 2, 82b8f51b8cSPiotr Kubaj IXL_STATE_PF_RESET_REQ = 3, 83b8f51b8cSPiotr Kubaj IXL_STATE_VF_RESET_REQ = 4, 84b8f51b8cSPiotr Kubaj IXL_STATE_PF_CRIT_ERR = 5, 85b8f51b8cSPiotr Kubaj IXL_STATE_CORE_RESET_REQ = 6, 86b8f51b8cSPiotr Kubaj IXL_STATE_GLOB_RESET_REQ = 7, 87b8f51b8cSPiotr Kubaj IXL_STATE_EMP_RESET_REQ = 8, 88b8f51b8cSPiotr Kubaj IXL_STATE_FW_LLDP_DISABLED = 9, 89b8f51b8cSPiotr Kubaj IXL_STATE_EEE_ENABLED = 10, 90b8f51b8cSPiotr Kubaj IXL_STATE_LINK_ACTIVE_ON_DOWN = 11, 91ba2f531fSKrzysztof Galazka IXL_STATE_LINK_POLLING = 12, 921031d839SEric Joyner }; 93fdb6f38aSEric Joyner 94b4a7ce06SEric Joyner #define IXL_PF_IN_RECOVERY_MODE(pf) \ 95b8f51b8cSPiotr Kubaj ixl_test_state(&pf->state, IXL_STATE_RECOVERY_MODE) 96b4a7ce06SEric Joyner 977d4dceecSKrzysztof Galazka #define IXL_PF_IS_RESETTING(pf) \ 98b8f51b8cSPiotr Kubaj ixl_test_state(&pf->state, IXL_STATE_RESETTING) 99b4a7ce06SEric Joyner 10056c2c47bSJack F Vogel struct ixl_vf { 10156c2c47bSJack F Vogel struct ixl_vsi vsi; 1021031d839SEric Joyner u32 vf_flags; 1031031d839SEric Joyner u32 num_mdd_events; 10456c2c47bSJack F Vogel 1051031d839SEric Joyner u8 mac[ETHER_ADDR_LEN]; 1061031d839SEric Joyner u16 vf_num; 107b4a7ce06SEric Joyner struct virtchnl_version_info version; 10856c2c47bSJack F Vogel 1094294f337SSean Bruno struct ixl_pf_qtag qtag; 11056c2c47bSJack F Vogel }; 11156c2c47bSJack F Vogel 11261ae650dSJack F Vogel /* Physical controller structure */ 11361ae650dSJack F Vogel struct ixl_pf { 1141031d839SEric Joyner struct ixl_vsi vsi; 1151031d839SEric Joyner 11661ae650dSJack F Vogel struct i40e_hw hw; 11761ae650dSJack F Vogel struct i40e_osdep osdep; 118bd937497SJean-Sébastien Pédron device_t dev; 11961ae650dSJack F Vogel 12061ae650dSJack F Vogel struct resource *pci_mem; 12161ae650dSJack F Vogel 122cb6b8299SEric Joyner #ifdef IXL_IW 123cb6b8299SEric Joyner int iw_msix; 124cb6b8299SEric Joyner bool iw_enabled; 125cb6b8299SEric Joyner #endif 1261031d839SEric Joyner u32 state; 127cb6b8299SEric Joyner u8 supported_speeds; 12861ae650dSJack F Vogel 1294294f337SSean Bruno struct ixl_pf_qmgr qmgr; 1304294f337SSean Bruno struct ixl_pf_qtag qtag; 1314294f337SSean Bruno 132b4a7ce06SEric Joyner char admin_mtx_name[16]; /* name of the admin mutex */ 133b4a7ce06SEric Joyner struct mtx admin_mtx; /* mutex to protect the admin timer */ 134b4a7ce06SEric Joyner struct callout admin_timer; /* timer to trigger admin task */ 135b4a7ce06SEric Joyner 1364294f337SSean Bruno /* Tunable values */ 137b4a7ce06SEric Joyner #ifdef IXL_DEBUG_FC 1384294f337SSean Bruno bool enable_tx_fc_filter; 139b4a7ce06SEric Joyner #endif 140b4a7ce06SEric Joyner #ifdef IXL_DEBUG 141b4a7ce06SEric Joyner bool recovery_mode; 142b4a7ce06SEric Joyner #endif 1434294f337SSean Bruno int dynamic_rx_itr; 1444294f337SSean Bruno int dynamic_tx_itr; 1454294f337SSean Bruno int tx_itr; 1464294f337SSean Bruno int rx_itr; 14777c1fcecSEric Joyner int enable_vf_loopback; 1484294f337SSean Bruno 14956c2c47bSJack F Vogel bool link_up; 15061ae650dSJack F Vogel int advertised_speed; 1514294f337SSean Bruno int fc; /* link flow ctrl setting */ 1524294f337SSean Bruno enum ixl_dbg_mask dbg_mask; 153cb6b8299SEric Joyner bool has_i2c; 15461ae650dSJack F Vogel 15561ae650dSJack F Vogel /* Misc stats maintained by the driver */ 15661ae650dSJack F Vogel u64 admin_irq; 15761ae650dSJack F Vogel 15861ae650dSJack F Vogel /* Statistics from hw */ 15961ae650dSJack F Vogel struct i40e_hw_port_stats stats; 16061ae650dSJack F Vogel struct i40e_hw_port_stats stats_offsets; 16161ae650dSJack F Vogel bool stat_offsets_loaded; 16256c2c47bSJack F Vogel 1631031d839SEric Joyner /* I2C access methods */ 164b4a7ce06SEric Joyner enum ixl_i2c_access_method_t i2c_access_method; 1651031d839SEric Joyner s32 (*read_i2c_byte)(struct ixl_pf *pf, u8 byte_offset, 1661031d839SEric Joyner u8 dev_addr, u8 *data); 1671031d839SEric Joyner s32 (*write_i2c_byte)(struct ixl_pf *pf, u8 byte_offset, 1681031d839SEric Joyner u8 dev_addr, u8 data); 1691031d839SEric Joyner 1704294f337SSean Bruno /* SR-IOV */ 17156c2c47bSJack F Vogel struct ixl_vf *vfs; 17256c2c47bSJack F Vogel int num_vfs; 17356c2c47bSJack F Vogel uint16_t veb_seid; 174b4a7ce06SEric Joyner int vc_debug_lvl; 175ba2f531fSKrzysztof Galazka 176ba2f531fSKrzysztof Galazka sbintime_t link_poll_start; 17761ae650dSJack F Vogel }; 17861ae650dSJack F Vogel 179223d846dSEric Joyner /* 180223d846dSEric Joyner * Defines used for NVM update ioctls. 181223d846dSEric Joyner * This value is used in the Solaris tool, too. 182223d846dSEric Joyner */ 183223d846dSEric Joyner #define I40E_NVM_ACCESS \ 184223d846dSEric Joyner (((((((('E' << 4) + '1') << 4) + 'K') << 4) + 'G') << 4) | 5) 185223d846dSEric Joyner 1867f70bec6SEric Joyner #define IXL_DEFAULT_PHY_INT_MASK \ 18795bb0504SEric Joyner ((~(I40E_AQ_EVENT_LINK_UPDOWN | I40E_AQ_EVENT_MODULE_QUAL_FAIL \ 18895bb0504SEric Joyner | I40E_AQ_EVENT_MEDIA_NA)) & 0x3FF) 1897f70bec6SEric Joyner 1901d767a8eSEric Joyner /*** Sysctl help messages; displayed with "sysctl -d" ***/ 1911d767a8eSEric Joyner 19295bb0504SEric Joyner #define IXL_SYSCTL_HELP_SET_ADVERTISE \ 19395bb0504SEric Joyner "\nControl advertised link speed.\n" \ 19495bb0504SEric Joyner "Flags:\n" \ 19595bb0504SEric Joyner "\t 0x1 - advertise 100M\n" \ 19695bb0504SEric Joyner "\t 0x2 - advertise 1G\n" \ 19795bb0504SEric Joyner "\t 0x4 - advertise 10G\n" \ 1981d767a8eSEric Joyner "\t 0x8 - advertise 20G\n" \ 199cb6b8299SEric Joyner "\t0x10 - advertise 25G\n" \ 2002984a8ddSEric Joyner "\t0x20 - advertise 40G\n" \ 2012984a8ddSEric Joyner "\t0x40 - advertise 2.5G\n" \ 2022984a8ddSEric Joyner "\t0x80 - advertise 5G\n\n" \ 203cb6b8299SEric Joyner "Set to 0 to disable link.\n" \ 204cb6b8299SEric Joyner "Use \"sysctl -x\" to view flags properly." 20595bb0504SEric Joyner 206ceebc2f3SEric Joyner #define IXL_SYSCTL_HELP_SUPPORTED_SPEED \ 207ceebc2f3SEric Joyner "\nSupported link speeds.\n" \ 208ceebc2f3SEric Joyner "Flags:\n" \ 209ceebc2f3SEric Joyner "\t 0x1 - 100M\n" \ 210ceebc2f3SEric Joyner "\t 0x2 - 1G\n" \ 211ceebc2f3SEric Joyner "\t 0x4 - 10G\n" \ 212ceebc2f3SEric Joyner "\t 0x8 - 20G\n" \ 213ceebc2f3SEric Joyner "\t0x10 - 25G\n" \ 2142984a8ddSEric Joyner "\t0x20 - 40G\n" \ 2152984a8ddSEric Joyner "\t0x40 - 2.5G\n" \ 2162984a8ddSEric Joyner "\t0x80 - 5G\n\n" \ 217ceebc2f3SEric Joyner "Use \"sysctl -x\" to view flags properly." 218ceebc2f3SEric Joyner 21995bb0504SEric Joyner #define IXL_SYSCTL_HELP_FC \ 22095bb0504SEric Joyner "\nSet flow control mode using the values below.\n" \ 22195bb0504SEric Joyner "\t0 - off\n" \ 22295bb0504SEric Joyner "\t1 - rx pause\n" \ 22395bb0504SEric Joyner "\t2 - tx pause\n" \ 22495bb0504SEric Joyner "\t3 - tx and rx pause" 22595bb0504SEric Joyner 22695bb0504SEric Joyner #define IXL_SYSCTL_HELP_LINK_STATUS \ 22795bb0504SEric Joyner "\nExecutes a \"Get Link Status\" command on the Admin Queue, and displays" \ 2281031d839SEric Joyner " the response." 22956c2c47bSJack F Vogel 230ceebc2f3SEric Joyner #define IXL_SYSCTL_HELP_FW_LLDP \ 231ceebc2f3SEric Joyner "\nFW LLDP engine:\n" \ 232ceebc2f3SEric Joyner "\t0 - disable\n" \ 233ceebc2f3SEric Joyner "\t1 - enable\n" 234ceebc2f3SEric Joyner 23521802a12SKrzysztof Galazka #define IXL_SYSCTL_HELP_SET_LINK_ACTIVE \ 23621802a12SKrzysztof Galazka "\nKeep link active after setting interface down:\n" \ 23721802a12SKrzysztof Galazka "\t0 - disable\n" \ 23821802a12SKrzysztof Galazka "\t1 - enable\n" 23921802a12SKrzysztof Galazka 2401031d839SEric Joyner #define IXL_SYSCTL_HELP_READ_I2C \ 2411031d839SEric Joyner "\nRead a byte from I2C bus\n" \ 2421031d839SEric Joyner "Input: 32-bit value\n" \ 2431031d839SEric Joyner "\tbits 0-7: device address (0xA0 or 0xA2)\n" \ 2441031d839SEric Joyner "\tbits 8-15: offset (0-255)\n" \ 2451031d839SEric Joyner "\tbits 16-31: unused\n" \ 2461031d839SEric Joyner "Output: 8-bit value read" 2471031d839SEric Joyner 2481031d839SEric Joyner #define IXL_SYSCTL_HELP_WRITE_I2C \ 2491031d839SEric Joyner "\nWrite a byte to the I2C bus\n" \ 2501031d839SEric Joyner "Input: 32-bit value\n" \ 2511031d839SEric Joyner "\tbits 0-7: device address (0xA0 or 0xA2)\n" \ 2521031d839SEric Joyner "\tbits 8-15: offset (0-255)\n" \ 2531031d839SEric Joyner "\tbits 16-23: value to write\n" \ 2541031d839SEric Joyner "\tbits 24-31: unused\n" \ 2551031d839SEric Joyner "Output: 8-bit value written" 2561031d839SEric Joyner 2571031d839SEric Joyner #define IXL_SYSCTL_HELP_I2C_METHOD \ 2581031d839SEric Joyner "\nI2C access method that driver will use:\n" \ 2591031d839SEric Joyner "\t0 - best available method\n" \ 2601031d839SEric Joyner "\t1 - bit bang via I2CPARAMS register\n" \ 2611031d839SEric Joyner "\t2 - register read/write via I2CCMD register\n" \ 2621031d839SEric Joyner "\t3 - Use Admin Queue command (best)\n" \ 2631031d839SEric Joyner "Using the Admin Queue is only supported on 710 devices with FW version 1.7 or higher" 2641031d839SEric Joyner 26577c1fcecSEric Joyner #define IXL_SYSCTL_HELP_VF_LOOPBACK \ 26677c1fcecSEric Joyner "\nDetermines mode that embedded device switch will use when SR-IOV is initialized:\n" \ 26777c1fcecSEric Joyner "\t0 - Disable (VEPA)\n" \ 26877c1fcecSEric Joyner "\t1 - Enable (VEB)\n" \ 26977c1fcecSEric Joyner "Enabling this will allow VFs in separate VMs to communicate over the hardware bridge." 27077c1fcecSEric Joyner 2711d767a8eSEric Joyner /*** Functions / Macros ***/ 272cb6b8299SEric Joyner /* Adjust the level here to 10 or over to print stats messages */ 273cb6b8299SEric Joyner #define I40E_VC_DEBUG(p, level, ...) \ 27456c2c47bSJack F Vogel do { \ 275cb6b8299SEric Joyner if (level < 10) \ 276cb6b8299SEric Joyner ixl_dbg(p, IXL_DBG_IOV_VC, ##__VA_ARGS__); \ 27756c2c47bSJack F Vogel } while (0) 27856c2c47bSJack F Vogel 27956c2c47bSJack F Vogel #define i40e_send_vf_nack(pf, vf, op, st) \ 28056c2c47bSJack F Vogel ixl_send_vf_nack_msg((pf), (vf), (op), (st), __FILE__, __LINE__) 28161ae650dSJack F Vogel 282cb6b8299SEric Joyner /* Debug printing */ 283b4a7ce06SEric Joyner #define ixl_dbg(pf, m, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, m, s, ##__VA_ARGS__) 284b4a7ce06SEric Joyner #define ixl_dbg_info(pf, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, IXL_DBG_INFO, s, ##__VA_ARGS__) 285b4a7ce06SEric Joyner #define ixl_dbg_filter(pf, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, IXL_DBG_FILTER, s, ##__VA_ARGS__) 286b4a7ce06SEric Joyner #define ixl_dbg_iov(pf, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, IXL_DBG_IOV, s, ##__VA_ARGS__) 287ba2f531fSKrzysztof Galazka #define ixl_dbg_link(pf, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, IXL_DBG_LINK, s, ##__VA_ARGS__) 288cb6b8299SEric Joyner 2891031d839SEric Joyner /* PF-only function declarations */ 290b8f51b8cSPiotr Kubaj void ixl_set_state(volatile u32 *s, enum ixl_state bit); 291b8f51b8cSPiotr Kubaj void ixl_clear_state(volatile u32 *s, enum ixl_state bit); 292b8f51b8cSPiotr Kubaj bool ixl_test_state(volatile u32 *s, enum ixl_state bit); 293b8f51b8cSPiotr Kubaj u32 ixl_testandset_state(volatile u32 *s, enum ixl_state bit); 2941031d839SEric Joyner int ixl_setup_interface(device_t, struct ixl_pf *); 2954294f337SSean Bruno void ixl_print_nvm_cmd(device_t, struct i40e_nvm_access *); 2964294f337SSean Bruno 2974294f337SSean Bruno void ixl_handle_que(void *context, int pending); 2984294f337SSean Bruno 2994294f337SSean Bruno void ixl_init(void *); 30086803260SJustin Hibbits void ixl_register_vlan(void *, if_t, u16); 30186803260SJustin Hibbits void ixl_unregister_vlan(void *, if_t, u16); 3021031d839SEric Joyner int ixl_intr(void *); 3031031d839SEric Joyner int ixl_msix_que(void *); 3041031d839SEric Joyner int ixl_msix_adminq(void *); 3054294f337SSean Bruno void ixl_do_adminq(void *, int); 3064294f337SSean Bruno 3074294f337SSean Bruno int ixl_res_alloc_cmp(const void *, const void *); 308b4a7ce06SEric Joyner const char * ixl_switch_res_type_string(u8); 3094294f337SSean Bruno void ixl_add_sysctls_mac_stats(struct sysctl_ctx_list *, 3104294f337SSean Bruno struct sysctl_oid_list *, struct i40e_hw_port_stats *); 3114294f337SSean Bruno 31286803260SJustin Hibbits void ixl_media_status(if_t, struct ifmediareq *); 31386803260SJustin Hibbits int ixl_media_change(if_t); 31486803260SJustin Hibbits int ixl_ioctl(if_t, u_long, caddr_t); 3154294f337SSean Bruno 3164294f337SSean Bruno void ixl_enable_queue(struct i40e_hw *, int); 3174294f337SSean Bruno void ixl_disable_queue(struct i40e_hw *, int); 318cb6b8299SEric Joyner void ixl_enable_intr0(struct i40e_hw *); 319cb6b8299SEric Joyner void ixl_disable_intr0(struct i40e_hw *); 3204294f337SSean Bruno void ixl_nvm_version_str(struct i40e_hw *hw, struct sbuf *buf); 321*fef4249fSEric Joyner void ixl_stat_update64(struct i40e_hw *, u32, bool, 322*fef4249fSEric Joyner u64 *, u64 *); 323*fef4249fSEric Joyner void ixl_stat_update48(struct i40e_hw *, u32, bool, 3244294f337SSean Bruno u64 *, u64 *); 3254294f337SSean Bruno void ixl_stat_update32(struct i40e_hw *, u32, bool, 3264294f337SSean Bruno u64 *, u64 *); 3274294f337SSean Bruno 3284294f337SSean Bruno void ixl_stop(struct ixl_pf *); 329b4a7ce06SEric Joyner void ixl_vsi_add_sysctls(struct ixl_vsi *, const char *, bool); 3304294f337SSean Bruno int ixl_get_hw_capabilities(struct ixl_pf *); 331cb6b8299SEric Joyner void ixl_link_up_msg(struct ixl_pf *); 3324294f337SSean Bruno void ixl_update_link_status(struct ixl_pf *); 3334294f337SSean Bruno int ixl_setup_stations(struct ixl_pf *); 3344294f337SSean Bruno int ixl_switch_config(struct ixl_pf *); 3354294f337SSean Bruno void ixl_stop_locked(struct ixl_pf *); 3364294f337SSean Bruno int ixl_teardown_hw_structs(struct ixl_pf *); 3374294f337SSean Bruno void ixl_init_locked(struct ixl_pf *); 3384294f337SSean Bruno void ixl_set_rss_key(struct ixl_pf *); 3394294f337SSean Bruno void ixl_set_rss_pctypes(struct ixl_pf *); 3404294f337SSean Bruno void ixl_set_rss_hlut(struct ixl_pf *); 3414294f337SSean Bruno int ixl_setup_adminq_msix(struct ixl_pf *); 3424294f337SSean Bruno int ixl_setup_adminq_tq(struct ixl_pf *); 343b4a7ce06SEric Joyner void ixl_teardown_adminq_msix(struct ixl_pf *); 3444294f337SSean Bruno void ixl_configure_intr0_msix(struct ixl_pf *); 3454294f337SSean Bruno void ixl_configure_queue_intr_msix(struct ixl_pf *); 3464294f337SSean Bruno void ixl_free_adminq_tq(struct ixl_pf *); 347cb6b8299SEric Joyner int ixl_setup_legacy(struct ixl_pf *); 3484294f337SSean Bruno int ixl_init_msix(struct ixl_pf *); 349b4a7ce06SEric Joyner void ixl_configure_tx_itr(struct ixl_pf *); 350b4a7ce06SEric Joyner void ixl_configure_rx_itr(struct ixl_pf *); 3514294f337SSean Bruno void ixl_configure_itr(struct ixl_pf *); 3524294f337SSean Bruno void ixl_configure_legacy(struct ixl_pf *); 3534294f337SSean Bruno void ixl_free_pci_resources(struct ixl_pf *); 3544294f337SSean Bruno void ixl_link_event(struct ixl_pf *, struct i40e_arq_event_info *); 3554294f337SSean Bruno void ixl_config_rss(struct ixl_pf *); 356ceebc2f3SEric Joyner int ixl_set_advertised_speeds(struct ixl_pf *, int, bool); 357ceebc2f3SEric Joyner void ixl_set_initial_advertised_speeds(struct ixl_pf *); 3584294f337SSean Bruno void ixl_print_nvm_version(struct ixl_pf *pf); 359b4a7ce06SEric Joyner void ixl_add_sysctls_recovery_mode(struct ixl_pf *); 3604294f337SSean Bruno void ixl_add_device_sysctls(struct ixl_pf *); 3614294f337SSean Bruno void ixl_handle_mdd_event(struct ixl_pf *); 3624294f337SSean Bruno void ixl_add_hw_stats(struct ixl_pf *); 3634294f337SSean Bruno void ixl_update_stats_counters(struct ixl_pf *); 3644294f337SSean Bruno void ixl_pf_reset_stats(struct ixl_pf *); 365cb6b8299SEric Joyner void ixl_get_bus_info(struct ixl_pf *pf); 366cb6b8299SEric Joyner int ixl_aq_get_link_status(struct ixl_pf *, 367cb6b8299SEric Joyner struct i40e_aqc_get_link_status *); 36821802a12SKrzysztof Galazka void ixl_set_link(struct ixl_pf *, bool); 3694294f337SSean Bruno 3704294f337SSean Bruno int ixl_handle_nvmupd_cmd(struct ixl_pf *, struct ifdrv *); 371b4a7ce06SEric Joyner int ixl_handle_i2c_eeprom_read_cmd(struct ixl_pf *, struct ifreq *ifr); 372b4a7ce06SEric Joyner 373b4a7ce06SEric Joyner int ixl_setup_hmc(struct ixl_pf *); 374b4a7ce06SEric Joyner void ixl_shutdown_hmc(struct ixl_pf *); 3754294f337SSean Bruno void ixl_handle_empr_reset(struct ixl_pf *); 376ceebc2f3SEric Joyner int ixl_prepare_for_reset(struct ixl_pf *pf, bool is_up); 377b4a7ce06SEric Joyner int ixl_rebuild_hw_structs_after_reset(struct ixl_pf *, bool is_up); 378b4a7ce06SEric Joyner int ixl_pf_reset(struct ixl_pf *); 3794294f337SSean Bruno 3801031d839SEric Joyner void ixl_set_queue_rx_itr(struct ixl_rx_queue *); 3811031d839SEric Joyner void ixl_set_queue_tx_itr(struct ixl_tx_queue *); 3824294f337SSean Bruno 38333c66d8aSRyan Libby void ixl_add_filter(struct ixl_vsi *, const u8 *, s16 vlan); 38433c66d8aSRyan Libby void ixl_del_filter(struct ixl_vsi *, const u8 *, s16 vlan); 3857d4dceecSKrzysztof Galazka void ixl_add_vlan_filters(struct ixl_vsi *, const u8 *); 3867d4dceecSKrzysztof Galazka void ixl_del_all_vlan_filters(struct ixl_vsi *, const u8 *); 3874294f337SSean Bruno void ixl_reconfigure_filters(struct ixl_vsi *vsi); 3884294f337SSean Bruno 38977c1fcecSEric Joyner int ixl_disable_rings(struct ixl_pf *, struct ixl_vsi *, struct ixl_pf_qtag *); 3904294f337SSean Bruno int ixl_disable_tx_ring(struct ixl_pf *, struct ixl_pf_qtag *, u16); 3914294f337SSean Bruno int ixl_disable_rx_ring(struct ixl_pf *, struct ixl_pf_qtag *, u16); 3924294f337SSean Bruno int ixl_disable_ring(struct ixl_pf *pf, struct ixl_pf_qtag *, u16); 3934294f337SSean Bruno 3944294f337SSean Bruno int ixl_enable_rings(struct ixl_vsi *); 3954294f337SSean Bruno int ixl_enable_tx_ring(struct ixl_pf *, struct ixl_pf_qtag *, u16); 3964294f337SSean Bruno int ixl_enable_rx_ring(struct ixl_pf *, struct ixl_pf_qtag *, u16); 3974294f337SSean Bruno int ixl_enable_ring(struct ixl_pf *pf, struct ixl_pf_qtag *, u16); 3984294f337SSean Bruno 3994294f337SSean Bruno void ixl_update_eth_stats(struct ixl_vsi *); 40086803260SJustin Hibbits void ixl_cap_txcsum_tso(struct ixl_vsi *, if_t, int); 4014294f337SSean Bruno int ixl_initialize_vsi(struct ixl_vsi *); 402b4a7ce06SEric Joyner void ixl_add_ifmedia(struct ifmedia *, u64); 4034294f337SSean Bruno int ixl_setup_queue_msix(struct ixl_vsi *); 4044294f337SSean Bruno int ixl_setup_queue_tqs(struct ixl_vsi *); 4054294f337SSean Bruno int ixl_teardown_queue_msix(struct ixl_vsi *); 4064294f337SSean Bruno void ixl_free_queue_tqs(struct ixl_vsi *); 4074294f337SSean Bruno void ixl_enable_intr(struct ixl_vsi *); 4084294f337SSean Bruno void ixl_disable_rings_intr(struct ixl_vsi *); 4094294f337SSean Bruno void ixl_set_promisc(struct ixl_vsi *); 4104294f337SSean Bruno void ixl_add_multi(struct ixl_vsi *); 4117d4dceecSKrzysztof Galazka void ixl_del_multi(struct ixl_vsi *, bool); 4124294f337SSean Bruno void ixl_setup_vlan_filters(struct ixl_vsi *); 4134294f337SSean Bruno void ixl_init_filters(struct ixl_vsi *); 4147d4dceecSKrzysztof Galazka void ixl_free_filters(struct ixl_ftl_head *); 4157d4dceecSKrzysztof Galazka void ixl_add_hw_filters(struct ixl_vsi *, struct ixl_ftl_head *, int); 4167d4dceecSKrzysztof Galazka void ixl_del_hw_filters(struct ixl_vsi *, struct ixl_ftl_head *, int); 41777c1fcecSEric Joyner void ixl_del_default_hw_filters(struct ixl_vsi *); 4184294f337SSean Bruno struct ixl_mac_filter * 4197d4dceecSKrzysztof Galazka ixl_find_filter(struct ixl_ftl_head *, const u8 *, s16); 4204294f337SSean Bruno void ixl_update_vsi_stats(struct ixl_vsi *); 4214294f337SSean Bruno void ixl_vsi_reset_stats(struct ixl_vsi *); 4224294f337SSean Bruno 423ceebc2f3SEric Joyner void ixl_vsi_free_queues(struct ixl_vsi *vsi); 424ceebc2f3SEric Joyner 4251031d839SEric Joyner void ixl_if_init(if_ctx_t ctx); 4261031d839SEric Joyner void ixl_if_stop(if_ctx_t ctx); 4271031d839SEric Joyner 428cb6b8299SEric Joyner /* 429cb6b8299SEric Joyner * I2C Function prototypes 430cb6b8299SEric Joyner */ 431cb6b8299SEric Joyner int ixl_find_i2c_interface(struct ixl_pf *); 4321031d839SEric Joyner s32 ixl_read_i2c_byte_bb(struct ixl_pf *pf, u8 byte_offset, 433cb6b8299SEric Joyner u8 dev_addr, u8 *data); 4341031d839SEric Joyner s32 ixl_write_i2c_byte_bb(struct ixl_pf *pf, u8 byte_offset, 4351031d839SEric Joyner u8 dev_addr, u8 data); 4361031d839SEric Joyner s32 ixl_read_i2c_byte_reg(struct ixl_pf *pf, u8 byte_offset, 4371031d839SEric Joyner u8 dev_addr, u8 *data); 4381031d839SEric Joyner s32 ixl_write_i2c_byte_reg(struct ixl_pf *pf, u8 byte_offset, 4391031d839SEric Joyner u8 dev_addr, u8 data); 4401031d839SEric Joyner s32 ixl_read_i2c_byte_aq(struct ixl_pf *pf, u8 byte_offset, 4411031d839SEric Joyner u8 dev_addr, u8 *data); 4421031d839SEric Joyner s32 ixl_write_i2c_byte_aq(struct ixl_pf *pf, u8 byte_offset, 443cb6b8299SEric Joyner u8 dev_addr, u8 data); 444cb6b8299SEric Joyner 44577c1fcecSEric Joyner u64 ixl_max_aq_speed_to_value(u8); 446b4a7ce06SEric Joyner int ixl_attach_get_link_status(struct ixl_pf *); 447b4a7ce06SEric Joyner int ixl_sysctl_set_flowcntl(SYSCTL_HANDLER_ARGS); 448ceebc2f3SEric Joyner 44961ae650dSJack F Vogel #endif /* _IXL_PF_H_ */ 450