aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6xxx.h
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-03-26 18:36:35 -0700
committerDavid S. Miller <davem@davemloft.net>2015-03-29 13:23:53 -0700
commitfacd95b2e0ec02ccf6d13f4d08c060628dca0862 (patch)
tree114bf401b08530583b16839c1c22f9fe220fa4de /drivers/net/dsa/mv88e6xxx.h
parentnet: dsa: mv88e6171: Use common port configuration (diff)
downloadlinux-dev-facd95b2e0ec02ccf6d13f4d08c060628dca0862.tar.xz
linux-dev-facd95b2e0ec02ccf6d13f4d08c060628dca0862.zip
net: dsa: mv88e6xxx: Add Hardware bridging support
Bridge support is similar for all chips supported by the mv88e6xxx code, so add the code there. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/dsa/mv88e6xxx.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h
index a4df4968594e..8e215ebc8d34 100644
--- a/drivers/net/dsa/mv88e6xxx.h
+++ b/drivers/net/dsa/mv88e6xxx.h
@@ -15,6 +15,20 @@
#define REG_GLOBAL 0x1b
#define REG_GLOBAL2 0x1c
+/* ATU commands */
+
+#define ATU_BUSY 0x8000
+
+#define ATU_CMD_FLUSH_NONSTATIC_FID (ATU_BUSY | 0x6000)
+
+/* port states */
+
+#define PSTATE_MASK 0x03
+#define PSTATE_DISABLED 0x00
+#define PSTATE_BLOCKING 0x01
+#define PSTATE_LEARNING 0x02
+#define PSTATE_FORWARDING 0x03
+
struct mv88e6xxx_priv_state {
/* When using multi-chip addressing, this mutex protects
* access to the indirect access registers. (In single-chip
@@ -49,6 +63,17 @@ struct mv88e6xxx_priv_state {
struct mutex eeprom_mutex;
int id; /* switch product id */
+
+ /* hw bridging */
+
+ u32 fid_mask;
+ u8 fid[DSA_MAX_PORTS];
+ u16 bridge_mask[DSA_MAX_PORTS];
+
+ unsigned long port_state_update_mask;
+ u8 port_state[DSA_MAX_PORTS];
+
+ struct work_struct bridge_work;
};
struct mv88e6xxx_hw_stat {
@@ -93,6 +118,9 @@ int mv88e6xxx_phy_write_indirect(struct dsa_switch *ds, int addr, int regnum,
int mv88e6xxx_get_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e);
int mv88e6xxx_set_eee(struct dsa_switch *ds, int port,
struct phy_device *phydev, struct ethtool_eee *e);
+int mv88e6xxx_join_bridge(struct dsa_switch *ds, int port, u32 br_port_mask);
+int mv88e6xxx_leave_bridge(struct dsa_switch *ds, int port, u32 br_port_mask);
+int mv88e6xxx_port_stp_update(struct dsa_switch *ds, int port, u8 state);
extern struct dsa_switch_driver mv88e6131_switch_driver;
extern struct dsa_switch_driver mv88e6123_61_65_switch_driver;