All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: Remove VHT Capabilities/Operation IEs from mesh beacon if VHT was disabled
@ 2017-02-02  0:05 Masashi Honma
  2017-02-08  8:22 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Masashi Honma @ 2017-02-02  0:05 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Masashi Honma

When wpa_supplicant.conf includes disable_ht=1, the beacon of the mesh
node does not have HT Capabilities/Operation IEs. However, the beacon
of the mesh node has VHT Capabilities/Operation IEs even though
wpa_supplicant.conf includes disable_vht=1.

This patch removes VHT Capabilities/Operation IEs when the
wpa_supplicant.conf includes disable_vht=1. We recognize the local peer
as 11ac ready, when it has more than 80MHz band width. Because
net/mac80211/util.c#ieee80211_build_preq_ies_band() uses 80MHz threshold
for VHT Capabilities IE inclusion.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
---
 net/mac80211/mesh.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 9c23172..a30be19 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -469,9 +469,9 @@ int mesh_add_vht_cap_ie(struct ieee80211_sub_if_data *sdata,
 
 	sband = local->hw.wiphy->bands[band];
 	if (!sband->vht_cap.vht_supported ||
-	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
-	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
-	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
+	    !(sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_80 ||
+	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_80P80 ||
+	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_160))
 		return 0;
 
 	if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_vht_cap))
@@ -506,9 +506,9 @@ int mesh_add_vht_oper_ie(struct ieee80211_sub_if_data *sdata,
 	vht_cap = &sband->vht_cap;
 
 	if (!vht_cap->vht_supported ||
-	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
-	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
-	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
+	    !(sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_80 ||
+	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_80P80 ||
+	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_160))
 		return 0;
 
 	if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_vht_operation))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211: Remove VHT Capabilities/Operation IEs from mesh beacon if VHT was disabled
  2017-02-02  0:05 [PATCH] mac80211: Remove VHT Capabilities/Operation IEs from mesh beacon if VHT was disabled Masashi Honma
@ 2017-02-08  8:22 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2017-02-08  8:22 UTC (permalink / raw)
  To: Masashi Honma; +Cc: linux-wireless


> This patch removes VHT Capabilities/Operation IEs when the
> wpa_supplicant.conf includes disable_vht=1. We recognize the local
> peer
> as 11ac ready, when it has more than 80MHz band width. Because
> net/mac80211/util.c#ieee80211_build_preq_ies_band() uses 80MHz
> threshold
> for VHT Capabilities IE inclusion.

I believe this is incorrect the way you've written it, we shouldn't
disable VHT because 80 MHz isn't *used* right now.

The code you reference checks if 80 MHz was technically *supported*,
and that's really only because we otherwise can't connect to a BSS
network that supports VHT, since the AP might switch from 20/40 to
80/160, and we can't say that we don't support 80 (since we have to
support it if we support VHT.)

>  	sband = local->hw.wiphy->bands[band];
>  	if (!sband->vht_cap.vht_supported ||
> -	    sdata->vif.bss_conf.chandef.width ==
> NL80211_CHAN_WIDTH_20_NOHT ||
> -	    sdata->vif.bss_conf.chandef.width ==
> NL80211_CHAN_WIDTH_5 ||
> -	    sdata->vif.bss_conf.chandef.width ==
> NL80211_CHAN_WIDTH_10)
> +	    !(sdata->vif.bss_conf.chandef.width ==
> NL80211_CHAN_WIDTH_80 ||
> +	    sdata->vif.bss_conf.chandef.width ==
> NL80211_CHAN_WIDTH_80P80 ||
> +	    sdata->vif.bss_conf.chandef.width ==
> NL80211_CHAN_WIDTH_160))
>  		return 0;
> 

But using the current bandwidth as you do now seems incorrect to me.

johannes

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-08  8:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-02  0:05 [PATCH] mac80211: Remove VHT Capabilities/Operation IEs from mesh beacon if VHT was disabled Masashi Honma
2017-02-08  8:22 ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.