summaryrefslogtreecommitdiff
path: root/drivers/net/phy/mdio_bus.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-02-12 05:27:40 +0400
committerDavid S. Miller <davem@davemloft.net>2014-02-13 04:08:20 +0400
commit3d055d8d1c24093bdd40e000570a59b841c2bb0b (patch)
tree01abab57957e897a2cd4f539db4c05ae96f8cd7c /drivers/net/phy/mdio_bus.c
parent8a2fe56e8827f2b1eb1766702f0215074dd2767e (diff)
downloadlinux-3d055d8d1c24093bdd40e000570a59b841c2bb0b.tar.xz
net: phy: expose PHY device interface mode
Expose the PHY device interface mode through sysfs since this is an useful piece of information for knowing how the attached networking device will have configured its transmit/receive path. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/mdio_bus.c')
-rw-r--r--drivers/net/phy/mdio_bus.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 71e49000fbf3..7c66ea095a46 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -432,8 +432,18 @@ phy_id_show(struct device *dev, struct device_attribute *attr, char *buf)
}
static DEVICE_ATTR_RO(phy_id);
+static ssize_t
+phy_interface_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ struct phy_device *phydev = to_phy_device(dev);
+
+ return sprintf(buf, "%s\n", phy_modes(phydev->interface));
+}
+static DEVICE_ATTR_RO(phy_interface);
+
static struct attribute *mdio_dev_attrs[] = {
&dev_attr_phy_id.attr,
+ &dev_attr_phy_interface.attr,
NULL,
};
ATTRIBUTE_GROUPS(mdio_dev);