diff mbox

[Bugme-new,Bug,13589] New: usbnet and /proc/net/dev stats

Message ID 200906300045.n5U0j2To004168@rs49.luxsci.com
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Ben Kibbey June 30, 2009, 12:42 a.m. UTC
On Mon, Jun 29, 2009 at 05:23:41PM -0700, Andrew Morton wrote:

All usbnet stats weren't getting updated (ifconfig, was always showing 0).
When applied to 2.6.30 this fixes it. Commit 805aaa29fa was the culprit and
reverting it re-adds usbnet_get_stats() but needed to be modified to add whats
in usbnet_netdev_ops:
diff mbox

Patch

--- /tmp/usbnet.c	2009-06-29 20:35:59.000000000 -0400
+++ usbnet.c	2009-06-20 11:40:41.000000000 -0400
@@ -1106,9 +1106,16 @@ 
 }
 EXPORT_SYMBOL_GPL(usbnet_disconnect);
 
+static struct net_device_stats *usbnet_get_stats (struct net_device *net)
+{
+       struct usbnet   *dev = netdev_priv(net);
+       return &dev->stats;
+}
+
 static const struct net_device_ops usbnet_netdev_ops = {
 	.ndo_open		= usbnet_open,
 	.ndo_stop		= usbnet_stop,
+	.ndo_get_stats		= usbnet_get_stats,
 	.ndo_start_xmit		= usbnet_start_xmit,
 	.ndo_tx_timeout		= usbnet_tx_timeout,
 	.ndo_change_mtu		= usbnet_change_mtu,