diff options
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 07aa42a7f397..2c3e43bb2cc9 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -1536,7 +1536,6 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, | |||
1536 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | 1536 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) |
1537 | { | 1537 | { |
1538 | struct slgt_info *info = dev_to_port(dev); | 1538 | struct slgt_info *info = dev_to_port(dev); |
1539 | struct net_device_stats *stats = hdlc_stats(dev); | ||
1540 | unsigned long flags; | 1539 | unsigned long flags; |
1541 | 1540 | ||
1542 | DBGINFO(("%s hdlc_xmit\n", dev->name)); | 1541 | DBGINFO(("%s hdlc_xmit\n", dev->name)); |
@@ -1549,8 +1548,8 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1549 | tx_load(info, skb->data, skb->len); | 1548 | tx_load(info, skb->data, skb->len); |
1550 | 1549 | ||
1551 | /* update network statistics */ | 1550 | /* update network statistics */ |
1552 | stats->tx_packets++; | 1551 | dev->stats.tx_packets++; |
1553 | stats->tx_bytes += skb->len; | 1552 | dev->stats.tx_bytes += skb->len; |
1554 | 1553 | ||
1555 | /* done with socket buffer, so free it */ | 1554 | /* done with socket buffer, so free it */ |
1556 | dev_kfree_skb(skb); | 1555 | dev_kfree_skb(skb); |
@@ -1767,13 +1766,12 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1767 | static void hdlcdev_tx_timeout(struct net_device *dev) | 1766 | static void hdlcdev_tx_timeout(struct net_device *dev) |
1768 | { | 1767 | { |
1769 | struct slgt_info *info = dev_to_port(dev); | 1768 | struct slgt_info *info = dev_to_port(dev); |
1770 | struct net_device_stats *stats = hdlc_stats(dev); | ||
1771 | unsigned long flags; | 1769 | unsigned long flags; |
1772 | 1770 | ||
1773 | DBGINFO(("%s hdlcdev_tx_timeout\n", dev->name)); | 1771 | DBGINFO(("%s hdlcdev_tx_timeout\n", dev->name)); |
1774 | 1772 | ||
1775 | stats->tx_errors++; | 1773 | dev->stats.tx_errors++; |
1776 | stats->tx_aborted_errors++; | 1774 | dev->stats.tx_aborted_errors++; |
1777 | 1775 | ||
1778 | spin_lock_irqsave(&info->lock,flags); | 1776 | spin_lock_irqsave(&info->lock,flags); |
1779 | tx_stop(info); | 1777 | tx_stop(info); |
@@ -1806,26 +1804,25 @@ static void hdlcdev_rx(struct slgt_info *info, char *buf, int size) | |||
1806 | { | 1804 | { |
1807 | struct sk_buff *skb = dev_alloc_skb(size); | 1805 | struct sk_buff *skb = dev_alloc_skb(size); |
1808 | struct net_device *dev = info->netdev; | 1806 | struct net_device *dev = info->netdev; |
1809 | struct net_device_stats *stats = hdlc_stats(dev); | ||
1810 | 1807 | ||
1811 | DBGINFO(("%s hdlcdev_rx\n", dev->name)); | 1808 | DBGINFO(("%s hdlcdev_rx\n", dev->name)); |
1812 | 1809 | ||
1813 | if (skb == NULL) { | 1810 | if (skb == NULL) { |
1814 | DBGERR(("%s: can't alloc skb, drop packet\n", dev->name)); | 1811 | DBGERR(("%s: can't alloc skb, drop packet\n", dev->name)); |
1815 | stats->rx_dropped++; | 1812 | dev->stats.rx_dropped++; |
1816 | return; | 1813 | return; |
1817 | } | 1814 | } |
1818 | 1815 | ||
1819 | memcpy(skb_put(skb, size),buf,size); | 1816 | memcpy(skb_put(skb, size), buf, size); |
1820 | 1817 | ||
1821 | skb->protocol = hdlc_type_trans(skb, info->netdev); | 1818 | skb->protocol = hdlc_type_trans(skb, dev); |
1822 | 1819 | ||
1823 | stats->rx_packets++; | 1820 | dev->stats.rx_packets++; |
1824 | stats->rx_bytes += size; | 1821 | dev->stats.rx_bytes += size; |
1825 | 1822 | ||
1826 | netif_rx(skb); | 1823 | netif_rx(skb); |
1827 | 1824 | ||
1828 | info->netdev->last_rx = jiffies; | 1825 | dev->last_rx = jiffies; |
1829 | } | 1826 | } |
1830 | 1827 | ||
1831 | /** | 1828 | /** |
@@ -4568,9 +4565,8 @@ check_again: | |||
4568 | 4565 | ||
4569 | #if SYNCLINK_GENERIC_HDLC | 4566 | #if SYNCLINK_GENERIC_HDLC |
4570 | if (framesize == 0) { | 4567 | if (framesize == 0) { |
4571 | struct net_device_stats *stats = hdlc_stats(info->netdev); | 4568 | info->netdev->stats.rx_errors++; |
4572 | stats->rx_errors++; | 4569 | info->netdev->stats.rx_frame_errors++; |
4573 | stats->rx_frame_errors++; | ||
4574 | } | 4570 | } |
4575 | #endif | 4571 | #endif |
4576 | 4572 | ||