aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
diff options
context:
space:
mode:
authorRon Rindjunsky <ron.rindjunsky@intel.com>2008-03-04 21:09:27 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-03-07 16:03:00 -0500
commit4c424e4cc7bc9d3c4c22b408904c36b44afddc3e (patch)
tree3c9edf26c05b4ee603cbeb0774ba95c011e31a42 /drivers/net/wireless/iwlwifi/iwl-4965-rs.c
parent11f4b1cec98ad95abda80dc20bdc3cecac145d77 (diff)
iwlwifi: use mac80211_tx_control_flags
This patch makes use of the new mac80211_tx_control_flags and tx_rate to pass Tx data, regular and 11n, from the HW tx response into the rate scaling. Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index cf7b569a2229..306fbdc6e62f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -823,6 +823,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
823 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 823 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
824 struct iwl4965_priv *priv = (struct iwl4965_priv *)priv_rate; 824 struct iwl4965_priv *priv = (struct iwl4965_priv *)priv_rate;
825 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 825 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
826 struct ieee80211_hw *hw = local_to_hw(local);
826 struct iwl4965_rate_scale_data *window = NULL; 827 struct iwl4965_rate_scale_data *window = NULL;
827 struct iwl4965_rate_scale_data *search_win = NULL; 828 struct iwl4965_rate_scale_data *search_win = NULL;
828 struct iwl4965_rate tx_mcs; 829 struct iwl4965_rate tx_mcs;
@@ -884,17 +885,6 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
884 search_win = (struct iwl4965_rate_scale_data *) 885 search_win = (struct iwl4965_rate_scale_data *)
885 &(search_tbl->win[0]); 886 &(search_tbl->win[0]);
886 887
887 tx_mcs.rate_n_flags = tx_resp->control.tx_rate->hw_value;
888
889 rs_get_tbl_info_from_mcs(&tx_mcs, priv->band,
890 &tbl_type, &rs_index);
891 if ((rs_index < 0) || (rs_index >= IWL_RATE_COUNT)) {
892 IWL_DEBUG_RATE("bad rate index at: %d rate 0x%X\n",
893 rs_index, tx_mcs.rate_n_flags);
894 rcu_read_unlock();
895 return;
896 }
897
898 /* 888 /*
899 * Ignore this Tx frame response if its initial rate doesn't match 889 * Ignore this Tx frame response if its initial rate doesn't match
900 * that of latest Link Quality command. There may be stragglers 890 * that of latest Link Quality command. There may be stragglers
@@ -903,12 +893,28 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
903 * to check "search" mode, or a prior "search" mode after we've moved 893 * to check "search" mode, or a prior "search" mode after we've moved
904 * to a new "search" mode (which might become the new "active" mode). 894 * to a new "search" mode (which might become the new "active" mode).
905 */ 895 */
906 if (retries && 896 tx_mcs.rate_n_flags = le32_to_cpu(table->rs_table[0].rate_n_flags);
907 (tx_mcs.rate_n_flags != 897 rs_get_tbl_info_from_mcs(&tx_mcs, priv->band, &tbl_type, &rs_index);
908 le32_to_cpu(table->rs_table[0].rate_n_flags))) { 898 if (priv->band == IEEE80211_BAND_5GHZ)
909 IWL_DEBUG_RATE("initial rate does not match 0x%x 0x%x\n", 899 rs_index -= IWL_FIRST_OFDM_RATE;
910 tx_mcs.rate_n_flags, 900
911 le32_to_cpu(table->rs_table[0].rate_n_flags)); 901 if ((tx_resp->control.tx_rate == NULL) ||
902 (tbl_type.is_SGI ^
903 !!(tx_resp->control.flags & IEEE80211_TXCTL_SHORT_GI)) ||
904 (tbl_type.is_fat ^
905 !!(tx_resp->control.flags & IEEE80211_TXCTL_40_MHZ_WIDTH)) ||
906 (tbl_type.is_dup ^
907 !!(tx_resp->control.flags & IEEE80211_TXCTL_DUP_DATA)) ||
908 (tbl_type.antenna_type ^
909 tx_resp->control.antenna_sel_tx) ||
910 (!!(tx_mcs.rate_n_flags & RATE_MCS_HT_MSK) ^
911 !!(tx_resp->control.flags & IEEE80211_TXCTL_OFDM_HT)) ||
912 (!!(tx_mcs.rate_n_flags & RATE_MCS_GF_MSK) ^
913 !!(tx_resp->control.flags & IEEE80211_TXCTL_GREEN_FIELD)) ||
914 (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate !=
915 tx_resp->control.tx_rate->bitrate)) {
916 IWL_DEBUG_RATE("initial rate does not match 0x%x\n",
917 tx_mcs.rate_n_flags);
912 rcu_read_unlock(); 918 rcu_read_unlock();
913 return; 919 return;
914 } 920 }
@@ -959,14 +965,8 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
959 * if Tx was successful first try, use original rate, 965 * if Tx was successful first try, use original rate,
960 * else look up the rate that was, finally, successful. 966 * else look up the rate that was, finally, successful.
961 */ 967 */
962 if (!tx_resp->retry_count) 968 tx_mcs.rate_n_flags = le32_to_cpu(table->rs_table[index].rate_n_flags);
963 tx_mcs.rate_n_flags = tx_resp->control.tx_rate->hw_value; 969 rs_get_tbl_info_from_mcs(&tx_mcs, priv->band, &tbl_type, &rs_index);
964 else
965 tx_mcs.rate_n_flags =
966 le32_to_cpu(table->rs_table[index].rate_n_flags);
967
968 rs_get_tbl_info_from_mcs(&tx_mcs, priv->band,
969 &tbl_type, &rs_index);
970 970
971 /* Update frame history window with "success" if Tx got ACKed ... */ 971 /* Update frame history window with "success" if Tx got ACKed ... */
972 if (tx_resp->flags & IEEE80211_TX_STATUS_ACK) 972 if (tx_resp->flags & IEEE80211_TX_STATUS_ACK)