From patchwork Thu Dec 15 15:22:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Pierre TOSONI X-Patchwork-Id: 9476491 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.web.codeaurora.org (Postfix) with ESMTP id 9BCAF6047D for ; Thu, 15 Dec 2016 16:15:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 858D1287D1 for ; Thu, 15 Dec 2016 16:15:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 767EE287D6; Thu, 15 Dec 2016 16:15:03 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 80EBC287D1 for ; Thu, 15 Dec 2016 16:15:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cHYg9-0000kd-1v; Thu, 15 Dec 2016 16:14:45 +0000 Received: from smtp-out03.msg.oleane.net ([62.161.7.1]) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cHYg4-0000fT-Sl for ath10k@lists.infradead.org; Thu, 15 Dec 2016 16:14:42 +0000 Received: from smtp27.msg.oleane.net ([172.17.20.149]) by smtp-out03.msg.oleane.net with ESMTP id uBFFiDl3025373 for ; Thu, 15 Dec 2016 16:44:15 +0100 Received: from RD9 ([195.6.104.67]) (authenticated) by smtp27.msg.oleane.net (MSA) with ESMTP id uBFFMYu0012493; Thu, 15 Dec 2016 16:22:34 +0100 From: "Jean-Pierre Tosoni" To: "'Jouni Malinen'" References: <004a01d24fe2$94da8dc0$be8fa940$@acksys.fr> <20161214195805.GA15022@w1.fi> In-Reply-To: <20161214195805.GA15022@w1.fi> Subject: RE: ath10k firmware sends probes on DFS channels without radar detection Date: Thu, 15 Dec 2016 16:22:34 +0100 Message-ID: <00f501d256e7$0f8d5380$2ea7fa80$@acksys.fr> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQL3KYY22ZL0scHo7CDJ9nFZ1NgD2AIVo9nHnq5vduA= Content-Language: fr X-Backend: vm-mx-sophos-mta90 X-PMX-Backend: PMX 6.3.1.2588712, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.12.15.151518 running on vm-mx-sophos-mta90 X-PMX-VirusScan: no virus found X-PFSI-Info: PMX 6.3.1.2588712, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.12.15.151518 (no virus found) X-PMX-Spam: Probability=8% X-PMX-SpamScan: NO 8% X-Orange-Auth: bWMxNDg4LTE4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161215_081441_626453_D55E5E87 X-CRM114-Status: GOOD ( 21.01 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Jouni, Thanks for the suggestion, I already tried something like this in wmi.c, with the same result: - Before patching the firmware scans DFS channels actively (with probes). - After patching, the firmware scans DFS channels passively *until* any beacon is received on the DFS channel. When *any* beacon is seen, the firmware decides to scan actively on its own, without any new IR/RADAR info from the driver. So, your patch is required but not sufficient. Somehow I was able to overcome this by reloading the regulation domain in the radio card before each scan request: ////// awful patch ahead //////// //////////////////////////////////////// ...But this sets a terrible penalty on performance when applied to background scan. On 12/14/16 20:58 Jouni Malinen wrote: > > On Tue, Dec 06, 2016 at 06:02:52PM +0100, Jean-Pierre Tosoni wrote: > > This follows on the previous discussion > > "Client station sends probes on DFS channels" > > > > Problem: > > The combination of QCA988X firmware v10.2.4.70-2 + ath10k + > > wpa_supplicant do not comply with the norm ETSI/EN 301-893 section > > 4.7; because they can send probes for 600s when no AP is around. > > > > Analysis: > > The problem seems to lie in the firmware, which regards the presence > > of *any* beacon as a proof that the channel is radar-clean for 600s. > > I don't think this is really firmware, but cfg80211 regulatory code and > how it interacts with ath10k.. > > > - there is no obvious fix working in ath10k. > > - the issue does not show up with other mac80211 devices like ath9k. > > - wpa_supplicant considers this is a kernel issue [2] > > There seems to be a difference between ath9k (mac80211-based Probe Request > frame sending) and ath10k (firmware) in this area for active scanning. > mac80211 uses IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR while ath10k > uses IEEE80211_CHAN_NO_IR. I'd assume this difference results in ath10k > using cfg80211 beacon hints (etc.) to update the NO_IR flag and that might > be behind the difference you see. > > Could you check whether the following change gets you the behavior you > want to see here? I have not had a chance to test this yet, but based on > code review, it looks like something that brings the same behavior to > ath10k that ath9k has for this through mac80211. > > > diff --git a/drivers/net/wireless/ath/ath10k/mac.c > b/drivers/net/wireless/ath/ath10k/mac.c > index aa545a1..758dbbd 100644 > --- a/drivers/net/wireless/ath/ath10k/mac.c > +++ b/drivers/net/wireless/ath/ath10k/mac.c > @@ -2973,7 +2973,8 @@ static int ath10k_update_channel_list(struct ath10k > *ar) > ch->chan_radar = > !!(channel->flags & IEEE80211_CHAN_RADAR); > > - passive = channel->flags & IEEE80211_CHAN_NO_IR; > + passive = channel->flags & (IEEE80211_CHAN_NO_IR | > + IEEE80211_CHAN_RADAR); > ch->passive = passive; > > ch->freq = channel->center_freq; > > -- > Jouni Malinen PGP id EFC895FA > > _______________________________________________ > ath10k mailing list > ath10k@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/ath10k --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -2842,7 +2842,9 @@ static int ath10k_update_channel_list(st ch->chan_radar = !!(channel->flags & IEEE80211_CHAN_RADAR); - passive = channel->flags & IEEE80211_CHAN_NO_IR; + passive = channel->flags & (IEEE80211_CHAN_NO_IR | + IEEE80211_CHAN_RADAR); + ch->passive = passive; ch->freq = channel->center_freq; @@ -3548,6 +3550,9 @@ static int ath10k_start_scan(struct ath1 lockdep_assert_held(&ar->conf_mutex); + if (ar->state == ATH10K_STATE_ON) + ath10k_regd_update(ar); + ret = ath10k_wmi_start_scan(ar, arg); if (ret) return ret;