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/pcmcia | |
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/pcmcia')
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 1dd0e992c83d..fb2fb159faa3 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -3886,9 +3886,8 @@ static bool rx_get_frame(MGSLPC_INFO *info) | |||
3886 | framesize = 0; | 3886 | framesize = 0; |
3887 | #if SYNCLINK_GENERIC_HDLC | 3887 | #if SYNCLINK_GENERIC_HDLC |
3888 | { | 3888 | { |
3889 | struct net_device_stats *stats = hdlc_stats(info->netdev); | 3889 | info->netdev->stats.rx_errors++; |
3890 | stats->rx_errors++; | 3890 | info->netdev->stats.rx_frame_errors++; |
3891 | stats->rx_frame_errors++; | ||
3892 | } | 3891 | } |
3893 | #endif | 3892 | #endif |
3894 | } else | 3893 | } else |
@@ -4144,7 +4143,6 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, | |||
4144 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | 4143 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) |
4145 | { | 4144 | { |
4146 | MGSLPC_INFO *info = dev_to_port(dev); | 4145 | MGSLPC_INFO *info = dev_to_port(dev); |
4147 | struct net_device_stats *stats = hdlc_stats(dev); | ||
4148 | unsigned long flags; | 4146 | unsigned long flags; |
4149 | 4147 | ||
4150 | if (debug_level >= DEBUG_LEVEL_INFO) | 4148 | if (debug_level >= DEBUG_LEVEL_INFO) |
@@ -4159,8 +4157,8 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4159 | info->tx_put = info->tx_count = skb->len; | 4157 | info->tx_put = info->tx_count = skb->len; |
4160 | 4158 | ||
4161 | /* update network statistics */ | 4159 | /* update network statistics */ |
4162 | stats->tx_packets++; | 4160 | dev->stats.tx_packets++; |
4163 | stats->tx_bytes += skb->len; | 4161 | dev->stats.tx_bytes += skb->len; |
4164 | 4162 | ||
4165 | /* done with socket buffer, so free it */ | 4163 | /* done with socket buffer, so free it */ |
4166 | dev_kfree_skb(skb); | 4164 | dev_kfree_skb(skb); |
@@ -4376,14 +4374,13 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
4376 | static void hdlcdev_tx_timeout(struct net_device *dev) | 4374 | static void hdlcdev_tx_timeout(struct net_device *dev) |
4377 | { | 4375 | { |
4378 | MGSLPC_INFO *info = dev_to_port(dev); | 4376 | MGSLPC_INFO *info = dev_to_port(dev); |
4379 | struct net_device_stats *stats = hdlc_stats(dev); | ||
4380 | unsigned long flags; | 4377 | unsigned long flags; |
4381 | 4378 | ||
4382 | if (debug_level >= DEBUG_LEVEL_INFO) | 4379 | if (debug_level >= DEBUG_LEVEL_INFO) |
4383 | printk("hdlcdev_tx_timeout(%s)\n",dev->name); | 4380 | printk("hdlcdev_tx_timeout(%s)\n",dev->name); |
4384 | 4381 | ||
4385 | stats->tx_errors++; | 4382 | dev->stats.tx_errors++; |
4386 | stats->tx_aborted_errors++; | 4383 | dev->stats.tx_aborted_errors++; |
4387 | 4384 | ||
4388 | spin_lock_irqsave(&info->lock,flags); | 4385 | spin_lock_irqsave(&info->lock,flags); |
4389 | tx_stop(info); | 4386 | tx_stop(info); |
@@ -4416,27 +4413,26 @@ static void hdlcdev_rx(MGSLPC_INFO *info, char *buf, int size) | |||
4416 | { | 4413 | { |
4417 | struct sk_buff *skb = dev_alloc_skb(size); | 4414 | struct sk_buff *skb = dev_alloc_skb(size); |
4418 | struct net_device *dev = info->netdev; | 4415 | struct net_device *dev = info->netdev; |
4419 | struct net_device_stats *stats = hdlc_stats(dev); | ||
4420 | 4416 | ||
4421 | if (debug_level >= DEBUG_LEVEL_INFO) | 4417 | if (debug_level >= DEBUG_LEVEL_INFO) |
4422 | printk("hdlcdev_rx(%s)\n",dev->name); | 4418 | printk("hdlcdev_rx(%s)\n",dev->name); |
4423 | 4419 | ||
4424 | if (skb == NULL) { | 4420 | if (skb == NULL) { |
4425 | printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n", dev->name); | 4421 | printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n", dev->name); |
4426 | stats->rx_dropped++; | 4422 | dev->stats.rx_dropped++; |
4427 | return; | 4423 | return; |
4428 | } | 4424 | } |
4429 | 4425 | ||
4430 | memcpy(skb_put(skb, size),buf,size); | 4426 | memcpy(skb_put(skb, size), buf, size); |
4431 | 4427 | ||
4432 | skb->protocol = hdlc_type_trans(skb, info->netdev); | 4428 | skb->protocol = hdlc_type_trans(skb, dev); |
4433 | 4429 | ||
4434 | stats->rx_packets++; | 4430 | dev->stats.rx_packets++; |
4435 | stats->rx_bytes += size; | 4431 | dev->stats.rx_bytes += size; |
4436 | 4432 | ||
4437 | netif_rx(skb); | 4433 | netif_rx(skb); |
4438 | 4434 | ||
4439 | info->netdev->last_rx = jiffies; | 4435 | dev->last_rx = jiffies; |
4440 | } | 4436 | } |
4441 | 4437 | ||
4442 | /** | 4438 | /** |