diff options
author | Andrew Lunn <andrew@lunn.ch> | 2015-08-31 09:56:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-31 17:48:02 -0400 |
commit | 34b31da486a5e4eda9ff548ebf6dc3adc167bd0c (patch) | |
tree | 0394017fa6fc48d665452780ba481d74108ccf10 | |
parent | dea870242a9c4ea74b3ca0f2da3f864c47484cff (diff) |
phy: fixed_phy: Set supported speed in phydev
Set the supported field of the phydev to indicate the speed features
of the phy. If the phy is never attached to a netdev, but used in an
adjust_link() function, the speed will be incorrectly evaluated to
10/half rather than the correct speed/duplex.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/phy/fixed_phy.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c index ce46428ff21f..2f9457f05a2e 100644 --- a/drivers/net/phy/fixed_phy.c +++ b/drivers/net/phy/fixed_phy.c | |||
@@ -305,6 +305,18 @@ struct phy_device *fixed_phy_register(unsigned int irq, | |||
305 | phy->dev.of_node = np; | 305 | phy->dev.of_node = np; |
306 | phy->is_pseudo_fixed_link = true; | 306 | phy->is_pseudo_fixed_link = true; |
307 | 307 | ||
308 | switch (status->speed) { | ||
309 | case SPEED_1000: | ||
310 | phy->supported = PHY_1000BT_FEATURES; | ||
311 | break; | ||
312 | case SPEED_100: | ||
313 | phy->supported = PHY_100BT_FEATURES; | ||
314 | break; | ||
315 | case SPEED_10: | ||
316 | default: | ||
317 | phy->supported = PHY_10BT_FEATURES; | ||
318 | } | ||
319 | |||
308 | ret = phy_device_register(phy); | 320 | ret = phy_device_register(phy); |
309 | if (ret) { | 321 | if (ret) { |
310 | phy_device_free(phy); | 322 | phy_device_free(phy); |