drivers/net/ethernet/broadcom/tg3.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/broadcom/tg3.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/broadcom/tg3.h
Extension
.h
Size
128393 bytes
Lines
3453
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 tg3_tx_buffer_desc {
	u32				addr_hi;
	u32				addr_lo;

	u32				len_flags;
#define TXD_FLAG_TCPUDP_CSUM		0x0001
#define TXD_FLAG_IP_CSUM		0x0002
#define TXD_FLAG_END			0x0004
#define TXD_FLAG_IP_FRAG		0x0008
#define TXD_FLAG_JMB_PKT		0x0008
#define TXD_FLAG_IP_FRAG_END		0x0010
#define TXD_FLAG_HWTSTAMP		0x0020
#define TXD_FLAG_VLAN			0x0040
#define TXD_FLAG_COAL_NOW		0x0080
#define TXD_FLAG_CPU_PRE_DMA		0x0100
#define TXD_FLAG_CPU_POST_DMA		0x0200
#define TXD_FLAG_ADD_SRC_ADDR		0x1000
#define TXD_FLAG_CHOOSE_SRC_ADDR	0x6000
#define TXD_FLAG_NO_CRC			0x8000
#define TXD_LEN_SHIFT			16

	u32				vlan_tag;
#define TXD_VLAN_TAG_SHIFT		0
#define TXD_MSS_SHIFT			16
};

#define TXD_ADDR			0x00UL /* 64-bit */
#define TXD_LEN_FLAGS			0x08UL /* 32-bit (upper 16-bits are len) */
#define TXD_VLAN_TAG			0x0cUL /* 32-bit (upper 16-bits are tag) */
#define TXD_SIZE			0x10UL

struct tg3_rx_buffer_desc {
	u32				addr_hi;
	u32				addr_lo;

	u32				idx_len;
#define RXD_IDX_MASK	0xffff0000
#define RXD_IDX_SHIFT	16
#define RXD_LEN_MASK	0x0000ffff
#define RXD_LEN_SHIFT	0

	u32				type_flags;
#define RXD_TYPE_SHIFT	16
#define RXD_FLAGS_SHIFT	0

#define RXD_FLAG_END			0x0004
#define RXD_FLAG_MINI			0x0800
#define RXD_FLAG_JUMBO			0x0020
#define RXD_FLAG_VLAN			0x0040
#define RXD_FLAG_ERROR			0x0400
#define RXD_FLAG_IP_CSUM		0x1000
#define RXD_FLAG_TCPUDP_CSUM		0x2000
#define RXD_FLAG_IS_TCP			0x4000
#define RXD_FLAG_PTPSTAT_MASK		0x0210
#define RXD_FLAG_PTPSTAT_PTPV1		0x0010
#define RXD_FLAG_PTPSTAT_PTPV2		0x0200

	u32				ip_tcp_csum;
#define RXD_IPCSUM_MASK		0xffff0000
#define RXD_IPCSUM_SHIFT	16
#define RXD_TCPCSUM_MASK	0x0000ffff
#define RXD_TCPCSUM_SHIFT	0

	u32				err_vlan;

#define RXD_VLAN_MASK			0x0000ffff

#define RXD_ERR_BAD_CRC			0x00010000
#define RXD_ERR_COLLISION		0x00020000
#define RXD_ERR_LINK_LOST		0x00040000
#define RXD_ERR_PHY_DECODE		0x00080000
#define RXD_ERR_ODD_NIBBLE_RCVD_MII	0x00100000
#define RXD_ERR_MAC_ABRT		0x00200000
#define RXD_ERR_TOO_SMALL		0x00400000
#define RXD_ERR_NO_RESOURCES		0x00800000
#define RXD_ERR_HUGE_FRAME		0x01000000

#define RXD_ERR_MASK	(RXD_ERR_BAD_CRC | RXD_ERR_COLLISION |		\
			 RXD_ERR_LINK_LOST | RXD_ERR_PHY_DECODE |	\
			 RXD_ERR_MAC_ABRT | RXD_ERR_TOO_SMALL |		\
			 RXD_ERR_NO_RESOURCES | RXD_ERR_HUGE_FRAME)

	u32				reserved;
	u32				opaque;
#define RXD_OPAQUE_INDEX_MASK		0x0000ffff
#define RXD_OPAQUE_INDEX_SHIFT		0
#define RXD_OPAQUE_RING_STD		0x00010000
#define RXD_OPAQUE_RING_JUMBO		0x00020000
#define RXD_OPAQUE_RING_MINI		0x00040000
#define RXD_OPAQUE_RING_MASK		0x00070000

Annotation

Implementation Notes