aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/synclinkmp.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/synclinkmp.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/synclinkmp.c')
-rw-r--r--drivers/char/synclinkmp.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index c4bc09018368..5768c4136342 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -1672,7 +1672,6 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding,
1672static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) 1672static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev)
1673{ 1673{
1674 SLMP_INFO *info = dev_to_port(dev); 1674 SLMP_INFO *info = dev_to_port(dev);
1675 struct net_device_stats *stats = hdlc_stats(dev);
1676 unsigned long flags; 1675 unsigned long flags;
1677 1676
1678 if (debug_level >= DEBUG_LEVEL_INFO) 1677 if (debug_level >= DEBUG_LEVEL_INFO)
@@ -1686,8 +1685,8 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev)
1686 tx_load_dma_buffer(info, skb->data, skb->len); 1685 tx_load_dma_buffer(info, skb->data, skb->len);
1687 1686
1688 /* update network statistics */ 1687 /* update network statistics */
1689 stats->tx_packets++; 1688 dev->stats.tx_packets++;
1690 stats->tx_bytes += skb->len; 1689 dev->stats.tx_bytes += skb->len;
1691 1690
1692 /* done with socket buffer, so free it */ 1691 /* done with socket buffer, so free it */
1693 dev_kfree_skb(skb); 1692 dev_kfree_skb(skb);
@@ -1903,14 +1902,13 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1903static void hdlcdev_tx_timeout(struct net_device *dev) 1902static void hdlcdev_tx_timeout(struct net_device *dev)
1904{ 1903{
1905 SLMP_INFO *info = dev_to_port(dev); 1904 SLMP_INFO *info = dev_to_port(dev);
1906 struct net_device_stats *stats = hdlc_stats(dev);
1907 unsigned long flags; 1905 unsigned long flags;
1908 1906
1909 if (debug_level >= DEBUG_LEVEL_INFO) 1907 if (debug_level >= DEBUG_LEVEL_INFO)
1910 printk("hdlcdev_tx_timeout(%s)\n",dev->name); 1908 printk("hdlcdev_tx_timeout(%s)\n",dev->name);
1911 1909
1912 stats->tx_errors++; 1910 dev->stats.tx_errors++;
1913 stats->tx_aborted_errors++; 1911 dev->stats.tx_aborted_errors++;
1914 1912
1915 spin_lock_irqsave(&info->lock,flags); 1913 spin_lock_irqsave(&info->lock,flags);
1916 tx_stop(info); 1914 tx_stop(info);
@@ -1943,27 +1941,27 @@ static void hdlcdev_rx(SLMP_INFO *info, char *buf, int size)
1943{ 1941{
1944 struct sk_buff *skb = dev_alloc_skb(size); 1942 struct sk_buff *skb = dev_alloc_skb(size);
1945 struct net_device *dev = info->netdev; 1943 struct net_device *dev = info->netdev;
1946 struct net_device_stats *stats = hdlc_stats(dev);
1947 1944
1948 if (debug_level >= DEBUG_LEVEL_INFO) 1945 if (debug_level >= DEBUG_LEVEL_INFO)
1949 printk("hdlcdev_rx(%s)\n",dev->name); 1946 printk("hdlcdev_rx(%s)\n",dev->name);
1950 1947
1951 if (skb == NULL) { 1948 if (skb == NULL) {
1952 printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n", dev->name); 1949 printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n",
1953 stats->rx_dropped++; 1950 dev->name);
1951 dev->stats.rx_dropped++;
1954 return; 1952 return;
1955 } 1953 }
1956 1954
1957 memcpy(skb_put(skb, size),buf,size); 1955 memcpy(skb_put(skb, size), buf, size);
1958 1956
1959 skb->protocol = hdlc_type_trans(skb, info->netdev); 1957 skb->protocol = hdlc_type_trans(skb, dev);
1960 1958
1961 stats->rx_packets++; 1959 dev->stats.rx_packets++;
1962 stats->rx_bytes += size; 1960 dev->stats.rx_bytes += size;
1963 1961
1964 netif_rx(skb); 1962 netif_rx(skb);
1965 1963
1966 info->netdev->last_rx = jiffies; 1964 dev->last_rx = jiffies;
1967} 1965}
1968 1966
1969/** 1967/**
@@ -4976,9 +4974,8 @@ CheckAgain:
4976 framesize = 0; 4974 framesize = 0;
4977#if SYNCLINK_GENERIC_HDLC 4975#if SYNCLINK_GENERIC_HDLC
4978 { 4976 {
4979 struct net_device_stats *stats = hdlc_stats(info->netdev); 4977 info->netdev->stats.rx_errors++;
4980 stats->rx_errors++; 4978 info->netdev->stats.rx_frame_errors++;
4981 stats->rx_frame_errors++;
4982 } 4979 }
4983#endif 4980#endif
4984 } 4981 }