diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 101 |
1 files changed, 33 insertions, 68 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 9468dde3c95e..1bdb873b65f2 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -270,6 +270,35 @@ static void rt2500pci_led_brightness(struct led_classdev *led_cdev, | |||
270 | /* | 270 | /* |
271 | * Configuration handlers. | 271 | * Configuration handlers. |
272 | */ | 272 | */ |
273 | static void rt2500pci_config_filter(struct rt2x00_dev *rt2x00dev, | ||
274 | const unsigned int filter_flags) | ||
275 | { | ||
276 | u32 reg; | ||
277 | |||
278 | /* | ||
279 | * Start configuration steps. | ||
280 | * Note that the version error will always be dropped | ||
281 | * and broadcast frames will always be accepted since | ||
282 | * there is no filter for it at this time. | ||
283 | */ | ||
284 | rt2x00pci_register_read(rt2x00dev, RXCSR0, ®); | ||
285 | rt2x00_set_field32(®, RXCSR0_DROP_CRC, | ||
286 | !(filter_flags & FIF_FCSFAIL)); | ||
287 | rt2x00_set_field32(®, RXCSR0_DROP_PHYSICAL, | ||
288 | !(filter_flags & FIF_PLCPFAIL)); | ||
289 | rt2x00_set_field32(®, RXCSR0_DROP_CONTROL, | ||
290 | !(filter_flags & FIF_CONTROL)); | ||
291 | rt2x00_set_field32(®, RXCSR0_DROP_NOT_TO_ME, | ||
292 | !(filter_flags & FIF_PROMISC_IN_BSS)); | ||
293 | rt2x00_set_field32(®, RXCSR0_DROP_TODS, | ||
294 | !(filter_flags & FIF_PROMISC_IN_BSS)); | ||
295 | rt2x00_set_field32(®, RXCSR0_DROP_VERSION_ERROR, 1); | ||
296 | rt2x00_set_field32(®, RXCSR0_DROP_MCAST, | ||
297 | !(filter_flags & FIF_ALLMULTI)); | ||
298 | rt2x00_set_field32(®, RXCSR0_DROP_BCAST, 0); | ||
299 | rt2x00pci_register_write(rt2x00dev, RXCSR0, reg); | ||
300 | } | ||
301 | |||
273 | static void rt2500pci_config_intf(struct rt2x00_dev *rt2x00dev, | 302 | static void rt2500pci_config_intf(struct rt2x00_dev *rt2x00dev, |
274 | struct rt2x00_intf *intf, | 303 | struct rt2x00_intf *intf, |
275 | struct rt2x00intf_conf *conf, | 304 | struct rt2x00intf_conf *conf, |
@@ -309,8 +338,8 @@ static void rt2500pci_config_intf(struct rt2x00_dev *rt2x00dev, | |||
309 | conf->bssid, sizeof(conf->bssid)); | 338 | conf->bssid, sizeof(conf->bssid)); |
310 | } | 339 | } |
311 | 340 | ||
312 | static int rt2500pci_config_erp(struct rt2x00_dev *rt2x00dev, | 341 | static void rt2500pci_config_erp(struct rt2x00_dev *rt2x00dev, |
313 | struct rt2x00lib_erp *erp) | 342 | struct rt2x00lib_erp *erp) |
314 | { | 343 | { |
315 | int preamble_mask; | 344 | int preamble_mask; |
316 | u32 reg; | 345 | u32 reg; |
@@ -350,8 +379,6 @@ static int rt2500pci_config_erp(struct rt2x00_dev *rt2x00dev, | |||
350 | rt2x00_set_field32(®, ARCSR5_SERVICE, 0x84); | 379 | rt2x00_set_field32(®, ARCSR5_SERVICE, 0x84); |
351 | rt2x00_set_field32(®, ARCSR2_LENGTH, get_duration(ACK_SIZE, 110)); | 380 | rt2x00_set_field32(®, ARCSR2_LENGTH, get_duration(ACK_SIZE, 110)); |
352 | rt2x00pci_register_write(rt2x00dev, ARCSR5, reg); | 381 | rt2x00pci_register_write(rt2x00dev, ARCSR5, reg); |
353 | |||
354 | return 0; | ||
355 | } | 382 | } |
356 | 383 | ||
357 | static void rt2500pci_config_phymode(struct rt2x00_dev *rt2x00dev, | 384 | static void rt2500pci_config_phymode(struct rt2x00_dev *rt2x00dev, |
@@ -1731,69 +1758,6 @@ static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1731 | /* | 1758 | /* |
1732 | * IEEE80211 stack callback functions. | 1759 | * IEEE80211 stack callback functions. |
1733 | */ | 1760 | */ |
1734 | static void rt2500pci_configure_filter(struct ieee80211_hw *hw, | ||
1735 | unsigned int changed_flags, | ||
1736 | unsigned int *total_flags, | ||
1737 | int mc_count, | ||
1738 | struct dev_addr_list *mc_list) | ||
1739 | { | ||
1740 | struct rt2x00_dev *rt2x00dev = hw->priv; | ||
1741 | u32 reg; | ||
1742 | |||
1743 | /* | ||
1744 | * Mask off any flags we are going to ignore from | ||
1745 | * the total_flags field. | ||
1746 | */ | ||
1747 | *total_flags &= | ||
1748 | FIF_ALLMULTI | | ||
1749 | FIF_FCSFAIL | | ||
1750 | FIF_PLCPFAIL | | ||
1751 | FIF_CONTROL | | ||
1752 | FIF_OTHER_BSS | | ||
1753 | FIF_PROMISC_IN_BSS; | ||
1754 | |||
1755 | /* | ||
1756 | * Apply some rules to the filters: | ||
1757 | * - Some filters imply different filters to be set. | ||
1758 | * - Some things we can't filter out at all. | ||
1759 | */ | ||
1760 | if (mc_count) | ||
1761 | *total_flags |= FIF_ALLMULTI; | ||
1762 | if (*total_flags & FIF_OTHER_BSS || | ||
1763 | *total_flags & FIF_PROMISC_IN_BSS) | ||
1764 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; | ||
1765 | |||
1766 | /* | ||
1767 | * Check if there is any work left for us. | ||
1768 | */ | ||
1769 | if (rt2x00dev->packet_filter == *total_flags) | ||
1770 | return; | ||
1771 | rt2x00dev->packet_filter = *total_flags; | ||
1772 | |||
1773 | /* | ||
1774 | * Start configuration steps. | ||
1775 | * Note that the version error will always be dropped | ||
1776 | * and broadcast frames will always be accepted since | ||
1777 | * there is no filter for it at this time. | ||
1778 | */ | ||
1779 | rt2x00pci_register_read(rt2x00dev, RXCSR0, ®); | ||
1780 | rt2x00_set_field32(®, RXCSR0_DROP_CRC, | ||
1781 | !(*total_flags & FIF_FCSFAIL)); | ||
1782 | rt2x00_set_field32(®, RXCSR0_DROP_PHYSICAL, | ||
1783 | !(*total_flags & FIF_PLCPFAIL)); | ||
1784 | rt2x00_set_field32(®, RXCSR0_DROP_CONTROL, | ||
1785 | !(*total_flags & FIF_CONTROL)); | ||
1786 | rt2x00_set_field32(®, RXCSR0_DROP_NOT_TO_ME, | ||
1787 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
1788 | rt2x00_set_field32(®, RXCSR0_DROP_TODS, | ||
1789 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
1790 | rt2x00_set_field32(®, RXCSR0_DROP_VERSION_ERROR, 1); | ||
1791 | rt2x00_set_field32(®, RXCSR0_DROP_MCAST, | ||
1792 | !(*total_flags & FIF_ALLMULTI)); | ||
1793 | rt2x00_set_field32(®, RXCSR0_DROP_BCAST, 0); | ||
1794 | rt2x00pci_register_write(rt2x00dev, RXCSR0, reg); | ||
1795 | } | ||
1796 | |||
1797 | static int rt2500pci_set_retry_limit(struct ieee80211_hw *hw, | 1761 | static int rt2500pci_set_retry_limit(struct ieee80211_hw *hw, |
1798 | u32 short_retry, u32 long_retry) | 1762 | u32 short_retry, u32 long_retry) |
1799 | { | 1763 | { |
@@ -1894,7 +1858,7 @@ static const struct ieee80211_ops rt2500pci_mac80211_ops = { | |||
1894 | .remove_interface = rt2x00mac_remove_interface, | 1858 | .remove_interface = rt2x00mac_remove_interface, |
1895 | .config = rt2x00mac_config, | 1859 | .config = rt2x00mac_config, |
1896 | .config_interface = rt2x00mac_config_interface, | 1860 | .config_interface = rt2x00mac_config_interface, |
1897 | .configure_filter = rt2500pci_configure_filter, | 1861 | .configure_filter = rt2x00mac_configure_filter, |
1898 | .get_stats = rt2x00mac_get_stats, | 1862 | .get_stats = rt2x00mac_get_stats, |
1899 | .set_retry_limit = rt2500pci_set_retry_limit, | 1863 | .set_retry_limit = rt2500pci_set_retry_limit, |
1900 | .bss_info_changed = rt2x00mac_bss_info_changed, | 1864 | .bss_info_changed = rt2x00mac_bss_info_changed, |
@@ -1922,6 +1886,7 @@ static const struct rt2x00lib_ops rt2500pci_rt2x00_ops = { | |||
1922 | .write_tx_data = rt2x00pci_write_tx_data, | 1886 | .write_tx_data = rt2x00pci_write_tx_data, |
1923 | .kick_tx_queue = rt2500pci_kick_tx_queue, | 1887 | .kick_tx_queue = rt2500pci_kick_tx_queue, |
1924 | .fill_rxdone = rt2500pci_fill_rxdone, | 1888 | .fill_rxdone = rt2500pci_fill_rxdone, |
1889 | .config_filter = rt2500pci_config_filter, | ||
1925 | .config_intf = rt2500pci_config_intf, | 1890 | .config_intf = rt2500pci_config_intf, |
1926 | .config_erp = rt2500pci_config_erp, | 1891 | .config_erp = rt2500pci_config_erp, |
1927 | .config = rt2500pci_config, | 1892 | .config = rt2500pci_config, |