drivers/net/ethernet/chelsio/cxgb3/common.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/chelsio/cxgb3/common.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/chelsio/cxgb3/common.h
Extension
.h
Size
24612 bytes
Lines
775
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 sg_ent {			/* SGE scatter/gather entry */
	__be32 len[2];
	__be64 addr[2];
};

#ifndef SGE_NUM_GENBITS
/* Must be 1 or 2 */
# define SGE_NUM_GENBITS 2
#endif

#define TX_DESC_FLITS 16U
#define WR_FLITS (TX_DESC_FLITS + 1 - SGE_NUM_GENBITS)

struct cphy;
struct adapter;

struct mdio_ops {
	int (*read)(struct net_device *dev, int phy_addr, int mmd_addr,
		    u16 reg_addr);
	int (*write)(struct net_device *dev, int phy_addr, int mmd_addr,
		     u16 reg_addr, u16 val);
	unsigned mode_support;
};

struct adapter_info {
	unsigned char nports0;        /* # of ports on channel 0 */
	unsigned char nports1;        /* # of ports on channel 1 */
	unsigned char phy_base_addr;	/* MDIO PHY base address */
	unsigned int gpio_out;	/* GPIO output settings */
	unsigned char gpio_intr[MAX_NPORTS]; /* GPIO PHY IRQ pins */
	unsigned long caps;	/* adapter capabilities */
	const struct mdio_ops *mdio_ops;	/* MDIO operations */
	const char *desc;	/* product description */
};

struct mc5_stats {
	unsigned long parity_err;
	unsigned long active_rgn_full;
	unsigned long nfa_srch_err;
	unsigned long unknown_cmd;
	unsigned long reqq_parity_err;
	unsigned long dispq_parity_err;
	unsigned long del_act_empty;
};

struct mc7_stats {
	unsigned long corr_err;
	unsigned long uncorr_err;
	unsigned long parity_err;
	unsigned long addr_err;
};

struct mac_stats {
	u64 tx_octets;		/* total # of octets in good frames */
	u64 tx_octets_bad;	/* total # of octets in error frames */
	u64 tx_frames;		/* all good frames */
	u64 tx_mcast_frames;	/* good multicast frames */
	u64 tx_bcast_frames;	/* good broadcast frames */
	u64 tx_pause;		/* # of transmitted pause frames */
	u64 tx_deferred;	/* frames with deferred transmissions */
	u64 tx_late_collisions;	/* # of late collisions */
	u64 tx_total_collisions;	/* # of total collisions */
	u64 tx_excess_collisions;	/* frame errors from excessive collissions */
	u64 tx_underrun;	/* # of Tx FIFO underruns */
	u64 tx_len_errs;	/* # of Tx length errors */
	u64 tx_mac_internal_errs;	/* # of internal MAC errors on Tx */
	u64 tx_excess_deferral;	/* # of frames with excessive deferral */
	u64 tx_fcs_errs;	/* # of frames with bad FCS */

	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 rx_octets;		/* total # of octets in good frames */
	u64 rx_octets_bad;	/* total # of octets in error frames */
	u64 rx_frames;		/* all good frames */
	u64 rx_mcast_frames;	/* good multicast frames */
	u64 rx_bcast_frames;	/* good broadcast frames */
	u64 rx_pause;		/* # of received pause frames */
	u64 rx_fcs_errs;	/* # of received frames with bad FCS */
	u64 rx_align_errs;	/* alignment errors */
	u64 rx_symbol_errs;	/* symbol errors */
	u64 rx_data_errs;	/* data errors */
	u64 rx_sequence_errs;	/* sequence errors */
	u64 rx_runt;		/* # of runt frames */
	u64 rx_jabber;		/* # of jabber frames */

Annotation

Implementation Notes