Commit 9ef7f897 authored by Zefir Kurtisi's avatar Zefir Kurtisi Committed by Greg Kroah-Hartman

ath9k: correctly handle short radar pulses

[ Upstream commit df5c4150 ]

In commit 3c0efb74 ("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: 3c0efb74 ("ath9k: discard undersized packets")
Signed-off-by: default avatarZefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 58093426
...@@ -815,6 +815,7 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc, ...@@ -815,6 +815,7 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
bool discard_current = sc->rx.discard_next; bool discard_current = sc->rx.discard_next;
bool is_phyerr;
/* /*
* Discard corrupt descriptors which are marked in * Discard corrupt descriptors which are marked in
...@@ -827,8 +828,11 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc, ...@@ -827,8 +828,11 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
/* /*
* Discard zero-length packets and packets smaller than an ACK * 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); RX_STAT_INC(sc, rx_len_err);
goto corrupt; goto corrupt;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment