arlan: use netstats in net_device structure
Use net_device_stats from net_device structure instead of local. Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
15dbf1b7b7
commit
06a5223d68
@ -125,7 +125,7 @@ static inline int arlan_drop_tx(struct net_device *dev)
|
|||||||
{
|
{
|
||||||
struct arlan_private *priv = netdev_priv(dev);
|
struct arlan_private *priv = netdev_priv(dev);
|
||||||
|
|
||||||
priv->stats.tx_errors++;
|
dev->stats.tx_errors++;
|
||||||
if (priv->Conf->tx_delay_ms)
|
if (priv->Conf->tx_delay_ms)
|
||||||
{
|
{
|
||||||
priv->tx_done_delayed = jiffies + priv->Conf->tx_delay_ms * HZ / 1000 + 1;
|
priv->tx_done_delayed = jiffies + priv->Conf->tx_delay_ms * HZ / 1000 + 1;
|
||||||
@ -1269,7 +1269,7 @@ static void arlan_tx_done_interrupt(struct net_device *dev, int status)
|
|||||||
{
|
{
|
||||||
IFDEBUG(ARLAN_DEBUG_TX_CHAIN)
|
IFDEBUG(ARLAN_DEBUG_TX_CHAIN)
|
||||||
printk("arlan intr: transmit OK\n");
|
printk("arlan intr: transmit OK\n");
|
||||||
priv->stats.tx_packets++;
|
dev->stats.tx_packets++;
|
||||||
priv->bad = 0;
|
priv->bad = 0;
|
||||||
priv->reset = 0;
|
priv->reset = 0;
|
||||||
priv->retransmissions = 0;
|
priv->retransmissions = 0;
|
||||||
@ -1496,7 +1496,7 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
|
|||||||
if (skb == NULL)
|
if (skb == NULL)
|
||||||
{
|
{
|
||||||
printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", dev->name);
|
printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", dev->name);
|
||||||
priv->stats.rx_dropped++;
|
dev->stats.rx_dropped++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
skb_reserve(skb, 2);
|
skb_reserve(skb, 2);
|
||||||
@ -1536,14 +1536,14 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
|
|||||||
}
|
}
|
||||||
netif_rx(skb);
|
netif_rx(skb);
|
||||||
dev->last_rx = jiffies;
|
dev->last_rx = jiffies;
|
||||||
priv->stats.rx_packets++;
|
dev->stats.rx_packets++;
|
||||||
priv->stats.rx_bytes += pkt_len;
|
dev->stats.rx_bytes += pkt_len;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printk(KERN_ERR "arlan intr: received unknown status\n");
|
printk(KERN_ERR "arlan intr: received unknown status\n");
|
||||||
priv->stats.rx_crc_errors++;
|
dev->stats.rx_crc_errors++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ARLAN_DEBUG_EXIT("arlan_rx_interrupt");
|
ARLAN_DEBUG_EXIT("arlan_rx_interrupt");
|
||||||
@ -1719,23 +1719,23 @@ static struct net_device_stats *arlan_statistics(struct net_device *dev)
|
|||||||
|
|
||||||
/* Update the statistics from the device registers. */
|
/* Update the statistics from the device registers. */
|
||||||
|
|
||||||
READSHM(priv->stats.collisions, arlan->numReTransmissions, u_int);
|
READSHM(dev->stats.collisions, arlan->numReTransmissions, u_int);
|
||||||
READSHM(priv->stats.rx_crc_errors, arlan->numCRCErrors, u_int);
|
READSHM(dev->stats.rx_crc_errors, arlan->numCRCErrors, u_int);
|
||||||
READSHM(priv->stats.rx_dropped, arlan->numFramesDiscarded, u_int);
|
READSHM(dev->stats.rx_dropped, arlan->numFramesDiscarded, u_int);
|
||||||
READSHM(priv->stats.rx_fifo_errors, arlan->numRXBufferOverflows, u_int);
|
READSHM(dev->stats.rx_fifo_errors, arlan->numRXBufferOverflows, u_int);
|
||||||
READSHM(priv->stats.rx_frame_errors, arlan->numReceiveFramesLost, u_int);
|
READSHM(dev->stats.rx_frame_errors, arlan->numReceiveFramesLost, u_int);
|
||||||
READSHM(priv->stats.rx_over_errors, arlan->numRXOverruns, u_int);
|
READSHM(dev->stats.rx_over_errors, arlan->numRXOverruns, u_int);
|
||||||
READSHM(priv->stats.rx_packets, arlan->numDatagramsReceived, u_int);
|
READSHM(dev->stats.rx_packets, arlan->numDatagramsReceived, u_int);
|
||||||
READSHM(priv->stats.tx_aborted_errors, arlan->numAbortErrors, u_int);
|
READSHM(dev->stats.tx_aborted_errors, arlan->numAbortErrors, u_int);
|
||||||
READSHM(priv->stats.tx_carrier_errors, arlan->numStatusTimeouts, u_int);
|
READSHM(dev->stats.tx_carrier_errors, arlan->numStatusTimeouts, u_int);
|
||||||
READSHM(priv->stats.tx_dropped, arlan->numDatagramsDiscarded, u_int);
|
READSHM(dev->stats.tx_dropped, arlan->numDatagramsDiscarded, u_int);
|
||||||
READSHM(priv->stats.tx_fifo_errors, arlan->numTXUnderruns, u_int);
|
READSHM(dev->stats.tx_fifo_errors, arlan->numTXUnderruns, u_int);
|
||||||
READSHM(priv->stats.tx_packets, arlan->numDatagramsTransmitted, u_int);
|
READSHM(dev->stats.tx_packets, arlan->numDatagramsTransmitted, u_int);
|
||||||
READSHM(priv->stats.tx_window_errors, arlan->numHoldOffs, u_int);
|
READSHM(dev->stats.tx_window_errors, arlan->numHoldOffs, u_int);
|
||||||
|
|
||||||
ARLAN_DEBUG_EXIT("arlan_statistics");
|
ARLAN_DEBUG_EXIT("arlan_statistics");
|
||||||
|
|
||||||
return &priv->stats;
|
return &dev->stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -330,7 +330,6 @@ struct TxParam
|
|||||||
#define TX_RING_SIZE 2
|
#define TX_RING_SIZE 2
|
||||||
/* Information that need to be kept for each board. */
|
/* Information that need to be kept for each board. */
|
||||||
struct arlan_private {
|
struct arlan_private {
|
||||||
struct net_device_stats stats;
|
|
||||||
struct arlan_shmem __iomem * card;
|
struct arlan_shmem __iomem * card;
|
||||||
struct arlan_shmem * conf;
|
struct arlan_shmem * conf;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user