linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: Fix TX status reporting for retries and MCS index
@ 2008-12-15 13:44 Jouni Malinen
  0 siblings, 0 replies; only message in thread
From: Jouni Malinen @ 2008-12-15 13:44 UTC (permalink / raw)
  To: John W. Linville, Johannes Berg; +Cc: linux-wireless

The count field in struct ieee80211_tx_rate does not include the final
successful attempt, so only report retries here.

Fix the struct ieee80211_tx_rate::idx field when MCS was used. It is
supposed to be the MCS index, not an internal index to the rate
control algorithm table.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
---
 drivers/net/wireless/ath9k/xmit.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

--- wireless-testing.orig/drivers/net/wireless/ath9k/xmit.c	2008-12-15 15:28:09.000000000 +0200
+++ wireless-testing/drivers/net/wireless/ath9k/xmit.c	2008-12-15 15:35:33.000000000 +0200
@@ -125,7 +125,15 @@ static void ath_tx_complete(struct ath_s
 		tx_info->flags |= IEEE80211_TX_STAT_ACK;
 	}
 
-	tx_info->status.rates[0].count = tx_status->retries + 1;
+	tx_info->status.rates[0].count = tx_status->retries;
+	if (tx_info->status.rates[0].flags & IEEE80211_TX_RC_MCS) {
+		/* Change idx from internal table index to MCS index */
+		int idx = tx_info->status.rates[0].idx;
+		struct ath_rate_table *rate_table = sc->cur_rate_table;
+		if (idx >= 0 && idx < rate_table->rate_cnt)
+			tx_info->status.rates[0].idx =
+				rate_table->info[idx].ratecode & 0x7f;
+	}
 
 	ieee80211_tx_status(hw, skb);
 }

-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-15 13:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-15 13:44 [PATCH] ath9k: Fix TX status reporting for retries and MCS index Jouni Malinen

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).