2012-05-30 11:56:44

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] mac80211: print info when disabling HT

From: Johannes Berg <[email protected]>

Make mac80211 print a message when it disables
HT due to the connection using WEP/TKIP or due
to the AP not supporting WMM/QoS.

Signed-off-by: Johannes Berg <[email protected]>
---
net/mac80211/mlme.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

--- a/net/mac80211/mlme.c 2012-05-30 10:39:53.000000000 +0200
+++ b/net/mac80211/mlme.c 2012-05-30 13:54:29.000000000 +0200
@@ -3326,11 +3326,15 @@ int ieee80211_mgd_assoc(struct ieee80211
* We can set this to true for non-11n hardware, that'll be checked
* separately along with the peer capabilities.
*/
- for (i = 0; i < req->crypto.n_ciphers_pairwise; i++)
+ for (i = 0; i < req->crypto.n_ciphers_pairwise; i++) {
if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 ||
req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_TKIP ||
- req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP104)
+ req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP104) {
ifmgd->flags |= IEEE80211_STA_DISABLE_11N;
+ netdev_printk(KERN_INFO, sdata->dev,
+ "disabling HT due to WEP/TKIP use\n");
+ }
+ }

if (req->flags & ASSOC_REQ_DISABLE_HT)
ifmgd->flags |= IEEE80211_STA_DISABLE_11N;
@@ -3338,8 +3342,11 @@ int ieee80211_mgd_assoc(struct ieee80211
/* Also disable HT if we don't support it or the AP doesn't use WMM */
sband = local->hw.wiphy->bands[req->bss->channel->band];
if (!sband->ht_cap.ht_supported ||
- local->hw.queues < IEEE80211_NUM_ACS || !bss->wmm_used)
+ local->hw.queues < IEEE80211_NUM_ACS || !bss->wmm_used) {
ifmgd->flags |= IEEE80211_STA_DISABLE_11N;
+ netdev_printk(KERN_INFO, sdata->dev,
+ "disabling HT as WMM/QoS is not supported\n");
+ }

memcpy(&ifmgd->ht_capa, &req->ht_capa, sizeof(ifmgd->ht_capa));
memcpy(&ifmgd->ht_capa_mask, &req->ht_capa_mask,




2012-05-30 14:50:59

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] mac80211: print info when disabling HT

On Wed, 2012-05-30 at 13:56 +0200, Johannes Berg wrote:
> Make mac80211 print a message when it disables
> HT due to the connection using WEP/TKIP or due
> to the AP not supporting WMM/QoS.

trivia: please use:
netdev_<level>(
not
netdev_printk(KERN_<LEVEL>,
[]
> + netdev_printk(KERN_INFO, sdata->dev,
> + "disabling HT due to WEP/TKIP use\n");

netdev_info(sdata->dev, etc...)

etc...


2012-05-30 13:58:17

by Johannes Berg

[permalink] [raw]
Subject: [PATCH v2] mac80211: print info when disabling HT

From: Johannes Berg <[email protected]>

Make mac80211 print a message when it disables
HT due to the connection using WEP/TKIP or due
to the AP not supporting WMM/QoS.

Signed-off-by: Johannes Berg <[email protected]>
---
v2: use netdev_info

net/mac80211/mlme.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

--- a/net/mac80211/mlme.c 2012-05-30 15:52:37.000000000 +0200
+++ b/net/mac80211/mlme.c 2012-05-30 15:52:59.000000000 +0200
@@ -3317,11 +3317,15 @@ int ieee80211_mgd_assoc(struct ieee80211
* We can set this to true for non-11n hardware, that'll be checked
* separately along with the peer capabilities.
*/
- for (i = 0; i < req->crypto.n_ciphers_pairwise; i++)
+ for (i = 0; i < req->crypto.n_ciphers_pairwise; i++) {
if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 ||
req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_TKIP ||
- req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP104)
+ req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP104) {
ifmgd->flags |= IEEE80211_STA_DISABLE_11N;
+ netdev_info(sdata->dev,
+ "disabling HT due to WEP/TKIP use\n");
+ }
+ }

if (req->flags & ASSOC_REQ_DISABLE_HT)
ifmgd->flags |= IEEE80211_STA_DISABLE_11N;
@@ -3329,8 +3333,11 @@ int ieee80211_mgd_assoc(struct ieee80211
/* Also disable HT if we don't support it or the AP doesn't use WMM */
sband = local->hw.wiphy->bands[req->bss->channel->band];
if (!sband->ht_cap.ht_supported ||
- local->hw.queues < IEEE80211_NUM_ACS || !bss->wmm_used)
+ local->hw.queues < IEEE80211_NUM_ACS || !bss->wmm_used) {
ifmgd->flags |= IEEE80211_STA_DISABLE_11N;
+ netdev_info(sdata->dev,
+ "disabling HT as WMM/QoS is not supported\n");
+ }

memcpy(&ifmgd->ht_capa, &req->ht_capa, sizeof(ifmgd->ht_capa));
memcpy(&ifmgd->ht_capa_mask, &req->ht_capa_mask,



2012-05-30 14:09:22

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] mac80211: print info when disabling HT

On Wed, 2012-05-30 at 15:51 +0200, Johannes Berg wrote:
> On Wed, 2012-05-30 at 06:48 -0700, Joe Perches wrote:
> > On Wed, 2012-05-30 at 13:56 +0200, Johannes Berg wrote:
> > > Make mac80211 print a message when it disables
> > > HT due to the connection using WEP/TKIP or due
> > > to the AP not supporting WMM/QoS.
> >
> > trivia: please use:
> > netdev_<level>(
> > not
> > netdev_printk(KERN_<LEVEL>,
> > []
> > > + netdev_printk(KERN_INFO, sdata->dev,
> > > + "disabling HT due to WEP/TKIP use\n");
> >
> > netdev_info(sdata->dev, etc...)
> >
> > etc...
>
> *sigh*
> Ok. I'm curious as to what the reason is for both, and using
> netdev_printk() everywhere?

netdev_printk isn't used generally. Other than the
netdev_<level> macros themselves, it's used only with
KERN_DEBUG to force output.

And to me, all of those netdev_level(KERN_DEBUG uses
would be better as netdev_dbg.

There are no other uses of netdev_printk except in
macros.



2012-05-30 14:21:37

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: print info when disabling HT

On Wed, 2012-05-30 at 07:08 -0700, Joe Perches wrote:
> On Wed, 2012-05-30 at 15:51 +0200, Johannes Berg wrote:
> > On Wed, 2012-05-30 at 06:48 -0700, Joe Perches wrote:
> > > On Wed, 2012-05-30 at 13:56 +0200, Johannes Berg wrote:
> > > > Make mac80211 print a message when it disables
> > > > HT due to the connection using WEP/TKIP or due
> > > > to the AP not supporting WMM/QoS.
> > >
> > > trivia: please use:
> > > netdev_<level>(
> > > not
> > > netdev_printk(KERN_<LEVEL>,
> > > []
> > > > + netdev_printk(KERN_INFO, sdata->dev,
> > > > + "disabling HT due to WEP/TKIP use\n");
> > >
> > > netdev_info(sdata->dev, etc...)
> > >
> > > etc...
> >
> > *sigh*
> > Ok. I'm curious as to what the reason is for both, and using
> > netdev_printk() everywhere?
>
> netdev_printk isn't used generally. Other than the
> netdev_<level> macros themselves, it's used only with
> KERN_DEBUG to force output.
>
> And to me, all of those netdev_level(KERN_DEBUG uses
> would be better as netdev_dbg.
>
> There are no other uses of netdev_printk except in
> macros.

Oh, I guess I was looking at an old tree since I was preparing the patch
against wireless-testing. Thanks for the explanation.

johannes


2012-05-30 13:53:13

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: print info when disabling HT

On Wed, 2012-05-30 at 06:48 -0700, Joe Perches wrote:
> On Wed, 2012-05-30 at 13:56 +0200, Johannes Berg wrote:
> > Make mac80211 print a message when it disables
> > HT due to the connection using WEP/TKIP or due
> > to the AP not supporting WMM/QoS.
>
> trivia: please use:
> netdev_<level>(
> not
> netdev_printk(KERN_<LEVEL>,
> []
> > + netdev_printk(KERN_INFO, sdata->dev,
> > + "disabling HT due to WEP/TKIP use\n");
>
> netdev_info(sdata->dev, etc...)
>
> etc...

*sigh*
Ok. I'm curious as to what the reason is for both, and using
netdev_printk() everywhere?

johannes


2012-06-08 17:48:03

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] mac80211: print info when disabling HT

On Wed, Jun 06, 2012 at 08:05:33AM +0200, Johannes Berg wrote:
> From: Johannes Berg <[email protected]>
>
> Make mac80211 print a message when it disables
> HT due to the connection using WEP/TKIP or due
> to the AP not supporting WMM/QoS.
>
> Signed-off-by: Johannes Berg <[email protected]>
> ---
> Did this slip through? :-)

I've got it on the wireless-next side.

commit 1c4cb928e1b7c6ad30a9b7d3e720f26156d92925
Author: Johannes Berg <[email protected]>
Date: Wed May 30 15:57:00 2012 +0200

mac80211: print info when disabling HT

Make mac80211 print a message when it disables
HT due to the connection using WEP/TKIP or due
to the AP not supporting WMM/QoS.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: John W. Linville <[email protected]>

--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2012-06-08 17:51:37

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: print info when disabling HT

On Fri, 2012-06-08 at 13:38 -0400, John W. Linville wrote:
> On Wed, Jun 06, 2012 at 08:05:33AM +0200, Johannes Berg wrote:
> > From: Johannes Berg <[email protected]>
> >
> > Make mac80211 print a message when it disables
> > HT due to the connection using WEP/TKIP or due
> > to the AP not supporting WMM/QoS.
> >
> > Signed-off-by: Johannes Berg <[email protected]>
> > ---
> > Did this slip through? :-)
>
> I've got it on the wireless-next side.

Oops, must've missed it, sorry!

johannes