aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda/ksdazzle-sir.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-01-06 13:40:43 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-06 13:40:43 -0500
commitaf0490810cfa159b4894ddecfc5eb2e4432fb976 (patch)
tree7c5074c11633b5c9cfa1489859d015974be5fe32 /drivers/net/irda/ksdazzle-sir.c
parent46377bb311a7682f6240c954c48e81a1e4f51e66 (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/ksdazzle-sir.c')
-rw-r--r--drivers/net/irda/ksdazzle-sir.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c
index 0e7f89337b25..5b327b09acd8 100644
--- a/drivers/net/irda/ksdazzle-sir.c
+++ b/drivers/net/irda/ksdazzle-sir.c
@@ -140,7 +140,7 @@ struct ksdazzle_cb {
140 struct usb_device *usbdev; /* init: probe_irda */ 140 struct usb_device *usbdev; /* init: probe_irda */
141 struct net_device *netdev; /* network layer */ 141 struct net_device *netdev; /* network layer */
142 struct irlap_cb *irlap; /* The link layer we are binded to */ 142 struct irlap_cb *irlap; /* The link layer we are binded to */
143 struct net_device_stats stats; /* network statistics */ 143
144 struct qos_info qos; 144 struct qos_info qos;
145 145
146 struct urb *tx_urb; 146 struct urb *tx_urb;
@@ -278,7 +278,7 @@ static void ksdazzle_send_irq(struct urb *urb)
278 case -EPIPE: 278 case -EPIPE:
279 break; 279 break;
280 default: 280 default:
281 kingsun->stats.tx_errors++; 281 netdev->stats.tx_errors++;
282 netif_start_queue(netdev); 282 netif_start_queue(netdev);
283 } 283 }
284 } 284 }
@@ -329,12 +329,12 @@ static int ksdazzle_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
329 case -EPIPE: 329 case -EPIPE:
330 break; 330 break;
331 default: 331 default:
332 kingsun->stats.tx_errors++; 332 netdev->stats.tx_errors++;
333 netif_start_queue(netdev); 333 netif_start_queue(netdev);
334 } 334 }
335 } else { 335 } else {
336 kingsun->stats.tx_packets++; 336 netdev->stats.tx_packets++;
337 kingsun->stats.tx_bytes += skb->len; 337 netdev->stats.tx_bytes += skb->len;
338 338
339 } 339 }
340 340
@@ -348,9 +348,10 @@ static int ksdazzle_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
348static void ksdazzle_rcv_irq(struct urb *urb) 348static void ksdazzle_rcv_irq(struct urb *urb)
349{ 349{
350 struct ksdazzle_cb *kingsun = urb->context; 350 struct ksdazzle_cb *kingsun = urb->context;
351 struct net_device *netdev = kingsun->netdev;
351 352
352 /* in process of stopping, just drop data */ 353 /* in process of stopping, just drop data */
353 if (!netif_running(kingsun->netdev)) { 354 if (!netif_running(netdev)) {
354 kingsun->receiving = 0; 355 kingsun->receiving = 0;
355 return; 356 return;
356 } 357 }
@@ -368,7 +369,7 @@ static void ksdazzle_rcv_irq(struct urb *urb)
368 unsigned int i; 369 unsigned int i;
369 370
370 for (i = 0; i < urb->actual_length; i++) { 371 for (i = 0; i < urb->actual_length; i++) {
371 async_unwrap_char(kingsun->netdev, &kingsun->stats, 372 async_unwrap_char(netdev, &netdev->stats,
372 &kingsun->rx_unwrap_buff, bytes[i]); 373 &kingsun->rx_unwrap_buff, bytes[i]);
373 } 374 }
374 kingsun->receiving = 375 kingsun->receiving =
@@ -562,16 +563,6 @@ static int ksdazzle_net_ioctl(struct net_device *netdev, struct ifreq *rq,
562} 563}
563 564
564/* 565/*
565 * Get device stats (for /proc/net/dev and ifconfig)
566 */
567static struct net_device_stats *ksdazzle_net_get_stats(struct net_device
568 *netdev)
569{
570 struct ksdazzle_cb *kingsun = netdev_priv(netdev);
571 return &kingsun->stats;
572}
573
574/*
575 * This routine is called by the USB subsystem for each new device 566 * This routine is called by the USB subsystem for each new device
576 * in the system. We need to check if the device is ours, and in 567 * in the system. We need to check if the device is ours, and in
577 * this case start handling it. 568 * this case start handling it.
@@ -696,7 +687,6 @@ static int ksdazzle_probe(struct usb_interface *intf,
696 net->hard_start_xmit = ksdazzle_hard_xmit; 687 net->hard_start_xmit = ksdazzle_hard_xmit;
697 net->open = ksdazzle_net_open; 688 net->open = ksdazzle_net_open;
698 net->stop = ksdazzle_net_close; 689 net->stop = ksdazzle_net_close;
699 net->get_stats = ksdazzle_net_get_stats;
700 net->do_ioctl = ksdazzle_net_ioctl; 690 net->do_ioctl = ksdazzle_net_ioctl;
701 691
702 ret = register_netdev(net); 692 ret = register_netdev(net);