* [PATCH] ath9k: preserve DFS flags in calcrxfilter
@ 2011-11-02 12:10 Zefir Kurtisi
2011-11-02 13:19 ` Felix Fietkau
0 siblings, 1 reply; 3+ messages in thread
From: Zefir Kurtisi @ 2011-11-02 12:10 UTC (permalink / raw)
To: linux-wireless, ath9k-devel; +Cc: rodrigue, nbd, linville, Zefir Kurtisi
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 <zefir.kurtisi@neratec.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ath9k: preserve DFS flags in calcrxfilter
2011-11-02 12:10 [PATCH] ath9k: preserve DFS flags in calcrxfilter Zefir Kurtisi
@ 2011-11-02 13:19 ` Felix Fietkau
2011-11-02 16:23 ` Zefir Kurtisi
0 siblings, 1 reply; 3+ messages in thread
From: Felix Fietkau @ 2011-11-02 13:19 UTC (permalink / raw)
To: Zefir Kurtisi; +Cc: linux-wireless, ath9k-devel, rodrigue, linville
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<zefir.kurtisi@neratec.com>
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ath9k: preserve DFS flags in calcrxfilter
2011-11-02 13:19 ` Felix Fietkau
@ 2011-11-02 16:23 ` Zefir Kurtisi
0 siblings, 0 replies; 3+ messages in thread
From: Zefir Kurtisi @ 2011-11-02 16:23 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, ath9k-devel, rodrigue, linville
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<zefir.kurtisi@neratec.com>
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-02 16:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-02 12:10 [PATCH] ath9k: preserve DFS flags in calcrxfilter Zefir Kurtisi
2011-11-02 13:19 ` Felix Fietkau
2011-11-02 16:23 ` Zefir Kurtisi
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).