drivers/net/ethernet/intel/e1000/e1000.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/e1000/e1000.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/e1000/e1000.h- Extension
.h- Size
- 9569 bytes
- Lines
- 352
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/stddef.hlinux/module.hlinux/types.hasm/byteorder.hlinux/mm.hlinux/errno.hlinux/ioport.hlinux/pci.hlinux/kernel.hlinux/netdevice.hlinux/etherdevice.hlinux/skbuff.hlinux/delay.hlinux/timer.hlinux/slab.hlinux/vmalloc.hlinux/interrupt.hlinux/string.hlinux/pagemap.hlinux/dma-mapping.hlinux/bitops.hasm/io.hasm/irq.hlinux/capability.hlinux/in.hlinux/ip.hlinux/ipv6.hlinux/tcp.hlinux/udp.hnet/pkt_sched.hlinux/list.hlinux/reboot.h
Detected Declarations
struct e1000_adapterstruct e1000_tx_bufferstruct e1000_rx_bufferstruct e1000_tx_ringstruct e1000_rx_ringstruct e1000_adapterenum e1000_state_t
Annotated Snippet
struct e1000_tx_buffer {
struct sk_buff *skb;
dma_addr_t dma;
unsigned long time_stamp;
u16 length;
u16 next_to_watch;
bool mapped_as_page;
unsigned short segs;
unsigned int bytecount;
};
struct e1000_rx_buffer {
union {
struct page *page; /* jumbo: alloc_page */
u8 *data; /* else, netdev_alloc_frag */
} rxbuf;
dma_addr_t dma;
};
struct e1000_tx_ring {
/* pointer to the descriptor ring memory */
void *desc;
/* physical address of the descriptor ring */
dma_addr_t dma;
/* length of descriptor ring in bytes */
unsigned int size;
/* number of descriptors in the ring */
unsigned int count;
/* next descriptor to associate a buffer with */
unsigned int next_to_use;
/* next descriptor to check for DD status bit */
unsigned int next_to_clean;
/* array of buffer information structs */
struct e1000_tx_buffer *buffer_info;
u16 tdh;
u16 tdt;
bool last_tx_tso;
};
struct e1000_rx_ring {
/* pointer to the descriptor ring memory */
void *desc;
/* physical address of the descriptor ring */
dma_addr_t dma;
/* length of descriptor ring in bytes */
unsigned int size;
/* number of descriptors in the ring */
unsigned int count;
/* next descriptor to associate a buffer with */
unsigned int next_to_use;
/* next descriptor to check for DD status bit */
unsigned int next_to_clean;
/* array of buffer information structs */
struct e1000_rx_buffer *buffer_info;
struct sk_buff *rx_skb_top;
/* cpu for rx queue */
int cpu;
u16 rdh;
u16 rdt;
};
#define E1000_DESC_UNUSED(R) \
({ \
unsigned int clean = smp_load_acquire(&(R)->next_to_clean); \
unsigned int use = READ_ONCE((R)->next_to_use); \
(clean > use ? 0 : (R)->count) + clean - use - 1; \
})
#define E1000_RX_DESC_EXT(R, i) \
(&(((union e1000_rx_desc_extended *)((R).desc))[i]))
#define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i]))
#define E1000_RX_DESC(R, i) E1000_GET_DESC(R, i, e1000_rx_desc)
#define E1000_TX_DESC(R, i) E1000_GET_DESC(R, i, e1000_tx_desc)
#define E1000_CONTEXT_DESC(R, i) E1000_GET_DESC(R, i, e1000_context_desc)
/* board specific private data structure */
struct e1000_adapter {
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
u16 mng_vlan_id;
u32 bd_number;
u32 rx_buffer_len;
u32 wol;
u32 smartspeed;
u32 en_mng_pt;
u16 link_speed;
u16 link_duplex;
Annotation
- Immediate include surface: `linux/stddef.h`, `linux/module.h`, `linux/types.h`, `asm/byteorder.h`, `linux/mm.h`, `linux/errno.h`, `linux/ioport.h`, `linux/pci.h`.
- Detected declarations: `struct e1000_adapter`, `struct e1000_tx_buffer`, `struct e1000_rx_buffer`, `struct e1000_tx_ring`, `struct e1000_rx_ring`, `struct e1000_adapter`, `enum e1000_state_t`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.