From patchwork Wed Mar 11 13:25:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5985161 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 46DC79F318 for ; Wed, 11 Mar 2015 13:39:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A558202AE for ; Wed, 11 Mar 2015 13:39:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B1CE420394 for ; Wed, 11 Mar 2015 13:39:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YVgrO-0005He-Gg; Wed, 11 Mar 2015 13:39:42 +0000 Received: from mail-la0-x234.google.com ([2a00:1450:4010:c03::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YVggE-0001Ye-8i for ath10k@lists.infradead.org; Wed, 11 Mar 2015 13:28:11 +0000 Received: by lams18 with SMTP id s18so8789585lam.2 for ; Wed, 11 Mar 2015 06:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=0DNU81gU9CgwTy312dyvf/WHtGtiGu6VGKGszrZOTOw=; b=ddpYEZc3sXeCuoXqPP3g9CWEOTRz8TdtLdRqZBEwVqB6yzNtthMlM3i0rXcRE6e9ia 1/ne/zsrXBXfQo5VsGC8gREunaQXmlmb2fRfLipBScaFxUx5spfM+FTE9ZDrKjNu1cHX qVGo5I4fb1+o+U7xYrdB+Yz0sIlTCP2d2Oj0Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0DNU81gU9CgwTy312dyvf/WHtGtiGu6VGKGszrZOTOw=; b=aYPmQD/AMIplYJRjMQotRDO21Y8RZYLxuyVyxmZSWDL3QOcjaLu/twUZEibSt1wG8O uTzXAZ8s3OQZsBp4wkM7UvyYnpZ7pM2QyZGx2kOr+ZCryx3aPX4naRTeMQ1lncLHyfcA X7jkDavfkqoTzAqvyNXJdf96aBAC95iNkXzW09VPLN8kJHa2/RmgKgnLHYUHV+i/0BBS hbwvrwdxeGyEplT/SWAK9dGcTyQ69f4QbSRCSy/5YM5qnzFswLNX5pohhYb7qazKTnem hsJAKQB5+v+/ebF72clvXKtn2ePCKCeh4uDmRibpB3podaIXSpBUDVPCDY7quSduKsSR weaw== X-Gm-Message-State: ALoCoQlnRQJiVXrHbLAmeEpHzxAdp9kYdp6R2Pfyxid3Hva5THDqx6DoSZoPJYWZxDJyyZizJAC36tI4/+cvFK9GSh1de/itnaC/w0gTbNHYZEhM+r2MJFhEVHPBxH/tV9AdqhcSipH5sttHjdrC7u8CcGkn1+uWwiSpaxNLaVJbsMrrwta8j0A= X-Received: by 10.152.36.101 with SMTP id p5mr35310930laj.34.1426080466664; Wed, 11 Mar 2015 06:27:46 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id p7sm725797lap.18.2015.03.11.06.27.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 06:27:45 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH] ath10k: strip qos data bit always Date: Wed, 11 Mar 2015 14:25:26 +0100 Message-Id: <1426080326-14764-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150311_062810_555274_AF6C26DC X-CRM114-Status: UNSURE ( 9.61 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 NativeWifi tx mode expects QoS Data frames to be delivered as Data frames with QoS part (e.g. tid) being delievered out-of-band in fw tx command. The QoS bit wasn't stripped before submitting to firmware. Stripping fixes two known problems: * qca6174 IOT with some APs, e.g. Cisco AIR-AP 1252 (which would crash after ath10k association). Some ath9k APs would crash as well. * sniffing own tx frames via radiotap because, e.g. wireshark was seeing QoS bit set but since QoS Control was stripped in ath10k it would parse beginning of LLC/SNAP From debugability point of view this removes the ability to distinguish QoS from non-QoS frames when sniffing own tx via radiotap. On the other hand frames can be now parsed correctly without special software modification. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 1138f4f..625e2cb 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -2463,16 +2463,15 @@ static void ath10k_tx_h_nwifi(struct ieee80211_hw *hw, struct sk_buff *skb) skb->data, (void *)qos_ctl - (void *)skb->data); skb_pull(skb, IEEE80211_QOS_CTL_LEN); - /* Fw/Hw generates a corrupted QoS Control Field for QoS NullFunc - * frames. Powersave is handled by the fw/hw so QoS NyllFunc frames are - * used only for CQM purposes (e.g. hostapd station keepalive ping) so - * it is safe to downgrade to NullFunc. + /* Some firmware revisions don't handle sending QoS NullFunc well. + * These frames are mainly used for CQM purposes so it doesn't really + * matter whether QoS NullFunc or NullFunc are sent. */ hdr = (void *)skb->data; - if (ieee80211_is_qos_nullfunc(hdr->frame_control)) { - hdr->frame_control &= ~__cpu_to_le16(IEEE80211_STYPE_QOS_DATA); + if (ieee80211_is_qos_nullfunc(hdr->frame_control)) cb->htt.tid = HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST; - } + + hdr->frame_control &= ~__cpu_to_le16(IEEE80211_STYPE_QOS_DATA); } static void ath10k_tx_h_add_p2p_noa_ie(struct ath10k *ar,