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: 5984821 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 B69C99F399 for ; Wed, 11 Mar 2015 13:27:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D49A3202AE for ; Wed, 11 Mar 2015 13:27:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECE572028D for ; Wed, 11 Mar 2015 13:27:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753798AbbCKN1t (ORCPT ); Wed, 11 Mar 2015 09:27:49 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:33292 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752349AbbCKN1s (ORCPT ); Wed, 11 Mar 2015 09:27:48 -0400 Received: by lbdu14 with SMTP id u14so8871917lbd.0 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=kZ0532n8Sh4PyYJ5E46GDtaMODSgaxGaGsgmkTFppkaYG8y4hoYIUaRwNLN7/IPZV9 mq/oeMGP85XkDSUJ9yBWwgWrnRfTHX33jX6zCPc1IjIALkvhscHGrFeJeAkHZ3jxpLgx QZoeGTCInanIPqTUzeRverBvrK5CqJmvwApFqLzoe9uPRI8nqYjR8NyUmo+IiMGPA5T+ Y7TdjQc3o1RfkbUj9bRsRe8ORcPM1d17ixB7eJ2mYYukkBD7CaLZB4MyLNT3+05kkpuf PXgk0Xt2vk/b+fmrvqy6Q4URdhFR5JyDmzxZEFD9Aqy0Vr4MeaQkKSiD+gzMW21hsCeN Fp9A== X-Gm-Message-State: ALoCoQnRqlnVjN15RuV6z99oXKQs50J0ONI+2uff/MY8ihsnys44BrgqfKoQPmmGuqOmh7s6fVdjqsuCI+YFpngpwmsei4JJ53k+WxBi3eVWIbUmgZLQ6QwGofytIcep1pX3jykThvZS 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 Cc: linux-wireless@vger.kernel.org, Michal Kazior 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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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 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,