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.

Dependency Surface

Detected Declarations

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

Implementation Notes