2014-04-02 04:05:24

by Chun-Yeow Yeoh

[permalink] [raw]
Subject: [PATCH] mac80211: update last_tx_rate only for data frame

Rate controller in firmware may also return the Tx Rate
used for management frame that is usually sent as lowest
Tx Rate (1Mbps in 2.4GHz). So update the last_tx_rate only
if it is data frame.

This patch is tested with ath9k_htc.

Signed-off-by: Chun-Yeow Yeoh <[email protected]>
---
net/mac80211/status.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index e6e574a..00ba90b 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -618,6 +618,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
sta, true, acked);

if ((local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) &&
+ (ieee80211_is_data(hdr->frame_control)) &&
(rates_idx != -1))
sta->last_tx_rate = info->status.rates[rates_idx];

--
1.7.9.5



2014-04-08 08:59:53

by Chun-Yeow Yeoh

[permalink] [raw]
Subject: Re: [PATCH] mac80211: update last_tx_rate only for data frame

On Tue, Apr 8, 2014 at 4:52 PM, Johannes Berg <[email protected]> wrote:
> On Wed, 2014-04-02 at 12:05 +0800, Chun-Yeow Yeoh wrote:
>> Rate controller in firmware may also return the Tx Rate
>> used for management frame that is usually sent as lowest
>> Tx Rate (1Mbps in 2.4GHz). So update the last_tx_rate only
>> if it is data frame.
>
> I guess this makes some sense, although maybe the rate shouldn't be
> reported then?

If you are referring to the last_tx_rate, we are using this to
calculate the Airtime Link Metric in the mesh mode.

----
Chun-Yeow

2014-04-08 08:56:38

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: update last_tx_rate only for data frame

On Wed, 2014-04-02 at 12:05 +0800, Chun-Yeow Yeoh wrote:
> Rate controller in firmware may also return the Tx Rate
> used for management frame that is usually sent as lowest
> Tx Rate (1Mbps in 2.4GHz). So update the last_tx_rate only
> if it is data frame.

I guess this makes some sense, although maybe the rate shouldn't be
reported then?

johannes