drivers/net/ethernet/chelsio/cxgb3/adapter.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/chelsio/cxgb3/adapter.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/chelsio/cxgb3/adapter.h- Extension
.h- Size
- 11244 bytes
- Lines
- 335
- 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/pci.hlinux/spinlock.hlinux/interrupt.hlinux/timer.hlinux/cache.hlinux/mutex.hlinux/bitops.ht3cdev.hasm/io.h
Detected Declarations
struct adapterstruct sge_qsetstruct port_infostruct iscsi_configstruct port_infostruct fl_pg_chunkstruct rx_descstruct rx_sw_descstruct sge_flstruct rsp_descstruct sge_rspqstruct tx_descstruct tx_sw_descstruct sge_txqstruct napi_gro_fraginfostruct sge_qsetstruct sgestruct adapterenum mac_idx_typesfunction t3_read_regfunction t3_write_regfunction phy2portidfunction offload_running
Annotated Snippet
struct iscsi_config {
__u8 mac_addr[ETH_ALEN];
__u32 flags;
int (*send)(struct port_info *pi, struct sk_buff **skb);
int (*recv)(struct port_info *pi, struct sk_buff *skb);
};
struct port_info {
struct adapter *adapter;
struct sge_qset *qs;
u8 port_id;
u8 nqsets;
u8 first_qset;
struct cphy phy;
struct cmac mac;
struct link_config link_config;
int activity;
__be32 iscsi_ipv4addr;
struct iscsi_config iscsic;
int link_fault; /* link fault was detected */
};
enum { /* adapter flags */
FULL_INIT_DONE = (1 << 0),
USING_MSI = (1 << 1),
USING_MSIX = (1 << 2),
QUEUES_BOUND = (1 << 3),
TP_PARITY_INIT = (1 << 4),
NAPI_INIT = (1 << 5),
};
struct fl_pg_chunk {
struct page *page;
void *va;
unsigned int offset;
unsigned long *p_cnt;
dma_addr_t mapping;
};
struct rx_desc;
struct rx_sw_desc;
struct sge_fl { /* SGE per free-buffer list state */
unsigned int buf_size; /* size of each Rx buffer */
unsigned int credits; /* # of available Rx buffers */
unsigned int pend_cred; /* new buffers since last FL DB ring */
unsigned int size; /* capacity of free list */
unsigned int cidx; /* consumer index */
unsigned int pidx; /* producer index */
unsigned int gen; /* free list generation */
struct fl_pg_chunk pg_chunk;/* page chunk cache */
unsigned int use_pages; /* whether FL uses pages or sk_buffs */
unsigned int order; /* order of page allocations */
unsigned int alloc_size; /* size of allocated buffer */
struct rx_desc *desc; /* address of HW Rx descriptor ring */
struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */
dma_addr_t phys_addr; /* physical address of HW ring start */
unsigned int cntxt_id; /* SGE context id for the free list */
unsigned long empty; /* # of times queue ran out of buffers */
unsigned long alloc_failed; /* # of times buffer allocation failed */
};
/*
* Bundle size for grouping offload RX packets for delivery to the stack.
* Don't make this too big as we do prefetch on each packet in a bundle.
*/
# define RX_BUNDLE_SIZE 8
struct rsp_desc;
struct sge_rspq { /* state for an SGE response queue */
unsigned int credits; /* # of pending response credits */
unsigned int size; /* capacity of response queue */
unsigned int cidx; /* consumer index */
unsigned int gen; /* current generation bit */
unsigned int polling; /* is the queue serviced through NAPI? */
unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */
unsigned int next_holdoff; /* holdoff time for next interrupt */
unsigned int rx_recycle_buf; /* whether recycling occurred
within current sop-eop */
struct rsp_desc *desc; /* address of HW response ring */
dma_addr_t phys_addr; /* physical address of the ring */
unsigned int cntxt_id; /* SGE context id for the response q */
spinlock_t lock; /* guards response processing */
struct sk_buff_head rx_queue; /* offload packet receive queue */
struct sk_buff *pg_skb; /* used to build frag list in napi handler */
unsigned long offload_pkts;
unsigned long offload_bundles;
Annotation
- Immediate include surface: `linux/pci.h`, `linux/spinlock.h`, `linux/interrupt.h`, `linux/timer.h`, `linux/cache.h`, `linux/mutex.h`, `linux/bitops.h`, `t3cdev.h`.
- Detected declarations: `struct adapter`, `struct sge_qset`, `struct port_info`, `struct iscsi_config`, `struct port_info`, `struct fl_pg_chunk`, `struct rx_desc`, `struct rx_sw_desc`, `struct sge_fl`, `struct rsp_desc`.
- 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.