This patch removes usage of all Atheros turbo modes from iwlwifi. This patch is intended for the iwlwifi branch of wireless-dev after a pull from origin/everything once 01-remove-atheros-turbo-from-mac80211.diff is applied. Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxx> Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx> Cc: Zhu Yi <yi.zhu@xxxxxxxxx> Cc: Jiri Slaby <jirislaby@xxxxxxxxx> Cc: Michael Wu <flamingice@xxxxxxxxxxxx> CC: Johannes Berg <johannes@xxxxxxxxxxxxxxxx> -- drivers/net/wireless/iwl-4965-rs.c | 18 ++++++------------ drivers/net/wireless/iwl-4965.c | 12 ++++-------- drivers/net/wireless/iwl-base.c | 36 +++++++----------------------------- drivers/net/wireless/iwl-channel.h | 6 ++---- 4 files changed, 19 insertions(+), 53 deletions(-) Luis
[PATCH] Remove use of Atheros-specific modes from iwlwifi This patch removes usage of all Atheros turbo modes usage from iwlwifi. This patch is intended for the iwlwifi branch of wireless-dev after a pull from origin/everything once 01-remove-atheros-turbo-from-mac80211.diff is applied. Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxx> Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx> Cc: Zhu Yi <yi.zhu@xxxxxxxxx> Cc: Jiri Slaby <jirislaby@xxxxxxxxx> diff --git a/drivers/net/wireless/iwl-4965-rs.c b/drivers/net/wireless/iwl-4965-rs.c index 66493b0..e598c0c 100644 --- a/drivers/net/wireless/iwl-4965-rs.c +++ b/drivers/net/wireless/iwl-4965-rs.c @@ -376,8 +376,7 @@ static int rs_get_tbl_info_from_mcs(const struct iwl_rate *mcs_rate, tbl->lq_type = LQ_NONE; else { - if ((phymode == MODE_ATHEROS_TURBO) || - (phymode == MODE_IEEE80211A)) + if (phymode == MODE_IEEE80211A) tbl->lq_type = LQ_A; else tbl->lq_type = LQ_G; @@ -554,8 +553,7 @@ static int rs_get_lower_rate(struct iwl_rate_scale_priv *lq_data, if (!is_legacy(tbl->lq_type) && (!ht_possible || !scale_index)) { switch_to_legacy = 1; scale_index = rs_ht_to_legacy[scale_index]; - if ((lq_data->phymode == MODE_IEEE80211A) || - (lq_data->phymode == MODE_ATHEROS_TURBO)) + if (lq_data->phymode == MODE_IEEE80211A) tbl->lq_type = LQ_A; else tbl->lq_type = LQ_G; @@ -572,8 +570,7 @@ static int rs_get_lower_rate(struct iwl_rate_scale_priv *lq_data, /* mask with station rate restriction */ if (is_legacy(tbl->lq_type)) { - if ((lq_data->phymode == (u8) MODE_IEEE80211A) || - (lq_data->phymode == (u8) MODE_ATHEROS_TURBO)) + if (lq_data->phymode == (u8) MODE_IEEE80211A) rate_mask = (u16)(rate_mask & (sta->supp_rates << IWL_FIRST_OFDM_RATE)); else @@ -1411,8 +1408,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, /* mask with station rate restriction */ if (is_legacy(tbl->lq_type)) { - if ((lq_data->phymode == (u8) MODE_IEEE80211A) || - (lq_data->phymode == (u8) MODE_ATHEROS_TURBO)) + if (lq_data->phymode == (u8) MODE_IEEE80211A) rate_scale_index_msk = (u16) (rate_mask & (sta->supp_rates << IWL_FIRST_OFDM_RATE)); else @@ -1657,8 +1653,7 @@ out: /* sta->txrate is an index to A mode rates which start * at IWL_FIRST_OFDM_RATE */ - if ((lq_data->phymode == (u8) MODE_IEEE80211A) || - (lq_data->phymode == (u8) MODE_ATHEROS_TURBO)) + if (lq_data->phymode == (u8) MODE_IEEE80211A) sta->txrate = i - IWL_FIRST_OFDM_RATE; return; @@ -1881,8 +1876,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, /* For MODE_IEEE80211A mode cck rate are at end * rate table */ - if ((local->hw.conf.phymode == MODE_IEEE80211A) || - (local->hw.conf.phymode == MODE_ATHEROS_TURBO)) + if (local->hw.conf.phymode == MODE_IEEE80211A) sta->last_txrate += IWL_FIRST_OFDM_RATE; crl->is_dup = priv->is_dup; diff --git a/drivers/net/wireless/iwl-4965.c b/drivers/net/wireless/iwl-4965.c index 6b6ab52..3c93af6 100644 --- a/drivers/net/wireless/iwl-4965.c +++ b/drivers/net/wireless/iwl-4965.c @@ -2558,8 +2558,7 @@ int iwl_hw_reg_send_txpower(struct iwl_priv *priv) } band = ((priv->phymode == MODE_IEEE80211B) || - (priv->phymode == MODE_IEEE80211G) || - (priv->phymode == MODE_ATHEROS_TURBOG)) ? 1 : 0; + (priv->phymode == MODE_IEEE80211G)); is_fat = is_fat_channel(priv->active_rxon.flags); @@ -2591,8 +2590,7 @@ int iwl_hw_channel_switch(struct iwl_priv *priv, u16 channel) const struct iwl_channel_info *ch_info; band = ((priv->phymode == MODE_IEEE80211B) || - (priv->phymode == MODE_IEEE80211G) || - (priv->phymode == MODE_ATHEROS_TURBOG)) ? 1 : 0; + (priv->phymode == MODE_IEEE80211G)); ch_info = iwl_get_channel_info(priv, priv->phymode, channel); @@ -4367,8 +4365,7 @@ void iwl4965_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap) * all the way to 1M in IEEE order and then spin on IEEE */ if (is_ap) r = IWL_RATE_54M_INDEX; - else if ((priv->phymode == MODE_IEEE80211A) || - (priv->phymode == MODE_ATHEROS_TURBO)) + else if (priv->phymode == MODE_IEEE80211A) r = IWL_RATE_6M_INDEX; else r = IWL_RATE_1M_INDEX; @@ -4432,8 +4429,7 @@ static u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv, return 0; /* no fat tx allowed on 2.4GHZ */ - if ((priv->phymode != MODE_IEEE80211A) && - (priv->phymode != MODE_ATHEROS_TURBO)) + if (priv->phymode != MODE_IEEE80211A) return 0; return (iwl_is_channel_extension(priv, priv->phymode, ht_info->control_chan, diff --git a/drivers/net/wireless/iwl-base.c b/drivers/net/wireless/iwl-base.c index addb1a1..e96c57b 100644 --- a/drivers/net/wireless/iwl-base.c +++ b/drivers/net/wireless/iwl-base.c @@ -974,8 +974,7 @@ static int iwl_set_rxon_channel(struct iwl_priv *priv, u8 phymode, u16 channel) return 0; priv->staging_rxon.channel = cpu_to_le16(channel); - if ((phymode == MODE_IEEE80211A) || - (phymode == MODE_ATHEROS_TURBO)) + if (phymode == MODE_IEEE80211A) priv->staging_rxon.flags &= ~RXON_FLG_BAND_24G_MSK; else priv->staging_rxon.flags |= RXON_FLG_BAND_24G_MSK; @@ -2567,8 +2566,7 @@ static int iwl_set_rxon_hwcrypto(struct iwl_priv *priv, int hw_decrypt) static void iwl_set_flags_for_phymode(struct iwl_priv *priv, u8 phymode) { - if ((phymode == MODE_IEEE80211A) || - (phymode == MODE_ATHEROS_TURBO)) { + if (phymode == MODE_IEEE80211A) { priv->staging_rxon.flags &= ~(RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK | RXON_FLG_CCK_MSK); @@ -3111,8 +3109,7 @@ static void iwl_set_rate(struct iwl_priv *priv) priv->active_rate_basic = 0; IWL_DEBUG_RATE("Setting rates for 802.11%c\n", - ((hw->mode == MODE_IEEE80211A) || - (hw->mode == MODE_ATHEROS_TURBO)) ? + hw->mode == MODE_IEEE80211A ? 'a' : ((hw->mode == MODE_IEEE80211B) ? 'b' : 'g')); for (i = 0; i < hw->num_rates; i++) { @@ -5441,7 +5438,6 @@ const struct iwl_channel_info *iwl_get_channel_info(const struct iwl_priv *priv, int i; switch (phymode) { - case MODE_ATHEROS_TURBO: case MODE_IEEE80211A: for (i = 14; i < priv->channel_count; i++) { if (priv->channel_info[i].channel == channel) @@ -5451,7 +5447,6 @@ const struct iwl_channel_info *iwl_get_channel_info(const struct iwl_priv *priv, case MODE_IEEE80211B: case MODE_IEEE80211G: - case MODE_ATHEROS_TURBOG: if (channel >= 1 && channel <= 14) return &priv->channel_info[channel - 1]; break; @@ -5636,8 +5631,7 @@ static int iwl_init_channel_map(struct iwl_priv *priv) static inline u16 iwl_get_active_dwell_time(struct iwl_priv *priv, int phymode) { - if ((phymode == MODE_IEEE80211A) || - (phymode == MODE_ATHEROS_TURBO)) + if (phymode == MODE_IEEE80211A) return IWL_ACTIVE_DWELL_TIME_52; else return IWL_ACTIVE_DWELL_TIME_24; @@ -5646,8 +5640,7 @@ static inline u16 iwl_get_active_dwell_time(struct iwl_priv *priv, int phymode) static u16 iwl_get_passive_dwell_time(struct iwl_priv *priv, int phymode) { u16 active = iwl_get_active_dwell_time(priv, phymode); - u16 passive = ((phymode != MODE_IEEE80211A) && - (phymode != MODE_ATHEROS_TURBO)) ? + u16 passive = (phymode != MODE_IEEE80211A) ? IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 : IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_52; @@ -5728,8 +5721,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv, int phymode, /* scan_pwr_info->tpc.dsp_atten; */ /*scan_pwr_info->tpc.tx_gain; */ - if ((phymode == MODE_IEEE80211A) || - (phymode == MODE_ATHEROS_TURBO)) + if (phymode == MODE_IEEE80211A) scan_ch->tpc.tx_gain = ((1 << 5) | (3 << 3)) | 3; else { scan_ch->tpc.tx_gain = ((1 << 5) | (5 << 3)); @@ -5881,19 +5873,6 @@ static int iwl_init_geos(struct iwl_priv *priv) modes[G].num_rates = 12; /* OFDM & CCK */ modes[G].num_channels = 0; -#if IWL == 4965 - modes[G_11N].mode = MODE_ATHEROS_TURBOG; - modes[G_11N].channels = channels; - modes[G_11N].num_rates = 13; /* OFDM & CCK */ - modes[G_11N].rates = rates; - modes[G_11N].num_channels = 0; - - modes[A_11N].mode = MODE_ATHEROS_TURBO; - modes[A_11N].channels = &channels[ARRAY_SIZE(iwl_eeprom_band_1)]; - modes[A_11N].rates = &rates[4]; - modes[A_11N].num_rates = 9; /* just OFDM */ - modes[A_11N].num_channels = 0; -#endif priv->ieee_channels = channels; priv->ieee_rates = rates; @@ -8329,8 +8308,7 @@ static void iwl_mac_get_ht_capab(struct ieee80211_hw *hw, use_wide_channel = 0; /* no fat tx allowed on 2.4GHZ */ - if ((priv->phymode != MODE_IEEE80211A) && - (priv->phymode != MODE_ATHEROS_TURBO)) + if (priv->phymode != MODE_IEEE80211A) use_wide_channel = 0; iwl_set_ht_capab(hw, ht_cap, use_wide_channel); diff --git a/drivers/net/wireless/iwl-channel.h b/drivers/net/wireless/iwl-channel.h index 97da370..023c3f2 100644 --- a/drivers/net/wireless/iwl-channel.h +++ b/drivers/net/wireless/iwl-channel.h @@ -136,15 +136,13 @@ static inline int is_channel_radar(const struct iwl_channel_info *ch_info) static inline u8 is_channel_a_band(const struct iwl_channel_info *ch_info) { - return ((ch_info->phymode == MODE_IEEE80211A) || - (ch_info->phymode == MODE_ATHEROS_TURBO)) ? 1 : 0; + return ch_info->phymode == MODE_IEEE80211A; } static inline u8 is_channel_bg_band(const struct iwl_channel_info *ch_info) { return ((ch_info->phymode == MODE_IEEE80211B) || - (ch_info->phymode == MODE_IEEE80211G) || - (ch_info->phymode == MODE_ATHEROS_TURBOG)) ? 1 : 0; + (ch_info->phymode == MODE_IEEE80211G)); } static inline int is_channel_passive(const struct iwl_channel_info *ch)