Skip to content

Commit 477b184

Browse files
viviendavem330
authored andcommitted
net: dsa: drop vlan_getnext
The VLAN GetNext operation is specific to some switches, and thus can be complicated to implement for some drivers. Remove the support for the vlan_getnext/port_pvid_get approach in favor of the generic and simpler port_vlan_dump function. Signed-off-by: Vivien Didelot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ceff5ef commit 477b184

File tree

3 files changed

+1
-46
lines changed

3 files changed

+1
-46
lines changed

Documentation/networking/dsa/dsa.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -542,12 +542,6 @@ Bridge layer
542542
Bridge VLAN filtering
543543
---------------------
544544

545-
- port_pvid_get: bridge layer function invoked when a Port-based VLAN ID is
546-
queried for the given switch port
547-
548-
- port_pvid_set: bridge layer function invoked when a Port-based VLAN ID needs
549-
to be configured on the given switch port
550-
551545
- port_vlan_add: bridge layer function invoked when a VLAN is configured
552546
(tagged or untagged) for the given switch port
553547

@@ -558,9 +552,6 @@ Bridge VLAN filtering
558552
function that the driver has to call for each VLAN the given port is a member
559553
of. A switchdev object is used to carry the VID and bridge flags.
560554

561-
- vlan_getnext: bridge layer function invoked to query the next configured VLAN
562-
in the switch, i.e. returns the bitmaps of members and untagged ports
563-
564555
- port_fdb_add: bridge layer function invoked when the bridge wants to install a
565556
Forwarding Database entry, the switch hardware should be programmed with the
566557
specified address in the specified VLAN Id in the forwarding database

include/net/dsa.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,6 @@ struct dsa_switch_driver {
316316
int (*port_vlan_dump)(struct dsa_switch *ds, int port,
317317
struct switchdev_obj_port_vlan *vlan,
318318
int (*cb)(struct switchdev_obj *obj));
319-
int (*port_pvid_get)(struct dsa_switch *ds, int port, u16 *pvid);
320-
int (*vlan_getnext)(struct dsa_switch *ds, u16 *vid,
321-
unsigned long *ports, unsigned long *untagged);
322319

323320
/*
324321
* Forwarding database

net/dsa/slave.c

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -243,44 +243,11 @@ static int dsa_slave_port_vlan_dump(struct net_device *dev,
243243
{
244244
struct dsa_slave_priv *p = netdev_priv(dev);
245245
struct dsa_switch *ds = p->parent;
246-
DECLARE_BITMAP(members, DSA_MAX_PORTS);
247-
DECLARE_BITMAP(untagged, DSA_MAX_PORTS);
248-
u16 pvid, vid = 0;
249-
int err;
250246

251247
if (ds->drv->port_vlan_dump)
252248
return ds->drv->port_vlan_dump(ds, p->port, vlan, cb);
253249

254-
if (!ds->drv->vlan_getnext || !ds->drv->port_pvid_get)
255-
return -EOPNOTSUPP;
256-
257-
err = ds->drv->port_pvid_get(ds, p->port, &pvid);
258-
if (err)
259-
return err;
260-
261-
for (;;) {
262-
err = ds->drv->vlan_getnext(ds, &vid, members, untagged);
263-
if (err)
264-
break;
265-
266-
if (!test_bit(p->port, members))
267-
continue;
268-
269-
memset(vlan, 0, sizeof(*vlan));
270-
vlan->vid_begin = vlan->vid_end = vid;
271-
272-
if (vid == pvid)
273-
vlan->flags |= BRIDGE_VLAN_INFO_PVID;
274-
275-
if (test_bit(p->port, untagged))
276-
vlan->flags |= BRIDGE_VLAN_INFO_UNTAGGED;
277-
278-
err = cb(&vlan->obj);
279-
if (err)
280-
break;
281-
}
282-
283-
return err == -ENOENT ? 0 : err;
250+
return -EOPNOTSUPP;
284251
}
285252

286253
static int dsa_slave_port_fdb_add(struct net_device *dev,

0 commit comments

Comments
 (0)