ethtool: Expand documentation of struct ethtool_stats
authorBen Hutchings <ben@decadent.org.uk>
Wed, 12 Feb 2014 22:14:43 +0000 (22:14 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Feb 2014 22:33:03 +0000 (17:33 -0500)
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/ethtool.h

index f246f3703ed870caa69c8c47f4d512005e7b45c5..e96aec0bf7c118dc89d6a25a811483c58c643072 100644 (file)
@@ -597,10 +597,20 @@ struct ethtool_test {
        __u64   data[0];
 };
 
-/* for dumping NIC-specific statistics */
+/**
+ * struct ethtool_stats - device-specific statistics
+ * @cmd: Command number = %ETHTOOL_GSTATS
+ * @n_stats: On return, the number of statistics
+ * @data: Array of statistics
+ *
+ * Users must use %ETHTOOL_GSSET_INFO or %ETHTOOL_GDRVINFO to find the
+ * number of statistics that will be returned.  They must allocate a
+ * buffer of the appropriate size (8 * number of statistics)
+ * immediately following this structure.
+ */
 struct ethtool_stats {
-       __u32   cmd;            /* ETHTOOL_GSTATS */
-       __u32   n_stats;        /* number of u64's being returned */
+       __u32   cmd;
+       __u32   n_stats;
        __u64   data[0];
 };