aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154
diff options
context:
space:
mode:
Diffstat (limited to 'net/ieee802154')
-rw-r--r--net/ieee802154/wpan-class.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/net/ieee802154/wpan-class.c b/net/ieee802154/wpan-class.c
index 68ccde63155b..0c51f85aa591 100644
--- a/net/ieee802154/wpan-class.c
+++ b/net/ieee802154/wpan-class.c
@@ -40,12 +40,30 @@ static ssize_t name ## _show(struct device *dev, \
40 40
41MASTER_SHOW(current_channel, "%d"); 41MASTER_SHOW(current_channel, "%d");
42MASTER_SHOW(current_page, "%d"); 42MASTER_SHOW(current_page, "%d");
43MASTER_SHOW(channels_supported, "%#x");
44MASTER_SHOW_COMPLEX(transmit_power, "%d +- %d dB", 43MASTER_SHOW_COMPLEX(transmit_power, "%d +- %d dB",
45 ((signed char) (phy->transmit_power << 2)) >> 2, 44 ((signed char) (phy->transmit_power << 2)) >> 2,
46 (phy->transmit_power >> 6) ? (phy->transmit_power >> 6) * 3 : 1 ); 45 (phy->transmit_power >> 6) ? (phy->transmit_power >> 6) * 3 : 1 );
47MASTER_SHOW(cca_mode, "%d"); 46MASTER_SHOW(cca_mode, "%d");
48 47
48static ssize_t channels_supported_show(struct device *dev,
49 struct device_attribute *attr, char *buf)
50{
51 struct wpan_phy *phy = container_of(dev, struct wpan_phy, dev);
52 int ret;
53 int i, len = 0;
54
55 mutex_lock(&phy->pib_lock);
56 for (i = 0; i < 32; i++) {
57 ret = snprintf(buf + len, PAGE_SIZE - len,
58 "%#09x\n", phy->channels_supported[i]);
59 if (ret < 0)
60 break;
61 len += ret;
62 }
63 mutex_unlock(&phy->pib_lock);
64 return len;
65}
66
49static struct device_attribute pmib_attrs[] = { 67static struct device_attribute pmib_attrs[] = {
50 __ATTR_RO(current_channel), 68 __ATTR_RO(current_channel),
51 __ATTR_RO(current_page), 69 __ATTR_RO(current_page),