|
@@ -528,6 +528,30 @@ int phy_register(struct phy_driver *drv)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int phy_set_supported(struct phy_device *phydev, u32 max_speed)
|
|
|
+{
|
|
|
+ /* The default values for phydev->supported are provided by the PHY
|
|
|
+ * driver "features" member, we want to reset to sane defaults first
|
|
|
+ * before supporting higher speeds.
|
|
|
+ */
|
|
|
+ phydev->supported &= PHY_DEFAULT_FEATURES;
|
|
|
+
|
|
|
+ switch (max_speed) {
|
|
|
+ default:
|
|
|
+ return -ENOTSUPP;
|
|
|
+ case SPEED_1000:
|
|
|
+ phydev->supported |= PHY_1000BT_FEATURES;
|
|
|
+ /* fall through */
|
|
|
+ case SPEED_100:
|
|
|
+ phydev->supported |= PHY_100BT_FEATURES;
|
|
|
+ /* fall through */
|
|
|
+ case SPEED_10:
|
|
|
+ phydev->supported |= PHY_10BT_FEATURES;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static int phy_probe(struct phy_device *phydev)
|
|
|
{
|
|
|
int err = 0;
|