net: dsa: realtek: add phylink_get_caps implementation
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Sat, 19 Aug 2023 11:11:06 +0000 (12:11 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 20 Aug 2023 10:38:43 +0000 (11:38 +0100)
commitb22eef6864caadd2199e3db0be7235c176a04f89
tree59ed78b7600ee18d839dfd0f26ba00ffc501bc3f
parent85c786340a65eb059183a5c3c6fab8664e1f6e8a
net: dsa: realtek: add phylink_get_caps implementation

The user ports use RSGMII, but we don't have that, and DT doesn't
specify a phy interface mode, so phylib defaults to GMII. These support
1G, 100M and 10M with flow control. It is unknown whether asymetric
pause is supported at all speeds.

The CPU port uses MII/GMII/RGMII/REVMII by hardware pin strapping,
and support speeds specific to each, with full duplex only supported
in some modes. Flow control may be supported again by hardware pin
strapping, and theoretically is readable through a register but no
information is given in the datasheet for that.

So, we do a best efforts - and be lenient.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/realtek/rtl8366rb.c