aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/e1000.h
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2008-04-23 14:09:00 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-04-25 02:07:11 -0400
commit7c25769f88ff0b186766d6a9f9390a2e9fd4670f (patch)
treec47607674ec0b14ddfc4f022822f49dbb9b4950f /drivers/net/e1000e/e1000.h
parentc9fcbf4774d7a29b73078017af25d100f152a4af (diff)
e1000e: cleanup several stats issues
Several stats registers are completely unused and we just waste pci bus time reading them. We also omit using the high 32 bits of the GORC/ GOTC counters. We can just read clear them and only read the low registers. Mii-tool can also break es2lan if it executes a MII PHY register ioctl while the device is in autonegotiation. Unfortunately it seems that several applications and installations still perform this ioctl call periodically and especially in this crucial startup time. We can fool the ioctl by providing fail safe information that mimics the "down" link state and only perform the dangerous PHY reads once after link comes up to fill in the real values. As long as link stays up the information will not change. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/e1000e/e1000.h')
-rw-r--r--drivers/net/e1000e/e1000.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 5a89dff52264..4d3d1c2991c9 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -147,6 +147,18 @@ struct e1000_ring {
147 struct e1000_queue_stats stats; 147 struct e1000_queue_stats stats;
148}; 148};
149 149
150/* PHY register snapshot values */
151struct e1000_phy_regs {
152 u16 bmcr; /* basic mode control register */
153 u16 bmsr; /* basic mode status register */
154 u16 advertise; /* auto-negotiation advertisement */
155 u16 lpa; /* link partner ability register */
156 u16 expansion; /* auto-negotiation expansion reg */
157 u16 ctrl1000; /* 1000BASE-T control register */
158 u16 stat1000; /* 1000BASE-T status register */
159 u16 estatus; /* extended status register */
160};
161
150/* board specific private data structure */ 162/* board specific private data structure */
151struct e1000_adapter { 163struct e1000_adapter {
152 struct timer_list watchdog_timer; 164 struct timer_list watchdog_timer;
@@ -202,8 +214,8 @@ struct e1000_adapter {
202 /* Tx stats */ 214 /* Tx stats */
203 u64 tpt_old; 215 u64 tpt_old;
204 u64 colc_old; 216 u64 colc_old;
205 u64 gotcl_old; 217 u32 gotc;
206 u32 gotcl; 218 u64 gotc_old;
207 u32 tx_timeout_count; 219 u32 tx_timeout_count;
208 u32 tx_fifo_head; 220 u32 tx_fifo_head;
209 u32 tx_head_addr; 221 u32 tx_head_addr;
@@ -227,8 +239,8 @@ struct e1000_adapter {
227 u64 hw_csum_err; 239 u64 hw_csum_err;
228 u64 hw_csum_good; 240 u64 hw_csum_good;
229 u64 rx_hdr_split; 241 u64 rx_hdr_split;
230 u64 gorcl_old; 242 u32 gorc;
231 u32 gorcl; 243 u64 gorc_old;
232 u32 alloc_rx_buff_failed; 244 u32 alloc_rx_buff_failed;
233 u32 rx_dma_failed; 245 u32 rx_dma_failed;
234 246
@@ -250,6 +262,9 @@ struct e1000_adapter {
250 struct e1000_phy_info phy_info; 262 struct e1000_phy_info phy_info;
251 struct e1000_phy_stats phy_stats; 263 struct e1000_phy_stats phy_stats;
252 264
265 /* Snapshot of PHY registers */
266 struct e1000_phy_regs phy_regs;
267
253 struct e1000_ring test_tx_ring; 268 struct e1000_ring test_tx_ring;
254 struct e1000_ring test_rx_ring; 269 struct e1000_ring test_rx_ring;
255 u32 test_icr; 270 u32 test_icr;
@@ -286,8 +301,6 @@ struct e1000_info {
286#define FLAG_HAS_CTRLEXT_ON_LOAD (1 << 5) 301#define FLAG_HAS_CTRLEXT_ON_LOAD (1 << 5)
287#define FLAG_HAS_SWSM_ON_LOAD (1 << 6) 302#define FLAG_HAS_SWSM_ON_LOAD (1 << 6)
288#define FLAG_HAS_JUMBO_FRAMES (1 << 7) 303#define FLAG_HAS_JUMBO_FRAMES (1 << 7)
289#define FLAG_HAS_STATS_ICR_ICT (1 << 9)
290#define FLAG_HAS_STATS_PTC_PRC (1 << 10)
291#define FLAG_HAS_SMART_POWER_DOWN (1 << 11) 304#define FLAG_HAS_SMART_POWER_DOWN (1 << 11)
292#define FLAG_IS_QUAD_PORT_A (1 << 12) 305#define FLAG_IS_QUAD_PORT_A (1 << 12)
293#define FLAG_IS_QUAD_PORT (1 << 13) 306#define FLAG_IS_QUAD_PORT (1 << 13)