diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-01-06 13:40:43 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-06 13:40:43 -0500 |
commit | af0490810cfa159b4894ddecfc5eb2e4432fb976 (patch) | |
tree | 7c5074c11633b5c9cfa1489859d015974be5fe32 /drivers/net/irda/kingsun-sir.c | |
parent | 46377bb311a7682f6240c954c48e81a1e4f51e66 (diff) |
irda: convert to internal stats
Convert IRDA drivers to use already existing net_device_stats structure
in network device. This is a pre-cursor to conversion to net_device
ops. Compile tested only.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/irda/kingsun-sir.c')
-rw-r--r-- | drivers/net/irda/kingsun-sir.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/net/irda/kingsun-sir.c b/drivers/net/irda/kingsun-sir.c index c747c874d44d..b4a61717254a 100644 --- a/drivers/net/irda/kingsun-sir.c +++ b/drivers/net/irda/kingsun-sir.c | |||
@@ -105,7 +105,7 @@ struct kingsun_cb { | |||
105 | struct usb_device *usbdev; /* init: probe_irda */ | 105 | struct usb_device *usbdev; /* init: probe_irda */ |
106 | struct net_device *netdev; /* network layer */ | 106 | struct net_device *netdev; /* network layer */ |
107 | struct irlap_cb *irlap; /* The link layer we are binded to */ | 107 | struct irlap_cb *irlap; /* The link layer we are binded to */ |
108 | struct net_device_stats stats; /* network statistics */ | 108 | |
109 | struct qos_info qos; | 109 | struct qos_info qos; |
110 | 110 | ||
111 | __u8 *in_buf; /* receive buffer */ | 111 | __u8 *in_buf; /* receive buffer */ |
@@ -186,12 +186,12 @@ static int kingsun_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
186 | case -EPIPE: | 186 | case -EPIPE: |
187 | break; | 187 | break; |
188 | default: | 188 | default: |
189 | kingsun->stats.tx_errors++; | 189 | netdev->stats.tx_errors++; |
190 | netif_start_queue(netdev); | 190 | netif_start_queue(netdev); |
191 | } | 191 | } |
192 | } else { | 192 | } else { |
193 | kingsun->stats.tx_packets++; | 193 | netdev->stats.tx_packets++; |
194 | kingsun->stats.tx_bytes += skb->len; | 194 | netdev->stats.tx_bytes += skb->len; |
195 | } | 195 | } |
196 | 196 | ||
197 | dev_kfree_skb(skb); | 197 | dev_kfree_skb(skb); |
@@ -232,7 +232,7 @@ static void kingsun_rcv_irq(struct urb *urb) | |||
232 | if (bytes[0] >= 1 && bytes[0] < kingsun->max_rx) { | 232 | if (bytes[0] >= 1 && bytes[0] < kingsun->max_rx) { |
233 | for (i = 1; i <= bytes[0]; i++) { | 233 | for (i = 1; i <= bytes[0]; i++) { |
234 | async_unwrap_char(kingsun->netdev, | 234 | async_unwrap_char(kingsun->netdev, |
235 | &kingsun->stats, | 235 | &kingsun->netdev->stats, |
236 | &kingsun->rx_buff, bytes[i]); | 236 | &kingsun->rx_buff, bytes[i]); |
237 | } | 237 | } |
238 | do_gettimeofday(&kingsun->rx_time); | 238 | do_gettimeofday(&kingsun->rx_time); |
@@ -418,15 +418,6 @@ static int kingsun_net_ioctl(struct net_device *netdev, struct ifreq *rq, | |||
418 | return ret; | 418 | return ret; |
419 | } | 419 | } |
420 | 420 | ||
421 | /* | ||
422 | * Get device stats (for /proc/net/dev and ifconfig) | ||
423 | */ | ||
424 | static struct net_device_stats * | ||
425 | kingsun_net_get_stats(struct net_device *netdev) | ||
426 | { | ||
427 | struct kingsun_cb *kingsun = netdev_priv(netdev); | ||
428 | return &kingsun->stats; | ||
429 | } | ||
430 | 421 | ||
431 | /* | 422 | /* |
432 | * This routine is called by the USB subsystem for each new device | 423 | * This routine is called by the USB subsystem for each new device |
@@ -532,7 +523,6 @@ static int kingsun_probe(struct usb_interface *intf, | |||
532 | net->hard_start_xmit = kingsun_hard_xmit; | 523 | net->hard_start_xmit = kingsun_hard_xmit; |
533 | net->open = kingsun_net_open; | 524 | net->open = kingsun_net_open; |
534 | net->stop = kingsun_net_close; | 525 | net->stop = kingsun_net_close; |
535 | net->get_stats = kingsun_net_get_stats; | ||
536 | net->do_ioctl = kingsun_net_ioctl; | 526 | net->do_ioctl = kingsun_net_ioctl; |
537 | 527 | ||
538 | ret = register_netdev(net); | 528 | ret = register_netdev(net); |