Commit 31eb078e authored by Vivien Didelot's avatar Vivien Didelot Committed by Ezequiel Garcia
Browse files

zii: net: dsa: mv88e6xxx: add BPDU MAC to side ports



This patch puts the BPDU MAC address in the ATU for the netleft
and netright ports, so that the switch bypass BPDU frames.

This is RDU specific, so wrap this code in a new
NET_DSA_MV88E6XXX_ZII_RDU Kconfig symbol for tweaks touching the
driver setup itself.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
parent 38faa886
......@@ -52,3 +52,10 @@ config NET_DSA_MV88E6XXX_ZII
depends on NET_DSA_MV88E6XXX
help
Say Y to enable ZII specific hacks.
config NET_DSA_MV88E6XXX_ZII_RDU
bool "Support for ZII specific RDU hacks"
default n
depends on NET_DSA_MV88E6XXX_ZII
help
Say Y to enable ZII specific RDU hacks.
......@@ -1259,6 +1259,21 @@ static int mv88e6xxx_atu_add_local_mac(struct mv88e6xxx_chip *chip, int fid)
}
#endif
#if IS_ENABLED(CONFIG_NET_DSA_MV88E6XXX_ZII_RDU)
static int mv88e6xxx_atu_add_bpdu_mac(struct mv88e6xxx_chip *chip, int fid)
{
u8 addr[6] = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
struct mv88e6xxx_atu_entry entry = {
.state = MV88E6XXX_G1_ATU_DATA_STATE_MC_STATIC_DA_MGMT_PO,
.portvec = BIT(3) | BIT(4), /* RDU netleft and netright */
};
ether_addr_copy(entry.mac, addr);
return mv88e6xxx_g1_atu_loadpurge(chip, fid, &entry);
}
#endif
static int mv88e6xxx_atu_setup(struct mv88e6xxx_chip *chip)
{
int err;
......@@ -1273,6 +1288,12 @@ static int mv88e6xxx_atu_setup(struct mv88e6xxx_chip *chip)
return err;
#endif
#if IS_ENABLED(CONFIG_NET_DSA_MV88E6XXX_ZII_RDU)
err = mv88e6xxx_atu_add_bpdu_mac(chip, 0);
if (err)
return err;
#endif
err = mv88e6xxx_g1_atu_set_learn2all(chip, true);
if (err)
return err;
......@@ -1447,6 +1468,12 @@ static int mv88e6xxx_atu_new(struct mv88e6xxx_chip *chip, u16 *fid)
return err;
#endif
#if IS_ENABLED(CONFIG_NET_DSA_MV88E6XXX_ZII_RDU)
err = mv88e6xxx_atu_add_bpdu_mac(chip, *fid);
if (err)
return err;
#endif
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment