drivers/net/ethernet/sunplus/spl2sw_define.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/sunplus/spl2sw_define.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/sunplus/spl2sw_define.h
Extension
.h
Size
8696 bytes
Lines
271
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 spl2sw_mac_desc {
	u32 cmd1;
	u32 cmd2;
	u32 addr1;
	u32 addr2;
};

struct spl2sw_skb_info {
	struct sk_buff *skb;
	u32 mapping;
	u32 len;
};

struct spl2sw_common {
	void __iomem *l2sw_reg_base;

	struct platform_device *pdev;
	struct reset_control *rstc;
	struct clk *clk;

	void *desc_base;
	dma_addr_t desc_dma;
	s32 desc_size;
	struct spl2sw_mac_desc *rx_desc[RX_DESC_QUEUE_NUM];
	struct spl2sw_skb_info *rx_skb_info[RX_DESC_QUEUE_NUM];
	u32 rx_pos[RX_DESC_QUEUE_NUM];
	u32 rx_desc_num[RX_DESC_QUEUE_NUM];
	u32 rx_desc_buff_size;

	struct spl2sw_mac_desc *tx_desc;
	struct spl2sw_skb_info tx_temp_skb_info[TX_DESC_NUM];
	u32 tx_done_pos;
	u32 tx_pos;
	u32 tx_desc_full;

	struct net_device *ndev[MAX_NETDEV_NUM];
	struct mii_bus *mii_bus;

	struct napi_struct rx_napi;
	struct napi_struct tx_napi;

	spinlock_t tx_lock;		/* spinlock for accessing tx buffer */
	spinlock_t mdio_lock;		/* spinlock for mdio commands */
	spinlock_t int_mask_lock;	/* spinlock for accessing int mask reg. */

	u8 enable;
};

struct spl2sw_mac {
	struct net_device *ndev;
	struct spl2sw_common *comm;

	u8 mac_addr[ETH_ALEN];
	phy_interface_t phy_mode;
	struct device_node *phy_node;

	u8 lan_port;
	u8 to_vlan;
	u8 vlan_id;
};

#endif

Annotation

Implementation Notes