/* * ethtool.h: Defines for Linux ethtool. * * Copyright (C) 1998 David S. Miller (davem@redhat.com) * Copyright 2001 Jeff Garzik <jgarzik@pobox.com> * Portions Copyright 2001 Sun Microsystems (thockin@sun.com) * Portions Copyright 2002 Intel (eli.kupermann@intel.com, * christopher.leech@intel.com, * scott.feldman@intel.com) * Portions Copyright (C) Sun Microsystems 2008 */ #ifndef _UAPI_LINUX_ETHTOOL_H #define _UAPI_LINUX_ETHTOOL_H #include <linux/kernel.h> #include <linux/types.h> #include <linux/if_ether.h> #ifndef __KERNEL__ #include <limits.h> /* for INT_MAX */ #endif /* All structures exposed to userland should be defined such that they * have the same layout for 32-bit and 64-bit userland. */ /** * struct ethtool_cmd - DEPRECATED, link control and status * This structure is DEPRECATED, please use struct ethtool_link_settings. * @cmd: Command number = %ETHTOOL_GSET or %ETHTOOL_SSET * @supported: Bitmask of %SUPPORTED_* flags for the link modes, * physical connectors and other link features for which the * interface supports autonegotiation or auto-detection. * Read-only. * @advertising: Bitmask of %ADVERTISED_* flags for the link modes, * physical connectors and other link features that are * advertised through autonegotiation or enabled for * auto-detection. * @speed: Low bits of the speed, 1Mb units, 0 to INT_MAX or SPEED_UNKNOWN * @duplex: Duplex mode; one of %DUPLEX_* * @port: Physical connector type; one of %PORT_* * @phy_address: MDIO address of PHY (transceiver); 0 or 255 if not * applicable. For clause 45 PHYs this is the PRTAD. * @transceiver: Historically used to distinguish different possible * PHY types, but not in a consistent way. Deprecated. * @autoneg: Enable/disable autonegotiation and auto-detection; * either %AUTONEG_DISABLE or %AUTONEG_ENABLE * @mdio_support: Bitmask of %ETH_MDIO_SUPPORTS_* flags for the MDIO * protocols supported by the interface; 0 if unknown. * Read-only. * @maxtxpkt: Historically used to report TX IRQ coalescing; now * obsoleted by &struct ethtool_coalesce. Read-only; deprecated. * @maxrxpkt: Historically used to report RX IRQ coalescing; now * obsoleted by &struct ethtool_coalesce. Read-only; deprecated. * @speed_hi: High bits of the speed, 1Mb units, 0 to INT_MAX or SPEED_UNKNOWN * @eth_tp_mdix: Ethernet twisted-pair MDI(-X) status; one of * %ETH_TP_MDI_*. If the status is unknown or not applicable, the * value will be %ETH_TP_MDI_INVALID. Read-only. * @eth_tp_mdix_ctrl: Ethernet twisted pair MDI(-X) control; one of * %ETH_TP_MDI_*. If MDI(-X) control is not implemented, reads * yield %ETH_TP_MDI_INVALID and writes may be ignored or rejected. * When written successfully, the link should be renegotiated if * necessary. * @lp_advertising: Bitmask of %ADVERTISED_* flags for the link modes * and other link features that the link partner advertised * through autonegotiation; 0 if unknown or not applicable. * Read-only. * * The link speed in Mbps is split between @speed and @speed_hi. Use * the ethtool_cmd_speed() and ethtool_cmd_speed_set() functions to * access it. * * If autonegotiation is disabled, the speed and @duplex represent the * fixed link mode and are writable if the driver supports multiple * link modes. If it is enabled then they are read-only; if the link * is up they represent the negotiated link mode; if the link is down, * the speed is 0, %SPEED_UNKNOWN or the highest enabled speed and * @duplex is %DUPLEX_UNKNOWN or the best enabled duplex mode. * * Some hardware interfaces may have multiple PHYs and/or physical * connectors fitted or do not allow the driver to detect which are * fitted. For these interfaces @port and/or @phy_address may be * writable, possibly dependent on @autoneg being %AUTONEG_DISABLE. * Otherwise, attempts to write different values may be ignored or * rejected. * * Users should assume that all fields not marked read-only are * writable and subject to validation by the driver. They should use * %ETHTOOL_GSET to get the current values before making specific * changes and then applying them with %ETHTOOL_SSET. * * Drivers that implement set_settings() should validate all fields * other than @cmd that are not described as read-only or deprecated, * and must ignore all fields described as read-only. * * Deprecated fields should be ignored by both users and drivers. */ struct ethtool_cmd { __u32 cmd; __u32 supported; __u32 advertising; __u16 speed; __u8 duplex; __u8 port; __u8 phy_address; __u8 transceiver; __u8 autoneg; __u8 mdio_support; __u32 maxtxpkt; __u32 maxrxpkt; __u16 speed_hi; __u8 eth_tp_mdix; __u8 eth_tp_mdix_ctrl; __u32 lp_advertising; __u32 reserved[2]; };
static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep, __u32 speed) { ep->speed = (__u16)speed; ep->speed_hi = (__u16)(speed >> 16); }Contributors
Person | Tokens | Prop | Commits | CommitProp | |
david howells | david howells | 37 | 100.00% | 1 | 100.00% |
Total | 37 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
david howells | david howells | 26 | 100.00% | 1 | 100.00% |
Total | 26 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
john fastabend | john fastabend | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
john fastabend | john fastabend | 19 | 100.00% | 1 | 100.00% |
Total | 19 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
nikolay aleksandrov | nikolay aleksandrov | 19 | 100.00% | 2 | 100.00% |
Total | 19 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
nikolay aleksandrov | nikolay aleksandrov | 31 | 100.00% | 1 | 100.00% |
Total | 31 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
david howells | david howells | 2064 | 71.54% | 1 | 2.56% |
david decotigny | david decotigny | 269 | 9.32% | 2 | 5.13% |
edward cree | edward cree | 117 | 4.06% | 1 | 2.56% |
govindarajulu varadarajan | govindarajulu varadarajan | 66 | 2.29% | 1 | 2.56% |
saeed mahameed | saeed mahameed | 52 | 1.80% | 2 | 5.13% |
nikolay aleksandrov | nikolay aleksandrov | 50 | 1.73% | 2 | 5.13% |
john fastabend | john fastabend | 49 | 1.70% | 1 | 2.56% |
vidya sagar ravipati | vidya sagar ravipati | 37 | 1.28% | 1 | 2.56% |
venkat duvvuru | venkat duvvuru | 36 | 1.25% | 1 | 2.56% |
kan liang | kan liang | 35 | 1.21% | 1 | 2.56% |
ben hutchings | ben hutchings | 23 | 0.80% | 13 | 33.33% |
yan burman | yan burman | 20 | 0.69% | 2 | 5.13% |
parav pandit | parav pandit | 16 | 0.55% | 1 | 2.56% |
nicolas dichtel | nicolas dichtel | 13 | 0.45% | 2 | 5.13% |
eyal perry | eyal perry | 12 | 0.42% | 1 | 2.56% |
andrew lunn | andrew lunn | 8 | 0.28% | 1 | 2.56% |
hariprasad shenai | hariprasad shenai | 7 | 0.24% | 1 | 2.56% |
hadar hen zion | hadar hen zion | 5 | 0.17% | 1 | 2.56% |
eric dumazet | eric dumazet | 2 | 0.07% | 1 | 2.56% |
florian fainelli | florian fainelli | 2 | 0.07% | 1 | 2.56% |
jacob e keller | jacob e keller | 1 | 0.03% | 1 | 2.56% |
michael s. tsirkin | michael s. tsirkin | 1 | 0.03% | 1 | 2.56% |
Total | 2885 | 100.00% | 39 | 100.00% |