aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-10-11 17:30:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-10-14 13:39:58 -0400
commit1a5e63265f6dbd616596325d899332ddc506e83e (patch)
tree4eaf70839662595abc190ca1aef08f002fa04ed0 /drivers
parent8896934c168474079ba1e81cf3f0c4a975b30406 (diff)
ath9k_hw: remove IS_CHAN_B()
Hardware 802.11b-only mode isn't supported by the driver (the device is configured for 802.11n/g instead). Simplify the code by removing checks for it. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar5008_phy.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_calib.c7
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.c6
6 files changed, 13 insertions, 22 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
index 2bfa6fbc6bb1..b197bf2047e7 100644
--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -794,8 +794,10 @@ static void ar5008_hw_set_rfmode(struct ath_hw *ah, struct ath9k_channel *chan)
794 if (chan == NULL) 794 if (chan == NULL)
795 return; 795 return;
796 796
797 rfMode |= (IS_CHAN_B(chan) || IS_CHAN_G(chan)) 797 if (IS_CHAN_2GHZ(chan))
798 ? AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM; 798 rfMode |= AR_PHY_MODE_DYNAMIC;
799 else
800 rfMode |= AR_PHY_MODE_OFDM;
799 801
800 if (!AR_SREV_9280_20_OR_LATER(ah)) 802 if (!AR_SREV_9280_20_OR_LATER(ah))
801 rfMode |= (IS_CHAN_5GHZ(chan)) ? 803 rfMode |= (IS_CHAN_5GHZ(chan)) ?
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
index 32376ad74011..cdc74005650c 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
@@ -33,15 +33,12 @@ static bool ar9002_hw_is_cal_supported(struct ath_hw *ah,
33 bool supported = false; 33 bool supported = false;
34 switch (ah->supp_cals & cal_type) { 34 switch (ah->supp_cals & cal_type) {
35 case IQ_MISMATCH_CAL: 35 case IQ_MISMATCH_CAL:
36 /* Run IQ Mismatch for non-CCK only */ 36 supported = true;
37 if (!IS_CHAN_B(chan))
38 supported = true;
39 break; 37 break;
40 case ADC_GAIN_CAL: 38 case ADC_GAIN_CAL:
41 case ADC_DC_CAL: 39 case ADC_DC_CAL:
42 /* Run ADC Gain Cal for non-CCK & non 2GHz-HT20 only */ 40 /* Run ADC Gain Cal for non-CCK & non 2GHz-HT20 only */
43 if (!IS_CHAN_B(chan) && 41 if (!((IS_CHAN_2GHZ(chan) || IS_CHAN_A_FAST_CLOCK(ah, chan)) &&
44 !((IS_CHAN_2GHZ(chan) || IS_CHAN_A_FAST_CLOCK(ah, chan)) &&
45 IS_CHAN_HT20(chan))) 42 IS_CHAN_HT20(chan)))
46 supported = true; 43 supported = true;
47 break; 44 break;
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index 724984430448..312c868f05be 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -808,8 +808,10 @@ static void ar9003_hw_set_rfmode(struct ath_hw *ah,
808 if (chan == NULL) 808 if (chan == NULL)
809 return; 809 return;
810 810
811 rfMode |= (IS_CHAN_B(chan) || IS_CHAN_G(chan)) 811 if (IS_CHAN_2GHZ(chan))
812 ? AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM; 812 rfMode |= AR_PHY_MODE_DYNAMIC;
813 else
814 rfMode |= AR_PHY_MODE_OFDM;
813 815
814 if (IS_CHAN_A_FAST_CLOCK(ah, chan)) 816 if (IS_CHAN_A_FAST_CLOCK(ah, chan))
815 rfMode |= (AR_PHY_MODE_DYNAMIC | AR_PHY_MODE_DYN_CCK_DISABLE); 817 rfMode |= (AR_PHY_MODE_DYNAMIC | AR_PHY_MODE_DYN_CCK_DISABLE);
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 7c4d600b14db..34c8e2ebb69b 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -190,10 +190,7 @@ EXPORT_SYMBOL(ath9k_hw_wait);
190void ath9k_hw_synth_delay(struct ath_hw *ah, struct ath9k_channel *chan, 190void ath9k_hw_synth_delay(struct ath_hw *ah, struct ath9k_channel *chan,
191 int hw_delay) 191 int hw_delay)
192{ 192{
193 if (IS_CHAN_B(chan)) 193 hw_delay /= 10;
194 hw_delay = (4 * hw_delay) / 22;
195 else
196 hw_delay /= 10;
197 194
198 if (IS_CHAN_HALF_RATE(chan)) 195 if (IS_CHAN_HALF_RATE(chan))
199 hw_delay *= 2; 196 hw_delay *= 2;
@@ -1159,9 +1156,7 @@ u32 ath9k_regd_get_ctl(struct ath_regulatory *reg, struct ath9k_channel *chan)
1159{ 1156{
1160 u32 ctl = ath_regd_get_band_ctl(reg, chan->chan->band); 1157 u32 ctl = ath_regd_get_band_ctl(reg, chan->chan->band);
1161 1158
1162 if (IS_CHAN_B(chan)) 1159 if (IS_CHAN_G(chan))
1163 ctl |= CTL_11B;
1164 else if (IS_CHAN_G(chan))
1165 ctl |= CTL_11G; 1160 ctl |= CTL_11G;
1166 else 1161 else
1167 ctl |= CTL_11A; 1162 ctl |= CTL_11A;
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 102b3b6571f3..eaaf98ba2509 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -455,7 +455,6 @@ struct ath9k_channel {
455 ((_ah)->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK)) 455 ((_ah)->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK))
456 456
457/* These macros check chanmode and not channelFlags */ 457/* These macros check chanmode and not channelFlags */
458#define IS_CHAN_B(_c) ((_c)->chanmode == CHANNEL_B)
459#define IS_CHAN_HT20(_c) (((_c)->chanmode == CHANNEL_A_HT20) || \ 458#define IS_CHAN_HT20(_c) (((_c)->chanmode == CHANNEL_A_HT20) || \
460 ((_c)->chanmode == CHANNEL_G_HT20)) 459 ((_c)->chanmode == CHANNEL_G_HT20))
461#define IS_CHAN_HT40(_c) (((_c)->chanmode == CHANNEL_A_HT40PLUS) || \ 460#define IS_CHAN_HT40(_c) (((_c)->chanmode == CHANNEL_A_HT40PLUS) || \
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index a3eff0986a3f..6a18f9d3e9cc 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -374,7 +374,6 @@ EXPORT_SYMBOL(ath9k_hw_releasetxqueue);
374bool ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q) 374bool ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q)
375{ 375{
376 struct ath_common *common = ath9k_hw_common(ah); 376 struct ath_common *common = ath9k_hw_common(ah);
377 struct ath9k_channel *chan = ah->curchan;
378 struct ath9k_tx_queue_info *qi; 377 struct ath9k_tx_queue_info *qi;
379 u32 cwMin, chanCwMin, value; 378 u32 cwMin, chanCwMin, value;
380 379
@@ -387,10 +386,7 @@ bool ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q)
387 ath_dbg(common, QUEUE, "Reset TX queue: %u\n", q); 386 ath_dbg(common, QUEUE, "Reset TX queue: %u\n", q);
388 387
389 if (qi->tqi_cwmin == ATH9K_TXQ_USEDEFAULT) { 388 if (qi->tqi_cwmin == ATH9K_TXQ_USEDEFAULT) {
390 if (chan && IS_CHAN_B(chan)) 389 chanCwMin = INIT_CWMIN;
391 chanCwMin = INIT_CWMIN_11B;
392 else
393 chanCwMin = INIT_CWMIN;
394 390
395 for (cwMin = 1; cwMin < chanCwMin; cwMin = (cwMin << 1) | 1); 391 for (cwMin = 1; cwMin < chanCwMin; cwMin = (cwMin << 1) | 1);
396 } else 392 } else