diff options
author | Ben Greear <greearb@candelatech.com> | 2010-10-11 13:28:59 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-10-12 16:05:29 -0400 |
commit | cfd8e12f42746df396ecbdf7a1d8e92e8e4dbb97 (patch) | |
tree | 3f393fd50bd7eac0f9bf2d08cc8ce1f059446cde /net/wireless/sysfs.c | |
parent | 5807bae7eda2d6da673c9f9f52460c3fbcea556c (diff) |
wireless: Print wiphy name in sysfs.
The index cannot be used to reliably reconstruct a phy
name, so explicitly add the phy name to sysfs so that scripts
can figure out the parent phy device for a particular
wireless interface.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/sysfs.c')
-rw-r--r-- | net/wireless/sysfs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c index 74a9e3cce452..4294fa22bb2d 100644 --- a/net/wireless/sysfs.c +++ b/net/wireless/sysfs.c | |||
@@ -35,6 +35,14 @@ 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); | 36 | SHOW_FMT(address_mask, "%pM", wiphy.addr_mask); |
37 | 37 | ||
38 | static ssize_t name_show(struct device *dev, | ||
39 | struct device_attribute *attr, | ||
40 | char *buf) { | ||
41 | struct wiphy *wiphy = &dev_to_rdev(dev)->wiphy; | ||
42 | return sprintf(buf, "%s\n", dev_name(&wiphy->dev)); | ||
43 | } | ||
44 | |||
45 | |||
38 | static ssize_t addresses_show(struct device *dev, | 46 | static ssize_t addresses_show(struct device *dev, |
39 | struct device_attribute *attr, | 47 | struct device_attribute *attr, |
40 | char *buf) | 48 | char *buf) |
@@ -57,6 +65,7 @@ static struct device_attribute ieee80211_dev_attrs[] = { | |||
57 | __ATTR_RO(macaddress), | 65 | __ATTR_RO(macaddress), |
58 | __ATTR_RO(address_mask), | 66 | __ATTR_RO(address_mask), |
59 | __ATTR_RO(addresses), | 67 | __ATTR_RO(addresses), |
68 | __ATTR_RO(name), | ||
60 | {} | 69 | {} |
61 | }; | 70 | }; |
62 | 71 | ||