diff options
author | Dedy Lansky <dlansky@codeaurora.org> | 2015-02-08 08:52:03 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-03-03 09:56:01 -0500 |
commit | 6eb18137643fee5f182d85c818062b4feddfb76b (patch) | |
tree | 6c9712c947498fd2291a53acfe2be48711a881ac /net/wireless/sme.c | |
parent | 76a70e9c4b45fc1dbcbff6f7ae88ac7e1ddfb677 (diff) |
cfg80211: add bss_type and privacy arguments in cfg80211_get_bss()
802.11ad adds new a network type (PBSS) and changes the capability
field interpretation for the DMG (60G) band.
The same 2 bits that were interpreted as "ESS" and "IBSS" before are
re-used as a 2-bit field with 3 valid values (and 1 reserved). Valid
values are: "IBSS", "PBSS" (new) and "AP".
In order to get the BSS struct for the new PBSS networks, change the
cfg80211_get_bss() function to take a new enum ieee80211_bss_type
argument with the valid network types, as "capa_mask" and "capa_val"
no longer work correctly (the search must be band-aware now.)
The remaining bits in "capa_mask" and "capa_val" are used only for
privacy matching so replace those two with a privacy enum as well.
Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
[rewrite commit log, tiny fixes]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r-- | net/wireless/sme.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 0ab3711c79a0..ea1da6621ff0 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c | |||
@@ -257,19 +257,15 @@ static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev) | |||
257 | { | 257 | { |
258 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); | 258 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
259 | struct cfg80211_bss *bss; | 259 | struct cfg80211_bss *bss; |
260 | u16 capa = WLAN_CAPABILITY_ESS; | ||
261 | 260 | ||
262 | ASSERT_WDEV_LOCK(wdev); | 261 | ASSERT_WDEV_LOCK(wdev); |
263 | 262 | ||
264 | if (wdev->conn->params.privacy) | ||
265 | capa |= WLAN_CAPABILITY_PRIVACY; | ||
266 | |||
267 | bss = cfg80211_get_bss(wdev->wiphy, wdev->conn->params.channel, | 263 | bss = cfg80211_get_bss(wdev->wiphy, wdev->conn->params.channel, |
268 | wdev->conn->params.bssid, | 264 | wdev->conn->params.bssid, |
269 | wdev->conn->params.ssid, | 265 | wdev->conn->params.ssid, |
270 | wdev->conn->params.ssid_len, | 266 | wdev->conn->params.ssid_len, |
271 | WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_PRIVACY, | 267 | IEEE80211_BSS_TYPE_ESS, |
272 | capa); | 268 | IEEE80211_PRIVACY(wdev->conn->params.privacy)); |
273 | if (!bss) | 269 | if (!bss) |
274 | return NULL; | 270 | return NULL; |
275 | 271 | ||
@@ -637,8 +633,8 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid, | |||
637 | WARN_ON_ONCE(!wiphy_to_rdev(wdev->wiphy)->ops->connect); | 633 | WARN_ON_ONCE(!wiphy_to_rdev(wdev->wiphy)->ops->connect); |
638 | bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid, | 634 | bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid, |
639 | wdev->ssid, wdev->ssid_len, | 635 | wdev->ssid, wdev->ssid_len, |
640 | WLAN_CAPABILITY_ESS, | 636 | IEEE80211_BSS_TYPE_ESS, |
641 | WLAN_CAPABILITY_ESS); | 637 | IEEE80211_PRIVACY_ANY); |
642 | if (bss) | 638 | if (bss) |
643 | cfg80211_hold_bss(bss_from_pub(bss)); | 639 | cfg80211_hold_bss(bss_from_pub(bss)); |
644 | } | 640 | } |
@@ -795,8 +791,8 @@ void cfg80211_roamed(struct net_device *dev, | |||
795 | struct cfg80211_bss *bss; | 791 | struct cfg80211_bss *bss; |
796 | 792 | ||
797 | bss = cfg80211_get_bss(wdev->wiphy, channel, bssid, wdev->ssid, | 793 | bss = cfg80211_get_bss(wdev->wiphy, channel, bssid, wdev->ssid, |
798 | wdev->ssid_len, WLAN_CAPABILITY_ESS, | 794 | wdev->ssid_len, |
799 | WLAN_CAPABILITY_ESS); | 795 | IEEE80211_BSS_TYPE_ESS, IEEE80211_PRIVACY_ANY); |
800 | if (WARN_ON(!bss)) | 796 | if (WARN_ON(!bss)) |
801 | return; | 797 | return; |
802 | 798 | ||