19ca4041bSJack F Vogel /****************************************************************************** 27282444bSPedro F. Giffuni SPDX-License-Identifier: BSD-3-Clause 313705f88SJack F Vogel 48455e365SKevin Bowling Copyright (c) 2001-2020, Intel Corporation 513705f88SJack F Vogel All rights reserved. 613705f88SJack F Vogel 713705f88SJack F Vogel Redistribution and use in source and binary forms, with or without 813705f88SJack F Vogel modification, are permitted provided that the following conditions are met: 913705f88SJack F Vogel 1013705f88SJack F Vogel 1. Redistributions of source code must retain the above copyright notice, 1113705f88SJack F Vogel this list of conditions and the following disclaimer. 1213705f88SJack F Vogel 1313705f88SJack F Vogel 2. Redistributions in binary form must reproduce the above copyright 1413705f88SJack F Vogel notice, this list of conditions and the following disclaimer in the 1513705f88SJack F Vogel documentation and/or other materials provided with the distribution. 1613705f88SJack F Vogel 1713705f88SJack F Vogel 3. Neither the name of the Intel Corporation nor the names of its 1813705f88SJack F Vogel contributors may be used to endorse or promote products derived from 1913705f88SJack F Vogel this software without specific prior written permission. 2013705f88SJack F Vogel 2113705f88SJack F Vogel THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 2213705f88SJack F Vogel AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2313705f88SJack F Vogel IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2413705f88SJack F Vogel ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 2513705f88SJack F Vogel LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2613705f88SJack F Vogel CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2713705f88SJack F Vogel SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2813705f88SJack F Vogel INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2913705f88SJack F Vogel CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 3013705f88SJack F Vogel ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 3113705f88SJack F Vogel POSSIBILITY OF SUCH DAMAGE. 3213705f88SJack F Vogel 339ca4041bSJack F Vogel ******************************************************************************/ 3413705f88SJack F Vogel 3513705f88SJack F Vogel #ifndef _IXGBE_API_H_ 3613705f88SJack F Vogel #define _IXGBE_API_H_ 3713705f88SJack F Vogel 3813705f88SJack F Vogel #include "ixgbe_type.h" 3913705f88SJack F Vogel 40fd75b91dSJack F Vogel void ixgbe_dcb_get_rtrup2tc(struct ixgbe_hw *hw, u8 *map); 41fd75b91dSJack F Vogel 4213705f88SJack F Vogel s32 ixgbe_init_shared_code(struct ixgbe_hw *hw); 4313705f88SJack F Vogel 4485d0a26eSJack F Vogel extern s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw); 4585d0a26eSJack F Vogel extern s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw); 4685d0a26eSJack F Vogel extern s32 ixgbe_init_ops_X540(struct ixgbe_hw *hw); 47758cc3dcSJack F Vogel extern s32 ixgbe_init_ops_X550(struct ixgbe_hw *hw); 48758cc3dcSJack F Vogel extern s32 ixgbe_init_ops_X550EM(struct ixgbe_hw *hw); 498eb6488eSEric Joyner extern s32 ixgbe_init_ops_X550EM_x(struct ixgbe_hw *hw); 508eb6488eSEric Joyner extern s32 ixgbe_init_ops_X550EM_a(struct ixgbe_hw *hw); 513f66b96dSKevin Bowling extern s32 ixgbe_init_ops_vf(struct ixgbe_hw *hw); 5285d0a26eSJack F Vogel 533ec35e52SJack F Vogel s32 ixgbe_set_mac_type(struct ixgbe_hw *hw); 5413705f88SJack F Vogel s32 ixgbe_init_hw(struct ixgbe_hw *hw); 5513705f88SJack F Vogel s32 ixgbe_reset_hw(struct ixgbe_hw *hw); 5613705f88SJack F Vogel s32 ixgbe_start_hw(struct ixgbe_hw *hw); 57c0014855SJack F Vogel void ixgbe_enable_relaxed_ordering(struct ixgbe_hw *hw); 5813705f88SJack F Vogel s32 ixgbe_clear_hw_cntrs(struct ixgbe_hw *hw); 5913705f88SJack F Vogel enum ixgbe_media_type ixgbe_get_media_type(struct ixgbe_hw *hw); 6013705f88SJack F Vogel s32 ixgbe_get_mac_addr(struct ixgbe_hw *hw, u8 *mac_addr); 6113705f88SJack F Vogel s32 ixgbe_get_bus_info(struct ixgbe_hw *hw); 6213705f88SJack F Vogel u32 ixgbe_get_num_of_tx_queues(struct ixgbe_hw *hw); 6313705f88SJack F Vogel u32 ixgbe_get_num_of_rx_queues(struct ixgbe_hw *hw); 6413705f88SJack F Vogel s32 ixgbe_stop_adapter(struct ixgbe_hw *hw); 659ca4041bSJack F Vogel s32 ixgbe_read_pba_num(struct ixgbe_hw *hw, u32 *pba_num); 661a4e3449SJack F Vogel s32 ixgbe_read_pba_string(struct ixgbe_hw *hw, u8 *pba_num, u32 pba_num_size); 6713705f88SJack F Vogel 6813705f88SJack F Vogel s32 ixgbe_identify_phy(struct ixgbe_hw *hw); 6913705f88SJack F Vogel s32 ixgbe_reset_phy(struct ixgbe_hw *hw); 7013705f88SJack F Vogel s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, 7113705f88SJack F Vogel u16 *phy_data); 7213705f88SJack F Vogel s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, 7313705f88SJack F Vogel u16 phy_data); 7413705f88SJack F Vogel 759ca4041bSJack F Vogel s32 ixgbe_setup_phy_link(struct ixgbe_hw *hw); 76758cc3dcSJack F Vogel s32 ixgbe_setup_internal_phy(struct ixgbe_hw *hw); 779ca4041bSJack F Vogel s32 ixgbe_check_phy_link(struct ixgbe_hw *hw, 789ca4041bSJack F Vogel ixgbe_link_speed *speed, 799ca4041bSJack F Vogel bool *link_up); 809ca4041bSJack F Vogel s32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, 819ca4041bSJack F Vogel ixgbe_link_speed speed, 829ca4041bSJack F Vogel bool autoneg_wait_to_complete); 83758cc3dcSJack F Vogel s32 ixgbe_set_phy_power(struct ixgbe_hw *, bool on); 841a4e3449SJack F Vogel void ixgbe_disable_tx_laser(struct ixgbe_hw *hw); 851a4e3449SJack F Vogel void ixgbe_enable_tx_laser(struct ixgbe_hw *hw); 861a4e3449SJack F Vogel void ixgbe_flap_tx_laser(struct ixgbe_hw *hw); 872969bf0eSJack F Vogel s32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed, 880ecc2ff0SJack F Vogel bool autoneg_wait_to_complete); 89758cc3dcSJack F Vogel s32 ixgbe_setup_mac_link(struct ixgbe_hw *hw, ixgbe_link_speed speed, 90758cc3dcSJack F Vogel bool autoneg_wait_to_complete); 9113705f88SJack F Vogel s32 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed, 929ca4041bSJack F Vogel bool *link_up, bool link_up_wait_to_complete); 939ca4041bSJack F Vogel s32 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed, 9413705f88SJack F Vogel bool *autoneg); 9513705f88SJack F Vogel s32 ixgbe_led_on(struct ixgbe_hw *hw, u32 index); 9613705f88SJack F Vogel s32 ixgbe_led_off(struct ixgbe_hw *hw, u32 index); 9713705f88SJack F Vogel s32 ixgbe_blink_led_start(struct ixgbe_hw *hw, u32 index); 9813705f88SJack F Vogel s32 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index); 9913705f88SJack F Vogel 10013705f88SJack F Vogel s32 ixgbe_init_eeprom_params(struct ixgbe_hw *hw); 10113705f88SJack F Vogel s32 ixgbe_write_eeprom(struct ixgbe_hw *hw, u16 offset, u16 data); 10285d0a26eSJack F Vogel s32 ixgbe_write_eeprom_buffer(struct ixgbe_hw *hw, u16 offset, 10385d0a26eSJack F Vogel u16 words, u16 *data); 10413705f88SJack F Vogel s32 ixgbe_read_eeprom(struct ixgbe_hw *hw, u16 offset, u16 *data); 10585d0a26eSJack F Vogel s32 ixgbe_read_eeprom_buffer(struct ixgbe_hw *hw, u16 offset, 10685d0a26eSJack F Vogel u16 words, u16 *data); 10785d0a26eSJack F Vogel 10813705f88SJack F Vogel s32 ixgbe_validate_eeprom_checksum(struct ixgbe_hw *hw, u16 *checksum_val); 10913705f88SJack F Vogel s32 ixgbe_update_eeprom_checksum(struct ixgbe_hw *hw); 11013705f88SJack F Vogel 1110ac6dfecSJack F Vogel s32 ixgbe_insert_mac_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq); 1129ca4041bSJack F Vogel s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq, 1139ca4041bSJack F Vogel u32 enable_addr); 1145b7f4cedSJack F Vogel s32 ixgbe_clear_rar(struct ixgbe_hw *hw, u32 index); 1159ca4041bSJack F Vogel s32 ixgbe_set_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq); 116a621e3c8SJack F Vogel s32 ixgbe_set_vmdq_san_mac(struct ixgbe_hw *hw, u32 vmdq); 1175b7f4cedSJack F Vogel s32 ixgbe_clear_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq); 11813705f88SJack F Vogel s32 ixgbe_init_rx_addrs(struct ixgbe_hw *hw); 11913705f88SJack F Vogel u32 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw); 1209ca4041bSJack F Vogel s32 ixgbe_update_uc_addr_list(struct ixgbe_hw *hw, u8 *addr_list, 1219ca4041bSJack F Vogel u32 addr_count, ixgbe_mc_addr_itr func); 12213705f88SJack F Vogel s32 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list, 12385d0a26eSJack F Vogel u32 mc_addr_count, ixgbe_mc_addr_itr func, 12485d0a26eSJack F Vogel bool clear); 1252969bf0eSJack F Vogel void ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr_list, u32 vmdq); 12613705f88SJack F Vogel s32 ixgbe_enable_mc(struct ixgbe_hw *hw); 12713705f88SJack F Vogel s32 ixgbe_disable_mc(struct ixgbe_hw *hw); 12813705f88SJack F Vogel s32 ixgbe_clear_vfta(struct ixgbe_hw *hw); 12913705f88SJack F Vogel s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan, 1308eb6488eSEric Joyner u32 vind, bool vlan_on, bool vlvf_bypass); 13185d0a26eSJack F Vogel s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind, 1328eb6488eSEric Joyner bool vlan_on, u32 *vfta_delta, u32 vfta, 1338eb6488eSEric Joyner bool vlvf_bypass); 134*f72de14eSKevin Bowling s32 ixgbe_toggle_txdctl(struct ixgbe_hw *hw, u32 vind); 135a621e3c8SJack F Vogel s32 ixgbe_fc_enable(struct ixgbe_hw *hw); 136758cc3dcSJack F Vogel s32 ixgbe_setup_fc(struct ixgbe_hw *hw); 13785d0a26eSJack F Vogel s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build, 1388eb6488eSEric Joyner u8 ver, u16 len, char *driver_ver); 1393f66b96dSKevin Bowling s32 ixgbe_get_thermal_sensor_data(struct ixgbe_hw *hw); 1403f66b96dSKevin Bowling s32 ixgbe_init_thermal_sensor_thresh(struct ixgbe_hw *hw); 14113705f88SJack F Vogel void ixgbe_set_mta(struct ixgbe_hw *hw, u8 *mc_addr); 1429ca4041bSJack F Vogel s32 ixgbe_get_phy_firmware_version(struct ixgbe_hw *hw, 1439ca4041bSJack F Vogel u16 *firmware_version); 1443ec35e52SJack F Vogel s32 ixgbe_read_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 *val); 1453ec35e52SJack F Vogel s32 ixgbe_write_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 val); 1465b7f4cedSJack F Vogel s32 ixgbe_init_uta_tables(struct ixgbe_hw *hw); 1471b6e0dbaSJack F Vogel s32 ixgbe_read_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 *eeprom_data); 1488eb6488eSEric Joyner u64 ixgbe_get_supported_physical_layer(struct ixgbe_hw *hw); 1490ac6dfecSJack F Vogel s32 ixgbe_enable_rx_dma(struct ixgbe_hw *hw, u32 regval); 15085d0a26eSJack F Vogel s32 ixgbe_disable_sec_rx_path(struct ixgbe_hw *hw); 15185d0a26eSJack F Vogel s32 ixgbe_enable_sec_rx_path(struct ixgbe_hw *hw); 1520ac6dfecSJack F Vogel s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw); 15385d0a26eSJack F Vogel s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 fdirctrl); 154758cc3dcSJack F Vogel s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 fdirctrl, 155758cc3dcSJack F Vogel bool cloud_mode); 156a9ca1c79SSean Bruno void ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw, 157182b3808SJack F Vogel union ixgbe_atr_hash_dword input, 158182b3808SJack F Vogel union ixgbe_atr_hash_dword common, 1590ac6dfecSJack F Vogel u8 queue); 16085d0a26eSJack F Vogel s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, 161758cc3dcSJack F Vogel union ixgbe_atr_input *input_mask, bool cloud_mode); 16285d0a26eSJack F Vogel s32 ixgbe_fdir_write_perfect_filter_82599(struct ixgbe_hw *hw, 16385d0a26eSJack F Vogel union ixgbe_atr_input *input, 164758cc3dcSJack F Vogel u16 soft_id, u8 queue, bool cloud_mode); 16585d0a26eSJack F Vogel s32 ixgbe_fdir_erase_perfect_filter_82599(struct ixgbe_hw *hw, 16685d0a26eSJack F Vogel union ixgbe_atr_input *input, 16785d0a26eSJack F Vogel u16 soft_id); 1680ac6dfecSJack F Vogel s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw, 1691a4e3449SJack F Vogel union ixgbe_atr_input *input, 17085d0a26eSJack F Vogel union ixgbe_atr_input *mask, 1710ac6dfecSJack F Vogel u16 soft_id, 172758cc3dcSJack F Vogel u8 queue, 173758cc3dcSJack F Vogel bool cloud_mode); 17485d0a26eSJack F Vogel void ixgbe_atr_compute_perfect_hash_82599(union ixgbe_atr_input *input, 17585d0a26eSJack F Vogel union ixgbe_atr_input *mask); 17685d0a26eSJack F Vogel u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_hash_dword input, 17785d0a26eSJack F Vogel union ixgbe_atr_hash_dword common); 1780ecc2ff0SJack F Vogel bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw); 1790ac6dfecSJack F Vogel s32 ixgbe_read_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr, 1800ac6dfecSJack F Vogel u8 *data); 1816f37f232SEric Joyner s32 ixgbe_read_i2c_byte_unlocked(struct ixgbe_hw *hw, u8 byte_offset, 1826f37f232SEric Joyner u8 dev_addr, u8 *data); 1838eb6488eSEric Joyner s32 ixgbe_read_link(struct ixgbe_hw *hw, u8 addr, u16 reg, u16 *val); 1848eb6488eSEric Joyner s32 ixgbe_read_link_unlocked(struct ixgbe_hw *hw, u8 addr, u16 reg, u16 *val); 1850ac6dfecSJack F Vogel s32 ixgbe_write_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr, 1860ac6dfecSJack F Vogel u8 data); 187a9ca1c79SSean Bruno void ixgbe_set_fdir_drop_queue_82599(struct ixgbe_hw *hw, u8 dropqueue); 1886f37f232SEric Joyner s32 ixgbe_write_i2c_byte_unlocked(struct ixgbe_hw *hw, u8 byte_offset, 1896f37f232SEric Joyner u8 dev_addr, u8 data); 1908eb6488eSEric Joyner s32 ixgbe_write_link(struct ixgbe_hw *hw, u8 addr, u16 reg, u16 val); 1918eb6488eSEric Joyner s32 ixgbe_write_link_unlocked(struct ixgbe_hw *hw, u8 addr, u16 reg, u16 val); 1920ac6dfecSJack F Vogel s32 ixgbe_write_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 eeprom_data); 1930ac6dfecSJack F Vogel s32 ixgbe_get_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr); 1940ac6dfecSJack F Vogel s32 ixgbe_set_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr); 1950ac6dfecSJack F Vogel s32 ixgbe_get_device_caps(struct ixgbe_hw *hw, u16 *device_caps); 196758cc3dcSJack F Vogel s32 ixgbe_acquire_swfw_semaphore(struct ixgbe_hw *hw, u32 mask); 197758cc3dcSJack F Vogel void ixgbe_release_swfw_semaphore(struct ixgbe_hw *hw, u32 mask); 1988eb6488eSEric Joyner void ixgbe_init_swfw_semaphore(struct ixgbe_hw *hw); 1992969bf0eSJack F Vogel s32 ixgbe_get_wwn_prefix(struct ixgbe_hw *hw, u16 *wwnn_prefix, 2002969bf0eSJack F Vogel u16 *wwpn_prefix); 2011a4e3449SJack F Vogel s32 ixgbe_get_fcoe_boot_status(struct ixgbe_hw *hw, u16 *bs); 2028eb6488eSEric Joyner s32 ixgbe_bypass_rw(struct ixgbe_hw *hw, u32 cmd, u32 *status); 2038eb6488eSEric Joyner s32 ixgbe_bypass_set(struct ixgbe_hw *hw, u32 cmd, u32 event, u32 action); 2048eb6488eSEric Joyner s32 ixgbe_bypass_rd_eep(struct ixgbe_hw *hw, u32 addr, u8 *value); 2058eb6488eSEric Joyner bool ixgbe_bypass_valid_rd(struct ixgbe_hw *hw, u32 in_reg, u32 out_reg); 206758cc3dcSJack F Vogel s32 ixgbe_dmac_config(struct ixgbe_hw *hw); 207758cc3dcSJack F Vogel s32 ixgbe_dmac_update_tcs(struct ixgbe_hw *hw); 208758cc3dcSJack F Vogel s32 ixgbe_dmac_config_tcs(struct ixgbe_hw *hw); 209758cc3dcSJack F Vogel s32 ixgbe_setup_eee(struct ixgbe_hw *hw, bool enable_eee); 210758cc3dcSJack F Vogel void ixgbe_set_source_address_pruning(struct ixgbe_hw *hw, bool enable, 211758cc3dcSJack F Vogel unsigned int vf); 212758cc3dcSJack F Vogel void ixgbe_set_ethertype_anti_spoofing(struct ixgbe_hw *hw, bool enable, 213758cc3dcSJack F Vogel int vf); 214758cc3dcSJack F Vogel s32 ixgbe_read_iosf_sb_reg(struct ixgbe_hw *hw, u32 reg_addr, 215758cc3dcSJack F Vogel u32 device_type, u32 *phy_data); 216758cc3dcSJack F Vogel s32 ixgbe_write_iosf_sb_reg(struct ixgbe_hw *hw, u32 reg_addr, 217758cc3dcSJack F Vogel u32 device_type, u32 phy_data); 218758cc3dcSJack F Vogel void ixgbe_disable_mdd(struct ixgbe_hw *hw); 219758cc3dcSJack F Vogel void ixgbe_enable_mdd(struct ixgbe_hw *hw); 220758cc3dcSJack F Vogel void ixgbe_mdd_event(struct ixgbe_hw *hw, u32 *vf_bitmap); 221758cc3dcSJack F Vogel void ixgbe_restore_mdd_vf(struct ixgbe_hw *hw, u32 vf); 222b622bdb4SXiaoyun Li bool ixgbe_fw_recovery_mode(struct ixgbe_hw *hw); 223758cc3dcSJack F Vogel s32 ixgbe_enter_lplu(struct ixgbe_hw *hw); 2246f37f232SEric Joyner s32 ixgbe_handle_lasi(struct ixgbe_hw *hw); 225758cc3dcSJack F Vogel void ixgbe_set_rate_select_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed); 226758cc3dcSJack F Vogel void ixgbe_disable_rx(struct ixgbe_hw *hw); 227758cc3dcSJack F Vogel void ixgbe_enable_rx(struct ixgbe_hw *hw); 2288eb6488eSEric Joyner s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg, 2298eb6488eSEric Joyner u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm); 230d8602bb9SJack F Vogel 23113705f88SJack F Vogel #endif /* _IXGBE_API_H_ */ 232