All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 4/5] mac80211: dont advertise WEP if unavailable
Date: Tue, 10 Aug 2010 09:46:41 +0200	[thread overview]
Message-ID: <20100810074700.566831120@sipsolutions.net> (raw)
In-Reply-To: 20100810074637.034583799@sipsolutions.net

From: Johannes Berg <johannes.berg@intel.com>

When WEP is unavailable, don't advertise it
to cfg80211.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/main.c |    5 +++++
 1 file changed, 5 insertions(+)

--- wireless-testing.orig/net/mac80211/main.c	2010-08-08 11:11:08.000000000 +0200
+++ wireless-testing/net/mac80211/main.c	2010-08-08 11:21:24.000000000 +0200
@@ -509,6 +509,7 @@ int ieee80211_register_hw(struct ieee802
 	int channels, max_bitrates;
 	bool supp_ht;
 	static const u32 cipher_suites[] = {
+		/* keep WEP first, it may be removed below */
 		WLAN_CIPHER_SUITE_WEP40,
 		WLAN_CIPHER_SUITE_WEP104,
 		WLAN_CIPHER_SUITE_TKIP,
@@ -596,6 +597,10 @@ int ieee80211_register_hw(struct ieee802
 	local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
 	if (!(local->hw.flags & IEEE80211_HW_MFP_CAPABLE))
 		local->hw.wiphy->n_cipher_suites--;
+	if (IS_ERR(local->wep_tx_tfm) || IS_ERR(local->wep_rx_tfm)) {
+		local->hw.wiphy->cipher_suites += 2;
+		local->hw.wiphy->n_cipher_suites -= 2;
+	}
 
 	result = wiphy_register(local->hw.wiphy);
 	if (result < 0)



  parent reply	other threads:[~2010-08-10  7:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10  7:46 [PATCH 0/5] mac80211 crypto cleanups Johannes Berg
2010-08-10  7:46 ` [PATCH 1/5] mac80211: use cipher suite selectors Johannes Berg
2010-08-10  7:46 ` [PATCH 2/5] mac80211: move key tfm setup Johannes Berg
2010-08-10  7:46 ` [PATCH 3/5] mac80211: remove unused status flag checks Johannes Berg
2010-08-11 11:51   ` Juuso Oikarinen
2010-08-11 12:12     ` Juuso Oikarinen
2010-08-11 12:39       ` Johannes Berg
2010-08-12  4:57         ` Juuso Oikarinen
2010-08-10  7:46 ` Johannes Berg [this message]
2010-08-10  7:46 ` [PATCH 5/5] cfg80211: check if WEP is available for shared key auth Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100810074700.566831120@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.