From: Ben Hutchings <ben@decadent.org.uk>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next 08/14] ethtool: Expand documentation of string set types
Date: Wed, 12 Feb 2014 22:14:33 +0000 [thread overview]
Message-ID: <1392243273.15615.12.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <1392243184.15615.4.camel@deadeye.wl.decadent.org.uk>
[-- Attachment #1: Type: text/plain, Size: 3293 bytes --]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
include/uapi/linux/ethtool.h | 59 +++++++++++++++++++++++++++++++++++---------
1 file changed, 47 insertions(+), 12 deletions(-)
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 8ca2924..e726340d 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -496,31 +496,66 @@ struct ethtool_pauseparam {
};
#define ETH_GSTRING_LEN 32
+
+/**
+ * enum ethtool_stringset - string set ID
+ * @ETH_SS_TEST: Self-test result names, for use with %ETHTOOL_TEST
+ * @ETH_SS_STATS: Statistic names, for use with %ETHTOOL_GSTATS
+ * @ETH_SS_PRIV_FLAGS: Driver private flag names, for use with
+ * %ETHTOOL_GPFLAGS and %ETHTOOL_SPFLAGS
+ * @ETH_SS_NTUPLE_FILTERS: Previously used with %ETHTOOL_GRXNTUPLE;
+ * now deprecated
+ * @ETH_SS_FEATURES: Device feature names
+ */
enum ethtool_stringset {
ETH_SS_TEST = 0,
ETH_SS_STATS,
ETH_SS_PRIV_FLAGS,
- ETH_SS_NTUPLE_FILTERS, /* Do not use, GRXNTUPLE is now deprecated */
+ ETH_SS_NTUPLE_FILTERS,
ETH_SS_FEATURES,
};
-/* for passing string sets for data tagging */
+/**
+ * struct ethtool_gstrings - string set for data tagging
+ * @cmd: Command number = %ETHTOOL_GSTRINGS
+ * @string_set: String set ID; one of &enum ethtool_stringset
+ * @len: On return, the number of strings in the string set
+ * @data: Buffer for strings. Each string is null-padded to a size of
+ * %ETH_GSTRING_LEN.
+ *
+ * Users must use %ETHTOOL_GSSET_INFO to find the number of strings in
+ * the string set. They must allocate a buffer of the appropriate
+ * size immediately following this structure.
+ */
struct ethtool_gstrings {
- __u32 cmd; /* ETHTOOL_GSTRINGS */
- __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
- __u32 len; /* number of strings in the string set */
+ __u32 cmd;
+ __u32 string_set;
+ __u32 len;
__u8 data[0];
};
+/**
+ * struct ethtool_sset_info - string set information
+ * @cmd: Command number = %ETHTOOL_GSSET_INFO
+ * @sset_mask: On entry, a bitmask of string sets to query, with bits
+ * numbered according to &enum ethtool_stringset. On return, a
+ * bitmask of those string sets queried that are supported.
+ * @data: Buffer for string set sizes. On return, this contains the
+ * size of each string set that was queried and supported, in
+ * order of ID.
+ *
+ * Example: The user passes in @sset_mask = 0x7 (sets 0, 1, 2) and on
+ * return @sset_mask == 0x6 (sets 1, 2). Then @data[0] contains the
+ * size of set 1 and @data[1] contains the size of set 2.
+ *
+ * Users must allocate a buffer of the appropriate size (4 * number of
+ * sets queried) immediately following this structure.
+ */
struct ethtool_sset_info {
- __u32 cmd; /* ETHTOOL_GSSET_INFO */
+ __u32 cmd;
__u32 reserved;
- __u64 sset_mask; /* input: each bit selects an sset to query */
- /* output: each bit a returned sset */
- __u32 data[0]; /* ETH_SS_xxx count, in order, based on bits
- in sset_mask. One bit implies one
- __u32, two bits implies two
- __u32's, etc. */
+ __u64 sset_mask;
+ __u32 data[0];
};
/**
--
Ben Hutchings
If more than one person is responsible for a bug, no one is at fault.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
next prev parent reply other threads:[~2014-02-12 22:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-12 22:13 [PATCH net-next 00/14] ethtool: Improve documentation Ben Hutchings
2014-02-12 22:13 ` [PATCH net-next 01/14] ethtool: Expand documentation of struct ethtool_cmd Ben Hutchings
2014-02-12 22:14 ` [PATCH net-next 02/14] ethtool: Expand documentation of struct ethtool_drvinfo Ben Hutchings
2014-02-12 22:14 ` [PATCH net-next 03/14] ethtool: Expand documentation of struct ethtool_wol Ben Hutchings
2014-02-12 22:14 ` [PATCH net-next 04/14] ethtool: Expand documentation of struct ethtool_regs Ben Hutchings
2014-02-12 22:14 ` [PATCH net-next 05/14] ethtool: Expand documentation of struct ethtool_eeprom Ben Hutchings
2014-02-12 22:14 ` [PATCH net-next 06/14] ethtool: Expand documentation of struct ethtool_ringparam Ben Hutchings
2014-02-12 22:14 ` [PATCH net-next 07/14] ethtool: Update documentation of struct ethtool_pauseparam Ben Hutchings
2014-02-12 22:14 ` Ben Hutchings [this message]
2014-02-12 22:14 ` [PATCH net-next 09/14] ethtool: Expand documentation of struct ethtool_test Ben Hutchings
2014-02-12 22:14 ` [PATCH net-next 10/14] ethtool: Expand documentation of struct ethtool_stats Ben Hutchings
2014-02-13 9:17 ` David Laight
2014-02-13 22:56 ` Ben Hutchings
2014-02-12 22:14 ` [PATCH net-next 11/14] ethtool: Expand documentation of struct ethtool_perm_addr Ben Hutchings
2014-02-12 22:14 ` [PATCH net-next 12/14] ethtool: Document the general convention for VLAs in kernel space Ben Hutchings
2014-02-12 22:14 ` [PATCH net-next 13/14] ethtool: Move kernel-doc comment next to struct ethtool_dump definition Ben Hutchings
2014-02-12 22:15 ` [PATCH net-next 14/14] ethtool: Fix unwanted section breaks in kernel-doc Ben Hutchings
2014-02-12 22:36 ` [PATCH net-next 00/14] ethtool: Improve documentation David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1392243273.15615.12.camel@deadeye.wl.decadent.org.uk \
--to=ben@decadent.org.uk \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox