drivers/net/ethernet/intel/e1000e/ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/e1000e/ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/e1000e/ethtool.c- Extension
.c- Size
- 65715 bytes
- Lines
- 2400
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/netdevice.hlinux/interrupt.hlinux/ethtool.hlinux/pci.hlinux/slab.hlinux/delay.hlinux/vmalloc.hlinux/pm_runtime.he1000.h
Detected Declarations
struct e1000_statsfunction e1000_get_link_ksettingsfunction e1000_set_spd_dplxfunction e1000_set_link_ksettingsfunction e1000_get_pauseparamfunction e1000_set_pauseparamfunction e1000_get_msglevelfunction e1000_set_msglevelfunction e1000_get_regs_lenfunction e1000_get_regsfunction e1000_get_eeprom_lenfunction e1000_get_eepromfunction e1000_set_eepromfunction e1000_get_drvinfofunction e1000_get_ringparamfunction e1000_set_ringparamfunction reg_pattern_testfunction reg_set_and_checkfunction e1000_reg_testfunction e1000_eeprom_testfunction e1000_test_intrfunction e1000_intr_testfunction e1000_free_desc_ringsfunction e1000_setup_desc_ringsfunction e1000_phy_disable_receiverfunction e1000_integrated_phy_loopbackfunction e1000_set_82571_fiber_loopbackfunction e1000_set_es2lan_mac_loopbackfunction e1000_setup_loopback_testfunction e1000_loopback_cleanupfunction e1000_create_lbtest_framefunction e1000_check_lbtest_framefunction e1000_run_loopback_testfunction e1000_loopback_testfunction e1000_link_testfunction e1000e_get_sset_countfunction e1000_diag_testfunction e1000_get_wolfunction e1000_set_wolfunction e1000_set_phys_idfunction e1000_get_coalescefunction e1000_set_coalescefunction e1000_nway_resetfunction e1000_get_ethtool_statsfunction e1000_get_stringsfunction e1000_get_rxfh_fieldsfunction e1000e_get_eeefunction e1000e_set_eee
Annotated Snippet
struct e1000_stats {
char stat_string[ETH_GSTRING_LEN];
int type;
int sizeof_stat;
int stat_offset;
};
static const char e1000e_priv_flags_strings[][ETH_GSTRING_LEN] = {
#define E1000E_PRIV_FLAGS_S0IX_ENABLED BIT(0)
"s0ix-enabled",
#define E1000E_PRIV_FLAGS_DISABLE_K1 BIT(1)
"disable-k1",
};
#define E1000E_PRIV_FLAGS_STR_LEN ARRAY_SIZE(e1000e_priv_flags_strings)
#define E1000_STAT(str, m) { \
.stat_string = str, \
.type = E1000_STATS, \
.sizeof_stat = sizeof(((struct e1000_adapter *)0)->m), \
.stat_offset = offsetof(struct e1000_adapter, m) }
#define E1000_NETDEV_STAT(str, m) { \
.stat_string = str, \
.type = NETDEV_STATS, \
.sizeof_stat = sizeof(((struct rtnl_link_stats64 *)0)->m), \
.stat_offset = offsetof(struct rtnl_link_stats64, m) }
static const struct e1000_stats e1000_gstrings_stats[] = {
E1000_STAT("rx_packets", stats.gprc),
E1000_STAT("tx_packets", stats.gptc),
E1000_STAT("rx_bytes", stats.gorc),
E1000_STAT("tx_bytes", stats.gotc),
E1000_STAT("rx_broadcast", stats.bprc),
E1000_STAT("tx_broadcast", stats.bptc),
E1000_STAT("rx_multicast", stats.mprc),
E1000_STAT("tx_multicast", stats.mptc),
E1000_NETDEV_STAT("rx_errors", rx_errors),
E1000_NETDEV_STAT("tx_errors", tx_errors),
E1000_NETDEV_STAT("tx_dropped", tx_dropped),
E1000_STAT("multicast", stats.mprc),
E1000_STAT("collisions", stats.colc),
E1000_NETDEV_STAT("rx_length_errors", rx_length_errors),
E1000_NETDEV_STAT("rx_over_errors", rx_over_errors),
E1000_STAT("rx_crc_errors", stats.crcerrs),
E1000_NETDEV_STAT("rx_frame_errors", rx_frame_errors),
E1000_STAT("rx_no_buffer_count", stats.rnbc),
E1000_STAT("rx_missed_errors", stats.mpc),
E1000_STAT("tx_aborted_errors", stats.ecol),
E1000_STAT("tx_carrier_errors", stats.tncrs),
E1000_NETDEV_STAT("tx_fifo_errors", tx_fifo_errors),
E1000_NETDEV_STAT("tx_heartbeat_errors", tx_heartbeat_errors),
E1000_STAT("tx_window_errors", stats.latecol),
E1000_STAT("tx_abort_late_coll", stats.latecol),
E1000_STAT("tx_deferred_ok", stats.dc),
E1000_STAT("tx_single_coll_ok", stats.scc),
E1000_STAT("tx_multi_coll_ok", stats.mcc),
E1000_STAT("tx_timeout_count", tx_timeout_count),
E1000_STAT("tx_restart_queue", restart_queue),
E1000_STAT("rx_long_length_errors", stats.roc),
E1000_STAT("rx_short_length_errors", stats.ruc),
E1000_STAT("rx_align_errors", stats.algnerrc),
E1000_STAT("tx_tcp_seg_good", stats.tsctc),
E1000_STAT("tx_tcp_seg_failed", stats.tsctfc),
E1000_STAT("rx_flow_control_xon", stats.xonrxc),
E1000_STAT("rx_flow_control_xoff", stats.xoffrxc),
E1000_STAT("tx_flow_control_xon", stats.xontxc),
E1000_STAT("tx_flow_control_xoff", stats.xofftxc),
E1000_STAT("rx_csum_offload_good", hw_csum_good),
E1000_STAT("rx_csum_offload_errors", hw_csum_err),
E1000_STAT("rx_header_split", rx_hdr_split),
E1000_STAT("alloc_rx_buff_failed", alloc_rx_buff_failed),
E1000_STAT("tx_smbus", stats.mgptc),
E1000_STAT("rx_smbus", stats.mgprc),
E1000_STAT("dropped_smbus", stats.mgpdc),
E1000_STAT("rx_dma_failed", rx_dma_failed),
E1000_STAT("tx_dma_failed", tx_dma_failed),
E1000_STAT("rx_hwtstamp_cleared", rx_hwtstamp_cleared),
E1000_STAT("uncorr_ecc_errors", uncorr_errors),
E1000_STAT("corr_ecc_errors", corr_errors),
E1000_STAT("tx_hwtstamp_timeouts", tx_hwtstamp_timeouts),
E1000_STAT("tx_hwtstamp_skipped", tx_hwtstamp_skipped),
};
#define E1000_GLOBAL_STATS_LEN ARRAY_SIZE(e1000_gstrings_stats)
#define E1000_STATS_LEN (E1000_GLOBAL_STATS_LEN)
static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
"Register test (offline)", "Eeprom test (offline)",
"Interrupt test (offline)", "Loopback test (offline)",
"Link test (on/offline)"
};
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/interrupt.h`, `linux/ethtool.h`, `linux/pci.h`, `linux/slab.h`, `linux/delay.h`, `linux/vmalloc.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct e1000_stats`, `function e1000_get_link_ksettings`, `function e1000_set_spd_dplx`, `function e1000_set_link_ksettings`, `function e1000_get_pauseparam`, `function e1000_set_pauseparam`, `function e1000_get_msglevel`, `function e1000_set_msglevel`, `function e1000_get_regs_len`, `function e1000_get_regs`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.