Blame include/linux/ethtool.h

Packit e9ba0d
/*
Packit e9ba0d
 * ethtool.h: Defines for Linux ethtool.
Packit e9ba0d
 *
Packit e9ba0d
 * Copyright (C) 1998 David S. Miller (davem@redhat.com)
Packit e9ba0d
 * Copyright 2001 Jeff Garzik <jgarzik@pobox.com>
Packit e9ba0d
 * Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
Packit e9ba0d
 * Portions Copyright 2002 Intel (eli.kupermann@intel.com,
Packit e9ba0d
 *                                christopher.leech@intel.com,
Packit e9ba0d
 *                                scott.feldman@intel.com)
Packit e9ba0d
 * Portions Copyright (C) Sun Microsystems 2008
Packit e9ba0d
 */
Packit e9ba0d
Packit e9ba0d
#ifndef _UAPI_LINUX_ETHTOOL_H
Packit e9ba0d
#define _UAPI_LINUX_ETHTOOL_H
Packit e9ba0d
Packit e9ba0d
#include <linux/types.h>
Packit e9ba0d
#include <linux/if_ether.h>
Packit e9ba0d
Packit e9ba0d
#ifndef __KERNEL__
Packit e9ba0d
#include <limits.h> /* for INT_MAX */
Packit e9ba0d
#endif
Packit e9ba0d
Packit e9ba0d
/* All structures exposed to userland should be defined such that they
Packit e9ba0d
 * have the same layout for 32-bit and 64-bit userland.
Packit e9ba0d
 */
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_cmd - DEPRECATED, link control and status
Packit e9ba0d
 * This structure is DEPRECATED, please use struct ethtool_link_settings.
Packit e9ba0d
 * @cmd: Command number = %ETHTOOL_GSET or %ETHTOOL_SSET
Packit e9ba0d
 * @supported: Bitmask of %SUPPORTED_* flags for the link modes,
Packit e9ba0d
 *	physical connectors and other link features for which the
Packit e9ba0d
 *	interface supports autonegotiation or auto-detection.
Packit e9ba0d
 *	Read-only.
Packit e9ba0d
 * @advertising: Bitmask of %ADVERTISED_* flags for the link modes,
Packit e9ba0d
 *	physical connectors and other link features that are
Packit e9ba0d
 *	advertised through autonegotiation or enabled for
Packit e9ba0d
 *	auto-detection.
Packit e9ba0d
 * @speed: Low bits of the speed, 1Mb units, 0 to INT_MAX or SPEED_UNKNOWN
Packit e9ba0d
 * @duplex: Duplex mode; one of %DUPLEX_*
Packit e9ba0d
 * @port: Physical connector type; one of %PORT_*
Packit e9ba0d
 * @phy_address: MDIO address of PHY (transceiver); 0 or 255 if not
Packit e9ba0d
 *	applicable.  For clause 45 PHYs this is the PRTAD.
Packit e9ba0d
 * @transceiver: Historically used to distinguish different possible
Packit e9ba0d
 *	PHY types, but not in a consistent way.  Deprecated.
Packit e9ba0d
 * @autoneg: Enable/disable autonegotiation and auto-detection;
Packit e9ba0d
 *	either %AUTONEG_DISABLE or %AUTONEG_ENABLE
Packit e9ba0d
 * @mdio_support: Bitmask of %ETH_MDIO_SUPPORTS_* flags for the MDIO
Packit e9ba0d
 *	protocols supported by the interface; 0 if unknown.
Packit e9ba0d
 *	Read-only.
Packit e9ba0d
 * @maxtxpkt: Historically used to report TX IRQ coalescing; now
Packit e9ba0d
 *	obsoleted by &struct ethtool_coalesce.  Read-only; deprecated.
Packit e9ba0d
 * @maxrxpkt: Historically used to report RX IRQ coalescing; now
Packit e9ba0d
 *	obsoleted by &struct ethtool_coalesce.  Read-only; deprecated.
Packit e9ba0d
 * @speed_hi: High bits of the speed, 1Mb units, 0 to INT_MAX or SPEED_UNKNOWN
Packit e9ba0d
 * @eth_tp_mdix: Ethernet twisted-pair MDI(-X) status; one of
Packit e9ba0d
 *	%ETH_TP_MDI_*.  If the status is unknown or not applicable, the
Packit e9ba0d
 *	value will be %ETH_TP_MDI_INVALID.  Read-only.
Packit e9ba0d
 * @eth_tp_mdix_ctrl: Ethernet twisted pair MDI(-X) control; one of
Packit e9ba0d
 *	%ETH_TP_MDI_*.  If MDI(-X) control is not implemented, reads
Packit e9ba0d
 *	yield %ETH_TP_MDI_INVALID and writes may be ignored or rejected.
Packit e9ba0d
 *	When written successfully, the link should be renegotiated if
Packit e9ba0d
 *	necessary.
Packit e9ba0d
 * @lp_advertising: Bitmask of %ADVERTISED_* flags for the link modes
Packit e9ba0d
 *	and other link features that the link partner advertised
Packit e9ba0d
 *	through autonegotiation; 0 if unknown or not applicable.
Packit e9ba0d
 *	Read-only.
Packit e9ba0d
 *
Packit e9ba0d
 * The link speed in Mbps is split between @speed and @speed_hi.  Use
Packit e9ba0d
 * the ethtool_cmd_speed() and ethtool_cmd_speed_set() functions to
Packit e9ba0d
 * access it.
Packit e9ba0d
 *
Packit e9ba0d
 * If autonegotiation is disabled, the speed and @duplex represent the
Packit e9ba0d
 * fixed link mode and are writable if the driver supports multiple
Packit e9ba0d
 * link modes.  If it is enabled then they are read-only; if the link
Packit e9ba0d
 * is up they represent the negotiated link mode; if the link is down,
Packit e9ba0d
 * the speed is 0, %SPEED_UNKNOWN or the highest enabled speed and
Packit e9ba0d
 * @duplex is %DUPLEX_UNKNOWN or the best enabled duplex mode.
Packit e9ba0d
 *
Packit e9ba0d
 * Some hardware interfaces may have multiple PHYs and/or physical
Packit e9ba0d
 * connectors fitted or do not allow the driver to detect which are
Packit e9ba0d
 * fitted.  For these interfaces @port and/or @phy_address may be
Packit e9ba0d
 * writable, possibly dependent on @autoneg being %AUTONEG_DISABLE.
Packit e9ba0d
 * Otherwise, attempts to write different values may be ignored or
Packit e9ba0d
 * rejected.
Packit e9ba0d
 *
Packit e9ba0d
 * Users should assume that all fields not marked read-only are
Packit e9ba0d
 * writable and subject to validation by the driver.  They should use
Packit e9ba0d
 * %ETHTOOL_GSET to get the current values before making specific
Packit e9ba0d
 * changes and then applying them with %ETHTOOL_SSET.
Packit e9ba0d
 *
Packit e9ba0d
 * Drivers that implement set_settings() should validate all fields
Packit e9ba0d
 * other than @cmd that are not described as read-only or deprecated,
Packit e9ba0d
 * and must ignore all fields described as read-only.
Packit e9ba0d
 *
Packit e9ba0d
 * Deprecated fields should be ignored by both users and drivers.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_cmd {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	supported;
Packit e9ba0d
	__u32	advertising;
Packit e9ba0d
	__u16	speed;
Packit e9ba0d
	__u8	duplex;
Packit e9ba0d
	__u8	port;
Packit e9ba0d
	__u8	phy_address;
Packit e9ba0d
	__u8	transceiver;
Packit e9ba0d
	__u8	autoneg;
Packit e9ba0d
	__u8	mdio_support;
Packit e9ba0d
	__u32	maxtxpkt;
Packit e9ba0d
	__u32	maxrxpkt;
Packit e9ba0d
	__u16	speed_hi;
Packit e9ba0d
	__u8	eth_tp_mdix;
Packit e9ba0d
	__u8	eth_tp_mdix_ctrl;
Packit e9ba0d
	__u32	lp_advertising;
Packit e9ba0d
	__u32	reserved[2];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
Packit e9ba0d
					 __u32 speed)
Packit e9ba0d
{
Packit e9ba0d
	ep->speed = (__u16)(speed & 0xFFFF);
Packit e9ba0d
	ep->speed_hi = (__u16)(speed >> 16);
Packit e9ba0d
}
Packit e9ba0d
Packit e9ba0d
static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
Packit e9ba0d
{
Packit e9ba0d
	return (ep->speed_hi << 16) | ep->speed;
Packit e9ba0d
}
Packit e9ba0d
Packit e9ba0d
/* Device supports clause 22 register access to PHY or peripherals
Packit e9ba0d
 * using the interface defined in <linux/mii.h>.  This should not be
Packit e9ba0d
 * set if there are known to be no such peripherals present or if
Packit e9ba0d
 * the driver only emulates clause 22 registers for compatibility.
Packit e9ba0d
 */
Packit e9ba0d
#define ETH_MDIO_SUPPORTS_C22	1
Packit e9ba0d
Packit e9ba0d
/* Device supports clause 45 register access to PHY or peripherals
Packit e9ba0d
 * using the interface defined in <linux/mii.h> and <linux/mdio.h>.
Packit e9ba0d
 * This should not be set if there are known to be no such peripherals
Packit e9ba0d
 * present.
Packit e9ba0d
 */
Packit e9ba0d
#define ETH_MDIO_SUPPORTS_C45	2
Packit e9ba0d
Packit e9ba0d
#define ETHTOOL_FWVERS_LEN	32
Packit e9ba0d
#define ETHTOOL_BUSINFO_LEN	32
Packit e9ba0d
#define ETHTOOL_EROMVERS_LEN	32
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_drvinfo - general driver and device information
Packit e9ba0d
 * @cmd: Command number = %ETHTOOL_GDRVINFO
Packit e9ba0d
 * @driver: Driver short name.  This should normally match the name
Packit e9ba0d
 *	in its bus driver structure (e.g. pci_driver::name).  Must
Packit e9ba0d
 *	not be an empty string.
Packit e9ba0d
 * @version: Driver version string; may be an empty string
Packit e9ba0d
 * @fw_version: Firmware version string; may be an empty string
Packit e9ba0d
 * @erom_version: Expansion ROM version string; may be an empty string
Packit e9ba0d
 * @bus_info: Device bus address.  This should match the dev_name()
Packit e9ba0d
 *	string for the underlying bus device, if there is one.  May be
Packit e9ba0d
 *	an empty string.
Packit e9ba0d
 * @n_priv_flags: Number of flags valid for %ETHTOOL_GPFLAGS and
Packit e9ba0d
 *	%ETHTOOL_SPFLAGS commands; also the number of strings in the
Packit e9ba0d
 *	%ETH_SS_PRIV_FLAGS set
Packit e9ba0d
 * @n_stats: Number of u64 statistics returned by the %ETHTOOL_GSTATS
Packit e9ba0d
 *	command; also the number of strings in the %ETH_SS_STATS set
Packit e9ba0d
 * @testinfo_len: Number of results returned by the %ETHTOOL_TEST
Packit e9ba0d
 *	command; also the number of strings in the %ETH_SS_TEST set
Packit e9ba0d
 * @eedump_len: Size of EEPROM accessible through the %ETHTOOL_GEEPROM
Packit e9ba0d
 *	and %ETHTOOL_SEEPROM commands, in bytes
Packit e9ba0d
 * @regdump_len: Size of register dump returned by the %ETHTOOL_GREGS
Packit e9ba0d
 *	command, in bytes
Packit e9ba0d
 *
Packit e9ba0d
 * Users can use the %ETHTOOL_GSSET_INFO command to get the number of
Packit e9ba0d
 * strings in any string set (from Linux 2.6.34).
Packit e9ba0d
 *
Packit e9ba0d
 * Drivers should set at most @driver, @version, @fw_version and
Packit e9ba0d
 * @bus_info in their get_drvinfo() implementation.  The ethtool
Packit e9ba0d
 * core fills in the other fields using other driver operations.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_drvinfo {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	char	driver[32];
Packit e9ba0d
	char	version[32];
Packit e9ba0d
	char	fw_version[ETHTOOL_FWVERS_LEN];
Packit e9ba0d
	char	bus_info[ETHTOOL_BUSINFO_LEN];
Packit e9ba0d
	char	erom_version[ETHTOOL_EROMVERS_LEN];
Packit e9ba0d
	char	reserved2[12];
Packit e9ba0d
	__u32	n_priv_flags;
Packit e9ba0d
	__u32	n_stats;
Packit e9ba0d
	__u32	testinfo_len;
Packit e9ba0d
	__u32	eedump_len;
Packit e9ba0d
	__u32	regdump_len;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
#define SOPASS_MAX	6
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_wolinfo - Wake-On-Lan configuration
Packit e9ba0d
 * @cmd: Command number = %ETHTOOL_GWOL or %ETHTOOL_SWOL
Packit e9ba0d
 * @supported: Bitmask of %WAKE_* flags for supported Wake-On-Lan modes.
Packit e9ba0d
 *	Read-only.
Packit e9ba0d
 * @wolopts: Bitmask of %WAKE_* flags for enabled Wake-On-Lan modes.
Packit e9ba0d
 * @sopass: SecureOn(tm) password; meaningful only if %WAKE_MAGICSECURE
Packit e9ba0d
 *	is set in @wolopts.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_wolinfo {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	supported;
Packit e9ba0d
	__u32	wolopts;
Packit e9ba0d
	__u8	sopass[SOPASS_MAX];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/* for passing single values */
Packit e9ba0d
struct ethtool_value {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	data;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
enum tunable_id {
Packit e9ba0d
	ETHTOOL_ID_UNSPEC,
Packit e9ba0d
	ETHTOOL_RX_COPYBREAK,
Packit e9ba0d
	ETHTOOL_TX_COPYBREAK,
Packit e9ba0d
	/*
Packit e9ba0d
	 * Add your fresh new tubale attribute above and remember to update
Packit e9ba0d
	 * tunable_strings[] in net/core/ethtool.c
Packit e9ba0d
	 */
Packit e9ba0d
	__ETHTOOL_TUNABLE_COUNT,
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
enum tunable_type_id {
Packit e9ba0d
	ETHTOOL_TUNABLE_UNSPEC,
Packit e9ba0d
	ETHTOOL_TUNABLE_U8,
Packit e9ba0d
	ETHTOOL_TUNABLE_U16,
Packit e9ba0d
	ETHTOOL_TUNABLE_U32,
Packit e9ba0d
	ETHTOOL_TUNABLE_U64,
Packit e9ba0d
	ETHTOOL_TUNABLE_STRING,
Packit e9ba0d
	ETHTOOL_TUNABLE_S8,
Packit e9ba0d
	ETHTOOL_TUNABLE_S16,
Packit e9ba0d
	ETHTOOL_TUNABLE_S32,
Packit e9ba0d
	ETHTOOL_TUNABLE_S64,
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
struct ethtool_tunable {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	id;
Packit e9ba0d
	__u32	type_id;
Packit e9ba0d
	__u32	len;
Packit e9ba0d
	void	*data[0];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
#define DOWNSHIFT_DEV_DEFAULT_COUNT	0xff
Packit e9ba0d
#define DOWNSHIFT_DEV_DISABLE		0
Packit e9ba0d
Packit e9ba0d
enum phy_tunable_id {
Packit e9ba0d
	ETHTOOL_PHY_ID_UNSPEC,
Packit e9ba0d
	ETHTOOL_PHY_DOWNSHIFT,
Packit e9ba0d
	/*
Packit e9ba0d
	 * Add your fresh new phy tunable attribute above and remember to update
Packit e9ba0d
	 * phy_tunable_strings[] in net/core/ethtool.c
Packit e9ba0d
	 */
Packit e9ba0d
	__ETHTOOL_PHY_TUNABLE_COUNT,
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_regs - hardware register dump
Packit e9ba0d
 * @cmd: Command number = %ETHTOOL_GREGS
Packit e9ba0d
 * @version: Dump format version.  This is driver-specific and may
Packit e9ba0d
 *	distinguish different chips/revisions.  Drivers must use new
Packit e9ba0d
 *	version numbers whenever the dump format changes in an
Packit e9ba0d
 *	incompatible way.
Packit e9ba0d
 * @len: On entry, the real length of @data.  On return, the number of
Packit e9ba0d
 *	bytes used.
Packit e9ba0d
 * @data: Buffer for the register dump
Packit e9ba0d
 *
Packit e9ba0d
 * Users should use %ETHTOOL_GDRVINFO to find the maximum length of
Packit e9ba0d
 * a register dump for the interface.  They must allocate the buffer
Packit e9ba0d
 * immediately following this structure.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_regs {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	version;
Packit e9ba0d
	__u32	len;
Packit e9ba0d
	__u8	data[0];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_eeprom - EEPROM dump
Packit e9ba0d
 * @cmd: Command number = %ETHTOOL_GEEPROM, %ETHTOOL_GMODULEEEPROM or
Packit e9ba0d
 *	%ETHTOOL_SEEPROM
Packit e9ba0d
 * @magic: A 'magic cookie' value to guard against accidental changes.
Packit e9ba0d
 *	The value passed in to %ETHTOOL_SEEPROM must match the value
Packit e9ba0d
 *	returned by %ETHTOOL_GEEPROM for the same device.  This is
Packit e9ba0d
 *	unused when @cmd is %ETHTOOL_GMODULEEEPROM.
Packit e9ba0d
 * @offset: Offset within the EEPROM to begin reading/writing, in bytes
Packit e9ba0d
 * @len: On entry, number of bytes to read/write.  On successful
Packit e9ba0d
 *	return, number of bytes actually read/written.  In case of
Packit e9ba0d
 *	error, this may indicate at what point the error occurred.
Packit e9ba0d
 * @data: Buffer to read/write from
Packit e9ba0d
 *
Packit e9ba0d
 * Users may use %ETHTOOL_GDRVINFO or %ETHTOOL_GMODULEINFO to find
Packit e9ba0d
 * the length of an on-board or module EEPROM, respectively.  They
Packit e9ba0d
 * must allocate the buffer immediately following this structure.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_eeprom {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	magic;
Packit e9ba0d
	__u32	offset;
Packit e9ba0d
	__u32	len;
Packit e9ba0d
	__u8	data[0];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_eee - Energy Efficient Ethernet information
Packit e9ba0d
 * @cmd: ETHTOOL_{G,S}EEE
Packit e9ba0d
 * @supported: Mask of %SUPPORTED_* flags for the speed/duplex combinations
Packit e9ba0d
 *	for which there is EEE support.
Packit e9ba0d
 * @advertised: Mask of %ADVERTISED_* flags for the speed/duplex combinations
Packit e9ba0d
 *	advertised as eee capable.
Packit e9ba0d
 * @lp_advertised: Mask of %ADVERTISED_* flags for the speed/duplex
Packit e9ba0d
 *	combinations advertised by the link partner as eee capable.
Packit e9ba0d
 * @eee_active: Result of the eee auto negotiation.
Packit e9ba0d
 * @eee_enabled: EEE configured mode (enabled/disabled).
Packit e9ba0d
 * @tx_lpi_enabled: Whether the interface should assert its tx lpi, given
Packit e9ba0d
 *	that eee was negotiated.
Packit e9ba0d
 * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting
Packit e9ba0d
 *	its tx lpi (after reaching 'idle' state). Effective only when eee
Packit e9ba0d
 *	was negotiated and tx_lpi_enabled was set.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_eee {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	supported;
Packit e9ba0d
	__u32	advertised;
Packit e9ba0d
	__u32	lp_advertised;
Packit e9ba0d
	__u32	eee_active;
Packit e9ba0d
	__u32	eee_enabled;
Packit e9ba0d
	__u32	tx_lpi_enabled;
Packit e9ba0d
	__u32	tx_lpi_timer;
Packit e9ba0d
	__u32	reserved[2];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_modinfo - plugin module eeprom information
Packit e9ba0d
 * @cmd: %ETHTOOL_GMODULEINFO
Packit e9ba0d
 * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx
Packit e9ba0d
 * @eeprom_len: Length of the eeprom
Packit e9ba0d
 *
Packit e9ba0d
 * This structure is used to return the information to
Packit e9ba0d
 * properly size memory for a subsequent call to %ETHTOOL_GMODULEEEPROM.
Packit e9ba0d
 * The type code indicates the eeprom data format
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_modinfo {
Packit e9ba0d
	__u32   cmd;
Packit e9ba0d
	__u32   type;
Packit e9ba0d
	__u32   eeprom_len;
Packit e9ba0d
	__u32   reserved[8];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates
Packit e9ba0d
 * @cmd: ETHTOOL_{G,S}COALESCE
Packit e9ba0d
 * @rx_coalesce_usecs: How many usecs to delay an RX interrupt after
Packit e9ba0d
 *	a packet arrives.
Packit e9ba0d
 * @rx_max_coalesced_frames: Maximum number of packets to receive
Packit e9ba0d
 *	before an RX interrupt.
Packit e9ba0d
 * @rx_coalesce_usecs_irq: Same as @rx_coalesce_usecs, except that
Packit e9ba0d
 *	this value applies while an IRQ is being serviced by the host.
Packit e9ba0d
 * @rx_max_coalesced_frames_irq: Same as @rx_max_coalesced_frames,
Packit e9ba0d
 *	except that this value applies while an IRQ is being serviced
Packit e9ba0d
 *	by the host.
Packit e9ba0d
 * @tx_coalesce_usecs: How many usecs to delay a TX interrupt after
Packit e9ba0d
 *	a packet is sent.
Packit e9ba0d
 * @tx_max_coalesced_frames: Maximum number of packets to be sent
Packit e9ba0d
 *	before a TX interrupt.
Packit e9ba0d
 * @tx_coalesce_usecs_irq: Same as @tx_coalesce_usecs, except that
Packit e9ba0d
 *	this value applies while an IRQ is being serviced by the host.
Packit e9ba0d
 * @tx_max_coalesced_frames_irq: Same as @tx_max_coalesced_frames,
Packit e9ba0d
 *	except that this value applies while an IRQ is being serviced
Packit e9ba0d
 *	by the host.
Packit e9ba0d
 * @stats_block_coalesce_usecs: How many usecs to delay in-memory
Packit e9ba0d
 *	statistics block updates.  Some drivers do not have an
Packit e9ba0d
 *	in-memory statistic block, and in such cases this value is
Packit e9ba0d
 *	ignored.  This value must not be zero.
Packit e9ba0d
 * @use_adaptive_rx_coalesce: Enable adaptive RX coalescing.
Packit e9ba0d
 * @use_adaptive_tx_coalesce: Enable adaptive TX coalescing.
Packit e9ba0d
 * @pkt_rate_low: Threshold for low packet rate (packets per second).
Packit e9ba0d
 * @rx_coalesce_usecs_low: How many usecs to delay an RX interrupt after
Packit e9ba0d
 *	a packet arrives, when the packet rate is below @pkt_rate_low.
Packit e9ba0d
 * @rx_max_coalesced_frames_low: Maximum number of packets to be received
Packit e9ba0d
 *	before an RX interrupt, when the packet rate is below @pkt_rate_low.
Packit e9ba0d
 * @tx_coalesce_usecs_low: How many usecs to delay a TX interrupt after
Packit e9ba0d
 *	a packet is sent, when the packet rate is below @pkt_rate_low.
Packit e9ba0d
 * @tx_max_coalesced_frames_low: Maximum nuumber of packets to be sent before
Packit e9ba0d
 *	a TX interrupt, when the packet rate is below @pkt_rate_low.
Packit e9ba0d
 * @pkt_rate_high: Threshold for high packet rate (packets per second).
Packit e9ba0d
 * @rx_coalesce_usecs_high: How many usecs to delay an RX interrupt after
Packit e9ba0d
 *	a packet arrives, when the packet rate is above @pkt_rate_high.
Packit e9ba0d
 * @rx_max_coalesced_frames_high: Maximum number of packets to be received
Packit e9ba0d
 *	before an RX interrupt, when the packet rate is above @pkt_rate_high.
Packit e9ba0d
 * @tx_coalesce_usecs_high: How many usecs to delay a TX interrupt after
Packit e9ba0d
 *	a packet is sent, when the packet rate is above @pkt_rate_high.
Packit e9ba0d
 * @tx_max_coalesced_frames_high: Maximum number of packets to be sent before
Packit e9ba0d
 *	a TX interrupt, when the packet rate is above @pkt_rate_high.
Packit e9ba0d
 * @rate_sample_interval: How often to do adaptive coalescing packet rate
Packit e9ba0d
 *	sampling, measured in seconds.  Must not be zero.
Packit e9ba0d
 *
Packit e9ba0d
 * Each pair of (usecs, max_frames) fields specifies that interrupts
Packit e9ba0d
 * should be coalesced until
Packit e9ba0d
 *	(usecs > 0 && time_since_first_completion >= usecs) ||
Packit e9ba0d
 *	(max_frames > 0 && completed_frames >= max_frames)
Packit e9ba0d
 *
Packit e9ba0d
 * It is illegal to set both usecs and max_frames to zero as this
Packit e9ba0d
 * would cause interrupts to never be generated.  To disable
Packit e9ba0d
 * coalescing, set usecs = 0 and max_frames = 1.
Packit e9ba0d
 *
Packit e9ba0d
 * Some implementations ignore the value of max_frames and use the
Packit e9ba0d
 * condition time_since_first_completion >= usecs
Packit e9ba0d
 *
Packit e9ba0d
 * This is deprecated.  Drivers for hardware that does not support
Packit e9ba0d
 * counting completions should validate that max_frames == !rx_usecs.
Packit e9ba0d
 *
Packit e9ba0d
 * Adaptive RX/TX coalescing is an algorithm implemented by some
Packit e9ba0d
 * drivers to improve latency under low packet rates and improve
Packit e9ba0d
 * throughput under high packet rates.  Some drivers only implement
Packit e9ba0d
 * one of RX or TX adaptive coalescing.  Anything not implemented by
Packit e9ba0d
 * the driver causes these values to be silently ignored.
Packit e9ba0d
 *
Packit e9ba0d
 * When the packet rate is below @pkt_rate_high but above
Packit e9ba0d
 * @pkt_rate_low (both measured in packets per second) the
Packit e9ba0d
 * normal {rx,tx}_* coalescing parameters are used.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_coalesce {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	rx_coalesce_usecs;
Packit e9ba0d
	__u32	rx_max_coalesced_frames;
Packit e9ba0d
	__u32	rx_coalesce_usecs_irq;
Packit e9ba0d
	__u32	rx_max_coalesced_frames_irq;
Packit e9ba0d
	__u32	tx_coalesce_usecs;
Packit e9ba0d
	__u32	tx_max_coalesced_frames;
Packit e9ba0d
	__u32	tx_coalesce_usecs_irq;
Packit e9ba0d
	__u32	tx_max_coalesced_frames_irq;
Packit e9ba0d
	__u32	stats_block_coalesce_usecs;
Packit e9ba0d
	__u32	use_adaptive_rx_coalesce;
Packit e9ba0d
	__u32	use_adaptive_tx_coalesce;
Packit e9ba0d
	__u32	pkt_rate_low;
Packit e9ba0d
	__u32	rx_coalesce_usecs_low;
Packit e9ba0d
	__u32	rx_max_coalesced_frames_low;
Packit e9ba0d
	__u32	tx_coalesce_usecs_low;
Packit e9ba0d
	__u32	tx_max_coalesced_frames_low;
Packit e9ba0d
	__u32	pkt_rate_high;
Packit e9ba0d
	__u32	rx_coalesce_usecs_high;
Packit e9ba0d
	__u32	rx_max_coalesced_frames_high;
Packit e9ba0d
	__u32	tx_coalesce_usecs_high;
Packit e9ba0d
	__u32	tx_max_coalesced_frames_high;
Packit e9ba0d
	__u32	rate_sample_interval;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_ringparam - RX/TX ring parameters
Packit e9ba0d
 * @cmd: Command number = %ETHTOOL_GRINGPARAM or %ETHTOOL_SRINGPARAM
Packit e9ba0d
 * @rx_max_pending: Maximum supported number of pending entries per
Packit e9ba0d
 *	RX ring.  Read-only.
Packit e9ba0d
 * @rx_mini_max_pending: Maximum supported number of pending entries
Packit e9ba0d
 *	per RX mini ring.  Read-only.
Packit e9ba0d
 * @rx_jumbo_max_pending: Maximum supported number of pending entries
Packit e9ba0d
 *	per RX jumbo ring.  Read-only.
Packit e9ba0d
 * @tx_max_pending: Maximum supported number of pending entries per
Packit e9ba0d
 *	TX ring.  Read-only.
Packit e9ba0d
 * @rx_pending: Current maximum number of pending entries per RX ring
Packit e9ba0d
 * @rx_mini_pending: Current maximum number of pending entries per RX
Packit e9ba0d
 *	mini ring
Packit e9ba0d
 * @rx_jumbo_pending: Current maximum number of pending entries per RX
Packit e9ba0d
 *	jumbo ring
Packit e9ba0d
 * @tx_pending: Current maximum supported number of pending entries
Packit e9ba0d
 *	per TX ring
Packit e9ba0d
 *
Packit e9ba0d
 * If the interface does not have separate RX mini and/or jumbo rings,
Packit e9ba0d
 * @rx_mini_max_pending and/or @rx_jumbo_max_pending will be 0.
Packit e9ba0d
 *
Packit e9ba0d
 * There may also be driver-dependent minimum values for the number
Packit e9ba0d
 * of entries per ring.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_ringparam {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	rx_max_pending;
Packit e9ba0d
	__u32	rx_mini_max_pending;
Packit e9ba0d
	__u32	rx_jumbo_max_pending;
Packit e9ba0d
	__u32	tx_max_pending;
Packit e9ba0d
	__u32	rx_pending;
Packit e9ba0d
	__u32	rx_mini_pending;
Packit e9ba0d
	__u32	rx_jumbo_pending;
Packit e9ba0d
	__u32	tx_pending;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_channels - configuring number of network channel
Packit e9ba0d
 * @cmd: ETHTOOL_{G,S}CHANNELS
Packit e9ba0d
 * @max_rx: Read only. Maximum number of receive channel the driver support.
Packit e9ba0d
 * @max_tx: Read only. Maximum number of transmit channel the driver support.
Packit e9ba0d
 * @max_other: Read only. Maximum number of other channel the driver support.
Packit e9ba0d
 * @max_combined: Read only. Maximum number of combined channel the driver
Packit e9ba0d
 *	support. Set of queues RX, TX or other.
Packit e9ba0d
 * @rx_count: Valid values are in the range 1 to the max_rx.
Packit e9ba0d
 * @tx_count: Valid values are in the range 1 to the max_tx.
Packit e9ba0d
 * @other_count: Valid values are in the range 1 to the max_other.
Packit e9ba0d
 * @combined_count: Valid values are in the range 1 to the max_combined.
Packit e9ba0d
 *
Packit e9ba0d
 * This can be used to configure RX, TX and other channels.
Packit e9ba0d
 */
Packit e9ba0d
Packit e9ba0d
struct ethtool_channels {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	max_rx;
Packit e9ba0d
	__u32	max_tx;
Packit e9ba0d
	__u32	max_other;
Packit e9ba0d
	__u32	max_combined;
Packit e9ba0d
	__u32	rx_count;
Packit e9ba0d
	__u32	tx_count;
Packit e9ba0d
	__u32	other_count;
Packit e9ba0d
	__u32	combined_count;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_pauseparam - Ethernet pause (flow control) parameters
Packit e9ba0d
 * @cmd: Command number = %ETHTOOL_GPAUSEPARAM or %ETHTOOL_SPAUSEPARAM
Packit e9ba0d
 * @autoneg: Flag to enable autonegotiation of pause frame use
Packit e9ba0d
 * @rx_pause: Flag to enable reception of pause frames
Packit e9ba0d
 * @tx_pause: Flag to enable transmission of pause frames
Packit e9ba0d
 *
Packit e9ba0d
 * Drivers should reject a non-zero setting of @autoneg when
Packit e9ba0d
 * autoneogotiation is disabled (or not supported) for the link.
Packit e9ba0d
 *
Packit e9ba0d
 * If the link is autonegotiated, drivers should use
Packit e9ba0d
 * mii_advertise_flowctrl() or similar code to set the advertised
Packit e9ba0d
 * pause frame capabilities based on the @rx_pause and @tx_pause flags,
Packit e9ba0d
 * even if @autoneg is zero.  They should also allow the advertised
Packit e9ba0d
 * pause frame capabilities to be controlled directly through the
Packit e9ba0d
 * advertising field of &struct ethtool_cmd.
Packit e9ba0d
 *
Packit e9ba0d
 * If @autoneg is non-zero, the MAC is configured to send and/or
Packit e9ba0d
 * receive pause frames according to the result of autonegotiation.
Packit e9ba0d
 * Otherwise, it is configured directly based on the @rx_pause and
Packit e9ba0d
 * @tx_pause flags.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_pauseparam {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	autoneg;
Packit e9ba0d
	__u32	rx_pause;
Packit e9ba0d
	__u32	tx_pause;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
#define ETH_GSTRING_LEN		32
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * enum ethtool_stringset - string set ID
Packit e9ba0d
 * @ETH_SS_TEST: Self-test result names, for use with %ETHTOOL_TEST
Packit e9ba0d
 * @ETH_SS_STATS: Statistic names, for use with %ETHTOOL_GSTATS
Packit e9ba0d
 * @ETH_SS_PRIV_FLAGS: Driver private flag names, for use with
Packit e9ba0d
 *	%ETHTOOL_GPFLAGS and %ETHTOOL_SPFLAGS
Packit e9ba0d
 * @ETH_SS_NTUPLE_FILTERS: Previously used with %ETHTOOL_GRXNTUPLE;
Packit e9ba0d
 *	now deprecated
Packit e9ba0d
 * @ETH_SS_FEATURES: Device feature names
Packit e9ba0d
 * @ETH_SS_RSS_HASH_FUNCS: RSS hush function names
Packit e9ba0d
 * @ETH_SS_PHY_STATS: Statistic names, for use with %ETHTOOL_GPHYSTATS
Packit e9ba0d
 * @ETH_SS_PHY_TUNABLES: PHY tunable names
Packit e9ba0d
 */
Packit e9ba0d
enum ethtool_stringset {
Packit e9ba0d
	ETH_SS_TEST		= 0,
Packit e9ba0d
	ETH_SS_STATS,
Packit e9ba0d
	ETH_SS_PRIV_FLAGS,
Packit e9ba0d
	ETH_SS_NTUPLE_FILTERS,
Packit e9ba0d
	ETH_SS_FEATURES,
Packit e9ba0d
	ETH_SS_RSS_HASH_FUNCS,
Packit e9ba0d
	ETH_SS_TUNABLES,
Packit e9ba0d
	ETH_SS_PHY_STATS,
Packit e9ba0d
	ETH_SS_PHY_TUNABLES,
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_gstrings - string set for data tagging
Packit e9ba0d
 * @cmd: Command number = %ETHTOOL_GSTRINGS
Packit e9ba0d
 * @string_set: String set ID; one of &enum ethtool_stringset
Packit e9ba0d
 * @len: On return, the number of strings in the string set
Packit e9ba0d
 * @data: Buffer for strings.  Each string is null-padded to a size of
Packit e9ba0d
 *	%ETH_GSTRING_LEN.
Packit e9ba0d
 *
Packit e9ba0d
 * Users must use %ETHTOOL_GSSET_INFO to find the number of strings in
Packit e9ba0d
 * the string set.  They must allocate a buffer of the appropriate
Packit e9ba0d
 * size immediately following this structure.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_gstrings {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	string_set;
Packit e9ba0d
	__u32	len;
Packit e9ba0d
	__u8	data[0];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_sset_info - string set information
Packit e9ba0d
 * @cmd: Command number = %ETHTOOL_GSSET_INFO
Packit e9ba0d
 * @sset_mask: On entry, a bitmask of string sets to query, with bits
Packit e9ba0d
 *	numbered according to &enum ethtool_stringset.  On return, a
Packit e9ba0d
 *	bitmask of those string sets queried that are supported.
Packit e9ba0d
 * @data: Buffer for string set sizes.  On return, this contains the
Packit e9ba0d
 *	size of each string set that was queried and supported, in
Packit e9ba0d
 *	order of ID.
Packit e9ba0d
 *
Packit e9ba0d
 * Example: The user passes in @sset_mask = 0x7 (sets 0, 1, 2) and on
Packit e9ba0d
 * return @sset_mask == 0x6 (sets 1, 2).  Then @data[0] contains the
Packit e9ba0d
 * size of set 1 and @data[1] contains the size of set 2.
Packit e9ba0d
 *
Packit e9ba0d
 * Users must allocate a buffer of the appropriate size (4 * number of
Packit e9ba0d
 * sets queried) immediately following this structure.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_sset_info {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	reserved;
Packit e9ba0d
	__u64	sset_mask;
Packit e9ba0d
	__u32	data[0];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * enum ethtool_test_flags - flags definition of ethtool_test
Packit e9ba0d
 * @ETH_TEST_FL_OFFLINE: if set perform online and offline tests, otherwise
Packit e9ba0d
 *	only online tests.
Packit e9ba0d
 * @ETH_TEST_FL_FAILED: Driver set this flag if test fails.
Packit e9ba0d
 * @ETH_TEST_FL_EXTERNAL_LB: Application request to perform external loopback
Packit e9ba0d
 *	test.
Packit e9ba0d
 * @ETH_TEST_FL_EXTERNAL_LB_DONE: Driver performed the external loopback test
Packit e9ba0d
 */
Packit e9ba0d
Packit e9ba0d
enum ethtool_test_flags {
Packit e9ba0d
	ETH_TEST_FL_OFFLINE	= (1 << 0),
Packit e9ba0d
	ETH_TEST_FL_FAILED	= (1 << 1),
Packit e9ba0d
	ETH_TEST_FL_EXTERNAL_LB	= (1 << 2),
Packit e9ba0d
	ETH_TEST_FL_EXTERNAL_LB_DONE	= (1 << 3),
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_test - device self-test invocation
Packit e9ba0d
 * @cmd: Command number = %ETHTOOL_TEST
Packit e9ba0d
 * @flags: A bitmask of flags from &enum ethtool_test_flags.  Some
Packit e9ba0d
 *	flags may be set by the user on entry; others may be set by
Packit e9ba0d
 *	the driver on return.
Packit e9ba0d
 * @len: On return, the number of test results
Packit e9ba0d
 * @data: Array of test results
Packit e9ba0d
 *
Packit e9ba0d
 * Users must use %ETHTOOL_GSSET_INFO or %ETHTOOL_GDRVINFO to find the
Packit e9ba0d
 * number of test results that will be returned.  They must allocate a
Packit e9ba0d
 * buffer of the appropriate size (8 * number of results) immediately
Packit e9ba0d
 * following this structure.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_test {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	flags;
Packit e9ba0d
	__u32	reserved;
Packit e9ba0d
	__u32	len;
Packit e9ba0d
	__u64	data[0];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_stats - device-specific statistics
Packit e9ba0d
 * @cmd: Command number = %ETHTOOL_GSTATS
Packit e9ba0d
 * @n_stats: On return, the number of statistics
Packit e9ba0d
 * @data: Array of statistics
Packit e9ba0d
 *
Packit e9ba0d
 * Users must use %ETHTOOL_GSSET_INFO or %ETHTOOL_GDRVINFO to find the
Packit e9ba0d
 * number of statistics that will be returned.  They must allocate a
Packit e9ba0d
 * buffer of the appropriate size (8 * number of statistics)
Packit e9ba0d
 * immediately following this structure.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_stats {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	n_stats;
Packit e9ba0d
	__u64	data[0];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_perm_addr - permanent hardware address
Packit e9ba0d
 * @cmd: Command number = %ETHTOOL_GPERMADDR
Packit e9ba0d
 * @size: On entry, the size of the buffer.  On return, the size of the
Packit e9ba0d
 *	address.  The command fails if the buffer is too small.
Packit e9ba0d
 * @data: Buffer for the address
Packit e9ba0d
 *
Packit e9ba0d
 * Users must allocate the buffer immediately following this structure.
Packit e9ba0d
 * A buffer size of %MAX_ADDR_LEN should be sufficient for any address
Packit e9ba0d
 * type.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_perm_addr {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	size;
Packit e9ba0d
	__u8	data[0];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/* boolean flags controlling per-interface behavior characteristics.
Packit e9ba0d
 * When reading, the flag indicates whether or not a certain behavior
Packit e9ba0d
 * is enabled/present.  When writing, the flag indicates whether
Packit e9ba0d
 * or not the driver should turn on (set) or off (clear) a behavior.
Packit e9ba0d
 *
Packit e9ba0d
 * Some behaviors may read-only (unconditionally absent or present).
Packit e9ba0d
 * If such is the case, return EINVAL in the set-flags operation if the
Packit e9ba0d
 * flag differs from the read-only value.
Packit e9ba0d
 */
Packit e9ba0d
enum ethtool_flags {
Packit e9ba0d
	ETH_FLAG_TXVLAN		= (1 << 7),	/* TX VLAN offload enabled */
Packit e9ba0d
	ETH_FLAG_RXVLAN		= (1 << 8),	/* RX VLAN offload enabled */
Packit e9ba0d
	ETH_FLAG_LRO		= (1 << 15),	/* LRO is enabled */
Packit e9ba0d
	ETH_FLAG_NTUPLE		= (1 << 27),	/* N-tuple filters enabled */
Packit e9ba0d
	ETH_FLAG_RXHASH		= (1 << 28),
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/* The following structures are for supporting RX network flow
Packit e9ba0d
 * classification and RX n-tuple configuration. Note, all multibyte
Packit e9ba0d
 * fields, e.g., ip4src, ip4dst, psrc, pdst, spi, etc. are expected to
Packit e9ba0d
 * be in network byte order.
Packit e9ba0d
 */
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_tcpip4_spec - flow specification for TCP/IPv4 etc.
Packit e9ba0d
 * @ip4src: Source host
Packit e9ba0d
 * @ip4dst: Destination host
Packit e9ba0d
 * @psrc: Source port
Packit e9ba0d
 * @pdst: Destination port
Packit e9ba0d
 * @tos: Type-of-service
Packit e9ba0d
 *
Packit e9ba0d
 * This can be used to specify a TCP/IPv4, UDP/IPv4 or SCTP/IPv4 flow.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_tcpip4_spec {
Packit e9ba0d
	__be32	ip4src;
Packit e9ba0d
	__be32	ip4dst;
Packit e9ba0d
	__be16	psrc;
Packit e9ba0d
	__be16	pdst;
Packit e9ba0d
	__u8    tos;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_ah_espip4_spec - flow specification for IPsec/IPv4
Packit e9ba0d
 * @ip4src: Source host
Packit e9ba0d
 * @ip4dst: Destination host
Packit e9ba0d
 * @spi: Security parameters index
Packit e9ba0d
 * @tos: Type-of-service
Packit e9ba0d
 *
Packit e9ba0d
 * This can be used to specify an IPsec transport or tunnel over IPv4.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_ah_espip4_spec {
Packit e9ba0d
	__be32	ip4src;
Packit e9ba0d
	__be32	ip4dst;
Packit e9ba0d
	__be32	spi;
Packit e9ba0d
	__u8    tos;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
#define	ETH_RX_NFC_IP4	1
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_usrip4_spec - general flow specification for IPv4
Packit e9ba0d
 * @ip4src: Source host
Packit e9ba0d
 * @ip4dst: Destination host
Packit e9ba0d
 * @l4_4_bytes: First 4 bytes of transport (layer 4) header
Packit e9ba0d
 * @tos: Type-of-service
Packit e9ba0d
 * @ip_ver: Value must be %ETH_RX_NFC_IP4; mask must be 0
Packit e9ba0d
 * @proto: Transport protocol number; mask must be 0
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_usrip4_spec {
Packit e9ba0d
	__be32	ip4src;
Packit e9ba0d
	__be32	ip4dst;
Packit e9ba0d
	__be32	l4_4_bytes;
Packit e9ba0d
	__u8    tos;
Packit e9ba0d
	__u8    ip_ver;
Packit e9ba0d
	__u8    proto;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_tcpip6_spec - flow specification for TCP/IPv6 etc.
Packit e9ba0d
 * @ip6src: Source host
Packit e9ba0d
 * @ip6dst: Destination host
Packit e9ba0d
 * @psrc: Source port
Packit e9ba0d
 * @pdst: Destination port
Packit e9ba0d
 * @tclass: Traffic Class
Packit e9ba0d
 *
Packit e9ba0d
 * This can be used to specify a TCP/IPv6, UDP/IPv6 or SCTP/IPv6 flow.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_tcpip6_spec {
Packit e9ba0d
	__be32	ip6src[4];
Packit e9ba0d
	__be32	ip6dst[4];
Packit e9ba0d
	__be16	psrc;
Packit e9ba0d
	__be16	pdst;
Packit e9ba0d
	__u8    tclass;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_ah_espip6_spec - flow specification for IPsec/IPv6
Packit e9ba0d
 * @ip6src: Source host
Packit e9ba0d
 * @ip6dst: Destination host
Packit e9ba0d
 * @spi: Security parameters index
Packit e9ba0d
 * @tclass: Traffic Class
Packit e9ba0d
 *
Packit e9ba0d
 * This can be used to specify an IPsec transport or tunnel over IPv6.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_ah_espip6_spec {
Packit e9ba0d
	__be32	ip6src[4];
Packit e9ba0d
	__be32	ip6dst[4];
Packit e9ba0d
	__be32	spi;
Packit e9ba0d
	__u8    tclass;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_usrip6_spec - general flow specification for IPv6
Packit e9ba0d
 * @ip6src: Source host
Packit e9ba0d
 * @ip6dst: Destination host
Packit e9ba0d
 * @l4_4_bytes: First 4 bytes of transport (layer 4) header
Packit e9ba0d
 * @tclass: Traffic Class
Packit e9ba0d
 * @l4_proto: Transport protocol number (nexthdr after any Extension Headers)
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_usrip6_spec {
Packit e9ba0d
	__be32	ip6src[4];
Packit e9ba0d
	__be32	ip6dst[4];
Packit e9ba0d
	__be32	l4_4_bytes;
Packit e9ba0d
	__u8    tclass;
Packit e9ba0d
	__u8    l4_proto;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
union ethtool_flow_union {
Packit e9ba0d
	struct ethtool_tcpip4_spec		tcp_ip4_spec;
Packit e9ba0d
	struct ethtool_tcpip4_spec		udp_ip4_spec;
Packit e9ba0d
	struct ethtool_tcpip4_spec		sctp_ip4_spec;
Packit e9ba0d
	struct ethtool_ah_espip4_spec		ah_ip4_spec;
Packit e9ba0d
	struct ethtool_ah_espip4_spec		esp_ip4_spec;
Packit e9ba0d
	struct ethtool_usrip4_spec		usr_ip4_spec;
Packit e9ba0d
	struct ethtool_tcpip6_spec		tcp_ip6_spec;
Packit e9ba0d
	struct ethtool_tcpip6_spec		udp_ip6_spec;
Packit e9ba0d
	struct ethtool_tcpip6_spec		sctp_ip6_spec;
Packit e9ba0d
	struct ethtool_ah_espip6_spec		ah_ip6_spec;
Packit e9ba0d
	struct ethtool_ah_espip6_spec		esp_ip6_spec;
Packit e9ba0d
	struct ethtool_usrip6_spec		usr_ip6_spec;
Packit e9ba0d
	struct ethhdr				ether_spec;
Packit e9ba0d
	__u8					hdata[52];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_flow_ext - additional RX flow fields
Packit e9ba0d
 * @h_dest: destination MAC address
Packit e9ba0d
 * @vlan_etype: VLAN EtherType
Packit e9ba0d
 * @vlan_tci: VLAN tag control information
Packit e9ba0d
 * @data: user defined data
Packit e9ba0d
 *
Packit e9ba0d
 * Note, @vlan_etype, @vlan_tci, and @data are only valid if %FLOW_EXT
Packit e9ba0d
 * is set in &struct ethtool_rx_flow_spec @flow_type.
Packit e9ba0d
 * @h_dest is valid if %FLOW_MAC_EXT is set.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_flow_ext {
Packit e9ba0d
	__u8		padding[2];
Packit e9ba0d
	unsigned char	h_dest[ETH_ALEN];
Packit e9ba0d
	__be16		vlan_etype;
Packit e9ba0d
	__be16		vlan_tci;
Packit e9ba0d
	__be32		data[2];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_rx_flow_spec - classification rule for RX flows
Packit e9ba0d
 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
Packit e9ba0d
 * @h_u: Flow fields to match (dependent on @flow_type)
Packit e9ba0d
 * @h_ext: Additional fields to match
Packit e9ba0d
 * @m_u: Masks for flow field bits to be matched
Packit e9ba0d
 * @m_ext: Masks for additional field bits to be matched
Packit e9ba0d
 *	Note, all additional fields must be ignored unless @flow_type
Packit e9ba0d
 *	includes the %FLOW_EXT or %FLOW_MAC_EXT flag
Packit e9ba0d
 *	(see &struct ethtool_flow_ext description).
Packit e9ba0d
 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
Packit e9ba0d
 *	if packets should be discarded
Packit e9ba0d
 * @location: Location of rule in the table.  Locations must be
Packit e9ba0d
 *	numbered such that a flow matching multiple rules will be
Packit e9ba0d
 *	classified according to the first (lowest numbered) rule.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_rx_flow_spec {
Packit e9ba0d
	__u32		flow_type;
Packit e9ba0d
	union ethtool_flow_union h_u;
Packit e9ba0d
	struct ethtool_flow_ext h_ext;
Packit e9ba0d
	union ethtool_flow_union m_u;
Packit e9ba0d
	struct ethtool_flow_ext m_ext;
Packit e9ba0d
	__u64		ring_cookie;
Packit e9ba0d
	__u32		location;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/* How rings are layed out when accessing virtual functions or
Packit e9ba0d
 * offloaded queues is device specific. To allow users to do flow
Packit e9ba0d
 * steering and specify these queues the ring cookie is partitioned
Packit e9ba0d
 * into a 32bit queue index with an 8 bit virtual function id.
Packit e9ba0d
 * This also leaves the 3bytes for further specifiers. It is possible
Packit e9ba0d
 * future devices may support more than 256 virtual functions if
Packit e9ba0d
 * devices start supporting PCIe w/ARI. However at the moment I
Packit e9ba0d
 * do not know of any devices that support this so I do not reserve
Packit e9ba0d
 * space for this at this time. If a future patch consumes the next
Packit e9ba0d
 * byte it should be aware of this possiblity.
Packit e9ba0d
 */
Packit e9ba0d
#define ETHTOOL_RX_FLOW_SPEC_RING	0x00000000FFFFFFFFLL
Packit e9ba0d
#define ETHTOOL_RX_FLOW_SPEC_RING_VF	0x000000FF00000000LL
Packit e9ba0d
#define ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF 32
Packit e9ba0d
static inline __u64 ethtool_get_flow_spec_ring(__u64 ring_cookie)
Packit e9ba0d
{
Packit e9ba0d
	return ETHTOOL_RX_FLOW_SPEC_RING & ring_cookie;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
static inline __u64 ethtool_get_flow_spec_ring_vf(__u64 ring_cookie)
Packit e9ba0d
{
Packit e9ba0d
	return (ETHTOOL_RX_FLOW_SPEC_RING_VF & ring_cookie) >>
Packit e9ba0d
				ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_rxnfc - command to get or set RX flow classification rules
Packit e9ba0d
 * @cmd: Specific command number - %ETHTOOL_GRXFH, %ETHTOOL_SRXFH,
Packit e9ba0d
 *	%ETHTOOL_GRXRINGS, %ETHTOOL_GRXCLSRLCNT, %ETHTOOL_GRXCLSRULE,
Packit e9ba0d
 *	%ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS
Packit e9ba0d
 * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
Packit e9ba0d
 * @data: Command-dependent value
Packit e9ba0d
 * @fs: Flow classification rule
Packit e9ba0d
 * @rule_cnt: Number of rules to be affected
Packit e9ba0d
 * @rule_locs: Array of used rule locations
Packit e9ba0d
 *
Packit e9ba0d
 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
Packit e9ba0d
 * the fields included in the flow hash, e.g. %RXH_IP_SRC.  The following
Packit e9ba0d
 * structure fields must not be used.
Packit e9ba0d
 *
Packit e9ba0d
 * For %ETHTOOL_GRXRINGS, @data is set to the number of RX rings/queues
Packit e9ba0d
 * on return.
Packit e9ba0d
 *
Packit e9ba0d
 * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined
Packit e9ba0d
 * rules on return.  If @data is non-zero on return then it is the
Packit e9ba0d
 * size of the rule table, plus the flag %RX_CLS_LOC_SPECIAL if the
Packit e9ba0d
 * driver supports any special location values.  If that flag is not
Packit e9ba0d
 * set in @data then special location values should not be used.
Packit e9ba0d
 *
Packit e9ba0d
 * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the location of an
Packit e9ba0d
 * existing rule on entry and @fs contains the rule on return.
Packit e9ba0d
 *
Packit e9ba0d
 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
Packit e9ba0d
 * user buffer for @rule_locs on entry.  On return, @data is the size
Packit e9ba0d
 * of the rule table, @rule_cnt is the number of defined rules, and
Packit e9ba0d
 * @rule_locs contains the locations of the defined rules.  Drivers
Packit e9ba0d
 * must use the second parameter to get_rxnfc() instead of @rule_locs.
Packit e9ba0d
 *
Packit e9ba0d
 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
Packit e9ba0d
 * @fs.@location either specifies the location to use or is a special
Packit e9ba0d
 * location value with %RX_CLS_LOC_SPECIAL flag set.  On return,
Packit e9ba0d
 * @fs.@location is the actual rule location.
Packit e9ba0d
 *
Packit e9ba0d
 * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the location of an
Packit e9ba0d
 * existing rule on entry.
Packit e9ba0d
 *
Packit e9ba0d
 * A driver supporting the special location values for
Packit e9ba0d
 * %ETHTOOL_SRXCLSRLINS may add the rule at any suitable unused
Packit e9ba0d
 * location, and may remove a rule at a later location (lower
Packit e9ba0d
 * priority) that matches exactly the same set of flows.  The special
Packit e9ba0d
 * values are %RX_CLS_LOC_ANY, selecting any location;
Packit e9ba0d
 * %RX_CLS_LOC_FIRST, selecting the first suitable location (maximum
Packit e9ba0d
 * priority); and %RX_CLS_LOC_LAST, selecting the last suitable
Packit e9ba0d
 * location (minimum priority).  Additional special values may be
Packit e9ba0d
 * defined in future and drivers must return -%EINVAL for any
Packit e9ba0d
 * unrecognised value.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_rxnfc {
Packit e9ba0d
	__u32				cmd;
Packit e9ba0d
	__u32				flow_type;
Packit e9ba0d
	__u64				data;
Packit e9ba0d
	struct ethtool_rx_flow_spec	fs;
Packit e9ba0d
	__u32				rule_cnt;
Packit e9ba0d
	__u32				rule_locs[0];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
Packit e9ba0d
 * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
Packit e9ba0d
 * @size: On entry, the array size of the user buffer, which may be zero.
Packit e9ba0d
 *	On return from %ETHTOOL_GRXFHINDIR, the array size of the hardware
Packit e9ba0d
 *	indirection table.
Packit e9ba0d
 * @ring_index: RX ring/queue index for each hash value
Packit e9ba0d
 *
Packit e9ba0d
 * For %ETHTOOL_GRXFHINDIR, a @size of zero means that only the size
Packit e9ba0d
 * should be returned.  For %ETHTOOL_SRXFHINDIR, a @size of zero means
Packit e9ba0d
 * the table should be reset to default values.  This last feature
Packit e9ba0d
 * is not supported by the original implementations.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_rxfh_indir {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	size;
Packit e9ba0d
	__u32	ring_index[0];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_rxfh - command to get/set RX flow hash indir or/and hash key.
Packit e9ba0d
 * @cmd: Specific command number - %ETHTOOL_GRSSH or %ETHTOOL_SRSSH
Packit e9ba0d
 * @rss_context: RSS context identifier.
Packit e9ba0d
 * @indir_size: On entry, the array size of the user buffer for the
Packit e9ba0d
 *	indirection table, which may be zero, or (for %ETHTOOL_SRSSH),
Packit e9ba0d
 *	%ETH_RXFH_INDIR_NO_CHANGE.  On return from %ETHTOOL_GRSSH,
Packit e9ba0d
 *	the array size of the hardware indirection table.
Packit e9ba0d
 * @key_size: On entry, the array size of the user buffer for the hash key,
Packit e9ba0d
 *	which may be zero.  On return from %ETHTOOL_GRSSH, the size of the
Packit e9ba0d
 *	hardware hash key.
Packit e9ba0d
 * @hfunc: Defines the current RSS hash function used by HW (or to be set to).
Packit e9ba0d
 *	Valid values are one of the %ETH_RSS_HASH_*.
Packit e9ba0d
 * @rsvd:	Reserved for future extensions.
Packit e9ba0d
 * @rss_config: RX ring/queue index for each hash value i.e., indirection table
Packit e9ba0d
 *	of @indir_size __u32 elements, followed by hash key of @key_size
Packit e9ba0d
 *	bytes.
Packit e9ba0d
 *
Packit e9ba0d
 * For %ETHTOOL_GRSSH, a @indir_size and key_size of zero means that only the
Packit e9ba0d
 * size should be returned.  For %ETHTOOL_SRSSH, an @indir_size of
Packit e9ba0d
 * %ETH_RXFH_INDIR_NO_CHANGE means that indir table setting is not requested
Packit e9ba0d
 * and a @indir_size of zero means the indir table should be reset to default
Packit e9ba0d
 * values. An hfunc of zero means that hash function setting is not requested.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_rxfh {
Packit e9ba0d
	__u32   cmd;
Packit e9ba0d
	__u32	rss_context;
Packit e9ba0d
	__u32   indir_size;
Packit e9ba0d
	__u32   key_size;
Packit e9ba0d
	__u8	hfunc;
Packit e9ba0d
	__u8	rsvd8[3];
Packit e9ba0d
	__u32	rsvd32;
Packit e9ba0d
	__u32   rss_config[0];
Packit e9ba0d
};
Packit e9ba0d
#define ETH_RXFH_INDIR_NO_CHANGE	0xffffffff
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
Packit e9ba0d
 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
Packit e9ba0d
 * @h_u: Flow field values to match (dependent on @flow_type)
Packit e9ba0d
 * @m_u: Masks for flow field value bits to be ignored
Packit e9ba0d
 * @vlan_tag: VLAN tag to match
Packit e9ba0d
 * @vlan_tag_mask: Mask for VLAN tag bits to be ignored
Packit e9ba0d
 * @data: Driver-dependent data to match
Packit e9ba0d
 * @data_mask: Mask for driver-dependent data bits to be ignored
Packit e9ba0d
 * @action: RX ring/queue index to deliver to (non-negative) or other action
Packit e9ba0d
 *	(negative, e.g. %ETHTOOL_RXNTUPLE_ACTION_DROP)
Packit e9ba0d
 *
Packit e9ba0d
 * For flow types %TCP_V4_FLOW, %UDP_V4_FLOW and %SCTP_V4_FLOW, where
Packit e9ba0d
 * a field value and mask are both zero this is treated as if all mask
Packit e9ba0d
 * bits are set i.e. the field is ignored.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_rx_ntuple_flow_spec {
Packit e9ba0d
	__u32		 flow_type;
Packit e9ba0d
	union {
Packit e9ba0d
		struct ethtool_tcpip4_spec		tcp_ip4_spec;
Packit e9ba0d
		struct ethtool_tcpip4_spec		udp_ip4_spec;
Packit e9ba0d
		struct ethtool_tcpip4_spec		sctp_ip4_spec;
Packit e9ba0d
		struct ethtool_ah_espip4_spec		ah_ip4_spec;
Packit e9ba0d
		struct ethtool_ah_espip4_spec		esp_ip4_spec;
Packit e9ba0d
		struct ethtool_usrip4_spec		usr_ip4_spec;
Packit e9ba0d
		struct ethhdr				ether_spec;
Packit e9ba0d
		__u8					hdata[72];
Packit e9ba0d
	} h_u, m_u;
Packit e9ba0d
Packit e9ba0d
	__u16	        vlan_tag;
Packit e9ba0d
	__u16	        vlan_tag_mask;
Packit e9ba0d
	__u64		data;
Packit e9ba0d
	__u64		data_mask;
Packit e9ba0d
Packit e9ba0d
	__s32		action;
Packit e9ba0d
#define ETHTOOL_RXNTUPLE_ACTION_DROP	(-1)	/* drop packet */
Packit e9ba0d
#define ETHTOOL_RXNTUPLE_ACTION_CLEAR	(-2)	/* clear filter */
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_rx_ntuple - command to set or clear RX flow filter
Packit e9ba0d
 * @cmd: Command number - %ETHTOOL_SRXNTUPLE
Packit e9ba0d
 * @fs: Flow filter specification
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_rx_ntuple {
Packit e9ba0d
	__u32					cmd;
Packit e9ba0d
	struct ethtool_rx_ntuple_flow_spec	fs;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
#define ETHTOOL_FLASH_MAX_FILENAME	128
Packit e9ba0d
enum ethtool_flash_op_type {
Packit e9ba0d
	ETHTOOL_FLASH_ALL_REGIONS	= 0,
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/* for passing firmware flashing related parameters */
Packit e9ba0d
struct ethtool_flash {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	region;
Packit e9ba0d
	char	data[ETHTOOL_FLASH_MAX_FILENAME];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_dump - used for retrieving, setting device dump
Packit e9ba0d
 * @cmd: Command number - %ETHTOOL_GET_DUMP_FLAG, %ETHTOOL_GET_DUMP_DATA, or
Packit e9ba0d
 * 	%ETHTOOL_SET_DUMP
Packit e9ba0d
 * @version: FW version of the dump, filled in by driver
Packit e9ba0d
 * @flag: driver dependent flag for dump setting, filled in by driver during
Packit e9ba0d
 *        get and filled in by ethtool for set operation.
Packit e9ba0d
 *        flag must be initialized by macro ETH_FW_DUMP_DISABLE value when
Packit e9ba0d
 *        firmware dump is disabled.
Packit e9ba0d
 * @len: length of dump data, used as the length of the user buffer on entry to
Packit e9ba0d
 * 	 %ETHTOOL_GET_DUMP_DATA and this is returned as dump length by driver
Packit e9ba0d
 * 	 for %ETHTOOL_GET_DUMP_FLAG command
Packit e9ba0d
 * @data: data collected for get dump data operation
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_dump {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	version;
Packit e9ba0d
	__u32	flag;
Packit e9ba0d
	__u32	len;
Packit e9ba0d
	__u8	data[0];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
#define ETH_FW_DUMP_DISABLE 0
Packit e9ba0d
Packit e9ba0d
/* for returning and changing feature sets */
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_get_features_block - block with state of 32 features
Packit e9ba0d
 * @available: mask of changeable features
Packit e9ba0d
 * @requested: mask of features requested to be enabled if possible
Packit e9ba0d
 * @active: mask of currently enabled features
Packit e9ba0d
 * @never_changed: mask of features not changeable for any device
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_get_features_block {
Packit e9ba0d
	__u32	available;
Packit e9ba0d
	__u32	requested;
Packit e9ba0d
	__u32	active;
Packit e9ba0d
	__u32	never_changed;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_gfeatures - command to get state of device's features
Packit e9ba0d
 * @cmd: command number = %ETHTOOL_GFEATURES
Packit e9ba0d
 * @size: On entry, the number of elements in the features[] array;
Packit e9ba0d
 *	on return, the number of elements in features[] needed to hold
Packit e9ba0d
 *	all features
Packit e9ba0d
 * @features: state of features
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_gfeatures {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	size;
Packit e9ba0d
	struct ethtool_get_features_block features[0];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_set_features_block - block with request for 32 features
Packit e9ba0d
 * @valid: mask of features to be changed
Packit e9ba0d
 * @requested: values of features to be changed
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_set_features_block {
Packit e9ba0d
	__u32	valid;
Packit e9ba0d
	__u32	requested;
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_sfeatures - command to request change in device's features
Packit e9ba0d
 * @cmd: command number = %ETHTOOL_SFEATURES
Packit e9ba0d
 * @size: array size of the features[] array
Packit e9ba0d
 * @features: feature change masks
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_sfeatures {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	size;
Packit e9ba0d
	struct ethtool_set_features_block features[0];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_ts_info - holds a device's timestamping and PHC association
Packit e9ba0d
 * @cmd: command number = %ETHTOOL_GET_TS_INFO
Packit e9ba0d
 * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags
Packit e9ba0d
 * @phc_index: device index of the associated PHC, or -1 if there is none
Packit e9ba0d
 * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values
Packit e9ba0d
 * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values
Packit e9ba0d
 *
Packit e9ba0d
 * The bits in the 'tx_types' and 'rx_filters' fields correspond to
Packit e9ba0d
 * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,
Packit e9ba0d
 * respectively.  For example, if the device supports HWTSTAMP_TX_ON,
Packit e9ba0d
 * then (1 << HWTSTAMP_TX_ON) in 'tx_types' will be set.
Packit e9ba0d
 *
Packit e9ba0d
 * Drivers should only report the filters they actually support without
Packit e9ba0d
 * upscaling in the SIOCSHWTSTAMP ioctl. If the SIOCSHWSTAMP request for
Packit e9ba0d
 * HWTSTAMP_FILTER_V1_SYNC is supported by HWTSTAMP_FILTER_V1_EVENT, then the
Packit e9ba0d
 * driver should only report HWTSTAMP_FILTER_V1_EVENT in this op.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_ts_info {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	so_timestamping;
Packit e9ba0d
	__s32	phc_index;
Packit e9ba0d
	__u32	tx_types;
Packit e9ba0d
	__u32	tx_reserved[3];
Packit e9ba0d
	__u32	rx_filters;
Packit e9ba0d
	__u32	rx_reserved[3];
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
/*
Packit e9ba0d
 * %ETHTOOL_SFEATURES changes features present in features[].valid to the
Packit e9ba0d
 * values of corresponding bits in features[].requested. Bits in .requested
Packit e9ba0d
 * not set in .valid or not changeable are ignored.
Packit e9ba0d
 *
Packit e9ba0d
 * Returns %EINVAL when .valid contains undefined or never-changeable bits
Packit e9ba0d
 * or size is not equal to required number of features words (32-bit blocks).
Packit e9ba0d
 * Returns >= 0 if request was completed; bits set in the value mean:
Packit e9ba0d
 *   %ETHTOOL_F_UNSUPPORTED - there were bits set in .valid that are not
Packit e9ba0d
 *	changeable (not present in %ETHTOOL_GFEATURES' features[].available)
Packit e9ba0d
 *	those bits were ignored.
Packit e9ba0d
 *   %ETHTOOL_F_WISH - some or all changes requested were recorded but the
Packit e9ba0d
 *      resulting state of bits masked by .valid is not equal to .requested.
Packit e9ba0d
 *      Probably there are other device-specific constraints on some features
Packit e9ba0d
 *      in the set. When %ETHTOOL_F_UNSUPPORTED is set, .valid is considered
Packit e9ba0d
 *      here as though ignored bits were cleared.
Packit e9ba0d
 *   %ETHTOOL_F_COMPAT - some or all changes requested were made by calling
Packit e9ba0d
 *      compatibility functions. Requested offload state cannot be properly
Packit e9ba0d
 *      managed by kernel.
Packit e9ba0d
 *
Packit e9ba0d
 * Meaning of bits in the masks are obtained by %ETHTOOL_GSSET_INFO (number of
Packit e9ba0d
 * bits in the arrays - always multiple of 32) and %ETHTOOL_GSTRINGS commands
Packit e9ba0d
 * for ETH_SS_FEATURES string set. First entry in the table corresponds to least
Packit e9ba0d
 * significant bit in features[0] fields. Empty strings mark undefined features.
Packit e9ba0d
 */
Packit e9ba0d
enum ethtool_sfeatures_retval_bits {
Packit e9ba0d
	ETHTOOL_F_UNSUPPORTED__BIT,
Packit e9ba0d
	ETHTOOL_F_WISH__BIT,
Packit e9ba0d
	ETHTOOL_F_COMPAT__BIT,
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
#define ETHTOOL_F_UNSUPPORTED   (1 << ETHTOOL_F_UNSUPPORTED__BIT)
Packit e9ba0d
#define ETHTOOL_F_WISH          (1 << ETHTOOL_F_WISH__BIT)
Packit e9ba0d
#define ETHTOOL_F_COMPAT        (1 << ETHTOOL_F_COMPAT__BIT)
Packit e9ba0d
Packit e9ba0d
#define MAX_NUM_QUEUE		4096
Packit e9ba0d
Packit e9ba0d
#if 0
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_per_queue_op - apply sub command to the queues in mask.
Packit e9ba0d
 * @cmd: ETHTOOL_PERQUEUE
Packit e9ba0d
 * @sub_command: the sub command which apply to each queues
Packit e9ba0d
 * @queue_mask: Bitmap of the queues which sub command apply to
Packit e9ba0d
 * @data: A complete command structure following for each of the queues addressed
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_per_queue_op {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	sub_command;
Packit e9ba0d
	__u32	queue_mask[__KERNEL_DIV_ROUND_UP(MAX_NUM_QUEUE, 32)];
Packit e9ba0d
	char	data[];
Packit e9ba0d
};
Packit e9ba0d
#endif
Packit e9ba0d
Packit e9ba0d
/* CMDs currently supported */
Packit e9ba0d
#define ETHTOOL_GSET		0x00000001 /* DEPRECATED, Get settings.
Packit e9ba0d
					    * Please use ETHTOOL_GLINKSETTINGS
Packit e9ba0d
					    */
Packit e9ba0d
#define ETHTOOL_SSET		0x00000002 /* DEPRECATED, Set settings.
Packit e9ba0d
					    * Please use ETHTOOL_SLINKSETTINGS
Packit e9ba0d
					    */
Packit e9ba0d
#define ETHTOOL_GDRVINFO	0x00000003 /* Get driver info. */
Packit e9ba0d
#define ETHTOOL_GREGS		0x00000004 /* Get NIC registers. */
Packit e9ba0d
#define ETHTOOL_GWOL		0x00000005 /* Get wake-on-lan options. */
Packit e9ba0d
#define ETHTOOL_SWOL		0x00000006 /* Set wake-on-lan options. */
Packit e9ba0d
#define ETHTOOL_GMSGLVL		0x00000007 /* Get driver message level */
Packit e9ba0d
#define ETHTOOL_SMSGLVL		0x00000008 /* Set driver msg level. */
Packit e9ba0d
#define ETHTOOL_NWAY_RST	0x00000009 /* Restart autonegotiation. */
Packit e9ba0d
/* Get link status for host, i.e. whether the interface *and* the
Packit e9ba0d
 * physical port (if there is one) are up (ethtool_value). */
Packit e9ba0d
#define ETHTOOL_GLINK		0x0000000a
Packit e9ba0d
#define ETHTOOL_GEEPROM		0x0000000b /* Get EEPROM data */
Packit e9ba0d
#define ETHTOOL_SEEPROM		0x0000000c /* Set EEPROM data. */
Packit e9ba0d
#define ETHTOOL_GCOALESCE	0x0000000e /* Get coalesce config */
Packit e9ba0d
#define ETHTOOL_SCOALESCE	0x0000000f /* Set coalesce config. */
Packit e9ba0d
#define ETHTOOL_GRINGPARAM	0x00000010 /* Get ring parameters */
Packit e9ba0d
#define ETHTOOL_SRINGPARAM	0x00000011 /* Set ring parameters. */
Packit e9ba0d
#define ETHTOOL_GPAUSEPARAM	0x00000012 /* Get pause parameters */
Packit e9ba0d
#define ETHTOOL_SPAUSEPARAM	0x00000013 /* Set pause parameters. */
Packit e9ba0d
#define ETHTOOL_GRXCSUM		0x00000014 /* Get RX hw csum enable (ethtool_value) */
Packit e9ba0d
#define ETHTOOL_SRXCSUM		0x00000015 /* Set RX hw csum enable (ethtool_value) */
Packit e9ba0d
#define ETHTOOL_GTXCSUM		0x00000016 /* Get TX hw csum enable (ethtool_value) */
Packit e9ba0d
#define ETHTOOL_STXCSUM		0x00000017 /* Set TX hw csum enable (ethtool_value) */
Packit e9ba0d
#define ETHTOOL_GSG		0x00000018 /* Get scatter-gather enable
Packit e9ba0d
					    * (ethtool_value) */
Packit e9ba0d
#define ETHTOOL_SSG		0x00000019 /* Set scatter-gather enable
Packit e9ba0d
					    * (ethtool_value). */
Packit e9ba0d
#define ETHTOOL_TEST		0x0000001a /* execute NIC self-test. */
Packit e9ba0d
#define ETHTOOL_GSTRINGS	0x0000001b /* get specified string set */
Packit e9ba0d
#define ETHTOOL_PHYS_ID		0x0000001c /* identify the NIC */
Packit e9ba0d
#define ETHTOOL_GSTATS		0x0000001d /* get NIC-specific statistics */
Packit e9ba0d
#define ETHTOOL_GTSO		0x0000001e /* Get TSO enable (ethtool_value) */
Packit e9ba0d
#define ETHTOOL_STSO		0x0000001f /* Set TSO enable (ethtool_value) */
Packit e9ba0d
#define ETHTOOL_GPERMADDR	0x00000020 /* Get permanent hardware address */
Packit e9ba0d
#define ETHTOOL_GUFO		0x00000021 /* Get UFO enable (ethtool_value) */
Packit e9ba0d
#define ETHTOOL_SUFO		0x00000022 /* Set UFO enable (ethtool_value) */
Packit e9ba0d
#define ETHTOOL_GGSO		0x00000023 /* Get GSO enable (ethtool_value) */
Packit e9ba0d
#define ETHTOOL_SGSO		0x00000024 /* Set GSO enable (ethtool_value) */
Packit e9ba0d
#define ETHTOOL_GFLAGS		0x00000025 /* Get flags bitmap(ethtool_value) */
Packit e9ba0d
#define ETHTOOL_SFLAGS		0x00000026 /* Set flags bitmap(ethtool_value) */
Packit e9ba0d
#define ETHTOOL_GPFLAGS		0x00000027 /* Get driver-private flags bitmap */
Packit e9ba0d
#define ETHTOOL_SPFLAGS		0x00000028 /* Set driver-private flags bitmap */
Packit e9ba0d
Packit e9ba0d
#define ETHTOOL_GRXFH		0x00000029 /* Get RX flow hash configuration */
Packit e9ba0d
#define ETHTOOL_SRXFH		0x0000002a /* Set RX flow hash configuration */
Packit e9ba0d
#define ETHTOOL_GGRO		0x0000002b /* Get GRO enable (ethtool_value) */
Packit e9ba0d
#define ETHTOOL_SGRO		0x0000002c /* Set GRO enable (ethtool_value) */
Packit e9ba0d
#define ETHTOOL_GRXRINGS	0x0000002d /* Get RX rings available for LB */
Packit e9ba0d
#define ETHTOOL_GRXCLSRLCNT	0x0000002e /* Get RX class rule count */
Packit e9ba0d
#define ETHTOOL_GRXCLSRULE	0x0000002f /* Get RX classification rule */
Packit e9ba0d
#define ETHTOOL_GRXCLSRLALL	0x00000030 /* Get all RX classification rule */
Packit e9ba0d
#define ETHTOOL_SRXCLSRLDEL	0x00000031 /* Delete RX classification rule */
Packit e9ba0d
#define ETHTOOL_SRXCLSRLINS	0x00000032 /* Insert RX classification rule */
Packit e9ba0d
#define ETHTOOL_FLASHDEV	0x00000033 /* Flash firmware to device */
Packit e9ba0d
#define ETHTOOL_RESET		0x00000034 /* Reset hardware */
Packit e9ba0d
#define ETHTOOL_SRXNTUPLE	0x00000035 /* Add an n-tuple filter to device */
Packit e9ba0d
#define ETHTOOL_GRXNTUPLE	0x00000036 /* deprecated */
Packit e9ba0d
#define ETHTOOL_GSSET_INFO	0x00000037 /* Get string set info */
Packit e9ba0d
#define ETHTOOL_GRXFHINDIR	0x00000038 /* Get RX flow hash indir'n table */
Packit e9ba0d
#define ETHTOOL_SRXFHINDIR	0x00000039 /* Set RX flow hash indir'n table */
Packit e9ba0d
Packit e9ba0d
#define ETHTOOL_GFEATURES	0x0000003a /* Get device offload settings */
Packit e9ba0d
#define ETHTOOL_SFEATURES	0x0000003b /* Change device offload settings */
Packit e9ba0d
#define ETHTOOL_GCHANNELS	0x0000003c /* Get no of channels */
Packit e9ba0d
#define ETHTOOL_SCHANNELS	0x0000003d /* Set no of channels */
Packit e9ba0d
#define ETHTOOL_SET_DUMP	0x0000003e /* Set dump settings */
Packit e9ba0d
#define ETHTOOL_GET_DUMP_FLAG	0x0000003f /* Get dump settings */
Packit e9ba0d
#define ETHTOOL_GET_DUMP_DATA	0x00000040 /* Get dump data */
Packit e9ba0d
#define ETHTOOL_GET_TS_INFO	0x00000041 /* Get time stamping and PHC info */
Packit e9ba0d
#define ETHTOOL_GMODULEINFO	0x00000042 /* Get plug-in module information */
Packit e9ba0d
#define ETHTOOL_GMODULEEEPROM	0x00000043 /* Get plug-in module eeprom */
Packit e9ba0d
#define ETHTOOL_GEEE		0x00000044 /* Get EEE settings */
Packit e9ba0d
#define ETHTOOL_SEEE		0x00000045 /* Set EEE settings */
Packit e9ba0d
Packit e9ba0d
#define ETHTOOL_GRSSH		0x00000046 /* Get RX flow hash configuration */
Packit e9ba0d
#define ETHTOOL_SRSSH		0x00000047 /* Set RX flow hash configuration */
Packit e9ba0d
#define ETHTOOL_GTUNABLE	0x00000048 /* Get tunable configuration */
Packit e9ba0d
#define ETHTOOL_STUNABLE	0x00000049 /* Set tunable configuration */
Packit e9ba0d
#define ETHTOOL_GPHYSTATS	0x0000004a /* get PHY-specific statistics */
Packit e9ba0d
Packit e9ba0d
#define ETHTOOL_PERQUEUE	0x0000004b /* Set per queue options */
Packit e9ba0d
Packit e9ba0d
#define ETHTOOL_GLINKSETTINGS	0x0000004c /* Get ethtool_link_settings */
Packit e9ba0d
#define ETHTOOL_SLINKSETTINGS	0x0000004d /* Set ethtool_link_settings */
Packit e9ba0d
#define ETHTOOL_PHY_GTUNABLE	0x0000004e /* Get PHY tunable configuration */
Packit e9ba0d
#define ETHTOOL_PHY_STUNABLE	0x0000004f /* Set PHY tunable configuration */
Packit e9ba0d
Packit e9ba0d
/* compatibility with older code */
Packit e9ba0d
#define SPARC_ETH_GSET		ETHTOOL_GSET
Packit e9ba0d
#define SPARC_ETH_SSET		ETHTOOL_SSET
Packit e9ba0d
Packit e9ba0d
/* Link mode bit indices */
Packit e9ba0d
enum ethtool_link_mode_bit_indices {
Packit e9ba0d
	ETHTOOL_LINK_MODE_10baseT_Half_BIT	= 0,
Packit e9ba0d
	ETHTOOL_LINK_MODE_10baseT_Full_BIT	= 1,
Packit e9ba0d
	ETHTOOL_LINK_MODE_100baseT_Half_BIT	= 2,
Packit e9ba0d
	ETHTOOL_LINK_MODE_100baseT_Full_BIT	= 3,
Packit e9ba0d
	ETHTOOL_LINK_MODE_1000baseT_Half_BIT	= 4,
Packit e9ba0d
	ETHTOOL_LINK_MODE_1000baseT_Full_BIT	= 5,
Packit e9ba0d
	ETHTOOL_LINK_MODE_Autoneg_BIT		= 6,
Packit e9ba0d
	ETHTOOL_LINK_MODE_TP_BIT		= 7,
Packit e9ba0d
	ETHTOOL_LINK_MODE_AUI_BIT		= 8,
Packit e9ba0d
	ETHTOOL_LINK_MODE_MII_BIT		= 9,
Packit e9ba0d
	ETHTOOL_LINK_MODE_FIBRE_BIT		= 10,
Packit e9ba0d
	ETHTOOL_LINK_MODE_BNC_BIT		= 11,
Packit e9ba0d
	ETHTOOL_LINK_MODE_10000baseT_Full_BIT	= 12,
Packit e9ba0d
	ETHTOOL_LINK_MODE_Pause_BIT		= 13,
Packit e9ba0d
	ETHTOOL_LINK_MODE_Asym_Pause_BIT	= 14,
Packit e9ba0d
	ETHTOOL_LINK_MODE_2500baseX_Full_BIT	= 15,
Packit e9ba0d
	ETHTOOL_LINK_MODE_Backplane_BIT		= 16,
Packit e9ba0d
	ETHTOOL_LINK_MODE_1000baseKX_Full_BIT	= 17,
Packit e9ba0d
	ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT	= 18,
Packit e9ba0d
	ETHTOOL_LINK_MODE_10000baseKR_Full_BIT	= 19,
Packit e9ba0d
	ETHTOOL_LINK_MODE_10000baseR_FEC_BIT	= 20,
Packit e9ba0d
	ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 21,
Packit e9ba0d
	ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT	= 22,
Packit e9ba0d
	ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT	= 23,
Packit e9ba0d
	ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT	= 24,
Packit e9ba0d
	ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT	= 25,
Packit e9ba0d
	ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT	= 26,
Packit e9ba0d
	ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT	= 27,
Packit e9ba0d
	ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT	= 28,
Packit e9ba0d
	ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT	= 29,
Packit e9ba0d
	ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT	= 30,
Packit e9ba0d
	ETHTOOL_LINK_MODE_25000baseCR_Full_BIT	= 31,
Packit e9ba0d
	ETHTOOL_LINK_MODE_25000baseKR_Full_BIT	= 32,
Packit e9ba0d
	ETHTOOL_LINK_MODE_25000baseSR_Full_BIT	= 33,
Packit e9ba0d
	ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT	= 34,
Packit e9ba0d
	ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT	= 35,
Packit e9ba0d
	ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT	= 36,
Packit e9ba0d
	ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT	= 37,
Packit e9ba0d
	ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT	= 38,
Packit e9ba0d
	ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT	= 39,
Packit e9ba0d
	ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT		= 40,
Packit e9ba0d
	ETHTOOL_LINK_MODE_1000baseX_Full_BIT	= 41,
Packit e9ba0d
	ETHTOOL_LINK_MODE_10000baseCR_Full_BIT	= 42,
Packit e9ba0d
	ETHTOOL_LINK_MODE_10000baseSR_Full_BIT	= 43,
Packit e9ba0d
	ETHTOOL_LINK_MODE_10000baseLR_Full_BIT	= 44,
Packit e9ba0d
	ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT	= 45,
Packit e9ba0d
	ETHTOOL_LINK_MODE_10000baseER_Full_BIT	= 46,
Packit e9ba0d
Packit e9ba0d
Packit e9ba0d
	/* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit
Packit e9ba0d
	 * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_*
Packit e9ba0d
	 * macro for bits > 31. The only way to use indices > 31 is to
Packit e9ba0d
	 * use the new ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API.
Packit e9ba0d
	 */
Packit e9ba0d
Packit e9ba0d
	__ETHTOOL_LINK_MODE_LAST
Packit e9ba0d
	  = ETHTOOL_LINK_MODE_10000baseER_Full_BIT,
Packit e9ba0d
};
Packit e9ba0d
Packit e9ba0d
#define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name)	\
Packit e9ba0d
	(1UL << (ETHTOOL_LINK_MODE_ ## base_name ## _BIT))
Packit e9ba0d
Packit e9ba0d
/* DEPRECATED macros. Please migrate to
Packit e9ba0d
 * ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API. Please do NOT
Packit e9ba0d
 * define any new SUPPORTED_* macro for bits > 31.
Packit e9ba0d
 */
Packit e9ba0d
#define SUPPORTED_10baseT_Half		__ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half)
Packit e9ba0d
#define SUPPORTED_10baseT_Full		__ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full)
Packit e9ba0d
#define SUPPORTED_100baseT_Half		__ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half)
Packit e9ba0d
#define SUPPORTED_100baseT_Full		__ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full)
Packit e9ba0d
#define SUPPORTED_1000baseT_Half	__ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half)
Packit e9ba0d
#define SUPPORTED_1000baseT_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full)
Packit e9ba0d
#define SUPPORTED_Autoneg		__ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg)
Packit e9ba0d
#define SUPPORTED_TP			__ETHTOOL_LINK_MODE_LEGACY_MASK(TP)
Packit e9ba0d
#define SUPPORTED_AUI			__ETHTOOL_LINK_MODE_LEGACY_MASK(AUI)
Packit e9ba0d
#define SUPPORTED_MII			__ETHTOOL_LINK_MODE_LEGACY_MASK(MII)
Packit e9ba0d
#define SUPPORTED_FIBRE			__ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE)
Packit e9ba0d
#define SUPPORTED_BNC			__ETHTOOL_LINK_MODE_LEGACY_MASK(BNC)
Packit e9ba0d
#define SUPPORTED_10000baseT_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full)
Packit e9ba0d
#define SUPPORTED_Pause			__ETHTOOL_LINK_MODE_LEGACY_MASK(Pause)
Packit e9ba0d
#define SUPPORTED_Asym_Pause		__ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause)
Packit e9ba0d
#define SUPPORTED_2500baseX_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full)
Packit e9ba0d
#define SUPPORTED_Backplane		__ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane)
Packit e9ba0d
#define SUPPORTED_1000baseKX_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full)
Packit e9ba0d
#define SUPPORTED_10000baseKX4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full)
Packit e9ba0d
#define SUPPORTED_10000baseKR_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full)
Packit e9ba0d
#define SUPPORTED_10000baseR_FEC	__ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC)
Packit e9ba0d
#define SUPPORTED_20000baseMLD2_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full)
Packit e9ba0d
#define SUPPORTED_20000baseKR2_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full)
Packit e9ba0d
#define SUPPORTED_40000baseKR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full)
Packit e9ba0d
#define SUPPORTED_40000baseCR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full)
Packit e9ba0d
#define SUPPORTED_40000baseSR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full)
Packit e9ba0d
#define SUPPORTED_40000baseLR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full)
Packit e9ba0d
#define SUPPORTED_56000baseKR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full)
Packit e9ba0d
#define SUPPORTED_56000baseCR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full)
Packit e9ba0d
#define SUPPORTED_56000baseSR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full)
Packit e9ba0d
#define SUPPORTED_56000baseLR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full)
Packit e9ba0d
/* Please do not define any new SUPPORTED_* macro for bits > 31, see
Packit e9ba0d
 * notice above.
Packit e9ba0d
 */
Packit e9ba0d
Packit e9ba0d
/*
Packit e9ba0d
 * DEPRECATED macros. Please migrate to
Packit e9ba0d
 * ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API. Please do NOT
Packit e9ba0d
 * define any new ADERTISE_* macro for bits > 31.
Packit e9ba0d
 */
Packit e9ba0d
#define ADVERTISED_10baseT_Half		__ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half)
Packit e9ba0d
#define ADVERTISED_10baseT_Full		__ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full)
Packit e9ba0d
#define ADVERTISED_100baseT_Half	__ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half)
Packit e9ba0d
#define ADVERTISED_100baseT_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full)
Packit e9ba0d
#define ADVERTISED_1000baseT_Half	__ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half)
Packit e9ba0d
#define ADVERTISED_1000baseT_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full)
Packit e9ba0d
#define ADVERTISED_Autoneg		__ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg)
Packit e9ba0d
#define ADVERTISED_TP			__ETHTOOL_LINK_MODE_LEGACY_MASK(TP)
Packit e9ba0d
#define ADVERTISED_AUI			__ETHTOOL_LINK_MODE_LEGACY_MASK(AUI)
Packit e9ba0d
#define ADVERTISED_MII			__ETHTOOL_LINK_MODE_LEGACY_MASK(MII)
Packit e9ba0d
#define ADVERTISED_FIBRE		__ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE)
Packit e9ba0d
#define ADVERTISED_BNC			__ETHTOOL_LINK_MODE_LEGACY_MASK(BNC)
Packit e9ba0d
#define ADVERTISED_10000baseT_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full)
Packit e9ba0d
#define ADVERTISED_Pause		__ETHTOOL_LINK_MODE_LEGACY_MASK(Pause)
Packit e9ba0d
#define ADVERTISED_Asym_Pause		__ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause)
Packit e9ba0d
#define ADVERTISED_2500baseX_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full)
Packit e9ba0d
#define ADVERTISED_Backplane		__ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane)
Packit e9ba0d
#define ADVERTISED_1000baseKX_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full)
Packit e9ba0d
#define ADVERTISED_10000baseKX4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full)
Packit e9ba0d
#define ADVERTISED_10000baseKR_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full)
Packit e9ba0d
#define ADVERTISED_10000baseR_FEC	__ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC)
Packit e9ba0d
#define ADVERTISED_20000baseMLD2_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full)
Packit e9ba0d
#define ADVERTISED_20000baseKR2_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full)
Packit e9ba0d
#define ADVERTISED_40000baseKR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full)
Packit e9ba0d
#define ADVERTISED_40000baseCR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full)
Packit e9ba0d
#define ADVERTISED_40000baseSR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full)
Packit e9ba0d
#define ADVERTISED_40000baseLR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full)
Packit e9ba0d
#define ADVERTISED_56000baseKR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full)
Packit e9ba0d
#define ADVERTISED_56000baseCR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full)
Packit e9ba0d
#define ADVERTISED_56000baseSR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full)
Packit e9ba0d
#define ADVERTISED_56000baseLR4_Full	__ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full)
Packit e9ba0d
/* Please do not define any new ADVERTISED_* macro for bits > 31, see
Packit e9ba0d
 * notice above.
Packit e9ba0d
 */
Packit e9ba0d
Packit e9ba0d
/* The following are all involved in forcing a particular link
Packit e9ba0d
 * mode for the device for setting things.  When getting the
Packit e9ba0d
 * devices settings, these indicate the current mode and whether
Packit e9ba0d
 * it was forced up into this mode or autonegotiated.
Packit e9ba0d
 */
Packit e9ba0d
Packit e9ba0d
/* The forced speed, in units of 1Mb. All values 0 to INT_MAX are legal. */
Packit e9ba0d
#define SPEED_10		10
Packit e9ba0d
#define SPEED_100		100
Packit e9ba0d
#define SPEED_1000		1000
Packit e9ba0d
#define SPEED_2500		2500
Packit e9ba0d
#define SPEED_5000		5000
Packit e9ba0d
#define SPEED_10000		10000
Packit e9ba0d
#define SPEED_20000		20000
Packit e9ba0d
#define SPEED_25000		25000
Packit e9ba0d
#define SPEED_40000		40000
Packit e9ba0d
#define SPEED_50000		50000
Packit e9ba0d
#define SPEED_56000		56000
Packit e9ba0d
#define SPEED_100000		100000
Packit e9ba0d
Packit e9ba0d
#define SPEED_UNKNOWN		-1
Packit e9ba0d
Packit e9ba0d
static inline int ethtool_validate_speed(__u32 speed)
Packit e9ba0d
{
Packit e9ba0d
	return speed <= INT_MAX || speed == SPEED_UNKNOWN;
Packit e9ba0d
}
Packit e9ba0d
Packit e9ba0d
/* Duplex, half or full. */
Packit e9ba0d
#define DUPLEX_HALF		0x00
Packit e9ba0d
#define DUPLEX_FULL		0x01
Packit e9ba0d
#define DUPLEX_UNKNOWN		0xff
Packit e9ba0d
Packit e9ba0d
static inline int ethtool_validate_duplex(__u8 duplex)
Packit e9ba0d
{
Packit e9ba0d
	switch (duplex) {
Packit e9ba0d
	case DUPLEX_HALF:
Packit e9ba0d
	case DUPLEX_FULL:
Packit e9ba0d
	case DUPLEX_UNKNOWN:
Packit e9ba0d
		return 1;
Packit e9ba0d
	}
Packit e9ba0d
Packit e9ba0d
	return 0;
Packit e9ba0d
}
Packit e9ba0d
Packit e9ba0d
/* Which connector port. */
Packit e9ba0d
#define PORT_TP			0x00
Packit e9ba0d
#define PORT_AUI		0x01
Packit e9ba0d
#define PORT_MII		0x02
Packit e9ba0d
#define PORT_FIBRE		0x03
Packit e9ba0d
#define PORT_BNC		0x04
Packit e9ba0d
#define PORT_DA			0x05
Packit e9ba0d
#define PORT_NONE		0xef
Packit e9ba0d
#define PORT_OTHER		0xff
Packit e9ba0d
Packit e9ba0d
/* Which transceiver to use. */
Packit e9ba0d
#define XCVR_INTERNAL		0x00 /* PHY and MAC are in the same package */
Packit e9ba0d
#define XCVR_EXTERNAL		0x01 /* PHY and MAC are in different packages */
Packit e9ba0d
#define XCVR_DUMMY1		0x02
Packit e9ba0d
#define XCVR_DUMMY2		0x03
Packit e9ba0d
#define XCVR_DUMMY3		0x04
Packit e9ba0d
Packit e9ba0d
/* Enable or disable autonegotiation. */
Packit e9ba0d
#define AUTONEG_DISABLE		0x00
Packit e9ba0d
#define AUTONEG_ENABLE		0x01
Packit e9ba0d
Packit e9ba0d
/* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
Packit e9ba0d
 * the driver is required to renegotiate link
Packit e9ba0d
 */
Packit e9ba0d
#define ETH_TP_MDI_INVALID	0x00 /* status: unknown; control: unsupported */
Packit e9ba0d
#define ETH_TP_MDI		0x01 /* status: MDI;     control: force MDI */
Packit e9ba0d
#define ETH_TP_MDI_X		0x02 /* status: MDI-X;   control: force MDI-X */
Packit e9ba0d
#define ETH_TP_MDI_AUTO		0x03 /*                  control: auto-select */
Packit e9ba0d
Packit e9ba0d
/* Wake-On-Lan options. */
Packit e9ba0d
#define WAKE_PHY		(1 << 0)
Packit e9ba0d
#define WAKE_UCAST		(1 << 1)
Packit e9ba0d
#define WAKE_MCAST		(1 << 2)
Packit e9ba0d
#define WAKE_BCAST		(1 << 3)
Packit e9ba0d
#define WAKE_ARP		(1 << 4)
Packit e9ba0d
#define WAKE_MAGIC		(1 << 5)
Packit e9ba0d
#define WAKE_MAGICSECURE	(1 << 6) /* only meaningful if WAKE_MAGIC */
Packit e9ba0d
Packit e9ba0d
/* L2-L4 network traffic flow types */
Packit e9ba0d
#define	TCP_V4_FLOW	0x01	/* hash or spec (tcp_ip4_spec) */
Packit e9ba0d
#define	UDP_V4_FLOW	0x02	/* hash or spec (udp_ip4_spec) */
Packit e9ba0d
#define	SCTP_V4_FLOW	0x03	/* hash or spec (sctp_ip4_spec) */
Packit e9ba0d
#define	AH_ESP_V4_FLOW	0x04	/* hash only */
Packit e9ba0d
#define	TCP_V6_FLOW	0x05	/* hash or spec (tcp_ip6_spec; nfc only) */
Packit e9ba0d
#define	UDP_V6_FLOW	0x06	/* hash or spec (udp_ip6_spec; nfc only) */
Packit e9ba0d
#define	SCTP_V6_FLOW	0x07	/* hash or spec (sctp_ip6_spec; nfc only) */
Packit e9ba0d
#define	AH_ESP_V6_FLOW	0x08	/* hash only */
Packit e9ba0d
#define	AH_V4_FLOW	0x09	/* hash or spec (ah_ip4_spec) */
Packit e9ba0d
#define	ESP_V4_FLOW	0x0a	/* hash or spec (esp_ip4_spec) */
Packit e9ba0d
#define	AH_V6_FLOW	0x0b	/* hash or spec (ah_ip6_spec; nfc only) */
Packit e9ba0d
#define	ESP_V6_FLOW	0x0c	/* hash or spec (esp_ip6_spec; nfc only) */
Packit e9ba0d
#define	IPV4_USER_FLOW	0x0d	/* spec only (usr_ip4_spec) */
Packit e9ba0d
#define	IP_USER_FLOW	IPV4_USER_FLOW
Packit e9ba0d
#define	IPV6_USER_FLOW	0x0e	/* spec only (usr_ip6_spec; nfc only) */
Packit e9ba0d
#define	IPV4_FLOW	0x10	/* hash only */
Packit e9ba0d
#define	IPV6_FLOW	0x11	/* hash only */
Packit e9ba0d
#define	ETHER_FLOW	0x12	/* spec only (ether_spec) */
Packit e9ba0d
/* Flag to enable additional fields in struct ethtool_rx_flow_spec */
Packit e9ba0d
#define	FLOW_EXT	0x80000000
Packit e9ba0d
#define	FLOW_MAC_EXT	0x40000000
Packit e9ba0d
Packit e9ba0d
/* L3-L4 network traffic flow hash options */
Packit e9ba0d
#define	RXH_L2DA	(1 << 1)
Packit e9ba0d
#define	RXH_VLAN	(1 << 2)
Packit e9ba0d
#define	RXH_L3_PROTO	(1 << 3)
Packit e9ba0d
#define	RXH_IP_SRC	(1 << 4)
Packit e9ba0d
#define	RXH_IP_DST	(1 << 5)
Packit e9ba0d
#define	RXH_L4_B_0_1	(1 << 6) /* src port in case of TCP/UDP/SCTP */
Packit e9ba0d
#define	RXH_L4_B_2_3	(1 << 7) /* dst port in case of TCP/UDP/SCTP */
Packit e9ba0d
#define	RXH_DISCARD	(1 << 31)
Packit e9ba0d
Packit e9ba0d
#define	RX_CLS_FLOW_DISC	0xffffffffffffffffULL
Packit e9ba0d
Packit e9ba0d
/* Special RX classification rule insert location values */
Packit e9ba0d
#define RX_CLS_LOC_SPECIAL	0x80000000	/* flag */
Packit e9ba0d
#define RX_CLS_LOC_ANY		0xffffffff
Packit e9ba0d
#define RX_CLS_LOC_FIRST	0xfffffffe
Packit e9ba0d
#define RX_CLS_LOC_LAST		0xfffffffd
Packit e9ba0d
Packit e9ba0d
/* EEPROM Standards for plug in modules */
Packit e9ba0d
#define ETH_MODULE_SFF_8079		0x1
Packit e9ba0d
#define ETH_MODULE_SFF_8079_LEN		256
Packit e9ba0d
#define ETH_MODULE_SFF_8472		0x2
Packit e9ba0d
#define ETH_MODULE_SFF_8472_LEN		512
Packit e9ba0d
#define ETH_MODULE_SFF_8636		0x3
Packit e9ba0d
#define ETH_MODULE_SFF_8636_LEN		256
Packit e9ba0d
#define ETH_MODULE_SFF_8436		0x4
Packit e9ba0d
#define ETH_MODULE_SFF_8436_LEN		256
Packit e9ba0d
Packit e9ba0d
/* Reset flags */
Packit e9ba0d
/* The reset() operation must clear the flags for the components which
Packit e9ba0d
 * were actually reset.  On successful return, the flags indicate the
Packit e9ba0d
 * components which were not reset, either because they do not exist
Packit e9ba0d
 * in the hardware or because they cannot be reset independently.  The
Packit e9ba0d
 * driver must never reset any components that were not requested.
Packit e9ba0d
 */
Packit e9ba0d
enum ethtool_reset_flags {
Packit e9ba0d
	/* These flags represent components dedicated to the interface
Packit e9ba0d
	 * the command is addressed to.  Shift any flag left by
Packit e9ba0d
	 * ETH_RESET_SHARED_SHIFT to reset a shared component of the
Packit e9ba0d
	 * same type.
Packit e9ba0d
	 */
Packit e9ba0d
	ETH_RESET_MGMT		= 1 << 0,	/* Management processor */
Packit e9ba0d
	ETH_RESET_IRQ		= 1 << 1,	/* Interrupt requester */
Packit e9ba0d
	ETH_RESET_DMA		= 1 << 2,	/* DMA engine */
Packit e9ba0d
	ETH_RESET_FILTER	= 1 << 3,	/* Filtering/flow direction */
Packit e9ba0d
	ETH_RESET_OFFLOAD	= 1 << 4,	/* Protocol offload */
Packit e9ba0d
	ETH_RESET_MAC		= 1 << 5,	/* Media access controller */
Packit e9ba0d
	ETH_RESET_PHY		= 1 << 6,	/* Transceiver/PHY */
Packit e9ba0d
	ETH_RESET_RAM		= 1 << 7,	/* RAM shared between
Packit e9ba0d
						 * multiple components */
Packit e9ba0d
Packit e9ba0d
	ETH_RESET_DEDICATED	= 0x0000ffff,	/* All components dedicated to
Packit e9ba0d
						 * this interface */
Packit e9ba0d
	ETH_RESET_ALL		= 0xffffffff,	/* All components used by this
Packit e9ba0d
						 * interface, even if shared */
Packit e9ba0d
};
Packit e9ba0d
#define ETH_RESET_SHARED_SHIFT	16
Packit e9ba0d
Packit e9ba0d
Packit e9ba0d
/**
Packit e9ba0d
 * struct ethtool_link_settings - link control and status
Packit e9ba0d
 *
Packit e9ba0d
 * IMPORTANT, Backward compatibility notice: When implementing new
Packit e9ba0d
 *	user-space tools, please first try %ETHTOOL_GLINKSETTINGS, and
Packit e9ba0d
 *	if it succeeds use %ETHTOOL_SLINKSETTINGS to change link
Packit e9ba0d
 *	settings; do not use %ETHTOOL_SSET if %ETHTOOL_GLINKSETTINGS
Packit e9ba0d
 *	succeeded: stick to %ETHTOOL_GLINKSETTINGS/%SLINKSETTINGS in
Packit e9ba0d
 *	that case.  Conversely, if %ETHTOOL_GLINKSETTINGS fails, use
Packit e9ba0d
 *	%ETHTOOL_GSET to query and %ETHTOOL_SSET to change link
Packit e9ba0d
 *	settings; do not use %ETHTOOL_SLINKSETTINGS if
Packit e9ba0d
 *	%ETHTOOL_GLINKSETTINGS failed: stick to
Packit e9ba0d
 *	%ETHTOOL_GSET/%ETHTOOL_SSET in that case.
Packit e9ba0d
 *
Packit e9ba0d
 * @cmd: Command number = %ETHTOOL_GLINKSETTINGS or %ETHTOOL_SLINKSETTINGS
Packit e9ba0d
 * @speed: Link speed (Mbps)
Packit e9ba0d
 * @duplex: Duplex mode; one of %DUPLEX_*
Packit e9ba0d
 * @port: Physical connector type; one of %PORT_*
Packit e9ba0d
 * @phy_address: MDIO address of PHY (transceiver); 0 or 255 if not
Packit e9ba0d
 *	applicable.  For clause 45 PHYs this is the PRTAD.
Packit e9ba0d
 * @autoneg: Enable/disable autonegotiation and auto-detection;
Packit e9ba0d
 *	either %AUTONEG_DISABLE or %AUTONEG_ENABLE
Packit e9ba0d
 * @mdio_support: Bitmask of %ETH_MDIO_SUPPORTS_* flags for the MDIO
Packit e9ba0d
 *	protocols supported by the interface; 0 if unknown.
Packit e9ba0d
 *	Read-only.
Packit e9ba0d
 * @eth_tp_mdix: Ethernet twisted-pair MDI(-X) status; one of
Packit e9ba0d
 *	%ETH_TP_MDI_*.  If the status is unknown or not applicable, the
Packit e9ba0d
 *	value will be %ETH_TP_MDI_INVALID.  Read-only.
Packit e9ba0d
 * @eth_tp_mdix_ctrl: Ethernet twisted pair MDI(-X) control; one of
Packit e9ba0d
 *	%ETH_TP_MDI_*.  If MDI(-X) control is not implemented, reads
Packit e9ba0d
 *	yield %ETH_TP_MDI_INVALID and writes may be ignored or rejected.
Packit e9ba0d
 *	When written successfully, the link should be renegotiated if
Packit e9ba0d
 *	necessary.
Packit e9ba0d
 * @link_mode_masks_nwords: Number of 32-bit words for each of the
Packit e9ba0d
 *	supported, advertising, lp_advertising link mode bitmaps. For
Packit e9ba0d
 *	%ETHTOOL_GLINKSETTINGS: on entry, number of words passed by user
Packit e9ba0d
 *	(>= 0); on return, if handshake in progress, negative if
Packit e9ba0d
 *	request size unsupported by kernel: absolute value indicates
Packit e9ba0d
 *	kernel expected size and all the other fields but cmd
Packit e9ba0d
 *	are 0; otherwise (handshake completed), strictly positive
Packit e9ba0d
 *	to indicate size used by kernel and cmd field stays
Packit e9ba0d
 *	%ETHTOOL_GLINKSETTINGS, all other fields populated by driver. For
Packit e9ba0d
 *	%ETHTOOL_SLINKSETTINGS: must be valid on entry, ie. a positive
Packit e9ba0d
 *	value returned previously by %ETHTOOL_GLINKSETTINGS, otherwise
Packit e9ba0d
 *	refused. For drivers: ignore this field (use kernel's
Packit e9ba0d
 *	__ETHTOOL_LINK_MODE_MASK_NBITS instead), any change to it will
Packit e9ba0d
 *	be overwritten by kernel.
Packit e9ba0d
 * @supported: Bitmap with each bit meaning given by
Packit e9ba0d
 *	%ethtool_link_mode_bit_indices for the link modes, physical
Packit e9ba0d
 *	connectors and other link features for which the interface
Packit e9ba0d
 *	supports autonegotiation or auto-detection.  Read-only.
Packit e9ba0d
 * @advertising: Bitmap with each bit meaning given by
Packit e9ba0d
 *	%ethtool_link_mode_bit_indices for the link modes, physical
Packit e9ba0d
 *	connectors and other link features that are advertised through
Packit e9ba0d
 *	autonegotiation or enabled for auto-detection.
Packit e9ba0d
 * @lp_advertising: Bitmap with each bit meaning given by
Packit e9ba0d
 *	%ethtool_link_mode_bit_indices for the link modes, and other
Packit e9ba0d
 *	link features that the link partner advertised through
Packit e9ba0d
 *	autonegotiation; 0 if unknown or not applicable.  Read-only.
Packit e9ba0d
 *
Packit e9ba0d
 * If autonegotiation is disabled, the speed and @duplex represent the
Packit e9ba0d
 * fixed link mode and are writable if the driver supports multiple
Packit e9ba0d
 * link modes.  If it is enabled then they are read-only; if the link
Packit e9ba0d
 * is up they represent the negotiated link mode; if the link is down,
Packit e9ba0d
 * the speed is 0, %SPEED_UNKNOWN or the highest enabled speed and
Packit e9ba0d
 * @duplex is %DUPLEX_UNKNOWN or the best enabled duplex mode.
Packit e9ba0d
 *
Packit e9ba0d
 * Some hardware interfaces may have multiple PHYs and/or physical
Packit e9ba0d
 * connectors fitted or do not allow the driver to detect which are
Packit e9ba0d
 * fitted.  For these interfaces @port and/or @phy_address may be
Packit e9ba0d
 * writable, possibly dependent on @autoneg being %AUTONEG_DISABLE.
Packit e9ba0d
 * Otherwise, attempts to write different values may be ignored or
Packit e9ba0d
 * rejected.
Packit e9ba0d
 *
Packit e9ba0d
 * Deprecated %ethtool_cmd fields transceiver, maxtxpkt and maxrxpkt
Packit e9ba0d
 * are not available in %ethtool_link_settings. Until all drivers are
Packit e9ba0d
 * converted to ignore them or to the new %ethtool_link_settings API,
Packit e9ba0d
 * for both queries and changes, users should always try
Packit e9ba0d
 * %ETHTOOL_GLINKSETTINGS first, and if it fails with -ENOTSUPP stick
Packit e9ba0d
 * only to %ETHTOOL_GSET and %ETHTOOL_SSET consistently. If it
Packit e9ba0d
 * succeeds, then users should stick to %ETHTOOL_GLINKSETTINGS and
Packit e9ba0d
 * %ETHTOOL_SLINKSETTINGS (which would support drivers implementing
Packit e9ba0d
 * either %ethtool_cmd or %ethtool_link_settings).
Packit e9ba0d
 *
Packit e9ba0d
 * Users should assume that all fields not marked read-only are
Packit e9ba0d
 * writable and subject to validation by the driver.  They should use
Packit e9ba0d
 * %ETHTOOL_GLINKSETTINGS to get the current values before making specific
Packit e9ba0d
 * changes and then applying them with %ETHTOOL_SLINKSETTINGS.
Packit e9ba0d
 *
Packit e9ba0d
 * Drivers that implement %get_link_ksettings and/or
Packit e9ba0d
 * %set_link_ksettings should ignore the @cmd
Packit e9ba0d
 * and @link_mode_masks_nwords fields (any change to them overwritten
Packit e9ba0d
 * by kernel), and rely only on kernel's internal
Packit e9ba0d
 * %__ETHTOOL_LINK_MODE_MASK_NBITS and
Packit e9ba0d
 * %ethtool_link_mode_mask_t. Drivers that implement
Packit e9ba0d
 * %set_link_ksettings() should validate all fields other than @cmd
Packit e9ba0d
 * and @link_mode_masks_nwords that are not described as read-only or
Packit e9ba0d
 * deprecated, and must ignore all fields described as read-only.
Packit e9ba0d
 */
Packit e9ba0d
struct ethtool_link_settings {
Packit e9ba0d
	__u32	cmd;
Packit e9ba0d
	__u32	speed;
Packit e9ba0d
	__u8	duplex;
Packit e9ba0d
	__u8	port;
Packit e9ba0d
	__u8	phy_address;
Packit e9ba0d
	__u8	autoneg;
Packit e9ba0d
	__u8	mdio_support;
Packit e9ba0d
	__u8	eth_tp_mdix;
Packit e9ba0d
	__u8	eth_tp_mdix_ctrl;
Packit e9ba0d
	__s8	link_mode_masks_nwords;
Packit e9ba0d
	__u32	reserved[8];
Packit e9ba0d
	__u32	link_mode_masks[0];
Packit e9ba0d
	/* layout of link_mode_masks fields:
Packit e9ba0d
	 * __u32 map_supported[link_mode_masks_nwords];
Packit e9ba0d
	 * __u32 map_advertising[link_mode_masks_nwords];
Packit e9ba0d
	 * __u32 map_lp_advertising[link_mode_masks_nwords];
Packit e9ba0d
	 */
Packit e9ba0d
};
Packit e9ba0d
#endif /* _UAPI_LINUX_ETHTOOL_H */