aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/synclink_gt.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-20 20:43:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-20 20:43:29 -0400
commitdb6d8c7a4027b48d797b369a53f8470aaeed7063 (patch)
treee140c104a89abc2154e1f41a7db8ebecbb6fa0b4 /drivers/char/synclink_gt.c
parent3a533374283aea50eab3976d8a6d30532175f009 (diff)
parentfb65a7c091529bfffb1262515252c0d0f6241c5c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (1232 commits) iucv: Fix bad merging. net_sched: Add size table for qdiscs net_sched: Add accessor function for packet length for qdiscs net_sched: Add qdisc_enqueue wrapper highmem: Export totalhigh_pages. ipv6 mcast: Omit redundant address family checks in ip6_mc_source(). net: Use standard structures for generic socket address structures. ipv6 netns: Make several "global" sysctl variables namespace aware. netns: Use net_eq() to compare net-namespaces for optimization. ipv6: remove unused macros from net/ipv6.h ipv6: remove unused parameter from ip6_ra_control tcp: fix kernel panic with listening_get_next tcp: Remove redundant checks when setting eff_sacks tcp: options clean up tcp: Fix MD5 signatures for non-linear skbs sctp: Update sctp global memory limit allocations. sctp: remove unnecessary byteshifting, calculate directly in big-endian sctp: Allow only 1 listening socket with SO_REUSEADDR sctp: Do not leak memory on multiple listen() calls sctp: Support ipv6only AF_INET6 sockets. ...
Diffstat (limited to 'drivers/char/synclink_gt.c')
-rw-r--r--drivers/char/synclink_gt.c28
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,
1536static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) 1536static 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)
1767static void hdlcdev_tx_timeout(struct net_device *dev) 1766static 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