drivers/net/ethernet/atheros/alx/alx.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/atheros/alx/alx.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/atheros/alx/alx.h- Extension
.h- Size
- 3420 bytes
- Lines
- 147
- 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/types.hlinux/etherdevice.hlinux/dma-mapping.hlinux/spinlock.hhw.h
Detected Declarations
struct alx_bufferstruct alx_rx_queuestruct alx_tx_queuestruct alx_napistruct alx_privenum alx_device_quirks
Annotated Snippet
struct alx_buffer {
struct sk_buff *skb;
DEFINE_DMA_UNMAP_ADDR(dma);
DEFINE_DMA_UNMAP_LEN(size);
};
struct alx_rx_queue {
struct net_device *netdev;
struct device *dev;
struct alx_napi *np;
struct alx_rrd *rrd;
dma_addr_t rrd_dma;
struct alx_rfd *rfd;
dma_addr_t rfd_dma;
struct alx_buffer *bufs;
u16 count;
u16 write_idx, read_idx;
u16 rrd_read_idx;
u16 queue_idx;
};
#define ALX_RX_ALLOC_THRESH 32
struct alx_tx_queue {
struct net_device *netdev;
struct device *dev;
struct alx_txd *tpd;
dma_addr_t tpd_dma;
struct alx_buffer *bufs;
u16 count;
u16 write_idx, read_idx;
u16 queue_idx;
u16 p_reg, c_reg;
};
#define ALX_DEFAULT_TX_WORK 128
enum alx_device_quirks {
ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG = BIT(0),
};
struct alx_napi {
struct napi_struct napi;
struct alx_priv *alx;
struct alx_rx_queue *rxq;
struct alx_tx_queue *txq;
int vec_idx;
u32 vec_mask;
char irq_lbl[IFNAMSIZ + 8];
};
#define ALX_MAX_NAPIS 8
struct alx_priv {
struct net_device *dev;
struct alx_hw hw;
/* msi-x vectors */
int num_vec;
/* all descriptor memory */
struct {
dma_addr_t dma;
void *virt;
unsigned int size;
} descmem;
struct alx_napi *qnapi[ALX_MAX_NAPIS];
int num_txq;
int num_rxq;
int num_napi;
/* protect int_mask updates */
spinlock_t irq_lock;
u32 int_mask;
unsigned int tx_ringsz;
unsigned int rx_ringsz;
unsigned int rxbuf_size;
struct work_struct link_check_wk;
struct work_struct reset_wk;
Annotation
- Immediate include surface: `linux/types.h`, `linux/etherdevice.h`, `linux/dma-mapping.h`, `linux/spinlock.h`, `hw.h`.
- Detected declarations: `struct alx_buffer`, `struct alx_rx_queue`, `struct alx_tx_queue`, `struct alx_napi`, `struct alx_priv`, `enum alx_device_quirks`.
- 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.