linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] wl12xx: Set IEEE80211_TX_RC_MCS on MCS rates on TX complete.
@ 2012-01-31 15:54 Eliad Peller
  2012-01-31 15:54 ` [PATCH 2/4] wl12xx: Set IEEE80211_TX_RC_SHORT_GI if short GI was used on Eliad Peller
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Eliad Peller @ 2012-01-31 15:54 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

From: Pontus Fuchs <pontus.fuchs@gmail.com>

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>
---
 drivers/net/wireless/wl12xx/conf.h |    4 ++++
 drivers/net/wireless/wl12xx/tx.c   |   12 +++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/conf.h b/drivers/net/wireless/wl12xx/conf.h
index f29fbfd..a152713 100644
--- a/drivers/net/wireless/wl12xx/conf.h
+++ b/drivers/net/wireless/wl12xx/conf.h
@@ -91,6 +91,10 @@ enum {
 	CONF_HW_RXTX_RATE_UNSUPPORTED = 0xff
 };
 
+/* Rates between and including these are MCS rates */
+#define CONF_HW_RXTX_RATE_MCS_MIN CONF_HW_RXTX_RATE_MCS7
+#define CONF_HW_RXTX_RATE_MCS_MAX CONF_HW_RXTX_RATE_MCS0
+
 enum {
 	CONF_SG_DISABLE = 0,
 	CONF_SG_PROTECTIVE,
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
index 2bf43b8..f95112f 100644
--- a/drivers/net/wireless/wl12xx/tx.c
+++ b/drivers/net/wireless/wl12xx/tx.c
@@ -764,6 +764,14 @@ out:
 	mutex_unlock(&wl->mutex);
 }
 
+static u8 wl1271_tx_get_rate_flags(u8 rate_class_index)
+{
+	if (rate_class_index >= CONF_HW_RXTX_RATE_MCS_MIN &&
+	    rate_class_index <= CONF_HW_RXTX_RATE_MCS_MAX)
+		return IEEE80211_TX_RC_MCS;
+	return 0;
+}
+
 static void wl1271_tx_complete_packet(struct wl1271 *wl,
 				      struct wl1271_tx_hw_res_descr *result)
 {
@@ -773,6 +781,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
 	struct sk_buff *skb;
 	int id = result->id;
 	int rate = -1;
+	u8 rate_flags = 0;
 	u8 retries = 0;
 
 	/* check for id legality */
@@ -799,6 +808,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
 			info->flags |= IEEE80211_TX_STAT_ACK;
 		rate = wl1271_rate_to_idx(result->rate_class_index,
 					  wlvif->band);
+		rate_flags = wl1271_tx_get_rate_flags(result->rate_class_index);
 		retries = result->ack_failures;
 	} else if (result->status == TX_RETRY_EXCEEDED) {
 		wl->stats.excessive_retries++;
@@ -807,7 +817,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
 
 	info->status.rates[0].idx = rate;
 	info->status.rates[0].count = retries;
-	info->status.rates[0].flags = 0;
+	info->status.rates[0].flags = rate_flags;
 	info->status.ack_signal = -1;
 
 	wl->stats.retry_count += result->ack_failures;
-- 
1.7.6.401.g6a319


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-02-15 10:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-31 15:54 [PATCH 1/4] wl12xx: Set IEEE80211_TX_RC_MCS on MCS rates on TX complete Eliad Peller
2012-01-31 15:54 ` [PATCH 2/4] wl12xx: Set IEEE80211_TX_RC_SHORT_GI if short GI was used on Eliad Peller
2012-01-31 15:54 ` [PATCH 3/4] wl12xx: add TX_HW_ATTR_HOST_ENCRYPT flag Eliad Peller
2012-01-31 15:54 ` [PATCH 4/4] wl12xx: add new coex params Eliad Peller
2012-02-15 10:16 ` [PATCH 1/4] wl12xx: Set IEEE80211_TX_RC_MCS on MCS rates on TX complete Luciano Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).