aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/spectral_common.h
diff options
context:
space:
mode:
authorSimon Wunderlich <sw@simonwunderlich.de>2014-08-02 09:12:54 +0300
committerKalle Valo <kvalo@qca.qualcomm.com>2014-08-04 09:07:54 +0300
commit855aed1220d2c94425ab01a85fe7a6f5c436940f (patch)
tree9d94bc1928b1dd95b4d807d751b1618a69964f7c /drivers/net/wireless/ath/spectral_common.h
parentath: Move spectral debugfs structs to shared header (diff)
downloadlinux-dev-855aed1220d2c94425ab01a85fe7a6f5c436940f.tar.xz
linux-dev-855aed1220d2c94425ab01a85fe7a6f5c436940f.zip
ath10k: add spectral scan feature
Adds the spectral scan feature for ath10k. The spectral scan is triggered by configuring a mode through a debugfs control file. Samples can be gathered via another relay debugfs file. Essentially, to try it out: ip link set dev wlan0 up echo background > /sys/kernel/debug/ieee80211/phy0/ath10k/spectral_scan_ctl echo trigger > /sys/kernel/debug/ieee80211/phy0/ath10k/spectral_scan_ctl iw dev wlan0 scan echo disable > /sys/kernel/debug/ieee80211/phy0/ath10k/spectral_scan_ctl cat /sys/kernel/debug/ieee80211/phy0/ath10k/spectral_scan0 > samples This feature is still experimental. Based on the original RFC patch of Sven Eckelmann. Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/spectral_common.h')
-rw-r--r--drivers/net/wireless/ath/spectral_common.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/spectral_common.h b/drivers/net/wireless/ath/spectral_common.h
index b9ab722747bd..0d742acb1599 100644
--- a/drivers/net/wireless/ath/spectral_common.h
+++ b/drivers/net/wireless/ath/spectral_common.h
@@ -20,6 +20,11 @@
#define SPECTRAL_HT20_NUM_BINS 56
#define SPECTRAL_HT20_40_NUM_BINS 128
+/* TODO: could possibly be 512, but no samples this large
+ * could be acquired so far.
+ */
+#define SPECTRAL_ATH10K_MAX_NUM_BINS 256
+
/* FFT sample format given to userspace via debugfs.
*
* Please keep the type/length at the front position and change
@@ -31,6 +36,7 @@
enum ath_fft_sample_type {
ATH_FFT_SAMPLE_HT20 = 1,
ATH_FFT_SAMPLE_HT20_40,
+ ATH_FFT_SAMPLE_ATH10K,
};
struct fft_sample_tlv {
@@ -85,4 +91,23 @@ struct fft_sample_ht20_40 {
u8 data[SPECTRAL_HT20_40_NUM_BINS];
} __packed;
+struct fft_sample_ath10k {
+ struct fft_sample_tlv tlv;
+ u8 chan_width_mhz;
+ __be16 freq1;
+ __be16 freq2;
+ __be16 noise;
+ __be16 max_magnitude;
+ __be16 total_gain_db;
+ __be16 base_pwr_db;
+ __be64 tsf;
+ s8 max_index;
+ u8 rssi;
+ u8 relpwr_db;
+ u8 avgpwr_db;
+ u8 max_exp;
+
+ u8 data[0];
+} __packed;
+
#endif /* SPECTRAL_COMMON_H */