From patchwork Wed Apr 2 04:05:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 3926601 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 534F7BF540 for ; Wed, 2 Apr 2014 04:05:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 840C420256 for ; Wed, 2 Apr 2014 04:05:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3BC92012E for ; Wed, 2 Apr 2014 04:05:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752530AbaDBEFZ (ORCPT ); Wed, 2 Apr 2014 00:05:25 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:35993 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751339AbaDBEFY (ORCPT ); Wed, 2 Apr 2014 00:05:24 -0400 Received: by mail-pb0-f45.google.com with SMTP id uo5so10892802pbc.32 for ; Tue, 01 Apr 2014 21:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Hsp0RqGcTrovCwKLPCOXNBAqQenaCMpIC4Isk6IcvW4=; b=xg2oG4Kd3uzzRB6i11oLDEQo5c0VdhwKLYq4BvbjTVTH2upbfgZylmknOIjMsI4zPn 3cNAtt0JJWQUvMRGXYV/7mCFaXRWwXE8qjbZH6UBRSHKlkWK/OXtgEPu0K3MrVLfZsIG waSv8/d6G8NYDrz/46YrqbijOzzyXz8+B47vM34pSDPeV8/ZGYDd0/FHLqulafUUM/fQ +B16MgI+IFSR8oT9p5YceZoADdyc8rOFI2r3jLSA5+RoWluuv2NKjuM+yY8Psyapkrgh r37CWuu4aj6M1s1kkhF5mbnr1Muih+gKSxJYZBNi3vsQRWc2WZKU04KBl93yy3bqqoi8 vTlQ== X-Received: by 10.66.149.37 with SMTP id tx5mr34974409pab.81.1396411524101; Tue, 01 Apr 2014 21:05:24 -0700 (PDT) Received: from localhost.localdomain ([58.26.233.145]) by mx.google.com with ESMTPSA id tk5sm1183836pbc.63.2014.04.01.21.05.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 21:05:23 -0700 (PDT) From: Chun-Yeow Yeoh To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, linville@tuxdriver.com, Chun-Yeow Yeoh Subject: [PATCH] mac80211: update last_tx_rate only for data frame Date: Wed, 2 Apr 2014 12:05:09 +0800 Message-Id: <1396411509-4660-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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];