0001
0002 #include <linux/if_ether.h>
0003
0004 struct lan9303;
0005
0006 struct lan9303_phy_ops {
0007
0008 int (*phy_read)(struct lan9303 *chip, int port, int regnum);
0009 int (*phy_write)(struct lan9303 *chip, int port,
0010 int regnum, u16 val);
0011 };
0012
0013 #define LAN9303_NUM_ALR_RECORDS 512
0014 struct lan9303_alr_cache_entry {
0015 u8 mac_addr[ETH_ALEN];
0016 u8 port_map;
0017 u8 stp_override;
0018 };
0019
0020 struct lan9303 {
0021 struct device *dev;
0022 struct regmap *regmap;
0023 struct regmap_irq_chip_data *irq_data;
0024 struct gpio_desc *reset_gpio;
0025 u32 reset_duration;
0026 int phy_addr_base;
0027 struct dsa_switch *ds;
0028 struct mutex indirect_mutex;
0029 struct mutex alr_mutex;
0030 const struct lan9303_phy_ops *ops;
0031 bool is_bridged;
0032
0033
0034 u32 swe_port_state;
0035
0036
0037
0038 struct lan9303_alr_cache_entry alr_cache[LAN9303_NUM_ALR_RECORDS];
0039 };