Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134179
b: refs/heads/master
c: 0378b3f
h: refs/heads/master
i:
  134177: 9a68937
  134175: 4c400d2
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jan 29, 2009
1 parent 11f13b0 commit ae84277
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e0463f501fb945c1fde536d98eefc5ba156ff497
refs/heads/master: 0378b3f1c49d48ed524eabda7e4340163d9483c9
6 changes: 6 additions & 0 deletions trunk/include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ struct ieee80211_channel;
* wireless extensions but this is subject to reevaluation as soon as this
* code is used more widely and we have a first user without wext.
*
* @suspend: wiphy device needs to be suspended
* @resume: wiphy device needs to be resumed
*
* @add_virtual_intf: create a new virtual interface with the given name,
* must set the struct wireless_dev's iftype.
*
Expand Down Expand Up @@ -525,6 +528,9 @@ struct ieee80211_channel;
* @set_mgmt_extra_ie: Set extra IE data for management frames
*/
struct cfg80211_ops {
int (*suspend)(struct wiphy *wiphy);
int (*resume)(struct wiphy *wiphy);

int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
enum nl80211_iftype type, u32 *flags,
struct vif_params *params);
Expand Down
30 changes: 30 additions & 0 deletions trunk/net/wireless/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,34 @@ static int wiphy_uevent(struct device *dev, struct kobj_uevent_env *env)
}
#endif

static int wiphy_suspend(struct device *dev, pm_message_t state)
{
struct cfg80211_registered_device *rdev = dev_to_rdev(dev);
int ret = 0;

if (rdev->ops->suspend) {
rtnl_lock();
ret = rdev->ops->suspend(&rdev->wiphy);
rtnl_unlock();
}

return ret;
}

static int wiphy_resume(struct device *dev)
{
struct cfg80211_registered_device *rdev = dev_to_rdev(dev);
int ret = 0;

if (rdev->ops->resume) {
rtnl_lock();
ret = rdev->ops->resume(&rdev->wiphy);
rtnl_unlock();
}

return ret;
}

struct class ieee80211_class = {
.name = "ieee80211",
.owner = THIS_MODULE,
Expand All @@ -63,6 +91,8 @@ struct class ieee80211_class = {
#ifdef CONFIG_HOTPLUG
.dev_uevent = wiphy_uevent,
#endif
.suspend = wiphy_suspend,
.resume = wiphy_resume,
};

int wiphy_sysfs_init(void)
Expand Down

0 comments on commit ae84277

Please sign in to comment.