diff options
Diffstat (limited to 'net/wireless/sysfs.c')
| -rw-r--r-- | net/wireless/sysfs.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c index efe3c5c92b2d..9f2cef3e0ca0 100644 --- a/net/wireless/sysfs.c +++ b/net/wireless/sysfs.c | |||
| @@ -33,10 +33,30 @@ static ssize_t name ## _show(struct device *dev, \ | |||
| 33 | 33 | ||
| 34 | SHOW_FMT(index, "%d", wiphy_idx); | 34 | SHOW_FMT(index, "%d", wiphy_idx); |
| 35 | SHOW_FMT(macaddress, "%pM", wiphy.perm_addr); | 35 | SHOW_FMT(macaddress, "%pM", wiphy.perm_addr); |
| 36 | SHOW_FMT(address_mask, "%pM", wiphy.addr_mask); | ||
| 37 | |||
| 38 | static ssize_t addresses_show(struct device *dev, | ||
| 39 | struct device_attribute *attr, | ||
| 40 | char *buf) | ||
| 41 | { | ||
| 42 | struct wiphy *wiphy = &dev_to_rdev(dev)->wiphy; | ||
| 43 | char *start = buf; | ||
| 44 | int i; | ||
| 45 | |||
| 46 | if (!wiphy->addresses) | ||
| 47 | return sprintf(buf, "%pM\n", wiphy->perm_addr); | ||
| 48 | |||
| 49 | for (i = 0; i < wiphy->n_addresses; i++) | ||
| 50 | buf += sprintf(buf, "%pM\n", &wiphy->addresses[i].addr); | ||
| 51 | |||
| 52 | return buf - start; | ||
| 53 | } | ||
| 36 | 54 | ||
| 37 | static struct device_attribute ieee80211_dev_attrs[] = { | 55 | static struct device_attribute ieee80211_dev_attrs[] = { |
| 38 | __ATTR_RO(index), | 56 | __ATTR_RO(index), |
| 39 | __ATTR_RO(macaddress), | 57 | __ATTR_RO(macaddress), |
| 58 | __ATTR_RO(address_mask), | ||
| 59 | __ATTR_RO(addresses), | ||
| 40 | {} | 60 | {} |
| 41 | }; | 61 | }; |
| 42 | 62 | ||
