11 #include <linux/device.h>
12 #include <linux/module.h>
13 #include <linux/netdevice.h>
15 #include <linux/rtnetlink.h>
26 #define SHOW_FMT(name, fmt, member) \
27 static ssize_t name ## _show(struct device *dev, \
28 struct device_attribute *attr, \
31 return sprintf(buf, fmt "\n", dev_to_rdev(dev)->member); \
41 struct wiphy *
wiphy = &dev_to_rdev(dev)->wiphy;
42 return sprintf(buf,
"%s\n", dev_name(&wiphy->
dev));
50 struct wiphy *wiphy = &dev_to_rdev(dev)->wiphy;
72 static void wiphy_dev_release(
struct device *dev)
94 if (rdev->
ops->suspend) {
96 if (rdev->wiphy.registered)
97 ret = rdev->
ops->suspend(&rdev->wiphy, rdev->
wowlan);
104 static int wiphy_resume(
struct device *dev)
114 if (rdev->
ops->resume) {
116 if (rdev->wiphy.registered)
117 ret = rdev->
ops->resume(&rdev->wiphy);
124 static const void *wiphy_namespace(
struct device *
d)
126 struct wiphy *wiphy =
container_of(d,
struct wiphy, dev);
128 return wiphy_net(wiphy);
134 .dev_release = wiphy_dev_release,
135 .dev_attrs = ieee80211_dev_attrs,
136 #ifdef CONFIG_HOTPLUG
137 .dev_uevent = wiphy_uevent,
139 .suspend = wiphy_suspend,
140 .resume = wiphy_resume,
142 .namespace = wiphy_namespace,