aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
diff options
context:
space:
mode:
authorDaniel C Halperin <daniel.c.halperin@intel.com>2009-08-28 12:44:45 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-31 14:42:09 -0400
commit5027309b5581e9c251a46f0ecbf88996d5e0f1e0 (patch)
tree78b42b3f93e377381623701944ee439994078fa6 /drivers/net/wireless/iwlwifi/iwl-agn-rs.c
parent9e39f7c5b311a306977c5471f9e2ce4c456aa038 (diff)
iwlwifi: remove 60 Mbps from sband bitrates table
ieee80211_supported_band is supposed to only contain legacy rates in the bitrates table (HT rates go in the ieee80211_sta_ht_cap substruct). Make iwlwifi driver obey this restriction by removing the 60 Mbps rate. Also, clean up a few pieces of other code that formerly relied on 60 Mbps being in sband->bitrates. Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c48
1 files changed, 20 insertions, 28 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 26ec969e265d..8239e5508cac 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -818,15 +818,15 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
818{ 818{
819 int status; 819 int status;
820 u8 retries; 820 u8 retries;
821 int rs_index, index = 0; 821 int rs_index, mac_index, index = 0;
822 struct iwl_lq_sta *lq_sta = priv_sta; 822 struct iwl_lq_sta *lq_sta = priv_sta;
823 struct iwl_link_quality_cmd *table; 823 struct iwl_link_quality_cmd *table;
824 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 824 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
825 struct iwl_priv *priv = (struct iwl_priv *)priv_r; 825 struct iwl_priv *priv = (struct iwl_priv *)priv_r;
826 struct ieee80211_hw *hw = priv->hw;
827 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 826 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
828 struct iwl_rate_scale_data *window = NULL; 827 struct iwl_rate_scale_data *window = NULL;
829 struct iwl_rate_scale_data *search_win = NULL; 828 struct iwl_rate_scale_data *search_win = NULL;
829 enum mac80211_rate_control_flags mac_flags;
830 u32 tx_rate; 830 u32 tx_rate;
831 struct iwl_scale_tbl_info tbl_type; 831 struct iwl_scale_tbl_info tbl_type;
832 struct iwl_scale_tbl_info *curr_tbl, *search_tbl; 832 struct iwl_scale_tbl_info *curr_tbl, *search_tbl;
@@ -876,16 +876,17 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
876 rs_get_tbl_info_from_mcs(tx_rate, priv->band, &tbl_type, &rs_index); 876 rs_get_tbl_info_from_mcs(tx_rate, priv->band, &tbl_type, &rs_index);
877 if (priv->band == IEEE80211_BAND_5GHZ) 877 if (priv->band == IEEE80211_BAND_5GHZ)
878 rs_index -= IWL_FIRST_OFDM_RATE; 878 rs_index -= IWL_FIRST_OFDM_RATE;
879 mac_flags = info->status.rates[0].flags;
880 mac_index = info->status.rates[0].idx;
879 881
880 if ((info->status.rates[0].idx < 0) || 882 if ((mac_index < 0) ||
881 (tbl_type.is_SGI != !!(info->status.rates[0].flags & IEEE80211_TX_RC_SHORT_GI)) || 883 (tbl_type.is_SGI != !!(mac_flags & IEEE80211_TX_RC_SHORT_GI)) ||
882 (tbl_type.is_ht40 != !!(info->status.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)) || 884 (tbl_type.is_ht40 != !!(mac_flags & IEEE80211_TX_RC_40_MHZ_WIDTH)) ||
883 (tbl_type.is_dup != !!(info->status.rates[0].flags & IEEE80211_TX_RC_DUP_DATA)) || 885 (tbl_type.is_dup != !!(mac_flags & IEEE80211_TX_RC_DUP_DATA)) ||
884 (tbl_type.ant_type != info->antenna_sel_tx) || 886 (tbl_type.ant_type != info->antenna_sel_tx) ||
885 (!!(tx_rate & RATE_MCS_HT_MSK) != !!(info->status.rates[0].flags & IEEE80211_TX_RC_MCS)) || 887 (!!(tx_rate & RATE_MCS_HT_MSK) != !!(mac_flags & IEEE80211_TX_RC_MCS)) ||
886 (!!(tx_rate & RATE_MCS_GF_MSK) != !!(info->status.rates[0].flags & IEEE80211_TX_RC_GREEN_FIELD)) || 888 (!!(tx_rate & RATE_MCS_GF_MSK) != !!(mac_flags & IEEE80211_TX_RC_GREEN_FIELD)) ||
887 (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate != 889 rs_index != mac_index) {
888 hw->wiphy->bands[info->band]->bitrates[info->status.rates[0].idx].bitrate)) {
889 IWL_DEBUG_RATE(priv, "initial rate does not match 0x%x\n", tx_rate); 890 IWL_DEBUG_RATE(priv, "initial rate does not match 0x%x\n", tx_rate);
890 /* the last LQ command could failed so the LQ in ucode not 891 /* the last LQ command could failed so the LQ in ucode not
891 * the same in driver sync up 892 * the same in driver sync up
@@ -2542,8 +2543,12 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, void *priv_sta,
2542 if (lq_sta->last_rate_n_flags & RATE_MCS_GF_MSK) 2543 if (lq_sta->last_rate_n_flags & RATE_MCS_GF_MSK)
2543 info->control.rates[0].flags |= IEEE80211_TX_RC_GREEN_FIELD; 2544 info->control.rates[0].flags |= IEEE80211_TX_RC_GREEN_FIELD;
2544 } else { 2545 } else {
2545 if (rate_idx < 0 || rate_idx > IWL_RATE_COUNT) 2546 /* Check for invalid rates */
2547 if ((rate_idx < 0) || (rate_idx >= IWL_RATE_COUNT_LEGACY) ||
2548 ((sband->band == IEEE80211_BAND_5GHZ) &&
2549 (rate_idx < IWL_FIRST_OFDM_RATE)))
2546 rate_idx = rate_lowest_index(sband, sta); 2550 rate_idx = rate_lowest_index(sband, sta);
2551 /* On valid 5 GHz rate, adjust index */
2547 else if (sband->band == IEEE80211_BAND_5GHZ) 2552 else if (sband->band == IEEE80211_BAND_5GHZ)
2548 rate_idx -= IWL_FIRST_OFDM_RATE; 2553 rate_idx -= IWL_FIRST_OFDM_RATE;
2549 info->control.rates[0].flags = 0; 2554 info->control.rates[0].flags = 0;
@@ -2584,9 +2589,6 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
2584 struct ieee80211_conf *conf = &priv->hw->conf; 2589 struct ieee80211_conf *conf = &priv->hw->conf;
2585 struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap; 2590 struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;
2586 struct iwl_lq_sta *lq_sta = priv_sta; 2591 struct iwl_lq_sta *lq_sta = priv_sta;
2587 u16 mask_bit = 0;
2588 int count;
2589 int start_rate = 0;
2590 2592
2591 lq_sta->flush_timer = 0; 2593 lq_sta->flush_timer = 0;
2592 lq_sta->supp_rates = sta->supp_rates[sband->band]; 2594 lq_sta->supp_rates = sta->supp_rates[sband->band];
@@ -2661,20 +2663,10 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
2661 lq_sta->tx_agg_tid_en = IWL_AGG_ALL_TID; 2663 lq_sta->tx_agg_tid_en = IWL_AGG_ALL_TID;
2662 lq_sta->drv = priv; 2664 lq_sta->drv = priv;
2663 2665
2664 /* Find highest tx rate supported by hardware and destination station */ 2666 /* Set last_txrate_idx to lowest rate */
2665 mask_bit = sta->supp_rates[sband->band]; 2667 lq_sta->last_txrate_idx = rate_lowest_index(sband, sta);
2666 count = sband->n_bitrates; 2668 if (sband->band == IEEE80211_BAND_5GHZ)
2667 if (sband->band == IEEE80211_BAND_5GHZ) { 2669 lq_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE;
2668 count += IWL_FIRST_OFDM_RATE;
2669 start_rate = IWL_FIRST_OFDM_RATE;
2670 mask_bit <<= IWL_FIRST_OFDM_RATE;
2671 }
2672
2673 mask_bit = mask_bit & lq_sta->active_legacy_rate;
2674 lq_sta->last_txrate_idx = 4;
2675 for (i = start_rate; i < count; i++)
2676 if (mask_bit & BIT(i))
2677 lq_sta->last_txrate_idx = i;
2678 2670
2679 rs_initialize_lq(priv, conf, sta, lq_sta); 2671 rs_initialize_lq(priv, conf, sta, lq_sta);
2680} 2672}