aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2022-03-21 15:51:53 -0700
committerJakub Kicinski <[email protected]>2022-03-21 15:51:53 -0700
commit7ee776cdc7a0b87b766f4cace50c36fe405922cf (patch)
tree6f366e3ad1cb35f2218f7527630b60591579fec1
parente0c0ca3546adf6aaa9ba7c7232bd3b1792f3153b (diff)
parentbd48b911c88f017a97b1943201d23d6962968d1a (diff)
Merge branch 'net-dsa-mv88e6xxx-mst-fixes'
Tobias Waldekranz says: ==================== net: dsa: mv88e6xxx: MST Fixes 1/2 fixes the issue reported by Marek here: https://lore.kernel.org/netdev/20220318182817.5ade8ecd@dellmb/ 2/2 adds a missing capability check to the new .vlan_msti_set callback. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c3
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index b36393ba6d49..afb9417ffca0 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2678,6 +2678,9 @@ static int mv88e6xxx_vlan_msti_set(struct dsa_switch *ds,
u8 old_sid, new_sid;
int err;
+ if (!mv88e6xxx_has_stu(chip))
+ return -EOPNOTSUPP;
+
mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_vtu_get(chip, msti->vid, &vlan);
diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h
index 6a0b66354e1d..5e03cfe50156 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.h
+++ b/drivers/net/dsa/mv88e6xxx/chip.h
@@ -730,7 +730,9 @@ struct mv88e6xxx_hw_stat {
static inline bool mv88e6xxx_has_stu(struct mv88e6xxx_chip *chip)
{
- return chip->info->max_sid > 0;
+ return chip->info->max_sid > 0 &&
+ chip->info->ops->stu_loadpurge &&
+ chip->info->ops->stu_getnext;
}
static inline bool mv88e6xxx_has_pvt(struct mv88e6xxx_chip *chip)