call_function_many: fix list delete vs add race
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / net / ixgbevf / vf.h
blob61f9dc831424143d02497b335387caba5bf65823
1 /*******************************************************************************
3 Intel 82599 Virtual Function driver
4 Copyright(c) 1999 - 2009 Intel Corporation.
6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License,
8 version 2, as published by the Free Software Foundation.
10 This program is distributed in the hope it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 more details.
15 You should have received a copy of the GNU General Public License along with
16 this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19 The full GNU General Public License is included in this distribution in
20 the file called "COPYING".
22 Contact Information:
23 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
24 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26 *******************************************************************************/
28 #ifndef __IXGBE_VF_H__
29 #define __IXGBE_VF_H__
31 #include <linux/pci.h>
32 #include <linux/delay.h>
33 #include <linux/interrupt.h>
34 #include <linux/if_ether.h>
35 #include <linux/netdevice.h>
37 #include "defines.h"
38 #include "regs.h"
39 #include "mbx.h"
41 struct ixgbe_hw;
43 /* iterator type for walking multicast address lists */
44 typedef u8* (*ixgbe_mc_addr_itr) (struct ixgbe_hw *hw, u8 **mc_addr_ptr,
45 u32 *vmdq);
46 struct ixgbe_mac_operations {
47 s32 (*init_hw)(struct ixgbe_hw *);
48 s32 (*reset_hw)(struct ixgbe_hw *);
49 s32 (*start_hw)(struct ixgbe_hw *);
50 s32 (*clear_hw_cntrs)(struct ixgbe_hw *);
51 enum ixgbe_media_type (*get_media_type)(struct ixgbe_hw *);
52 u32 (*get_supported_physical_layer)(struct ixgbe_hw *);
53 s32 (*get_mac_addr)(struct ixgbe_hw *, u8 *);
54 s32 (*stop_adapter)(struct ixgbe_hw *);
55 s32 (*get_bus_info)(struct ixgbe_hw *);
57 /* Link */
58 s32 (*setup_link)(struct ixgbe_hw *, ixgbe_link_speed, bool, bool);
59 s32 (*check_link)(struct ixgbe_hw *, ixgbe_link_speed *, bool *, bool);
60 s32 (*get_link_capabilities)(struct ixgbe_hw *, ixgbe_link_speed *,
61 bool *);
63 /* RAR, Multicast, VLAN */
64 s32 (*set_rar)(struct ixgbe_hw *, u32, u8 *, u32);
65 s32 (*init_rx_addrs)(struct ixgbe_hw *);
66 s32 (*update_mc_addr_list)(struct ixgbe_hw *, struct net_device *);
67 s32 (*enable_mc)(struct ixgbe_hw *);
68 s32 (*disable_mc)(struct ixgbe_hw *);
69 s32 (*clear_vfta)(struct ixgbe_hw *);
70 s32 (*set_vfta)(struct ixgbe_hw *, u32, u32, bool);
73 enum ixgbe_mac_type {
74 ixgbe_mac_unknown = 0,
75 ixgbe_mac_82599_vf,
76 ixgbe_num_macs
79 struct ixgbe_mac_info {
80 struct ixgbe_mac_operations ops;
81 u8 addr[6];
82 u8 perm_addr[6];
84 enum ixgbe_mac_type type;
86 s32 mc_filter_type;
88 bool get_link_status;
89 u32 max_tx_queues;
90 u32 max_rx_queues;
91 u32 max_msix_vectors;
94 struct ixgbe_mbx_operations {
95 s32 (*init_params)(struct ixgbe_hw *hw);
96 s32 (*read)(struct ixgbe_hw *, u32 *, u16);
97 s32 (*write)(struct ixgbe_hw *, u32 *, u16);
98 s32 (*read_posted)(struct ixgbe_hw *, u32 *, u16);
99 s32 (*write_posted)(struct ixgbe_hw *, u32 *, u16);
100 s32 (*check_for_msg)(struct ixgbe_hw *);
101 s32 (*check_for_ack)(struct ixgbe_hw *);
102 s32 (*check_for_rst)(struct ixgbe_hw *);
105 struct ixgbe_mbx_stats {
106 u32 msgs_tx;
107 u32 msgs_rx;
109 u32 acks;
110 u32 reqs;
111 u32 rsts;
114 struct ixgbe_mbx_info {
115 struct ixgbe_mbx_operations ops;
116 struct ixgbe_mbx_stats stats;
117 u32 timeout;
118 u32 udelay;
119 u32 v2p_mailbox;
120 u16 size;
123 struct ixgbe_hw {
124 void *back;
126 u8 __iomem *hw_addr;
128 struct ixgbe_mac_info mac;
129 struct ixgbe_mbx_info mbx;
131 u16 device_id;
132 u16 subsystem_vendor_id;
133 u16 subsystem_device_id;
134 u16 vendor_id;
136 u8 revision_id;
137 bool adapter_stopped;
140 struct ixgbevf_hw_stats {
141 u64 base_vfgprc;
142 u64 base_vfgptc;
143 u64 base_vfgorc;
144 u64 base_vfgotc;
145 u64 base_vfmprc;
147 u64 last_vfgprc;
148 u64 last_vfgptc;
149 u64 last_vfgorc;
150 u64 last_vfgotc;
151 u64 last_vfmprc;
153 u64 vfgprc;
154 u64 vfgptc;
155 u64 vfgorc;
156 u64 vfgotc;
157 u64 vfmprc;
159 u64 saved_reset_vfgprc;
160 u64 saved_reset_vfgptc;
161 u64 saved_reset_vfgorc;
162 u64 saved_reset_vfgotc;
163 u64 saved_reset_vfmprc;
166 struct ixgbevf_info {
167 enum ixgbe_mac_type mac;
168 struct ixgbe_mac_operations *mac_ops;
171 #endif /* __IXGBE_VF_H__ */