Blame SOURCES/0001-ethtool-copy.h-sync-with-net.patch

9b550e
From e63362618ed0b54fe8341c700cf5fe695a24b258 Mon Sep 17 00:00:00 2001
9b550e
From: Ben Hutchings <ben@decadent.org.uk>
9b550e
Date: Sun, 21 Sep 2014 21:40:46 +0100
9b550e
Subject: [PATCH 1/4] ethtool-copy.h: sync with net
9b550e
9b550e
This covers kernel changes up to:
9b550e
9b550e
commit 38c891a49dec43dbb1575cc40d10dbd49c4961ab
9b550e
Author: Ben Hutchings <ben@decadent.org.uk>
9b550e
Date:   Thu May 15 01:07:16 2014 +0100
9b550e
9b550e
    ethtool: Improve explanation of the two arrays following struct ethtool_rxfh
9b550e
9b550e
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
9b550e
---
9b550e
 ethtool-copy.h | 478 +++++++++++++++++++++++++++++++++++++++++++--------------
9b550e
 1 file changed, 363 insertions(+), 115 deletions(-)
9b550e
9b550e
diff --git a/ethtool-copy.h b/ethtool-copy.h
9b550e
index b5515c2..61b78fc 100644
9b550e
--- a/ethtool-copy.h
9b550e
+++ b/ethtool-copy.h
9b550e
@@ -16,37 +16,97 @@
9b550e
 #include <linux/types.h>
9b550e
 #include <linux/if_ether.h>
9b550e
 
9b550e
-/* This should work for both 32 and 64 bit userland. */
9b550e
+/* All structures exposed to userland should be defined such that they
9b550e
+ * have the same layout for 32-bit and 64-bit userland.
9b550e
+ */
9b550e
+
9b550e
+/**
9b550e
+ * struct ethtool_cmd - link control and status
9b550e
+ * @cmd: Command number = %ETHTOOL_GSET or %ETHTOOL_SSET
9b550e
+ * @supported: Bitmask of %SUPPORTED_* flags for the link modes,
9b550e
+ *	physical connectors and other link features for which the
9b550e
+ *	interface supports autonegotiation or auto-detection.
9b550e
+ *	Read-only.
9b550e
+ * @advertising: Bitmask of %ADVERTISED_* flags for the link modes,
9b550e
+ *	physical connectors and other link features that are
9b550e
+ *	advertised through autonegotiation or enabled for
9b550e
+ *	auto-detection.
9b550e
+ * @speed: Low bits of the speed
9b550e
+ * @duplex: Duplex mode; one of %DUPLEX_*
9b550e
+ * @port: Physical connector type; one of %PORT_*
9b550e
+ * @phy_address: MDIO address of PHY (transceiver); 0 or 255 if not
9b550e
+ *	applicable.  For clause 45 PHYs this is the PRTAD.
9b550e
+ * @transceiver: Historically used to distinguish different possible
9b550e
+ *	PHY types, but not in a consistent way.  Deprecated.
9b550e
+ * @autoneg: Enable/disable autonegotiation and auto-detection;
9b550e
+ *	either %AUTONEG_DISABLE or %AUTONEG_ENABLE
9b550e
+ * @mdio_support: Bitmask of %ETH_MDIO_SUPPORTS_* flags for the MDIO
9b550e
+ *	protocols supported by the interface; 0 if unknown.
9b550e
+ *	Read-only.
9b550e
+ * @maxtxpkt: Historically used to report TX IRQ coalescing; now
9b550e
+ *	obsoleted by &struct ethtool_coalesce.  Read-only; deprecated.
9b550e
+ * @maxrxpkt: Historically used to report RX IRQ coalescing; now
9b550e
+ *	obsoleted by &struct ethtool_coalesce.  Read-only; deprecated.
9b550e
+ * @speed_hi: High bits of the speed
9b550e
+ * @eth_tp_mdix: Ethernet twisted-pair MDI(-X) status; one of
9b550e
+ *	%ETH_TP_MDI_*.  If the status is unknown or not applicable, the
9b550e
+ *	value will be %ETH_TP_MDI_INVALID.  Read-only.
9b550e
+ * @eth_tp_mdix_ctrl: Ethernet twisted pair MDI(-X) control; one of
9b550e
+ *	%ETH_TP_MDI_*.  If MDI(-X) control is not implemented, reads
9b550e
+ *	yield %ETH_TP_MDI_INVALID and writes may be ignored or rejected.
9b550e
+ *	When written successfully, the link should be renegotiated if
9b550e
+ *	necessary.
9b550e
+ * @lp_advertising: Bitmask of %ADVERTISED_* flags for the link modes
9b550e
+ *	and other link features that the link partner advertised
9b550e
+ *	through autonegotiation; 0 if unknown or not applicable.
9b550e
+ *	Read-only.
9b550e
+ *
9b550e
+ * The link speed in Mbps is split between @speed and @speed_hi.  Use
9b550e
+ * the ethtool_cmd_speed() and ethtool_cmd_speed_set() functions to
9b550e
+ * access it.
9b550e
+ *
9b550e
+ * If autonegotiation is disabled, the speed and @duplex represent the
9b550e
+ * fixed link mode and are writable if the driver supports multiple
9b550e
+ * link modes.  If it is enabled then they are read-only; if the link
9b550e
+ * is up they represent the negotiated link mode; if the link is down,
9b550e
+ * the speed is 0, %SPEED_UNKNOWN or the highest enabled speed and
9b550e
+ * @duplex is %DUPLEX_UNKNOWN or the best enabled duplex mode.
9b550e
+ *
9b550e
+ * Some hardware interfaces may have multiple PHYs and/or physical
9b550e
+ * connectors fitted or do not allow the driver to detect which are
9b550e
+ * fitted.  For these interfaces @port and/or @phy_address may be
9b550e
+ * writable, possibly dependent on @autoneg being %AUTONEG_DISABLE.
9b550e
+ * Otherwise, attempts to write different values may be ignored or
9b550e
+ * rejected.
9b550e
+ *
9b550e
+ * Users should assume that all fields not marked read-only are
9b550e
+ * writable and subject to validation by the driver.  They should use
9b550e
+ * %ETHTOOL_GSET to get the current values before making specific
9b550e
+ * changes and then applying them with %ETHTOOL_SSET.
9b550e
+ *
9b550e
+ * Drivers that implement set_settings() should validate all fields
9b550e
+ * other than @cmd that are not described as read-only or deprecated,
9b550e
+ * and must ignore all fields described as read-only.
9b550e
+ *
9b550e
+ * Deprecated fields should be ignored by both users and drivers.
9b550e
+ */
9b550e
 struct ethtool_cmd {
9b550e
 	__u32	cmd;
9b550e
-	__u32	supported;	/* Features this interface supports */
9b550e
-	__u32	advertising;	/* Features this interface advertises */
9b550e
-	__u16	speed;	        /* The forced speed (lower bits) in
9b550e
-				 * Mbps. Please use
9b550e
-				 * ethtool_cmd_speed()/_set() to
9b550e
-				 * access it */
9b550e
-	__u8	duplex;		/* Duplex, half or full */
9b550e
-	__u8	port;		/* Which connector port */
9b550e
-	__u8	phy_address;	/* MDIO PHY address (PRTAD for clause 45).
9b550e
-				 * May be read-only or read-write
9b550e
-				 * depending on the driver.
9b550e
-				 */
9b550e
-	__u8	transceiver;	/* Which transceiver to use */
9b550e
-	__u8	autoneg;	/* Enable or disable autonegotiation */
9b550e
-	__u8	mdio_support;	/* MDIO protocols supported.  Read-only.
9b550e
-				 * Not set by all drivers.
9b550e
-				 */
9b550e
-	__u32	maxtxpkt;	/* Tx pkts before generating tx int */
9b550e
-	__u32	maxrxpkt;	/* Rx pkts before generating rx int */
9b550e
-	__u16	speed_hi;       /* The forced speed (upper
9b550e
-				 * bits) in Mbps. Please use
9b550e
-				 * ethtool_cmd_speed()/_set() to
9b550e
-				 * access it */
9b550e
-	__u8	eth_tp_mdix;	/* twisted pair MDI-X status */
9b550e
-	__u8    eth_tp_mdix_ctrl; /* twisted pair MDI-X control, when set,
9b550e
-				   * link should be renegotiated if necessary
9b550e
-				   */
9b550e
-	__u32	lp_advertising;	/* Features the link partner advertises */
9b550e
+	__u32	supported;
9b550e
+	__u32	advertising;
9b550e
+	__u16	speed;
9b550e
+	__u8	duplex;
9b550e
+	__u8	port;
9b550e
+	__u8	phy_address;
9b550e
+	__u8	transceiver;
9b550e
+	__u8	autoneg;
9b550e
+	__u8	mdio_support;
9b550e
+	__u32	maxtxpkt;
9b550e
+	__u32	maxrxpkt;
9b550e
+	__u16	speed_hi;
9b550e
+	__u8	eth_tp_mdix;
9b550e
+	__u8	eth_tp_mdix_ctrl;
9b550e
+	__u32	lp_advertising;
9b550e
 	__u32	reserved[2];
9b550e
 };
9b550e
 
9b550e
@@ -79,37 +139,68 @@ static __inline__ __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
9b550e
 
9b550e
 #define ETHTOOL_FWVERS_LEN	32
9b550e
 #define ETHTOOL_BUSINFO_LEN	32
9b550e
-/* these strings are set to whatever the driver author decides... */
9b550e
+
9b550e
+/**
9b550e
+ * struct ethtool_drvinfo - general driver and device information
9b550e
+ * @cmd: Command number = %ETHTOOL_GDRVINFO
9b550e
+ * @driver: Driver short name.  This should normally match the name
9b550e
+ *	in its bus driver structure (e.g. pci_driver::name).  Must
9b550e
+ *	not be an empty string.
9b550e
+ * @version: Driver version string; may be an empty string
9b550e
+ * @fw_version: Firmware version string; may be an empty string
9b550e
+ * @bus_info: Device bus address.  This should match the dev_name()
9b550e
+ *	string for the underlying bus device, if there is one.  May be
9b550e
+ *	an empty string.
9b550e
+ * @n_priv_flags: Number of flags valid for %ETHTOOL_GPFLAGS and
9b550e
+ *	%ETHTOOL_SPFLAGS commands; also the number of strings in the
9b550e
+ *	%ETH_SS_PRIV_FLAGS set
9b550e
+ * @n_stats: Number of u64 statistics returned by the %ETHTOOL_GSTATS
9b550e
+ *	command; also the number of strings in the %ETH_SS_STATS set
9b550e
+ * @testinfo_len: Number of results returned by the %ETHTOOL_TEST
9b550e
+ *	command; also the number of strings in the %ETH_SS_TEST set
9b550e
+ * @eedump_len: Size of EEPROM accessible through the %ETHTOOL_GEEPROM
9b550e
+ *	and %ETHTOOL_SEEPROM commands, in bytes
9b550e
+ * @regdump_len: Size of register dump returned by the %ETHTOOL_GREGS
9b550e
+ *	command, in bytes
9b550e
+ *
9b550e
+ * Users can use the %ETHTOOL_GSSET_INFO command to get the number of
9b550e
+ * strings in any string set (from Linux 2.6.34).
9b550e
+ *
9b550e
+ * Drivers should set at most @driver, @version, @fw_version and
9b550e
+ * @bus_info in their get_drvinfo() implementation.  The ethtool
9b550e
+ * core fills in the other fields using other driver operations.
9b550e
+ */
9b550e
 struct ethtool_drvinfo {
9b550e
 	__u32	cmd;
9b550e
-	char	driver[32];	/* driver short name, "tulip", "eepro100" */
9b550e
-	char	version[32];	/* driver version string */
9b550e
-	char	fw_version[ETHTOOL_FWVERS_LEN];	/* firmware version string */
9b550e
-	char	bus_info[ETHTOOL_BUSINFO_LEN];	/* Bus info for this IF. */
9b550e
-				/* For PCI devices, use pci_name(pci_dev). */
9b550e
+	char	driver[32];
9b550e
+	char	version[32];
9b550e
+	char	fw_version[ETHTOOL_FWVERS_LEN];
9b550e
+	char	bus_info[ETHTOOL_BUSINFO_LEN];
9b550e
 	char	reserved1[32];
9b550e
 	char	reserved2[12];
9b550e
-				/*
9b550e
-				 * Some struct members below are filled in
9b550e
-				 * using ops->get_sset_count().  Obtaining
9b550e
-				 * this info from ethtool_drvinfo is now
9b550e
-				 * deprecated; Use ETHTOOL_GSSET_INFO
9b550e
-				 * instead.
9b550e
-				 */
9b550e
-	__u32	n_priv_flags;	/* number of flags valid in ETHTOOL_GPFLAGS */
9b550e
-	__u32	n_stats;	/* number of u64's from ETHTOOL_GSTATS */
9b550e
+	__u32	n_priv_flags;
9b550e
+	__u32	n_stats;
9b550e
 	__u32	testinfo_len;
9b550e
-	__u32	eedump_len;	/* Size of data from ETHTOOL_GEEPROM (bytes) */
9b550e
-	__u32	regdump_len;	/* Size of data from ETHTOOL_GREGS (bytes) */
9b550e
+	__u32	eedump_len;
9b550e
+	__u32	regdump_len;
9b550e
 };
9b550e
 
9b550e
 #define SOPASS_MAX	6
9b550e
-/* wake-on-lan settings */
9b550e
+
9b550e
+/**
9b550e
+ * struct ethtool_wolinfo - Wake-On-Lan configuration
9b550e
+ * @cmd: Command number = %ETHTOOL_GWOL or %ETHTOOL_SWOL
9b550e
+ * @supported: Bitmask of %WAKE_* flags for supported Wake-On-Lan modes.
9b550e
+ *	Read-only.
9b550e
+ * @wolopts: Bitmask of %WAKE_* flags for enabled Wake-On-Lan modes.
9b550e
+ * @sopass: SecureOn(tm) password; meaningful only if %WAKE_MAGICSECURE
9b550e
+ *	is set in @wolopts.
9b550e
+ */
9b550e
 struct ethtool_wolinfo {
9b550e
 	__u32	cmd;
9b550e
 	__u32	supported;
9b550e
 	__u32	wolopts;
9b550e
-	__u8	sopass[SOPASS_MAX]; /* SecureOn(tm) password */
9b550e
+	__u8	sopass[SOPASS_MAX];
9b550e
 };
9b550e
 
9b550e
 /* for passing single values */
9b550e
@@ -118,20 +209,51 @@ struct ethtool_value {
9b550e
 	__u32	data;
9b550e
 };
9b550e
 
9b550e
-/* for passing big chunks of data */
9b550e
+/**
9b550e
+ * struct ethtool_regs - hardware register dump
9b550e
+ * @cmd: Command number = %ETHTOOL_GREGS
9b550e
+ * @version: Dump format version.  This is driver-specific and may
9b550e
+ *	distinguish different chips/revisions.  Drivers must use new
9b550e
+ *	version numbers whenever the dump format changes in an
9b550e
+ *	incompatible way.
9b550e
+ * @len: On entry, the real length of @data.  On return, the number of
9b550e
+ *	bytes used.
9b550e
+ * @data: Buffer for the register dump
9b550e
+ *
9b550e
+ * Users should use %ETHTOOL_GDRVINFO to find the maximum length of
9b550e
+ * a register dump for the interface.  They must allocate the buffer
9b550e
+ * immediately following this structure.
9b550e
+ */
9b550e
 struct ethtool_regs {
9b550e
 	__u32	cmd;
9b550e
-	__u32	version; /* driver-specific, indicates different chips/revs */
9b550e
-	__u32	len; /* bytes */
9b550e
+	__u32	version;
9b550e
+	__u32	len;
9b550e
 	__u8	data[0];
9b550e
 };
9b550e
 
9b550e
-/* for passing EEPROM chunks */
9b550e
+/**
9b550e
+ * struct ethtool_eeprom - EEPROM dump
9b550e
+ * @cmd: Command number = %ETHTOOL_GEEPROM, %ETHTOOL_GMODULEEEPROM or
9b550e
+ *	%ETHTOOL_SEEPROM
9b550e
+ * @magic: A 'magic cookie' value to guard against accidental changes.
9b550e
+ *	The value passed in to %ETHTOOL_SEEPROM must match the value
9b550e
+ *	returned by %ETHTOOL_GEEPROM for the same device.  This is
9b550e
+ *	unused when @cmd is %ETHTOOL_GMODULEEEPROM.
9b550e
+ * @offset: Offset within the EEPROM to begin reading/writing, in bytes
9b550e
+ * @len: On entry, number of bytes to read/write.  On successful
9b550e
+ *	return, number of bytes actually read/written.  In case of
9b550e
+ *	error, this may indicate at what point the error occurred.
9b550e
+ * @data: Buffer to read/write from
9b550e
+ *
9b550e
+ * Users may use %ETHTOOL_GDRVINFO or %ETHTOOL_GMODULEINFO to find
9b550e
+ * the length of an on-board or module EEPROM, respectively.  They
9b550e
+ * must allocate the buffer immediately following this structure.
9b550e
+ */
9b550e
 struct ethtool_eeprom {
9b550e
 	__u32	cmd;
9b550e
 	__u32	magic;
9b550e
-	__u32	offset; /* in bytes */
9b550e
-	__u32	len; /* in bytes */
9b550e
+	__u32	offset;
9b550e
+	__u32	len;
9b550e
 	__u8	data[0];
9b550e
 };
9b550e
 
9b550e
@@ -229,17 +351,18 @@ struct ethtool_modinfo {
9b550e
  * @rate_sample_interval: How often to do adaptive coalescing packet rate
9b550e
  *	sampling, measured in seconds.  Must not be zero.
9b550e
  *
9b550e
- * Each pair of (usecs, max_frames) fields specifies this exit
9b550e
- * condition for interrupt coalescing:
9b550e
+ * Each pair of (usecs, max_frames) fields specifies that interrupts
9b550e
+ * should be coalesced until
9b550e
  *	(usecs > 0 && time_since_first_completion >= usecs) ||
9b550e
  *	(max_frames > 0 && completed_frames >= max_frames)
9b550e
+ *
9b550e
  * It is illegal to set both usecs and max_frames to zero as this
9b550e
  * would cause interrupts to never be generated.  To disable
9b550e
  * coalescing, set usecs = 0 and max_frames = 1.
9b550e
  *
9b550e
  * Some implementations ignore the value of max_frames and use the
9b550e
- * condition:
9b550e
- *	time_since_first_completion >= usecs
9b550e
+ * condition time_since_first_completion >= usecs
9b550e
+ *
9b550e
  * This is deprecated.  Drivers for hardware that does not support
9b550e
  * counting completions should validate that max_frames == !rx_usecs.
9b550e
  *
9b550e
@@ -279,22 +402,37 @@ struct ethtool_coalesce {
9b550e
 	__u32	rate_sample_interval;
9b550e
 };
9b550e
 
9b550e
-/* for configuring RX/TX ring parameters */
9b550e
+/**
9b550e
+ * struct ethtool_ringparam - RX/TX ring parameters
9b550e
+ * @cmd: Command number = %ETHTOOL_GRINGPARAM or %ETHTOOL_SRINGPARAM
9b550e
+ * @rx_max_pending: Maximum supported number of pending entries per
9b550e
+ *	RX ring.  Read-only.
9b550e
+ * @rx_mini_max_pending: Maximum supported number of pending entries
9b550e
+ *	per RX mini ring.  Read-only.
9b550e
+ * @rx_jumbo_max_pending: Maximum supported number of pending entries
9b550e
+ *	per RX jumbo ring.  Read-only.
9b550e
+ * @tx_max_pending: Maximum supported number of pending entries per
9b550e
+ *	TX ring.  Read-only.
9b550e
+ * @rx_pending: Current maximum number of pending entries per RX ring
9b550e
+ * @rx_mini_pending: Current maximum number of pending entries per RX
9b550e
+ *	mini ring
9b550e
+ * @rx_jumbo_pending: Current maximum number of pending entries per RX
9b550e
+ *	jumbo ring
9b550e
+ * @tx_pending: Current maximum supported number of pending entries
9b550e
+ *	per TX ring
9b550e
+ *
9b550e
+ * If the interface does not have separate RX mini and/or jumbo rings,
9b550e
+ * @rx_mini_max_pending and/or @rx_jumbo_max_pending will be 0.
9b550e
+ *
9b550e
+ * There may also be driver-dependent minimum values for the number
9b550e
+ * of entries per ring.
9b550e
+ */
9b550e
 struct ethtool_ringparam {
9b550e
-	__u32	cmd;	/* ETHTOOL_{G,S}RINGPARAM */
9b550e
-
9b550e
-	/* Read only attributes.  These indicate the maximum number
9b550e
-	 * of pending RX/TX ring entries the driver will allow the
9b550e
-	 * user to set.
9b550e
-	 */
9b550e
+	__u32	cmd;
9b550e
 	__u32	rx_max_pending;
9b550e
 	__u32	rx_mini_max_pending;
9b550e
 	__u32	rx_jumbo_max_pending;
9b550e
 	__u32	tx_max_pending;
9b550e
-
9b550e
-	/* Values changeable by the user.  The valid values are
9b550e
-	 * in the range 1 to the "*_max_pending" counterpart above.
9b550e
-	 */
9b550e
 	__u32	rx_pending;
9b550e
 	__u32	rx_mini_pending;
9b550e
 	__u32	rx_jumbo_pending;
9b550e
@@ -329,51 +467,96 @@ struct ethtool_channels {
9b550e
 	__u32	combined_count;
9b550e
 };
9b550e
 
9b550e
-/* for configuring link flow control parameters */
9b550e
+/**
9b550e
+ * struct ethtool_pauseparam - Ethernet pause (flow control) parameters
9b550e
+ * @cmd: Command number = %ETHTOOL_GPAUSEPARAM or %ETHTOOL_SPAUSEPARAM
9b550e
+ * @autoneg: Flag to enable autonegotiation of pause frame use
9b550e
+ * @rx_pause: Flag to enable reception of pause frames
9b550e
+ * @tx_pause: Flag to enable transmission of pause frames
9b550e
+ *
9b550e
+ * Drivers should reject a non-zero setting of @autoneg when
9b550e
+ * autoneogotiation is disabled (or not supported) for the link.
9b550e
+ *
9b550e
+ * If the link is autonegotiated, drivers should use
9b550e
+ * mii_advertise_flowctrl() or similar code to set the advertised
9b550e
+ * pause frame capabilities based on the @rx_pause and @tx_pause flags,
9b550e
+ * even if @autoneg is zero.  They should also allow the advertised
9b550e
+ * pause frame capabilities to be controlled directly through the
9b550e
+ * advertising field of &struct ethtool_cmd.
9b550e
+ *
9b550e
+ * If @autoneg is non-zero, the MAC is configured to send and/or
9b550e
+ * receive pause frames according to the result of autonegotiation.
9b550e
+ * Otherwise, it is configured directly based on the @rx_pause and
9b550e
+ * @tx_pause flags.
9b550e
+ */
9b550e
 struct ethtool_pauseparam {
9b550e
-	__u32	cmd;	/* ETHTOOL_{G,S}PAUSEPARAM */
9b550e
-
9b550e
-	/* If the link is being auto-negotiated (via ethtool_cmd.autoneg
9b550e
-	 * being true) the user may set 'autoneg' here non-zero to have the
9b550e
-	 * pause parameters be auto-negotiated too.  In such a case, the
9b550e
-	 * {rx,tx}_pause values below determine what capabilities are
9b550e
-	 * advertised.
9b550e
-	 *
9b550e
-	 * If 'autoneg' is zero or the link is not being auto-negotiated,
9b550e
-	 * then {rx,tx}_pause force the driver to use/not-use pause
9b550e
-	 * flow control.
9b550e
-	 */
9b550e
+	__u32	cmd;
9b550e
 	__u32	autoneg;
9b550e
 	__u32	rx_pause;
9b550e
 	__u32	tx_pause;
9b550e
 };
9b550e
 
9b550e
 #define ETH_GSTRING_LEN		32
9b550e
+
9b550e
+/**
9b550e
+ * enum ethtool_stringset - string set ID
9b550e
+ * @ETH_SS_TEST: Self-test result names, for use with %ETHTOOL_TEST
9b550e
+ * @ETH_SS_STATS: Statistic names, for use with %ETHTOOL_GSTATS
9b550e
+ * @ETH_SS_PRIV_FLAGS: Driver private flag names, for use with
9b550e
+ *	%ETHTOOL_GPFLAGS and %ETHTOOL_SPFLAGS
9b550e
+ * @ETH_SS_NTUPLE_FILTERS: Previously used with %ETHTOOL_GRXNTUPLE;
9b550e
+ *	now deprecated
9b550e
+ * @ETH_SS_FEATURES: Device feature names
9b550e
+ */
9b550e
 enum ethtool_stringset {
9b550e
 	ETH_SS_TEST		= 0,
9b550e
 	ETH_SS_STATS,
9b550e
 	ETH_SS_PRIV_FLAGS,
9b550e
-	ETH_SS_NTUPLE_FILTERS,	/* Do not use, GRXNTUPLE is now deprecated */
9b550e
+	ETH_SS_NTUPLE_FILTERS,
9b550e
 	ETH_SS_FEATURES,
9b550e
 };
9b550e
 
9b550e
-/* for passing string sets for data tagging */
9b550e
+/**
9b550e
+ * struct ethtool_gstrings - string set for data tagging
9b550e
+ * @cmd: Command number = %ETHTOOL_GSTRINGS
9b550e
+ * @string_set: String set ID; one of &enum ethtool_stringset
9b550e
+ * @len: On return, the number of strings in the string set
9b550e
+ * @data: Buffer for strings.  Each string is null-padded to a size of
9b550e
+ *	%ETH_GSTRING_LEN.
9b550e
+ *
9b550e
+ * Users must use %ETHTOOL_GSSET_INFO to find the number of strings in
9b550e
+ * the string set.  They must allocate a buffer of the appropriate
9b550e
+ * size immediately following this structure.
9b550e
+ */
9b550e
 struct ethtool_gstrings {
9b550e
-	__u32	cmd;		/* ETHTOOL_GSTRINGS */
9b550e
-	__u32	string_set;	/* string set id e.c. ETH_SS_TEST, etc*/
9b550e
-	__u32	len;		/* number of strings in the string set */
9b550e
+	__u32	cmd;
9b550e
+	__u32	string_set;
9b550e
+	__u32	len;
9b550e
 	__u8	data[0];
9b550e
 };
9b550e
 
9b550e
+/**
9b550e
+ * struct ethtool_sset_info - string set information
9b550e
+ * @cmd: Command number = %ETHTOOL_GSSET_INFO
9b550e
+ * @sset_mask: On entry, a bitmask of string sets to query, with bits
9b550e
+ *	numbered according to &enum ethtool_stringset.  On return, a
9b550e
+ *	bitmask of those string sets queried that are supported.
9b550e
+ * @data: Buffer for string set sizes.  On return, this contains the
9b550e
+ *	size of each string set that was queried and supported, in
9b550e
+ *	order of ID.
9b550e
+ *
9b550e
+ * Example: The user passes in @sset_mask = 0x7 (sets 0, 1, 2) and on
9b550e
+ * return @sset_mask == 0x6 (sets 1, 2).  Then @data[0] contains the
9b550e
+ * size of set 1 and @data[1] contains the size of set 2.
9b550e
+ *
9b550e
+ * Users must allocate a buffer of the appropriate size (4 * number of
9b550e
+ * sets queried) immediately following this structure.
9b550e
+ */
9b550e
 struct ethtool_sset_info {
9b550e
-	__u32	cmd;		/* ETHTOOL_GSSET_INFO */
9b550e
+	__u32	cmd;
9b550e
 	__u32	reserved;
9b550e
-	__u64	sset_mask;	/* input: each bit selects an sset to query */
9b550e
-				/* output: each bit a returned sset */
9b550e
-	__u32	data[0];	/* ETH_SS_xxx count, in order, based on bits
9b550e
-				   in sset_mask.  One bit implies one
9b550e
-				   __u32, two bits implies two
9b550e
-				   __u32's, etc. */
9b550e
+	__u64	sset_mask;
9b550e
+	__u32	data[0];
9b550e
 };
9b550e
 
9b550e
 /**
9b550e
@@ -393,24 +576,58 @@ enum ethtool_test_flags {
9b550e
 	ETH_TEST_FL_EXTERNAL_LB_DONE	= (1 << 3),
9b550e
 };
9b550e
 
9b550e
-/* for requesting NIC test and getting results*/
9b550e
+/**
9b550e
+ * struct ethtool_test - device self-test invocation
9b550e
+ * @cmd: Command number = %ETHTOOL_TEST
9b550e
+ * @flags: A bitmask of flags from &enum ethtool_test_flags.  Some
9b550e
+ *	flags may be set by the user on entry; others may be set by
9b550e
+ *	the driver on return.
9b550e
+ * @len: On return, the number of test results
9b550e
+ * @data: Array of test results
9b550e
+ *
9b550e
+ * Users must use %ETHTOOL_GSSET_INFO or %ETHTOOL_GDRVINFO to find the
9b550e
+ * number of test results that will be returned.  They must allocate a
9b550e
+ * buffer of the appropriate size (8 * number of results) immediately
9b550e
+ * following this structure.
9b550e
+ */
9b550e
 struct ethtool_test {
9b550e
-	__u32	cmd;		/* ETHTOOL_TEST */
9b550e
-	__u32	flags;		/* ETH_TEST_FL_xxx */
9b550e
+	__u32	cmd;
9b550e
+	__u32	flags;
9b550e
 	__u32	reserved;
9b550e
-	__u32	len;		/* result length, in number of u64 elements */
9b550e
+	__u32	len;
9b550e
 	__u64	data[0];
9b550e
 };
9b550e
 
9b550e
-/* for dumping NIC-specific statistics */
9b550e
+/**
9b550e
+ * struct ethtool_stats - device-specific statistics
9b550e
+ * @cmd: Command number = %ETHTOOL_GSTATS
9b550e
+ * @n_stats: On return, the number of statistics
9b550e
+ * @data: Array of statistics
9b550e
+ *
9b550e
+ * Users must use %ETHTOOL_GSSET_INFO or %ETHTOOL_GDRVINFO to find the
9b550e
+ * number of statistics that will be returned.  They must allocate a
9b550e
+ * buffer of the appropriate size (8 * number of statistics)
9b550e
+ * immediately following this structure.
9b550e
+ */
9b550e
 struct ethtool_stats {
9b550e
-	__u32	cmd;		/* ETHTOOL_GSTATS */
9b550e
-	__u32	n_stats;	/* number of u64's being returned */
9b550e
+	__u32	cmd;
9b550e
+	__u32	n_stats;
9b550e
 	__u64	data[0];
9b550e
 };
9b550e
 
9b550e
+/**
9b550e
+ * struct ethtool_perm_addr - permanent hardware address
9b550e
+ * @cmd: Command number = %ETHTOOL_GPERMADDR
9b550e
+ * @size: On entry, the size of the buffer.  On return, the size of the
9b550e
+ *	address.  The command fails if the buffer is too small.
9b550e
+ * @data: Buffer for the address
9b550e
+ *
9b550e
+ * Users must allocate the buffer immediately following this structure.
9b550e
+ * A buffer size of %MAX_ADDR_LEN should be sufficient for any address
9b550e
+ * type.
9b550e
+ */
9b550e
 struct ethtool_perm_addr {
9b550e
-	__u32	cmd;		/* ETHTOOL_GPERMADDR */
9b550e
+	__u32	cmd;
9b550e
 	__u32	size;
9b550e
 	__u8	data[0];
9b550e
 };
9b550e
@@ -593,7 +810,7 @@ struct ethtool_rx_flow_spec {
9b550e
  * %ETHTOOL_SRXCLSRLINS may add the rule at any suitable unused
9b550e
  * location, and may remove a rule at a later location (lower
9b550e
  * priority) that matches exactly the same set of flows.  The special
9b550e
- * values are: %RX_CLS_LOC_ANY, selecting any location;
9b550e
+ * values are %RX_CLS_LOC_ANY, selecting any location;
9b550e
  * %RX_CLS_LOC_FIRST, selecting the first suitable location (maximum
9b550e
  * priority); and %RX_CLS_LOC_LAST, selecting the last suitable
9b550e
  * location (minimum priority).  Additional special values may be
9b550e
@@ -630,6 +847,38 @@ struct ethtool_rxfh_indir {
9b550e
 };
9b550e
 
9b550e
 /**
9b550e
+ * struct ethtool_rxfh - command to get/set RX flow hash indir or/and hash key.
9b550e
+ * @cmd: Specific command number - %ETHTOOL_GRSSH or %ETHTOOL_SRSSH
9b550e
+ * @rss_context: RSS context identifier.
9b550e
+ * @indir_size: On entry, the array size of the user buffer for the
9b550e
+ *	indirection table, which may be zero, or (for %ETHTOOL_SRSSH),
9b550e
+ *	%ETH_RXFH_INDIR_NO_CHANGE.  On return from %ETHTOOL_GRSSH,
9b550e
+ *	the array size of the hardware indirection table.
9b550e
+ * @key_size: On entry, the array size of the user buffer for the hash key,
9b550e
+ *	which may be zero.  On return from %ETHTOOL_GRSSH, the size of the
9b550e
+ *	hardware hash key.
9b550e
+ * @rsvd:	Reserved for future extensions.
9b550e
+ * @rss_config: RX ring/queue index for each hash value i.e., indirection table
9b550e
+ *	of @indir_size __u32 elements, followed by hash key of @key_size
9b550e
+ *	bytes.
9b550e
+ *
9b550e
+ * For %ETHTOOL_GRSSH, a @indir_size and key_size of zero means that only the
9b550e
+ * size should be returned.  For %ETHTOOL_SRSSH, an @indir_size of
9b550e
+ * %ETH_RXFH_INDIR_NO_CHANGE means that indir table setting is not requested
9b550e
+ * and a @indir_size of zero means the indir table should be reset to default
9b550e
+ * values.
9b550e
+ */
9b550e
+struct ethtool_rxfh {
9b550e
+	__u32   cmd;
9b550e
+	__u32	rss_context;
9b550e
+	__u32   indir_size;
9b550e
+	__u32   key_size;
9b550e
+	__u32	rsvd[2];
9b550e
+	__u32   rss_config[0];
9b550e
+};
9b550e
+#define ETH_RXFH_INDIR_NO_CHANGE	0xffffffff
9b550e
+
9b550e
+/**
9b550e
  * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
9b550e
  * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
9b550e
  * @h_u: Flow field values to match (dependent on @flow_type)
9b550e
@@ -704,9 +953,6 @@ struct ethtool_flash {
9b550e
  * 	 for %ETHTOOL_GET_DUMP_FLAG command
9b550e
  * @data: data collected for get dump data operation
9b550e
  */
9b550e
-
9b550e
-#define ETH_FW_DUMP_DISABLE 0
9b550e
-
9b550e
 struct ethtool_dump {
9b550e
 	__u32	cmd;
9b550e
 	__u32	version;
9b550e
@@ -715,6 +961,8 @@ struct ethtool_dump {
9b550e
 	__u8	data[0];
9b550e
 };
9b550e
 
9b550e
+#define ETH_FW_DUMP_DISABLE 0
9b550e
+
9b550e
 /* for returning and changing feature sets */
9b550e
 
9b550e
 /**
9b550e
@@ -734,8 +982,9 @@ struct ethtool_get_features_block {
9b550e
 /**
9b550e
  * struct ethtool_gfeatures - command to get state of device's features
9b550e
  * @cmd: command number = %ETHTOOL_GFEATURES
9b550e
- * @size: in: number of elements in the features[] array;
9b550e
- *       out: number of elements in features[] needed to hold all features
9b550e
+ * @size: On entry, the number of elements in the features[] array;
9b550e
+ *	on return, the number of elements in features[] needed to hold
9b550e
+ *	all features
9b550e
  * @features: state of features
9b550e
  */
9b550e
 struct ethtool_gfeatures {
9b550e
@@ -901,11 +1150,13 @@ enum ethtool_sfeatures_retval_bits {
9b550e
 #define ETHTOOL_GEEE		0x00000044 /* Get EEE settings */
9b550e
 #define ETHTOOL_SEEE		0x00000045 /* Set EEE settings */
9b550e
 
9b550e
+#define ETHTOOL_GRSSH		0x00000046 /* Get RX flow hash configuration */
9b550e
+#define ETHTOOL_SRSSH		0x00000047 /* Set RX flow hash configuration */
9b550e
+
9b550e
 /* compatibility with older code */
9b550e
 #define SPARC_ETH_GSET		ETHTOOL_GSET
9b550e
 #define SPARC_ETH_SSET		ETHTOOL_SSET
9b550e
 
9b550e
-/* Indicates what features are supported by the interface. */
9b550e
 #define SUPPORTED_10baseT_Half		(1 << 0)
9b550e
 #define SUPPORTED_10baseT_Full		(1 << 1)
9b550e
 #define SUPPORTED_100baseT_Half		(1 << 2)
9b550e
@@ -934,7 +1185,6 @@ enum ethtool_sfeatures_retval_bits {
9b550e
 #define SUPPORTED_40000baseSR4_Full	(1 << 25)
9b550e
 #define SUPPORTED_40000baseLR4_Full	(1 << 26)
9b550e
 
9b550e
-/* Indicates what features are advertised by the interface. */
9b550e
 #define ADVERTISED_10baseT_Half		(1 << 0)
9b550e
 #define ADVERTISED_10baseT_Full		(1 << 1)
9b550e
 #define ADVERTISED_100baseT_Half	(1 << 2)
9b550e
@@ -993,15 +1243,13 @@ enum ethtool_sfeatures_retval_bits {
9b550e
 #define PORT_OTHER		0xff
9b550e
 
9b550e
 /* Which transceiver to use. */
9b550e
-#define XCVR_INTERNAL		0x00
9b550e
-#define XCVR_EXTERNAL		0x01
9b550e
+#define XCVR_INTERNAL		0x00 /* PHY and MAC are in the same package */
9b550e
+#define XCVR_EXTERNAL		0x01 /* PHY and MAC are in different packages */
9b550e
 #define XCVR_DUMMY1		0x02
9b550e
 #define XCVR_DUMMY2		0x03
9b550e
 #define XCVR_DUMMY3		0x04
9b550e
 
9b550e
-/* Enable or disable autonegotiation.  If this is set to enable,
9b550e
- * the forced link modes above are completely ignored.
9b550e
- */
9b550e
+/* Enable or disable autonegotiation. */
9b550e
 #define AUTONEG_DISABLE		0x00
9b550e
 #define AUTONEG_ENABLE		0x01
9b550e
 
9b550e
-- 
9b550e
1.8.3.1
9b550e