ath5k: Disable fast channel switching by default

Disable fast channel change by default on AR2413/AR5413 due to
some bug reports (it still works for me but it's better to be safe).
Add a module parameter "fastchanswitch" in case anyone wants to enable
it and play with it.

Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Nick Kossifidis 2011-06-02 03:09:48 +03:00 committed by John W. Linville
parent bdf492f502
commit a99168eece
2 changed files with 14 additions and 2 deletions

View file

@ -72,6 +72,11 @@ static int modparam_all_channels;
module_param_named(all_channels, modparam_all_channels, bool, S_IRUGO); module_param_named(all_channels, modparam_all_channels, bool, S_IRUGO);
MODULE_PARM_DESC(all_channels, "Expose all channels the device can use."); MODULE_PARM_DESC(all_channels, "Expose all channels the device can use.");
static int modparam_fastchanswitch;
module_param_named(fastchanswitch, modparam_fastchanswitch, bool, S_IRUGO);
MODULE_PARM_DESC(fastchanswitch, "Enable fast channel switching for AR2413/AR5413 radios.");
/* Module info */ /* Module info */
MODULE_AUTHOR("Jiri Slaby"); MODULE_AUTHOR("Jiri Slaby");
MODULE_AUTHOR("Nick Kossifidis"); MODULE_AUTHOR("Nick Kossifidis");
@ -2686,6 +2691,7 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
struct ath5k_hw *ah = sc->ah; struct ath5k_hw *ah = sc->ah;
struct ath_common *common = ath5k_hw_common(ah); struct ath_common *common = ath5k_hw_common(ah);
int ret, ani_mode; int ret, ani_mode;
bool fast;
ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n"); ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n");
@ -2705,7 +2711,10 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
ath5k_drain_tx_buffs(sc); ath5k_drain_tx_buffs(sc);
if (chan) if (chan)
sc->curchan = chan; sc->curchan = chan;
ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, chan != NULL,
fast = ((chan != NULL) && modparam_fastchanswitch) ? 1 : 0;
ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, fast,
skip_pcu); skip_pcu);
if (ret) { if (ret) {
ATH5K_ERR(sc, "can't reset hardware (%d)\n", ret); ATH5K_ERR(sc, "can't reset hardware (%d)\n", ret);

View file

@ -1124,9 +1124,12 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
/* Non fatal, can happen eg. /* Non fatal, can happen eg.
* on mode change */ * on mode change */
ret = 0; ret = 0;
} else } else {
ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_RESET,
"fast chan change successful\n");
return 0; return 0;
} }
}
/* /*
* Save some registers before a reset * Save some registers before a reset