Skip to contentSkip to conversation

mac80211: print info when disabling HT

PATCH Superseded Johannes Berg 2 participants 6 messages May 30, 2012 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 net/mac80211/mlme.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
net/mac80211/mlme.c +10 -3
@@ -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,
#1 lore raw
Quoted 3 lines · Johannes Berg

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>,
[]

net/mac80211/mlme.c int ieee80211_mgd_assoc(struct ieee80211 · line 3335

Quoted 2 lines
net/mac80211/mlme.c +2 -0
+			netdev_printk(KERN_INFO, sdata->dev,
+				      "disabling HT due to WEP/TKIP use\n");
			netdev_info(sdata->dev, etc...)

etc...

author maintainer
#2 lore raw
Quoted 10 lines · Joe Perches
Quoted 3 lines · Johannes Berg

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>,
[]

Quoted 6 lines

net/mac80211/mlme.c int ieee80211_mgd_assoc(struct ieee80211 · line 3335

Quoted 2 lines
net/mac80211/mlme.c +2 -0
+			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

#3 lore raw
Quoted 16 lines · Johannes Berg
Quoted 15 lines · Joe Perches
Quoted 3 lines · Johannes Berg

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>,
[]

net/mac80211/mlme.c int ieee80211_mgd_assoc(struct ieee80211 · line 3335

Quoted 2 lines
net/mac80211/mlme.c +2 -0
+			netdev_printk(KERN_INFO, sdata->dev,
+				      "disabling HT due to WEP/TKIP use\n");
			netdev_info(sdata->dev, etc...)
Quoted 5 lines
Quoted 1 line

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.

author maintainer
#4 lore raw
Quoted 27 lines · Joe Perches
Quoted 16 lines · Johannes Berg
Quoted 15 lines · Joe Perches
Quoted 3 lines · Johannes Berg

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>,
[]

net/mac80211/mlme.c int ieee80211_mgd_assoc(struct ieee80211 · line 3335

Quoted 2 lines
net/mac80211/mlme.c +2 -0
+			netdev_printk(KERN_INFO, sdata->dev,
+				      "disabling HT due to WEP/TKIP use\n");
			netdev_info(sdata->dev, etc...)
Quoted 5 lines
Quoted 1 line

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.

Quoted 5 lines

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

author maintainer
#5 lore raw

PATCH v2 1/1 mac80211: print info when disabling HT

In reply to Johannes Berg

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.

---
v2: use netdev_info

 net/mac80211/mlme.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
net/mac80211/mlme.c +10 -3
@@ -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,