Skip to content

Commit

Permalink
phy: fixed_phy: Set supported speed in phydev
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Lunn authored and David S. Miller committed Aug 31, 2015
1 parent dea8702 commit 34b31da
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/net/phy/fixed_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 34b31da

Please sign in to comment.