drivers/net/dsa/b53/b53_priv.h

Source file repositories/reference/linux-study-clean/drivers/net/dsa/b53/b53_priv.h

File Facts

System
Linux kernel
Corpus path
drivers/net/dsa/b53/b53_priv.h
Extension
.h
Size
16674 bytes
Lines
562
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 b53_io_ops {
	int (*read8)(struct b53_device *dev, u8 page, u8 reg, u8 *value);
	int (*read16)(struct b53_device *dev, u8 page, u8 reg, u16 *value);
	int (*read32)(struct b53_device *dev, u8 page, u8 reg, u32 *value);
	int (*read48)(struct b53_device *dev, u8 page, u8 reg, u64 *value);
	int (*read64)(struct b53_device *dev, u8 page, u8 reg, u64 *value);
	int (*write8)(struct b53_device *dev, u8 page, u8 reg, u8 value);
	int (*write16)(struct b53_device *dev, u8 page, u8 reg, u16 value);
	int (*write32)(struct b53_device *dev, u8 page, u8 reg, u32 value);
	int (*write48)(struct b53_device *dev, u8 page, u8 reg, u64 value);
	int (*write64)(struct b53_device *dev, u8 page, u8 reg, u64 value);
	int (*phy_read16)(struct b53_device *dev, int addr, int reg, u16 *value);
	int (*phy_write16)(struct b53_device *dev, int addr, int reg, u16 value);
	int (*irq_enable)(struct b53_device *dev, int port);
	void (*irq_disable)(struct b53_device *dev, int port);
	void (*phy_enable)(struct b53_device *dev, int port);
	void (*phy_disable)(struct b53_device *dev, int port);
	void (*phylink_get_caps)(struct b53_device *dev, int port,
				 struct phylink_config *config);
	struct phylink_pcs *(*phylink_mac_select_pcs)(struct b53_device *dev,
						      int port,
						      phy_interface_t interface);
	u8 (*serdes_map_lane)(struct b53_device *dev, int port);
	void (*serdes_link_set)(struct b53_device *dev, int port,
				unsigned int mode, phy_interface_t interface,
				bool link_up);
};

struct b53_arl_entry;

struct b53_arl_ops {
	void (*arl_read_entry)(struct b53_device *dev,
			       struct b53_arl_entry *ent, u8 idx);
	void (*arl_write_entry)(struct b53_device *dev,
				const struct b53_arl_entry *ent, u8 idx);
	void (*arl_search_read)(struct b53_device *dev, u8 idx,
				struct b53_arl_entry *ent);
};

#define B53_INVALID_LANE	0xff

enum {
	BCM4908_DEVICE_ID = 0x4908,
	BCM5325_DEVICE_ID = 0x25,
	BCM5365_DEVICE_ID = 0x65,
	BCM5389_DEVICE_ID = 0x89,
	BCM5395_DEVICE_ID = 0x95,
	BCM5397_DEVICE_ID = 0x97,
	BCM5398_DEVICE_ID = 0x98,
	BCM53101_DEVICE_ID = 0x53101,
	BCM53115_DEVICE_ID = 0x53115,
	BCM53125_DEVICE_ID = 0x53125,
	BCM53128_DEVICE_ID = 0x53128,
	BCM63XX_DEVICE_ID = 0x6300,
	BCM6318_DEVICE_ID = 0x6318,
	BCM6328_DEVICE_ID = 0x6328,
	BCM6362_DEVICE_ID = 0x6362,
	BCM6368_DEVICE_ID = 0x6368,
	BCM63268_DEVICE_ID = 0x63268,
	BCM53010_DEVICE_ID = 0x53010,
	BCM53011_DEVICE_ID = 0x53011,
	BCM53012_DEVICE_ID = 0x53012,
	BCM53018_DEVICE_ID = 0x53018,
	BCM53019_DEVICE_ID = 0x53019,
	BCM58XX_DEVICE_ID = 0x5800,
	BCM583XX_DEVICE_ID = 0x58300,
	BCM7445_DEVICE_ID = 0x7445,
	BCM7278_DEVICE_ID = 0x7278,
	BCM53134_DEVICE_ID = 0x5075,
};

enum b53_variant_id {
	B53_VARIANT_NONE = 0,
	B53_VARIANT_5325E,
	B53_VARIANT_5325M,
};

struct b53_pcs {
	struct phylink_pcs pcs;
	struct b53_device *dev;
	u8 lane;
};

#define B53_N_PORTS	9
#define B53_N_PORTS_25	6
#define B53_N_PCS	2

struct b53_port {
	u16		vlan_ctl_mask;
	u16		pvid;

Annotation

Implementation Notes