|
@@ -560,8 +560,8 @@ next_desc:
|
|
|
|
|
|
adapter->total_rx_bytes += total_rx_bytes;
|
|
adapter->total_rx_bytes += total_rx_bytes;
|
|
adapter->total_rx_packets += total_rx_packets;
|
|
adapter->total_rx_packets += total_rx_packets;
|
|
- adapter->net_stats.rx_bytes += total_rx_bytes;
|
|
|
|
- adapter->net_stats.rx_packets += total_rx_packets;
|
|
|
|
|
|
+ netdev->stats.rx_bytes += total_rx_bytes;
|
|
|
|
+ netdev->stats.rx_packets += total_rx_packets;
|
|
return cleaned;
|
|
return cleaned;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -690,8 +690,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
|
|
}
|
|
}
|
|
adapter->total_tx_bytes += total_tx_bytes;
|
|
adapter->total_tx_bytes += total_tx_bytes;
|
|
adapter->total_tx_packets += total_tx_packets;
|
|
adapter->total_tx_packets += total_tx_packets;
|
|
- adapter->net_stats.tx_bytes += total_tx_bytes;
|
|
|
|
- adapter->net_stats.tx_packets += total_tx_packets;
|
|
|
|
|
|
+ netdev->stats.tx_bytes += total_tx_bytes;
|
|
|
|
+ netdev->stats.tx_packets += total_tx_packets;
|
|
return (count < tx_ring->count);
|
|
return (count < tx_ring->count);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -871,8 +871,8 @@ next_desc:
|
|
|
|
|
|
adapter->total_rx_bytes += total_rx_bytes;
|
|
adapter->total_rx_bytes += total_rx_bytes;
|
|
adapter->total_rx_packets += total_rx_packets;
|
|
adapter->total_rx_packets += total_rx_packets;
|
|
- adapter->net_stats.rx_bytes += total_rx_bytes;
|
|
|
|
- adapter->net_stats.rx_packets += total_rx_packets;
|
|
|
|
|
|
+ netdev->stats.rx_bytes += total_rx_bytes;
|
|
|
|
+ netdev->stats.rx_packets += total_rx_packets;
|
|
return cleaned;
|
|
return cleaned;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1051,8 +1051,8 @@ next_desc:
|
|
|
|
|
|
adapter->total_rx_bytes += total_rx_bytes;
|
|
adapter->total_rx_bytes += total_rx_bytes;
|
|
adapter->total_rx_packets += total_rx_packets;
|
|
adapter->total_rx_packets += total_rx_packets;
|
|
- adapter->net_stats.rx_bytes += total_rx_bytes;
|
|
|
|
- adapter->net_stats.rx_packets += total_rx_packets;
|
|
|
|
|
|
+ netdev->stats.rx_bytes += total_rx_bytes;
|
|
|
|
+ netdev->stats.rx_packets += total_rx_packets;
|
|
return cleaned;
|
|
return cleaned;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3287,6 +3287,7 @@ static void e1000_update_phy_info(unsigned long data)
|
|
**/
|
|
**/
|
|
void e1000e_update_stats(struct e1000_adapter *adapter)
|
|
void e1000e_update_stats(struct e1000_adapter *adapter)
|
|
{
|
|
{
|
|
|
|
+ struct net_device *netdev = adapter->netdev;
|
|
struct e1000_hw *hw = &adapter->hw;
|
|
struct e1000_hw *hw = &adapter->hw;
|
|
struct pci_dev *pdev = adapter->pdev;
|
|
struct pci_dev *pdev = adapter->pdev;
|
|
u16 phy_data;
|
|
u16 phy_data;
|
|
@@ -3381,8 +3382,8 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
|
|
adapter->stats.tsctfc += er32(TSCTFC);
|
|
adapter->stats.tsctfc += er32(TSCTFC);
|
|
|
|
|
|
/* Fill out the OS statistics structure */
|
|
/* Fill out the OS statistics structure */
|
|
- adapter->net_stats.multicast = adapter->stats.mprc;
|
|
|
|
- adapter->net_stats.collisions = adapter->stats.colc;
|
|
|
|
|
|
+ netdev->stats.multicast = adapter->stats.mprc;
|
|
|
|
+ netdev->stats.collisions = adapter->stats.colc;
|
|
|
|
|
|
/* Rx Errors */
|
|
/* Rx Errors */
|
|
|
|
|
|
@@ -3390,22 +3391,22 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
|
|
* RLEC on some newer hardware can be incorrect so build
|
|
* RLEC on some newer hardware can be incorrect so build
|
|
* our own version based on RUC and ROC
|
|
* our own version based on RUC and ROC
|
|
*/
|
|
*/
|
|
- adapter->net_stats.rx_errors = adapter->stats.rxerrc +
|
|
|
|
|
|
+ netdev->stats.rx_errors = adapter->stats.rxerrc +
|
|
adapter->stats.crcerrs + adapter->stats.algnerrc +
|
|
adapter->stats.crcerrs + adapter->stats.algnerrc +
|
|
adapter->stats.ruc + adapter->stats.roc +
|
|
adapter->stats.ruc + adapter->stats.roc +
|
|
adapter->stats.cexterr;
|
|
adapter->stats.cexterr;
|
|
- adapter->net_stats.rx_length_errors = adapter->stats.ruc +
|
|
|
|
|
|
+ netdev->stats.rx_length_errors = adapter->stats.ruc +
|
|
adapter->stats.roc;
|
|
adapter->stats.roc;
|
|
- adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs;
|
|
|
|
- adapter->net_stats.rx_frame_errors = adapter->stats.algnerrc;
|
|
|
|
- adapter->net_stats.rx_missed_errors = adapter->stats.mpc;
|
|
|
|
|
|
+ netdev->stats.rx_crc_errors = adapter->stats.crcerrs;
|
|
|
|
+ netdev->stats.rx_frame_errors = adapter->stats.algnerrc;
|
|
|
|
+ netdev->stats.rx_missed_errors = adapter->stats.mpc;
|
|
|
|
|
|
/* Tx Errors */
|
|
/* Tx Errors */
|
|
- adapter->net_stats.tx_errors = adapter->stats.ecol +
|
|
|
|
|
|
+ netdev->stats.tx_errors = adapter->stats.ecol +
|
|
adapter->stats.latecol;
|
|
adapter->stats.latecol;
|
|
- adapter->net_stats.tx_aborted_errors = adapter->stats.ecol;
|
|
|
|
- adapter->net_stats.tx_window_errors = adapter->stats.latecol;
|
|
|
|
- adapter->net_stats.tx_carrier_errors = adapter->stats.tncrs;
|
|
|
|
|
|
+ netdev->stats.tx_aborted_errors = adapter->stats.ecol;
|
|
|
|
+ netdev->stats.tx_window_errors = adapter->stats.latecol;
|
|
|
|
+ netdev->stats.tx_carrier_errors = adapter->stats.tncrs;
|
|
|
|
|
|
/* Tx Dropped needs to be maintained elsewhere */
|
|
/* Tx Dropped needs to be maintained elsewhere */
|
|
|
|
|
|
@@ -4254,10 +4255,8 @@ static void e1000_reset_task(struct work_struct *work)
|
|
**/
|
|
**/
|
|
static struct net_device_stats *e1000_get_stats(struct net_device *netdev)
|
|
static struct net_device_stats *e1000_get_stats(struct net_device *netdev)
|
|
{
|
|
{
|
|
- struct e1000_adapter *adapter = netdev_priv(netdev);
|
|
|
|
-
|
|
|
|
/* only return the current stats */
|
|
/* only return the current stats */
|
|
- return &adapter->net_stats;
|
|
|
|
|
|
+ return &netdev->stats;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|