Simply having a physical STU table in the device doesn't do us any
good if there's no implementation of the relevant ops to access that
table. So ensure that chips that claim STU support can also talk to
the hardware.
This fixes an issue where chips that had a their ->info->max_sid
set (due to their family membership), but no implementation (due to
their chip-specific ops struct) would fail to probe.
Fixes: 4c7969625cdc ("net: dsa: mv88e6xxx: Disentangle STU from VTU")
Reported-by: Marek BehĂșn <kabel@kernel.org>
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Marek BehĂșn <kabel@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
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)