net: phylink: use supported_interfaces for phylink validation
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 26 Oct 2021 10:06:11 +0000 (11:06 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Oct 2021 14:10:36 +0000 (15:10 +0100)
commitd25f3a74f30aace819163dfa54f2a4b8ca1dc932
tree65da141e422565b05e2ee8710cf602bfb42cf1a8
parent38c310eb46f5f80213a92093af11af270c209a76
net: phylink: use supported_interfaces for phylink validation

If the network device supplies a supported interface bitmap, we can use
that during phylink's validation to simplify MAC drivers in two ways by
using the supported_interfaces bitmap to:

1. reject unsupported interfaces before calling into the MAC driver.
2. generate the set of all supported link modes across all supported
   interfaces (used mainly for SFP, but also some 10G PHYs.)

Suggested-by: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phylink.c
include/linux/phylink.h