net: dsa: mv88e6xxx: add port vlan map setter
Add a port function to access the Port Based VLAN Map register. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
e28def3329
commit
5a7921f46d
@@ -1218,16 +1218,13 @@ static int _mv88e6xxx_atu_remove(struct mv88e6xxx_chip *chip, u16 fid,
|
||||
static int _mv88e6xxx_port_based_vlan_map(struct mv88e6xxx_chip *chip, int port)
|
||||
{
|
||||
struct net_device *bridge = chip->ports[port].bridge_dev;
|
||||
const u16 mask = (1 << mv88e6xxx_num_ports(chip)) - 1;
|
||||
struct dsa_switch *ds = chip->ds;
|
||||
u16 output_ports = 0;
|
||||
u16 reg;
|
||||
int err;
|
||||
int i;
|
||||
|
||||
/* allow CPU port or DSA link(s) to send frames to every port */
|
||||
if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)) {
|
||||
output_ports = mask;
|
||||
output_ports = ~0;
|
||||
} else {
|
||||
for (i = 0; i < mv88e6xxx_num_ports(chip); ++i) {
|
||||
/* allow sending frames to every group member */
|
||||
@@ -1243,14 +1240,7 @@ static int _mv88e6xxx_port_based_vlan_map(struct mv88e6xxx_chip *chip, int port)
|
||||
/* prevent frames from going back out of the port they came in on */
|
||||
output_ports &= ~BIT(port);
|
||||
|
||||
err = mv88e6xxx_port_read(chip, port, PORT_BASE_VLAN, ®);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
reg &= ~mask;
|
||||
reg |= output_ports & mask;
|
||||
|
||||
return mv88e6xxx_port_write(chip, port, PORT_BASE_VLAN, reg);
|
||||
return mv88e6xxx_port_set_vlan_map(chip, port, output_ports);
|
||||
}
|
||||
|
||||
static void mv88e6xxx_port_stp_state_set(struct dsa_switch *ds, int port,
|
||||
|
Reference in New Issue
Block a user