linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zefir Kurtisi <zefir.kurtisi@neratec.com>
To: Simon Wunderlich <sw@simonwunderlich.de>,
	Arend van Spriel <arend@broadcom.com>
Cc: linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org,
	kvalo@qca.qualcomm.com, mathias.kretschmer@fokus.fraunhofer.de,
	stable@vger.kernel.org
Subject: Re: [PATCH] ath9k: ignore radar PHY errors when DFS is not enabled
Date: Tue, 13 Jan 2015 11:16:02 +0100	[thread overview]
Message-ID: <54B4F062.2090301@neratec.com> (raw)
In-Reply-To: <2179820.H2CYa3nAla@prime>

[-- Attachment #1: Type: text/plain, Size: 2565 bytes --]

On 01/10/2015 05:26 PM, Simon Wunderlich wrote:
> On Friday 09 January 2015 19:57:37 Arend van Spriel wrote:
>> On 01/09/15 17:54, Simon Wunderlich wrote:
>>> Performing spectral scans on 5 GHz channels may result in PHY errors
>>> sent by the hardware, even if DFS support is not enabled in the driver
>>> (e.g. channel scanning or passive monitoring). In that case channels may
>>> falsely get marked as 'unusable'. To fix that, only process radar PHY
>>> errors when radar is explicitly enabled in the driver.
>>
>> Hi Simon,
>>
>> Not an ath9k expert, but I would think those channels would already be
>> marked as unusable, because DFS is disabled in the driver. Or does this
>> also affect 5G channels that do not require DFS.
>>
>> Regards,
>> Arend
> 
> Hey Arend,
> 
> maybe that was not really clear, but this is talking about the DFS state 
> "unusable". By default, channels are marked in DFS state "usable", and after 
> the clear channel assessment (which is done e.g. when starting AP mode) they 
> are marked as "available". As soon as radar is detected they are marked as 
> "unusable".
> 
> These DFS state changes should only happen while there is something operating 
> with radar enabled, e.g. AP mode. It should not happen if we just have monitor 
> mode or scan for channels. These channels should then stay in their previous 
> DFS state (e.g. 'usable'). This was borked and this patch tries to fix it. :)
> 
> Cheers,
>      Simon
> 
Hi,

the issue here is that DFS and spectral use the same PHY_ERROR reporting
mechanism, and the dfs module is still in its initial state prior the spectral
support was added. With that, feeding the dfs detector with PHY_ERROR frames
generated by spectral scanner might cause false radar detections.

I did not dig how the hw->conf.radar_enabled flag is set in monitor mode, but if
it is same as for master (i.e. set for DFS channels), then it would be a better
approach to prevent calling ath9k_dfs_process_phyerr() altogether from
ath9k_rx_skb_preprocess() if not set.

And while you're at that: slaves do not need to scan for radar, might be worth
checking if it makes sense to selectively disable radar detection in STA mode. I
am using attached private OpenWRT patch for that - which still would interfere
with spectral scanning. Generally, the PHY_ERROR processing should be reworked but
becomes quite complicated when you take into account special use-cases. Think of
radar events being treated differently depending on whether a master or a monitor
detected them (OC-CAC vs. ISM).


Cheers,
Zefir


[-- Attachment #2: 999-0001-ath9k-do-not-enable-radar-pulse-detection-in-STA-mod.patch --]
[-- Type: text/x-patch, Size: 788 bytes --]

>From 089ab0d624d4b6f3a206ea8a81b4a3e061cf3edb Mon Sep 17 00:00:00 2001
From: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Date: Thu, 30 Jan 2014 13:33:50 +0100
Subject: [PATCH] ath9k: do not enable radar pulse detection in STA mode

---
 drivers/net/wireless/ath/ath9k/recv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -384,7 +384,7 @@ u32 ath_calcrxfilter(struct ath_softc *s
 		| ATH9K_RX_FILTER_MCAST;
 
 	/* if operating on a DFS channel, enable radar pulse detection */
-	if (sc->hw->conf.radar_enabled)
+	if (sc->hw->conf.radar_enabled && sc->sc_ah->opmode != NL80211_IFTYPE_STATION)
 		rfilt |= ATH9K_RX_FILTER_PHYRADAR | ATH9K_RX_FILTER_PHYERR;
 
 	spin_lock_bh(&sc->chan_lock);

  reply	other threads:[~2015-01-13 10:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09 16:54 [PATCH] ath9k: ignore radar PHY errors when DFS is not enabled Simon Wunderlich
2015-01-09 18:57 ` Arend van Spriel
2015-01-10 16:26   ` Simon Wunderlich
2015-01-13 10:16     ` Zefir Kurtisi [this message]
2015-01-13 11:04       ` Simon Wunderlich
2015-01-13 12:08         ` Zefir Kurtisi
2015-01-15 14:30         ` Kalle Valo
2015-01-15 15:58           ` Simon Wunderlich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54B4F062.2090301@neratec.com \
    --to=zefir.kurtisi@neratec.com \
    --cc=arend@broadcom.com \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mathias.kretschmer@fokus.fraunhofer.de \
    --cc=stable@vger.kernel.org \
    --cc=sw@simonwunderlich.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).