summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/fixed_phy.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2015-08-31 15:56:48 +0200
committerDavid S. Miller <davem@davemloft.net>2015-08-31 23:48:02 +0200
commit34b31da486a5e4eda9ff548ebf6dc3adc167bd0c (patch)
tree0394017fa6fc48d665452780ba481d74108ccf10 /drivers/net/phy/fixed_phy.c
parentdsa: mv88e6xxx: Allow speed/duplex of port to be configured (diff)
downloadlinux-34b31da486a5e4eda9ff548ebf6dc3adc167bd0c.tar.xz
linux-34b31da486a5e4eda9ff548ebf6dc3adc167bd0c.zip
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>
Diffstat (limited to 'drivers/net/phy/fixed_phy.c')
-rw-r--r--drivers/net/phy/fixed_phy.c12
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,
phy->dev.of_node = np;
phy->is_pseudo_fixed_link = true;
+ switch (status->speed) {
+ case SPEED_1000:
+ phy->supported = PHY_1000BT_FEATURES;
+ break;
+ case SPEED_100:
+ phy->supported = PHY_100BT_FEATURES;
+ break;
+ case SPEED_10:
+ default:
+ phy->supported = PHY_10BT_FEATURES;
+ }
+
ret = phy_device_register(phy);
if (ret) {
phy_device_free(phy);