aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/core.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-11-18 18:56:28 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-19 11:08:50 -0500
commit5be83de54c16944dea9c16c6a5a53c1fa75ed304 (patch)
treedd251d9331a07ec73c7a4992c79ce30f0553db40 /net/wireless/core.c
parent9bd568a50c446433038dec2a5186c5c57c3dbd23 (diff)
cfg80211: convert bools into flags
We've accumulated a number of options for wiphys which make more sense as flags as we keep adding more. Convert the existing ones. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r--net/wireless/core.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 02835172b227..e2cc6e7522dd 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -230,7 +230,7 @@ int cfg80211_switch_netns(struct cfg80211_registered_device *rdev,
230 struct wireless_dev *wdev; 230 struct wireless_dev *wdev;
231 int err = 0; 231 int err = 0;
232 232
233 if (!rdev->wiphy.netnsok) 233 if (!(rdev->wiphy.flags & WIPHY_FLAG_NETNS_OK))
234 return -EOPNOTSUPP; 234 return -EOPNOTSUPP;
235 235
236 list_for_each_entry(wdev, &rdev->netdev_list, list) { 236 list_for_each_entry(wdev, &rdev->netdev_list, list) {
@@ -367,7 +367,9 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
367 rdev->wiphy.dev.class = &ieee80211_class; 367 rdev->wiphy.dev.class = &ieee80211_class;
368 rdev->wiphy.dev.platform_data = rdev; 368 rdev->wiphy.dev.platform_data = rdev;
369 369
370 rdev->wiphy.ps_default = CONFIG_CFG80211_DEFAULT_PS_VALUE; 370#ifdef CONFIG_CFG80211_DEFAULT_PS
371 rdev->wiphy.flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT;
372#endif
371 373
372 wiphy_net_set(&rdev->wiphy, &init_net); 374 wiphy_net_set(&rdev->wiphy, &init_net);
373 375
@@ -482,7 +484,7 @@ int wiphy_register(struct wiphy *wiphy)
482 if (IS_ERR(rdev->wiphy.debugfsdir)) 484 if (IS_ERR(rdev->wiphy.debugfsdir))
483 rdev->wiphy.debugfsdir = NULL; 485 rdev->wiphy.debugfsdir = NULL;
484 486
485 if (wiphy->custom_regulatory) { 487 if (wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) {
486 struct regulatory_request request; 488 struct regulatory_request request;
487 489
488 request.wiphy_idx = get_wiphy_idx(wiphy); 490 request.wiphy_idx = get_wiphy_idx(wiphy);
@@ -680,7 +682,10 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
680 wdev->wext.default_key = -1; 682 wdev->wext.default_key = -1;
681 wdev->wext.default_mgmt_key = -1; 683 wdev->wext.default_mgmt_key = -1;
682 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; 684 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
683 wdev->wext.ps = wdev->wiphy->ps_default; 685 if (wdev->wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT)
686 wdev->wext.ps = true;
687 else
688 wdev->wext.ps = false;
684 wdev->wext.ps_timeout = 100; 689 wdev->wext.ps_timeout = 100;
685 if (rdev->ops->set_power_mgmt) 690 if (rdev->ops->set_power_mgmt)
686 if (rdev->ops->set_power_mgmt(wdev->wiphy, dev, 691 if (rdev->ops->set_power_mgmt(wdev->wiphy, dev,