Skip to content

Commit

Permalink
Merge branch 'net-dsa-mv88e6xxx-mst-fixes'
Browse files Browse the repository at this point in the history
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/20220318201321.4010543-1-tobias@waldekranz.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Mar 21, 2022
2 parents e0c0ca3 + bd48b91 commit 7ee776c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions drivers/net/dsa/mv88e6xxx/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/dsa/mv88e6xxx/chip.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7ee776c

Please sign in to comment.