linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: Add module parameter to disable hardware crypto
@ 2009-02-24 11:42 Jouni Malinen
  2009-02-24 13:49 ` Johannes Berg
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Jouni Malinen @ 2009-02-24 11:42 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless

nohwcrypt=1 module parameter can now be used to disable hardware
crypto in ath9k. While the hardware acceleration handles most cases,
it may be useful to be able to force mac80211 software implementation
to be used for some tests, e.g., with virtual interface combinations
that may not yet be supported in the key cache configuration. In
addition, this allows management frame protection to be tested with
older hardware revisions.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>

---
 drivers/net/wireless/ath9k/main.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- wireless-testing.orig/drivers/net/wireless/ath9k/main.c	2009-02-24 13:34:44.000000000 +0200
+++ wireless-testing/drivers/net/wireless/ath9k/main.c	2009-02-24 13:35:01.000000000 +0200
@@ -26,6 +26,10 @@ MODULE_DESCRIPTION("Support for Atheros 
 MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards");
 MODULE_LICENSE("Dual BSD/GPL");
 
+static int modparam_nohwcrypt;
+module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
+MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption");
+
 /* We use the hw_value as an index into our private channel structure */
 
 #define CHAN2G(_freq, _idx)  { \
@@ -1587,7 +1591,7 @@ int ath_attach(u16 devid, struct ath_sof
 		IEEE80211_HW_SUPPORTS_PS |
 		IEEE80211_HW_PS_NULLFUNC_STACK;
 
-	if (AR_SREV_9160_10_OR_LATER(sc->sc_ah))
+	if (AR_SREV_9160_10_OR_LATER(sc->sc_ah) || modparam_nohwcrypt)
 		hw->flags |= IEEE80211_HW_MFP_CAPABLE;
 
 	hw->wiphy->interface_modes =
@@ -2468,6 +2472,9 @@ static int ath9k_set_key(struct ieee8021
 	struct ath_softc *sc = hw->priv;
 	int ret = 0;
 
+	if (modparam_nohwcrypt)
+		return -ENOSPC;
+
 	mutex_lock(&sc->mutex);
 	ath9k_ps_wakeup(sc);
 	DPRINTF(sc, ATH_DBG_KEYCACHE, "Set HW Key\n");

-- 
Jouni Malinen                                            PGP id EFC895FA

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

end of thread, other threads:[~2009-02-26  9:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-24 11:42 [PATCH] ath9k: Add module parameter to disable hardware crypto Jouni Malinen
2009-02-24 13:49 ` Johannes Berg
2009-02-24 14:06   ` Jouni Malinen
2009-02-24 14:23     ` Johannes Berg
2009-02-24 14:24 ` pat-lkml
2009-02-24 15:07   ` Jouni Malinen
2009-02-24 15:32     ` pat-lkml
2009-02-24 20:07       ` pat-lkml
2009-02-24 22:45         ` pat-lkml
2009-02-25 18:19         ` ath9k and TKIP hw crypto in AP mode Jouni Malinen
2009-02-25 23:46           ` pat-lkml
2009-02-26  0:10             ` pat-lkml
2009-02-26  9:10               ` Jouni Malinen
2009-02-24 16:15 ` [PATCH] ath9k: Add module parameter to disable hardware crypto Michael Buesch
2009-02-24 17:07   ` Jouni Malinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).