xgmii, moca, qsgmii, trgmii, 1000base-x, 2500base-x, rxaui,
                xaui, 10gbase-kr, unknown
 
+What:          /sys/class/mdio_bus/<bus>/<device>/phy_standalone
+Date:          May 2019
+KernelVersion: 5.3
+Contact:       netdev@vger.kernel.org
+Description:
+               Boolean value indicating whether the PHY device is used in
+               standalone mode, without a net_device associated, by PHYLINK.
+               Attribute created only when this is the case.
 
        phydev->sysfs_links = true;
 }
 
+static ssize_t
+phy_standalone_show(struct device *dev, struct device_attribute *attr,
+                   char *buf)
+{
+       struct phy_device *phydev = to_phy_device(dev);
+
+       return sprintf(buf, "%d\n", !phydev->attached_dev);
+}
+static DEVICE_ATTR_RO(phy_standalone);
+
 /**
  * phy_attach_direct - attach a network device to a given PHY device pointer
  * @dev: network device to attach
 
        phy_sysfs_create_links(phydev);
 
+       if (!phydev->attached_dev) {
+               err = sysfs_create_file(&phydev->mdio.dev.kobj,
+                                       &dev_attr_phy_standalone.attr);
+               if (err)
+                       phydev_err(phydev, "error creating 'phy_standalone' sysfs entry\n");
+       }
+
        phydev->dev_flags = flags;
 
        phydev->interface = interface;
                        sysfs_remove_link(&dev->dev.kobj, "phydev");
                sysfs_remove_link(&phydev->mdio.dev.kobj, "attached_dev");
        }
+
+       if (!phydev->attached_dev)
+               sysfs_remove_file(&phydev->mdio.dev.kobj,
+                                 &dev_attr_phy_standalone.attr);
+
        phy_suspend(phydev);
        if (dev) {
                phydev->attached_dev->phydev = NULL;