diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/benet/be.h | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/benet/be.h')
-rw-r--r-- | drivers/net/benet/be.h | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index 3b79a225628a..56387b191c96 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2005 - 2009 ServerEngines | 2 | * Copyright (C) 2005 - 2010 ServerEngines |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or | 5 | * This program is free software; you can redistribute it and/or |
@@ -29,26 +29,36 @@ | |||
29 | #include <linux/workqueue.h> | 29 | #include <linux/workqueue.h> |
30 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
31 | #include <linux/firmware.h> | 31 | #include <linux/firmware.h> |
32 | #include <linux/slab.h> | ||
32 | 33 | ||
33 | #include "be_hw.h" | 34 | #include "be_hw.h" |
34 | 35 | ||
35 | #define DRV_VER "2.101.205" | 36 | #define DRV_VER "2.102.147u" |
36 | #define DRV_NAME "be2net" | 37 | #define DRV_NAME "be2net" |
37 | #define BE_NAME "ServerEngines BladeEngine2 10Gbps NIC" | 38 | #define BE_NAME "ServerEngines BladeEngine2 10Gbps NIC" |
39 | #define BE3_NAME "ServerEngines BladeEngine3 10Gbps NIC" | ||
38 | #define OC_NAME "Emulex OneConnect 10Gbps NIC" | 40 | #define OC_NAME "Emulex OneConnect 10Gbps NIC" |
39 | #define DRV_DESC BE_NAME "Driver" | 41 | #define OC_NAME1 "Emulex OneConnect 10Gbps NIC (be3)" |
42 | #define DRV_DESC "ServerEngines BladeEngine 10Gbps NIC Driver" | ||
40 | 43 | ||
41 | #define BE_VENDOR_ID 0x19a2 | 44 | #define BE_VENDOR_ID 0x19a2 |
42 | #define BE_DEVICE_ID1 0x211 | 45 | #define BE_DEVICE_ID1 0x211 |
46 | #define BE_DEVICE_ID2 0x221 | ||
43 | #define OC_DEVICE_ID1 0x700 | 47 | #define OC_DEVICE_ID1 0x700 |
44 | #define OC_DEVICE_ID2 0x701 | 48 | #define OC_DEVICE_ID2 0x710 |
45 | 49 | ||
46 | static inline char *nic_name(struct pci_dev *pdev) | 50 | static inline char *nic_name(struct pci_dev *pdev) |
47 | { | 51 | { |
48 | if (pdev->device == OC_DEVICE_ID1 || pdev->device == OC_DEVICE_ID2) | 52 | switch (pdev->device) { |
53 | case OC_DEVICE_ID1: | ||
49 | return OC_NAME; | 54 | return OC_NAME; |
50 | else | 55 | case OC_DEVICE_ID2: |
56 | return OC_NAME1; | ||
57 | case BE_DEVICE_ID2: | ||
58 | return BE3_NAME; | ||
59 | default: | ||
51 | return BE_NAME; | 60 | return BE_NAME; |
61 | } | ||
52 | } | 62 | } |
53 | 63 | ||
54 | /* Number of bytes of an RX frame that are copied to skb->data */ | 64 | /* Number of bytes of an RX frame that are copied to skb->data */ |
@@ -142,6 +152,7 @@ struct be_eq_obj { | |||
142 | struct be_mcc_obj { | 152 | struct be_mcc_obj { |
143 | struct be_queue_info q; | 153 | struct be_queue_info q; |
144 | struct be_queue_info cq; | 154 | struct be_queue_info cq; |
155 | bool rearm_cq; | ||
145 | }; | 156 | }; |
146 | 157 | ||
147 | struct be_drvr_stats { | 158 | struct be_drvr_stats { |
@@ -154,17 +165,19 @@ struct be_drvr_stats { | |||
154 | ulong be_tx_jiffies; | 165 | ulong be_tx_jiffies; |
155 | u64 be_tx_bytes; | 166 | u64 be_tx_bytes; |
156 | u64 be_tx_bytes_prev; | 167 | u64 be_tx_bytes_prev; |
168 | u64 be_tx_pkts; | ||
157 | u32 be_tx_rate; | 169 | u32 be_tx_rate; |
158 | 170 | ||
159 | u32 cache_barrier[16]; | 171 | u32 cache_barrier[16]; |
160 | 172 | ||
161 | u32 be_ethrx_post_fail;/* number of ethrx buffer alloc failures */ | 173 | u32 be_ethrx_post_fail;/* number of ethrx buffer alloc failures */ |
162 | u32 be_polls; /* number of times NAPI called poll function */ | 174 | u32 be_rx_polls; /* number of times NAPI called poll function */ |
163 | u32 be_rx_events; /* number of ucast rx completion events */ | 175 | u32 be_rx_events; /* number of ucast rx completion events */ |
164 | u32 be_rx_compl; /* number of rx completion entries processed */ | 176 | u32 be_rx_compl; /* number of rx completion entries processed */ |
165 | ulong be_rx_jiffies; | 177 | ulong be_rx_jiffies; |
166 | u64 be_rx_bytes; | 178 | u64 be_rx_bytes; |
167 | u64 be_rx_bytes_prev; | 179 | u64 be_rx_bytes_prev; |
180 | u64 be_rx_pkts; | ||
168 | u32 be_rx_rate; | 181 | u32 be_rx_rate; |
169 | /* number of non ether type II frames dropped where | 182 | /* number of non ether type II frames dropped where |
170 | * frame len > length field of Mac Hdr */ | 183 | * frame len > length field of Mac Hdr */ |
@@ -181,7 +194,6 @@ struct be_drvr_stats { | |||
181 | 194 | ||
182 | struct be_stats_obj { | 195 | struct be_stats_obj { |
183 | struct be_drvr_stats drvr_stats; | 196 | struct be_drvr_stats drvr_stats; |
184 | struct net_device_stats net_stats; | ||
185 | struct be_dma_mem cmd; | 197 | struct be_dma_mem cmd; |
186 | }; | 198 | }; |
187 | 199 | ||
@@ -242,8 +254,10 @@ struct be_adapter { | |||
242 | bool rx_post_starved; /* Zero rx frags have been posted to BE */ | 254 | bool rx_post_starved; /* Zero rx frags have been posted to BE */ |
243 | 255 | ||
244 | struct vlan_group *vlan_grp; | 256 | struct vlan_group *vlan_grp; |
245 | u16 num_vlans; | 257 | u16 vlans_added; |
258 | u16 max_vlans; /* Number of vlans supported */ | ||
246 | u8 vlan_tag[VLAN_GROUP_ARRAY_LEN]; | 259 | u8 vlan_tag[VLAN_GROUP_ARRAY_LEN]; |
260 | struct be_dma_mem mc_cmd_mem; | ||
247 | 261 | ||
248 | struct be_stats_obj stats; | 262 | struct be_stats_obj stats; |
249 | /* Work queue used to perform periodic tasks like getting statistics */ | 263 | /* Work queue used to perform periodic tasks like getting statistics */ |
@@ -255,23 +269,28 @@ struct be_adapter { | |||
255 | u32 if_handle; /* Used to configure filtering */ | 269 | u32 if_handle; /* Used to configure filtering */ |
256 | u32 pmac_id; /* MAC addr handle used by BE card */ | 270 | u32 pmac_id; /* MAC addr handle used by BE card */ |
257 | 271 | ||
272 | bool eeh_err; | ||
258 | bool link_up; | 273 | bool link_up; |
259 | u32 port_num; | 274 | u32 port_num; |
260 | bool promiscuous; | 275 | bool promiscuous; |
276 | bool wol; | ||
261 | u32 cap; | 277 | u32 cap; |
262 | u32 rx_fc; /* Rx flow control */ | 278 | u32 rx_fc; /* Rx flow control */ |
263 | u32 tx_fc; /* Tx flow control */ | 279 | u32 tx_fc; /* Tx flow control */ |
280 | int link_speed; | ||
281 | u8 port_type; | ||
282 | u8 transceiver; | ||
283 | u8 generation; /* BladeEngine ASIC generation */ | ||
264 | }; | 284 | }; |
265 | 285 | ||
286 | /* BladeEngine Generation numbers */ | ||
287 | #define BE_GEN2 2 | ||
288 | #define BE_GEN3 3 | ||
289 | |||
266 | extern const struct ethtool_ops be_ethtool_ops; | 290 | extern const struct ethtool_ops be_ethtool_ops; |
267 | 291 | ||
268 | #define drvr_stats(adapter) (&adapter->stats.drvr_stats) | 292 | #define drvr_stats(adapter) (&adapter->stats.drvr_stats) |
269 | 293 | ||
270 | static inline unsigned int be_pci_func(struct be_adapter *adapter) | ||
271 | { | ||
272 | return PCI_FUNC(adapter->pdev->devfn); | ||
273 | } | ||
274 | |||
275 | #define BE_SET_NETDEV_OPS(netdev, ops) (netdev->netdev_ops = ops) | 294 | #define BE_SET_NETDEV_OPS(netdev, ops) (netdev->netdev_ops = ops) |
276 | 295 | ||
277 | #define PAGE_SHIFT_4K 12 | 296 | #define PAGE_SHIFT_4K 12 |