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.
- 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/clk.hlinux/hrtimer.hlinux/if_vlan.hlinux/stmmac.hlinux/phylink.hlinux/pci.hcommon.hlinux/ptp_clock_kernel.hlinux/net_tstamp.hlinux/reset.hnet/page_pool/types.hnet/xdp.huapi/linux/bpf.h
Detected Declarations
struct stmmac_pcsstruct stmmac_resourcesstruct stmmac_tx_infostruct stmmac_tx_queuestruct stmmac_rx_bufferstruct stmmac_xdp_buffstruct stmmac_metadata_requeststruct stmmac_xsk_tx_completestruct stmmac_rx_queuestruct stmmac_channelstruct stmmac_fpe_cfgstruct stmmac_tc_entrystruct stmmac_pps_cfgstruct stmmac_rssstruct stmmac_flow_entrystruct stmmac_rfs_entrystruct stmmac_dma_confstruct stmmac_eststruct stmmac_msistruct stmmac_privenum stmmac_txbuf_typeenum stmmac_rfs_typeenum stmmac_statefunction stmmac_xdp_is_enabledfunction stmmac_selftest_run
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
- Immediate include surface: `linux/clk.h`, `linux/hrtimer.h`, `linux/if_vlan.h`, `linux/stmmac.h`, `linux/phylink.h`, `linux/pci.h`, `common.h`, `linux/ptp_clock_kernel.h`.
- Detected declarations: `struct stmmac_pcs`, `struct stmmac_resources`, `struct stmmac_tx_info`, `struct stmmac_tx_queue`, `struct stmmac_rx_buffer`, `struct stmmac_xdp_buff`, `struct stmmac_metadata_request`, `struct stmmac_xsk_tx_complete`, `struct stmmac_rx_queue`, `struct stmmac_channel`.
- 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.