History

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.

Jeremy Linton committed 6 years ago

Commit 0cc8fec1 parent 1c59bb62 files · +24 −2Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/phy.h+8−0
@@ -298,6 +298,14 @@ struct mii_bus { · 297 unmodified lines
298298 /* RESET GPIO descriptor pointer */
299299 struct gpio_desc *reset_gpiod;
300300
301+ /* bus capabilities, used for probing */
302+ enum {
303+ MDIOBUS_NO_CAP = 0,
304+ MDIOBUS_C22,
305+ MDIOBUS_C45,
306+ MDIOBUS_C22_C45,
307+ } probe_capabilities;
308+
301309 /* protect access to the shared element */
302310 struct mutex shared_lock;
303311

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t