drivers/net/ethernet/stmicro/stmmac/common.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/stmicro/stmmac/common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/stmicro/stmmac/common.h- Extension
.h- Size
- 19966 bytes
- Lines
- 671
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/etherdevice.hlinux/netdevice.hlinux/stmmac.hlinux/phy.hlinux/pcs/pcs-xpcs.hlinux/module.hlinux/if_vlan.hdescs.hhwif.hmmc.h
Detected Declarations
struct stmmac_q_tx_statsstruct stmmac_napi_tx_statsstruct stmmac_txq_statsstruct stmmac_napi_rx_statsstruct stmmac_rxq_statsstruct stmmac_pcpu_statsstruct stmmac_extra_statsstruct stmmac_safety_statsstruct dma_featuresstruct mac_device_infostruct mac_linkstruct mii_regsstruct mac_device_infostruct stmmac_rx_routingenum packets_typesenum rx_frame_statusenum tx_frame_statusenum dma_irq_statusenum dma_irq_direnum request_irq_errfunction Copyright
Annotated Snippet
struct stmmac_q_tx_stats {
u64_stats_t tx_bytes;
u64_stats_t tx_set_ic_bit;
u64_stats_t tx_tso_frames;
u64_stats_t tx_tso_nfrags;
};
struct stmmac_napi_tx_stats {
u64_stats_t tx_packets;
u64_stats_t tx_pkt_n;
u64_stats_t poll;
u64_stats_t tx_clean;
u64_stats_t tx_set_ic_bit;
};
struct stmmac_txq_stats {
/* Updates protected by tx queue lock. */
struct u64_stats_sync q_syncp;
struct stmmac_q_tx_stats q;
/* Updates protected by NAPI poll logic. */
struct u64_stats_sync napi_syncp;
struct stmmac_napi_tx_stats napi;
} ____cacheline_aligned_in_smp;
struct stmmac_napi_rx_stats {
u64_stats_t rx_bytes;
u64_stats_t rx_packets;
u64_stats_t rx_pkt_n;
u64_stats_t poll;
};
struct stmmac_rxq_stats {
/* Updates protected by NAPI poll logic. */
struct u64_stats_sync napi_syncp;
struct stmmac_napi_rx_stats napi;
} ____cacheline_aligned_in_smp;
/* Updates on each CPU protected by not allowing nested irqs. */
struct stmmac_pcpu_stats {
struct u64_stats_sync syncp;
u64_stats_t rx_normal_irq_n[MTL_MAX_RX_QUEUES];
u64_stats_t tx_normal_irq_n[MTL_MAX_TX_QUEUES];
};
/* Extra statistic and debug information exposed by ethtool */
struct stmmac_extra_stats {
/* Transmit errors */
unsigned long tx_underflow ____cacheline_aligned;
unsigned long tx_carrier;
unsigned long tx_losscarrier;
unsigned long vlan_tag;
unsigned long tx_deferred;
unsigned long tx_vlan;
unsigned long tx_jabber;
unsigned long tx_frame_flushed;
unsigned long tx_payload_error;
unsigned long tx_ip_header_error;
unsigned long tx_collision;
/* Receive errors */
unsigned long rx_desc;
unsigned long sa_filter_fail;
unsigned long overflow_error;
unsigned long ipc_csum_error;
unsigned long rx_collision;
unsigned long rx_crc_errors;
unsigned long dribbling_bit;
unsigned long rx_length;
unsigned long rx_mii;
unsigned long rx_multicast;
unsigned long rx_gmac_overflow;
unsigned long rx_watchdog;
unsigned long da_rx_filter_fail;
unsigned long sa_rx_filter_fail;
unsigned long rx_missed_cntr;
unsigned long rx_overflow_cntr;
unsigned long rx_vlan;
unsigned long rx_split_hdr_pkt_n;
/* Tx/Rx IRQ error info */
unsigned long tx_undeflow_irq;
unsigned long tx_process_stopped_irq;
unsigned long tx_jabber_irq;
unsigned long rx_overflow_irq;
unsigned long rx_buf_unav_irq;
unsigned long rx_process_stopped_irq;
unsigned long rx_watchdog_irq;
unsigned long tx_early_irq;
unsigned long fatal_bus_error_irq;
/* Tx/Rx IRQ Events */
unsigned long rx_early_irq;
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/netdevice.h`, `linux/stmmac.h`, `linux/phy.h`, `linux/pcs/pcs-xpcs.h`, `linux/module.h`, `linux/if_vlan.h`, `descs.h`.
- Detected declarations: `struct stmmac_q_tx_stats`, `struct stmmac_napi_tx_stats`, `struct stmmac_txq_stats`, `struct stmmac_napi_rx_stats`, `struct stmmac_rxq_stats`, `struct stmmac_pcpu_stats`, `struct stmmac_extra_stats`, `struct stmmac_safety_stats`, `struct dma_features`, `struct mac_device_info`.
- 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.