diff options
author | Arik Nemtsov <arik@wizery.com> | 2015-08-15 15:39:46 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-09-22 09:21:21 -0400 |
commit | 82c0cc90d6268a3cd3ee058257d2146188326452 (patch) | |
tree | 1a4c12dc918c9671743378436b94846a4f519534 | |
parent | fc58c47ef1ace65c5c1c94f2e96578e7b04aad64 (diff) |
mac80211: debugfs: add file to disallow TDLS wider-bw
Sometimes we are interested in testing TDLS performance in a specific
width setting. Add the ability to disable the wider-band feature, thereby
allowing the TDLS channel width to be controlled by the BSS width.
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/mac80211/cfg.c | 1 | ||||
-rw-r--r-- | net/mac80211/debugfs_netdev.c | 29 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 1 | ||||
-rw-r--r-- | net/mac80211/tdls.c | 4 |
4 files changed, 34 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 685ec13ed7c2..1ca972e5418b 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1156,6 +1156,7 @@ static int sta_apply_parameters(struct ieee80211_local *local, | |||
1156 | set_sta_flag(sta, WLAN_STA_TDLS_CHAN_SWITCH); | 1156 | set_sta_flag(sta, WLAN_STA_TDLS_CHAN_SWITCH); |
1157 | 1157 | ||
1158 | if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) && | 1158 | if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) && |
1159 | !sdata->u.mgd.tdls_wider_bw_prohibited && | ||
1159 | ieee80211_hw_check(&local->hw, TDLS_WIDER_BW) && | 1160 | ieee80211_hw_check(&local->hw, TDLS_WIDER_BW) && |
1160 | params->ext_capab_len >= 8 && | 1161 | params->ext_capab_len >= 8 && |
1161 | params->ext_capab[7] & WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED) | 1162 | params->ext_capab[7] & WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED) |
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 1021e87c051f..f1580e96c8fc 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -455,6 +455,34 @@ static ssize_t ieee80211_if_parse_uapsd_max_sp_len( | |||
455 | } | 455 | } |
456 | IEEE80211_IF_FILE_RW(uapsd_max_sp_len); | 456 | IEEE80211_IF_FILE_RW(uapsd_max_sp_len); |
457 | 457 | ||
458 | static ssize_t ieee80211_if_fmt_tdls_wider_bw( | ||
459 | const struct ieee80211_sub_if_data *sdata, char *buf, int buflen) | ||
460 | { | ||
461 | const struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | ||
462 | bool tdls_wider_bw; | ||
463 | |||
464 | tdls_wider_bw = ieee80211_hw_check(&sdata->local->hw, TDLS_WIDER_BW) && | ||
465 | !ifmgd->tdls_wider_bw_prohibited; | ||
466 | |||
467 | return snprintf(buf, buflen, "%d\n", tdls_wider_bw); | ||
468 | } | ||
469 | |||
470 | static ssize_t ieee80211_if_parse_tdls_wider_bw( | ||
471 | struct ieee80211_sub_if_data *sdata, const char *buf, int buflen) | ||
472 | { | ||
473 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | ||
474 | u8 val; | ||
475 | int ret; | ||
476 | |||
477 | ret = kstrtou8(buf, 0, &val); | ||
478 | if (ret) | ||
479 | return ret; | ||
480 | |||
481 | ifmgd->tdls_wider_bw_prohibited = !val; | ||
482 | return buflen; | ||
483 | } | ||
484 | IEEE80211_IF_FILE_RW(tdls_wider_bw); | ||
485 | |||
458 | /* AP attributes */ | 486 | /* AP attributes */ |
459 | IEEE80211_IF_FILE(num_mcast_sta, u.ap.num_mcast_sta, ATOMIC); | 487 | IEEE80211_IF_FILE(num_mcast_sta, u.ap.num_mcast_sta, ATOMIC); |
460 | IEEE80211_IF_FILE(num_sta_ps, u.ap.ps.num_sta_ps, ATOMIC); | 488 | IEEE80211_IF_FILE(num_sta_ps, u.ap.ps.num_sta_ps, ATOMIC); |
@@ -614,6 +642,7 @@ static void add_sta_files(struct ieee80211_sub_if_data *sdata) | |||
614 | DEBUGFS_ADD_MODE(beacon_loss, 0200); | 642 | DEBUGFS_ADD_MODE(beacon_loss, 0200); |
615 | DEBUGFS_ADD_MODE(uapsd_queues, 0600); | 643 | DEBUGFS_ADD_MODE(uapsd_queues, 0600); |
616 | DEBUGFS_ADD_MODE(uapsd_max_sp_len, 0600); | 644 | DEBUGFS_ADD_MODE(uapsd_max_sp_len, 0600); |
645 | DEBUGFS_ADD_MODE(tdls_wider_bw, 0600); | ||
617 | } | 646 | } |
618 | 647 | ||
619 | static void add_ap_files(struct ieee80211_sub_if_data *sdata) | 648 | static void add_ap_files(struct ieee80211_sub_if_data *sdata) |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 6e52659f923f..65f4faa94e4e 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -535,6 +535,7 @@ struct ieee80211_if_managed { | |||
535 | struct sk_buff *teardown_skb; /* A copy to send through the AP */ | 535 | struct sk_buff *teardown_skb; /* A copy to send through the AP */ |
536 | spinlock_t teardown_lock; /* To lock changing teardown_skb */ | 536 | spinlock_t teardown_lock; /* To lock changing teardown_skb */ |
537 | bool tdls_chan_switch_prohibited; | 537 | bool tdls_chan_switch_prohibited; |
538 | bool tdls_wider_bw_prohibited; | ||
538 | 539 | ||
539 | /* WMM-AC TSPEC support */ | 540 | /* WMM-AC TSPEC support */ |
540 | struct ieee80211_sta_tx_tspec tx_tspec[IEEE80211_NUM_ACS]; | 541 | struct ieee80211_sta_tx_tspec tx_tspec[IEEE80211_NUM_ACS]; |
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index aee701a5649e..1bacea793c23 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c | |||
@@ -41,9 +41,11 @@ static void ieee80211_tdls_add_ext_capab(struct ieee80211_sub_if_data *sdata, | |||
41 | struct sk_buff *skb) | 41 | struct sk_buff *skb) |
42 | { | 42 | { |
43 | struct ieee80211_local *local = sdata->local; | 43 | struct ieee80211_local *local = sdata->local; |
44 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | ||
44 | bool chan_switch = local->hw.wiphy->features & | 45 | bool chan_switch = local->hw.wiphy->features & |
45 | NL80211_FEATURE_TDLS_CHANNEL_SWITCH; | 46 | NL80211_FEATURE_TDLS_CHANNEL_SWITCH; |
46 | bool wider_band = ieee80211_hw_check(&local->hw, TDLS_WIDER_BW); | 47 | bool wider_band = ieee80211_hw_check(&local->hw, TDLS_WIDER_BW) && |
48 | !ifmgd->tdls_wider_bw_prohibited; | ||
47 | enum ieee80211_band band = ieee80211_get_sdata_band(sdata); | 49 | enum ieee80211_band band = ieee80211_get_sdata_band(sdata); |
48 | struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band]; | 50 | struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band]; |
49 | bool vht = sband && sband->vht_cap.vht_supported; | 51 | bool vht = sband && sband->vht_cap.vht_supported; |