All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath9k: corrctly handle short radar pulses (fixes 3c0efb745a)
@ 2019-06-11 13:10 Zefir Kurtisi
  2019-06-11 13:36 ` [PATCH v2] ath9k: correctly " Zefir Kurtisi
  0 siblings, 1 reply; 7+ messages in thread
From: Zefir Kurtisi @ 2019-06-11 13:10 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, nbd

In commit '3c0efb745a17 ("ath9k: discard undersized packets")'
the lower bound of RX packets was set to 10 (min ACK size) to
filter those that would otherwise be treated as invalid at
mac80211.

Alas, short radar pulses are reported as PHY_ERROR frames
with length set to 3. Therefore their detection stopped
working after that commit.

NOTE: ath9k drivers built thereafter will not pass DFS
certification.

This extends the criteria for short packages to explicitly
handle PHY_ERROR frames.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
---
 drivers/net/wireless/ath/ath9k/recv.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 4e97f7f3b2a3..5519c144d1f1 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -815,6 +815,7 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
 	struct ath_common *common = ath9k_hw_common(ah);
 	struct ieee80211_hdr *hdr;
 	bool discard_current = sc->rx.discard_next;
+	bool is_phyerr;
 
 	/*
 	 * Discard corrupt descriptors which are marked in
@@ -827,8 +828,11 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
 
 	/*
 	 * Discard zero-length packets and packets smaller than an ACK
+	 * which are not PHY_ERROR (short radar pulses have a length of 3)
 	 */
-	if (rx_stats->rs_datalen < 10) {
+	is_phyerr = rx_stats->rs_status & ATH9K_RXERR_PHY;
+	if (!rx_stats->rs_datalen ||
+	    (rx_stats->rs_datalen < 10 && !is_phyerr)) {
 		RX_STAT_INC(sc, rx_len_err);
 		goto corrupt;
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2] ath9k: correctly handle short radar pulses (fixes 3c0efb745a)
  2019-06-11 13:10 [PATCH] ath9k: corrctly handle short radar pulses (fixes 3c0efb745a) Zefir Kurtisi
@ 2019-06-11 13:36 ` Zefir Kurtisi
  2019-06-11 13:42   ` Kalle Valo
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Zefir Kurtisi @ 2019-06-11 13:36 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, nbd

Changes to v1:
* typos fixed in commit-message
--

In commit '3c0efb745a17 ("ath9k: discard undersized packets")'
the lower bound of RX packets was set to 10 (min ACK size) to
filter those that would otherwise be treated as invalid at
mac80211.

Alas, short radar pulses are reported as PHY_ERROR frames
with length set to 3. Therefore their detection stopped
working after that commit.

NOTE: ath9k drivers built thereafter will not pass DFS
certification.

This extends the criteria for short packets to explicitly
handle PHY_ERROR frames.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
---
 drivers/net/wireless/ath/ath9k/recv.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 4e97f7f3b2a3..5519c144d1f1 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -815,6 +815,7 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
 	struct ath_common *common = ath9k_hw_common(ah);
 	struct ieee80211_hdr *hdr;
 	bool discard_current = sc->rx.discard_next;
+	bool is_phyerr;
 
 	/*
 	 * Discard corrupt descriptors which are marked in
@@ -827,8 +828,11 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
 
 	/*
 	 * Discard zero-length packets and packets smaller than an ACK
+	 * which are not PHY_ERROR (short radar pulses have a length of 3)
 	 */
-	if (rx_stats->rs_datalen < 10) {
+	is_phyerr = rx_stats->rs_status & ATH9K_RXERR_PHY;
+	if (!rx_stats->rs_datalen ||
+	    (rx_stats->rs_datalen < 10 && !is_phyerr)) {
 		RX_STAT_INC(sc, rx_len_err);
 		goto corrupt;
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ath9k: correctly handle short radar pulses (fixes 3c0efb745a)
  2019-06-11 13:36 ` [PATCH v2] ath9k: correctly " Zefir Kurtisi
@ 2019-06-11 13:42   ` Kalle Valo
  2019-06-11 13:43   ` Kalle Valo
  2019-06-27 17:46   ` Kalle Valo
  2 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2019-06-11 13:42 UTC (permalink / raw)
  To: Zefir Kurtisi; +Cc: linux-wireless, nbd

Zefir Kurtisi <zefir.kurtisi@neratec.com> writes:

> Changes to v1:
> * typos fixed in commit-message
> --

This in the wrong place.

> In commit '3c0efb745a17 ("ath9k: discard undersized packets")'
> the lower bound of RX packets was set to 10 (min ACK size) to
> filter those that would otherwise be treated as invalid at
> mac80211.
>
> Alas, short radar pulses are reported as PHY_ERROR frames
> with length set to 3. Therefore their detection stopped
> working after that commit.
>
> NOTE: ath9k drivers built thereafter will not pass DFS
> certification.
>
> This extends the criteria for short packets to explicitly
> handle PHY_ERROR frames.
>
> Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
> ---

The changelog should be here. But I can fix it manually this time.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ath9k: correctly handle short radar pulses (fixes 3c0efb745a)
  2019-06-11 13:36 ` [PATCH v2] ath9k: correctly " Zefir Kurtisi
  2019-06-11 13:42   ` Kalle Valo
@ 2019-06-11 13:43   ` Kalle Valo
  2019-06-11 13:48     ` Zefir Kurtisi
  2019-06-27 17:46   ` Kalle Valo
  2 siblings, 1 reply; 7+ messages in thread
From: Kalle Valo @ 2019-06-11 13:43 UTC (permalink / raw)
  To: Zefir Kurtisi; +Cc: linux-wireless, nbd

Zefir Kurtisi <zefir.kurtisi@neratec.com> writes:

> Changes to v1:
> * typos fixed in commit-message
> --
>
> In commit '3c0efb745a17 ("ath9k: discard undersized packets")'
> the lower bound of RX packets was set to 10 (min ACK size) to
> filter those that would otherwise be treated as invalid at
> mac80211.
>
> Alas, short radar pulses are reported as PHY_ERROR frames
> with length set to 3. Therefore their detection stopped
> working after that commit.
>
> NOTE: ath9k drivers built thereafter will not pass DFS
> certification.
>
> This extends the criteria for short packets to explicitly
> handle PHY_ERROR frames.
>
> Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>

Forgot to mention that the Fixes line should be before s-o-b, not in the
title:

Fixes: 3c0efb745a17 ("ath9k: discard undersized packets")

I'll fix (no pun intended) that as well.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ath9k: correctly handle short radar pulses (fixes 3c0efb745a)
  2019-06-11 13:43   ` Kalle Valo
@ 2019-06-11 13:48     ` Zefir Kurtisi
  2019-06-11 14:08       ` Kalle Valo
  0 siblings, 1 reply; 7+ messages in thread
From: Zefir Kurtisi @ 2019-06-11 13:48 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, nbd

On 6/11/19 3:43 PM, Kalle Valo wrote:
> Zefir Kurtisi <zefir.kurtisi@neratec.com> writes:
> 
>> Changes to v1:
>> * typos fixed in commit-message
>> --
>>
>> In commit '3c0efb745a17 ("ath9k: discard undersized packets")'
>> the lower bound of RX packets was set to 10 (min ACK size) to
>> filter those that would otherwise be treated as invalid at
>> mac80211.
>>
>> Alas, short radar pulses are reported as PHY_ERROR frames
>> with length set to 3. Therefore their detection stopped
>> working after that commit.
>>
>> NOTE: ath9k drivers built thereafter will not pass DFS
>> certification.
>>
>> This extends the criteria for short packets to explicitly
>> handle PHY_ERROR frames.
>>
>> Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
> 
> Forgot to mention that the Fixes line should be before s-o-b, not in the
> title:
> 
> Fixes: 3c0efb745a17 ("ath9k: discard undersized packets")
> 
> I'll fix (no pun intended) that as well.
> 
Thanks. Was unsure about that, checkpatch warned about format (mandatory 12 digit
hash), but not the proper location. Will keep in mind.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ath9k: correctly handle short radar pulses (fixes 3c0efb745a)
  2019-06-11 13:48     ` Zefir Kurtisi
@ 2019-06-11 14:08       ` Kalle Valo
  0 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2019-06-11 14:08 UTC (permalink / raw)
  To: Zefir Kurtisi; +Cc: linux-wireless, nbd

Zefir Kurtisi <zefir.kurtisi@neratec.com> writes:

> On 6/11/19 3:43 PM, Kalle Valo wrote:
>> Zefir Kurtisi <zefir.kurtisi@neratec.com> writes:
>> 
>>> Changes to v1:
>>> * typos fixed in commit-message
>>> --
>>>
>>> In commit '3c0efb745a17 ("ath9k: discard undersized packets")'
>>> the lower bound of RX packets was set to 10 (min ACK size) to
>>> filter those that would otherwise be treated as invalid at
>>> mac80211.
>>>
>>> Alas, short radar pulses are reported as PHY_ERROR frames
>>> with length set to 3. Therefore their detection stopped
>>> working after that commit.
>>>
>>> NOTE: ath9k drivers built thereafter will not pass DFS
>>> certification.
>>>
>>> This extends the criteria for short packets to explicitly
>>> handle PHY_ERROR frames.
>>>
>>> Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
>> 
>> Forgot to mention that the Fixes line should be before s-o-b, not in the
>> title:
>> 
>> Fixes: 3c0efb745a17 ("ath9k: discard undersized packets")
>> 
>> I'll fix (no pun intended) that as well.
>> 
> Thanks. Was unsure about that, checkpatch warned about format (mandatory 12 digit
> hash), but not the proper location. Will keep in mind.

I have tried to document the most important parts to the wiki:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#fixes_line_is_incorrect

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ath9k: correctly handle short radar pulses (fixes 3c0efb745a)
  2019-06-11 13:36 ` [PATCH v2] ath9k: correctly " Zefir Kurtisi
  2019-06-11 13:42   ` Kalle Valo
  2019-06-11 13:43   ` Kalle Valo
@ 2019-06-27 17:46   ` Kalle Valo
  2 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2019-06-27 17:46 UTC (permalink / raw)
  To: Zefir Kurtisi; +Cc: linux-wireless, nbd

Zefir Kurtisi <zefir.kurtisi@neratec.com> wrote:

> In commit 3c0efb745a17 ("ath9k: discard undersized packets")
> the lower bound of RX packets was set to 10 (min ACK size) to
> filter those that would otherwise be treated as invalid at
> mac80211.
> 
> Alas, short radar pulses are reported as PHY_ERROR frames
> with length set to 3. Therefore their detection stopped
> working after that commit.
> 
> NOTE: ath9k drivers built thereafter will not pass DFS
> certification.
> 
> This extends the criteria for short packets to explicitly
> handle PHY_ERROR frames.
> 
> Fixes: 3c0efb745a17 ("ath9k: discard undersized packets")
> Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

df5c4150501e ath9k: correctly handle short radar pulses

-- 
https://patchwork.kernel.org/patch/10986957/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-06-27 17:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 13:10 [PATCH] ath9k: corrctly handle short radar pulses (fixes 3c0efb745a) Zefir Kurtisi
2019-06-11 13:36 ` [PATCH v2] ath9k: correctly " Zefir Kurtisi
2019-06-11 13:42   ` Kalle Valo
2019-06-11 13:43   ` Kalle Valo
2019-06-11 13:48     ` Zefir Kurtisi
2019-06-11 14:08       ` Kalle Valo
2019-06-27 17:46   ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.