]> Pileus Git - ~andy/linux/blobdiff - net/wireless/sysfs.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[~andy/linux] / net / wireless / sysfs.c
index 9f2cef3e0ca0cd21640127a27fd72edba88434a5..4294fa22bb2dfc15cbd6d0d2e7c0303a42f7d278 100644 (file)
@@ -35,6 +35,14 @@ SHOW_FMT(index, "%d", wiphy_idx);
 SHOW_FMT(macaddress, "%pM", wiphy.perm_addr);
 SHOW_FMT(address_mask, "%pM", wiphy.addr_mask);
 
+static ssize_t name_show(struct device *dev,
+                        struct device_attribute *attr,
+                        char *buf) {
+       struct wiphy *wiphy = &dev_to_rdev(dev)->wiphy;
+       return sprintf(buf, "%s\n", dev_name(&wiphy->dev));
+}
+
+
 static ssize_t addresses_show(struct device *dev,
                              struct device_attribute *attr,
                              char *buf)
@@ -57,6 +65,7 @@ static struct device_attribute ieee80211_dev_attrs[] = {
        __ATTR_RO(macaddress),
        __ATTR_RO(address_mask),
        __ATTR_RO(addresses),
+       __ATTR_RO(name),
        {}
 };
 
@@ -110,6 +119,13 @@ static int wiphy_resume(struct device *dev)
        return ret;
 }
 
+static const void *wiphy_namespace(struct device *d)
+{
+       struct wiphy *wiphy = container_of(d, struct wiphy, dev);
+
+       return wiphy_net(wiphy);
+}
+
 struct class ieee80211_class = {
        .name = "ieee80211",
        .owner = THIS_MODULE,
@@ -120,6 +136,8 @@ struct class ieee80211_class = {
 #endif
        .suspend = wiphy_suspend,
        .resume = wiphy_resume,
+       .ns_type = &net_ns_type_operations,
+       .namespace = wiphy_namespace,
 };
 
 int wiphy_sysfs_init(void)