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.

Dependency Surface

Detected Declarations

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

Implementation Notes