Re: [Bugme-new] [Bug 13589] New: usbnet and /proc/net/dev stats
From: Ben Kibbey <hidden>
Date: 2009-06-30 00:53:44
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:
--- /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,
--
Ben Kibbey (bjk) @ FreeNode/OFTC/Jabber