aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPontus Fuchs <pontus.fuchs@gmail.com>2012-01-31 10:54:40 -0500
committerLuciano Coelho <coelho@ti.com>2012-02-15 01:38:32 -0500
commitd2e2d769e3d328ba7cbf08e8ed85e3f817915843 (patch)
tree006023507efb2ebd2b1de9beaaf8a580197fc808 /drivers
parentd18da7fcca449f09c91a209b4f5006959c5a7656 (diff)
wl12xx: Set IEEE80211_TX_RC_MCS on MCS rates on TX complete.
IEEE80211_TX_RC_MCS was not set correctly leading to incorrect link speed calculation. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Ido Reis <idor@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/wl12xx/conf.h4
-rw-r--r--drivers/net/wireless/wl12xx/tx.c12
2 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/wireless/wl12xx/conf.h b/drivers/net/wireless/wl12xx/conf.h
index 10e5e3df4b95..209f05312909 100644
--- a/drivers/net/wireless/wl12xx/conf.h
+++ b/drivers/net/wireless/wl12xx/conf.h
@@ -91,6 +91,10 @@ enum {
91 CONF_HW_RXTX_RATE_UNSUPPORTED = 0xff 91 CONF_HW_RXTX_RATE_UNSUPPORTED = 0xff
92}; 92};
93 93
94/* Rates between and including these are MCS rates */
95#define CONF_HW_RXTX_RATE_MCS_MIN CONF_HW_RXTX_RATE_MCS7
96#define CONF_HW_RXTX_RATE_MCS_MAX CONF_HW_RXTX_RATE_MCS0
97
94enum { 98enum {
95 CONF_SG_DISABLE = 0, 99 CONF_SG_DISABLE = 0,
96 CONF_SG_PROTECTIVE, 100 CONF_SG_PROTECTIVE,
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
index 2bf43b86a3f9..f95112f6769f 100644
--- a/drivers/net/wireless/wl12xx/tx.c
+++ b/drivers/net/wireless/wl12xx/tx.c
@@ -764,6 +764,14 @@ out:
764 mutex_unlock(&wl->mutex); 764 mutex_unlock(&wl->mutex);
765} 765}
766 766
767static u8 wl1271_tx_get_rate_flags(u8 rate_class_index)
768{
769 if (rate_class_index >= CONF_HW_RXTX_RATE_MCS_MIN &&
770 rate_class_index <= CONF_HW_RXTX_RATE_MCS_MAX)
771 return IEEE80211_TX_RC_MCS;
772 return 0;
773}
774
767static void wl1271_tx_complete_packet(struct wl1271 *wl, 775static void wl1271_tx_complete_packet(struct wl1271 *wl,
768 struct wl1271_tx_hw_res_descr *result) 776 struct wl1271_tx_hw_res_descr *result)
769{ 777{
@@ -773,6 +781,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
773 struct sk_buff *skb; 781 struct sk_buff *skb;
774 int id = result->id; 782 int id = result->id;
775 int rate = -1; 783 int rate = -1;
784 u8 rate_flags = 0;
776 u8 retries = 0; 785 u8 retries = 0;
777 786
778 /* check for id legality */ 787 /* check for id legality */
@@ -799,6 +808,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
799 info->flags |= IEEE80211_TX_STAT_ACK; 808 info->flags |= IEEE80211_TX_STAT_ACK;
800 rate = wl1271_rate_to_idx(result->rate_class_index, 809 rate = wl1271_rate_to_idx(result->rate_class_index,
801 wlvif->band); 810 wlvif->band);
811 rate_flags = wl1271_tx_get_rate_flags(result->rate_class_index);
802 retries = result->ack_failures; 812 retries = result->ack_failures;
803 } else if (result->status == TX_RETRY_EXCEEDED) { 813 } else if (result->status == TX_RETRY_EXCEEDED) {
804 wl->stats.excessive_retries++; 814 wl->stats.excessive_retries++;
@@ -807,7 +817,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
807 817
808 info->status.rates[0].idx = rate; 818 info->status.rates[0].idx = rate;
809 info->status.rates[0].count = retries; 819 info->status.rates[0].count = retries;
810 info->status.rates[0].flags = 0; 820 info->status.rates[0].flags = rate_flags;
811 info->status.ack_signal = -1; 821 info->status.ack_signal = -1;
812 822
813 wl->stats.retry_count += result->ack_failures; 823 wl->stats.retry_count += result->ack_failures;