提交 d3f65f7c 编写于 作者: E Eric Dumazet 提交者: David S. Miller

atl1: use netdev->stats

Get rid of private struct net_device_stats in "struct atl1e_adapter",
and use one provided in struct net_device instead.
Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 08baf561
...@@ -429,7 +429,6 @@ struct atl1e_adapter { ...@@ -429,7 +429,6 @@ struct atl1e_adapter {
struct mii_if_info mii; /* MII interface info */ struct mii_if_info mii; /* MII interface info */
struct atl1e_hw hw; struct atl1e_hw hw;
struct atl1e_hw_stats hw_stats; struct atl1e_hw_stats hw_stats;
struct net_device_stats net_stats;
bool have_msi; bool have_msi;
u32 wol; u32 wol;
......
...@@ -1153,7 +1153,7 @@ static struct net_device_stats *atl1e_get_stats(struct net_device *netdev) ...@@ -1153,7 +1153,7 @@ static struct net_device_stats *atl1e_get_stats(struct net_device *netdev)
{ {
struct atl1e_adapter *adapter = netdev_priv(netdev); struct atl1e_adapter *adapter = netdev_priv(netdev);
struct atl1e_hw_stats *hw_stats = &adapter->hw_stats; struct atl1e_hw_stats *hw_stats = &adapter->hw_stats;
struct net_device_stats *net_stats = &adapter->net_stats; struct net_device_stats *net_stats = &netdev->stats;
net_stats->rx_packets = hw_stats->rx_ok; net_stats->rx_packets = hw_stats->rx_ok;
net_stats->tx_packets = hw_stats->tx_ok; net_stats->tx_packets = hw_stats->tx_ok;
...@@ -1181,7 +1181,7 @@ static struct net_device_stats *atl1e_get_stats(struct net_device *netdev) ...@@ -1181,7 +1181,7 @@ static struct net_device_stats *atl1e_get_stats(struct net_device *netdev)
net_stats->tx_aborted_errors = hw_stats->tx_abort_col; net_stats->tx_aborted_errors = hw_stats->tx_abort_col;
net_stats->tx_window_errors = hw_stats->tx_late_col; net_stats->tx_window_errors = hw_stats->tx_late_col;
return &adapter->net_stats; return net_stats;
} }
static void atl1e_update_hw_stats(struct atl1e_adapter *adapter) static void atl1e_update_hw_stats(struct atl1e_adapter *adapter)
...@@ -1309,7 +1309,7 @@ static irqreturn_t atl1e_intr(int irq, void *data) ...@@ -1309,7 +1309,7 @@ static irqreturn_t atl1e_intr(int irq, void *data)
/* link event */ /* link event */
if (status & (ISR_GPHY | ISR_MANUAL)) { if (status & (ISR_GPHY | ISR_MANUAL)) {
adapter->net_stats.tx_carrier_errors++; netdev->stats.tx_carrier_errors++;
atl1e_link_chg_event(adapter); atl1e_link_chg_event(adapter);
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册