2 * Copyright (c) 2013 Qualcomm Atheros, Inc.
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #ifndef SPECTRAL_COMMON_H
18 #define SPECTRAL_COMMON_H
20 #define SPECTRAL_HT20_NUM_BINS 56
21 #define SPECTRAL_HT20_40_NUM_BINS 128
23 /* TODO: could possibly be 512, but no samples this large
24 * could be acquired so far.
26 #define SPECTRAL_ATH10K_MAX_NUM_BINS 256
28 /* FFT sample format given to userspace via debugfs.
30 * Please keep the type/length at the front position and change
31 * other fields after adding another sample type
33 * TODO: this might need rework when switching to nl80211-based
36 enum ath_fft_sample_type
{
37 ATH_FFT_SAMPLE_HT20
= 1,
38 ATH_FFT_SAMPLE_HT20_40
,
39 ATH_FFT_SAMPLE_ATH10K
,
42 struct fft_sample_tlv
{
43 u8 type
; /* see ath_fft_sample */
45 /* type dependent data follows */
48 struct fft_sample_ht20
{
49 struct fft_sample_tlv tlv
;
63 u8 data
[SPECTRAL_HT20_NUM_BINS
];
66 struct fft_sample_ht20_40
{
67 struct fft_sample_tlv tlv
;
80 __be16 lower_max_magnitude
;
81 __be16 upper_max_magnitude
;
86 u8 lower_bitmap_weight
;
87 u8 upper_bitmap_weight
;
91 u8 data
[SPECTRAL_HT20_40_NUM_BINS
];
94 struct fft_sample_ath10k
{
95 struct fft_sample_tlv tlv
;
100 __be16 max_magnitude
;
101 __be16 total_gain_db
;
113 #endif /* SPECTRAL_COMMON_H */