Commit 12824374 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by John W. Linville

ath9k: Fix sparse __CHECK_ENDIAN__ for spectral code

Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 00b54182
...@@ -871,7 +871,7 @@ enum ath_fft_sample_type { ...@@ -871,7 +871,7 @@ enum ath_fft_sample_type {
struct fft_sample_tlv { struct fft_sample_tlv {
u8 type; /* see ath_fft_sample */ u8 type; /* see ath_fft_sample */
u16 length; __be16 length;
/* type dependent data follows */ /* type dependent data follows */
} __packed; } __packed;
...@@ -880,15 +880,15 @@ struct fft_sample_ht20 { ...@@ -880,15 +880,15 @@ struct fft_sample_ht20 {
u8 max_exp; u8 max_exp;
u16 freq; __be16 freq;
s8 rssi; s8 rssi;
s8 noise; s8 noise;
u16 max_magnitude; __be16 max_magnitude;
u8 max_index; u8 max_index;
u8 bitmap_weight; u8 bitmap_weight;
u64 tsf; __be64 tsf;
u8 data[SPECTRAL_HT20_NUM_BINS]; u8 data[SPECTRAL_HT20_NUM_BINS];
} __packed; } __packed;
......
...@@ -1038,6 +1038,7 @@ static int ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr, ...@@ -1038,6 +1038,7 @@ static int ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr,
struct ath_ht20_mag_info *mag_info; struct ath_ht20_mag_info *mag_info;
int len = rs->rs_datalen; int len = rs->rs_datalen;
int dc_pos; int dc_pos;
u16 length, max_magnitude;
/* AR9280 and before report via ATH9K_PHYERR_RADAR, AR93xx and newer /* AR9280 and before report via ATH9K_PHYERR_RADAR, AR93xx and newer
* via ATH9K_PHYERR_SPECTRAL. Haven't seen ATH9K_PHYERR_FALSE_RADAR_EXT * via ATH9K_PHYERR_SPECTRAL. Haven't seen ATH9K_PHYERR_FALSE_RADAR_EXT
...@@ -1065,8 +1066,8 @@ static int ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr, ...@@ -1065,8 +1066,8 @@ static int ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr,
return 1; return 1;
fft_sample.tlv.type = ATH_FFT_SAMPLE_HT20; fft_sample.tlv.type = ATH_FFT_SAMPLE_HT20;
fft_sample.tlv.length = sizeof(fft_sample) - sizeof(fft_sample.tlv); length = sizeof(fft_sample) - sizeof(fft_sample.tlv);
fft_sample.tlv.length = __cpu_to_be16(fft_sample.tlv.length); fft_sample.tlv.length = __cpu_to_be16(length);
fft_sample.freq = __cpu_to_be16(ah->curchan->chan->center_freq); fft_sample.freq = __cpu_to_be16(ah->curchan->chan->center_freq);
fft_sample.rssi = fix_rssi_inv_only(rs->rs_rssi_ctl0); fft_sample.rssi = fix_rssi_inv_only(rs->rs_rssi_ctl0);
...@@ -1112,8 +1113,8 @@ static int ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr, ...@@ -1112,8 +1113,8 @@ static int ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr,
memcpy(fft_sample.data, bins, SPECTRAL_HT20_NUM_BINS); memcpy(fft_sample.data, bins, SPECTRAL_HT20_NUM_BINS);
fft_sample.max_exp = mag_info->max_exp & 0xf; fft_sample.max_exp = mag_info->max_exp & 0xf;
fft_sample.max_magnitude = spectral_max_magnitude(mag_info->all_bins); max_magnitude = spectral_max_magnitude(mag_info->all_bins);
fft_sample.max_magnitude = __cpu_to_be16(fft_sample.max_magnitude); fft_sample.max_magnitude = __cpu_to_be16(max_magnitude);
fft_sample.max_index = spectral_max_index(mag_info->all_bins); fft_sample.max_index = spectral_max_index(mag_info->all_bins);
fft_sample.bitmap_weight = spectral_bitmap_weight(mag_info->all_bins); fft_sample.bitmap_weight = spectral_bitmap_weight(mag_info->all_bins);
fft_sample.tsf = __cpu_to_be64(tsf); fft_sample.tsf = __cpu_to_be64(tsf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment