aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/netdev.c
diff options
context:
space:
mode:
authorAjit Khaparde <ajitkhaparde@gmail.com>2009-10-06 22:44:26 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-08 01:00:24 -0400
commit7274c20f7b6a7bd6e3e8441e1727bf9cfd8235bb (patch)
treea46cdcbea0a4cee1952b539b742aaf1ac1bc590c /drivers/net/e1000e/netdev.c
parent72dad218f872dbd53f5dc5df9df45709e4b77870 (diff)
e1000e: Use the instance of net_device_stats from net_device.
Since net_device has an instance of net_device_stats, we can remove the instance of this from the private adapter structure. Signed-off-by: Ajit Khaparde <ajitk@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000e/netdev.c')
-rw-r--r--drivers/net/e1000e/netdev.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 0687c6aa4e46..21af3984e5c2 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -560,8 +560,8 @@ next_desc:
560 560
561 adapter->total_rx_bytes += total_rx_bytes; 561 adapter->total_rx_bytes += total_rx_bytes;
562 adapter->total_rx_packets += total_rx_packets; 562 adapter->total_rx_packets += total_rx_packets;
563 adapter->net_stats.rx_bytes += total_rx_bytes; 563 netdev->stats.rx_bytes += total_rx_bytes;
564 adapter->net_stats.rx_packets += total_rx_packets; 564 netdev->stats.rx_packets += total_rx_packets;
565 return cleaned; 565 return cleaned;
566} 566}
567 567
@@ -690,8 +690,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
690 } 690 }
691 adapter->total_tx_bytes += total_tx_bytes; 691 adapter->total_tx_bytes += total_tx_bytes;
692 adapter->total_tx_packets += total_tx_packets; 692 adapter->total_tx_packets += total_tx_packets;
693 adapter->net_stats.tx_bytes += total_tx_bytes; 693 netdev->stats.tx_bytes += total_tx_bytes;
694 adapter->net_stats.tx_packets += total_tx_packets; 694 netdev->stats.tx_packets += total_tx_packets;
695 return (count < tx_ring->count); 695 return (count < tx_ring->count);
696} 696}
697 697
@@ -871,8 +871,8 @@ next_desc:
871 871
872 adapter->total_rx_bytes += total_rx_bytes; 872 adapter->total_rx_bytes += total_rx_bytes;
873 adapter->total_rx_packets += total_rx_packets; 873 adapter->total_rx_packets += total_rx_packets;
874 adapter->net_stats.rx_bytes += total_rx_bytes; 874 netdev->stats.rx_bytes += total_rx_bytes;
875 adapter->net_stats.rx_packets += total_rx_packets; 875 netdev->stats.rx_packets += total_rx_packets;
876 return cleaned; 876 return cleaned;
877} 877}
878 878
@@ -1051,8 +1051,8 @@ next_desc:
1051 1051
1052 adapter->total_rx_bytes += total_rx_bytes; 1052 adapter->total_rx_bytes += total_rx_bytes;
1053 adapter->total_rx_packets += total_rx_packets; 1053 adapter->total_rx_packets += total_rx_packets;
1054 adapter->net_stats.rx_bytes += total_rx_bytes; 1054 netdev->stats.rx_bytes += total_rx_bytes;
1055 adapter->net_stats.rx_packets += total_rx_packets; 1055 netdev->stats.rx_packets += total_rx_packets;
1056 return cleaned; 1056 return cleaned;
1057} 1057}
1058 1058
@@ -3287,6 +3287,7 @@ static void e1000_update_phy_info(unsigned long data)
3287 **/ 3287 **/
3288void e1000e_update_stats(struct e1000_adapter *adapter) 3288void e1000e_update_stats(struct e1000_adapter *adapter)
3289{ 3289{
3290 struct net_device *netdev = adapter->netdev;
3290 struct e1000_hw *hw = &adapter->hw; 3291 struct e1000_hw *hw = &adapter->hw;
3291 struct pci_dev *pdev = adapter->pdev; 3292 struct pci_dev *pdev = adapter->pdev;
3292 u16 phy_data; 3293 u16 phy_data;
@@ -3381,8 +3382,8 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
3381 adapter->stats.tsctfc += er32(TSCTFC); 3382 adapter->stats.tsctfc += er32(TSCTFC);
3382 3383
3383 /* Fill out the OS statistics structure */ 3384 /* Fill out the OS statistics structure */
3384 adapter->net_stats.multicast = adapter->stats.mprc; 3385 netdev->stats.multicast = adapter->stats.mprc;
3385 adapter->net_stats.collisions = adapter->stats.colc; 3386 netdev->stats.collisions = adapter->stats.colc;
3386 3387
3387 /* Rx Errors */ 3388 /* Rx Errors */
3388 3389
@@ -3390,22 +3391,22 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
3390 * RLEC on some newer hardware can be incorrect so build 3391 * RLEC on some newer hardware can be incorrect so build
3391 * our own version based on RUC and ROC 3392 * our own version based on RUC and ROC
3392 */ 3393 */
3393 adapter->net_stats.rx_errors = adapter->stats.rxerrc + 3394 netdev->stats.rx_errors = adapter->stats.rxerrc +
3394 adapter->stats.crcerrs + adapter->stats.algnerrc + 3395 adapter->stats.crcerrs + adapter->stats.algnerrc +
3395 adapter->stats.ruc + adapter->stats.roc + 3396 adapter->stats.ruc + adapter->stats.roc +
3396 adapter->stats.cexterr; 3397 adapter->stats.cexterr;
3397 adapter->net_stats.rx_length_errors = adapter->stats.ruc + 3398 netdev->stats.rx_length_errors = adapter->stats.ruc +
3398 adapter->stats.roc; 3399 adapter->stats.roc;
3399 adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs; 3400 netdev->stats.rx_crc_errors = adapter->stats.crcerrs;
3400 adapter->net_stats.rx_frame_errors = adapter->stats.algnerrc; 3401 netdev->stats.rx_frame_errors = adapter->stats.algnerrc;
3401 adapter->net_stats.rx_missed_errors = adapter->stats.mpc; 3402 netdev->stats.rx_missed_errors = adapter->stats.mpc;
3402 3403
3403 /* Tx Errors */ 3404 /* Tx Errors */
3404 adapter->net_stats.tx_errors = adapter->stats.ecol + 3405 netdev->stats.tx_errors = adapter->stats.ecol +
3405 adapter->stats.latecol; 3406 adapter->stats.latecol;
3406 adapter->net_stats.tx_aborted_errors = adapter->stats.ecol; 3407 netdev->stats.tx_aborted_errors = adapter->stats.ecol;
3407 adapter->net_stats.tx_window_errors = adapter->stats.latecol; 3408 netdev->stats.tx_window_errors = adapter->stats.latecol;
3408 adapter->net_stats.tx_carrier_errors = adapter->stats.tncrs; 3409 netdev->stats.tx_carrier_errors = adapter->stats.tncrs;
3409 3410
3410 /* Tx Dropped needs to be maintained elsewhere */ 3411 /* Tx Dropped needs to be maintained elsewhere */
3411 3412
@@ -4254,10 +4255,8 @@ static void e1000_reset_task(struct work_struct *work)
4254 **/ 4255 **/
4255static struct net_device_stats *e1000_get_stats(struct net_device *netdev) 4256static struct net_device_stats *e1000_get_stats(struct net_device *netdev)
4256{ 4257{
4257 struct e1000_adapter *adapter = netdev_priv(netdev);
4258
4259 /* only return the current stats */ 4258 /* only return the current stats */
4260 return &adapter->net_stats; 4259 return &netdev->stats;
4261} 4260}
4262 4261
4263/** 4262/**