Commit b3bd89ce authored by Jouni Malinen's avatar Jouni Malinen Committed by John W. Linville

ath9k: Add module parameter to disable hardware crypto

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: default avatarJouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 508827ff
...@@ -26,6 +26,10 @@ MODULE_DESCRIPTION("Support for Atheros 802.11n wireless LAN cards."); ...@@ -26,6 +26,10 @@ MODULE_DESCRIPTION("Support for Atheros 802.11n wireless LAN cards.");
MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards"); MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards");
MODULE_LICENSE("Dual BSD/GPL"); 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 */ /* We use the hw_value as an index into our private channel structure */
#define CHAN2G(_freq, _idx) { \ #define CHAN2G(_freq, _idx) { \
...@@ -1587,7 +1591,7 @@ int ath_attach(u16 devid, struct ath_softc *sc) ...@@ -1587,7 +1591,7 @@ int ath_attach(u16 devid, struct ath_softc *sc)
IEEE80211_HW_SUPPORTS_PS | IEEE80211_HW_SUPPORTS_PS |
IEEE80211_HW_PS_NULLFUNC_STACK; 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->flags |= IEEE80211_HW_MFP_CAPABLE;
hw->wiphy->interface_modes = hw->wiphy->interface_modes =
...@@ -2468,6 +2472,9 @@ static int ath9k_set_key(struct ieee80211_hw *hw, ...@@ -2468,6 +2472,9 @@ static int ath9k_set_key(struct ieee80211_hw *hw,
struct ath_softc *sc = hw->priv; struct ath_softc *sc = hw->priv;
int ret = 0; int ret = 0;
if (modparam_nohwcrypt)
return -ENOSPC;
mutex_lock(&sc->mutex); mutex_lock(&sc->mutex);
ath9k_ps_wakeup(sc); ath9k_ps_wakeup(sc);
DPRINTF(sc, ATH_DBG_KEYCACHE, "Set HW Key\n"); DPRINTF(sc, ATH_DBG_KEYCACHE, "Set HW Key\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment