diff options
author | David S. Miller <davem@davemloft.net> | 2015-03-29 13:24:05 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-29 13:24:05 -0700 |
commit | 7836b16c0dd1d3039ccc35ceeff6d75401fbba8c (patch) | |
tree | 62f92afc09fc12f37e1048147ea0090e652921c8 /drivers/net/dsa/mv88e6xxx.h | |
parent | 5ce58c2f13eaa8ca6d7e1041175433bd8cc55756 (diff) | |
parent | b2a6b93a0c5730dd96f224ed22ccd0662d06b3b0 (diff) |
Merge branch 'dsa-hw-bridging'
Guenter Roeck says:
====================
net: dsa: HW bridging, EEE support
Patch 1 to 7 of this series prepare the drivers using the mv88e6xxx code
for HW bridging support, without adding the code itself. For the most part
this factors out common port initialization code. There is no functional
change except for patch 3, which disables the message port bit for the
CPU port to prevent packet duplication if HW bridging is configured.
Patch 8 adds the infrastructure for hardware bridging support to the
mv88e6xxx code.
Patch 9 wires the MV88E6352 driver to support hardware bridging.
Patches 10 to 12 add support for ndo_fdb functions to the dsa subsystem,
and wire up the MV88E6352 driver to support those functions.
Patches 13 to 16 add EEE support and HW bridging support to the mv88e6171
driver. This set of patches is from Andrew, applied on top of the first
set of patches.
The series applies to net-next as of 3/24/2015.
Thanks a lot to Andrew Lunn for testing and valuable feedback.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx.h')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h index 5fd42ced9011..aaf239aba726 100644 --- a/drivers/net/dsa/mv88e6xxx.h +++ b/drivers/net/dsa/mv88e6xxx.h @@ -15,6 +15,30 @@ #define REG_GLOBAL 0x1b #define REG_GLOBAL2 0x1c +/* ATU commands */ + +#define ATU_BUSY 0x8000 + +#define ATU_CMD_LOAD_FID (ATU_BUSY | 0x3000) +#define ATU_CMD_GETNEXT_FID (ATU_BUSY | 0x4000) +#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 + +/* FDB states */ + +#define FDB_STATE_MASK 0x0f + +#define FDB_STATE_UNUSED 0x00 +#define FDB_STATE_MC_STATIC 0x07 /* static multicast */ +#define FDB_STATE_STATIC 0x0e /* static unicast */ + struct mv88e6xxx_priv_state { /* When using multi-chip addressing, this mutex protects * access to the indirect access registers. (In single-chip @@ -49,6 +73,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 { @@ -57,6 +92,8 @@ struct mv88e6xxx_hw_stat { int reg; }; +int mv88e6xxx_setup_port_common(struct dsa_switch *ds, int port); +int mv88e6xxx_setup_common(struct dsa_switch *ds); int __mv88e6xxx_reg_read(struct mii_bus *bus, int sw_addr, int addr, int reg); int mv88e6xxx_reg_read(struct dsa_switch *ds, int addr, int reg); int __mv88e6xxx_reg_write(struct mii_bus *bus, int sw_addr, int addr, @@ -91,6 +128,15 @@ 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); +int mv88e6xxx_port_fdb_add(struct dsa_switch *ds, int port, + const unsigned char *addr, u16 vid); +int mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port, + const unsigned char *addr, u16 vid); +int mv88e6xxx_port_fdb_getnext(struct dsa_switch *ds, int port, + unsigned char *addr, bool *is_static); extern struct dsa_switch_driver mv88e6131_switch_driver; extern struct dsa_switch_driver mv88e6123_61_65_switch_driver; |