Skip to content

Commit a0b6b8c

Browse files
Arkadi Sharshevskydavem330
authored andcommitted
net: dsa: Remove support for vlan dump from DSA's drivers
This is done as a preparation before removing support for vlan dump from DSA core. The vlans are synced with the bridge and thus there is no need for special dump operation support. Signed-off-by: Arkadi Sharshevsky <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c9e2105 commit a0b6b8c

File tree

6 files changed

+0
-183
lines changed

6 files changed

+0
-183
lines changed

drivers/net/dsa/b53/b53_common.c

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,49 +1053,6 @@ int b53_vlan_del(struct dsa_switch *ds, int port,
10531053
}
10541054
EXPORT_SYMBOL(b53_vlan_del);
10551055

1056-
int b53_vlan_dump(struct dsa_switch *ds, int port,
1057-
struct switchdev_obj_port_vlan *vlan,
1058-
switchdev_obj_dump_cb_t *cb)
1059-
{
1060-
struct b53_device *dev = ds->priv;
1061-
u16 vid, vid_start = 0, pvid;
1062-
struct b53_vlan *vl;
1063-
int err = 0;
1064-
1065-
if (is5325(dev) || is5365(dev))
1066-
vid_start = 1;
1067-
1068-
b53_read16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(port), &pvid);
1069-
1070-
/* Use our software cache for dumps, since we do not have any HW
1071-
* operation returning only the used/valid VLANs
1072-
*/
1073-
for (vid = vid_start; vid < dev->num_vlans; vid++) {
1074-
vl = &dev->vlans[vid];
1075-
1076-
if (!vl->valid)
1077-
continue;
1078-
1079-
if (!(vl->members & BIT(port)))
1080-
continue;
1081-
1082-
vlan->vid_begin = vlan->vid_end = vid;
1083-
vlan->flags = 0;
1084-
1085-
if (vl->untag & BIT(port))
1086-
vlan->flags |= BRIDGE_VLAN_INFO_UNTAGGED;
1087-
if (pvid == vid)
1088-
vlan->flags |= BRIDGE_VLAN_INFO_PVID;
1089-
1090-
err = cb(&vlan->obj);
1091-
if (err)
1092-
break;
1093-
}
1094-
1095-
return err;
1096-
}
1097-
EXPORT_SYMBOL(b53_vlan_dump);
1098-
10991056
/* Address Resolution Logic routines */
11001057
static int b53_arl_op_wait(struct b53_device *dev)
11011058
{
@@ -1552,7 +1509,6 @@ static const struct dsa_switch_ops b53_switch_ops = {
15521509
.port_vlan_prepare = b53_vlan_prepare,
15531510
.port_vlan_add = b53_vlan_add,
15541511
.port_vlan_del = b53_vlan_del,
1555-
.port_vlan_dump = b53_vlan_dump,
15561512
.port_fdb_dump = b53_fdb_dump,
15571513
.port_fdb_add = b53_fdb_add,
15581514
.port_fdb_del = b53_fdb_del,

drivers/net/dsa/b53/b53_priv.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,6 @@ void b53_vlan_add(struct dsa_switch *ds, int port,
393393
struct switchdev_trans *trans);
394394
int b53_vlan_del(struct dsa_switch *ds, int port,
395395
const struct switchdev_obj_port_vlan *vlan);
396-
int b53_vlan_dump(struct dsa_switch *ds, int port,
397-
struct switchdev_obj_port_vlan *vlan,
398-
switchdev_obj_dump_cb_t *cb);
399396
int b53_fdb_add(struct dsa_switch *ds, int port,
400397
const unsigned char *addr, u16 vid);
401398
int b53_fdb_del(struct dsa_switch *ds, int port,

drivers/net/dsa/bcm_sf2.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,6 @@ static const struct dsa_switch_ops bcm_sf2_ops = {
10211021
.port_vlan_prepare = b53_vlan_prepare,
10221022
.port_vlan_add = b53_vlan_add,
10231023
.port_vlan_del = b53_vlan_del,
1024-
.port_vlan_dump = b53_vlan_dump,
10251024
.port_fdb_dump = b53_fdb_dump,
10261025
.port_fdb_add = b53_fdb_add,
10271026
.port_fdb_del = b53_fdb_del,

drivers/net/dsa/dsa_loop.c

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -257,43 +257,6 @@ static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port,
257257
return 0;
258258
}
259259

260-
static int dsa_loop_port_vlan_dump(struct dsa_switch *ds, int port,
261-
struct switchdev_obj_port_vlan *vlan,
262-
switchdev_obj_dump_cb_t *cb)
263-
{
264-
struct dsa_loop_priv *ps = ds->priv;
265-
struct mii_bus *bus = ps->bus;
266-
struct dsa_loop_vlan *vl;
267-
u16 vid, vid_start = 0;
268-
int err = 0;
269-
270-
dev_dbg(ds->dev, "%s\n", __func__);
271-
272-
/* Just do a sleeping operation to make lockdep checks effective */
273-
mdiobus_read(bus, ps->port_base + port, MII_BMSR);
274-
275-
for (vid = vid_start; vid < DSA_LOOP_VLANS; vid++) {
276-
vl = &ps->vlans[vid];
277-
278-
if (!(vl->members & BIT(port)))
279-
continue;
280-
281-
vlan->vid_begin = vlan->vid_end = vid;
282-
vlan->flags = 0;
283-
284-
if (vl->untagged & BIT(port))
285-
vlan->flags |= BRIDGE_VLAN_INFO_UNTAGGED;
286-
if (ps->pvid == vid)
287-
vlan->flags |= BRIDGE_VLAN_INFO_PVID;
288-
289-
err = cb(&vlan->obj);
290-
if (err)
291-
break;
292-
}
293-
294-
return err;
295-
}
296-
297260
static struct dsa_switch_ops dsa_loop_driver = {
298261
.get_tag_protocol = dsa_loop_get_protocol,
299262
.setup = dsa_loop_setup,
@@ -310,7 +273,6 @@ static struct dsa_switch_ops dsa_loop_driver = {
310273
.port_vlan_prepare = dsa_loop_port_vlan_prepare,
311274
.port_vlan_add = dsa_loop_port_vlan_add,
312275
.port_vlan_del = dsa_loop_port_vlan_del,
313-
.port_vlan_dump = dsa_loop_port_vlan_dump,
314276
};
315277

316278
static int dsa_loop_drv_probe(struct mdio_device *mdiodev)

drivers/net/dsa/microchip/ksz_common.c

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -638,46 +638,6 @@ static int ksz_port_vlan_del(struct dsa_switch *ds, int port,
638638
return 0;
639639
}
640640

641-
static int ksz_port_vlan_dump(struct dsa_switch *ds, int port,
642-
struct switchdev_obj_port_vlan *vlan,
643-
switchdev_obj_dump_cb_t *cb)
644-
{
645-
struct ksz_device *dev = ds->priv;
646-
u16 vid;
647-
u16 data;
648-
struct vlan_table *vlan_cache;
649-
int err = 0;
650-
651-
mutex_lock(&dev->vlan_mutex);
652-
653-
/* use dev->vlan_cache due to lack of searching valid vlan entry */
654-
for (vid = vlan->vid_begin; vid < dev->num_vlans; vid++) {
655-
vlan_cache = &dev->vlan_cache[vid];
656-
657-
if (!(vlan_cache->table[0] & VLAN_VALID))
658-
continue;
659-
660-
vlan->vid_begin = vid;
661-
vlan->vid_end = vid;
662-
vlan->flags = 0;
663-
if (vlan_cache->table[2] & BIT(port)) {
664-
if (vlan_cache->table[1] & BIT(port))
665-
vlan->flags |= BRIDGE_VLAN_INFO_UNTAGGED;
666-
ksz_pread16(dev, port, REG_PORT_DEFAULT_VID, &data);
667-
if (vid == (data & 0xFFFFF))
668-
vlan->flags |= BRIDGE_VLAN_INFO_PVID;
669-
670-
err = cb(&vlan->obj);
671-
if (err)
672-
break;
673-
}
674-
}
675-
676-
mutex_unlock(&dev->vlan_mutex);
677-
678-
return err;
679-
}
680-
681641
struct alu_struct {
682642
/* entry 1 */
683643
u8 is_static:1;
@@ -1124,7 +1084,6 @@ static const struct dsa_switch_ops ksz_switch_ops = {
11241084
.port_vlan_prepare = ksz_port_vlan_prepare,
11251085
.port_vlan_add = ksz_port_vlan_add,
11261086
.port_vlan_del = ksz_port_vlan_del,
1127-
.port_vlan_dump = ksz_port_vlan_dump,
11281087
.port_fdb_dump = ksz_port_fdb_dump,
11291088
.port_fdb_add = ksz_port_fdb_add,
11301089
.port_fdb_del = ksz_port_fdb_del,

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,61 +1011,6 @@ static int mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip,
10111011
return chip->info->ops->vtu_loadpurge(chip, entry);
10121012
}
10131013

1014-
static int mv88e6xxx_port_vlan_dump(struct dsa_switch *ds, int port,
1015-
struct switchdev_obj_port_vlan *vlan,
1016-
switchdev_obj_dump_cb_t *cb)
1017-
{
1018-
struct mv88e6xxx_chip *chip = ds->priv;
1019-
struct mv88e6xxx_vtu_entry next = {
1020-
.vid = chip->info->max_vid,
1021-
};
1022-
u16 pvid;
1023-
int err;
1024-
1025-
if (!chip->info->max_vid)
1026-
return -EOPNOTSUPP;
1027-
1028-
mutex_lock(&chip->reg_lock);
1029-
1030-
err = mv88e6xxx_port_get_pvid(chip, port, &pvid);
1031-
if (err)
1032-
goto unlock;
1033-
1034-
do {
1035-
err = mv88e6xxx_vtu_getnext(chip, &next);
1036-
if (err)
1037-
break;
1038-
1039-
if (!next.valid)
1040-
break;
1041-
1042-
if (next.member[port] ==
1043-
MV88E6XXX_G1_VTU_DATA_MEMBER_TAG_NON_MEMBER)
1044-
continue;
1045-
1046-
/* reinit and dump this VLAN obj */
1047-
vlan->vid_begin = next.vid;
1048-
vlan->vid_end = next.vid;
1049-
vlan->flags = 0;
1050-
1051-
if (next.member[port] ==
1052-
MV88E6XXX_G1_VTU_DATA_MEMBER_TAG_UNTAGGED)
1053-
vlan->flags |= BRIDGE_VLAN_INFO_UNTAGGED;
1054-
1055-
if (next.vid == pvid)
1056-
vlan->flags |= BRIDGE_VLAN_INFO_PVID;
1057-
1058-
err = cb(&vlan->obj);
1059-
if (err)
1060-
break;
1061-
} while (next.vid < chip->info->max_vid);
1062-
1063-
unlock:
1064-
mutex_unlock(&chip->reg_lock);
1065-
1066-
return err;
1067-
}
1068-
10691014
static int mv88e6xxx_atu_new(struct mv88e6xxx_chip *chip, u16 *fid)
10701015
{
10711016
DECLARE_BITMAP(fid_bitmap, MV88E6XXX_N_FID);
@@ -3896,7 +3841,6 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
38963841
.port_vlan_prepare = mv88e6xxx_port_vlan_prepare,
38973842
.port_vlan_add = mv88e6xxx_port_vlan_add,
38983843
.port_vlan_del = mv88e6xxx_port_vlan_del,
3899-
.port_vlan_dump = mv88e6xxx_port_vlan_dump,
39003844
.port_fdb_add = mv88e6xxx_port_fdb_add,
39013845
.port_fdb_del = mv88e6xxx_port_fdb_del,
39023846
.port_fdb_dump = mv88e6xxx_port_fdb_dump,

0 commit comments

Comments
 (0)