drivers/net/ethernet/intel/igc/igc_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/igc/igc_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/igc/igc_ethtool.c- Extension
.c- Size
- 63024 bytes
- Lines
- 2202
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/if_vlan.hlinux/pm_runtime.hlinux/mdio.higc.higc_diag.higc_tsn.h
Detected Declarations
struct igc_statsenum igc_diagnostics_resultsfunction igc_ethtool_get_drvinfofunction igc_ethtool_get_regs_lenfunction igc_ethtool_get_regsfunction igc_ethtool_get_wolfunction igc_ethtool_set_wolfunction igc_ethtool_get_msglevelfunction igc_ethtool_set_msglevelfunction igc_ethtool_nway_resetfunction igc_ethtool_get_linkfunction igc_ethtool_get_eeprom_lenfunction igc_ethtool_get_eepromfunction igc_ethtool_set_eepromfunction igc_ethtool_get_ringparamfunction igc_ethtool_set_ringparamfunction igc_ethtool_get_pauseparamfunction igc_ethtool_set_pauseparamfunction igc_ethtool_get_stringsfunction igc_ethtool_get_sset_countfunction igc_ethtool_get_statsfunction igc_ethtool_get_previous_rx_coalescefunction igc_ethtool_get_previous_tx_coalescefunction igc_ethtool_get_coalescefunction igc_ethtool_set_coalescefunction igc_ethtool_get_nfc_rulefunction igc_ethtool_get_nfc_rulesfunction list_for_each_entryfunction igc_ethtool_get_rxfh_fieldsfunction igc_ethtool_get_rx_ring_countfunction igc_ethtool_get_rxnfcfunction igc_ethtool_set_rxfh_fieldsfunction igc_ethtool_init_nfc_rulefunction igc_ethtool_check_nfc_rulefunction list_for_each_entryfunction igc_ethtool_add_nfc_rulefunction igc_ethtool_del_nfc_rulefunction igc_ethtool_set_rxnfcfunction igc_write_rss_indir_tblfunction igc_ethtool_get_rxfh_indir_sizefunction igc_ethtool_get_rxfhfunction igc_ethtool_set_rxfhfunction igc_ethtool_get_channelsfunction igc_ethtool_set_channelsfunction igc_ethtool_get_ts_infofunction igc_ethtool_get_priv_flagsfunction igc_ethtool_set_priv_flagsfunction igc_ethtool_get_eee
Annotated Snippet
struct igc_stats {
char stat_string[ETH_GSTRING_LEN];
int sizeof_stat;
int stat_offset;
};
#define IGC_STAT(_name, _stat) { \
.stat_string = _name, \
.sizeof_stat = sizeof_field(struct igc_adapter, _stat), \
.stat_offset = offsetof(struct igc_adapter, _stat) \
}
static const struct igc_stats igc_gstrings_stats[] = {
IGC_STAT("rx_packets", stats.gprc),
IGC_STAT("tx_packets", stats.gptc),
IGC_STAT("rx_bytes", stats.gorc),
IGC_STAT("tx_bytes", stats.gotc),
IGC_STAT("rx_broadcast", stats.bprc),
IGC_STAT("tx_broadcast", stats.bptc),
IGC_STAT("rx_multicast", stats.mprc),
IGC_STAT("tx_multicast", stats.mptc),
IGC_STAT("multicast", stats.mprc),
IGC_STAT("collisions", stats.colc),
IGC_STAT("rx_crc_errors", stats.crcerrs),
IGC_STAT("rx_no_buffer_count", stats.rnbc),
IGC_STAT("rx_missed_errors", stats.mpc),
IGC_STAT("tx_aborted_errors", stats.ecol),
IGC_STAT("tx_carrier_errors", stats.tncrs),
IGC_STAT("tx_window_errors", stats.latecol),
IGC_STAT("tx_abort_late_coll", stats.latecol),
IGC_STAT("tx_deferred_ok", stats.dc),
IGC_STAT("tx_single_coll_ok", stats.scc),
IGC_STAT("tx_multi_coll_ok", stats.mcc),
IGC_STAT("tx_timeout_count", tx_timeout_count),
IGC_STAT("rx_long_length_errors", stats.roc),
IGC_STAT("rx_short_length_errors", stats.ruc),
IGC_STAT("rx_align_errors", stats.algnerrc),
IGC_STAT("tx_tcp_seg_good", stats.tsctc),
IGC_STAT("tx_tcp_seg_failed", stats.tsctfc),
IGC_STAT("rx_flow_control_xon", stats.xonrxc),
IGC_STAT("rx_flow_control_xoff", stats.xoffrxc),
IGC_STAT("tx_flow_control_xon", stats.xontxc),
IGC_STAT("tx_flow_control_xoff", stats.xofftxc),
IGC_STAT("rx_long_byte_count", stats.gorc),
IGC_STAT("tx_dma_out_of_sync", stats.doosync),
IGC_STAT("tx_smbus", stats.mgptc),
IGC_STAT("rx_smbus", stats.mgprc),
IGC_STAT("dropped_smbus", stats.mgpdc),
IGC_STAT("os2bmc_rx_by_bmc", stats.o2bgptc),
IGC_STAT("os2bmc_tx_by_bmc", stats.b2ospc),
IGC_STAT("os2bmc_tx_by_host", stats.o2bspc),
IGC_STAT("os2bmc_rx_by_host", stats.b2ogprc),
IGC_STAT("tx_hwtstamp_timeouts", tx_hwtstamp_timeouts),
IGC_STAT("tx_hwtstamp_skipped", tx_hwtstamp_skipped),
IGC_STAT("rx_hwtstamp_cleared", rx_hwtstamp_cleared),
IGC_STAT("tx_lpi_counter", stats.tlpic),
IGC_STAT("rx_lpi_counter", stats.rlpic),
IGC_STAT("qbv_config_change_errors", qbv_config_change_errors),
};
#define IGC_NETDEV_STAT(_net_stat) { \
.stat_string = __stringify(_net_stat), \
.sizeof_stat = sizeof_field(struct rtnl_link_stats64, _net_stat), \
.stat_offset = offsetof(struct rtnl_link_stats64, _net_stat) \
}
static const struct igc_stats igc_gstrings_net_stats[] = {
IGC_NETDEV_STAT(rx_errors),
IGC_NETDEV_STAT(tx_errors),
IGC_NETDEV_STAT(tx_dropped),
IGC_NETDEV_STAT(rx_length_errors),
IGC_NETDEV_STAT(rx_over_errors),
IGC_NETDEV_STAT(rx_frame_errors),
IGC_NETDEV_STAT(rx_fifo_errors),
IGC_NETDEV_STAT(tx_fifo_errors),
IGC_NETDEV_STAT(tx_heartbeat_errors)
};
enum igc_diagnostics_results {
TEST_REG = 0,
TEST_EEP,
TEST_IRQ,
TEST_LOOP,
TEST_LINK
};
static const char igc_gstrings_test[][ETH_GSTRING_LEN] = {
[TEST_REG] = "Register test (offline)",
[TEST_EEP] = "Eeprom test (offline)",
[TEST_IRQ] = "Interrupt test (offline)",
Annotation
- Immediate include surface: `linux/if_vlan.h`, `linux/pm_runtime.h`, `linux/mdio.h`, `igc.h`, `igc_diag.h`, `igc_tsn.h`.
- Detected declarations: `struct igc_stats`, `enum igc_diagnostics_results`, `function igc_ethtool_get_drvinfo`, `function igc_ethtool_get_regs_len`, `function igc_ethtool_get_regs`, `function igc_ethtool_get_wol`, `function igc_ethtool_set_wol`, `function igc_ethtool_get_msglevel`, `function igc_ethtool_set_msglevel`, `function igc_ethtool_nway_reset`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.