diff mbox

mac80211: update last_tx_rate only for data frame

Message ID 1396411509-4660-1-git-send-email-yeohchunyeow@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Chun-Yeow Yeoh April 2, 2014, 4:05 a.m. UTC
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 <yeohchunyeow@gmail.com>
---
 net/mac80211/status.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Johannes Berg April 8, 2014, 8:52 a.m. UTC | #1
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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chun-Yeow Yeoh April 8, 2014, 8:59 a.m. UTC | #2
On Tue, Apr 8, 2014 at 4:52 PM, Johannes Berg <johannes@sipsolutions.net> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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];