aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c2
7 files changed, 27 insertions, 22 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index e51eeeff6992..f3ca02fe9619 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -464,7 +464,7 @@ static void rs_tx_status(void *priv_rate,
464 464
465 465
466 retries = tx_resp->retry_count; 466 retries = tx_resp->retry_count;
467 first_index = tx_resp->control.tx_rate->hw_value; 467 first_index = sband->bitrates[tx_resp->control.tx_rate_idx].hw_value;
468 if ((first_index < 0) || (first_index >= IWL_RATE_COUNT)) { 468 if ((first_index < 0) || (first_index >= IWL_RATE_COUNT)) {
469 IWL_DEBUG_RATE("leave: Rate out of bounds: %d\n", first_index); 469 IWL_DEBUG_RATE("leave: Rate out of bounds: %d\n", first_index);
470 return; 470 return;
@@ -669,7 +669,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
669 is_multicast_ether_addr(hdr->addr1) || 669 is_multicast_ether_addr(hdr->addr1) ||
670 !sta || !sta->rate_ctrl_priv) { 670 !sta || !sta->rate_ctrl_priv) {
671 IWL_DEBUG_RATE("leave: No STA priv data to update!\n"); 671 IWL_DEBUG_RATE("leave: No STA priv data to update!\n");
672 sel->rate = rate_lowest(local, sband, sta); 672 sel->rate_idx = rate_lowest_index(local, sband, sta);
673 rcu_read_unlock(); 673 rcu_read_unlock();
674 return; 674 return;
675 } 675 }
@@ -813,7 +813,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
813 813
814 IWL_DEBUG_RATE("leave: %d\n", index); 814 IWL_DEBUG_RATE("leave: %d\n", index);
815 815
816 sel->rate = &sband->bitrates[sta->txrate_idx]; 816 sel->rate_idx = sta->txrate_idx;
817} 817}
818 818
819static struct rate_control_ops rs_ops = { 819static struct rate_control_ops rs_ops = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index ad4e7b74ca24..f8e691f88ab3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -331,7 +331,9 @@ static void iwl3945_rx_reply_tx(struct iwl3945_priv *priv,
331 tx_resp->rate, tx_resp->failure_frame); 331 tx_resp->rate, tx_resp->failure_frame);
332 332
333 rate_idx = iwl3945_hwrate_to_plcp_idx(tx_resp->rate); 333 rate_idx = iwl3945_hwrate_to_plcp_idx(tx_resp->rate);
334 tx_status->control.tx_rate = &priv->ieee_rates[rate_idx]; 334 if (tx_status->control.band == IEEE80211_BAND_5GHZ)
335 rate_idx -= IWL_FIRST_OFDM_RATE;
336 tx_status->control.tx_rate_idx = rate_idx;
335 IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index); 337 IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index);
336 iwl3945_tx_queue_reclaim(priv, txq_id, index); 338 iwl3945_tx_queue_reclaim(priv, txq_id, index);
337 339
@@ -962,7 +964,8 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv,
962 struct ieee80211_hdr *hdr, int sta_id, int tx_id) 964 struct ieee80211_hdr *hdr, int sta_id, int tx_id)
963{ 965{
964 unsigned long flags; 966 unsigned long flags;
965 u16 rate_index = min(ctrl->tx_rate->hw_value & 0xffff, IWL_RATE_COUNT - 1); 967 u16 hw_value = ieee80211_get_tx_rate(priv->hw, ctrl)->hw_value;
968 u16 rate_index = min(hw_value & 0xffff, IWL_RATE_COUNT - 1);
966 u16 rate_mask; 969 u16 rate_mask;
967 int rate; 970 int rate;
968 u8 rts_retry_limit; 971 u8 rts_retry_limit;
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index 2adc2281c77c..7993a1d83025 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -862,7 +862,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
862 if (priv->band == IEEE80211_BAND_5GHZ) 862 if (priv->band == IEEE80211_BAND_5GHZ)
863 rs_index -= IWL_FIRST_OFDM_RATE; 863 rs_index -= IWL_FIRST_OFDM_RATE;
864 864
865 if ((tx_resp->control.tx_rate == NULL) || 865 if ((tx_resp->control.tx_rate_idx < 0) ||
866 (tbl_type.is_SGI ^ 866 (tbl_type.is_SGI ^
867 !!(tx_resp->control.flags & IEEE80211_TXCTL_SHORT_GI)) || 867 !!(tx_resp->control.flags & IEEE80211_TXCTL_SHORT_GI)) ||
868 (tbl_type.is_fat ^ 868 (tbl_type.is_fat ^
@@ -875,7 +875,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
875 (!!(tx_rate & RATE_MCS_GF_MSK) ^ 875 (!!(tx_rate & RATE_MCS_GF_MSK) ^
876 !!(tx_resp->control.flags & IEEE80211_TXCTL_GREEN_FIELD)) || 876 !!(tx_resp->control.flags & IEEE80211_TXCTL_GREEN_FIELD)) ||
877 (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate != 877 (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate !=
878 tx_resp->control.tx_rate->bitrate)) { 878 hw->wiphy->bands[tx_resp->control.band]->bitrates[tx_resp->control.tx_rate_idx].bitrate)) {
879 IWL_DEBUG_RATE("initial rate does not match 0x%x\n", tx_rate); 879 IWL_DEBUG_RATE("initial rate does not match 0x%x\n", tx_rate);
880 goto out; 880 goto out;
881 } 881 }
@@ -2154,7 +2154,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
2154 fc = le16_to_cpu(hdr->frame_control); 2154 fc = le16_to_cpu(hdr->frame_control);
2155 if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1) || 2155 if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1) ||
2156 !sta || !sta->rate_ctrl_priv) { 2156 !sta || !sta->rate_ctrl_priv) {
2157 sel->rate = rate_lowest(local, sband, sta); 2157 sel->rate_idx = rate_lowest_index(local, sband, sta);
2158 goto out; 2158 goto out;
2159 } 2159 }
2160 2160
@@ -2184,11 +2184,13 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
2184 2184
2185done: 2185done:
2186 if ((i < 0) || (i > IWL_RATE_COUNT)) { 2186 if ((i < 0) || (i > IWL_RATE_COUNT)) {
2187 sel->rate = rate_lowest(local, sband, sta); 2187 sel->rate_idx = rate_lowest_index(local, sband, sta);
2188 goto out; 2188 goto out;
2189 } 2189 }
2190 2190
2191 sel->rate = &priv->ieee_rates[i]; 2191 if (sband->band == IEEE80211_BAND_5GHZ)
2192 i -= IWL_FIRST_OFDM_RATE;
2193 sel->rate_idx = i;
2192out: 2194out:
2193 rcu_read_unlock(); 2195 rcu_read_unlock();
2194} 2196}
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index f848a5b0f622..fb670b5cfebb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -373,14 +373,10 @@ void iwl4965_hwrate_to_tx_control(struct iwl_priv *priv, u32 rate_n_flags,
373 control->flags |= IEEE80211_TXCTL_DUP_DATA; 373 control->flags |= IEEE80211_TXCTL_DUP_DATA;
374 if (rate_n_flags & RATE_MCS_SGI_MSK) 374 if (rate_n_flags & RATE_MCS_SGI_MSK)
375 control->flags |= IEEE80211_TXCTL_SHORT_GI; 375 control->flags |= IEEE80211_TXCTL_SHORT_GI;
376 /* since iwl4965_hwrate_to_plcp_idx is band indifferent, we always use
377 * IEEE80211_BAND_2GHZ band as it contains all the rates */
378 rate_index = iwl4965_hwrate_to_plcp_idx(rate_n_flags); 376 rate_index = iwl4965_hwrate_to_plcp_idx(rate_n_flags);
379 if (rate_index == -1) 377 if (control->band == IEEE80211_BAND_5GHZ)
380 control->tx_rate = NULL; 378 rate_index -= IWL_FIRST_OFDM_RATE;
381 else 379 control->tx_rate_idx = rate_index;
382 control->tx_rate =
383 &priv->bands[IEEE80211_BAND_2GHZ].bitrates[rate_index];
384} 380}
385 381
386int iwl4965_hw_rxq_stop(struct iwl_priv *priv) 382int iwl4965_hw_rxq_stop(struct iwl_priv *priv)
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index f32cddabdf64..4b5149c8c32e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -578,7 +578,10 @@ static void iwl_tx_cmd_build_rate(struct iwl_priv *priv,
578 u8 data_retry_limit = 0; 578 u8 data_retry_limit = 0;
579 u8 rate_plcp; 579 u8 rate_plcp;
580 u16 rate_flags = 0; 580 u16 rate_flags = 0;
581 int rate_idx = min(ctrl->tx_rate->hw_value & 0xffff, IWL_RATE_COUNT - 1); 581 int rate_idx;
582
583 rate_idx = min(ieee80211_get_tx_rate(priv->hw, ctrl)->hw_value & 0xffff,
584 IWL_RATE_COUNT - 1);
582 585
583 rate_plcp = iwl_rates[rate_idx].plcp; 586 rate_plcp = iwl_rates[rate_idx].plcp;
584 587
@@ -723,7 +726,8 @@ int iwl_tx_skb(struct iwl_priv *priv,
723 goto drop_unlock; 726 goto drop_unlock;
724 } 727 }
725 728
726 if ((ctl->tx_rate->hw_value & 0xFF) == IWL_INVALID_RATE) { 729 if ((ieee80211_get_tx_rate(priv->hw, ctl)->hw_value & 0xFF) ==
730 IWL_INVALID_RATE) {
727 IWL_ERROR("ERROR: No TX rate available.\n"); 731 IWL_ERROR("ERROR: No TX rate available.\n");
728 goto drop_unlock; 732 goto drop_unlock;
729 } 733 }
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 54cde8a7b5fa..a28b4c9f6524 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2581,7 +2581,7 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv,
2581 goto drop_unlock; 2581 goto drop_unlock;
2582 } 2582 }
2583 2583
2584 if ((ctl->tx_rate->hw_value & 0xFF) == IWL_INVALID_RATE) { 2584 if ((ieee80211_get_tx_rate(priv->hw, ctl)->hw_value & 0xFF) == IWL_INVALID_RATE) {
2585 IWL_ERROR("ERROR: No TX rate available.\n"); 2585 IWL_ERROR("ERROR: No TX rate available.\n");
2586 goto drop_unlock; 2586 goto drop_unlock;
2587 } 2587 }
@@ -6694,7 +6694,7 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
6694 } 6694 }
6695 6695
6696 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, 6696 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
6697 ctl->tx_rate->bitrate); 6697 ieee80211_get_tx_rate(hw, ctl)->bitrate);
6698 6698
6699 if (iwl3945_tx_skb(priv, skb, ctl)) 6699 if (iwl3945_tx_skb(priv, skb, ctl))
6700 dev_kfree_skb_any(skb); 6700 dev_kfree_skb_any(skb);
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index db4f606bad50..1fad6227aa51 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -4281,7 +4281,7 @@ static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
4281 } 4281 }
4282 4282
4283 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, 4283 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
4284 ctl->tx_rate->bitrate); 4284 ieee80211_get_tx_rate(hw, ctl)->bitrate);
4285 4285
4286 if (iwl_tx_skb(priv, skb, ctl)) 4286 if (iwl_tx_skb(priv, skb, ctl))
4287 dev_kfree_skb_any(skb); 4287 dev_kfree_skb_any(skb);