drivers/net/ethernet/stmicro/stmmac/stmmac.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/stmicro/stmmac/stmmac.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/stmicro/stmmac/stmmac.h
Extension
.h
Size
11186 bytes
Lines
461
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_resources {
	void __iomem *addr;
	u8 mac[ETH_ALEN];
	int wol_irq;
	int irq;
	int sfty_irq;
	int sfty_ce_irq;
	int sfty_ue_irq;
	int rx_irq[MTL_MAX_RX_QUEUES];
	int tx_irq[MTL_MAX_TX_QUEUES];
};

enum stmmac_txbuf_type {
	STMMAC_TXBUF_T_SKB,
	STMMAC_TXBUF_T_XDP_TX,
	STMMAC_TXBUF_T_XDP_NDO,
	STMMAC_TXBUF_T_XSK_TX,
};

struct stmmac_tx_info {
	struct xsk_tx_metadata_compl xsk_meta;
	dma_addr_t buf;
	unsigned len;
	enum stmmac_txbuf_type buf_type;
	bool map_as_page;
	bool last_segment;
	bool is_jumbo;
};

#define STMMAC_TBS_AVAIL	BIT(0)
#define STMMAC_TBS_EN		BIT(1)

/* Frequently used values are kept adjacent for cache effect */
struct stmmac_tx_queue {
	u32 tx_count_frames;
	int tbs;
	struct hrtimer txtimer;
	u32 queue_index;
	struct stmmac_priv *priv_data;
	struct dma_extended_desc *dma_etx ____cacheline_aligned_in_smp;
	struct dma_edesc *dma_entx;
	struct dma_desc *dma_tx;
	union {
		struct sk_buff **tx_skbuff;
		struct xdp_frame **xdpf;
	};
	struct stmmac_tx_info *tx_skbuff_dma;
	struct xsk_buff_pool *xsk_pool;
	u32 xsk_frames_done;
	unsigned int cur_tx;
	unsigned int dirty_tx;
	dma_addr_t dma_tx_phy;
	u32 mss;
};

struct stmmac_rx_buffer {
	union {
		struct {
			struct page *page;
			dma_addr_t addr;
			__u32 page_offset;
		};
		struct xdp_buff *xdp;
	};
	struct page *sec_page;
	dma_addr_t sec_addr;
};

struct stmmac_xdp_buff {
	struct xdp_buff xdp;
	struct stmmac_priv *priv;
	struct dma_desc *desc;
	struct dma_desc *ndesc;
};

struct stmmac_metadata_request {
	struct stmmac_priv *priv;
	struct dma_desc *tx_desc;
	bool *set_ic;
	struct dma_edesc *edesc;
	int tbs;
};

struct stmmac_xsk_tx_complete {
	struct stmmac_priv *priv;
	struct dma_desc *desc;
};

struct stmmac_rx_queue {
	u32 rx_count_frames;

Annotation

Implementation Notes