diff options
author | Mathy Vanhoef <vanhoefm@gmail.com> | 2014-06-13 17:40:22 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-07-01 14:26:25 -0400 |
commit | 41881354f93a5e82f16c811f95e0700bf99283ec (patch) | |
tree | 95b29e51deb99142cfac4a1c0ddc40485c2e4746 /drivers/net/wireless/ath | |
parent | c64800e772a03a8162e107c2d03d06175fff443d (diff) |
ath5k: support for FIF_FCSFAIL filter
When the FIF_FCSFAIL filter flag is set, pass frames with CRC errors.
Signed-off-by: Mathy Vanhoef <vanhoefm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ath5k.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/mac80211-ops.c | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h index 74bd54d6aceb..85316bb3f8c6 100644 --- a/drivers/net/wireless/ath/ath5k/ath5k.h +++ b/drivers/net/wireless/ath/ath5k/ath5k.h | |||
@@ -1285,6 +1285,7 @@ struct ath5k_hw { | |||
1285 | #define ATH_STAT_STARTED 3 /* opened & irqs enabled */ | 1285 | #define ATH_STAT_STARTED 3 /* opened & irqs enabled */ |
1286 | 1286 | ||
1287 | unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ | 1287 | unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ |
1288 | unsigned int fif_filter_flags; /* Current FIF_* filter flags */ | ||
1288 | struct ieee80211_channel *curchan; /* current h/w channel */ | 1289 | struct ieee80211_channel *curchan; /* current h/w channel */ |
1289 | 1290 | ||
1290 | u16 nvifs; | 1291 | u16 nvifs; |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 4b18434ba697..5839a3434119 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -1382,6 +1382,9 @@ ath5k_receive_frame(struct ath5k_hw *ah, struct sk_buff *skb, | |||
1382 | rxs->flag = 0; | 1382 | rxs->flag = 0; |
1383 | if (unlikely(rs->rs_status & AR5K_RXERR_MIC)) | 1383 | if (unlikely(rs->rs_status & AR5K_RXERR_MIC)) |
1384 | rxs->flag |= RX_FLAG_MMIC_ERROR; | 1384 | rxs->flag |= RX_FLAG_MMIC_ERROR; |
1385 | if (unlikely(rs->rs_status & AR5K_RXERR_CRC)) | ||
1386 | rxs->flag |= RX_FLAG_FAILED_FCS_CRC; | ||
1387 | |||
1385 | 1388 | ||
1386 | /* | 1389 | /* |
1387 | * always extend the mac timestamp, since this information is | 1390 | * always extend the mac timestamp, since this information is |
@@ -1449,6 +1452,8 @@ ath5k_receive_frame_ok(struct ath5k_hw *ah, struct ath5k_rx_status *rs) | |||
1449 | ah->stats.rx_bytes_count += rs->rs_datalen; | 1452 | ah->stats.rx_bytes_count += rs->rs_datalen; |
1450 | 1453 | ||
1451 | if (unlikely(rs->rs_status)) { | 1454 | if (unlikely(rs->rs_status)) { |
1455 | unsigned int filters; | ||
1456 | |||
1452 | if (rs->rs_status & AR5K_RXERR_CRC) | 1457 | if (rs->rs_status & AR5K_RXERR_CRC) |
1453 | ah->stats.rxerr_crc++; | 1458 | ah->stats.rxerr_crc++; |
1454 | if (rs->rs_status & AR5K_RXERR_FIFO) | 1459 | if (rs->rs_status & AR5K_RXERR_FIFO) |
@@ -1480,8 +1485,15 @@ ath5k_receive_frame_ok(struct ath5k_hw *ah, struct ath5k_rx_status *rs) | |||
1480 | return true; | 1485 | return true; |
1481 | } | 1486 | } |
1482 | 1487 | ||
1483 | /* reject any frames with non-crypto errors */ | 1488 | /* |
1484 | if (rs->rs_status & ~(AR5K_RXERR_DECRYPT)) | 1489 | * Reject any frames with non-crypto errors, and take into account the |
1490 | * current FIF_* filters. | ||
1491 | */ | ||
1492 | filters = AR5K_RXERR_DECRYPT; | ||
1493 | if (ah->fif_filter_flags & FIF_FCSFAIL) | ||
1494 | filters |= AR5K_RXERR_CRC; | ||
1495 | |||
1496 | if (rs->rs_status & ~filters) | ||
1485 | return false; | 1497 | return false; |
1486 | } | 1498 | } |
1487 | 1499 | ||
diff --git a/drivers/net/wireless/ath/ath5k/mac80211-ops.c b/drivers/net/wireless/ath/ath5k/mac80211-ops.c index afb23b3cc7be..b65c38fdaa4b 100644 --- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c +++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c | |||
@@ -473,6 +473,8 @@ ath5k_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, | |||
473 | /* Set the cached hw filter flags, this will later actually | 473 | /* Set the cached hw filter flags, this will later actually |
474 | * be set in HW */ | 474 | * be set in HW */ |
475 | ah->filter_flags = rfilt; | 475 | ah->filter_flags = rfilt; |
476 | /* Store current FIF filter flags */ | ||
477 | ah->fif_filter_flags = *new_flags; | ||
476 | 478 | ||
477 | mutex_unlock(&ah->lock); | 479 | mutex_unlock(&ah->lock); |
478 | } | 480 | } |