brintos

brintos / linux-shallow public Read only

0
0
Text · 2.7 KiB · fe187c1 Raw
130 lines · c
1/*2 * Copyright (c) 2013 Qualcomm Atheros, Inc.3 *4 * Permission to use, copy, modify, and/or distribute this software for any5 * purpose with or without fee is hereby granted, provided that the above6 * copyright notice and this permission notice appear in all copies.7 *8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.15 */16 17#ifndef SPECTRAL_COMMON_H18#define SPECTRAL_COMMON_H19 20#define SPECTRAL_HT20_NUM_BINS		5621#define SPECTRAL_HT20_40_NUM_BINS		12822 23/* TODO: could possibly be 512, but no samples this large24 * could be acquired so far.25 */26#define SPECTRAL_ATH10K_MAX_NUM_BINS		25627 28/* FFT sample format given to userspace via debugfs.29 *30 * Please keep the type/length at the front position and change31 * other fields after adding another sample type32 *33 * TODO: this might need rework when switching to nl80211-based34 * interface.35 */36enum ath_fft_sample_type {37	ATH_FFT_SAMPLE_HT20 = 1,38	ATH_FFT_SAMPLE_HT20_40,39	ATH_FFT_SAMPLE_ATH10K,40	ATH_FFT_SAMPLE_ATH11K41};42 43struct fft_sample_tlv {44	u8 type;	/* see ath_fft_sample */45	__be16 length;46	/* type dependent data follows */47} __packed;48 49struct fft_sample_ht20 {50	struct fft_sample_tlv tlv;51 52	u8 max_exp;53 54	__be16 freq;55	s8 rssi;56	s8 noise;57 58	__be16 max_magnitude;59	u8 max_index;60	u8 bitmap_weight;61 62	__be64 tsf;63 64	u8 data[SPECTRAL_HT20_NUM_BINS];65} __packed;66 67struct fft_sample_ht20_40 {68	struct fft_sample_tlv tlv;69 70	u8 channel_type;71	__be16 freq;72 73	s8 lower_rssi;74	s8 upper_rssi;75 76	__be64 tsf;77 78	s8 lower_noise;79	s8 upper_noise;80 81	__be16 lower_max_magnitude;82	__be16 upper_max_magnitude;83 84	u8 lower_max_index;85	u8 upper_max_index;86 87	u8 lower_bitmap_weight;88	u8 upper_bitmap_weight;89 90	u8 max_exp;91 92	u8 data[SPECTRAL_HT20_40_NUM_BINS];93} __packed;94 95struct fft_sample_ath10k {96	struct fft_sample_tlv tlv;97	u8 chan_width_mhz;98	__be16 freq1;99	__be16 freq2;100	__be16 noise;101	__be16 max_magnitude;102	__be16 total_gain_db;103	__be16 base_pwr_db;104	__be64 tsf;105	s8 max_index;106	u8 rssi;107	u8 relpwr_db;108	u8 avgpwr_db;109	u8 max_exp;110 111	u8 data[];112} __packed;113 114struct fft_sample_ath11k {115	struct fft_sample_tlv tlv;116	u8 chan_width_mhz;117	s8 max_index;118	u8 max_exp;119	__be16 freq1;120	__be16 freq2;121	__be16 max_magnitude;122	__be16 rssi;123	__be32 tsf;124	__be32 noise;125 126	u8 data[];127} __packed;128 129#endif /* SPECTRAL_COMMON_H */130