Commit graph

17 commits

Author SHA1 Message Date
Sriram R f40105e674 ath: add support to get the detected radar specifications
This enables ath10k/ath9k drivers to collect the specifications of the
radar type once it is detected by the dfs pattern detector unit.
Usage of the collected info is specific to driver implementation.
For example, collected radar info could be used by the host driver
to send to co-processors for additional processing/validation.

Note: 'radar_detector_specs' data containing the specifications of
different radar types which was private within dfs_pattern_detector/
dfs_pri_detector is now shared with drivers as well for making use
of this information.

Signed-off-by: Sriram R <srirrama@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-05-25 13:15:21 +03:00
Gustavo A. R. Silva 9c27489a34 ath9k: dfs: remove accidental use of stack VLA
In preparation to enabling -Wvla, remove accidental use of stack VLA.

This avoids an accidental stack VLA (since the compiler thinks
the value of FFT_NUM_SAMPLES can change, even when marked
"const"). This just replaces it with a #define.

Also, fixed as part of the directive to remove all VLAs from
the kernel: https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-04-10 17:32:44 +03:00
Gustavo A. R. Silva 626ab6707a ath9k: dfs: use swap macro in ath9k_check_chirping
Make use of the swap macro and remove unnecessary variable temp.
This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-12-02 16:12:53 +02:00
Himanshu Jha 50c8cd44ed ath9k: remove cast to void pointer
casting to void pointer from any pointer type and vice-versa is done
implicitly and therefore casting is not needed in such a case.

Done using Coccinellle.
Semantic Patch used :

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)


Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-09-25 10:13:58 +03:00
Zefir Kurtisi 8fc2b61a36 ath9k: DFS - add pulse chirp detection for FCC
FCC long pulse radar (type 5) requires pulses to be
checked for chirping. This patch implements chirp
detection based on the FFT data provided for long
pulses.

A chirp is detected when a set of criteria defined
by FCC pulse characteristics is met, including
* have at least 4 FFT samples
* max_bin index moves equidistantly between samples
* the gradient is within defined range

The chirp detection has been tested with reference
radar generating devices and proved to work reliably.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-11 19:51:53 +03:00
Zefir Kurtisi 8f010d9ca8 ath9k: DFS - consider ext_channel pulses only in HT40 mode
The chip reports radar pulses on extension channel
even if operating in HT20 mode. This patch adds a
sanity check for HT40 mode before it feeds pulses
on extension channel to the pattern detector.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-11 19:51:20 +03:00
Zefir Kurtisi 58766977ad ath9k: add DFS support for extension channel
In HT40 modes, pulse events on primary and extension
channel are processed individually. If valid, a pulse
event will be fed into the detector
* for primary frequency, or
* for extension frequency (+/-20MHz based on HT40-mode)
* or both

With that, a 40MHz radar will result in two individual
radar events.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-03-16 17:53:07 +02:00
Zefir Kurtisi 3f3c09f38b ath9k: simplify DFS pulse interval debug printing
Make DFS pulse interval calculation independent
from CONFIG_ATH9K_DEBUGFS.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-05-29 13:08:10 -04:00
Zefir Kurtisi b7a5970144 ath9k: fix build error with disabled debug
DFS pulse interval printing is only available
when CONFIG_ATH9K_DEBUGFS is set.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-05-22 14:04:37 -04:00
Zefir Kurtisi e515e9cb64 ath9k: non-functional: calculate DFS pulse interval per-wiphy
Systems with multiple DFS channel detectors need to track
timestamp of previous pulse per instance to display the
correct pulse interval.

Since the interval value is used for debug printing only,
this is a non-functional modification.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-05-13 15:56:34 -04:00
Felix Fietkau e45e91d881 ath9k: add support for reporting per-chain signal strength
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:19 -05:00
Zefir Kurtisi ca21cfde84 ath9k: change DFS logging to use ath_dbg()
The DFS pattern detector was initially planned to reside on
a higher layer and used generic pr_*() logging functions.

Being part of ath9k, use ath_dbg() instead and make DFS log
ouput selectable via ATH_DBG_DFS (0x20000) at runtime.

This patch does not contain functional modifications.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:17:40 -04:00
Zefir Kurtisi 73e4937d48 ath9k: add support for DFS master mode
These are the remaining knobs in ath9k to support DFS:
* mark AR9280 and AR9580 as DFS tested
* synchronize DFS regulatory domain to reg notifyer
* set required RX filter flags for radar detection
* process radar PHY errors at DFS detector
* notify DFS master on radar detection

DFS support requires CONFIG_ATH9K_DFS_CERTIFIED to be set.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-08 15:28:38 -04:00
Zefir Kurtisi b96f20b3af ath9k: extend DFS detector stats in dfs_debugfs
Extend debugfs entry for dfs_stats with DFS detection events
and shared pool statistics.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-23 15:37:41 -04:00
Zefir Kurtisi 56dc389f76 ath9k: update to DFS pattern detector interface
Follow updates in DFS pattern detector interface:
a) use given pulse event structure
b) adapt to boolean return value of add_pulse()

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-11 16:23:54 -04:00
Luis R. Rodriguez ec9a570547 ath9k: fix roadkill due to Joe's patch on ath_dbg() changes
Joe changed ath_dbg() to simpify code but while his patch was
being merged dfs.c was born and as such did not get the change
Joe envisioned. This fixes that. Test compiled with:

 make allmodconfig

Cc: Joe Perches <joe@perches.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: John W. Linville <linville@tuxdriver.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-21 15:06:11 -05:00
Zefir Kurtisi 29942bc125 ath9k: add DFS radar pulse processing
This initial DFS module provides basic functionality to deal
with radar pulses reported by the Atheros DFS HW pulse detector.

The reported data is evaluated and basic plausibility checks
are performed to filter false pulses. Passing radar pulses are
forwarded to pattern detectors which are not yet implemented.

(Some modifications to actually use ATH9K_DFS_DEBUGFS based on comments
from Julian Calaby <julian.calaby@gmail.com>. -- JWL)

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-15 14:46:37 -05:00