net: phylink: delay MAC configuration for copper SFP modules
authorRussell King <rmk+kernel@armlinux.org.uk>
Wed, 11 Dec 2019 10:56:45 +0000 (10:56 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Dec 2019 19:53:41 +0000 (11:53 -0800)
commit52c956003a9d5bcae1f445f9dfd42b624adb6e87
treee5839ba1ae0b1a3403aa4440b0589665120e19f7
parentc0de2f47202941d936f0482ccd5b010b642a0008
net: phylink: delay MAC configuration for copper SFP modules

Knowing whether we need to delay the MAC configuration because a module
may have a PHY is useful to phylink to allow NBASE-T modules to work on
systems supporting no more than 2.5G speeds.

This commit allows us to delay such configuration until after the PHY
has been probed by recording the parsed capabilities, and if the module
may have a PHY, doing no more until the module_start() notification is
called.  At that point, we either have a PHY, or we don't.

We move the PHY-based setup a little later, and use the PHYs support
capabilities rather than the EEPROM parsed capabilities to determine
whether we can support the PHY.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phylink.c
drivers/net/phy/sfp-bus.c
include/linux/sfp.h