aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/common-spectral.c
Commit message (Collapse)AuthorAge
* ath9k: Mix the received FFT bins to the random poolNick Kossifidis2015-05-09
| | | | | | | | | | E/M noise is a pretty good source of entropy so we mix the FFT measurements of the E/M spectrum to /dev/random pool. Note that this doesn't increase the pool's entropy count but it still helps on improving the output of /dev/(u)random. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath9k: No need for that extra memsetNick Kossifidis2015-05-09
| | | | | | | | Temp buffer is only used for fixing malformed frames, there is no need to memset it every time. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath9k: Skip FFT reports if we are out of output buffersNick Kossifidis2015-05-09
| | | | | | | | | There is no reason to keep processing FFT reports if there is no space left on the relayfs buffers for the results. This saves lots of CPU cycles, especially on normal (non-short) reports. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath9k: No need for that extra memcpyNick Kossifidis2015-05-09
| | | | | | | | No need to copy the frame to the temporary buffer when its length is ok. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath9k: Skip malformed frames on normal FFT reportNick Kossifidis2015-05-09
| | | | | | | | | Since we have lots of frames on a normal FFT report don't bother processing the malformed ones. Only try to fix malformed frames in case of a short FFT report (only a single frame on the report). Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath9k: Support processing of multiple FFT frames per report.Nick Kossifidis2015-05-09
| | | | | | | | | | | | | | | | Since we can identify the FFT frames on the report by checking the consistency of their magnitude info, we can process all of them, even when some of them are corrupted. This patch introduces two functions to quickly verify the integrity of the mag_info fields and some further tweaks to detect the frames in the report and process them. Note that in case of missing bytes we don't duplicate them, instead we leave them as zeroes. This way we get less noise on the FFT plot. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath9k: Perform integrity checks when processing FFT framesNick Kossifidis2015-05-09
| | | | | | | | | | | | a) Check that the maximum magnitude is at the specified index b) Check if the maximum magnitude index is at dc_pos and if so calculate a new one (value at dc_pos is invalid) c) Check if the specified maximum magnitude is indeed the maximum Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath9k: Move processing of FFT frames to different functionsNick Kossifidis2015-05-09
| | | | | | | | Since more checks and fixes will be added later and ath_cmn_process_fft is already big enough. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath9k: Fix hanlding of maximum magnitude indexNick Kossifidis2015-05-09
| | | | | | | | | | | | | | | Maximum magnitude index is a 5bit signed integer, convert to an 8bit signed integer and then "shift" it so that it can be used as an array index. Note that the current implementation adds +1 to the index value (so it can't be used as an array index) and it's only valid for HT20 channels. Note that the maximum magnitude index is not being used by the userspace tools that parse FFT samples (they just use maximum magnitude) so this doesn't break userspace compatibility. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath9k: Delete an unnecessary check before the function call "relay_close"Markus Elfring2015-02-06
| | | | | | | | | | The relay_close() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* ath9k: move spectral.* to common-spectral.*Oleksij Rempel2014-11-11
and rename exports from ath9k_spectral_* to ath9k_cmn_spectral_* Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>