Re: [PATCH net-next v4 07/11] net: dsa: realtek: rtl8365mb: rename extport to extint, add "realtek,ext-int"

Alvin Šipraga
2022-01-10T13:15:49Z

Luiz Angelo Daros de Luca <luizluca@gmail.com> writes:

> "extport" 0, 1, 2 was used to reference external ports (ext0,
> ext1, ext2). Meanwhile, port 0..9 is used as switch ports,
> including external ports. "extport" was renamed to extint to
> make it clear it does not mean the port number but the external
> interface number.
>
> The macros that map extint numbers to registers addresses now
> use inline ifs instead of binary arithmetic.
>
> "extint" was hardcoded to 1. However, some chips have multiple
> external interfaces. It's not right to assume the CPU port uses
> extint 1 nor that all extint are CPU ports. Now the association
> between the port and the external interface can be defined with
> a device-tree port property "realtek,ext-int".
>
> This patch still does not allow multiple CPU ports nor extint
> as a non CPU port.
>
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
> Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>

Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk>

> ---
> drivers/net/dsa/realtek/rtl8365mb.c | 135 ++++++++++++++++++----------
> 1 file changed, 88 insertions(+), 47 deletions(-)