Skip to content
Permalink
Browse files
net: dsa: lan9303: add VLAN IDs to master device
If the master device does VLAN filtering, the IDs used by the switch
must be added for any frames to be received.  Do this in the
port_enable() function, and remove them in port_disable().

Signed-off-by: Mans Rullgard <mans@mansr.com>
  • Loading branch information
mansr authored and intel-lab-lkp committed Feb 16, 2022
1 parent c5d9ae2 commit 960beb0e82f5d219a4f7e8bdcc49fb548a82a69d
Showing 1 changed file with 12 additions and 0 deletions.
@@ -1084,20 +1084,32 @@ static int lan9303_port_enable(struct dsa_switch *ds, int port,
struct phy_device *phy)
{
struct lan9303 *chip = ds->priv;
struct dsa_port *cpu_dp;

if (!dsa_is_user_port(ds, port))
return 0;

dsa_switch_for_each_cpu_port(cpu_dp, ds)
break;

vlan_vid_add(cpu_dp->master, htons(ETH_P_8021Q), port);

return lan9303_enable_processing_port(chip, port);
}

static void lan9303_port_disable(struct dsa_switch *ds, int port)
{
struct lan9303 *chip = ds->priv;
struct dsa_port *cpu_dp;

if (!dsa_is_user_port(ds, port))
return;

dsa_switch_for_each_cpu_port(cpu_dp, ds)
break;

vlan_vid_del(cpu_dp->master, htons(ETH_P_8021Q), port);

lan9303_disable_processing_port(chip, port);
lan9303_phy_write(ds, chip->phy_addr_base + port, MII_BMCR, BMCR_PDOWN);
}

0 comments on commit 960beb0

Please sign in to comment.