ixgbe_api.h revision 215911
1179055Sjfv/******************************************************************************
2171384Sjfv
3205720Sjfv  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_api.h 215911 2010-11-26 22:46:32Z jfv $*/
34171384Sjfv
35171384Sjfv#ifndef _IXGBE_API_H_
36171384Sjfv#define _IXGBE_API_H_
37171384Sjfv
38171384Sjfv#include "ixgbe_type.h"
39171384Sjfv
40171384Sjfvs32 ixgbe_init_shared_code(struct ixgbe_hw *hw);
41171384Sjfv
42172043Sjfvs32 ixgbe_set_mac_type(struct ixgbe_hw *hw);
43171384Sjfvs32 ixgbe_init_hw(struct ixgbe_hw *hw);
44171384Sjfvs32 ixgbe_reset_hw(struct ixgbe_hw *hw);
45171384Sjfvs32 ixgbe_start_hw(struct ixgbe_hw *hw);
46205720Sjfvvoid ixgbe_enable_relaxed_ordering(struct ixgbe_hw *hw);
47171384Sjfvs32 ixgbe_clear_hw_cntrs(struct ixgbe_hw *hw);
48171384Sjfvenum ixgbe_media_type ixgbe_get_media_type(struct ixgbe_hw *hw);
49171384Sjfvs32 ixgbe_get_mac_addr(struct ixgbe_hw *hw, u8 *mac_addr);
50171384Sjfvs32 ixgbe_get_bus_info(struct ixgbe_hw *hw);
51171384Sjfvu32 ixgbe_get_num_of_tx_queues(struct ixgbe_hw *hw);
52171384Sjfvu32 ixgbe_get_num_of_rx_queues(struct ixgbe_hw *hw);
53171384Sjfvs32 ixgbe_stop_adapter(struct ixgbe_hw *hw);
54179055Sjfvs32 ixgbe_read_pba_num(struct ixgbe_hw *hw, u32 *pba_num);
55215911Sjfvs32 ixgbe_read_pba_string(struct ixgbe_hw *hw, u8 *pba_num, u32 pba_num_size);
56215911Sjfvs32 ixgbe_read_pba_length(struct ixgbe_hw *hw, u32 *pba_num_size);
57171384Sjfv
58171384Sjfvs32 ixgbe_identify_phy(struct ixgbe_hw *hw);
59171384Sjfvs32 ixgbe_reset_phy(struct ixgbe_hw *hw);
60171384Sjfvs32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
61179055Sjfv                       u16 *phy_data);
62171384Sjfvs32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
63179055Sjfv                        u16 phy_data);
64171384Sjfv
65179055Sjfvs32 ixgbe_setup_phy_link(struct ixgbe_hw *hw);
66179055Sjfvs32 ixgbe_check_phy_link(struct ixgbe_hw *hw,
67179055Sjfv                         ixgbe_link_speed *speed,
68179055Sjfv                         bool *link_up);
69179055Sjfvs32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw,
70179055Sjfv                               ixgbe_link_speed speed,
71179055Sjfv                               bool autoneg,
72179055Sjfv                               bool autoneg_wait_to_complete);
73215911Sjfvvoid ixgbe_disable_tx_laser(struct ixgbe_hw *hw);
74215911Sjfvvoid ixgbe_enable_tx_laser(struct ixgbe_hw *hw);
75215911Sjfvvoid ixgbe_flap_tx_laser(struct ixgbe_hw *hw);
76200239Sjfvs32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed,
77179055Sjfv                           bool autoneg, bool autoneg_wait_to_complete);
78171384Sjfvs32 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
79179055Sjfv                     bool *link_up, bool link_up_wait_to_complete);
80179055Sjfvs32 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
81179055Sjfv                            bool *autoneg);
82171384Sjfvs32 ixgbe_led_on(struct ixgbe_hw *hw, u32 index);
83171384Sjfvs32 ixgbe_led_off(struct ixgbe_hw *hw, u32 index);
84171384Sjfvs32 ixgbe_blink_led_start(struct ixgbe_hw *hw, u32 index);
85171384Sjfvs32 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index);
86171384Sjfv
87171384Sjfvs32 ixgbe_init_eeprom_params(struct ixgbe_hw *hw);
88171384Sjfvs32 ixgbe_write_eeprom(struct ixgbe_hw *hw, u16 offset, u16 data);
89171384Sjfvs32 ixgbe_read_eeprom(struct ixgbe_hw *hw, u16 offset, u16 *data);
90171384Sjfvs32 ixgbe_validate_eeprom_checksum(struct ixgbe_hw *hw, u16 *checksum_val);
91171384Sjfvs32 ixgbe_update_eeprom_checksum(struct ixgbe_hw *hw);
92171384Sjfv
93190873Sjfvs32 ixgbe_insert_mac_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq);
94179055Sjfvs32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
95179055Sjfv                  u32 enable_addr);
96181003Sjfvs32 ixgbe_clear_rar(struct ixgbe_hw *hw, u32 index);
97179055Sjfvs32 ixgbe_set_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq);
98181003Sjfvs32 ixgbe_clear_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq);
99171384Sjfvs32 ixgbe_init_rx_addrs(struct ixgbe_hw *hw);
100171384Sjfvu32 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw);
101179055Sjfvs32 ixgbe_update_uc_addr_list(struct ixgbe_hw *hw, u8 *addr_list,
102179055Sjfv                              u32 addr_count, ixgbe_mc_addr_itr func);
103171384Sjfvs32 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list,
104179055Sjfv                              u32 mc_addr_count, ixgbe_mc_addr_itr func);
105200239Sjfvvoid ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr_list, u32 vmdq);
106171384Sjfvs32 ixgbe_enable_mc(struct ixgbe_hw *hw);
107171384Sjfvs32 ixgbe_disable_mc(struct ixgbe_hw *hw);
108171384Sjfvs32 ixgbe_clear_vfta(struct ixgbe_hw *hw);
109171384Sjfvs32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan,
110179055Sjfv                   u32 vind, bool vlan_on);
111171384Sjfv
112190873Sjfvs32 ixgbe_fc_enable(struct ixgbe_hw *hw, s32 packetbuf_num);
113171384Sjfv
114171384Sjfvvoid ixgbe_set_mta(struct ixgbe_hw *hw, u8 *mc_addr);
115179055Sjfvs32 ixgbe_get_phy_firmware_version(struct ixgbe_hw *hw,
116179055Sjfv                                   u16 *firmware_version);
117172043Sjfvs32 ixgbe_read_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 *val);
118172043Sjfvs32 ixgbe_write_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 val);
119181003Sjfvs32 ixgbe_init_uta_tables(struct ixgbe_hw *hw);
120185352Sjfvs32 ixgbe_read_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 *eeprom_data);
121185352Sjfvu32 ixgbe_get_supported_physical_layer(struct ixgbe_hw *hw);
122190873Sjfvs32 ixgbe_enable_rx_dma(struct ixgbe_hw *hw, u32 regval);
123190873Sjfvs32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw);
124190873Sjfvs32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 pballoc);
125190873Sjfvs32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 pballoc);
126190873Sjfvs32 ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw,
127215911Sjfv                                          union ixgbe_atr_input *input,
128190873Sjfv                                          u8 queue);
129190873Sjfvs32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw,
130215911Sjfv                                        union ixgbe_atr_input *input,
131205720Sjfv                                        struct ixgbe_atr_input_masks *masks,
132190873Sjfv                                        u16 soft_id,
133190873Sjfv                                        u8 queue);
134215911Sjfvu16 ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *input, u32 key);
135215911Sjfvs32 ixgbe_atr_set_vlan_id_82599(union ixgbe_atr_input *input, __be16 vlan_id);
136215911Sjfvs32 ixgbe_atr_set_src_ipv4_82599(union ixgbe_atr_input *input, __be32 src_addr);
137215911Sjfvs32 ixgbe_atr_set_dst_ipv4_82599(union ixgbe_atr_input *input, __be32 dst_addr);
138215911Sjfvs32 ixgbe_atr_set_src_ipv6_82599(union ixgbe_atr_input *input, __be32 src_addr_0,
139215911Sjfv                                 __be32 src_addr_1, __be32 src_addr_2,
140215911Sjfv                                 __be32 src_addr_3);
141215911Sjfvs32 ixgbe_atr_set_dst_ipv6_82599(union ixgbe_atr_input *input, __be32 dst_addr_0,
142215911Sjfv                                 __be32 dst_addr_1, __be32 dst_addr_2,
143215911Sjfv                                 __be32 dst_addr_3);
144215911Sjfvs32 ixgbe_atr_set_src_port_82599(union ixgbe_atr_input *input, __be16 src_port);
145215911Sjfvs32 ixgbe_atr_set_dst_port_82599(union ixgbe_atr_input *input, __be16 dst_port);
146215911Sjfvs32 ixgbe_atr_set_flex_byte_82599(union ixgbe_atr_input *input, __be16 flex_byte);
147215911Sjfvs32 ixgbe_atr_set_vm_pool_82599(union ixgbe_atr_input *input, u8 vm_pool);
148215911Sjfvs32 ixgbe_atr_set_l4type_82599(union ixgbe_atr_input *input, u8 l4type);
149215911Sjfvs32 ixgbe_atr_get_vlan_id_82599(union ixgbe_atr_input *input, __be16 *vlan_id);
150215911Sjfvs32 ixgbe_atr_get_src_ipv4_82599(union ixgbe_atr_input *input, __be32 *src_addr);
151215911Sjfvs32 ixgbe_atr_get_dst_ipv4_82599(union ixgbe_atr_input *input, __be32 *dst_addr);
152215911Sjfvs32 ixgbe_atr_get_src_ipv6_82599(union ixgbe_atr_input *input, __be32 *src_addr_0,
153215911Sjfv                                 __be32 *src_addr_1, __be32 *src_addr_2,
154215911Sjfv                                 __be32 *src_addr_3);
155215911Sjfvs32 ixgbe_atr_get_dst_ipv6_82599(union ixgbe_atr_input *input, __be32 *dst_addr_0,
156215911Sjfv                                 __be32 *dst_addr_1, __be32 *dst_addr_2,
157215911Sjfv                                 __be32 *dst_addr_3);
158215911Sjfvs32 ixgbe_atr_get_src_port_82599(union ixgbe_atr_input *input, __be16 *src_port);
159215911Sjfvs32 ixgbe_atr_get_dst_port_82599(union ixgbe_atr_input *input, __be16 *dst_port);
160215911Sjfvs32 ixgbe_atr_get_flex_byte_82599(union ixgbe_atr_input *input,
161215911Sjfv                                  __be16 *flex_byte);
162215911Sjfvs32 ixgbe_atr_get_vm_pool_82599(union ixgbe_atr_input *input, u8 *vm_pool);
163215911Sjfvs32 ixgbe_atr_get_l4type_82599(union ixgbe_atr_input *input, u8 *l4type);
164190873Sjfvs32 ixgbe_read_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
165190873Sjfv                        u8 *data);
166190873Sjfvs32 ixgbe_write_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
167190873Sjfv                         u8 data);
168190873Sjfvs32 ixgbe_write_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 eeprom_data);
169190873Sjfvs32 ixgbe_get_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr);
170190873Sjfvs32 ixgbe_set_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr);
171190873Sjfvs32 ixgbe_get_device_caps(struct ixgbe_hw *hw, u16 *device_caps);
172194875Sjfvs32 ixgbe_acquire_swfw_semaphore(struct ixgbe_hw *hw, u16 mask);
173194875Sjfvvoid ixgbe_release_swfw_semaphore(struct ixgbe_hw *hw, u16 mask);
174200239Sjfvs32 ixgbe_get_wwn_prefix(struct ixgbe_hw *hw, u16 *wwnn_prefix,
175200239Sjfv                         u16 *wwpn_prefix);
176215911Sjfvs32 ixgbe_get_fcoe_boot_status(struct ixgbe_hw *hw, u16 *bs);
177171384Sjfv
178194875Sjfv
179171384Sjfv#endif /* _IXGBE_API_H_ */
180