aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorDedy Lansky <dlansky@codeaurora.org>2015-02-08 08:52:03 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-03-03 09:56:01 -0500
commit6eb18137643fee5f182d85c818062b4feddfb76b (patch)
tree6c9712c947498fd2291a53acfe2be48711a881ac /net/mac80211
parent76a70e9c4b45fc1dbcbff6f7ae88ac7e1ddfb677 (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/mac80211')
-rw-r--r--net/mac80211/ibss.c43
1 files changed, 12 insertions, 31 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index b606b53a49a7..ee93d7d9aa4b 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -470,22 +470,19 @@ int ieee80211_ibss_csa_beacon(struct ieee80211_sub_if_data *sdata,
470 struct beacon_data *presp, *old_presp; 470 struct beacon_data *presp, *old_presp;
471 struct cfg80211_bss *cbss; 471 struct cfg80211_bss *cbss;
472 const struct cfg80211_bss_ies *ies; 472 const struct cfg80211_bss_ies *ies;
473 u16 capability; 473 u16 capability = 0;
474 u64 tsf; 474 u64 tsf;
475 int ret = 0; 475 int ret = 0;
476 476
477 sdata_assert_lock(sdata); 477 sdata_assert_lock(sdata);
478 478
479 capability = WLAN_CAPABILITY_IBSS;
480
481 if (ifibss->privacy) 479 if (ifibss->privacy)
482 capability |= WLAN_CAPABILITY_PRIVACY; 480 capability = WLAN_CAPABILITY_PRIVACY;
483 481
484 cbss = cfg80211_get_bss(sdata->local->hw.wiphy, ifibss->chandef.chan, 482 cbss = cfg80211_get_bss(sdata->local->hw.wiphy, ifibss->chandef.chan,
485 ifibss->bssid, ifibss->ssid, 483 ifibss->bssid, ifibss->ssid,
486 ifibss->ssid_len, WLAN_CAPABILITY_IBSS | 484 ifibss->ssid_len, IEEE80211_BSS_TYPE_IBSS,
487 WLAN_CAPABILITY_PRIVACY, 485 IEEE80211_PRIVACY(ifibss->privacy));
488 capability);
489 486
490 if (WARN_ON(!cbss)) { 487 if (WARN_ON(!cbss)) {
491 ret = -EINVAL; 488 ret = -EINVAL;
@@ -525,23 +522,17 @@ int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata)
525 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; 522 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
526 struct cfg80211_bss *cbss; 523 struct cfg80211_bss *cbss;
527 int err, changed = 0; 524 int err, changed = 0;
528 u16 capability;
529 525
530 sdata_assert_lock(sdata); 526 sdata_assert_lock(sdata);
531 527
532 /* update cfg80211 bss information with the new channel */ 528 /* update cfg80211 bss information with the new channel */
533 if (!is_zero_ether_addr(ifibss->bssid)) { 529 if (!is_zero_ether_addr(ifibss->bssid)) {
534 capability = WLAN_CAPABILITY_IBSS;
535
536 if (ifibss->privacy)
537 capability |= WLAN_CAPABILITY_PRIVACY;
538
539 cbss = cfg80211_get_bss(sdata->local->hw.wiphy, 530 cbss = cfg80211_get_bss(sdata->local->hw.wiphy,
540 ifibss->chandef.chan, 531 ifibss->chandef.chan,
541 ifibss->bssid, ifibss->ssid, 532 ifibss->bssid, ifibss->ssid,
542 ifibss->ssid_len, WLAN_CAPABILITY_IBSS | 533 ifibss->ssid_len,
543 WLAN_CAPABILITY_PRIVACY, 534 IEEE80211_BSS_TYPE_IBSS,
544 capability); 535 IEEE80211_PRIVACY(ifibss->privacy));
545 /* XXX: should not really modify cfg80211 data */ 536 /* XXX: should not really modify cfg80211 data */
546 if (cbss) { 537 if (cbss) {
547 cbss->channel = sdata->csa_chandef.chan; 538 cbss->channel = sdata->csa_chandef.chan;
@@ -682,19 +673,13 @@ static void ieee80211_ibss_disconnect(struct ieee80211_sub_if_data *sdata)
682 struct cfg80211_bss *cbss; 673 struct cfg80211_bss *cbss;
683 struct beacon_data *presp; 674 struct beacon_data *presp;
684 struct sta_info *sta; 675 struct sta_info *sta;
685 u16 capability;
686 676
687 if (!is_zero_ether_addr(ifibss->bssid)) { 677 if (!is_zero_ether_addr(ifibss->bssid)) {
688 capability = WLAN_CAPABILITY_IBSS;
689
690 if (ifibss->privacy)
691 capability |= WLAN_CAPABILITY_PRIVACY;
692
693 cbss = cfg80211_get_bss(local->hw.wiphy, ifibss->chandef.chan, 678 cbss = cfg80211_get_bss(local->hw.wiphy, ifibss->chandef.chan,
694 ifibss->bssid, ifibss->ssid, 679 ifibss->bssid, ifibss->ssid,
695 ifibss->ssid_len, WLAN_CAPABILITY_IBSS | 680 ifibss->ssid_len,
696 WLAN_CAPABILITY_PRIVACY, 681 IEEE80211_BSS_TYPE_IBSS,
697 capability); 682 IEEE80211_PRIVACY(ifibss->privacy));
698 683
699 if (cbss) { 684 if (cbss) {
700 cfg80211_unlink_bss(local->hw.wiphy, cbss); 685 cfg80211_unlink_bss(local->hw.wiphy, cbss);
@@ -1325,7 +1310,6 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
1325 const u8 *bssid = NULL; 1310 const u8 *bssid = NULL;
1326 enum nl80211_bss_scan_width scan_width; 1311 enum nl80211_bss_scan_width scan_width;
1327 int active_ibss; 1312 int active_ibss;
1328 u16 capability;
1329 1313
1330 sdata_assert_lock(sdata); 1314 sdata_assert_lock(sdata);
1331 1315
@@ -1335,9 +1319,6 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
1335 if (active_ibss) 1319 if (active_ibss)
1336 return; 1320 return;
1337 1321
1338 capability = WLAN_CAPABILITY_IBSS;
1339 if (ifibss->privacy)
1340 capability |= WLAN_CAPABILITY_PRIVACY;
1341 if (ifibss->fixed_bssid) 1322 if (ifibss->fixed_bssid)
1342 bssid = ifibss->bssid; 1323 bssid = ifibss->bssid;
1343 if (ifibss->fixed_channel) 1324 if (ifibss->fixed_channel)
@@ -1346,8 +1327,8 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
1346 bssid = ifibss->bssid; 1327 bssid = ifibss->bssid;
1347 cbss = cfg80211_get_bss(local->hw.wiphy, chan, bssid, 1328 cbss = cfg80211_get_bss(local->hw.wiphy, chan, bssid,
1348 ifibss->ssid, ifibss->ssid_len, 1329 ifibss->ssid, ifibss->ssid_len,
1349 WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_PRIVACY, 1330 IEEE80211_BSS_TYPE_IBSS,
1350 capability); 1331 IEEE80211_PRIVACY(ifibss->privacy));
1351 1332
1352 if (cbss) { 1333 if (cbss) {
1353 struct ieee80211_bss *bss; 1334 struct ieee80211_bss *bss;