RX filter flags previously set for DFS radar detection were not
preserved after "ath9k: disable unnecessary PHY error reporting".
This patch ensures that the flags required for DFS support are
kept set.
Signed-off-by: Zefir Kurtisi <[email protected]>
---
drivers/net/wireless/ath/ath9k/recv.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 592ae5b..02c8dc3 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -417,6 +417,7 @@ void ath_rx_cleanup(struct ath_softc *sc)
* Calculate the receive filter according to the
* operating mode and state:
*
+ * o preserve DFS (phyerror, phyradar)
* o always accept unicast, broadcast, and multicast traffic
* o maintain current state of phy error reception (the hal
* may enable phy error frames for noise immunity work)
@@ -434,10 +435,15 @@ void ath_rx_cleanup(struct ath_softc *sc)
u32 ath_calcrxfilter(struct ath_softc *sc)
{
+ const u32 rx_filter_preserve =
+ (ATH9K_RX_FILTER_PHYERR | ATH9K_RX_FILTER_PHYRADAR);
+ const u32 rx_filter_accept =
+ (ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
+ | ATH9K_RX_FILTER_MCAST);
u32 rfilt;
- rfilt = ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
- | ATH9K_RX_FILTER_MCAST;
+ rfilt = (ath9k_hw_getrxfilter(sc->sc_ah) & rx_filter_preserve);
+ rfilt |= rx_filter_accept;
if (sc->rx.rxfilter & FIF_PROBE_REQ)
rfilt |= ATH9K_RX_FILTER_PROBEREQ;
@@ -475,8 +481,6 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
}
return rfilt;
-
-#undef RX_FILTER_PRESERVE
}
int ath_startrecv(struct ath_softc *sc)
--
1.7.4.1
On 2011-11-02 1:10 PM, Zefir Kurtisi wrote:
> RX filter flags previously set for DFS radar detection were not
> preserved after "ath9k: disable unnecessary PHY error reporting".
>
> This patch ensures that the flags required for DFS support are
> kept set.
>
> Signed-off-by: Zefir Kurtisi<[email protected]>
I think preserving the existing register values is a bit fragile wrt.
hardware resets, register clobbering, etc.
How about just adding an internal flag or bool in the softc?
- Felix
On 11/02/2011 02:19 PM, Felix Fietkau wrote:
> On 2011-11-02 1:10 PM, Zefir Kurtisi wrote:
>> RX filter flags previously set for DFS radar detection were not
>> preserved after "ath9k: disable unnecessary PHY error reporting".
>>
>> This patch ensures that the flags required for DFS support are
>> kept set.
>>
>> Signed-off-by: Zefir Kurtisi<[email protected]>
> I think preserving the existing register values is a bit fragile wrt. hardware resets, register clobbering, etc.
> How about just adding an internal flag or bool in the softc?
>
> - Felix
Hm, need to dig deeper.
Ideally, the DFS rx filter flags are set at reset along with the channel setup and remain untouched until the chip is stopped (and set-up again).
In fact, currently ath9k_hw_setrxfilter() is called only when the chip is stopped (clearing all flags in ath_stoprecv()) and from ath_opmode_init() and ieee80211_configure_filter() with the flags returned by ath_calcrxfilter().
Since ath_calcrxfilter() provides static initial filter settings for the current opmode, all rx filter flags set internally are reset each time ieee80211_configure_filter() is called.
With your proposal, we need to mirror each rx filter bit set in softc to be reset in ath_calcrxfilter(), right?.
My thinking is, if it is assured that the chip is always reset after a stop, we can ignore potential register clobbering and preserve those bits set in ath_calcrxfilter().
Thanks
Zefir