aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/recv.c
diff options
context:
space:
mode:
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>2013-01-23 11:38:05 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-01-30 15:06:40 -0500
commit9b99e665f6176500e8ee61d149bbe69544354b40 (patch)
treec961474e1f1ed51e7f082133a8fc0971f80f0eb3 /drivers/net/wireless/ath/ath9k/recv.c
parent04ccd4a1a61a2824539e04b5d7f4ee87e8aab0ed (diff)
ath9k: drop spectral packets after processing them
Spectral packets are "bogus" packets and should not be further evaluated by the RX path. Statistics are added to keep track of these packets. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/recv.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index d7c129bb571b..13ee37bcdb7d 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -1023,9 +1023,9 @@ static s8 fix_rssi_inv_only(u8 rssi_val)
1023 return (s8) rssi_val; 1023 return (s8) rssi_val;
1024} 1024}
1025 1025
1026 1026/* returns 1 if this was a spectral frame, even if not handled. */
1027static void ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr, 1027static int ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr,
1028 struct ath_rx_status *rs, u64 tsf) 1028 struct ath_rx_status *rs, u64 tsf)
1029{ 1029{
1030#ifdef CONFIG_ATH_DEBUG 1030#ifdef CONFIG_ATH_DEBUG
1031 struct ath_hw *ah = sc->sc_ah; 1031 struct ath_hw *ah = sc->sc_ah;
@@ -1044,7 +1044,14 @@ static void ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr,
1044 if (rs->rs_phyerr != ATH9K_PHYERR_RADAR && 1044 if (rs->rs_phyerr != ATH9K_PHYERR_RADAR &&
1045 rs->rs_phyerr != ATH9K_PHYERR_FALSE_RADAR_EXT && 1045 rs->rs_phyerr != ATH9K_PHYERR_FALSE_RADAR_EXT &&
1046 rs->rs_phyerr != ATH9K_PHYERR_SPECTRAL) 1046 rs->rs_phyerr != ATH9K_PHYERR_SPECTRAL)
1047 return; 1047 return 0;
1048
1049 /* check if spectral scan bit is set. This does not have to be checked
1050 * if received through a SPECTRAL phy error, but shouldn't hurt.
1051 */
1052 radar_info = ((struct ath_radar_info *)&vdata[len]) - 1;
1053 if (!(radar_info->pulse_bw_info & SPECTRAL_SCAN_BITMASK))
1054 return 0;
1048 1055
1049 /* Variation in the data length is possible and will be fixed later. 1056 /* Variation in the data length is possible and will be fixed later.
1050 * Note that we only support HT20 for now. 1057 * Note that we only support HT20 for now.
@@ -1053,14 +1060,7 @@ static void ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr,
1053 */ 1060 */
1054 if ((len > SPECTRAL_HT20_TOTAL_DATA_LEN + 2) || 1061 if ((len > SPECTRAL_HT20_TOTAL_DATA_LEN + 2) ||
1055 (len < SPECTRAL_HT20_TOTAL_DATA_LEN - 1)) 1062 (len < SPECTRAL_HT20_TOTAL_DATA_LEN - 1))
1056 return; 1063 return 1;
1057
1058 /* check if spectral scan bit is set. This does not have to be checked
1059 * if received through a SPECTRAL phy error, but shouldn't hurt.
1060 */
1061 radar_info = ((struct ath_radar_info *)&vdata[len]) - 1;
1062 if (!(radar_info->pulse_bw_info & SPECTRAL_SCAN_BITMASK))
1063 return;
1064 1064
1065 fft_sample.tlv.type = ATH_FFT_SAMPLE_HT20; 1065 fft_sample.tlv.type = ATH_FFT_SAMPLE_HT20;
1066 fft_sample.tlv.length = sizeof(fft_sample) - sizeof(fft_sample.tlv); 1066 fft_sample.tlv.length = sizeof(fft_sample) - sizeof(fft_sample.tlv);
@@ -1093,7 +1093,7 @@ static void ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr,
1093 memcpy(&bins[32], &vdata[33], SPECTRAL_HT20_NUM_BINS - 32); 1093 memcpy(&bins[32], &vdata[33], SPECTRAL_HT20_NUM_BINS - 32);
1094 break; 1094 break;
1095 default: 1095 default:
1096 return; 1096 return 1;
1097 } 1097 }
1098 1098
1099 /* DC value (value in the middle) is the blind spot of the spectral 1099 /* DC value (value in the middle) is the blind spot of the spectral
@@ -1115,6 +1115,9 @@ static void ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr,
1115 fft_sample.tsf = tsf; 1115 fft_sample.tsf = tsf;
1116 1116
1117 ath_debug_send_fft_sample(sc, &fft_sample.tlv); 1117 ath_debug_send_fft_sample(sc, &fft_sample.tlv);
1118 return 1;
1119#else
1120 return 0;
1118#endif 1121#endif
1119} 1122}
1120 1123
@@ -1202,8 +1205,12 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
1202 unlikely(tsf_lower - rs.rs_tstamp > 0x10000000)) 1205 unlikely(tsf_lower - rs.rs_tstamp > 0x10000000))
1203 rxs->mactime += 0x100000000ULL; 1206 rxs->mactime += 0x100000000ULL;
1204 1207
1205 if ((rs.rs_status & ATH9K_RXERR_PHY)) 1208 if (rs.rs_status & ATH9K_RXERR_PHY) {
1206 ath_process_fft(sc, hdr, &rs, rxs->mactime); 1209 if (ath_process_fft(sc, hdr, &rs, rxs->mactime)) {
1210 RX_STAT_INC(rx_spectral);
1211 goto requeue_drop_frag;
1212 }
1213 }
1207 1214
1208 retval = ath9k_rx_skb_preprocess(common, hw, hdr, &rs, 1215 retval = ath9k_rx_skb_preprocess(common, hw, hdr, &rs,
1209 rxs, &decrypt_error); 1216 rxs, &decrypt_error);