include/uapi/linux/ethtool.h
Source file repositories/reference/linux-study-clean/include/uapi/linux/ethtool.h
File Facts
- System
- Linux kernel
- Corpus path
include/uapi/linux/ethtool.h- Extension
.h- Size
- 104965 bytes
- Lines
- 2613
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/const.hlinux/typelimits.hlinux/types.hlinux/if_ether.h
Detected Declarations
struct ethtool_cmdstruct ethtool_drvinfostruct ethtool_wolinfostruct ethtool_valuestruct ethtool_tunablestruct ethtool_regsstruct ethtool_eepromstruct ethtool_eeestruct ethtool_modinfostruct ethtool_coalescestruct ethtool_ringparamstruct ethtool_channelsstruct ethtool_pauseparamstruct ethtool_gstringsstruct ethtool_sset_infostruct ethtool_teststruct ethtool_statsstruct ethtool_perm_addrstruct ethtool_tcpip4_specstruct ethtool_ah_espip4_specstruct ethtool_usrip4_specstruct ethtool_tcpip6_specstruct ethtool_ah_espip6_specstruct ethtool_usrip6_specstruct ethtool_flow_extstruct ethtool_rx_flow_specstruct ethtool_rxnfcstruct ethtool_rxfh_indirstruct ethtool_rxfhstruct ethtool_rx_ntuple_flow_specstruct ethtool_rx_ntuplestruct ethtool_flashstruct ethtool_dumpstruct ethtool_get_features_blockstruct ethtool_gfeaturesstruct ethtool_set_features_blockstruct ethtool_sfeaturesstruct ethtool_ts_infostruct ethtool_per_queue_opstruct ethtool_fecparamstruct ethtool_link_settingsenum tunable_idenum tunable_type_idenum phy_tunable_idenum ethtool_link_ext_stateenum ethtool_link_ext_substate_autonegenum ethtool_link_ext_substate_link_trainingenum ethtool_link_ext_substate_link_logical_mismatch
Annotated Snippet
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 & 0xFFFF);
ep->speed_hi = (__u16)(speed >> 16);
}
static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
{
return (ep->speed_hi << 16) | ep->speed;
}
/* Device supports clause 22 register access to PHY or peripherals
* using the interface defined in <linux/mii.h>. This should not be
* set if there are known to be no such peripherals present or if
* the driver only emulates clause 22 registers for compatibility.
*/
#define ETH_MDIO_SUPPORTS_C22 1
/* Device supports clause 45 register access to PHY or peripherals
* using the interface defined in <linux/mii.h> and <linux/mdio.h>.
* This should not be set if there are known to be no such peripherals
* present.
*/
#define ETH_MDIO_SUPPORTS_C45 2
#define ETHTOOL_FWVERS_LEN 32
#define ETHTOOL_BUSINFO_LEN 32
#define ETHTOOL_EROMVERS_LEN 32
/**
* struct ethtool_drvinfo - general driver and device information
* @cmd: Command number = %ETHTOOL_GDRVINFO
* @driver: Driver short name. This should normally match the name
* in its bus driver structure (e.g. pci_driver::name). Must
* not be an empty string.
* @version: Driver version string; may be an empty string
* @fw_version: Firmware version string; driver defined; may be an
* empty string
* @erom_version: Expansion ROM version string; driver defined; may be
* an empty string
* @bus_info: Device bus address. This should match the dev_name()
* string for the underlying bus device, if there is one. May be
* an empty string.
* @reserved2: Reserved for future use; see the note on reserved space.
* @n_priv_flags: Number of flags valid for %ETHTOOL_GPFLAGS and
* %ETHTOOL_SPFLAGS commands; also the number of strings in the
* %ETH_SS_PRIV_FLAGS set
* @n_stats: Number of u64 statistics returned by the %ETHTOOL_GSTATS
* command; also the number of strings in the %ETH_SS_STATS set
* @testinfo_len: Number of results returned by the %ETHTOOL_TEST
* command; also the number of strings in the %ETH_SS_TEST set
* @eedump_len: Size of EEPROM accessible through the %ETHTOOL_GEEPROM
* and %ETHTOOL_SEEPROM commands, in bytes
* @regdump_len: Size of register dump returned by the %ETHTOOL_GREGS
* command, in bytes
*
* Users can use the %ETHTOOL_GSSET_INFO command to get the number of
* strings in any string set (from Linux 2.6.34).
*/
struct ethtool_drvinfo {
__u32 cmd;
char driver[32];
char version[32];
char fw_version[ETHTOOL_FWVERS_LEN];
char bus_info[ETHTOOL_BUSINFO_LEN];
char erom_version[ETHTOOL_EROMVERS_LEN];
char reserved2[12];
__u32 n_priv_flags;
__u32 n_stats;
Annotation
- Immediate include surface: `linux/const.h`, `linux/typelimits.h`, `linux/types.h`, `linux/if_ether.h`.
- Detected declarations: `struct ethtool_cmd`, `struct ethtool_drvinfo`, `struct ethtool_wolinfo`, `struct ethtool_value`, `struct ethtool_tunable`, `struct ethtool_regs`, `struct ethtool_eeprom`, `struct ethtool_eee`, `struct ethtool_modinfo`, `struct ethtool_coalesce`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.