xref: /freebsd/sys/dev/ixgbe/ixgbe_common.h (revision 0ac6dfec68247cda47a7ca53c69ee8fc50e776b3)
19ca4041bSJack F Vogel /******************************************************************************
213705f88SJack F Vogel 
30ac6dfecSJack F Vogel   Copyright (c) 2001-2009, Intel Corporation
413705f88SJack F Vogel   All rights reserved.
513705f88SJack F Vogel 
613705f88SJack F Vogel   Redistribution and use in source and binary forms, with or without
713705f88SJack F Vogel   modification, are permitted provided that the following conditions are met:
813705f88SJack F Vogel 
913705f88SJack F Vogel    1. Redistributions of source code must retain the above copyright notice,
1013705f88SJack F Vogel       this list of conditions and the following disclaimer.
1113705f88SJack F Vogel 
1213705f88SJack F Vogel    2. Redistributions in binary form must reproduce the above copyright
1313705f88SJack F Vogel       notice, this list of conditions and the following disclaimer in the
1413705f88SJack F Vogel       documentation and/or other materials provided with the distribution.
1513705f88SJack F Vogel 
1613705f88SJack F Vogel    3. Neither the name of the Intel Corporation nor the names of its
1713705f88SJack F Vogel       contributors may be used to endorse or promote products derived from
1813705f88SJack F Vogel       this software without specific prior written permission.
1913705f88SJack F Vogel 
2013705f88SJack F Vogel   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2113705f88SJack F Vogel   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2213705f88SJack F Vogel   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2313705f88SJack F Vogel   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
2413705f88SJack F Vogel   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2513705f88SJack F Vogel   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2613705f88SJack F Vogel   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2713705f88SJack F Vogel   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2813705f88SJack F Vogel   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2913705f88SJack F Vogel   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3013705f88SJack F Vogel   POSSIBILITY OF SUCH DAMAGE.
3113705f88SJack F Vogel 
329ca4041bSJack F Vogel ******************************************************************************/
3313705f88SJack F Vogel /*$FreeBSD$*/
3413705f88SJack F Vogel 
3513705f88SJack F Vogel #ifndef _IXGBE_COMMON_H_
3613705f88SJack F Vogel #define _IXGBE_COMMON_H_
3713705f88SJack F Vogel 
3813705f88SJack F Vogel #include "ixgbe_type.h"
390ac6dfecSJack F Vogel #define IXGBE_WRITE_REG64(hw, reg, value) \
400ac6dfecSJack F Vogel 	do { \
410ac6dfecSJack F Vogel 		IXGBE_WRITE_REG(hw, reg, (u32) value); \
420ac6dfecSJack F Vogel 		IXGBE_WRITE_REG(hw, reg + 4, (u32) (value >> 32)); \
430ac6dfecSJack F Vogel 	} while (0)
4413705f88SJack F Vogel 
459ca4041bSJack F Vogel s32 ixgbe_init_ops_generic(struct ixgbe_hw *hw);
4613705f88SJack F Vogel s32 ixgbe_init_hw_generic(struct ixgbe_hw *hw);
4713705f88SJack F Vogel s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw);
4813705f88SJack F Vogel s32 ixgbe_clear_hw_cntrs_generic(struct ixgbe_hw *hw);
499ca4041bSJack F Vogel s32 ixgbe_read_pba_num_generic(struct ixgbe_hw *hw, u32 *pba_num);
5013705f88SJack F Vogel s32 ixgbe_get_mac_addr_generic(struct ixgbe_hw *hw, u8 *mac_addr);
5113705f88SJack F Vogel s32 ixgbe_get_bus_info_generic(struct ixgbe_hw *hw);
521b6e0dbaSJack F Vogel void ixgbe_set_lan_id_multi_port_pcie(struct ixgbe_hw *hw);
5313705f88SJack F Vogel s32 ixgbe_stop_adapter_generic(struct ixgbe_hw *hw);
5413705f88SJack F Vogel 
5513705f88SJack F Vogel s32 ixgbe_led_on_generic(struct ixgbe_hw *hw, u32 index);
5613705f88SJack F Vogel s32 ixgbe_led_off_generic(struct ixgbe_hw *hw, u32 index);
5713705f88SJack F Vogel 
5813705f88SJack F Vogel s32 ixgbe_init_eeprom_params_generic(struct ixgbe_hw *hw);
5913705f88SJack F Vogel s32 ixgbe_write_eeprom_generic(struct ixgbe_hw *hw, u16 offset, u16 data);
6013705f88SJack F Vogel s32 ixgbe_read_eeprom_generic(struct ixgbe_hw *hw, u16 offset, u16 *data);
6113705f88SJack F Vogel s32 ixgbe_read_eeprom_bit_bang_generic(struct ixgbe_hw *hw, u16 offset,
6213705f88SJack F Vogel                                        u16 *data);
6313705f88SJack F Vogel s32 ixgbe_validate_eeprom_checksum_generic(struct ixgbe_hw *hw,
6413705f88SJack F Vogel                                            u16 *checksum_val);
6513705f88SJack F Vogel s32 ixgbe_update_eeprom_checksum_generic(struct ixgbe_hw *hw);
6613705f88SJack F Vogel 
679ca4041bSJack F Vogel s32 ixgbe_set_rar_generic(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
689ca4041bSJack F Vogel                           u32 enable_addr);
695b7f4cedSJack F Vogel s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index);
7013705f88SJack F Vogel s32 ixgbe_init_rx_addrs_generic(struct ixgbe_hw *hw);
7113705f88SJack F Vogel s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, u8 *mc_addr_list,
729ca4041bSJack F Vogel                                       u32 mc_addr_count,
739ca4041bSJack F Vogel                                       ixgbe_mc_addr_itr func);
749ca4041bSJack F Vogel s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, u8 *addr_list,
759ca4041bSJack F Vogel                                       u32 addr_count, ixgbe_mc_addr_itr func);
760ac6dfecSJack F Vogel void ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq);
7713705f88SJack F Vogel s32 ixgbe_enable_mc_generic(struct ixgbe_hw *hw);
7813705f88SJack F Vogel s32 ixgbe_disable_mc_generic(struct ixgbe_hw *hw);
790ac6dfecSJack F Vogel s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval);
8013705f88SJack F Vogel 
810ac6dfecSJack F Vogel s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num);
820ac6dfecSJack F Vogel s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw, s32 packtetbuf_num);
831b6e0dbaSJack F Vogel s32 ixgbe_fc_autoneg(struct ixgbe_hw *hw);
841b6e0dbaSJack F Vogel 
8513705f88SJack F Vogel s32 ixgbe_validate_mac_addr(u8 *mac_addr);
8613705f88SJack F Vogel s32 ixgbe_acquire_swfw_sync(struct ixgbe_hw *hw, u16 mask);
8713705f88SJack F Vogel void ixgbe_release_swfw_sync(struct ixgbe_hw *hw, u16 mask);
8813705f88SJack F Vogel s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw);
8913705f88SJack F Vogel 
909ca4041bSJack F Vogel s32 ixgbe_read_analog_reg8_generic(struct ixgbe_hw *hw, u32 reg, u8 *val);
919ca4041bSJack F Vogel s32 ixgbe_write_analog_reg8_generic(struct ixgbe_hw *hw, u32 reg, u8 val);
920ac6dfecSJack F Vogel s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index);
930ac6dfecSJack F Vogel s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index);
940ac6dfecSJack F Vogel 
9513705f88SJack F Vogel #endif /* IXGBE_COMMON */
96