diff options
author | Nick Kossifidis <mickflemm@gmail.com> | 2010-11-23 14:49:53 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-30 13:53:45 -0500 |
commit | acb091d67c5c9649cf5d25055ef6fd64239a6762 (patch) | |
tree | 43c2df5f954cd28c6917709496d269296d22f658 | |
parent | 73a06a683455f472cc09ad249064c66a41e29e39 (diff) |
ath5k: Cleanup turbo channel flags
* Clean up CHANNEL_T(URBO), use AR5K_BWMODE_40MHZ instead
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ath5k.h | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/phy.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/reset.c | 17 |
4 files changed, 10 insertions, 43 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h index 385b91911ab..81ad236932c 100644 --- a/drivers/net/wireless/ath/ath5k/ath5k.h +++ b/drivers/net/wireless/ath/ath5k/ath5k.h | |||
@@ -686,7 +686,6 @@ struct ath5k_gain { | |||
686 | 686 | ||
687 | /* channel_flags */ | 687 | /* channel_flags */ |
688 | #define CHANNEL_CW_INT 0x0008 /* Contention Window interference detected */ | 688 | #define CHANNEL_CW_INT 0x0008 /* Contention Window interference detected */ |
689 | #define CHANNEL_TURBO 0x0010 /* Turbo Channel */ | ||
690 | #define CHANNEL_CCK 0x0020 /* CCK channel */ | 689 | #define CHANNEL_CCK 0x0020 /* CCK channel */ |
691 | #define CHANNEL_OFDM 0x0040 /* OFDM channel */ | 690 | #define CHANNEL_OFDM 0x0040 /* OFDM channel */ |
692 | #define CHANNEL_2GHZ 0x0080 /* 2GHz channel. */ | 691 | #define CHANNEL_2GHZ 0x0080 /* 2GHz channel. */ |
@@ -698,16 +697,10 @@ struct ath5k_gain { | |||
698 | #define CHANNEL_A (CHANNEL_5GHZ|CHANNEL_OFDM) | 697 | #define CHANNEL_A (CHANNEL_5GHZ|CHANNEL_OFDM) |
699 | #define CHANNEL_B (CHANNEL_2GHZ|CHANNEL_CCK) | 698 | #define CHANNEL_B (CHANNEL_2GHZ|CHANNEL_CCK) |
700 | #define CHANNEL_G (CHANNEL_2GHZ|CHANNEL_OFDM) | 699 | #define CHANNEL_G (CHANNEL_2GHZ|CHANNEL_OFDM) |
701 | #define CHANNEL_T (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_TURBO) | ||
702 | #define CHANNEL_TG (CHANNEL_2GHZ|CHANNEL_OFDM|CHANNEL_TURBO) | ||
703 | #define CHANNEL_108A CHANNEL_T | ||
704 | #define CHANNEL_108G CHANNEL_TG | ||
705 | #define CHANNEL_X (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_XR) | 700 | #define CHANNEL_X (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_XR) |
706 | 701 | ||
707 | #define CHANNEL_ALL (CHANNEL_OFDM|CHANNEL_CCK|CHANNEL_2GHZ|CHANNEL_5GHZ| \ | 702 | #define CHANNEL_ALL (CHANNEL_OFDM|CHANNEL_CCK|CHANNEL_2GHZ|CHANNEL_5GHZ) |
708 | CHANNEL_TURBO) | ||
709 | 703 | ||
710 | #define CHANNEL_ALL_NOTURBO (CHANNEL_ALL & ~CHANNEL_TURBO) | ||
711 | #define CHANNEL_MODES CHANNEL_ALL | 704 | #define CHANNEL_MODES CHANNEL_ALL |
712 | 705 | ||
713 | /* | 706 | /* |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 33cd1bc4a71..80831171f1b 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -364,11 +364,6 @@ ath5k_copy_channels(struct ath5k_hw *ah, | |||
364 | case AR5K_MODE_11G: | 364 | case AR5K_MODE_11G: |
365 | channels[count].hw_value = chfreq | CHANNEL_OFDM; | 365 | channels[count].hw_value = chfreq | CHANNEL_OFDM; |
366 | break; | 366 | break; |
367 | case AR5K_MODE_11A_TURBO: | ||
368 | case AR5K_MODE_11G_TURBO: | ||
369 | channels[count].hw_value = chfreq | | ||
370 | CHANNEL_OFDM | CHANNEL_TURBO; | ||
371 | break; | ||
372 | case AR5K_MODE_11B: | 367 | case AR5K_MODE_11B: |
373 | channels[count].hw_value = CHANNEL_B; | 368 | channels[count].hw_value = CHANNEL_B; |
374 | } | 369 | } |
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c index 95b602b4f44..61d3800c811 100644 --- a/drivers/net/wireless/ath/ath5k/phy.c +++ b/drivers/net/wireless/ath/ath5k/phy.c | |||
@@ -1358,12 +1358,10 @@ void ath5k_hw_update_noise_floor(struct ath5k_hw *ah) | |||
1358 | 1358 | ||
1359 | switch (ah->ah_current_channel->hw_value & CHANNEL_MODES) { | 1359 | switch (ah->ah_current_channel->hw_value & CHANNEL_MODES) { |
1360 | case CHANNEL_A: | 1360 | case CHANNEL_A: |
1361 | case CHANNEL_T: | ||
1362 | case CHANNEL_XR: | 1361 | case CHANNEL_XR: |
1363 | ee_mode = AR5K_EEPROM_MODE_11A; | 1362 | ee_mode = AR5K_EEPROM_MODE_11A; |
1364 | break; | 1363 | break; |
1365 | case CHANNEL_G: | 1364 | case CHANNEL_G: |
1366 | case CHANNEL_TG: | ||
1367 | ee_mode = AR5K_EEPROM_MODE_11G; | 1365 | ee_mode = AR5K_EEPROM_MODE_11G; |
1368 | break; | 1366 | break; |
1369 | default: | 1367 | default: |
@@ -1946,12 +1944,10 @@ ath5k_hw_set_antenna_mode(struct ath5k_hw *ah, u8 ant_mode) | |||
1946 | 1944 | ||
1947 | switch (channel->hw_value & CHANNEL_MODES) { | 1945 | switch (channel->hw_value & CHANNEL_MODES) { |
1948 | case CHANNEL_A: | 1946 | case CHANNEL_A: |
1949 | case CHANNEL_T: | ||
1950 | case CHANNEL_XR: | 1947 | case CHANNEL_XR: |
1951 | ee_mode = AR5K_EEPROM_MODE_11A; | 1948 | ee_mode = AR5K_EEPROM_MODE_11A; |
1952 | break; | 1949 | break; |
1953 | case CHANNEL_G: | 1950 | case CHANNEL_G: |
1954 | case CHANNEL_TG: | ||
1955 | ee_mode = AR5K_EEPROM_MODE_11G; | 1951 | ee_mode = AR5K_EEPROM_MODE_11G; |
1956 | break; | 1952 | break; |
1957 | case CHANNEL_B: | 1953 | case CHANNEL_B: |
@@ -2385,20 +2381,20 @@ ath5k_get_max_ctl_power(struct ath5k_hw *ah, | |||
2385 | 2381 | ||
2386 | switch (channel->hw_value & CHANNEL_MODES) { | 2382 | switch (channel->hw_value & CHANNEL_MODES) { |
2387 | case CHANNEL_A: | 2383 | case CHANNEL_A: |
2388 | ctl_mode |= AR5K_CTL_11A; | 2384 | if (ah->ah_bwmode == AR5K_BWMODE_40MHZ) |
2385 | ctl_mode |= AR5K_CTL_TURBO; | ||
2386 | else | ||
2387 | ctl_mode |= AR5K_CTL_11A; | ||
2389 | break; | 2388 | break; |
2390 | case CHANNEL_G: | 2389 | case CHANNEL_G: |
2391 | ctl_mode |= AR5K_CTL_11G; | 2390 | if (ah->ah_bwmode == AR5K_BWMODE_40MHZ) |
2391 | ctl_mode |= AR5K_CTL_TURBOG; | ||
2392 | else | ||
2393 | ctl_mode |= AR5K_CTL_11G; | ||
2392 | break; | 2394 | break; |
2393 | case CHANNEL_B: | 2395 | case CHANNEL_B: |
2394 | ctl_mode |= AR5K_CTL_11B; | 2396 | ctl_mode |= AR5K_CTL_11B; |
2395 | break; | 2397 | break; |
2396 | case CHANNEL_T: | ||
2397 | ctl_mode |= AR5K_CTL_TURBO; | ||
2398 | break; | ||
2399 | case CHANNEL_TG: | ||
2400 | ctl_mode |= AR5K_CTL_TURBOG; | ||
2401 | break; | ||
2402 | case CHANNEL_XR: | 2398 | case CHANNEL_XR: |
2403 | /* Fall through */ | 2399 | /* Fall through */ |
2404 | default: | 2400 | default: |
@@ -3210,12 +3206,10 @@ int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower) | |||
3210 | 3206 | ||
3211 | switch (channel->hw_value & CHANNEL_MODES) { | 3207 | switch (channel->hw_value & CHANNEL_MODES) { |
3212 | case CHANNEL_A: | 3208 | case CHANNEL_A: |
3213 | case CHANNEL_T: | ||
3214 | case CHANNEL_XR: | 3209 | case CHANNEL_XR: |
3215 | ee_mode = AR5K_EEPROM_MODE_11A; | 3210 | ee_mode = AR5K_EEPROM_MODE_11A; |
3216 | break; | 3211 | break; |
3217 | case CHANNEL_G: | 3212 | case CHANNEL_G: |
3218 | case CHANNEL_TG: | ||
3219 | ee_mode = AR5K_EEPROM_MODE_11G; | 3213 | ee_mode = AR5K_EEPROM_MODE_11G; |
3220 | break; | 3214 | break; |
3221 | case CHANNEL_B: | 3215 | case CHANNEL_B: |
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c index c7291001545..7d8ef8decf0 100644 --- a/drivers/net/wireless/ath/ath5k/reset.c +++ b/drivers/net/wireless/ath/ath5k/reset.c | |||
@@ -834,7 +834,7 @@ static void ath5k_hw_commit_eeprom_settings(struct ath5k_hw *ah, | |||
834 | AR5K_PHY_NF_SVAL(ee->ee_noise_floor_thr[ee_mode]), | 834 | AR5K_PHY_NF_SVAL(ee->ee_noise_floor_thr[ee_mode]), |
835 | AR5K_PHY_NFTHRES); | 835 | AR5K_PHY_NFTHRES); |
836 | 836 | ||
837 | if ((channel->hw_value & CHANNEL_TURBO) && | 837 | if ((ah->ah_bwmode == AR5K_BWMODE_40MHZ) && |
838 | (ah->ah_ee_version >= AR5K_EEPROM_VERSION_5_0)) { | 838 | (ah->ah_ee_version >= AR5K_EEPROM_VERSION_5_0)) { |
839 | /* Switch settling time (Turbo) */ | 839 | /* Switch settling time (Turbo) */ |
840 | AR5K_REG_WRITE_BITS(ah, AR5K_PHY_SETTLING, | 840 | AR5K_REG_WRITE_BITS(ah, AR5K_PHY_SETTLING, |
@@ -1019,21 +1019,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
1019 | freq = AR5K_INI_RFGAIN_2GHZ; | 1019 | freq = AR5K_INI_RFGAIN_2GHZ; |
1020 | ee_mode = AR5K_EEPROM_MODE_11B; | 1020 | ee_mode = AR5K_EEPROM_MODE_11B; |
1021 | break; | 1021 | break; |
1022 | case CHANNEL_T: | ||
1023 | mode = AR5K_MODE_11A_TURBO; | ||
1024 | freq = AR5K_INI_RFGAIN_5GHZ; | ||
1025 | ee_mode = AR5K_EEPROM_MODE_11A; | ||
1026 | break; | ||
1027 | case CHANNEL_TG: | ||
1028 | if (ah->ah_version == AR5K_AR5211) { | ||
1029 | ATH5K_ERR(ah->ah_sc, | ||
1030 | "TurboG mode not available on 5211"); | ||
1031 | return -EINVAL; | ||
1032 | } | ||
1033 | mode = AR5K_MODE_11G_TURBO; | ||
1034 | freq = AR5K_INI_RFGAIN_2GHZ; | ||
1035 | ee_mode = AR5K_EEPROM_MODE_11G; | ||
1036 | break; | ||
1037 | case CHANNEL_XR: | 1022 | case CHANNEL_XR: |
1038 | if (ah->ah_version == AR5K_AR5211) { | 1023 | if (ah->ah_version == AR5K_AR5211) { |
1039 | ATH5K_ERR(ah->ah_sc, | 1024 | ATH5K_ERR(ah->ah_sc, |