On Thu, Sep 26, 2013 at 04:37:38PM +0200, Lorenzo Bianconi wrote: > Add spectral scan feature on HT40 channels for ath9k. This patch extends > previous capability added by Simon Wunderlich > > Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@xxxxxxxxx> > --- > drivers/net/wireless/ath/ath9k/ath9k.h | 47 +++++++---- > drivers/net/wireless/ath/ath9k/calib.c | 10 +-- > drivers/net/wireless/ath/ath9k/calib.h | 3 +- > drivers/net/wireless/ath/ath9k/hw.c | 2 +- > drivers/net/wireless/ath/ath9k/link.c | 3 +- > drivers/net/wireless/ath/ath9k/recv.c | 142 ++++++++++++++++++++++----------- > 6 files changed, 139 insertions(+), 68 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h > index 2ee35f6..b44955e 100644 > --- a/drivers/net/wireless/ath/ath9k/ath9k.h > +++ b/drivers/net/wireless/ath/ath9k/ath9k.h > @@ -875,32 +875,49 @@ static inline u8 spectral_bitmap_weight(u8 *bins) > * TODO: this might need rework when switching to nl80211-based > * interface. > */ > -enum ath_fft_sample_type { > - ATH_FFT_SAMPLE_HT20 = 1, > +enum fft_sample_type { > + FFT_SAMPLE_HT20 = 1, > + FFT_SAMPLE_HT20_40, > }; > > struct fft_sample_tlv { > - u8 type; /* see ath_fft_sample */ > + enum fft_sample_type type; > __be16 length; > /* type dependent data follows */ > } __packed; > > -struct fft_sample_ht20 { > +struct fft_sample { > struct fft_sample_tlv tlv; > - > - u8 max_exp; > - > __be16 freq; > - s8 rssi; > - s8 noise; > - > - __be16 max_magnitude; > - u8 max_index; > - u8 bitmap_weight; > - > __be64 tsf; > > - u8 data[SPECTRAL_HT20_NUM_BINS]; > + union { > + struct { > + s8 rssi; > + s8 nf; > + > + u8 data[SPECTRAL_HT20_NUM_BINS]; > + __be16 max_mag; > + u8 max_idx; > + u8 bitmap_w; > + u8 max_exp; > + } ht20; > + struct { > + s8 lower_rssi; > + s8 upper_rssi; > + s8 lower_nf; > + s8 upper_nf; > + > + u8 data[SPECTRAL_HT20_40_NUM_BINS]; > + __be16 lower_max_mag; > + __be16 upper_max_mag; > + u8 lower_max_idx; > + u8 upper_max_idx; > + u8 lower_bitmap_w; > + u8 upper_bitmap_w; > + u8 max_exp; > + } ht20_40; > + }; > } __packed; One more thing: please don't change the format for HT20 - there are already userspace programs which rely on the order of the parameters as they are now. This is why we have added the TLVs in the first place - you can just add a new type for HT40 (as you did), but keep the format of other formats (HT20). Thanks, Simon
Attachment:
signature.asc
Description: Digital signature