aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-02-11 20:27:42 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-12 19:08:49 -0500
commit8bed1285b98e6a90403cdfe0500e8ad6bd8e8f1c (patch)
tree05000e0153853964af653ad5ed566a669a9a8681
parentb0ae009f3dc14643e56972cfc08c060dd72cc24d (diff)
net: phy: expose phydev->has_fixups to sysfs
Expose the PHY device has_fixups boolean as a sysfs property to help troubleshooting PHY configurations. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--Documentation/ABI/testing/sysfs-bus-mdio10
-rw-r--r--drivers/net/phy/mdio_bus.c10
2 files changed, 20 insertions, 0 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-mdio b/Documentation/ABI/testing/sysfs-bus-mdio
index 2133afd0b067..491baaf4285f 100644
--- a/Documentation/ABI/testing/sysfs-bus-mdio
+++ b/Documentation/ABI/testing/sysfs-bus-mdio
@@ -17,3 +17,13 @@ Description:
17 Ethernet driver during bus enumeration, encoded in string. 17 Ethernet driver during bus enumeration, encoded in string.
18 This interface mode is used to configure the Ethernet MAC with the 18 This interface mode is used to configure the Ethernet MAC with the
19 appropriate mode for its data lines to the PHY hardware. 19 appropriate mode for its data lines to the PHY hardware.
20
21What: /sys/bus/mdio_bus/devices/.../phy_has_fixups
22Date: February 2014
23KernelVersion: 3.15
24Contact: netdev@vger.kernel.org
25Description:
26 This attribute contains the boolean value whether a given PHY
27 device has had any "fixup" workaround running on it, encoded as
28 a boolean. This information is provided to help troubleshooting
29 PHY configurations.
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 7c66ea095a46..76f54b32a120 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -441,9 +441,19 @@ phy_interface_show(struct device *dev, struct device_attribute *attr, char *buf)
441} 441}
442static DEVICE_ATTR_RO(phy_interface); 442static DEVICE_ATTR_RO(phy_interface);
443 443
444static ssize_t
445phy_has_fixups_show(struct device *dev, struct device_attribute *attr, char *buf)
446{
447 struct phy_device *phydev = to_phy_device(dev);
448
449 return sprintf(buf, "%d\n", phydev->has_fixups);
450}
451static DEVICE_ATTR_RO(phy_has_fixups);
452
444static struct attribute *mdio_dev_attrs[] = { 453static struct attribute *mdio_dev_attrs[] = {
445 &dev_attr_phy_id.attr, 454 &dev_attr_phy_id.attr,
446 &dev_attr_phy_interface.attr, 455 &dev_attr_phy_interface.attr,
456 &dev_attr_phy_has_fixups.attr,
447 NULL, 457 NULL,
448}; 458};
449ATTRIBUTE_GROUPS(mdio_dev); 459ATTRIBUTE_GROUPS(mdio_dev);