aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgb/ixgb_main.c
diff options
context:
space:
mode:
authorAjit Khaparde <ajitkhaparde@gmail.com>2009-10-06 22:46:59 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-08 01:00:29 -0400
commit0cdc03698f2586923ad3b9fca06643ff5675f221 (patch)
treea403607562ecd5588b7735093ddbdb32d61f032a /drivers/net/ixgb/ixgb_main.c
parentbcc90f555b4eb82604436f7ab6a7853c4b5997a3 (diff)
ixgb: 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/ixgb/ixgb_main.c')
-rw-r--r--drivers/net/ixgb/ixgb_main.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 8aa44dca57eb..f9f633c134bd 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1537,9 +1537,7 @@ ixgb_tx_timeout_task(struct work_struct *work)
1537static struct net_device_stats * 1537static struct net_device_stats *
1538ixgb_get_stats(struct net_device *netdev) 1538ixgb_get_stats(struct net_device *netdev)
1539{ 1539{
1540 struct ixgb_adapter *adapter = netdev_priv(netdev); 1540 return &netdev->stats;
1541
1542 return &adapter->net_stats;
1543} 1541}
1544 1542
1545/** 1543/**
@@ -1676,16 +1674,16 @@ ixgb_update_stats(struct ixgb_adapter *adapter)
1676 1674
1677 /* Fill out the OS statistics structure */ 1675 /* Fill out the OS statistics structure */
1678 1676
1679 adapter->net_stats.rx_packets = adapter->stats.gprcl; 1677 netdev->stats.rx_packets = adapter->stats.gprcl;
1680 adapter->net_stats.tx_packets = adapter->stats.gptcl; 1678 netdev->stats.tx_packets = adapter->stats.gptcl;
1681 adapter->net_stats.rx_bytes = adapter->stats.gorcl; 1679 netdev->stats.rx_bytes = adapter->stats.gorcl;
1682 adapter->net_stats.tx_bytes = adapter->stats.gotcl; 1680 netdev->stats.tx_bytes = adapter->stats.gotcl;
1683 adapter->net_stats.multicast = adapter->stats.mprcl; 1681 netdev->stats.multicast = adapter->stats.mprcl;
1684 adapter->net_stats.collisions = 0; 1682 netdev->stats.collisions = 0;
1685 1683
1686 /* ignore RLEC as it reports errors for padded (<64bytes) frames 1684 /* ignore RLEC as it reports errors for padded (<64bytes) frames
1687 * with a length in the type/len field */ 1685 * with a length in the type/len field */
1688 adapter->net_stats.rx_errors = 1686 netdev->stats.rx_errors =
1689 /* adapter->stats.rnbc + */ adapter->stats.crcerrs + 1687 /* adapter->stats.rnbc + */ adapter->stats.crcerrs +
1690 adapter->stats.ruc + 1688 adapter->stats.ruc +
1691 adapter->stats.roc /*+ adapter->stats.rlec */ + 1689 adapter->stats.roc /*+ adapter->stats.rlec */ +
@@ -1693,21 +1691,21 @@ ixgb_update_stats(struct ixgb_adapter *adapter)
1693 adapter->stats.ecbc + adapter->stats.mpc; 1691 adapter->stats.ecbc + adapter->stats.mpc;
1694 1692
1695 /* see above 1693 /* see above
1696 * adapter->net_stats.rx_length_errors = adapter->stats.rlec; 1694 * netdev->stats.rx_length_errors = adapter->stats.rlec;
1697 */ 1695 */
1698 1696
1699 adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs; 1697 netdev->stats.rx_crc_errors = adapter->stats.crcerrs;
1700 adapter->net_stats.rx_fifo_errors = adapter->stats.mpc; 1698 netdev->stats.rx_fifo_errors = adapter->stats.mpc;
1701 adapter->net_stats.rx_missed_errors = adapter->stats.mpc; 1699 netdev->stats.rx_missed_errors = adapter->stats.mpc;
1702 adapter->net_stats.rx_over_errors = adapter->stats.mpc; 1700 netdev->stats.rx_over_errors = adapter->stats.mpc;
1703 1701
1704 adapter->net_stats.tx_errors = 0; 1702 netdev->stats.tx_errors = 0;
1705 adapter->net_stats.rx_frame_errors = 0; 1703 netdev->stats.rx_frame_errors = 0;
1706 adapter->net_stats.tx_aborted_errors = 0; 1704 netdev->stats.tx_aborted_errors = 0;
1707 adapter->net_stats.tx_carrier_errors = 0; 1705 netdev->stats.tx_carrier_errors = 0;
1708 adapter->net_stats.tx_fifo_errors = 0; 1706 netdev->stats.tx_fifo_errors = 0;
1709 adapter->net_stats.tx_heartbeat_errors = 0; 1707 netdev->stats.tx_heartbeat_errors = 0;
1710 adapter->net_stats.tx_window_errors = 0; 1708 netdev->stats.tx_window_errors = 0;
1711} 1709}
1712 1710
1713#define IXGB_MAX_INTR 10 1711#define IXGB_MAX_INTR 10