drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h- Extension
.h- Size
- 74993 bytes
- Lines
- 2157
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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
t4_hw.hlinux/bitops.hlinux/cache.hlinux/ethtool.hlinux/interrupt.hlinux/list.hlinux/netdevice.hlinux/pci.hlinux/spinlock.hlinux/timer.hlinux/vmalloc.hlinux/rhashtable.hlinux/etherdevice.hlinux/net_tstamp.hlinux/ptp_clock_kernel.hlinux/ptp_classify.hlinux/crash_dump.hlinux/thermal.hasm/io.ht4_chip_type.hcxgb4_uld.ht4fw_api.hcxgb4_dcb.hcxgb4_fcoe.h
Detected Declarations
struct cxgb4_bootcfg_datastruct cxgb4_pcir_datastruct cxgb4_pci_exp_rom_headerstruct legacy_pci_rom_hdrstruct port_statsstruct lb_port_statsstruct tp_tcp_statsstruct tp_usm_statsstruct tp_fcoe_statsstruct tp_err_statsstruct tp_cpl_statsstruct tp_rdma_statsstruct sge_paramsstruct tp_paramsstruct vpd_paramsstruct pf_resourcesstruct pci_paramsstruct devlog_paramsstruct arch_specific_paramsstruct adapter_paramsstruct sge_idma_monitor_statestruct mbox_cmdstruct mbox_cmd_logstruct cxgb4_ethtool_lb_teststruct fw_infostruct trace_paramsstruct cxgb4_fw_datastruct link_configstruct adapterstruct sge_rspqstruct port_infostruct dentrystruct work_structstruct rx_sw_descstruct sge_flstruct pkt_glstruct t4_lro_mgrstruct sge_rspqstruct sge_eth_statsstruct sge_eth_rxqstruct sge_ofld_statsstruct sge_ofld_rxqstruct tx_descstruct ulptx_sglstruct tx_sw_descstruct sge_txqstruct sge_eth_txqstruct sge_uld_txq
Annotated Snippet
struct cxgb4_bootcfg_data {
__le16 signature;
__u8 reserved[2];
};
struct cxgb4_pcir_data {
__le32 signature; /* Signature. The string "PCIR" */
__le16 vendor_id; /* Vendor Identification */
__le16 device_id; /* Device Identification */
__u8 vital_product[2]; /* Pointer to Vital Product Data */
__u8 length[2]; /* PCIR Data Structure Length */
__u8 revision; /* PCIR Data Structure Revision */
__u8 class_code[3]; /* Class Code */
__u8 image_length[2]; /* Image Length. Multiple of 512B */
__u8 code_revision[2]; /* Revision Level of Code/Data */
__u8 code_type;
__u8 indicator;
__u8 reserved[2];
};
/* BIOS boot headers */
struct cxgb4_pci_exp_rom_header {
__le16 signature; /* ROM Signature. Should be 0xaa55 */
__u8 reserved[22]; /* Reserved per processor Architecture data */
__le16 pcir_offset; /* Offset to PCI Data Structure */
};
/* Legacy PCI Expansion ROM Header */
struct legacy_pci_rom_hdr {
__u8 signature[2]; /* ROM Signature. Should be 0xaa55 */
__u8 size512; /* Current Image Size in units of 512 bytes */
__u8 initentry_point[4];
__u8 cksum; /* Checksum computed on the entire Image */
__u8 reserved[16]; /* Reserved */
__le16 pcir_offset; /* Offset to PCI Data Struture */
};
#define CXGB4_HDR_CODE1 0x00
#define CXGB4_HDR_CODE2 0x03
#define CXGB4_HDR_INDI 0x80
/* BOOT constants */
enum {
BOOT_CFG_SIG = 0x4243,
BOOT_SIZE_INC = 512,
BOOT_SIGNATURE = 0xaa55,
BOOT_MIN_SIZE = sizeof(struct cxgb4_pci_exp_rom_header),
BOOT_MAX_SIZE = 1024 * BOOT_SIZE_INC,
PCIR_SIGNATURE = 0x52494350
};
struct port_stats {
u64 tx_octets; /* total # of octets in good frames */
u64 tx_frames; /* all good frames */
u64 tx_bcast_frames; /* all broadcast frames */
u64 tx_mcast_frames; /* all multicast frames */
u64 tx_ucast_frames; /* all unicast frames */
u64 tx_error_frames; /* all error frames */
u64 tx_frames_64; /* # of Tx frames in a particular range */
u64 tx_frames_65_127;
u64 tx_frames_128_255;
u64 tx_frames_256_511;
u64 tx_frames_512_1023;
u64 tx_frames_1024_1518;
u64 tx_frames_1519_max;
u64 tx_drop; /* # of dropped Tx frames */
u64 tx_pause; /* # of transmitted pause frames */
u64 tx_ppp0; /* # of transmitted PPP prio 0 frames */
u64 tx_ppp1; /* # of transmitted PPP prio 1 frames */
u64 tx_ppp2; /* # of transmitted PPP prio 2 frames */
u64 tx_ppp3; /* # of transmitted PPP prio 3 frames */
u64 tx_ppp4; /* # of transmitted PPP prio 4 frames */
u64 tx_ppp5; /* # of transmitted PPP prio 5 frames */
u64 tx_ppp6; /* # of transmitted PPP prio 6 frames */
u64 tx_ppp7; /* # of transmitted PPP prio 7 frames */
u64 rx_octets; /* total # of octets in good frames */
u64 rx_frames; /* all good frames */
u64 rx_bcast_frames; /* all broadcast frames */
u64 rx_mcast_frames; /* all multicast frames */
u64 rx_ucast_frames; /* all unicast frames */
u64 rx_too_long; /* # of frames exceeding MTU */
u64 rx_jabber; /* # of jabber frames */
u64 rx_fcs_err; /* # of received frames with bad FCS */
u64 rx_len_err; /* # of received frames with length error */
u64 rx_symbol_err; /* symbol errors */
u64 rx_runt; /* # of short frames */
Annotation
- Immediate include surface: `t4_hw.h`, `linux/bitops.h`, `linux/cache.h`, `linux/ethtool.h`, `linux/interrupt.h`, `linux/list.h`, `linux/netdevice.h`, `linux/pci.h`.
- Detected declarations: `struct cxgb4_bootcfg_data`, `struct cxgb4_pcir_data`, `struct cxgb4_pci_exp_rom_header`, `struct legacy_pci_rom_hdr`, `struct port_stats`, `struct lb_port_stats`, `struct tp_tcp_stats`, `struct tp_usm_stats`, `struct tp_fcoe_stats`, `struct tp_err_stats`.
- 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.
- 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.