diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-11-18 18:56:28 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-19 11:08:50 -0500 |
commit | 5be83de54c16944dea9c16c6a5a53c1fa75ed304 (patch) | |
tree | dd251d9331a07ec73c7a4992c79ce30f0553db40 /net/wireless | |
parent | 9bd568a50c446433038dec2a5186c5c57c3dbd23 (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')
-rw-r--r-- | net/wireless/Kconfig | 6 | ||||
-rw-r--r-- | net/wireless/core.c | 13 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 2 | ||||
-rw-r--r-- | net/wireless/reg.c | 13 |
4 files changed, 17 insertions, 17 deletions
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig index 614bdcec1c80..90e93a5701aa 100644 --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig | |||
@@ -74,12 +74,6 @@ config CFG80211_REG_DEBUG | |||
74 | 74 | ||
75 | If unsure, say N. | 75 | If unsure, say N. |
76 | 76 | ||
77 | config CFG80211_DEFAULT_PS_VALUE | ||
78 | int | ||
79 | default 1 if CFG80211_DEFAULT_PS | ||
80 | default 0 | ||
81 | depends on CFG80211 | ||
82 | |||
83 | config CFG80211_DEFAULT_PS | 77 | config CFG80211_DEFAULT_PS |
84 | bool "enable powersave by default" | 78 | bool "enable powersave by default" |
85 | depends on CFG80211 | 79 | depends on CFG80211 |
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, |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 37264d56bace..6634188f9453 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -561,7 +561,7 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags, | |||
561 | CMD(deauth, DEAUTHENTICATE); | 561 | CMD(deauth, DEAUTHENTICATE); |
562 | CMD(disassoc, DISASSOCIATE); | 562 | CMD(disassoc, DISASSOCIATE); |
563 | CMD(join_ibss, JOIN_IBSS); | 563 | CMD(join_ibss, JOIN_IBSS); |
564 | if (dev->wiphy.netnsok) { | 564 | if (dev->wiphy.flags & WIPHY_FLAG_NETNS_OK) { |
565 | i++; | 565 | i++; |
566 | NLA_PUT_U32(msg, i, NL80211_CMD_SET_WIPHY_NETNS); | 566 | NLA_PUT_U32(msg, i, NL80211_CMD_SET_WIPHY_NETNS); |
567 | } | 567 | } |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index f256dfffbf46..1f33017737fd 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1008,7 +1008,7 @@ static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band, | |||
1008 | 1008 | ||
1009 | if (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER && | 1009 | if (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER && |
1010 | request_wiphy && request_wiphy == wiphy && | 1010 | request_wiphy && request_wiphy == wiphy && |
1011 | request_wiphy->strict_regulatory) { | 1011 | request_wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) { |
1012 | /* | 1012 | /* |
1013 | * This gaurantees the driver's requested regulatory domain | 1013 | * This gaurantees the driver's requested regulatory domain |
1014 | * will always be used as a base for further regulatory | 1014 | * will always be used as a base for further regulatory |
@@ -1051,13 +1051,13 @@ static bool ignore_reg_update(struct wiphy *wiphy, | |||
1051 | if (!last_request) | 1051 | if (!last_request) |
1052 | return true; | 1052 | return true; |
1053 | if (initiator == NL80211_REGDOM_SET_BY_CORE && | 1053 | if (initiator == NL80211_REGDOM_SET_BY_CORE && |
1054 | wiphy->custom_regulatory) | 1054 | wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) |
1055 | return true; | 1055 | return true; |
1056 | /* | 1056 | /* |
1057 | * wiphy->regd will be set once the device has its own | 1057 | * wiphy->regd will be set once the device has its own |
1058 | * desired regulatory domain set | 1058 | * desired regulatory domain set |
1059 | */ | 1059 | */ |
1060 | if (wiphy->strict_regulatory && !wiphy->regd && | 1060 | if (wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY && !wiphy->regd && |
1061 | !is_world_regdom(last_request->alpha2)) | 1061 | !is_world_regdom(last_request->alpha2)) |
1062 | return true; | 1062 | return true; |
1063 | return false; | 1063 | return false; |
@@ -1093,7 +1093,7 @@ static void handle_reg_beacon(struct wiphy *wiphy, | |||
1093 | 1093 | ||
1094 | chan->beacon_found = true; | 1094 | chan->beacon_found = true; |
1095 | 1095 | ||
1096 | if (wiphy->disable_beacon_hints) | 1096 | if (wiphy->flags & WIPHY_FLAG_DISABLE_BEACON_HINTS) |
1097 | return; | 1097 | return; |
1098 | 1098 | ||
1099 | chan_before.center_freq = chan->center_freq; | 1099 | chan_before.center_freq = chan->center_freq; |
@@ -1164,7 +1164,7 @@ static bool reg_is_world_roaming(struct wiphy *wiphy) | |||
1164 | return true; | 1164 | return true; |
1165 | if (last_request && | 1165 | if (last_request && |
1166 | last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && | 1166 | last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && |
1167 | wiphy->custom_regulatory) | 1167 | wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) |
1168 | return true; | 1168 | return true; |
1169 | return false; | 1169 | return false; |
1170 | } | 1170 | } |
@@ -1591,7 +1591,8 @@ static void reg_process_hint(struct regulatory_request *reg_request) | |||
1591 | 1591 | ||
1592 | r = __regulatory_hint(wiphy, reg_request); | 1592 | r = __regulatory_hint(wiphy, reg_request); |
1593 | /* This is required so that the orig_* parameters are saved */ | 1593 | /* This is required so that the orig_* parameters are saved */ |
1594 | if (r == -EALREADY && wiphy && wiphy->strict_regulatory) | 1594 | if (r == -EALREADY && wiphy && |
1595 | wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) | ||
1595 | wiphy_update_regulatory(wiphy, reg_request->initiator); | 1596 | wiphy_update_regulatory(wiphy, reg_request->initiator); |
1596 | out: | 1597 | out: |
1597 | mutex_unlock(®_mutex); | 1598 | mutex_unlock(®_mutex); |