From patchwork Tue Jul 9 19:13:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 2825427 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 032EAC0AB2 for ; Tue, 9 Jul 2013 19:13:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D93520184 for ; Tue, 9 Jul 2013 19:13:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DEB0D2017B for ; Tue, 9 Jul 2013 19:13:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752311Ab3GITNe (ORCPT ); Tue, 9 Jul 2013 15:13:34 -0400 Received: from cora.hrz.tu-chemnitz.de ([134.109.228.40]:36483 "EHLO cora.hrz.tu-chemnitz.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752206Ab3GITNd (ORCPT ); Tue, 9 Jul 2013 15:13:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tu-chemnitz.de; s=dkim2010; h=Message-Id:Date:Subject:Cc:To:From; bh=xb5awZ2tjtFN1q6001Q8CXQ775o55MMCltXNxZG/x8Q=; b=mcJCtyFF9I4cUOJ+YJWxEBWLeRyVFTHdoltJWDEpPKCVIgvpqLerHMkVCir7n9pGW9eJkWUaahZ9xae0lIIIXpx1PJKXFH42j/i/7+zx9c4+EKe2w0UghT1mJciMktT0bIMHZsRK9FStARqTBhJZs22GHpomf6AuWEk96bMqdHg=; Received: from p579e7a48.dip0.t-ipconnect.de ([87.158.122.72] helo=pandem0nium) by cora.hrz.tu-chemnitz.de with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1UwdLv-0008UI-OR; Tue, 09 Jul 2013 21:13:32 +0200 Received: from dotslash by pandem0nium with local (Exim 4.80) (envelope-from ) id 1UwdLu-0006AY-F9; Tue, 09 Jul 2013 21:13:30 +0200 From: Simon Wunderlich To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Mathias Kretschmer , Simon Wunderlich Subject: [PATCH] mac80211: fix 5/10 MHz tx_status regression Date: Tue, 9 Jul 2013 21:13:20 +0200 Message-Id: <1373397200-23686-1-git-send-email-siwu@hrz.tu-chemnitz.de> X-Mailer: git-send-email 1.7.10.4 X-purgate: clean X-purgate-type: clean X-purgate-ID: 154106::1373397211-0000051A-E1C84114/0-0/0-0 X-Scan-AV: cora.hrz.tu-chemnitz.de; 2013-07-09 21:13:31; d299b5152f358deb26738f00de966f25 X-Scan-SA: cora.hrz.tu-chemnitz.de; 2013-07-09 21:13:32; c647155862ff0fdf5d2ac1ec5b94b285 X-Spam-Score: -1.0 (-) 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 sdata may be used uninitialized in ieee80211_tx_status() when adding the radiotap header. It was added as parameter in "mac80211: select and adjust bitrates according to channel mode" to find the current control channel width (5/10/20+ MHz) and is used to report the bitrate correctly. Fix this by identifing the required shift when cycling through the interfaces. Reported-by: kbuild test robot Signed-off-by: Simon Wunderlich Cc: Mathias Kretschmer --- You might want to squash this into the offending patch before sending it further upstream. --- net/mac80211/status.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/net/mac80211/status.c b/net/mac80211/status.c index 690138a..6ad4c14 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -253,10 +253,9 @@ static int ieee80211_tx_radiotap_len(struct ieee80211_tx_info *info) } static void -ieee80211_add_tx_radiotap_header(struct ieee80211_sub_if_data *sdata, - struct ieee80211_supported_band *sband, +ieee80211_add_tx_radiotap_header(struct ieee80211_supported_band *sband, struct sk_buff *skb, int retry_count, - int rtap_len) + int rtap_len, int shift) { struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; @@ -282,7 +281,6 @@ ieee80211_add_tx_radiotap_header(struct ieee80211_sub_if_data *sdata, /* IEEE80211_RADIOTAP_RATE */ if (info->status.rates[0].idx >= 0 && !(info->status.rates[0].flags & IEEE80211_TX_RC_MCS)) { - int shift = ieee80211_vif_get_shift(&sdata->vif); u16 rate; rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_RATE); @@ -430,6 +428,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) bool acked; struct ieee80211_bar *bar; int rtap_len; + int shift = 0; for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { if ((info->flags & IEEE80211_TX_CTL_AMPDU) && @@ -464,6 +463,8 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) if (!ether_addr_equal(hdr->addr2, sta->sdata->vif.addr)) continue; + shift = ieee80211_vif_get_shift(&sta->sdata->vif); + if (info->flags & IEEE80211_TX_STATUS_EOSP) clear_sta_flag(sta, WLAN_STA_SP); @@ -630,8 +631,8 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) dev_kfree_skb(skb); return; } - ieee80211_add_tx_radiotap_header(sdata, sband, skb, retry_count, - rtap_len); + ieee80211_add_tx_radiotap_header(sband, skb, retry_count, rtap_len, + shift); /* XXX: is this sufficient for BPF? */ skb_set_mac_header(skb, 0);