aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2014-07-10 20:01:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-07-15 15:59:53 -0400
commit601d6c4e701133ae23dd1b9507bf9d3a4172e586 (patch)
tree6b457cfcadbd535d2b8dde4bf3d24e04a5b255d4 /drivers/net/wireless/ti
parent30a003588898924964dfa537670f35aac7cd9629 (diff)
wl18xx: fix last tx rate calculation
The last tx rate calculation didn't take into account the different indices of 11a and 11g rates tables. Add the required alignment (count only from the first 11a rate in case of 11a) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ti')
-rw-r--r--drivers/net/wireless/ti/wl18xx/tx.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/tx.c b/drivers/net/wireless/ti/wl18xx/tx.c
index be1ebd55ac88..3406ffb53325 100644
--- a/drivers/net/wireless/ti/wl18xx/tx.c
+++ b/drivers/net/wireless/ti/wl18xx/tx.c
@@ -30,7 +30,7 @@
30 30
31static 31static
32void wl18xx_get_last_tx_rate(struct wl1271 *wl, struct ieee80211_vif *vif, 32void wl18xx_get_last_tx_rate(struct wl1271 *wl, struct ieee80211_vif *vif,
33 struct ieee80211_tx_rate *rate) 33 u8 band, struct ieee80211_tx_rate *rate)
34{ 34{
35 u8 fw_rate = wl->fw_status->counters.tx_last_rate; 35 u8 fw_rate = wl->fw_status->counters.tx_last_rate;
36 36
@@ -43,6 +43,8 @@ void wl18xx_get_last_tx_rate(struct wl1271 *wl, struct ieee80211_vif *vif,
43 43
44 if (fw_rate <= CONF_HW_RATE_INDEX_54MBPS) { 44 if (fw_rate <= CONF_HW_RATE_INDEX_54MBPS) {
45 rate->idx = fw_rate; 45 rate->idx = fw_rate;
46 if (band == IEEE80211_BAND_5GHZ)
47 rate->idx -= CONF_HW_RATE_INDEX_6MBPS;
46 rate->flags = 0; 48 rate->flags = 0;
47 } else { 49 } else {
48 rate->flags = IEEE80211_TX_RC_MCS; 50 rate->flags = IEEE80211_TX_RC_MCS;
@@ -102,7 +104,8 @@ static void wl18xx_tx_complete_packet(struct wl1271 *wl, u8 tx_stat_byte)
102 * first pass info->control.vif while it's valid, and then fill out 104 * first pass info->control.vif while it's valid, and then fill out
103 * the info->status structures 105 * the info->status structures
104 */ 106 */
105 wl18xx_get_last_tx_rate(wl, info->control.vif, &info->status.rates[0]); 107 wl18xx_get_last_tx_rate(wl, info->control.vif,
108 info->band, &info->status.rates[0]);
106 109
107 info->status.rates[0].count = 1; /* no data about retries */ 110 info->status.rates[0].count = 1; /* no data about retries */
108 info->status.ack_signal = -1; 111 info->status.ack_signal = -1;