linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Update last_tx_rate only for data frames
@ 2010-12-01 11:18 Helmut Schaa
  2010-12-01 14:04 ` Mohammed Shafi
  2010-12-01 15:34 ` [PATCHv2] " Helmut Schaa
  0 siblings, 2 replies; 8+ messages in thread
From: Helmut Schaa @ 2010-12-01 11:18 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Helmut Schaa, Johannes Berg

The last_tx_rate field was also updated for non-data frames that are
often sent with a lower rate (for example management frames at 1 Mbps).
This is confusing when the data rate is actually much higher.

Hence, only update the last_tx_rate field with tx rate information
gathered from the last data frames.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---

Not sure if there are any reasons why somebody would like to see the "real"
last tx rate including management frames?

 net/mac80211/tx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index e694836..f753081 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -669,7 +669,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
 	if (txrc.reported_rate.idx < 0)
 		txrc.reported_rate = info->control.rates[0];
 
-	if (tx->sta)
+	if (tx->sta && ieee80211_is_data(hdr->frame_control))
 		tx->sta->last_tx_rate = txrc.reported_rate;
 
 	if (unlikely(!info->control.rates[0].count))
-- 
1.7.1


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

end of thread, other threads:[~2010-12-01 16:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-01 11:18 [PATCH] mac80211: Update last_tx_rate only for data frames Helmut Schaa
2010-12-01 14:04 ` Mohammed Shafi
2010-12-01 14:40   ` Helmut Schaa
2010-12-01 15:03     ` Mohammed Shafi
2010-12-01 15:14     ` Helmut Schaa
2010-12-01 15:21       ` Mohammed Shafi
2010-12-01 16:54     ` Larry Finger
2010-12-01 15:34 ` [PATCHv2] " Helmut Schaa

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