net: phy: Allow mdio buses to auto-probe c45 devices
authorJeremy Linton <jeremy.linton@arm.com>
Mon, 22 Jun 2020 15:05:32 +0000 (20:35 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Jun 2020 03:35:15 +0000 (20:35 -0700)
commit0cc8fecf041d3e5285380da62cc6662bdc942d8c
tree6976c1fadad4d6bde98e126787916ad2c15cb058
parent1c59bb6bcbe88aff1527e8eae396d5d5a706e659
net: phy: Allow mdio buses to auto-probe c45 devices

The mdiobus_scan logic is currently hardcoded to only
work with c22 devices. This works fairly well in most
cases, but its possible that a c45 device doesn't respond
despite being a standard phy. If the parent hardware
is capable, it makes sense to scan for c22 devices before
falling back to c45.

As we want this to reflect the capabilities of the STA,
lets add a field to the mii_bus structure to represent
the capability. That way devices can opt into the extended
scanning. Existing users should continue to default to c22
only scanning as long as they are zero'ing the structure
before use.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mdio_bus.c
include/linux/phy.h