Re: [PATCH net-next 3/3 v5] net: dsa: rtl8366rb: Support setting STP state
From: Vladimir Oltean <olteanv@gmail.com>
Date: 2021-10-06 10:17:27
From: Vladimir Oltean <olteanv@gmail.com>
Date: 2021-10-06 10:17:27
On Tue, Oct 05, 2021 at 09:47:04PM +0200, Linus Walleij wrote:
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 <redacted> Cc: DENG Qingfang <dqfext@gmail.com> Signed-off-by: Linus Walleij <redacted> --- ChangeLog v4->v5: - Rename register from RTL8368S* to RTL8366RB as all other registers. (RTL8368S is some similar ASIC maybe the same.) - Rename registers from "SPT" to "STP", we assume this is just a typo in the vendor tree. - Create RTL8366RB_STP_STATE_MASK() and RTL8366RB_STP_STATE() macros and use these. ChangeLog v1->v4: - New patch after discovering that we can do really nice bridge offloading with these bits. ---
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>