drivers/net/ethernet/marvell/sky2.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/marvell/sky2.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/marvell/sky2.h
Extension
.h
Size
92216 bytes
Lines
2429
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 sky2_tx_le {
	__le32	addr;
	__le16	length;	/* also vlan tag or checksum start */
	u8	ctrl;
	u8	opcode;
} __packed;

struct sky2_rx_le {
	__le32	addr;
	__le16	length;
	u8	ctrl;
	u8	opcode;
} __packed;

struct sky2_status_le {
	__le32	status;	/* also checksum */
	__le16	length;	/* also vlan tag */
	u8	css;
	u8	opcode;
} __packed;

struct tx_ring_info {
	struct sk_buff	*skb;
	unsigned long flags;
#define TX_MAP_SINGLE   0x0001
#define TX_MAP_PAGE     0x0002
	DEFINE_DMA_UNMAP_ADDR(mapaddr);
	DEFINE_DMA_UNMAP_LEN(maplen);
};

struct rx_ring_info {
	struct sk_buff	*skb;
	dma_addr_t	data_addr;
	DEFINE_DMA_UNMAP_LEN(data_size);
	dma_addr_t	frag_addr[ETH_JUMBO_MTU >> PAGE_SHIFT ?: 1];
};

enum flow_control {
	FC_NONE	= 0,
	FC_TX	= 1,
	FC_RX	= 2,
	FC_BOTH	= 3,
};

struct sky2_stats {
	struct u64_stats_sync syncp;
	u64		packets;
	u64		bytes;
};

struct sky2_port {
	struct sky2_hw	     *hw;
	struct net_device    *netdev;
	unsigned	     port;
	u32		     msg_enable;
	spinlock_t	     phy_lock;

	struct tx_ring_info  *tx_ring;
	struct sky2_tx_le    *tx_le;
	struct sky2_stats    tx_stats;

	u16		     tx_ring_size;
	u16		     tx_cons;		/* next le to check */
	u16		     tx_prod;		/* next le to use */
	u16		     tx_next;		/* debug only */

	u16		     tx_pending;
	u16		     tx_last_mss;
	u32		     tx_last_upper;
	u32		     tx_tcpsum;

	struct rx_ring_info  *rx_ring ____cacheline_aligned_in_smp;
	struct sky2_rx_le    *rx_le;
	struct sky2_stats    rx_stats;

	u16		     rx_next;		/* next re to check */
	u16		     rx_put;		/* next le index to use */
	u16		     rx_pending;
	u16		     rx_data_size;
	u16		     rx_nfrags;

	unsigned long	     last_rx;
	struct {
		unsigned long last;
		u32	mac_rp;
		u8	mac_lev;
		u8	fifo_rp;
		u8	fifo_lev;
	} check;

Annotation

Implementation Notes