Skip to content

Commit 916a8d1

Browse files
ffainellidavem330
authored andcommitted
net: dsa: loop: Support 4K VLANs
Allocate a 4K array of VLANs instead of limiting ourselves to just 5 which is arbitrary. Signed-off-by: Florian Fainelli <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 81d4e8e commit 916a8d1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/dsa/dsa_loop.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ struct dsa_loop_port {
4848
u16 pvid;
4949
};
5050

51-
#define DSA_LOOP_VLANS 5
52-
5351
struct dsa_loop_priv {
5452
struct mii_bus *bus;
5553
unsigned int port_base;
56-
struct dsa_loop_vlan vlans[DSA_LOOP_VLANS];
54+
struct dsa_loop_vlan vlans[VLAN_N_VID];
5755
struct net_device *netdev;
5856
struct dsa_loop_port ports[DSA_MAX_PORTS];
5957
};
@@ -191,7 +189,7 @@ dsa_loop_port_vlan_prepare(struct dsa_switch *ds, int port,
191189
/* Just do a sleeping operation to make lockdep checks effective */
192190
mdiobus_read(bus, ps->port_base + port, MII_BMSR);
193191

194-
if (vlan->vid_end > DSA_LOOP_VLANS)
192+
if (vlan->vid_end > ARRAY_SIZE(ps->vlans))
195193
return -ERANGE;
196194

197195
return 0;

0 commit comments

Comments
 (0)