diff options
author | Nick Nunley <nicholasx.d.nunley@intel.com> | 2010-02-16 20:03:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 16:21:36 -0500 |
commit | 43915c7c9a99e38406103d9c72b73edeaa19d0ff (patch) | |
tree | 8bd6a84a28892e973b0e71c8baa4e68df90ed7ef /drivers/net/igb | |
parent | e6bdb6fefc590ad2fb5f79e1d1d3660afbc7c8ff (diff) |
igb: only read phy specific stats if in internal phy mode
There are a couple statistics registers that are not meant to
be read when in SGMII/serdes mode. This patch adds a check to
verify mode before reading and updating these statistics.
Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r-- | drivers/net/igb/igb_main.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index b989b34a4adb..cba0115a6a57 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -3975,7 +3975,7 @@ void igb_update_stats(struct igb_adapter *adapter) | |||
3975 | struct net_device_stats *net_stats = igb_get_stats(adapter->netdev); | 3975 | struct net_device_stats *net_stats = igb_get_stats(adapter->netdev); |
3976 | struct e1000_hw *hw = &adapter->hw; | 3976 | struct e1000_hw *hw = &adapter->hw; |
3977 | struct pci_dev *pdev = adapter->pdev; | 3977 | struct pci_dev *pdev = adapter->pdev; |
3978 | u32 rnbc; | 3978 | u32 rnbc, reg; |
3979 | u16 phy_tmp; | 3979 | u16 phy_tmp; |
3980 | int i; | 3980 | int i; |
3981 | u64 bytes, packets; | 3981 | u64 bytes, packets; |
@@ -4072,8 +4072,13 @@ void igb_update_stats(struct igb_adapter *adapter) | |||
4072 | adapter->stats.colc += rd32(E1000_COLC); | 4072 | adapter->stats.colc += rd32(E1000_COLC); |
4073 | 4073 | ||
4074 | adapter->stats.algnerrc += rd32(E1000_ALGNERRC); | 4074 | adapter->stats.algnerrc += rd32(E1000_ALGNERRC); |
4075 | adapter->stats.rxerrc += rd32(E1000_RXERRC); | 4075 | /* read internal phy specific stats */ |
4076 | adapter->stats.tncrs += rd32(E1000_TNCRS); | 4076 | reg = rd32(E1000_CTRL_EXT); |
4077 | if (!(reg & E1000_CTRL_EXT_LINK_MODE_MASK)) { | ||
4078 | adapter->stats.rxerrc += rd32(E1000_RXERRC); | ||
4079 | adapter->stats.tncrs += rd32(E1000_TNCRS); | ||
4080 | } | ||
4081 | |||
4077 | adapter->stats.tsctc += rd32(E1000_TSCTC); | 4082 | adapter->stats.tsctc += rd32(E1000_TSCTC); |
4078 | adapter->stats.tsctfc += rd32(E1000_TSCTFC); | 4083 | adapter->stats.tsctfc += rd32(E1000_TSCTFC); |
4079 | 4084 | ||