Skip to content

Commit 81d4e8e

Browse files
ffainellidavem330
authored andcommitted
net: dsa: loop: PVID should be per-port
The PVID should be per-port, this is a preliminary change to support a 802.1Q data path in the driver. Signed-off-by: Florian Fainelli <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 59b328c commit 81d4e8e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/dsa/dsa_loop.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ static struct dsa_loop_mib_entry dsa_loop_mibs[] = {
4545

4646
struct dsa_loop_port {
4747
struct dsa_loop_mib_entry mib[__DSA_LOOP_CNT_MAX];
48+
u16 pvid;
4849
};
4950

5051
#define DSA_LOOP_VLANS 5
@@ -55,7 +56,6 @@ struct dsa_loop_priv {
5556
struct dsa_loop_vlan vlans[DSA_LOOP_VLANS];
5657
struct net_device *netdev;
5758
struct dsa_loop_port ports[DSA_MAX_PORTS];
58-
u16 pvid;
5959
};
6060

6161
static struct phy_device *phydevs[PHY_MAX_ADDR];
@@ -224,7 +224,7 @@ static void dsa_loop_port_vlan_add(struct dsa_switch *ds, int port,
224224
}
225225

226226
if (pvid)
227-
ps->pvid = vid;
227+
ps->ports[port].pvid = vid;
228228
}
229229

230230
static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port,
@@ -234,7 +234,7 @@ static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port,
234234
struct dsa_loop_priv *ps = ds->priv;
235235
struct mii_bus *bus = ps->bus;
236236
struct dsa_loop_vlan *vl;
237-
u16 vid, pvid = ps->pvid;
237+
u16 vid, pvid = ps->ports[port].pvid;
238238

239239
/* Just do a sleeping operation to make lockdep checks effective */
240240
mdiobus_read(bus, ps->port_base + port, MII_BMSR);
@@ -252,7 +252,7 @@ static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port,
252252
dev_dbg(ds->dev, "%s: port: %d vlan: %d, %stagged, pvid: %d\n",
253253
__func__, port, vid, untagged ? "un" : "", pvid);
254254
}
255-
ps->pvid = pvid;
255+
ps->ports[port].pvid = pvid;
256256

257257
return 0;
258258
}

0 commit comments

Comments
 (0)