From patchwork Thu Jul 26 13:59:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 10545939 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B32FB9093 for ; Thu, 26 Jul 2018 14:08:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2BEE2B195 for ; Thu, 26 Jul 2018 14:08:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 967BA2B362; Thu, 26 Jul 2018 14:08:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 846B02B371 for ; Thu, 26 Jul 2018 14:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730198AbeGZPZO (ORCPT ); Thu, 26 Jul 2018 11:25:14 -0400 Received: from narfation.org ([79.140.41.39]:52642 "EHLO v3-1039.vlinux.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730062AbeGZPZN (ORCPT ); Thu, 26 Jul 2018 11:25:13 -0400 X-Greylist: delayed 495 seconds by postgrey-1.27 at vger.kernel.org; Thu, 26 Jul 2018 11:25:12 EDT Received: from sven-desktop.home.narfation.org (p200300C593D685FE00000000000003ED.dip0.t-ipconnect.de [IPv6:2003:c5:93d6:85fe::3ed]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id D304A1100E1; Thu, 26 Jul 2018 15:59:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1532613597; bh=/6Q7YLm7ZJRKAlGLPXgVItYN9nxTSi1f8I6eNKJbDhg=; h=From:To:Cc:Subject:Date:From; b=MLSrjWJKp9fpmFUCBeGo1ZkSpNT0avXucP4Qsk8ZCFmcmPTxbd/SMYq7bg5icUPJd XxFnACXS/txV25nlX3ZHm+iHS17CHt/ISErzczJLU5NIHGwYca4v5fZK5pHkfcZQCi mEyAgzM0vmLkSbC3cd5EMqZggt8LbHLxpODhJO/4= From: Sven Eckelmann To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Sven Eckelmann , Simon Wunderlich , Marek Puzyniak Subject: [PATCH RESENT] ath10k: Prevent active scans on potential unusable channels Date: Thu, 26 Jul 2018 15:59:48 +0200 Message-Id: <20180726135948.29160-1-sven@narfation.org> X-Mailer: git-send-email 2.11.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sven Eckelmann The QCA4019 hw1.0 firmware 10.4-3.2.1-00050 and 10.4-3.5.3-00053 (and most likely all other) seem to ignore the WMI_CHAN_FLAG_DFS flag during the scan. This results in transmission (probe requests) on channels which are not "available" for transmissions. Since the firmware is closed source and nothing can be done from our side to fix the problem in it, the driver has to work around this problem. The WMI_CHAN_FLAG_PASSIVE seems to be interpreted by the firmware to not scan actively on a channel unless an AP was detected on it. Simple probe requests will then be transmitted by the STA on the channel. ath10k must therefore also use this flag when it queues a radar channel for scanning. This should reduce the chance of an active scan when the channel might be "unusable" for transmissions. Fixes: e8a50f8ba44b ("ath10k: introduce DFS implementation") Signed-off-by: Sven Eckelmann --- Cc: Simon Wunderlich Cc: Marek Puzyniak --- drivers/net/wireless/ath/ath10k/mac.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 95243b48a179..76e9c6eaa051 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3085,6 +3085,13 @@ static int ath10k_update_channel_list(struct ath10k *ar) passive = channel->flags & IEEE80211_CHAN_NO_IR; ch->passive = passive; + /* the firmware is ignoring the "radar" flag of the + * channel and is scanning actively using Probe Requests + * on "Radar detection"/DFS channels which are not + * marked as "available" + */ + ch->passive |= ch->chan_radar; + ch->freq = channel->center_freq; ch->band_center_freq1 = channel->center_freq; ch->min_power = 0;