aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/debug.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@open-mesh.com>2013-01-23 14:12:39 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-01-30 15:06:42 -0500
commit4ab0b0aa57a794ce299b0192e924379d7353beef (patch)
treed4d26f83abeed0596abdc5c1918af66c29da81a9 /drivers/net/wireless/ath/ath9k/debug.c
parent3a325565c7fa0ba7fd1e319c5fd07665a092fb89 (diff)
ath9k: Update spectral scan output data
The sample data received through the spectral scan can be either in big or little endian byteorder. This information isn't stored in the output file. Therefore it is not possible for the analyzer software to find the correct byte order. It is relative common to get the data from a low end AP in big endian mode and transfer it to another computer in little endian mode to analyze it. Therefore, it would be better to store it in network (big endian) byte order. The extension of the 8 bit bins for each bin to 16 bit is not necessary. This operation can be done in userspace or on a different machine. Instead the max_exp defining the amount of shifting required for each bin is exported to userspace. The change of the output format requires a change of the type in the sample tlv to allow the userspace program to correctly detect the bin format. Reported-by: Zefir Kurtisi <zefir.kurtisi@neratec.com> Signed-off-by: Sven Eckelmann <sven@open-mesh.com> [siwu@hrz.tu-chemnitz.de: squashed patches, update commit message, rebase, fix endianess bug] Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/debug.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 2bbdcf89d39a..3714b971d18e 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -1236,11 +1236,13 @@ static int remove_buf_file_handler(struct dentry *dentry)
1236void ath_debug_send_fft_sample(struct ath_softc *sc, 1236void ath_debug_send_fft_sample(struct ath_softc *sc,
1237 struct fft_sample_tlv *fft_sample_tlv) 1237 struct fft_sample_tlv *fft_sample_tlv)
1238{ 1238{
1239 int length;
1239 if (!sc->rfs_chan_spec_scan) 1240 if (!sc->rfs_chan_spec_scan)
1240 return; 1241 return;
1241 1242
1242 relay_write(sc->rfs_chan_spec_scan, fft_sample_tlv, 1243 length = __be16_to_cpu(fft_sample_tlv->length) +
1243 fft_sample_tlv->length + sizeof(*fft_sample_tlv)); 1244 sizeof(*fft_sample_tlv);
1245 relay_write(sc->rfs_chan_spec_scan, fft_sample_tlv, length);
1244} 1246}
1245 1247
1246static struct rchan_callbacks rfs_spec_scan_cb = { 1248static struct rchan_callbacks rfs_spec_scan_cb = {