aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Perminov <igor.perminov@inbox.ru>2009-08-08 17:55:55 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:53 -0400
commit1afcfd54fdf913017c07fa1ee497141a7958991d (patch)
tree38e9bfc5af6ad83b014a795f6bf4623cd9083e40
parent17512dc3b7fc9ff1a60d3748ce87c323df507c3d (diff)
rt2x00: FIF_PSPOLL filter flag support
This patch implements FIF_PSPOLL filter flag support in rt2x00 drivers, which has been introduced in mac80211 (see http://marc.info/?l=linux-wireless&m=124897986330807&w=2). Signed-off-by: Igor Perminov <igor.perminov@inbox.ru> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c17
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c8
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c8
5 files changed, 41 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 9efb41710508..2de0389d823d 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -518,7 +518,7 @@ static void rt2800usb_config_filter(struct rt2x00_dev *rt2x00dev,
518 rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_RTS, 518 rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_RTS,
519 !(filter_flags & FIF_CONTROL)); 519 !(filter_flags & FIF_CONTROL));
520 rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_PSPOLL, 520 rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_PSPOLL,
521 !(filter_flags & FIF_CONTROL)); 521 !(filter_flags & FIF_PSPOLL));
522 rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_BA, 1); 522 rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_BA, 1);
523 rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_BAR, 0); 523 rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_BAR, 0);
524 rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_CNTL, 524 rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_CNTL,
@@ -2624,6 +2624,13 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev)
2624 return retval; 2624 return retval;
2625 2625
2626 /* 2626 /*
2627 * This device has multiple filters for control frames
2628 * and has a separate filter for PS Poll frames.
2629 */
2630 __set_bit(DRIVER_SUPPORT_CONTROL_FILTERS, &rt2x00dev->flags);
2631 __set_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags);
2632
2633 /*
2627 * This device requires firmware. 2634 * This device requires firmware.
2628 */ 2635 */
2629 __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags); 2636 __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 7c74c4efcb0f..5bc100db28d4 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -624,6 +624,8 @@ enum rt2x00_flags {
624 */ 624 */
625 CONFIG_SUPPORT_HW_BUTTON, 625 CONFIG_SUPPORT_HW_BUTTON,
626 CONFIG_SUPPORT_HW_CRYPTO, 626 CONFIG_SUPPORT_HW_CRYPTO,
627 DRIVER_SUPPORT_CONTROL_FILTERS,
628 DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL,
627 629
628 /* 630 /*
629 * Driver configuration 631 * Driver configuration
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 74451f9672d9..cb7b6d459331 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -392,6 +392,7 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
392 FIF_FCSFAIL | 392 FIF_FCSFAIL |
393 FIF_PLCPFAIL | 393 FIF_PLCPFAIL |
394 FIF_CONTROL | 394 FIF_CONTROL |
395 FIF_PSPOLL |
395 FIF_OTHER_BSS | 396 FIF_OTHER_BSS |
396 FIF_PROMISC_IN_BSS; 397 FIF_PROMISC_IN_BSS;
397 398
@@ -407,6 +408,22 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
407 *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; 408 *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS;
408 409
409 /* 410 /*
411 * If the device has a single filter for all control frames,
412 * FIF_CONTROL and FIF_PSPOLL flags imply each other.
413 * And if the device has more than one filter for control frames
414 * of different types, but has no a separate filter for PS Poll frames,
415 * FIF_CONTROL flag implies FIF_PSPOLL.
416 */
417 if (!test_bit(DRIVER_SUPPORT_CONTROL_FILTERS, &rt2x00dev->flags)) {
418 if (*total_flags & FIF_CONTROL || *total_flags & FIF_PSPOLL)
419 *total_flags |= FIF_CONTROL | FIF_PSPOLL;
420 }
421 if (!test_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags)) {
422 if (*total_flags & FIF_CONTROL)
423 *total_flags |= FIF_PSPOLL;
424 }
425
426 /*
410 * Check if there is any work left for us. 427 * Check if there is any work left for us.
411 */ 428 */
412 if (rt2x00dev->packet_filter == *total_flags) 429 if (rt2x00dev->packet_filter == *total_flags)
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index e20dd7431f21..3447997fc71a 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -530,7 +530,7 @@ static void rt61pci_config_filter(struct rt2x00_dev *rt2x00dev,
530 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_PHYSICAL, 530 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_PHYSICAL,
531 !(filter_flags & FIF_PLCPFAIL)); 531 !(filter_flags & FIF_PLCPFAIL));
532 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_CONTROL, 532 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_CONTROL,
533 !(filter_flags & FIF_CONTROL)); 533 !(filter_flags & (FIF_CONTROL | FIF_PSPOLL)));
534 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_NOT_TO_ME, 534 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_NOT_TO_ME,
535 !(filter_flags & FIF_PROMISC_IN_BSS)); 535 !(filter_flags & FIF_PROMISC_IN_BSS));
536 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_TO_DS, 536 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_TO_DS,
@@ -2624,6 +2624,12 @@ static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev)
2624 return retval; 2624 return retval;
2625 2625
2626 /* 2626 /*
2627 * This device has multiple filters for control frames,
2628 * but has no a separate filter for PS Poll frames.
2629 */
2630 __set_bit(DRIVER_SUPPORT_CONTROL_FILTERS, &rt2x00dev->flags);
2631
2632 /*
2627 * This device requires firmware and DMA mapped skbs. 2633 * This device requires firmware and DMA mapped skbs.
2628 */ 2634 */
2629 __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags); 2635 __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 4f9b1772e1a1..4b9955b1c70e 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -493,7 +493,7 @@ static void rt73usb_config_filter(struct rt2x00_dev *rt2x00dev,
493 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_PHYSICAL, 493 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_PHYSICAL,
494 !(filter_flags & FIF_PLCPFAIL)); 494 !(filter_flags & FIF_PLCPFAIL));
495 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_CONTROL, 495 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_CONTROL,
496 !(filter_flags & FIF_CONTROL)); 496 !(filter_flags & (FIF_CONTROL | FIF_PSPOLL)));
497 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_NOT_TO_ME, 497 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_NOT_TO_ME,
498 !(filter_flags & FIF_PROMISC_IN_BSS)); 498 !(filter_flags & FIF_PROMISC_IN_BSS));
499 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_TO_DS, 499 rt2x00_set_field32(&reg, TXRX_CSR0_DROP_TO_DS,
@@ -2144,6 +2144,12 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev)
2144 return retval; 2144 return retval;
2145 2145
2146 /* 2146 /*
2147 * This device has multiple filters for control frames,
2148 * but has no a separate filter for PS Poll frames.
2149 */
2150 __set_bit(DRIVER_SUPPORT_CONTROL_FILTERS, &rt2x00dev->flags);
2151
2152 /*
2147 * This device requires firmware. 2153 * This device requires firmware.
2148 */ 2154 */
2149 __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags); 2155 __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);