Skip to contentSkip to conversation

ath5k: Fix another faulty channel flag check

PATCH In review Nick Kossifidis 2 participants 2 messages Nov 14, 2007 – Nov 15, 2007 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

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
index f78ca6e..ead2d75 100644
@@ -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;
Acked-by on v1 1/4
#1 lore raw
Quoted 10 lines · Nick Kossifidis

*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

Luis