aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/dfs.c
AgeCommit message (Collapse)Author
2018-05-25ath: add support to get the detected radar specificationsSriram R
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-04-10ath9k: dfs: remove accidental use of stack VLAGustavo A. R. Silva
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>
2017-12-02ath9k: dfs: use swap macro in ath9k_check_chirpingGustavo A. R. Silva
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-09-25ath9k: remove cast to void pointerHimanshu Jha
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>
2015-07-11ath9k: DFS - add pulse chirp detection for FCCZefir Kurtisi
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-11ath9k: DFS - consider ext_channel pulses only in HT40 modeZefir Kurtisi
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-03-16ath9k: add DFS support for extension channelZefir Kurtisi
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>
2014-05-29ath9k: simplify DFS pulse interval debug printingZefir Kurtisi
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-22ath9k: fix build error with disabled debugZefir Kurtisi
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-13ath9k: non-functional: calculate DFS pulse interval per-wiphyZefir Kurtisi
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>
2013-12-18ath9k: add support for reporting per-chain signal strengthFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22ath9k: change DFS logging to use ath_dbg()Zefir Kurtisi
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-08ath9k: add support for DFS master modeZefir Kurtisi
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>
2012-04-23ath9k: extend DFS detector stats in dfs_debugfsZefir Kurtisi
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-11ath9k: update to DFS pattern detector interfaceZefir Kurtisi
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>
2011-12-21ath9k: fix roadkill due to Joe's patch on ath_dbg() changesLuis R. Rodriguez
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-15ath9k: add DFS radar pulse processingZefir Kurtisi
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>