diff options
author | Daniel C Halperin <daniel.c.halperin@intel.com> | 2009-08-28 12:44:47 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-31 14:42:10 -0400 |
commit | 31513be8a06874eb359908b7b735929837831a9a (patch) | |
tree | 1bb7bbff7fa671ae2169012cf81dc84ebd64722b /drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |
parent | b58ef214b7db57cfcbca0e1edae08566cdfd56b7 (diff) |
iwlwifi: use iwl_hwrate_get_mac80211_idx where appropriate
For HT packets, mac80211 expects the rate_idx to be an MCS number, which is the
lower byte of rate_n_flags. However, iwl_hwrate_to_plcp_idx takes the MCS
number and reduces it down to the range 0-8 (6 to 60 Mbps), removing the bits
that signify multiply streams, HT40 Duplicate mode, or unequal modulation.
This version is used for various internal purposes through the driver.
Add the function iwl_hwrate_get_mac80211_idx, an alternate version which takes
the rate and the band and returns the mac80211 index (MCS, for HT packets, and
PLCP rate, for legacy packets).
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.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 8239e5508ca..40b207aa8fe 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -878,6 +878,12 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband, | |||
878 | rs_index -= IWL_FIRST_OFDM_RATE; | 878 | rs_index -= IWL_FIRST_OFDM_RATE; |
879 | mac_flags = info->status.rates[0].flags; | 879 | mac_flags = info->status.rates[0].flags; |
880 | mac_index = info->status.rates[0].idx; | 880 | mac_index = info->status.rates[0].idx; |
881 | /* For HT packets, map MCS to PLCP */ | ||
882 | if (mac_flags & IEEE80211_TX_RC_MCS) { | ||
883 | mac_index &= RATE_MCS_CODE_MSK; /* Remove # of streams */ | ||
884 | if (mac_index >= (IWL_RATE_9M_INDEX - IWL_FIRST_OFDM_RATE)) | ||
885 | mac_index++; | ||
886 | } | ||
881 | 887 | ||
882 | if ((mac_index < 0) || | 888 | if ((mac_index < 0) || |
883 | (tbl_type.is_SGI != !!(mac_flags & IEEE80211_TX_RC_SHORT_GI)) || | 889 | (tbl_type.is_SGI != !!(mac_flags & IEEE80211_TX_RC_SHORT_GI)) || |
@@ -886,8 +892,8 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband, | |||
886 | (tbl_type.ant_type != info->antenna_sel_tx) || | 892 | (tbl_type.ant_type != info->antenna_sel_tx) || |
887 | (!!(tx_rate & RATE_MCS_HT_MSK) != !!(mac_flags & IEEE80211_TX_RC_MCS)) || | 893 | (!!(tx_rate & RATE_MCS_HT_MSK) != !!(mac_flags & IEEE80211_TX_RC_MCS)) || |
888 | (!!(tx_rate & RATE_MCS_GF_MSK) != !!(mac_flags & IEEE80211_TX_RC_GREEN_FIELD)) || | 894 | (!!(tx_rate & RATE_MCS_GF_MSK) != !!(mac_flags & IEEE80211_TX_RC_GREEN_FIELD)) || |
889 | rs_index != mac_index) { | 895 | (rs_index != mac_index)) { |
890 | IWL_DEBUG_RATE(priv, "initial rate does not match 0x%x\n", tx_rate); | 896 | IWL_DEBUG_RATE(priv, "initial rate %d does not match %d (0x%x)\n", mac_index, rs_index, tx_rate); |
891 | /* the last LQ command could failed so the LQ in ucode not | 897 | /* the last LQ command could failed so the LQ in ucode not |
892 | * the same in driver sync up | 898 | * the same in driver sync up |
893 | */ | 899 | */ |