summaryrefslogtreecommitdiff
path: root/net/ieee802154/sysfs.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2014-11-18 15:13:26 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-11-18 15:13:26 -0500
commitf48ecb19bc0443a4272dd0934e7bee4480610df9 (patch)
treeeb29c8f7491e0fbf93e0c722a4b3feb575fc93c3 /net/ieee802154/sysfs.c
parent47b6308b643302e642ca2a5cb6470926f7e1c428 (diff)
parenta86c02ea38c53b695209b1181f9e2e18d73eb4e8 (diff)
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Johan Hedberg <johan.hedberg@gmail.com> says: "Here's another bluetooth-next pull request for 3.19. We've got: - Various fixes, cleanups and improvements to ieee802154/mac802154 - Support for a Broadcom BCM20702A1 variant - Lots of lockdep fixes - Fixed handling of LE CoC errors that should trigger SMP" Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/ieee802154/sysfs.c')
-rw-r--r--net/ieee802154/sysfs.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/net/ieee802154/sysfs.c b/net/ieee802154/sysfs.c
index 88199980dae9..1613b9c65dfa 100644
--- a/net/ieee802154/sysfs.c
+++ b/net/ieee802154/sysfs.c
@@ -27,6 +27,27 @@ dev_to_rdev(struct device *dev)
wpan_phy.dev);
}
+#define SHOW_FMT(name, fmt, member) \
+static ssize_t name ## _show(struct device *dev, \
+ struct device_attribute *attr, \
+ char *buf) \
+{ \
+ return sprintf(buf, fmt "\n", dev_to_rdev(dev)->member); \
+} \
+static DEVICE_ATTR_RO(name)
+
+SHOW_FMT(index, "%d", wpan_phy_idx);
+
+static ssize_t name_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct wpan_phy *wpan_phy = &dev_to_rdev(dev)->wpan_phy;
+
+ return sprintf(buf, "%s\n", dev_name(&wpan_phy->dev));
+}
+static DEVICE_ATTR_RO(name);
+
#define MASTER_SHOW_COMPLEX(name, format_string, args...) \
static ssize_t name ## _show(struct device *dev, \
struct device_attribute *attr, char *buf) \
@@ -78,6 +99,9 @@ static void wpan_phy_release(struct device *dev)
}
static struct attribute *pmib_attrs[] = {
+ &dev_attr_index.attr,
+ &dev_attr_name.attr,
+ /* below will be removed soon */
&dev_attr_current_channel.attr,
&dev_attr_current_page.attr,
&dev_attr_channels_supported.attr,