]> git.itanic.dy.fi Git - linux-stable/commit
net: phylink: reimplement population of pl->supported for in-band
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 13 Dec 2023 15:51:42 +0000 (17:51 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Dec 2023 01:00:53 +0000 (01:00 +0000)
commit37a8997fc5a5a6ffc60b197d048a9351d1043efd
tree922cbd19da957017d7f7bba8f12aa3f54e657ce3
parent358105ab92fc588aee0f37402f5705b031dc6f6f
net: phylink: reimplement population of pl->supported for in-band

phylink_parse_mode() populates all possible supported link modes for a
given phy_interface_t, for the case where a phylib phy may be absent and
we can't retrieve the supported link modes from that.

Russell points out that since the introduction of the generic validation
helpers phylink_get_capabilities() and phylink_caps_to_linkmodes(), we
can rewrite this procedure to populate the pl->supported mask, so that
instead of spelling out the link modes, we derive an intermediary
mac_capabilities bit field, and we convert that to the equivalent link
modes.

Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phylink.c