diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-01-06 17:40:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:09:25 -0500 |
commit | 3c4f2085e5d82639004406795653e1e4dd6720e0 (patch) | |
tree | 439cde40c92b581cf56c81ce8806126a4eee4867 | |
parent | e37ea2135be080dd25f1a2644c9132c109fa77d1 (diff) |
rt2x00: Move packet filter flags
The packet filter flags don't belong in the interface structure
because they are device based instead of interface based.
So move the filter fields out of struct interface and into rt2x00_dev.
Additionally we shouldn't change the filter based on the working
mode, if such a thing is needed than mac80211 should have done that.
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/rt2400pci.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 8 |
7 files changed, 19 insertions, 37 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 9eed9e90fc0c..b042eb551cde 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1422,7 +1422,6 @@ static void rt2400pci_configure_filter(struct ieee80211_hw *hw, | |||
1422 | struct dev_addr_list *mc_list) | 1422 | struct dev_addr_list *mc_list) |
1423 | { | 1423 | { |
1424 | struct rt2x00_dev *rt2x00dev = hw->priv; | 1424 | struct rt2x00_dev *rt2x00dev = hw->priv; |
1425 | struct interface *intf = &rt2x00dev->interface; | ||
1426 | u32 reg; | 1425 | u32 reg; |
1427 | 1426 | ||
1428 | /* | 1427 | /* |
@@ -1441,21 +1440,18 @@ static void rt2400pci_configure_filter(struct ieee80211_hw *hw, | |||
1441 | * Apply some rules to the filters: | 1440 | * Apply some rules to the filters: |
1442 | * - Some filters imply different filters to be set. | 1441 | * - Some filters imply different filters to be set. |
1443 | * - Some things we can't filter out at all. | 1442 | * - Some things we can't filter out at all. |
1444 | * - Some filters are set based on interface type. | ||
1445 | */ | 1443 | */ |
1446 | *total_flags |= FIF_ALLMULTI; | 1444 | *total_flags |= FIF_ALLMULTI; |
1447 | if (*total_flags & FIF_OTHER_BSS || | 1445 | if (*total_flags & FIF_OTHER_BSS || |
1448 | *total_flags & FIF_PROMISC_IN_BSS) | 1446 | *total_flags & FIF_PROMISC_IN_BSS) |
1449 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; | 1447 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; |
1450 | if (is_interface_type(intf, IEEE80211_IF_TYPE_AP)) | ||
1451 | *total_flags |= FIF_PROMISC_IN_BSS; | ||
1452 | 1448 | ||
1453 | /* | 1449 | /* |
1454 | * Check if there is any work left for us. | 1450 | * Check if there is any work left for us. |
1455 | */ | 1451 | */ |
1456 | if (intf->filter == *total_flags) | 1452 | if (rt2x00dev->packet_filter == *total_flags) |
1457 | return; | 1453 | return; |
1458 | intf->filter = *total_flags; | 1454 | rt2x00dev->packet_filter = *total_flags; |
1459 | 1455 | ||
1460 | /* | 1456 | /* |
1461 | * Start configuration steps. | 1457 | * Start configuration steps. |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 8b2f54b2e631..c92163d2d9ab 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -1751,7 +1751,6 @@ static void rt2500pci_configure_filter(struct ieee80211_hw *hw, | |||
1751 | struct dev_addr_list *mc_list) | 1751 | struct dev_addr_list *mc_list) |
1752 | { | 1752 | { |
1753 | struct rt2x00_dev *rt2x00dev = hw->priv; | 1753 | struct rt2x00_dev *rt2x00dev = hw->priv; |
1754 | struct interface *intf = &rt2x00dev->interface; | ||
1755 | u32 reg; | 1754 | u32 reg; |
1756 | 1755 | ||
1757 | /* | 1756 | /* |
@@ -1770,22 +1769,19 @@ static void rt2500pci_configure_filter(struct ieee80211_hw *hw, | |||
1770 | * Apply some rules to the filters: | 1769 | * Apply some rules to the filters: |
1771 | * - Some filters imply different filters to be set. | 1770 | * - Some filters imply different filters to be set. |
1772 | * - Some things we can't filter out at all. | 1771 | * - Some things we can't filter out at all. |
1773 | * - Some filters are set based on interface type. | ||
1774 | */ | 1772 | */ |
1775 | if (mc_count) | 1773 | if (mc_count) |
1776 | *total_flags |= FIF_ALLMULTI; | 1774 | *total_flags |= FIF_ALLMULTI; |
1777 | if (*total_flags & FIF_OTHER_BSS || | 1775 | if (*total_flags & FIF_OTHER_BSS || |
1778 | *total_flags & FIF_PROMISC_IN_BSS) | 1776 | *total_flags & FIF_PROMISC_IN_BSS) |
1779 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; | 1777 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; |
1780 | if (is_interface_type(intf, IEEE80211_IF_TYPE_AP)) | ||
1781 | *total_flags |= FIF_PROMISC_IN_BSS; | ||
1782 | 1778 | ||
1783 | /* | 1779 | /* |
1784 | * Check if there is any work left for us. | 1780 | * Check if there is any work left for us. |
1785 | */ | 1781 | */ |
1786 | if (intf->filter == *total_flags) | 1782 | if (rt2x00dev->packet_filter == *total_flags) |
1787 | return; | 1783 | return; |
1788 | intf->filter = *total_flags; | 1784 | rt2x00dev->packet_filter = *total_flags; |
1789 | 1785 | ||
1790 | /* | 1786 | /* |
1791 | * Start configuration steps. | 1787 | * Start configuration steps. |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 531d6a02755a..3dca09d6e319 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1611,7 +1611,6 @@ static void rt2500usb_configure_filter(struct ieee80211_hw *hw, | |||
1611 | struct dev_addr_list *mc_list) | 1611 | struct dev_addr_list *mc_list) |
1612 | { | 1612 | { |
1613 | struct rt2x00_dev *rt2x00dev = hw->priv; | 1613 | struct rt2x00_dev *rt2x00dev = hw->priv; |
1614 | struct interface *intf = &rt2x00dev->interface; | ||
1615 | u16 reg; | 1614 | u16 reg; |
1616 | 1615 | ||
1617 | /* | 1616 | /* |
@@ -1630,22 +1629,19 @@ static void rt2500usb_configure_filter(struct ieee80211_hw *hw, | |||
1630 | * Apply some rules to the filters: | 1629 | * Apply some rules to the filters: |
1631 | * - Some filters imply different filters to be set. | 1630 | * - Some filters imply different filters to be set. |
1632 | * - Some things we can't filter out at all. | 1631 | * - Some things we can't filter out at all. |
1633 | * - Some filters are set based on interface type. | ||
1634 | */ | 1632 | */ |
1635 | if (mc_count) | 1633 | if (mc_count) |
1636 | *total_flags |= FIF_ALLMULTI; | 1634 | *total_flags |= FIF_ALLMULTI; |
1637 | if (*total_flags & FIF_OTHER_BSS || | 1635 | if (*total_flags & FIF_OTHER_BSS || |
1638 | *total_flags & FIF_PROMISC_IN_BSS) | 1636 | *total_flags & FIF_PROMISC_IN_BSS) |
1639 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; | 1637 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; |
1640 | if (is_interface_type(intf, IEEE80211_IF_TYPE_AP)) | ||
1641 | *total_flags |= FIF_PROMISC_IN_BSS; | ||
1642 | 1638 | ||
1643 | /* | 1639 | /* |
1644 | * Check if there is any work left for us. | 1640 | * Check if there is any work left for us. |
1645 | */ | 1641 | */ |
1646 | if (intf->filter == *total_flags) | 1642 | if (rt2x00dev->packet_filter == *total_flags) |
1647 | return; | 1643 | return; |
1648 | intf->filter = *total_flags; | 1644 | rt2x00dev->packet_filter = *total_flags; |
1649 | 1645 | ||
1650 | /* | 1646 | /* |
1651 | * When in atomic context, reschedule and let rt2x00lib | 1647 | * When in atomic context, reschedule and let rt2x00lib |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 5e4cb3ee2eae..be1fc0aebadc 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -388,11 +388,6 @@ struct interface { | |||
388 | * BBSID of the AP to associate with. | 388 | * BBSID of the AP to associate with. |
389 | */ | 389 | */ |
390 | u8 bssid[ETH_ALEN]; | 390 | u8 bssid[ETH_ALEN]; |
391 | |||
392 | /* | ||
393 | * Store the packet filter mode for the current interface. | ||
394 | */ | ||
395 | unsigned int filter; | ||
396 | }; | 391 | }; |
397 | 392 | ||
398 | static inline int is_interface_present(struct interface *intf) | 393 | static inline int is_interface_present(struct interface *intf) |
@@ -676,6 +671,13 @@ struct rt2x00_dev { | |||
676 | struct mutex usb_cache_mutex; | 671 | struct mutex usb_cache_mutex; |
677 | 672 | ||
678 | /* | 673 | /* |
674 | * Current packet filter configuration for the device. | ||
675 | * This contains all currently active FIF_* flags send | ||
676 | * to us by mac80211 during configure_filter(). | ||
677 | */ | ||
678 | unsigned int packet_filter; | ||
679 | |||
680 | /* | ||
679 | * Interface configuration. | 681 | * Interface configuration. |
680 | */ | 682 | */ |
681 | struct interface interface; | 683 | struct interface interface; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index cea2bd91ff5f..911060df8037 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -417,7 +417,7 @@ static void rt2x00lib_packetfilter_scheduled(struct work_struct *work) | |||
417 | { | 417 | { |
418 | struct rt2x00_dev *rt2x00dev = | 418 | struct rt2x00_dev *rt2x00dev = |
419 | container_of(work, struct rt2x00_dev, filter_work); | 419 | container_of(work, struct rt2x00_dev, filter_work); |
420 | unsigned int filter = rt2x00dev->interface.filter; | 420 | unsigned int filter = rt2x00dev->packet_filter; |
421 | 421 | ||
422 | /* | 422 | /* |
423 | * Since we had stored the filter inside interface.filter, | 423 | * Since we had stored the filter inside interface.filter, |
@@ -425,7 +425,7 @@ static void rt2x00lib_packetfilter_scheduled(struct work_struct *work) | |||
425 | * assume nothing has changed (*total_flags will be compared | 425 | * assume nothing has changed (*total_flags will be compared |
426 | * to interface.filter to determine if any action is required). | 426 | * to interface.filter to determine if any action is required). |
427 | */ | 427 | */ |
428 | rt2x00dev->interface.filter = 0; | 428 | rt2x00dev->packet_filter = 0; |
429 | 429 | ||
430 | rt2x00dev->ops->hw->configure_filter(rt2x00dev->hw, | 430 | rt2x00dev->ops->hw->configure_filter(rt2x00dev->hw, |
431 | filter, &filter, 0, NULL); | 431 | filter, &filter, 0, NULL); |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index fc36320a5f13..5c78c4cf80ae 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2310,7 +2310,6 @@ static void rt61pci_configure_filter(struct ieee80211_hw *hw, | |||
2310 | struct dev_addr_list *mc_list) | 2310 | struct dev_addr_list *mc_list) |
2311 | { | 2311 | { |
2312 | struct rt2x00_dev *rt2x00dev = hw->priv; | 2312 | struct rt2x00_dev *rt2x00dev = hw->priv; |
2313 | struct interface *intf = &rt2x00dev->interface; | ||
2314 | u32 reg; | 2313 | u32 reg; |
2315 | 2314 | ||
2316 | /* | 2315 | /* |
@@ -2329,22 +2328,19 @@ static void rt61pci_configure_filter(struct ieee80211_hw *hw, | |||
2329 | * Apply some rules to the filters: | 2328 | * Apply some rules to the filters: |
2330 | * - Some filters imply different filters to be set. | 2329 | * - Some filters imply different filters to be set. |
2331 | * - Some things we can't filter out at all. | 2330 | * - Some things we can't filter out at all. |
2332 | * - Some filters are set based on interface type. | ||
2333 | */ | 2331 | */ |
2334 | if (mc_count) | 2332 | if (mc_count) |
2335 | *total_flags |= FIF_ALLMULTI; | 2333 | *total_flags |= FIF_ALLMULTI; |
2336 | if (*total_flags & FIF_OTHER_BSS || | 2334 | if (*total_flags & FIF_OTHER_BSS || |
2337 | *total_flags & FIF_PROMISC_IN_BSS) | 2335 | *total_flags & FIF_PROMISC_IN_BSS) |
2338 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; | 2336 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; |
2339 | if (is_interface_type(intf, IEEE80211_IF_TYPE_AP)) | ||
2340 | *total_flags |= FIF_PROMISC_IN_BSS; | ||
2341 | 2337 | ||
2342 | /* | 2338 | /* |
2343 | * Check if there is any work left for us. | 2339 | * Check if there is any work left for us. |
2344 | */ | 2340 | */ |
2345 | if (intf->filter == *total_flags) | 2341 | if (rt2x00dev->packet_filter == *total_flags) |
2346 | return; | 2342 | return; |
2347 | intf->filter = *total_flags; | 2343 | rt2x00dev->packet_filter = *total_flags; |
2348 | 2344 | ||
2349 | /* | 2345 | /* |
2350 | * Start configuration steps. | 2346 | * Start configuration steps. |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 939341582e72..f2d1810fb3fe 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1846,7 +1846,6 @@ static void rt73usb_configure_filter(struct ieee80211_hw *hw, | |||
1846 | struct dev_addr_list *mc_list) | 1846 | struct dev_addr_list *mc_list) |
1847 | { | 1847 | { |
1848 | struct rt2x00_dev *rt2x00dev = hw->priv; | 1848 | struct rt2x00_dev *rt2x00dev = hw->priv; |
1849 | struct interface *intf = &rt2x00dev->interface; | ||
1850 | u32 reg; | 1849 | u32 reg; |
1851 | 1850 | ||
1852 | /* | 1851 | /* |
@@ -1865,22 +1864,19 @@ static void rt73usb_configure_filter(struct ieee80211_hw *hw, | |||
1865 | * Apply some rules to the filters: | 1864 | * Apply some rules to the filters: |
1866 | * - Some filters imply different filters to be set. | 1865 | * - Some filters imply different filters to be set. |
1867 | * - Some things we can't filter out at all. | 1866 | * - Some things we can't filter out at all. |
1868 | * - Some filters are set based on interface type. | ||
1869 | */ | 1867 | */ |
1870 | if (mc_count) | 1868 | if (mc_count) |
1871 | *total_flags |= FIF_ALLMULTI; | 1869 | *total_flags |= FIF_ALLMULTI; |
1872 | if (*total_flags & FIF_OTHER_BSS || | 1870 | if (*total_flags & FIF_OTHER_BSS || |
1873 | *total_flags & FIF_PROMISC_IN_BSS) | 1871 | *total_flags & FIF_PROMISC_IN_BSS) |
1874 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; | 1872 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; |
1875 | if (is_interface_type(intf, IEEE80211_IF_TYPE_AP)) | ||
1876 | *total_flags |= FIF_PROMISC_IN_BSS; | ||
1877 | 1873 | ||
1878 | /* | 1874 | /* |
1879 | * Check if there is any work left for us. | 1875 | * Check if there is any work left for us. |
1880 | */ | 1876 | */ |
1881 | if (intf->filter == *total_flags) | 1877 | if (rt2x00dev->packet_filter == *total_flags) |
1882 | return; | 1878 | return; |
1883 | intf->filter = *total_flags; | 1879 | rt2x00dev->packet_filter = *total_flags; |
1884 | 1880 | ||
1885 | /* | 1881 | /* |
1886 | * When in atomic context, reschedule and let rt2x00lib | 1882 | * When in atomic context, reschedule and let rt2x00lib |