ixgbe_common.h revision 215911
1179055Sjfv/******************************************************************************
2171384Sjfv
3215911Sjfv  Copyright (c) 2001-2010, Intel Corporation
4171384Sjfv  All rights reserved.
5171384Sjfv
6171384Sjfv  Redistribution and use in source and binary forms, with or without
7171384Sjfv  modification, are permitted provided that the following conditions are met:
8171384Sjfv
9171384Sjfv   1. Redistributions of source code must retain the above copyright notice,
10171384Sjfv      this list of conditions and the following disclaimer.
11171384Sjfv
12171384Sjfv   2. Redistributions in binary form must reproduce the above copyright
13171384Sjfv      notice, this list of conditions and the following disclaimer in the
14171384Sjfv      documentation and/or other materials provided with the distribution.
15171384Sjfv
16171384Sjfv   3. Neither the name of the Intel Corporation nor the names of its
17171384Sjfv      contributors may be used to endorse or promote products derived from
18171384Sjfv      this software without specific prior written permission.
19171384Sjfv
20171384Sjfv  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21171384Sjfv  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22171384Sjfv  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23171384Sjfv  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24171384Sjfv  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25171384Sjfv  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26171384Sjfv  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27171384Sjfv  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28171384Sjfv  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29171384Sjfv  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30171384Sjfv  POSSIBILITY OF SUCH DAMAGE.
31171384Sjfv
32179055Sjfv******************************************************************************/
33179055Sjfv/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.h 215911 2010-11-26 22:46:32Z jfv $*/
34171384Sjfv
35171384Sjfv#ifndef _IXGBE_COMMON_H_
36171384Sjfv#define _IXGBE_COMMON_H_
37171384Sjfv
38171384Sjfv#include "ixgbe_type.h"
39190873Sjfv#define IXGBE_WRITE_REG64(hw, reg, value) \
40190873Sjfv	do { \
41190873Sjfv		IXGBE_WRITE_REG(hw, reg, (u32) value); \
42190873Sjfv		IXGBE_WRITE_REG(hw, reg + 4, (u32) (value >> 32)); \
43190873Sjfv	} while (0)
44171384Sjfv
45200239Sjfvu32 ixgbe_get_pcie_msix_count_generic(struct ixgbe_hw *hw);
46200239Sjfv
47179055Sjfvs32 ixgbe_init_ops_generic(struct ixgbe_hw *hw);
48171384Sjfvs32 ixgbe_init_hw_generic(struct ixgbe_hw *hw);
49171384Sjfvs32 ixgbe_start_hw_generic(struct ixgbe_hw *hw);
50215911Sjfvs32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw);
51171384Sjfvs32 ixgbe_clear_hw_cntrs_generic(struct ixgbe_hw *hw);
52179055Sjfvs32 ixgbe_read_pba_num_generic(struct ixgbe_hw *hw, u32 *pba_num);
53215911Sjfvs32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num,
54215911Sjfv                                  u32 pba_num_size);
55215911Sjfvs32 ixgbe_read_pba_length_generic(struct ixgbe_hw *hw, u32 *pba_num_size);
56171384Sjfvs32 ixgbe_get_mac_addr_generic(struct ixgbe_hw *hw, u8 *mac_addr);
57171384Sjfvs32 ixgbe_get_bus_info_generic(struct ixgbe_hw *hw);
58185352Sjfvvoid ixgbe_set_lan_id_multi_port_pcie(struct ixgbe_hw *hw);
59171384Sjfvs32 ixgbe_stop_adapter_generic(struct ixgbe_hw *hw);
60171384Sjfv
61171384Sjfvs32 ixgbe_led_on_generic(struct ixgbe_hw *hw, u32 index);
62171384Sjfvs32 ixgbe_led_off_generic(struct ixgbe_hw *hw, u32 index);
63171384Sjfv
64171384Sjfvs32 ixgbe_init_eeprom_params_generic(struct ixgbe_hw *hw);
65171384Sjfvs32 ixgbe_write_eeprom_generic(struct ixgbe_hw *hw, u16 offset, u16 data);
66200239Sjfvs32 ixgbe_read_eerd_generic(struct ixgbe_hw *hw, u16 offset, u16 *data);
67215911Sjfvs32 ixgbe_write_eewr_generic(struct ixgbe_hw *hw, u16 offset, u16 data);
68171384Sjfvs32 ixgbe_read_eeprom_bit_bang_generic(struct ixgbe_hw *hw, u16 offset,
69179055Sjfv                                       u16 *data);
70200239Sjfvu16 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw);
71171384Sjfvs32 ixgbe_validate_eeprom_checksum_generic(struct ixgbe_hw *hw,
72179055Sjfv                                           u16 *checksum_val);
73171384Sjfvs32 ixgbe_update_eeprom_checksum_generic(struct ixgbe_hw *hw);
74200239Sjfvs32 ixgbe_poll_eerd_eewr_done(struct ixgbe_hw *hw, u32 ee_reg);
75171384Sjfv
76179055Sjfvs32 ixgbe_set_rar_generic(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
77179055Sjfv                          u32 enable_addr);
78181003Sjfvs32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index);
79171384Sjfvs32 ixgbe_init_rx_addrs_generic(struct ixgbe_hw *hw);
80171384Sjfvs32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, u8 *mc_addr_list,
81179055Sjfv                                      u32 mc_addr_count,
82179055Sjfv                                      ixgbe_mc_addr_itr func);
83179055Sjfvs32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, u8 *addr_list,
84179055Sjfv                                      u32 addr_count, ixgbe_mc_addr_itr func);
85171384Sjfvs32 ixgbe_enable_mc_generic(struct ixgbe_hw *hw);
86171384Sjfvs32 ixgbe_disable_mc_generic(struct ixgbe_hw *hw);
87190873Sjfvs32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval);
88171384Sjfv
89190873Sjfvs32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num);
90190873Sjfvs32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw, s32 packtetbuf_num);
91185352Sjfvs32 ixgbe_fc_autoneg(struct ixgbe_hw *hw);
92185352Sjfv
93171384Sjfvs32 ixgbe_validate_mac_addr(u8 *mac_addr);
94171384Sjfvs32 ixgbe_acquire_swfw_sync(struct ixgbe_hw *hw, u16 mask);
95171384Sjfvvoid ixgbe_release_swfw_sync(struct ixgbe_hw *hw, u16 mask);
96171384Sjfvs32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw);
97171384Sjfv
98190873Sjfvs32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index);
99190873Sjfvs32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index);
100190873Sjfv
101200239Sjfvs32 ixgbe_get_san_mac_addr_generic(struct ixgbe_hw *hw, u8 *san_mac_addr);
102200239Sjfvs32 ixgbe_set_san_mac_addr_generic(struct ixgbe_hw *hw, u8 *san_mac_addr);
103200239Sjfv
104200239Sjfvs32 ixgbe_set_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq);
105200239Sjfvs32 ixgbe_clear_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq);
106200239Sjfvs32 ixgbe_insert_mac_addr_generic(struct ixgbe_hw *hw, u8 *addr, u32 vmdq);
107200239Sjfvs32 ixgbe_init_uta_tables_generic(struct ixgbe_hw *hw);
108200239Sjfvs32 ixgbe_set_vfta_generic(struct ixgbe_hw *hw, u32 vlan,
109200239Sjfv                         u32 vind, bool vlan_on);
110200239Sjfvs32 ixgbe_clear_vfta_generic(struct ixgbe_hw *hw);
111200239Sjfv
112200239Sjfvs32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw,
113200239Sjfv                               ixgbe_link_speed *speed,
114200239Sjfv                               bool *link_up, bool link_up_wait_to_complete);
115200239Sjfv
116200239Sjfvs32 ixgbe_get_wwn_prefix_generic(struct ixgbe_hw *hw, u16 *wwnn_prefix,
117200239Sjfv                                 u16 *wwpn_prefix);
118200239Sjfv
119215911Sjfvs32 ixgbe_get_fcoe_boot_status_generic(struct ixgbe_hw *hw, u16 *bs);
120215911Sjfvvoid ixgbe_set_mac_anti_spoofing(struct ixgbe_hw *hw, bool enable, int pf);
121215911Sjfvvoid ixgbe_set_vlan_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf);
122171384Sjfv#endif /* IXGBE_COMMON */
123