ath5k: Cleanup turbo channel flags
authorNick Kossifidis <mickflemm@gmail.com>
Tue, 23 Nov 2010 19:49:53 +0000 (21:49 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 30 Nov 2010 18:53:45 +0000 (13:53 -0500)
 * 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>
drivers/net/wireless/ath/ath5k/ath5k.h
drivers/net/wireless/ath/ath5k/base.c
drivers/net/wireless/ath/ath5k/phy.c
drivers/net/wireless/ath/ath5k/reset.c

index 385b91911abcc500edddb3b5919517e5ce4d6b09..81ad236932c87c0a2cc2f758a64d8ebd815c5c5b 100644 (file)
@@ -686,7 +686,6 @@ struct ath5k_gain {
 
 /* channel_flags */
 #define        CHANNEL_CW_INT  0x0008  /* Contention Window interference detected */
-#define        CHANNEL_TURBO   0x0010  /* Turbo Channel */
 #define        CHANNEL_CCK     0x0020  /* CCK channel */
 #define        CHANNEL_OFDM    0x0040  /* OFDM channel */
 #define        CHANNEL_2GHZ    0x0080  /* 2GHz channel. */
@@ -698,16 +697,10 @@ struct ath5k_gain {
 #define        CHANNEL_A       (CHANNEL_5GHZ|CHANNEL_OFDM)
 #define        CHANNEL_B       (CHANNEL_2GHZ|CHANNEL_CCK)
 #define        CHANNEL_G       (CHANNEL_2GHZ|CHANNEL_OFDM)
-#define        CHANNEL_T       (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_TURBO)
-#define        CHANNEL_TG      (CHANNEL_2GHZ|CHANNEL_OFDM|CHANNEL_TURBO)
-#define        CHANNEL_108A    CHANNEL_T
-#define        CHANNEL_108G    CHANNEL_TG
 #define        CHANNEL_X       (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_XR)
 
-#define        CHANNEL_ALL     (CHANNEL_OFDM|CHANNEL_CCK|CHANNEL_2GHZ|CHANNEL_5GHZ| \
-               CHANNEL_TURBO)
+#define        CHANNEL_ALL     (CHANNEL_OFDM|CHANNEL_CCK|CHANNEL_2GHZ|CHANNEL_5GHZ)
 
-#define        CHANNEL_ALL_NOTURBO     (CHANNEL_ALL & ~CHANNEL_TURBO)
 #define CHANNEL_MODES          CHANNEL_ALL
 
 /*
index 33cd1bc4a71c48be26f5e09b4d91da6da676d2cf..80831171f1b01173933496aa7e2971d0c57f8165 100644 (file)
@@ -364,11 +364,6 @@ ath5k_copy_channels(struct ath5k_hw *ah,
                case AR5K_MODE_11G:
                        channels[count].hw_value = chfreq | CHANNEL_OFDM;
                        break;
-               case AR5K_MODE_11A_TURBO:
-               case AR5K_MODE_11G_TURBO:
-                       channels[count].hw_value = chfreq |
-                               CHANNEL_OFDM | CHANNEL_TURBO;
-                       break;
                case AR5K_MODE_11B:
                        channels[count].hw_value = CHANNEL_B;
                }
index 95b602b4f4460c9d49b3310f4b73b7d9516f33ff..61d3800c8118afa442fd3948636b5a58920fde8a 100644 (file)
@@ -1358,12 +1358,10 @@ void ath5k_hw_update_noise_floor(struct ath5k_hw *ah)
 
        switch (ah->ah_current_channel->hw_value & CHANNEL_MODES) {
        case CHANNEL_A:
-       case CHANNEL_T:
        case CHANNEL_XR:
                ee_mode = AR5K_EEPROM_MODE_11A;
                break;
        case CHANNEL_G:
-       case CHANNEL_TG:
                ee_mode = AR5K_EEPROM_MODE_11G;
                break;
        default:
@@ -1946,12 +1944,10 @@ ath5k_hw_set_antenna_mode(struct ath5k_hw *ah, u8 ant_mode)
 
        switch (channel->hw_value & CHANNEL_MODES) {
        case CHANNEL_A:
-       case CHANNEL_T:
        case CHANNEL_XR:
                ee_mode = AR5K_EEPROM_MODE_11A;
                break;
        case CHANNEL_G:
-       case CHANNEL_TG:
                ee_mode = AR5K_EEPROM_MODE_11G;
                break;
        case CHANNEL_B:
@@ -2385,20 +2381,20 @@ ath5k_get_max_ctl_power(struct ath5k_hw *ah,
 
        switch (channel->hw_value & CHANNEL_MODES) {
        case CHANNEL_A:
-               ctl_mode |= AR5K_CTL_11A;
+               if (ah->ah_bwmode == AR5K_BWMODE_40MHZ)
+                       ctl_mode |= AR5K_CTL_TURBO;
+               else
+                       ctl_mode |= AR5K_CTL_11A;
                break;
        case CHANNEL_G:
-               ctl_mode |= AR5K_CTL_11G;
+               if (ah->ah_bwmode == AR5K_BWMODE_40MHZ)
+                       ctl_mode |= AR5K_CTL_TURBOG;
+               else
+                       ctl_mode |= AR5K_CTL_11G;
                break;
        case CHANNEL_B:
                ctl_mode |= AR5K_CTL_11B;
                break;
-       case CHANNEL_T:
-               ctl_mode |= AR5K_CTL_TURBO;
-               break;
-       case CHANNEL_TG:
-               ctl_mode |= AR5K_CTL_TURBOG;
-               break;
        case CHANNEL_XR:
                /* Fall through */
        default:
@@ -3210,12 +3206,10 @@ int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower)
 
        switch (channel->hw_value & CHANNEL_MODES) {
        case CHANNEL_A:
-       case CHANNEL_T:
        case CHANNEL_XR:
                ee_mode = AR5K_EEPROM_MODE_11A;
                break;
        case CHANNEL_G:
-       case CHANNEL_TG:
                ee_mode = AR5K_EEPROM_MODE_11G;
                break;
        case CHANNEL_B:
index c72910015454c4aa440ff0079bce1f384f3b1965..7d8ef8decf0083d6387d37f81cf53593e12a318b 100644 (file)
@@ -834,7 +834,7 @@ static void ath5k_hw_commit_eeprom_settings(struct ath5k_hw *ah,
                AR5K_PHY_NF_SVAL(ee->ee_noise_floor_thr[ee_mode]),
                AR5K_PHY_NFTHRES);
 
-       if ((channel->hw_value & CHANNEL_TURBO) &&
+       if ((ah->ah_bwmode == AR5K_BWMODE_40MHZ) &&
        (ah->ah_ee_version >= AR5K_EEPROM_VERSION_5_0)) {
                /* Switch settling time (Turbo) */
                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,
                freq = AR5K_INI_RFGAIN_2GHZ;
                ee_mode = AR5K_EEPROM_MODE_11B;
                break;
-       case CHANNEL_T:
-               mode = AR5K_MODE_11A_TURBO;
-               freq = AR5K_INI_RFGAIN_5GHZ;
-               ee_mode = AR5K_EEPROM_MODE_11A;
-               break;
-       case CHANNEL_TG:
-               if (ah->ah_version == AR5K_AR5211) {
-                       ATH5K_ERR(ah->ah_sc,
-                               "TurboG mode not available on 5211");
-                       return -EINVAL;
-               }
-               mode = AR5K_MODE_11G_TURBO;
-               freq = AR5K_INI_RFGAIN_2GHZ;
-               ee_mode = AR5K_EEPROM_MODE_11G;
-               break;
        case CHANNEL_XR:
                if (ah->ah_version == AR5K_AR5211) {
                        ATH5K_ERR(ah->ah_sc,