163b3bba8SJerry Jelinek /****************************************************************************** 2*48ed61a7SRobert Mustacchi SPDX-License-Identifier: BSD-3-Clause 39da57d7bSbt 4*48ed61a7SRobert Mustacchi Copyright (c) 2001-2017, Intel Corporation 563b3bba8SJerry Jelinek All rights reserved. 6*48ed61a7SRobert Mustacchi 7*48ed61a7SRobert Mustacchi Redistribution and use in source and binary forms, with or without 863b3bba8SJerry Jelinek modification, are permitted provided that the following conditions are met: 9*48ed61a7SRobert Mustacchi 10*48ed61a7SRobert Mustacchi 1. Redistributions of source code must retain the above copyright notice, 1163b3bba8SJerry Jelinek this list of conditions and the following disclaimer. 12*48ed61a7SRobert Mustacchi 13*48ed61a7SRobert Mustacchi 2. Redistributions in binary form must reproduce the above copyright 14*48ed61a7SRobert Mustacchi notice, this list of conditions and the following disclaimer in the 1563b3bba8SJerry Jelinek documentation and/or other materials provided with the distribution. 16*48ed61a7SRobert Mustacchi 17*48ed61a7SRobert Mustacchi 3. Neither the name of the Intel Corporation nor the names of its 18*48ed61a7SRobert Mustacchi contributors may be used to endorse or promote products derived from 1963b3bba8SJerry Jelinek this software without specific prior written permission. 20*48ed61a7SRobert Mustacchi 2163b3bba8SJerry Jelinek THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22*48ed61a7SRobert Mustacchi AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23*48ed61a7SRobert Mustacchi IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24*48ed61a7SRobert Mustacchi ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25*48ed61a7SRobert Mustacchi LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26*48ed61a7SRobert Mustacchi CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27*48ed61a7SRobert Mustacchi SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28*48ed61a7SRobert Mustacchi INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29*48ed61a7SRobert Mustacchi CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 3063b3bba8SJerry Jelinek ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 3163b3bba8SJerry Jelinek POSSIBILITY OF SUCH DAMAGE. 325b6dd21fSchenlu chen - Sun Microsystems - Beijing China 3363b3bba8SJerry Jelinek ******************************************************************************/ 34dc0cb1cdSDale Ghent /*$FreeBSD$*/ 359da57d7bSbt 3663b3bba8SJerry Jelinek #ifndef _IXGBE_API_H_ 3763b3bba8SJerry Jelinek #define _IXGBE_API_H_ 389da57d7bSbt 399da57d7bSbt #include "ixgbe_type.h" 409da57d7bSbt 41dc0cb1cdSDale Ghent void ixgbe_dcb_get_rtrup2tc(struct ixgbe_hw *hw, u8 *map); 42dc0cb1cdSDale Ghent 439da57d7bSbt s32 ixgbe_init_shared_code(struct ixgbe_hw *hw); 449da57d7bSbt 4569b5a878SDan McDonald extern s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw); 4669b5a878SDan McDonald extern s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw); 4769b5a878SDan McDonald extern s32 ixgbe_init_ops_X540(struct ixgbe_hw *hw); 48dc0cb1cdSDale Ghent extern s32 ixgbe_init_ops_X550(struct ixgbe_hw *hw); 49dc0cb1cdSDale Ghent extern s32 ixgbe_init_ops_X550EM(struct ixgbe_hw *hw); 50*48ed61a7SRobert Mustacchi extern s32 ixgbe_init_ops_X550EM_x(struct ixgbe_hw *hw); 51*48ed61a7SRobert Mustacchi extern s32 ixgbe_init_ops_X550EM_a(struct ixgbe_hw *hw); 5269b5a878SDan McDonald 539da57d7bSbt s32 ixgbe_set_mac_type(struct ixgbe_hw *hw); 549da57d7bSbt s32 ixgbe_init_hw(struct ixgbe_hw *hw); 559da57d7bSbt s32 ixgbe_reset_hw(struct ixgbe_hw *hw); 569da57d7bSbt s32 ixgbe_start_hw(struct ixgbe_hw *hw); 5719843f01SPaul Guo void ixgbe_enable_relaxed_ordering(struct ixgbe_hw *hw); 589da57d7bSbt s32 ixgbe_clear_hw_cntrs(struct ixgbe_hw *hw); 599da57d7bSbt enum ixgbe_media_type ixgbe_get_media_type(struct ixgbe_hw *hw); 609da57d7bSbt s32 ixgbe_get_mac_addr(struct ixgbe_hw *hw, u8 *mac_addr); 619da57d7bSbt s32 ixgbe_get_bus_info(struct ixgbe_hw *hw); 629da57d7bSbt u32 ixgbe_get_num_of_tx_queues(struct ixgbe_hw *hw); 639da57d7bSbt u32 ixgbe_get_num_of_rx_queues(struct ixgbe_hw *hw); 649da57d7bSbt s32 ixgbe_stop_adapter(struct ixgbe_hw *hw); 659da57d7bSbt s32 ixgbe_read_pba_num(struct ixgbe_hw *hw, u32 *pba_num); 6663b3bba8SJerry Jelinek s32 ixgbe_read_pba_string(struct ixgbe_hw *hw, u8 *pba_num, u32 pba_num_size); 679da57d7bSbt 689da57d7bSbt s32 ixgbe_identify_phy(struct ixgbe_hw *hw); 699da57d7bSbt s32 ixgbe_reset_phy(struct ixgbe_hw *hw); 709da57d7bSbt s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, 7169b5a878SDan McDonald u16 *phy_data); 729da57d7bSbt s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, 7369b5a878SDan McDonald u16 phy_data); 749da57d7bSbt 759da57d7bSbt s32 ixgbe_setup_phy_link(struct ixgbe_hw *hw); 76dc0cb1cdSDale Ghent s32 ixgbe_setup_internal_phy(struct ixgbe_hw *hw); 779da57d7bSbt s32 ixgbe_check_phy_link(struct ixgbe_hw *hw, 7869b5a878SDan McDonald ixgbe_link_speed *speed, 7969b5a878SDan McDonald bool *link_up); 8063b3bba8SJerry Jelinek s32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, 8169b5a878SDan McDonald ixgbe_link_speed speed, 8269b5a878SDan McDonald bool autoneg_wait_to_complete); 83dc0cb1cdSDale Ghent s32 ixgbe_set_phy_power(struct ixgbe_hw *, bool on); 845b6dd21fSchenlu chen - Sun Microsystems - Beijing China void ixgbe_disable_tx_laser(struct ixgbe_hw *hw); 855b6dd21fSchenlu chen - Sun Microsystems - Beijing China void ixgbe_enable_tx_laser(struct ixgbe_hw *hw); 865b6dd21fSchenlu chen - Sun Microsystems - Beijing China void ixgbe_flap_tx_laser(struct ixgbe_hw *hw); 873cfa0eb9Schenlu chen - Sun Microsystems - Beijing China s32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed, 88dc0cb1cdSDale Ghent bool autoneg_wait_to_complete); 89dc0cb1cdSDale Ghent s32 ixgbe_setup_mac_link(struct ixgbe_hw *hw, ixgbe_link_speed speed, 90dc0cb1cdSDale Ghent bool autoneg_wait_to_complete); 919da57d7bSbt s32 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed, 9269b5a878SDan McDonald bool *link_up, bool link_up_wait_to_complete); 939da57d7bSbt s32 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed, 9469b5a878SDan McDonald bool *autoneg); 959da57d7bSbt s32 ixgbe_led_on(struct ixgbe_hw *hw, u32 index); 969da57d7bSbt s32 ixgbe_led_off(struct ixgbe_hw *hw, u32 index); 979da57d7bSbt s32 ixgbe_blink_led_start(struct ixgbe_hw *hw, u32 index); 989da57d7bSbt s32 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index); 999da57d7bSbt 1009da57d7bSbt s32 ixgbe_init_eeprom_params(struct ixgbe_hw *hw); 1019da57d7bSbt s32 ixgbe_write_eeprom(struct ixgbe_hw *hw, u16 offset, u16 data); 10269b5a878SDan McDonald s32 ixgbe_write_eeprom_buffer(struct ixgbe_hw *hw, u16 offset, 10369b5a878SDan McDonald u16 words, u16 *data); 1049da57d7bSbt s32 ixgbe_read_eeprom(struct ixgbe_hw *hw, u16 offset, u16 *data); 10569b5a878SDan McDonald s32 ixgbe_read_eeprom_buffer(struct ixgbe_hw *hw, u16 offset, 10669b5a878SDan McDonald u16 words, u16 *data); 10769b5a878SDan McDonald 1089da57d7bSbt s32 ixgbe_validate_eeprom_checksum(struct ixgbe_hw *hw, u16 *checksum_val); 1099da57d7bSbt s32 ixgbe_update_eeprom_checksum(struct ixgbe_hw *hw); 1109da57d7bSbt 11173cd555cSBin Tu - Sun Microsystems - Beijing China s32 ixgbe_insert_mac_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq); 1129da57d7bSbt s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq, 11369b5a878SDan McDonald u32 enable_addr); 11413740cb2SPaul Guo s32 ixgbe_clear_rar(struct ixgbe_hw *hw, u32 index); 1159da57d7bSbt s32 ixgbe_set_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq); 11669b5a878SDan McDonald s32 ixgbe_set_vmdq_san_mac(struct ixgbe_hw *hw, u32 vmdq); 11713740cb2SPaul Guo s32 ixgbe_clear_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq); 1189da57d7bSbt s32 ixgbe_init_rx_addrs(struct ixgbe_hw *hw); 1199da57d7bSbt u32 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw); 1209da57d7bSbt s32 ixgbe_update_uc_addr_list(struct ixgbe_hw *hw, u8 *addr_list, 12169b5a878SDan McDonald u32 addr_count, ixgbe_mc_addr_itr func); 1229da57d7bSbt s32 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list, 12369b5a878SDan McDonald u32 mc_addr_count, ixgbe_mc_addr_itr func, 12469b5a878SDan McDonald bool clear); 1253cfa0eb9Schenlu chen - Sun Microsystems - Beijing China void ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr_list, u32 vmdq); 1269da57d7bSbt s32 ixgbe_enable_mc(struct ixgbe_hw *hw); 1279da57d7bSbt s32 ixgbe_disable_mc(struct ixgbe_hw *hw); 1289da57d7bSbt s32 ixgbe_clear_vfta(struct ixgbe_hw *hw); 12963b3bba8SJerry Jelinek s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan, 130*48ed61a7SRobert Mustacchi u32 vind, bool vlan_on, bool vlvf_bypass); 13169b5a878SDan McDonald s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind, 132*48ed61a7SRobert Mustacchi bool vlan_on, u32 *vfta_delta, u32 vfta, 133*48ed61a7SRobert Mustacchi bool vlvf_bypass); 13469b5a878SDan McDonald s32 ixgbe_fc_enable(struct ixgbe_hw *hw); 135dc0cb1cdSDale Ghent s32 ixgbe_setup_fc(struct ixgbe_hw *hw); 13669b5a878SDan McDonald s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build, 137*48ed61a7SRobert Mustacchi u8 ver, u16 len, char *driver_ver); 1389da57d7bSbt void ixgbe_set_mta(struct ixgbe_hw *hw, u8 *mc_addr); 1399da57d7bSbt s32 ixgbe_get_phy_firmware_version(struct ixgbe_hw *hw, 14069b5a878SDan McDonald u16 *firmware_version); 1419da57d7bSbt s32 ixgbe_read_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 *val); 1429da57d7bSbt s32 ixgbe_write_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 val); 14313740cb2SPaul Guo s32 ixgbe_init_uta_tables(struct ixgbe_hw *hw); 14413740cb2SPaul Guo s32 ixgbe_read_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 *eeprom_data); 145*48ed61a7SRobert Mustacchi u64 ixgbe_get_supported_physical_layer(struct ixgbe_hw *hw); 14673cd555cSBin Tu - Sun Microsystems - Beijing China s32 ixgbe_enable_rx_dma(struct ixgbe_hw *hw, u32 regval); 14769b5a878SDan McDonald s32 ixgbe_disable_sec_rx_path(struct ixgbe_hw *hw); 14869b5a878SDan McDonald s32 ixgbe_enable_sec_rx_path(struct ixgbe_hw *hw); 149dc0cb1cdSDale Ghent s32 ixgbe_mng_fw_enabled(struct ixgbe_hw *hw); 15073cd555cSBin Tu - Sun Microsystems - Beijing China s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw); 15169b5a878SDan McDonald s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 fdirctrl); 152dc0cb1cdSDale Ghent s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 fdirctrl, 153dc0cb1cdSDale Ghent bool cloud_mode); 154dc0cb1cdSDale Ghent void ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw, 155dc0cb1cdSDale Ghent union ixgbe_atr_hash_dword input, 156dc0cb1cdSDale Ghent union ixgbe_atr_hash_dword common, 157dc0cb1cdSDale Ghent u8 queue); 15869b5a878SDan McDonald s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, 159dc0cb1cdSDale Ghent union ixgbe_atr_input *input_mask, bool cloud_mode); 16069b5a878SDan McDonald s32 ixgbe_fdir_write_perfect_filter_82599(struct ixgbe_hw *hw, 16169b5a878SDan McDonald union ixgbe_atr_input *input, 162dc0cb1cdSDale Ghent u16 soft_id, u8 queue, bool cloud_mode); 16369b5a878SDan McDonald s32 ixgbe_fdir_erase_perfect_filter_82599(struct ixgbe_hw *hw, 16469b5a878SDan McDonald union ixgbe_atr_input *input, 16569b5a878SDan McDonald u16 soft_id); 16673cd555cSBin Tu - Sun Microsystems - Beijing China s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw, 16769b5a878SDan McDonald union ixgbe_atr_input *input, 16869b5a878SDan McDonald union ixgbe_atr_input *mask, 16969b5a878SDan McDonald u16 soft_id, 170dc0cb1cdSDale Ghent u8 queue, 171dc0cb1cdSDale Ghent bool cloud_mode); 17269b5a878SDan McDonald void ixgbe_atr_compute_perfect_hash_82599(union ixgbe_atr_input *input, 17369b5a878SDan McDonald union ixgbe_atr_input *mask); 17469b5a878SDan McDonald u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_hash_dword input, 17569b5a878SDan McDonald union ixgbe_atr_hash_dword common); 176dc0cb1cdSDale Ghent bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw); 17773cd555cSBin Tu - Sun Microsystems - Beijing China s32 ixgbe_read_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr, 17869b5a878SDan McDonald u8 *data); 179dc0cb1cdSDale Ghent s32 ixgbe_read_i2c_byte_unlocked(struct ixgbe_hw *hw, u8 byte_offset, 180dc0cb1cdSDale Ghent u8 dev_addr, u8 *data); 181*48ed61a7SRobert Mustacchi s32 ixgbe_read_link(struct ixgbe_hw *hw, u8 addr, u16 reg, u16 *val); 182*48ed61a7SRobert Mustacchi s32 ixgbe_read_link_unlocked(struct ixgbe_hw *hw, u8 addr, u16 reg, u16 *val); 18373cd555cSBin Tu - Sun Microsystems - Beijing China s32 ixgbe_write_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr, 18469b5a878SDan McDonald u8 data); 185dc0cb1cdSDale Ghent void ixgbe_set_fdir_drop_queue_82599(struct ixgbe_hw *hw, u8 dropqueue); 186dc0cb1cdSDale Ghent s32 ixgbe_write_i2c_byte_unlocked(struct ixgbe_hw *hw, u8 byte_offset, 187dc0cb1cdSDale Ghent u8 dev_addr, u8 data); 188*48ed61a7SRobert Mustacchi s32 ixgbe_write_link(struct ixgbe_hw *hw, u8 addr, u16 reg, u16 val); 189*48ed61a7SRobert Mustacchi s32 ixgbe_write_link_unlocked(struct ixgbe_hw *hw, u8 addr, u16 reg, u16 val); 19073cd555cSBin Tu - Sun Microsystems - Beijing China s32 ixgbe_write_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 eeprom_data); 19173cd555cSBin Tu - Sun Microsystems - Beijing China s32 ixgbe_get_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr); 19273cd555cSBin Tu - Sun Microsystems - Beijing China s32 ixgbe_set_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr); 19373cd555cSBin Tu - Sun Microsystems - Beijing China s32 ixgbe_get_device_caps(struct ixgbe_hw *hw, u16 *device_caps); 194dc0cb1cdSDale Ghent s32 ixgbe_acquire_swfw_semaphore(struct ixgbe_hw *hw, u32 mask); 195dc0cb1cdSDale Ghent void ixgbe_release_swfw_semaphore(struct ixgbe_hw *hw, u32 mask); 196*48ed61a7SRobert Mustacchi void ixgbe_init_swfw_semaphore(struct ixgbe_hw *hw); 1973cfa0eb9Schenlu chen - Sun Microsystems - Beijing China s32 ixgbe_get_wwn_prefix(struct ixgbe_hw *hw, u16 *wwnn_prefix, 19869b5a878SDan McDonald u16 *wwpn_prefix); 1995b6dd21fSchenlu chen - Sun Microsystems - Beijing China s32 ixgbe_get_fcoe_boot_status(struct ixgbe_hw *hw, u16 *bs); 200*48ed61a7SRobert Mustacchi s32 ixgbe_bypass_rw(struct ixgbe_hw *hw, u32 cmd, u32 *status); 201*48ed61a7SRobert Mustacchi s32 ixgbe_bypass_set(struct ixgbe_hw *hw, u32 cmd, u32 event, u32 action); 202*48ed61a7SRobert Mustacchi s32 ixgbe_bypass_rd_eep(struct ixgbe_hw *hw, u32 addr, u8 *value); 203*48ed61a7SRobert Mustacchi bool ixgbe_bypass_valid_rd(struct ixgbe_hw *hw, u32 in_reg, u32 out_reg); 204dc0cb1cdSDale Ghent s32 ixgbe_dmac_config(struct ixgbe_hw *hw); 205dc0cb1cdSDale Ghent s32 ixgbe_dmac_update_tcs(struct ixgbe_hw *hw); 206dc0cb1cdSDale Ghent s32 ixgbe_dmac_config_tcs(struct ixgbe_hw *hw); 207dc0cb1cdSDale Ghent s32 ixgbe_setup_eee(struct ixgbe_hw *hw, bool enable_eee); 208dc0cb1cdSDale Ghent void ixgbe_set_source_address_pruning(struct ixgbe_hw *hw, bool enable, 209dc0cb1cdSDale Ghent unsigned int vf); 210dc0cb1cdSDale Ghent void ixgbe_set_ethertype_anti_spoofing(struct ixgbe_hw *hw, bool enable, 211dc0cb1cdSDale Ghent int vf); 212dc0cb1cdSDale Ghent s32 ixgbe_read_iosf_sb_reg(struct ixgbe_hw *hw, u32 reg_addr, 213dc0cb1cdSDale Ghent u32 device_type, u32 *phy_data); 214dc0cb1cdSDale Ghent s32 ixgbe_write_iosf_sb_reg(struct ixgbe_hw *hw, u32 reg_addr, 215dc0cb1cdSDale Ghent u32 device_type, u32 phy_data); 216dc0cb1cdSDale Ghent void ixgbe_disable_mdd(struct ixgbe_hw *hw); 217dc0cb1cdSDale Ghent void ixgbe_enable_mdd(struct ixgbe_hw *hw); 218dc0cb1cdSDale Ghent void ixgbe_mdd_event(struct ixgbe_hw *hw, u32 *vf_bitmap); 219dc0cb1cdSDale Ghent void ixgbe_restore_mdd_vf(struct ixgbe_hw *hw, u32 vf); 220dc0cb1cdSDale Ghent s32 ixgbe_enter_lplu(struct ixgbe_hw *hw); 221dc0cb1cdSDale Ghent s32 ixgbe_handle_lasi(struct ixgbe_hw *hw); 222dc0cb1cdSDale Ghent void ixgbe_set_rate_select_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed); 223dc0cb1cdSDale Ghent void ixgbe_disable_rx(struct ixgbe_hw *hw); 224dc0cb1cdSDale Ghent void ixgbe_enable_rx(struct ixgbe_hw *hw); 225*48ed61a7SRobert Mustacchi s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg, 226*48ed61a7SRobert Mustacchi u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm); 2279da57d7bSbt 22863b3bba8SJerry Jelinek #endif /* _IXGBE_API_H_ */ 229