diff options
author | Krzysztof Halasa <khc@pm.waw.pl> | 2008-06-30 17:26:53 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-07-04 08:47:41 -0400 |
commit | 198191c4a7ce4daba379608fb38b9bc5a4eedc61 (patch) | |
tree | 3229362a45a15af42628553926bc040e44c39ce0 /drivers/char/synclink_gt.c | |
parent | 844290e56067aed0a54142d756565abb9614136c (diff) |
WAN: convert drivers to use built-in netdev_stats
There is no point in using separate net_device_stats structs when
the one in struct net_device is present. Compiles.
Signed-off-by: Krzysztof HaĆasa <khc@pm.waw.pl>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/char/synclink_gt.c')
-rw-r--r-- | drivers/char/synclink_gt.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index 55c1653be00c..d88a607e34b7 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -1544,7 +1544,6 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, | |||
1544 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | 1544 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) |
1545 | { | 1545 | { |
1546 | struct slgt_info *info = dev_to_port(dev); | 1546 | struct slgt_info *info = dev_to_port(dev); |
1547 | struct net_device_stats *stats = hdlc_stats(dev); | ||
1548 | unsigned long flags; | 1547 | unsigned long flags; |
1549 | 1548 | ||
1550 | DBGINFO(("%s hdlc_xmit\n", dev->name)); | 1549 | DBGINFO(("%s hdlc_xmit\n", dev->name)); |
@@ -1557,8 +1556,8 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1557 | tx_load(info, skb->data, skb->len); | 1556 | tx_load(info, skb->data, skb->len); |
1558 | 1557 | ||
1559 | /* update network statistics */ | 1558 | /* update network statistics */ |
1560 | stats->tx_packets++; | 1559 | dev->stats.tx_packets++; |
1561 | stats->tx_bytes += skb->len; | 1560 | dev->stats.tx_bytes += skb->len; |
1562 | 1561 | ||
1563 | /* done with socket buffer, so free it */ | 1562 | /* done with socket buffer, so free it */ |
1564 | dev_kfree_skb(skb); | 1563 | dev_kfree_skb(skb); |
@@ -1775,13 +1774,12 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1775 | static void hdlcdev_tx_timeout(struct net_device *dev) | 1774 | static void hdlcdev_tx_timeout(struct net_device *dev) |
1776 | { | 1775 | { |
1777 | struct slgt_info *info = dev_to_port(dev); | 1776 | struct slgt_info *info = dev_to_port(dev); |
1778 | struct net_device_stats *stats = hdlc_stats(dev); | ||
1779 | unsigned long flags; | 1777 | unsigned long flags; |
1780 | 1778 | ||
1781 | DBGINFO(("%s hdlcdev_tx_timeout\n", dev->name)); | 1779 | DBGINFO(("%s hdlcdev_tx_timeout\n", dev->name)); |
1782 | 1780 | ||
1783 | stats->tx_errors++; | 1781 | dev->stats.tx_errors++; |
1784 | stats->tx_aborted_errors++; | 1782 | dev->stats.tx_aborted_errors++; |
1785 | 1783 | ||
1786 | spin_lock_irqsave(&info->lock,flags); | 1784 | spin_lock_irqsave(&info->lock,flags); |
1787 | tx_stop(info); | 1785 | tx_stop(info); |
@@ -1814,26 +1812,25 @@ static void hdlcdev_rx(struct slgt_info *info, char *buf, int size) | |||
1814 | { | 1812 | { |
1815 | struct sk_buff *skb = dev_alloc_skb(size); | 1813 | struct sk_buff *skb = dev_alloc_skb(size); |
1816 | struct net_device *dev = info->netdev; | 1814 | struct net_device *dev = info->netdev; |
1817 | struct net_device_stats *stats = hdlc_stats(dev); | ||
1818 | 1815 | ||
1819 | DBGINFO(("%s hdlcdev_rx\n", dev->name)); | 1816 | DBGINFO(("%s hdlcdev_rx\n", dev->name)); |
1820 | 1817 | ||
1821 | if (skb == NULL) { | 1818 | if (skb == NULL) { |
1822 | DBGERR(("%s: can't alloc skb, drop packet\n", dev->name)); | 1819 | DBGERR(("%s: can't alloc skb, drop packet\n", dev->name)); |
1823 | stats->rx_dropped++; | 1820 | dev->stats.rx_dropped++; |
1824 | return; | 1821 | return; |
1825 | } | 1822 | } |
1826 | 1823 | ||
1827 | memcpy(skb_put(skb, size),buf,size); | 1824 | memcpy(skb_put(skb, size), buf, size); |
1828 | 1825 | ||
1829 | skb->protocol = hdlc_type_trans(skb, info->netdev); | 1826 | skb->protocol = hdlc_type_trans(skb, dev); |
1830 | 1827 | ||
1831 | stats->rx_packets++; | 1828 | dev->stats.rx_packets++; |
1832 | stats->rx_bytes += size; | 1829 | dev->stats.rx_bytes += size; |
1833 | 1830 | ||
1834 | netif_rx(skb); | 1831 | netif_rx(skb); |
1835 | 1832 | ||
1836 | info->netdev->last_rx = jiffies; | 1833 | dev->last_rx = jiffies; |
1837 | } | 1834 | } |
1838 | 1835 | ||
1839 | /** | 1836 | /** |
@@ -4577,9 +4574,8 @@ check_again: | |||
4577 | 4574 | ||
4578 | #if SYNCLINK_GENERIC_HDLC | 4575 | #if SYNCLINK_GENERIC_HDLC |
4579 | if (framesize == 0) { | 4576 | if (framesize == 0) { |
4580 | struct net_device_stats *stats = hdlc_stats(info->netdev); | 4577 | info->netdev->stats.rx_errors++; |
4581 | stats->rx_errors++; | 4578 | info->netdev->stats.rx_frame_errors++; |
4582 | stats->rx_frame_errors++; | ||
4583 | } | 4579 | } |
4584 | #endif | 4580 | #endif |
4585 | 4581 | ||