ath5k: Fix another faulty channel flag check
PATCH 1/4 ath5k: Fix another faulty channel flag check
*Fix another faulty channel flags check
Don't check channel->val against CHANNEL_A/B/G flags because they have common flags set eg. doing AND between CHANNEL_A and CHANNEL_G always returns true because they have CHANNEL_OFDM, same goes for CHANNEL_B and CHANNEL_G that have CHANNEL_2GHZ in common.
Instead check against CHANNEL_CCK/OFDM/2GHZ/5GHZ...
Changes-licensed-under: ISC
---
drivers/net/wireless/ath5k/hw.c +1 -1
@@ -719,7 +719,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, AR5K_SREV_RAD_5112A) {ath5k_hw_reg_write (ah,AR5K_PHY_CCKTXCTL_WORLD ,AR5K_PHY_CCKTXCTL ); -if (channel->val &CHANNEL_A ) +if (channel->val &CHANNEL_5GHZ ) data =0xffb81020 ;else data =0xffb80d20 ;
Quoted 10 lines · Nick Kossifidis
*Fix another faulty channel flags check
Don't check
channel->valagainst CHANNEL_A/B/G flags because they have common flags set eg. doing AND betweenCHANNEL_AandCHANNEL_Galways returns true because they haveCHANNEL_OFDM, same goes forCHANNEL_BandCHANNEL_Gthat haveCHANNEL_2GHZin common.Instead check against CHANNEL_CCK/OFDM/2GHZ/5GHZ...
Changes-licensed-under: ISC
Signed-off-by Nick Kossifidis <[email protected]>
Luis