diff options
Diffstat (limited to 'drivers/char/synclink.c')
-rw-r--r-- | drivers/char/synclink.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index ac5080df2565..9d247d8a87a3 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c | |||
@@ -6640,9 +6640,8 @@ static bool mgsl_get_rx_frame(struct mgsl_struct *info) | |||
6640 | framesize = 0; | 6640 | framesize = 0; |
6641 | #if SYNCLINK_GENERIC_HDLC | 6641 | #if SYNCLINK_GENERIC_HDLC |
6642 | { | 6642 | { |
6643 | struct net_device_stats *stats = hdlc_stats(info->netdev); | 6643 | info->netdev->stats.rx_errors++; |
6644 | stats->rx_errors++; | 6644 | info->netdev->stats.rx_frame_errors++; |
6645 | stats->rx_frame_errors++; | ||
6646 | } | 6645 | } |
6647 | #endif | 6646 | #endif |
6648 | } else | 6647 | } else |
@@ -7753,7 +7752,6 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, | |||
7753 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | 7752 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) |
7754 | { | 7753 | { |
7755 | struct mgsl_struct *info = dev_to_port(dev); | 7754 | struct mgsl_struct *info = dev_to_port(dev); |
7756 | struct net_device_stats *stats = hdlc_stats(dev); | ||
7757 | unsigned long flags; | 7755 | unsigned long flags; |
7758 | 7756 | ||
7759 | if (debug_level >= DEBUG_LEVEL_INFO) | 7757 | if (debug_level >= DEBUG_LEVEL_INFO) |
@@ -7767,8 +7765,8 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
7767 | mgsl_load_tx_dma_buffer(info, skb->data, skb->len); | 7765 | mgsl_load_tx_dma_buffer(info, skb->data, skb->len); |
7768 | 7766 | ||
7769 | /* update network statistics */ | 7767 | /* update network statistics */ |
7770 | stats->tx_packets++; | 7768 | dev->stats.tx_packets++; |
7771 | stats->tx_bytes += skb->len; | 7769 | dev->stats.tx_bytes += skb->len; |
7772 | 7770 | ||
7773 | /* done with socket buffer, so free it */ | 7771 | /* done with socket buffer, so free it */ |
7774 | dev_kfree_skb(skb); | 7772 | dev_kfree_skb(skb); |
@@ -7984,14 +7982,13 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
7984 | static void hdlcdev_tx_timeout(struct net_device *dev) | 7982 | static void hdlcdev_tx_timeout(struct net_device *dev) |
7985 | { | 7983 | { |
7986 | struct mgsl_struct *info = dev_to_port(dev); | 7984 | struct mgsl_struct *info = dev_to_port(dev); |
7987 | struct net_device_stats *stats = hdlc_stats(dev); | ||
7988 | unsigned long flags; | 7985 | unsigned long flags; |
7989 | 7986 | ||
7990 | if (debug_level >= DEBUG_LEVEL_INFO) | 7987 | if (debug_level >= DEBUG_LEVEL_INFO) |
7991 | printk("hdlcdev_tx_timeout(%s)\n",dev->name); | 7988 | printk("hdlcdev_tx_timeout(%s)\n",dev->name); |
7992 | 7989 | ||
7993 | stats->tx_errors++; | 7990 | dev->stats.tx_errors++; |
7994 | stats->tx_aborted_errors++; | 7991 | dev->stats.tx_aborted_errors++; |
7995 | 7992 | ||
7996 | spin_lock_irqsave(&info->irq_spinlock,flags); | 7993 | spin_lock_irqsave(&info->irq_spinlock,flags); |
7997 | usc_stop_transmitter(info); | 7994 | usc_stop_transmitter(info); |
@@ -8024,27 +8021,27 @@ static void hdlcdev_rx(struct mgsl_struct *info, char *buf, int size) | |||
8024 | { | 8021 | { |
8025 | struct sk_buff *skb = dev_alloc_skb(size); | 8022 | struct sk_buff *skb = dev_alloc_skb(size); |
8026 | struct net_device *dev = info->netdev; | 8023 | struct net_device *dev = info->netdev; |
8027 | struct net_device_stats *stats = hdlc_stats(dev); | ||
8028 | 8024 | ||
8029 | if (debug_level >= DEBUG_LEVEL_INFO) | 8025 | if (debug_level >= DEBUG_LEVEL_INFO) |
8030 | printk("hdlcdev_rx(%s)\n",dev->name); | 8026 | printk("hdlcdev_rx(%s)\n", dev->name); |
8031 | 8027 | ||
8032 | if (skb == NULL) { | 8028 | if (skb == NULL) { |
8033 | printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n", dev->name); | 8029 | printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n", |
8034 | stats->rx_dropped++; | 8030 | dev->name); |
8031 | dev->stats.rx_dropped++; | ||
8035 | return; | 8032 | return; |
8036 | } | 8033 | } |
8037 | 8034 | ||
8038 | memcpy(skb_put(skb, size),buf,size); | 8035 | memcpy(skb_put(skb, size), buf, size); |
8039 | 8036 | ||
8040 | skb->protocol = hdlc_type_trans(skb, info->netdev); | 8037 | skb->protocol = hdlc_type_trans(skb, dev); |
8041 | 8038 | ||
8042 | stats->rx_packets++; | 8039 | dev->stats.rx_packets++; |
8043 | stats->rx_bytes += size; | 8040 | dev->stats.rx_bytes += size; |
8044 | 8041 | ||
8045 | netif_rx(skb); | 8042 | netif_rx(skb); |
8046 | 8043 | ||
8047 | info->netdev->last_rx = jiffies; | 8044 | dev->last_rx = jiffies; |
8048 | } | 8045 | } |
8049 | 8046 | ||
8050 | /** | 8047 | /** |