1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifndef SPECTRAL_COMMON_H
18 #define SPECTRAL_COMMON_H
19
20 #define SPECTRAL_HT20_NUM_BINS 56
21 #define SPECTRAL_HT20_40_NUM_BINS 128
22
23
24
25
26 #define SPECTRAL_ATH10K_MAX_NUM_BINS 256
27
28
29
30
31
32
33
34
35
36 enum ath_fft_sample_type {
37 ATH_FFT_SAMPLE_HT20 = 1,
38 ATH_FFT_SAMPLE_HT20_40,
39 ATH_FFT_SAMPLE_ATH10K,
40 };
41
42 struct fft_sample_tlv {
43 u8 type;
44 __be16 length;
45
46 } __packed;
47
48 struct fft_sample_ht20 {
49 struct fft_sample_tlv tlv;
50
51 u8 max_exp;
52
53 __be16 freq;
54 s8 rssi;
55 s8 noise;
56
57 __be16 max_magnitude;
58 u8 max_index;
59 u8 bitmap_weight;
60
61 __be64 tsf;
62
63 u8 data[SPECTRAL_HT20_NUM_BINS];
64 } __packed;
65
66 struct fft_sample_ht20_40 {
67 struct fft_sample_tlv tlv;
68
69 u8 channel_type;
70 __be16 freq;
71
72 s8 lower_rssi;
73 s8 upper_rssi;
74
75 __be64 tsf;
76
77 s8 lower_noise;
78 s8 upper_noise;
79
80 __be16 lower_max_magnitude;
81 __be16 upper_max_magnitude;
82
83 u8 lower_max_index;
84 u8 upper_max_index;
85
86 u8 lower_bitmap_weight;
87 u8 upper_bitmap_weight;
88
89 u8 max_exp;
90
91 u8 data[SPECTRAL_HT20_40_NUM_BINS];
92 } __packed;
93
94 struct fft_sample_ath10k {
95 struct fft_sample_tlv tlv;
96 u8 chan_width_mhz;
97 __be16 freq1;
98 __be16 freq2;
99 __be16 noise;
100 __be16 max_magnitude;
101 __be16 total_gain_db;
102 __be16 base_pwr_db;
103 __be64 tsf;
104 s8 max_index;
105 u8 rssi;
106 u8 relpwr_db;
107 u8 avgpwr_db;
108 u8 max_exp;
109
110 u8 data[0];
111 } __packed;
112
113 #endif