net: dsa: rtl8366rb: Support setting STP state
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 5 Oct 2021 19:47:04 +0000 (21:47 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Oct 2021 14:08:12 +0000 (15:08 +0100)
commite674cfd08537f2692a7d06dcbe4633b07819c92a
tree70fcf03892581489078289a0f75298c7bb193aa5
parent1fbd19e10b735106fb91d4cb07095bc986a513aa
net: dsa: rtl8366rb: Support setting STP state

This adds support for setting the STP state to the RTL8366RB
DSA switch. This rids the following message from the kernel on
e.g. OpenWrt:

DSA: failed to set STP state 3 (-95)

Since the RTL8366RB has one STP state register per FID with
two bit per port in each, we simply loop over all the FIDs
and set the state on all of them.

Cc: Vladimir Oltean <olteanv@gmail.com>
Cc: Alvin Šipraga <alsi@bang-olufsen.dk>
Cc: Mauri Sandberg <sandberg@mailfence.com>
Cc: DENG Qingfang <dqfext@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/rtl8366rb.c