netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kaweth:BQL support
@ 2012-11-09 12:19 Oliver Neukum
  2012-11-09 13:15 ` Eric Dumazet
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Neukum @ 2012-11-09 12:19 UTC (permalink / raw)
  To: davem, netdev; +Cc: Oliver Neukum, Oliver Neukum

This adds the callbacks for the statistics necessary for BQL

Signed-off-by: Oliver Neukum <oneukum@suse.de>
---
 drivers/net/usb/kaweth.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index afb117c..f30e07f 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -715,6 +715,7 @@ static int kaweth_open(struct net_device *net)
 		usb_kill_urb(kaweth->rx_urb);
 		goto err_out;
 	}
+	netdev_reset_queue(net);
 	kaweth->opened = 1;
 
 	netif_start_queue(net);
@@ -783,6 +784,7 @@ static void kaweth_usb_transmit_complete(struct urb *urb)
 {
 	struct kaweth_device *kaweth = urb->context;
 	struct sk_buff *skb = kaweth->tx_skb;
+	struct net_device *net = kaweth->net;
 	int status = urb->status;
 
 	if (unlikely(status != 0))
@@ -790,7 +792,8 @@ static void kaweth_usb_transmit_complete(struct urb *urb)
 			dev_dbg(&urb->dev->dev, "%s: TX status %d.\n",
 				kaweth->net->name, status);
 
-	netif_wake_queue(kaweth->net);
+	netif_wake_queue(net);
+	netdev_completed_queue(net, 1, skb->len - 2);
 	dev_kfree_skb_irq(skb);
 }
 
@@ -854,6 +857,7 @@ skip:
 	{
 		kaweth->stats.tx_packets++;
 		kaweth->stats.tx_bytes += skb->len;
+		netdev_sent_queue(net, skb->len - 2);
 	}
 
 	spin_unlock_irq(&kaweth->device_lock);
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-12  7:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-09 12:19 [PATCH] kaweth:BQL support Oliver Neukum
2012-11-09 13:15 ` Eric Dumazet
2012-11-12  7:38   ` Oliver Neukum
2012-11-12  7:59     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).