From: Felix Fietkau Date: Mon, 18 Nov 2013 19:14:44 +0000 (+0100) Subject: ath9k_hw: allow fast channel change when only CHANNEL_HT changes X-Git-Tag: submit/tizen/20160607.132125~5255^2~482^2^2~131 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af02efb32e34938aecce5362b0cdb70e4d18e846;p=sdk%2Femulator%2Femulator-kernel.git ath9k_hw: allow fast channel change when only CHANNEL_HT changes The CHANNEL_HT flag is insignificant for fast channel change conditions, since it does not affect any important part of the hardware reset / channel setup. Scanning usually runs with HT disabled, so this change will slightly improve scan time on many chipsets. Signed-off-by: Felix Fietkau Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 02eff2a..fe3537f 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c @@ -1502,8 +1502,9 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah, int r; if (pCap->hw_caps & ATH9K_HW_CAP_FCC_BAND_SWITCH) { - band_switch = IS_CHAN_5GHZ(ah->curchan) != IS_CHAN_5GHZ(chan); - mode_diff = (chan->channelFlags != ah->curchan->channelFlags); + u32 flags_diff = chan->channelFlags ^ ah->curchan->channelFlags; + band_switch = !!(flags_diff & CHANNEL_5GHZ); + mode_diff = !!(flags_diff & ~CHANNEL_HT); } for (qnum = 0; qnum < AR_NUM_QCU; qnum++) { @@ -1815,7 +1816,7 @@ static int ath9k_hw_do_fastcc(struct ath_hw *ah, struct ath9k_channel *chan) * If cross-band fcc is not supoprted, bail out if channelFlags differ. */ if (!(pCap->hw_caps & ATH9K_HW_CAP_FCC_BAND_SWITCH) && - chan->channelFlags != ah->curchan->channelFlags) + ((chan->channelFlags ^ ah->curchan->channelFlags) & ~CHANNEL_HT)) goto fail; if (!ath9k_hw_check_alive(ah))