diff options
author | David S. Miller <davem@davemloft.net> | 2008-03-25 20:20:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-25 20:20:03 -0400 |
commit | f89e6e3834035c6e8203042f3527931aa7f52496 (patch) | |
tree | a82677254fe4511679d5690606ac75f4300fefe1 /drivers/net/wireless/rt2x00 | |
parent | 7cbca67c073263c179f605bdbbdc565ab29d801d (diff) | |
parent | 3a643d244f09fa1fdd25d48a56a073c1a69583ee (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.26
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | drivers/net/wireless/rt2x00/Kconfig | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 99 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 110 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 127 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00config.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 57 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.h | 22 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 114 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 131 |
11 files changed, 289 insertions, 411 deletions
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig index 4709c11da419..ad1549592c00 100644 --- a/drivers/net/wireless/rt2x00/Kconfig +++ b/drivers/net/wireless/rt2x00/Kconfig | |||
@@ -134,7 +134,7 @@ config RT2500USB | |||
134 | 134 | ||
135 | config RT2500USB_LEDS | 135 | config RT2500USB_LEDS |
136 | bool "RT2500 leds support" | 136 | bool "RT2500 leds support" |
137 | depends on RT2500USB | 137 | depends on RT2500USB && BROKEN |
138 | select RT2X00_LIB_LEDS | 138 | select RT2X00_LIB_LEDS |
139 | ---help--- | 139 | ---help--- |
140 | This adds support for led triggers provided my mac80211. | 140 | This adds support for led triggers provided my mac80211. |
@@ -152,7 +152,7 @@ config RT73USB | |||
152 | 152 | ||
153 | config RT73USB_LEDS | 153 | config RT73USB_LEDS |
154 | bool "RT73 leds support" | 154 | bool "RT73 leds support" |
155 | depends on RT73USB | 155 | depends on RT73USB && BROKEN |
156 | select RT2X00_LIB_LEDS | 156 | select RT2X00_LIB_LEDS |
157 | ---help--- | 157 | ---help--- |
158 | This adds support for led triggers provided my mac80211. | 158 | This adds support for led triggers provided my mac80211. |
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 1f49561d3ddc..a6e9c89c802a 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -270,6 +270,31 @@ static void rt2400pci_led_brightness(struct led_classdev *led_cdev, | |||
270 | /* | 270 | /* |
271 | * Configuration handlers. | 271 | * Configuration handlers. |
272 | */ | 272 | */ |
273 | static void rt2400pci_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 | * since there is no filter for it at this time. | ||
282 | */ | ||
283 | rt2x00pci_register_read(rt2x00dev, RXCSR0, ®); | ||
284 | rt2x00_set_field32(®, RXCSR0_DROP_CRC, | ||
285 | !(filter_flags & FIF_FCSFAIL)); | ||
286 | rt2x00_set_field32(®, RXCSR0_DROP_PHYSICAL, | ||
287 | !(filter_flags & FIF_PLCPFAIL)); | ||
288 | rt2x00_set_field32(®, RXCSR0_DROP_CONTROL, | ||
289 | !(filter_flags & FIF_CONTROL)); | ||
290 | rt2x00_set_field32(®, RXCSR0_DROP_NOT_TO_ME, | ||
291 | !(filter_flags & FIF_PROMISC_IN_BSS)); | ||
292 | rt2x00_set_field32(®, RXCSR0_DROP_TODS, | ||
293 | !(filter_flags & FIF_PROMISC_IN_BSS)); | ||
294 | rt2x00_set_field32(®, RXCSR0_DROP_VERSION_ERROR, 1); | ||
295 | rt2x00pci_register_write(rt2x00dev, RXCSR0, reg); | ||
296 | } | ||
297 | |||
273 | static void rt2400pci_config_intf(struct rt2x00_dev *rt2x00dev, | 298 | static void rt2400pci_config_intf(struct rt2x00_dev *rt2x00dev, |
274 | struct rt2x00_intf *intf, | 299 | struct rt2x00_intf *intf, |
275 | struct rt2x00intf_conf *conf, | 300 | struct rt2x00intf_conf *conf, |
@@ -306,8 +331,8 @@ static void rt2400pci_config_intf(struct rt2x00_dev *rt2x00dev, | |||
306 | conf->bssid, sizeof(conf->bssid)); | 331 | conf->bssid, sizeof(conf->bssid)); |
307 | } | 332 | } |
308 | 333 | ||
309 | static int rt2400pci_config_erp(struct rt2x00_dev *rt2x00dev, | 334 | static void rt2400pci_config_erp(struct rt2x00_dev *rt2x00dev, |
310 | struct rt2x00lib_erp *erp) | 335 | struct rt2x00lib_erp *erp) |
311 | { | 336 | { |
312 | int preamble_mask; | 337 | int preamble_mask; |
313 | u32 reg; | 338 | u32 reg; |
@@ -347,8 +372,6 @@ static int rt2400pci_config_erp(struct rt2x00_dev *rt2x00dev, | |||
347 | rt2x00_set_field32(®, ARCSR5_SERVICE, 0x84); | 372 | rt2x00_set_field32(®, ARCSR5_SERVICE, 0x84); |
348 | rt2x00_set_field32(®, ARCSR2_LENGTH, get_duration(ACK_SIZE, 110)); | 373 | rt2x00_set_field32(®, ARCSR2_LENGTH, get_duration(ACK_SIZE, 110)); |
349 | rt2x00pci_register_write(rt2x00dev, ARCSR5, reg); | 374 | rt2x00pci_register_write(rt2x00dev, ARCSR5, reg); |
350 | |||
351 | return 0; | ||
352 | } | 375 | } |
353 | 376 | ||
354 | static void rt2400pci_config_phymode(struct rt2x00_dev *rt2x00dev, | 377 | static void rt2400pci_config_phymode(struct rt2x00_dev *rt2x00dev, |
@@ -1076,12 +1099,13 @@ static void rt2400pci_fill_rxdone(struct queue_entry *entry, | |||
1076 | * of the preamble bit (0x08). | 1099 | * of the preamble bit (0x08). |
1077 | */ | 1100 | */ |
1078 | rxdesc->signal = rt2x00_get_field32(word2, RXD_W2_SIGNAL) & ~0x08; | 1101 | rxdesc->signal = rt2x00_get_field32(word2, RXD_W2_SIGNAL) & ~0x08; |
1079 | rxdesc->signal_plcp = 1; | ||
1080 | rxdesc->rssi = rt2x00_get_field32(word2, RXD_W3_RSSI) - | 1102 | rxdesc->rssi = rt2x00_get_field32(word2, RXD_W3_RSSI) - |
1081 | entry->queue->rt2x00dev->rssi_offset; | 1103 | entry->queue->rt2x00dev->rssi_offset; |
1082 | rxdesc->ofdm = 0; | ||
1083 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); | 1104 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); |
1084 | rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS); | 1105 | |
1106 | rxdesc->dev_flags = RXDONE_SIGNAL_PLCP; | ||
1107 | if (rt2x00_get_field32(word0, RXD_W0_MY_BSS)) | ||
1108 | rxdesc->dev_flags |= RXDONE_MY_BSS; | ||
1085 | } | 1109 | } |
1086 | 1110 | ||
1087 | /* | 1111 | /* |
@@ -1396,64 +1420,6 @@ static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1396 | /* | 1420 | /* |
1397 | * IEEE80211 stack callback functions. | 1421 | * IEEE80211 stack callback functions. |
1398 | */ | 1422 | */ |
1399 | static void rt2400pci_configure_filter(struct ieee80211_hw *hw, | ||
1400 | unsigned int changed_flags, | ||
1401 | unsigned int *total_flags, | ||
1402 | int mc_count, | ||
1403 | struct dev_addr_list *mc_list) | ||
1404 | { | ||
1405 | struct rt2x00_dev *rt2x00dev = hw->priv; | ||
1406 | u32 reg; | ||
1407 | |||
1408 | /* | ||
1409 | * Mask off any flags we are going to ignore from | ||
1410 | * the total_flags field. | ||
1411 | */ | ||
1412 | *total_flags &= | ||
1413 | FIF_ALLMULTI | | ||
1414 | FIF_FCSFAIL | | ||
1415 | FIF_PLCPFAIL | | ||
1416 | FIF_CONTROL | | ||
1417 | FIF_OTHER_BSS | | ||
1418 | FIF_PROMISC_IN_BSS; | ||
1419 | |||
1420 | /* | ||
1421 | * Apply some rules to the filters: | ||
1422 | * - Some filters imply different filters to be set. | ||
1423 | * - Some things we can't filter out at all. | ||
1424 | */ | ||
1425 | *total_flags |= FIF_ALLMULTI; | ||
1426 | if (*total_flags & FIF_OTHER_BSS || | ||
1427 | *total_flags & FIF_PROMISC_IN_BSS) | ||
1428 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; | ||
1429 | |||
1430 | /* | ||
1431 | * Check if there is any work left for us. | ||
1432 | */ | ||
1433 | if (rt2x00dev->packet_filter == *total_flags) | ||
1434 | return; | ||
1435 | rt2x00dev->packet_filter = *total_flags; | ||
1436 | |||
1437 | /* | ||
1438 | * Start configuration steps. | ||
1439 | * Note that the version error will always be dropped | ||
1440 | * since there is no filter for it at this time. | ||
1441 | */ | ||
1442 | rt2x00pci_register_read(rt2x00dev, RXCSR0, ®); | ||
1443 | rt2x00_set_field32(®, RXCSR0_DROP_CRC, | ||
1444 | !(*total_flags & FIF_FCSFAIL)); | ||
1445 | rt2x00_set_field32(®, RXCSR0_DROP_PHYSICAL, | ||
1446 | !(*total_flags & FIF_PLCPFAIL)); | ||
1447 | rt2x00_set_field32(®, RXCSR0_DROP_CONTROL, | ||
1448 | !(*total_flags & FIF_CONTROL)); | ||
1449 | rt2x00_set_field32(®, RXCSR0_DROP_NOT_TO_ME, | ||
1450 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
1451 | rt2x00_set_field32(®, RXCSR0_DROP_TODS, | ||
1452 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
1453 | rt2x00_set_field32(®, RXCSR0_DROP_VERSION_ERROR, 1); | ||
1454 | rt2x00pci_register_write(rt2x00dev, RXCSR0, reg); | ||
1455 | } | ||
1456 | |||
1457 | static int rt2400pci_set_retry_limit(struct ieee80211_hw *hw, | 1423 | static int rt2400pci_set_retry_limit(struct ieee80211_hw *hw, |
1458 | u32 short_retry, u32 long_retry) | 1424 | u32 short_retry, u32 long_retry) |
1459 | { | 1425 | { |
@@ -1579,7 +1545,7 @@ static const struct ieee80211_ops rt2400pci_mac80211_ops = { | |||
1579 | .remove_interface = rt2x00mac_remove_interface, | 1545 | .remove_interface = rt2x00mac_remove_interface, |
1580 | .config = rt2x00mac_config, | 1546 | .config = rt2x00mac_config, |
1581 | .config_interface = rt2x00mac_config_interface, | 1547 | .config_interface = rt2x00mac_config_interface, |
1582 | .configure_filter = rt2400pci_configure_filter, | 1548 | .configure_filter = rt2x00mac_configure_filter, |
1583 | .get_stats = rt2x00mac_get_stats, | 1549 | .get_stats = rt2x00mac_get_stats, |
1584 | .set_retry_limit = rt2400pci_set_retry_limit, | 1550 | .set_retry_limit = rt2400pci_set_retry_limit, |
1585 | .bss_info_changed = rt2x00mac_bss_info_changed, | 1551 | .bss_info_changed = rt2x00mac_bss_info_changed, |
@@ -1607,6 +1573,7 @@ static const struct rt2x00lib_ops rt2400pci_rt2x00_ops = { | |||
1607 | .write_tx_data = rt2x00pci_write_tx_data, | 1573 | .write_tx_data = rt2x00pci_write_tx_data, |
1608 | .kick_tx_queue = rt2400pci_kick_tx_queue, | 1574 | .kick_tx_queue = rt2400pci_kick_tx_queue, |
1609 | .fill_rxdone = rt2400pci_fill_rxdone, | 1575 | .fill_rxdone = rt2400pci_fill_rxdone, |
1576 | .config_filter = rt2400pci_config_filter, | ||
1610 | .config_intf = rt2400pci_config_intf, | 1577 | .config_intf = rt2400pci_config_intf, |
1611 | .config_erp = rt2400pci_config_erp, | 1578 | .config_erp = rt2400pci_config_erp, |
1612 | .config = rt2400pci_config, | 1579 | .config = rt2400pci_config, |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 0f5139a2f238..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, |
@@ -1225,13 +1252,16 @@ static void rt2500pci_fill_rxdone(struct queue_entry *entry, | |||
1225 | * the signal is the PLCP value. If it was received with | 1252 | * the signal is the PLCP value. If it was received with |
1226 | * a CCK bitrate the signal is the rate in 100kbit/s. | 1253 | * a CCK bitrate the signal is the rate in 100kbit/s. |
1227 | */ | 1254 | */ |
1228 | rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM); | ||
1229 | rxdesc->signal = rt2x00_get_field32(word2, RXD_W2_SIGNAL); | 1255 | rxdesc->signal = rt2x00_get_field32(word2, RXD_W2_SIGNAL); |
1230 | rxdesc->signal_plcp = rxdesc->ofdm; | ||
1231 | rxdesc->rssi = rt2x00_get_field32(word2, RXD_W2_RSSI) - | 1256 | rxdesc->rssi = rt2x00_get_field32(word2, RXD_W2_RSSI) - |
1232 | entry->queue->rt2x00dev->rssi_offset; | 1257 | entry->queue->rt2x00dev->rssi_offset; |
1233 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); | 1258 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); |
1234 | rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS); | 1259 | |
1260 | rxdesc->dev_flags = 0; | ||
1261 | if (rt2x00_get_field32(word0, RXD_W0_OFDM)) | ||
1262 | rxdesc->dev_flags |= RXDONE_SIGNAL_PLCP; | ||
1263 | if (rt2x00_get_field32(word0, RXD_W0_MY_BSS)) | ||
1264 | rxdesc->dev_flags |= RXDONE_MY_BSS; | ||
1235 | } | 1265 | } |
1236 | 1266 | ||
1237 | /* | 1267 | /* |
@@ -1728,69 +1758,6 @@ static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1728 | /* | 1758 | /* |
1729 | * IEEE80211 stack callback functions. | 1759 | * IEEE80211 stack callback functions. |
1730 | */ | 1760 | */ |
1731 | static void rt2500pci_configure_filter(struct ieee80211_hw *hw, | ||
1732 | unsigned int changed_flags, | ||
1733 | unsigned int *total_flags, | ||
1734 | int mc_count, | ||
1735 | struct dev_addr_list *mc_list) | ||
1736 | { | ||
1737 | struct rt2x00_dev *rt2x00dev = hw->priv; | ||
1738 | u32 reg; | ||
1739 | |||
1740 | /* | ||
1741 | * Mask off any flags we are going to ignore from | ||
1742 | * the total_flags field. | ||
1743 | */ | ||
1744 | *total_flags &= | ||
1745 | FIF_ALLMULTI | | ||
1746 | FIF_FCSFAIL | | ||
1747 | FIF_PLCPFAIL | | ||
1748 | FIF_CONTROL | | ||
1749 | FIF_OTHER_BSS | | ||
1750 | FIF_PROMISC_IN_BSS; | ||
1751 | |||
1752 | /* | ||
1753 | * Apply some rules to the filters: | ||
1754 | * - Some filters imply different filters to be set. | ||
1755 | * - Some things we can't filter out at all. | ||
1756 | */ | ||
1757 | if (mc_count) | ||
1758 | *total_flags |= FIF_ALLMULTI; | ||
1759 | if (*total_flags & FIF_OTHER_BSS || | ||
1760 | *total_flags & FIF_PROMISC_IN_BSS) | ||
1761 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; | ||
1762 | |||
1763 | /* | ||
1764 | * Check if there is any work left for us. | ||
1765 | */ | ||
1766 | if (rt2x00dev->packet_filter == *total_flags) | ||
1767 | return; | ||
1768 | rt2x00dev->packet_filter = *total_flags; | ||
1769 | |||
1770 | /* | ||
1771 | * Start configuration steps. | ||
1772 | * Note that the version error will always be dropped | ||
1773 | * and broadcast frames will always be accepted since | ||
1774 | * there is no filter for it at this time. | ||
1775 | */ | ||
1776 | rt2x00pci_register_read(rt2x00dev, RXCSR0, ®); | ||
1777 | rt2x00_set_field32(®, RXCSR0_DROP_CRC, | ||
1778 | !(*total_flags & FIF_FCSFAIL)); | ||
1779 | rt2x00_set_field32(®, RXCSR0_DROP_PHYSICAL, | ||
1780 | !(*total_flags & FIF_PLCPFAIL)); | ||
1781 | rt2x00_set_field32(®, RXCSR0_DROP_CONTROL, | ||
1782 | !(*total_flags & FIF_CONTROL)); | ||
1783 | rt2x00_set_field32(®, RXCSR0_DROP_NOT_TO_ME, | ||
1784 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
1785 | rt2x00_set_field32(®, RXCSR0_DROP_TODS, | ||
1786 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
1787 | rt2x00_set_field32(®, RXCSR0_DROP_VERSION_ERROR, 1); | ||
1788 | rt2x00_set_field32(®, RXCSR0_DROP_MCAST, | ||
1789 | !(*total_flags & FIF_ALLMULTI)); | ||
1790 | rt2x00_set_field32(®, RXCSR0_DROP_BCAST, 0); | ||
1791 | rt2x00pci_register_write(rt2x00dev, RXCSR0, reg); | ||
1792 | } | ||
1793 | |||
1794 | static int rt2500pci_set_retry_limit(struct ieee80211_hw *hw, | 1761 | static int rt2500pci_set_retry_limit(struct ieee80211_hw *hw, |
1795 | u32 short_retry, u32 long_retry) | 1762 | u32 short_retry, u32 long_retry) |
1796 | { | 1763 | { |
@@ -1891,7 +1858,7 @@ static const struct ieee80211_ops rt2500pci_mac80211_ops = { | |||
1891 | .remove_interface = rt2x00mac_remove_interface, | 1858 | .remove_interface = rt2x00mac_remove_interface, |
1892 | .config = rt2x00mac_config, | 1859 | .config = rt2x00mac_config, |
1893 | .config_interface = rt2x00mac_config_interface, | 1860 | .config_interface = rt2x00mac_config_interface, |
1894 | .configure_filter = rt2500pci_configure_filter, | 1861 | .configure_filter = rt2x00mac_configure_filter, |
1895 | .get_stats = rt2x00mac_get_stats, | 1862 | .get_stats = rt2x00mac_get_stats, |
1896 | .set_retry_limit = rt2500pci_set_retry_limit, | 1863 | .set_retry_limit = rt2500pci_set_retry_limit, |
1897 | .bss_info_changed = rt2x00mac_bss_info_changed, | 1864 | .bss_info_changed = rt2x00mac_bss_info_changed, |
@@ -1919,6 +1886,7 @@ static const struct rt2x00lib_ops rt2500pci_rt2x00_ops = { | |||
1919 | .write_tx_data = rt2x00pci_write_tx_data, | 1886 | .write_tx_data = rt2x00pci_write_tx_data, |
1920 | .kick_tx_queue = rt2500pci_kick_tx_queue, | 1887 | .kick_tx_queue = rt2500pci_kick_tx_queue, |
1921 | .fill_rxdone = rt2500pci_fill_rxdone, | 1888 | .fill_rxdone = rt2500pci_fill_rxdone, |
1889 | .config_filter = rt2500pci_config_filter, | ||
1922 | .config_intf = rt2500pci_config_intf, | 1890 | .config_intf = rt2500pci_config_intf, |
1923 | .config_erp = rt2500pci_config_erp, | 1891 | .config_erp = rt2500pci_config_erp, |
1924 | .config = rt2500pci_config, | 1892 | .config = rt2500pci_config, |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index c8216d755835..f5c18f011e93 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -316,6 +316,35 @@ static void rt2500usb_led_brightness(struct led_classdev *led_cdev, | |||
316 | /* | 316 | /* |
317 | * Configuration handlers. | 317 | * Configuration handlers. |
318 | */ | 318 | */ |
319 | static void rt2500usb_config_filter(struct rt2x00_dev *rt2x00dev, | ||
320 | const unsigned int filter_flags) | ||
321 | { | ||
322 | u16 reg; | ||
323 | |||
324 | /* | ||
325 | * Start configuration steps. | ||
326 | * Note that the version error will always be dropped | ||
327 | * and broadcast frames will always be accepted since | ||
328 | * there is no filter for it at this time. | ||
329 | */ | ||
330 | rt2500usb_register_read(rt2x00dev, TXRX_CSR2, ®); | ||
331 | rt2x00_set_field16(®, TXRX_CSR2_DROP_CRC, | ||
332 | !(filter_flags & FIF_FCSFAIL)); | ||
333 | rt2x00_set_field16(®, TXRX_CSR2_DROP_PHYSICAL, | ||
334 | !(filter_flags & FIF_PLCPFAIL)); | ||
335 | rt2x00_set_field16(®, TXRX_CSR2_DROP_CONTROL, | ||
336 | !(filter_flags & FIF_CONTROL)); | ||
337 | rt2x00_set_field16(®, TXRX_CSR2_DROP_NOT_TO_ME, | ||
338 | !(filter_flags & FIF_PROMISC_IN_BSS)); | ||
339 | rt2x00_set_field16(®, TXRX_CSR2_DROP_TODS, | ||
340 | !(filter_flags & FIF_PROMISC_IN_BSS)); | ||
341 | rt2x00_set_field16(®, TXRX_CSR2_DROP_VERSION_ERROR, 1); | ||
342 | rt2x00_set_field16(®, TXRX_CSR2_DROP_MULTICAST, | ||
343 | !(filter_flags & FIF_ALLMULTI)); | ||
344 | rt2x00_set_field16(®, TXRX_CSR2_DROP_BROADCAST, 0); | ||
345 | rt2500usb_register_write(rt2x00dev, TXRX_CSR2, reg); | ||
346 | } | ||
347 | |||
319 | static void rt2500usb_config_intf(struct rt2x00_dev *rt2x00dev, | 348 | static void rt2500usb_config_intf(struct rt2x00_dev *rt2x00dev, |
320 | struct rt2x00_intf *intf, | 349 | struct rt2x00_intf *intf, |
321 | struct rt2x00intf_conf *conf, | 350 | struct rt2x00intf_conf *conf, |
@@ -358,18 +387,11 @@ static void rt2500usb_config_intf(struct rt2x00_dev *rt2x00dev, | |||
358 | (3 * sizeof(__le16))); | 387 | (3 * sizeof(__le16))); |
359 | } | 388 | } |
360 | 389 | ||
361 | static int rt2500usb_config_erp(struct rt2x00_dev *rt2x00dev, | 390 | static void rt2500usb_config_erp(struct rt2x00_dev *rt2x00dev, |
362 | struct rt2x00lib_erp *erp) | 391 | struct rt2x00lib_erp *erp) |
363 | { | 392 | { |
364 | u16 reg; | 393 | u16 reg; |
365 | 394 | ||
366 | /* | ||
367 | * When in atomic context, we should let rt2x00lib | ||
368 | * try this configuration again later. | ||
369 | */ | ||
370 | if (in_atomic()) | ||
371 | return -EAGAIN; | ||
372 | |||
373 | rt2500usb_register_read(rt2x00dev, TXRX_CSR1, ®); | 395 | rt2500usb_register_read(rt2x00dev, TXRX_CSR1, ®); |
374 | rt2x00_set_field16(®, TXRX_CSR1_ACK_TIMEOUT, erp->ack_timeout); | 396 | rt2x00_set_field16(®, TXRX_CSR1_ACK_TIMEOUT, erp->ack_timeout); |
375 | rt2500usb_register_write(rt2x00dev, TXRX_CSR1, reg); | 397 | rt2500usb_register_write(rt2x00dev, TXRX_CSR1, reg); |
@@ -378,8 +400,6 @@ static int rt2500usb_config_erp(struct rt2x00_dev *rt2x00dev, | |||
378 | rt2x00_set_field16(®, TXRX_CSR10_AUTORESPOND_PREAMBLE, | 400 | rt2x00_set_field16(®, TXRX_CSR10_AUTORESPOND_PREAMBLE, |
379 | !!erp->short_preamble); | 401 | !!erp->short_preamble); |
380 | rt2500usb_register_write(rt2x00dev, TXRX_CSR10, reg); | 402 | rt2500usb_register_write(rt2x00dev, TXRX_CSR10, reg); |
381 | |||
382 | return 0; | ||
383 | } | 403 | } |
384 | 404 | ||
385 | static void rt2500usb_config_phymode(struct rt2x00_dev *rt2x00dev, | 405 | static void rt2500usb_config_phymode(struct rt2x00_dev *rt2x00dev, |
@@ -1139,13 +1159,16 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry, | |||
1139 | * the signal is the PLCP value. If it was received with | 1159 | * the signal is the PLCP value. If it was received with |
1140 | * a CCK bitrate the signal is the rate in 100kbit/s. | 1160 | * a CCK bitrate the signal is the rate in 100kbit/s. |
1141 | */ | 1161 | */ |
1142 | rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM); | ||
1143 | rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL); | 1162 | rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL); |
1144 | rxdesc->signal_plcp = rxdesc->ofdm; | ||
1145 | rxdesc->rssi = rt2x00_get_field32(word1, RXD_W1_RSSI) - | 1163 | rxdesc->rssi = rt2x00_get_field32(word1, RXD_W1_RSSI) - |
1146 | entry->queue->rt2x00dev->rssi_offset; | 1164 | entry->queue->rt2x00dev->rssi_offset; |
1147 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); | 1165 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); |
1148 | rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS); | 1166 | |
1167 | rxdesc->dev_flags = 0; | ||
1168 | if (rt2x00_get_field32(word0, RXD_W0_OFDM)) | ||
1169 | rxdesc->dev_flags |= RXDONE_SIGNAL_PLCP; | ||
1170 | if (rt2x00_get_field32(word0, RXD_W0_MY_BSS)) | ||
1171 | rxdesc->dev_flags |= RXDONE_MY_BSS; | ||
1149 | 1172 | ||
1150 | /* | 1173 | /* |
1151 | * Adjust the skb memory window to the frame boundaries. | 1174 | * Adjust the skb memory window to the frame boundaries. |
@@ -1641,6 +1664,7 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1641 | */ | 1664 | */ |
1642 | __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags); | 1665 | __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags); |
1643 | __set_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags); | 1666 | __set_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags); |
1667 | __set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags); | ||
1644 | 1668 | ||
1645 | /* | 1669 | /* |
1646 | * Set the rssi offset. | 1670 | * Set the rssi offset. |
@@ -1653,78 +1677,6 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1653 | /* | 1677 | /* |
1654 | * IEEE80211 stack callback functions. | 1678 | * IEEE80211 stack callback functions. |
1655 | */ | 1679 | */ |
1656 | static void rt2500usb_configure_filter(struct ieee80211_hw *hw, | ||
1657 | unsigned int changed_flags, | ||
1658 | unsigned int *total_flags, | ||
1659 | int mc_count, | ||
1660 | struct dev_addr_list *mc_list) | ||
1661 | { | ||
1662 | struct rt2x00_dev *rt2x00dev = hw->priv; | ||
1663 | u16 reg; | ||
1664 | |||
1665 | /* | ||
1666 | * Mask off any flags we are going to ignore from | ||
1667 | * the total_flags field. | ||
1668 | */ | ||
1669 | *total_flags &= | ||
1670 | FIF_ALLMULTI | | ||
1671 | FIF_FCSFAIL | | ||
1672 | FIF_PLCPFAIL | | ||
1673 | FIF_CONTROL | | ||
1674 | FIF_OTHER_BSS | | ||
1675 | FIF_PROMISC_IN_BSS; | ||
1676 | |||
1677 | /* | ||
1678 | * Apply some rules to the filters: | ||
1679 | * - Some filters imply different filters to be set. | ||
1680 | * - Some things we can't filter out at all. | ||
1681 | */ | ||
1682 | if (mc_count) | ||
1683 | *total_flags |= FIF_ALLMULTI; | ||
1684 | if (*total_flags & FIF_OTHER_BSS || | ||
1685 | *total_flags & FIF_PROMISC_IN_BSS) | ||
1686 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; | ||
1687 | |||
1688 | /* | ||
1689 | * Check if there is any work left for us. | ||
1690 | */ | ||
1691 | if (rt2x00dev->packet_filter == *total_flags) | ||
1692 | return; | ||
1693 | rt2x00dev->packet_filter = *total_flags; | ||
1694 | |||
1695 | /* | ||
1696 | * When in atomic context, reschedule and let rt2x00lib | ||
1697 | * call this function again. | ||
1698 | */ | ||
1699 | if (in_atomic()) { | ||
1700 | queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->filter_work); | ||
1701 | return; | ||
1702 | } | ||
1703 | |||
1704 | /* | ||
1705 | * Start configuration steps. | ||
1706 | * Note that the version error will always be dropped | ||
1707 | * and broadcast frames will always be accepted since | ||
1708 | * there is no filter for it at this time. | ||
1709 | */ | ||
1710 | rt2500usb_register_read(rt2x00dev, TXRX_CSR2, ®); | ||
1711 | rt2x00_set_field16(®, TXRX_CSR2_DROP_CRC, | ||
1712 | !(*total_flags & FIF_FCSFAIL)); | ||
1713 | rt2x00_set_field16(®, TXRX_CSR2_DROP_PHYSICAL, | ||
1714 | !(*total_flags & FIF_PLCPFAIL)); | ||
1715 | rt2x00_set_field16(®, TXRX_CSR2_DROP_CONTROL, | ||
1716 | !(*total_flags & FIF_CONTROL)); | ||
1717 | rt2x00_set_field16(®, TXRX_CSR2_DROP_NOT_TO_ME, | ||
1718 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
1719 | rt2x00_set_field16(®, TXRX_CSR2_DROP_TODS, | ||
1720 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
1721 | rt2x00_set_field16(®, TXRX_CSR2_DROP_VERSION_ERROR, 1); | ||
1722 | rt2x00_set_field16(®, TXRX_CSR2_DROP_MULTICAST, | ||
1723 | !(*total_flags & FIF_ALLMULTI)); | ||
1724 | rt2x00_set_field16(®, TXRX_CSR2_DROP_BROADCAST, 0); | ||
1725 | rt2500usb_register_write(rt2x00dev, TXRX_CSR2, reg); | ||
1726 | } | ||
1727 | |||
1728 | static int rt2500usb_beacon_update(struct ieee80211_hw *hw, | 1680 | static int rt2500usb_beacon_update(struct ieee80211_hw *hw, |
1729 | struct sk_buff *skb, | 1681 | struct sk_buff *skb, |
1730 | struct ieee80211_tx_control *control) | 1682 | struct ieee80211_tx_control *control) |
@@ -1821,7 +1773,7 @@ static const struct ieee80211_ops rt2500usb_mac80211_ops = { | |||
1821 | .remove_interface = rt2x00mac_remove_interface, | 1773 | .remove_interface = rt2x00mac_remove_interface, |
1822 | .config = rt2x00mac_config, | 1774 | .config = rt2x00mac_config, |
1823 | .config_interface = rt2x00mac_config_interface, | 1775 | .config_interface = rt2x00mac_config_interface, |
1824 | .configure_filter = rt2500usb_configure_filter, | 1776 | .configure_filter = rt2x00mac_configure_filter, |
1825 | .get_stats = rt2x00mac_get_stats, | 1777 | .get_stats = rt2x00mac_get_stats, |
1826 | .bss_info_changed = rt2x00mac_bss_info_changed, | 1778 | .bss_info_changed = rt2x00mac_bss_info_changed, |
1827 | .conf_tx = rt2x00mac_conf_tx, | 1779 | .conf_tx = rt2x00mac_conf_tx, |
@@ -1845,6 +1797,7 @@ static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = { | |||
1845 | .get_tx_data_len = rt2500usb_get_tx_data_len, | 1797 | .get_tx_data_len = rt2500usb_get_tx_data_len, |
1846 | .kick_tx_queue = rt2500usb_kick_tx_queue, | 1798 | .kick_tx_queue = rt2500usb_kick_tx_queue, |
1847 | .fill_rxdone = rt2500usb_fill_rxdone, | 1799 | .fill_rxdone = rt2500usb_fill_rxdone, |
1800 | .config_filter = rt2500usb_config_filter, | ||
1848 | .config_intf = rt2500usb_config_intf, | 1801 | .config_intf = rt2500usb_config_intf, |
1849 | .config_erp = rt2500usb_config_erp, | 1802 | .config_erp = rt2500usb_config_erp, |
1850 | .config = rt2500usb_config, | 1803 | .config = rt2500usb_config, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index c016bfe1defd..333484ddb993 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -560,6 +560,8 @@ struct rt2x00lib_ops { | |||
560 | /* | 560 | /* |
561 | * Configuration handlers. | 561 | * Configuration handlers. |
562 | */ | 562 | */ |
563 | void (*config_filter) (struct rt2x00_dev *rt2x00dev, | ||
564 | const unsigned int filter_flags); | ||
563 | void (*config_intf) (struct rt2x00_dev *rt2x00dev, | 565 | void (*config_intf) (struct rt2x00_dev *rt2x00dev, |
564 | struct rt2x00_intf *intf, | 566 | struct rt2x00_intf *intf, |
565 | struct rt2x00intf_conf *conf, | 567 | struct rt2x00intf_conf *conf, |
@@ -568,8 +570,8 @@ struct rt2x00lib_ops { | |||
568 | #define CONFIG_UPDATE_MAC ( 1 << 2 ) | 570 | #define CONFIG_UPDATE_MAC ( 1 << 2 ) |
569 | #define CONFIG_UPDATE_BSSID ( 1 << 3 ) | 571 | #define CONFIG_UPDATE_BSSID ( 1 << 3 ) |
570 | 572 | ||
571 | int (*config_erp) (struct rt2x00_dev *rt2x00dev, | 573 | void (*config_erp) (struct rt2x00_dev *rt2x00dev, |
572 | struct rt2x00lib_erp *erp); | 574 | struct rt2x00lib_erp *erp); |
573 | void (*config) (struct rt2x00_dev *rt2x00dev, | 575 | void (*config) (struct rt2x00_dev *rt2x00dev, |
574 | struct rt2x00lib_conf *libconf, | 576 | struct rt2x00lib_conf *libconf, |
575 | const unsigned int flags); | 577 | const unsigned int flags); |
@@ -624,6 +626,7 @@ enum rt2x00_flags { | |||
624 | DRIVER_REQUIRE_FIRMWARE, | 626 | DRIVER_REQUIRE_FIRMWARE, |
625 | DRIVER_REQUIRE_BEACON_GUARD, | 627 | DRIVER_REQUIRE_BEACON_GUARD, |
626 | DRIVER_REQUIRE_ATIM_QUEUE, | 628 | DRIVER_REQUIRE_ATIM_QUEUE, |
629 | DRIVER_REQUIRE_SCHEDULED, | ||
627 | 630 | ||
628 | /* | 631 | /* |
629 | * Driver configuration | 632 | * Driver configuration |
@@ -987,6 +990,10 @@ int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf); | |||
987 | int rt2x00mac_config_interface(struct ieee80211_hw *hw, | 990 | int rt2x00mac_config_interface(struct ieee80211_hw *hw, |
988 | struct ieee80211_vif *vif, | 991 | struct ieee80211_vif *vif, |
989 | struct ieee80211_if_conf *conf); | 992 | struct ieee80211_if_conf *conf); |
993 | void rt2x00mac_configure_filter(struct ieee80211_hw *hw, | ||
994 | unsigned int changed_flags, | ||
995 | unsigned int *total_flags, | ||
996 | int mc_count, struct dev_addr_list *mc_list); | ||
990 | int rt2x00mac_get_stats(struct ieee80211_hw *hw, | 997 | int rt2x00mac_get_stats(struct ieee80211_hw *hw, |
991 | struct ieee80211_low_level_stats *stats); | 998 | struct ieee80211_low_level_stats *stats); |
992 | int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw, | 999 | int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c index 5e2d81a9e438..a9930a03f450 100644 --- a/drivers/net/wireless/rt2x00/rt2x00config.c +++ b/drivers/net/wireless/rt2x00/rt2x00config.c | |||
@@ -80,7 +80,6 @@ void rt2x00lib_config_erp(struct rt2x00_dev *rt2x00dev, | |||
80 | struct ieee80211_bss_conf *bss_conf) | 80 | struct ieee80211_bss_conf *bss_conf) |
81 | { | 81 | { |
82 | struct rt2x00lib_erp erp; | 82 | struct rt2x00lib_erp erp; |
83 | int retval; | ||
84 | 83 | ||
85 | memset(&erp, 0, sizeof(erp)); | 84 | memset(&erp, 0, sizeof(erp)); |
86 | 85 | ||
@@ -101,14 +100,7 @@ void rt2x00lib_config_erp(struct rt2x00_dev *rt2x00dev, | |||
101 | erp.ack_consume_time += PREAMBLE; | 100 | erp.ack_consume_time += PREAMBLE; |
102 | } | 101 | } |
103 | 102 | ||
104 | retval = rt2x00dev->ops->lib->config_erp(rt2x00dev, &erp); | 103 | rt2x00dev->ops->lib->config_erp(rt2x00dev, &erp); |
105 | |||
106 | if (retval) { | ||
107 | spin_lock(&intf->lock); | ||
108 | intf->delayed_flags |= DELAYED_CONFIG_ERP; | ||
109 | queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->intf_work); | ||
110 | spin_unlock(&intf->lock); | ||
111 | } | ||
112 | } | 104 | } |
113 | 105 | ||
114 | void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev, | 106 | void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index acf4d67ba43d..f52e92512f90 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -580,19 +580,28 @@ void rt2x00lib_rxdone(struct queue_entry *entry, | |||
580 | for (i = 0; i < sband->n_bitrates; i++) { | 580 | for (i = 0; i < sband->n_bitrates; i++) { |
581 | rate = rt2x00_get_rate(sband->bitrates[i].hw_value); | 581 | rate = rt2x00_get_rate(sband->bitrates[i].hw_value); |
582 | 582 | ||
583 | if ((rxdesc->signal_plcp && rate->plcp == rxdesc->signal) || | 583 | if (((rxdesc->dev_flags & RXDONE_SIGNAL_PLCP) && |
584 | (!rxdesc->signal_plcp && rate->bitrate == rxdesc->signal)) { | 584 | (rate->plcp == rxdesc->signal)) || |
585 | (!(rxdesc->dev_flags & RXDONE_SIGNAL_PLCP) && | ||
586 | (rate->bitrate == rxdesc->signal))) { | ||
585 | idx = i; | 587 | idx = i; |
586 | break; | 588 | break; |
587 | } | 589 | } |
588 | } | 590 | } |
589 | 591 | ||
592 | if (idx < 0) { | ||
593 | WARNING(rt2x00dev, "Frame received with unrecognized signal," | ||
594 | "signal=0x%.2x, plcp=%d.\n", rxdesc->signal, | ||
595 | !!(rxdesc->dev_flags & RXDONE_SIGNAL_PLCP)); | ||
596 | idx = 0; | ||
597 | } | ||
598 | |||
590 | /* | 599 | /* |
591 | * Only update link status if this is a beacon frame carrying our bssid. | 600 | * Only update link status if this is a beacon frame carrying our bssid. |
592 | */ | 601 | */ |
593 | hdr = (struct ieee80211_hdr *)entry->skb->data; | 602 | hdr = (struct ieee80211_hdr *)entry->skb->data; |
594 | fc = le16_to_cpu(hdr->frame_control); | 603 | fc = le16_to_cpu(hdr->frame_control); |
595 | if (is_beacon(fc) && rxdesc->my_bss) | 604 | if (is_beacon(fc) && (rxdesc->dev_flags & RXDONE_MY_BSS)) |
596 | rt2x00lib_update_link_stats(&rt2x00dev->link, rxdesc->rssi); | 605 | rt2x00lib_update_link_stats(&rt2x00dev->link, rxdesc->rssi); |
597 | 606 | ||
598 | rt2x00dev->link.qual.rx_success++; | 607 | rt2x00dev->link.qual.rx_success++; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index 0a11c27d603b..17b6bb034ebf 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -380,6 +380,50 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw, | |||
380 | } | 380 | } |
381 | EXPORT_SYMBOL_GPL(rt2x00mac_config_interface); | 381 | EXPORT_SYMBOL_GPL(rt2x00mac_config_interface); |
382 | 382 | ||
383 | void rt2x00mac_configure_filter(struct ieee80211_hw *hw, | ||
384 | unsigned int changed_flags, | ||
385 | unsigned int *total_flags, | ||
386 | int mc_count, struct dev_addr_list *mc_list) | ||
387 | { | ||
388 | struct rt2x00_dev *rt2x00dev = hw->priv; | ||
389 | |||
390 | /* | ||
391 | * Mask off any flags we are going to ignore | ||
392 | * from the total_flags field. | ||
393 | */ | ||
394 | *total_flags &= | ||
395 | FIF_ALLMULTI | | ||
396 | FIF_FCSFAIL | | ||
397 | FIF_PLCPFAIL | | ||
398 | FIF_CONTROL | | ||
399 | FIF_OTHER_BSS | | ||
400 | FIF_PROMISC_IN_BSS; | ||
401 | |||
402 | /* | ||
403 | * Apply some rules to the filters: | ||
404 | * - Some filters imply different filters to be set. | ||
405 | * - Some things we can't filter out at all. | ||
406 | * - Multicast filter seems to kill broadcast traffic so never use it. | ||
407 | */ | ||
408 | *total_flags |= FIF_ALLMULTI; | ||
409 | if (*total_flags & FIF_OTHER_BSS || | ||
410 | *total_flags & FIF_PROMISC_IN_BSS) | ||
411 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; | ||
412 | |||
413 | /* | ||
414 | * Check if there is any work left for us. | ||
415 | */ | ||
416 | if (rt2x00dev->packet_filter == *total_flags) | ||
417 | return; | ||
418 | rt2x00dev->packet_filter = *total_flags; | ||
419 | |||
420 | if (!test_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags)) | ||
421 | queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->filter_work); | ||
422 | else | ||
423 | rt2x00dev->ops->lib->config_filter(rt2x00dev, *total_flags); | ||
424 | } | ||
425 | EXPORT_SYMBOL_GPL(rt2x00mac_configure_filter); | ||
426 | |||
383 | int rt2x00mac_get_stats(struct ieee80211_hw *hw, | 427 | int rt2x00mac_get_stats(struct ieee80211_hw *hw, |
384 | struct ieee80211_low_level_stats *stats) | 428 | struct ieee80211_low_level_stats *stats) |
385 | { | 429 | { |
@@ -419,6 +463,7 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, | |||
419 | { | 463 | { |
420 | struct rt2x00_dev *rt2x00dev = hw->priv; | 464 | struct rt2x00_dev *rt2x00dev = hw->priv; |
421 | struct rt2x00_intf *intf = vif_to_intf(vif); | 465 | struct rt2x00_intf *intf = vif_to_intf(vif); |
466 | unsigned int delayed = 0; | ||
422 | 467 | ||
423 | /* | 468 | /* |
424 | * When the association status has changed we must reset the link | 469 | * When the association status has changed we must reset the link |
@@ -439,11 +484,19 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, | |||
439 | * When the erp information has changed, we should perform | 484 | * When the erp information has changed, we should perform |
440 | * additional configuration steps. For all other changes we are done. | 485 | * additional configuration steps. For all other changes we are done. |
441 | */ | 486 | */ |
442 | if (changes & BSS_CHANGED_ERP_PREAMBLE) | 487 | if (changes & BSS_CHANGED_ERP_PREAMBLE) { |
443 | rt2x00lib_config_erp(rt2x00dev, intf, bss_conf); | 488 | if (!test_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags)) |
489 | rt2x00lib_config_erp(rt2x00dev, intf, bss_conf); | ||
490 | else | ||
491 | delayed |= DELAYED_CONFIG_ERP; | ||
492 | } | ||
444 | 493 | ||
445 | spin_lock(&intf->lock); | 494 | spin_lock(&intf->lock); |
446 | memcpy(&intf->conf, bss_conf, sizeof(*bss_conf)); | 495 | memcpy(&intf->conf, bss_conf, sizeof(*bss_conf)); |
496 | if (delayed) { | ||
497 | intf->delayed_flags |= delayed; | ||
498 | queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->intf_work); | ||
499 | } | ||
447 | spin_unlock(&intf->lock); | 500 | spin_unlock(&intf->lock); |
448 | } | 501 | } |
449 | EXPORT_SYMBOL_GPL(rt2x00mac_bss_info_changed); | 502 | EXPORT_SYMBOL_GPL(rt2x00mac_bss_info_changed); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h index c5f46f234083..7027c9f47d3f 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.h +++ b/drivers/net/wireless/rt2x00/rt2x00queue.h | |||
@@ -129,27 +129,35 @@ static inline struct skb_frame_desc* get_skb_frame_desc(struct sk_buff *skb) | |||
129 | } | 129 | } |
130 | 130 | ||
131 | /** | 131 | /** |
132 | * enum rxdone_entry_desc_flags: Flags for &struct rxdone_entry_desc | ||
133 | * | ||
134 | * @RXDONE_SIGNAL_PLCP: Does the signal field contain the plcp value, | ||
135 | * or does it contain the bitrate itself. | ||
136 | * @RXDONE_MY_BSS: Does this frame originate from device's BSS. | ||
137 | */ | ||
138 | enum rxdone_entry_desc_flags { | ||
139 | RXDONE_SIGNAL_PLCP = 1 << 0, | ||
140 | RXDONE_MY_BSS = 1 << 1, | ||
141 | }; | ||
142 | |||
143 | /** | ||
132 | * struct rxdone_entry_desc: RX Entry descriptor | 144 | * struct rxdone_entry_desc: RX Entry descriptor |
133 | * | 145 | * |
134 | * Summary of information that has been read from the RX frame descriptor. | 146 | * Summary of information that has been read from the RX frame descriptor. |
135 | * | 147 | * |
136 | * @signal: Signal of the received frame. | 148 | * @signal: Signal of the received frame. |
137 | * @signal_plcp: Does the signal field contain the plcp value, | ||
138 | * or does it contain the bitrate itself. | ||
139 | * @rssi: RSSI of the received frame. | 149 | * @rssi: RSSI of the received frame. |
140 | * @ofdm: Was frame send with an OFDM rate. | ||
141 | * @size: Data size of the received frame. | 150 | * @size: Data size of the received frame. |
142 | * @flags: MAC80211 receive flags (See &enum mac80211_rx_flags). | 151 | * @flags: MAC80211 receive flags (See &enum mac80211_rx_flags). |
143 | * @my_bss: Does this frame originate from device's BSS. | 152 | * @dev_flags: Ralink receive flags (See &enum rxdone_entry_desc_flags). |
153 | |||
144 | */ | 154 | */ |
145 | struct rxdone_entry_desc { | 155 | struct rxdone_entry_desc { |
146 | int signal; | 156 | int signal; |
147 | int signal_plcp; | ||
148 | int rssi; | 157 | int rssi; |
149 | int ofdm; | ||
150 | int size; | 158 | int size; |
151 | int flags; | 159 | int flags; |
152 | int my_bss; | 160 | int dev_flags; |
153 | }; | 161 | }; |
154 | 162 | ||
155 | /** | 163 | /** |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index babb240cef3d..0d2e6f7dd692 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -321,6 +321,37 @@ static void rt61pci_led_brightness(struct led_classdev *led_cdev, | |||
321 | /* | 321 | /* |
322 | * Configuration handlers. | 322 | * Configuration handlers. |
323 | */ | 323 | */ |
324 | static void rt61pci_config_filter(struct rt2x00_dev *rt2x00dev, | ||
325 | const unsigned int filter_flags) | ||
326 | { | ||
327 | u32 reg; | ||
328 | |||
329 | /* | ||
330 | * Start configuration steps. | ||
331 | * Note that the version error will always be dropped | ||
332 | * and broadcast frames will always be accepted since | ||
333 | * there is no filter for it at this time. | ||
334 | */ | ||
335 | rt2x00pci_register_read(rt2x00dev, TXRX_CSR0, ®); | ||
336 | rt2x00_set_field32(®, TXRX_CSR0_DROP_CRC, | ||
337 | !(filter_flags & FIF_FCSFAIL)); | ||
338 | rt2x00_set_field32(®, TXRX_CSR0_DROP_PHYSICAL, | ||
339 | !(filter_flags & FIF_PLCPFAIL)); | ||
340 | rt2x00_set_field32(®, TXRX_CSR0_DROP_CONTROL, | ||
341 | !(filter_flags & FIF_CONTROL)); | ||
342 | rt2x00_set_field32(®, TXRX_CSR0_DROP_NOT_TO_ME, | ||
343 | !(filter_flags & FIF_PROMISC_IN_BSS)); | ||
344 | rt2x00_set_field32(®, TXRX_CSR0_DROP_TO_DS, | ||
345 | !(filter_flags & FIF_PROMISC_IN_BSS)); | ||
346 | rt2x00_set_field32(®, TXRX_CSR0_DROP_VERSION_ERROR, 1); | ||
347 | rt2x00_set_field32(®, TXRX_CSR0_DROP_MULTICAST, | ||
348 | !(filter_flags & FIF_ALLMULTI)); | ||
349 | rt2x00_set_field32(®, TXRX_CSR0_DROP_BROADCAST, 0); | ||
350 | rt2x00_set_field32(®, TXRX_CSR0_DROP_ACK_CTS, | ||
351 | !(filter_flags & FIF_CONTROL)); | ||
352 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR0, reg); | ||
353 | } | ||
354 | |||
324 | static void rt61pci_config_intf(struct rt2x00_dev *rt2x00dev, | 355 | static void rt61pci_config_intf(struct rt2x00_dev *rt2x00dev, |
325 | struct rt2x00_intf *intf, | 356 | struct rt2x00_intf *intf, |
326 | struct rt2x00intf_conf *conf, | 357 | struct rt2x00intf_conf *conf, |
@@ -368,8 +399,8 @@ static void rt61pci_config_intf(struct rt2x00_dev *rt2x00dev, | |||
368 | } | 399 | } |
369 | } | 400 | } |
370 | 401 | ||
371 | static int rt61pci_config_erp(struct rt2x00_dev *rt2x00dev, | 402 | static void rt61pci_config_erp(struct rt2x00_dev *rt2x00dev, |
372 | struct rt2x00lib_erp *erp) | 403 | struct rt2x00lib_erp *erp) |
373 | { | 404 | { |
374 | u32 reg; | 405 | u32 reg; |
375 | 406 | ||
@@ -381,8 +412,6 @@ static int rt61pci_config_erp(struct rt2x00_dev *rt2x00dev, | |||
381 | rt2x00_set_field32(®, TXRX_CSR4_AUTORESPOND_PREAMBLE, | 412 | rt2x00_set_field32(®, TXRX_CSR4_AUTORESPOND_PREAMBLE, |
382 | !!erp->short_preamble); | 413 | !!erp->short_preamble); |
383 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR4, reg); | 414 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR4, reg); |
384 | |||
385 | return 0; | ||
386 | } | 415 | } |
387 | 416 | ||
388 | static void rt61pci_config_phymode(struct rt2x00_dev *rt2x00dev, | 417 | static void rt61pci_config_phymode(struct rt2x00_dev *rt2x00dev, |
@@ -1649,12 +1678,15 @@ static void rt61pci_fill_rxdone(struct queue_entry *entry, | |||
1649 | * the signal is the PLCP value. If it was received with | 1678 | * the signal is the PLCP value. If it was received with |
1650 | * a CCK bitrate the signal is the rate in 100kbit/s. | 1679 | * a CCK bitrate the signal is the rate in 100kbit/s. |
1651 | */ | 1680 | */ |
1652 | rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM); | ||
1653 | rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL); | 1681 | rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL); |
1654 | rxdesc->signal_plcp = rxdesc->ofdm; | ||
1655 | rxdesc->rssi = rt61pci_agc_to_rssi(entry->queue->rt2x00dev, word1); | 1682 | rxdesc->rssi = rt61pci_agc_to_rssi(entry->queue->rt2x00dev, word1); |
1656 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); | 1683 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); |
1657 | rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS); | 1684 | |
1685 | rxdesc->dev_flags = 0; | ||
1686 | if (rt2x00_get_field32(word0, RXD_W0_OFDM)) | ||
1687 | rxdesc->dev_flags |= RXDONE_SIGNAL_PLCP; | ||
1688 | if (rt2x00_get_field32(word0, RXD_W0_MY_BSS)) | ||
1689 | rxdesc->dev_flags |= RXDONE_MY_BSS; | ||
1658 | } | 1690 | } |
1659 | 1691 | ||
1660 | /* | 1692 | /* |
@@ -2281,71 +2313,6 @@ static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
2281 | /* | 2313 | /* |
2282 | * IEEE80211 stack callback functions. | 2314 | * IEEE80211 stack callback functions. |
2283 | */ | 2315 | */ |
2284 | static void rt61pci_configure_filter(struct ieee80211_hw *hw, | ||
2285 | unsigned int changed_flags, | ||
2286 | unsigned int *total_flags, | ||
2287 | int mc_count, | ||
2288 | struct dev_addr_list *mc_list) | ||
2289 | { | ||
2290 | struct rt2x00_dev *rt2x00dev = hw->priv; | ||
2291 | u32 reg; | ||
2292 | |||
2293 | /* | ||
2294 | * Mask off any flags we are going to ignore from | ||
2295 | * the total_flags field. | ||
2296 | */ | ||
2297 | *total_flags &= | ||
2298 | FIF_ALLMULTI | | ||
2299 | FIF_FCSFAIL | | ||
2300 | FIF_PLCPFAIL | | ||
2301 | FIF_CONTROL | | ||
2302 | FIF_OTHER_BSS | | ||
2303 | FIF_PROMISC_IN_BSS; | ||
2304 | |||
2305 | /* | ||
2306 | * Apply some rules to the filters: | ||
2307 | * - Some filters imply different filters to be set. | ||
2308 | * - Some things we can't filter out at all. | ||
2309 | * - Multicast filter seems to kill broadcast traffic so never use it. | ||
2310 | */ | ||
2311 | *total_flags |= FIF_ALLMULTI; | ||
2312 | if (*total_flags & FIF_OTHER_BSS || | ||
2313 | *total_flags & FIF_PROMISC_IN_BSS) | ||
2314 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; | ||
2315 | |||
2316 | /* | ||
2317 | * Check if there is any work left for us. | ||
2318 | */ | ||
2319 | if (rt2x00dev->packet_filter == *total_flags) | ||
2320 | return; | ||
2321 | rt2x00dev->packet_filter = *total_flags; | ||
2322 | |||
2323 | /* | ||
2324 | * Start configuration steps. | ||
2325 | * Note that the version error will always be dropped | ||
2326 | * and broadcast frames will always be accepted since | ||
2327 | * there is no filter for it at this time. | ||
2328 | */ | ||
2329 | rt2x00pci_register_read(rt2x00dev, TXRX_CSR0, ®); | ||
2330 | rt2x00_set_field32(®, TXRX_CSR0_DROP_CRC, | ||
2331 | !(*total_flags & FIF_FCSFAIL)); | ||
2332 | rt2x00_set_field32(®, TXRX_CSR0_DROP_PHYSICAL, | ||
2333 | !(*total_flags & FIF_PLCPFAIL)); | ||
2334 | rt2x00_set_field32(®, TXRX_CSR0_DROP_CONTROL, | ||
2335 | !(*total_flags & FIF_CONTROL)); | ||
2336 | rt2x00_set_field32(®, TXRX_CSR0_DROP_NOT_TO_ME, | ||
2337 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
2338 | rt2x00_set_field32(®, TXRX_CSR0_DROP_TO_DS, | ||
2339 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
2340 | rt2x00_set_field32(®, TXRX_CSR0_DROP_VERSION_ERROR, 1); | ||
2341 | rt2x00_set_field32(®, TXRX_CSR0_DROP_MULTICAST, | ||
2342 | !(*total_flags & FIF_ALLMULTI)); | ||
2343 | rt2x00_set_field32(®, TXRX_CSR0_DROP_BROADCAST, 0); | ||
2344 | rt2x00_set_field32(®, TXRX_CSR0_DROP_ACK_CTS, | ||
2345 | !(*total_flags & FIF_CONTROL)); | ||
2346 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR0, reg); | ||
2347 | } | ||
2348 | |||
2349 | static int rt61pci_set_retry_limit(struct ieee80211_hw *hw, | 2316 | static int rt61pci_set_retry_limit(struct ieee80211_hw *hw, |
2350 | u32 short_retry, u32 long_retry) | 2317 | u32 short_retry, u32 long_retry) |
2351 | { | 2318 | { |
@@ -2454,7 +2421,7 @@ static const struct ieee80211_ops rt61pci_mac80211_ops = { | |||
2454 | .remove_interface = rt2x00mac_remove_interface, | 2421 | .remove_interface = rt2x00mac_remove_interface, |
2455 | .config = rt2x00mac_config, | 2422 | .config = rt2x00mac_config, |
2456 | .config_interface = rt2x00mac_config_interface, | 2423 | .config_interface = rt2x00mac_config_interface, |
2457 | .configure_filter = rt61pci_configure_filter, | 2424 | .configure_filter = rt2x00mac_configure_filter, |
2458 | .get_stats = rt2x00mac_get_stats, | 2425 | .get_stats = rt2x00mac_get_stats, |
2459 | .set_retry_limit = rt61pci_set_retry_limit, | 2426 | .set_retry_limit = rt61pci_set_retry_limit, |
2460 | .bss_info_changed = rt2x00mac_bss_info_changed, | 2427 | .bss_info_changed = rt2x00mac_bss_info_changed, |
@@ -2484,6 +2451,7 @@ static const struct rt2x00lib_ops rt61pci_rt2x00_ops = { | |||
2484 | .write_tx_data = rt2x00pci_write_tx_data, | 2451 | .write_tx_data = rt2x00pci_write_tx_data, |
2485 | .kick_tx_queue = rt61pci_kick_tx_queue, | 2452 | .kick_tx_queue = rt61pci_kick_tx_queue, |
2486 | .fill_rxdone = rt61pci_fill_rxdone, | 2453 | .fill_rxdone = rt61pci_fill_rxdone, |
2454 | .config_filter = rt61pci_config_filter, | ||
2487 | .config_intf = rt61pci_config_intf, | 2455 | .config_intf = rt61pci_config_intf, |
2488 | .config_erp = rt61pci_config_erp, | 2456 | .config_erp = rt61pci_config_erp, |
2489 | .config = rt61pci_config, | 2457 | .config = rt61pci_config, |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 46b040bf62de..187e832bab2e 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -333,6 +333,37 @@ static void rt73usb_led_brightness(struct led_classdev *led_cdev, | |||
333 | /* | 333 | /* |
334 | * Configuration handlers. | 334 | * Configuration handlers. |
335 | */ | 335 | */ |
336 | static void rt73usb_config_filter(struct rt2x00_dev *rt2x00dev, | ||
337 | const unsigned int filter_flags) | ||
338 | { | ||
339 | u32 reg; | ||
340 | |||
341 | /* | ||
342 | * Start configuration steps. | ||
343 | * Note that the version error will always be dropped | ||
344 | * and broadcast frames will always be accepted since | ||
345 | * there is no filter for it at this time. | ||
346 | */ | ||
347 | rt73usb_register_read(rt2x00dev, TXRX_CSR0, ®); | ||
348 | rt2x00_set_field32(®, TXRX_CSR0_DROP_CRC, | ||
349 | !(filter_flags & FIF_FCSFAIL)); | ||
350 | rt2x00_set_field32(®, TXRX_CSR0_DROP_PHYSICAL, | ||
351 | !(filter_flags & FIF_PLCPFAIL)); | ||
352 | rt2x00_set_field32(®, TXRX_CSR0_DROP_CONTROL, | ||
353 | !(filter_flags & FIF_CONTROL)); | ||
354 | rt2x00_set_field32(®, TXRX_CSR0_DROP_NOT_TO_ME, | ||
355 | !(filter_flags & FIF_PROMISC_IN_BSS)); | ||
356 | rt2x00_set_field32(®, TXRX_CSR0_DROP_TO_DS, | ||
357 | !(filter_flags & FIF_PROMISC_IN_BSS)); | ||
358 | rt2x00_set_field32(®, TXRX_CSR0_DROP_VERSION_ERROR, 1); | ||
359 | rt2x00_set_field32(®, TXRX_CSR0_DROP_MULTICAST, | ||
360 | !(filter_flags & FIF_ALLMULTI)); | ||
361 | rt2x00_set_field32(®, TXRX_CSR0_DROP_BROADCAST, 0); | ||
362 | rt2x00_set_field32(®, TXRX_CSR0_DROP_ACK_CTS, | ||
363 | !(filter_flags & FIF_CONTROL)); | ||
364 | rt73usb_register_write(rt2x00dev, TXRX_CSR0, reg); | ||
365 | } | ||
366 | |||
336 | static void rt73usb_config_intf(struct rt2x00_dev *rt2x00dev, | 367 | static void rt73usb_config_intf(struct rt2x00_dev *rt2x00dev, |
337 | struct rt2x00_intf *intf, | 368 | struct rt2x00_intf *intf, |
338 | struct rt2x00intf_conf *conf, | 369 | struct rt2x00intf_conf *conf, |
@@ -380,18 +411,11 @@ static void rt73usb_config_intf(struct rt2x00_dev *rt2x00dev, | |||
380 | } | 411 | } |
381 | } | 412 | } |
382 | 413 | ||
383 | static int rt73usb_config_erp(struct rt2x00_dev *rt2x00dev, | 414 | static void rt73usb_config_erp(struct rt2x00_dev *rt2x00dev, |
384 | struct rt2x00lib_erp *erp) | 415 | struct rt2x00lib_erp *erp) |
385 | { | 416 | { |
386 | u32 reg; | 417 | u32 reg; |
387 | 418 | ||
388 | /* | ||
389 | * When in atomic context, we should let rt2x00lib | ||
390 | * try this configuration again later. | ||
391 | */ | ||
392 | if (in_atomic()) | ||
393 | return -EAGAIN; | ||
394 | |||
395 | rt73usb_register_read(rt2x00dev, TXRX_CSR0, ®); | 419 | rt73usb_register_read(rt2x00dev, TXRX_CSR0, ®); |
396 | rt2x00_set_field32(®, TXRX_CSR0_RX_ACK_TIMEOUT, erp->ack_timeout); | 420 | rt2x00_set_field32(®, TXRX_CSR0_RX_ACK_TIMEOUT, erp->ack_timeout); |
397 | rt73usb_register_write(rt2x00dev, TXRX_CSR0, reg); | 421 | rt73usb_register_write(rt2x00dev, TXRX_CSR0, reg); |
@@ -400,8 +424,6 @@ static int rt73usb_config_erp(struct rt2x00_dev *rt2x00dev, | |||
400 | rt2x00_set_field32(®, TXRX_CSR4_AUTORESPOND_PREAMBLE, | 424 | rt2x00_set_field32(®, TXRX_CSR4_AUTORESPOND_PREAMBLE, |
401 | !!erp->short_preamble); | 425 | !!erp->short_preamble); |
402 | rt73usb_register_write(rt2x00dev, TXRX_CSR4, reg); | 426 | rt73usb_register_write(rt2x00dev, TXRX_CSR4, reg); |
403 | |||
404 | return 0; | ||
405 | } | 427 | } |
406 | 428 | ||
407 | static void rt73usb_config_phymode(struct rt2x00_dev *rt2x00dev, | 429 | static void rt73usb_config_phymode(struct rt2x00_dev *rt2x00dev, |
@@ -1409,12 +1431,15 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry, | |||
1409 | * the signal is the PLCP value. If it was received with | 1431 | * the signal is the PLCP value. If it was received with |
1410 | * a CCK bitrate the signal is the rate in 100kbit/s. | 1432 | * a CCK bitrate the signal is the rate in 100kbit/s. |
1411 | */ | 1433 | */ |
1412 | rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM); | ||
1413 | rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL); | 1434 | rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL); |
1414 | rxdesc->signal_plcp = rxdesc->ofdm; | ||
1415 | rxdesc->rssi = rt73usb_agc_to_rssi(entry->queue->rt2x00dev, word1); | 1435 | rxdesc->rssi = rt73usb_agc_to_rssi(entry->queue->rt2x00dev, word1); |
1416 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); | 1436 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); |
1417 | rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS); | 1437 | |
1438 | rxdesc->dev_flags = 0; | ||
1439 | if (rt2x00_get_field32(word0, RXD_W0_OFDM)) | ||
1440 | rxdesc->dev_flags |= RXDONE_SIGNAL_PLCP; | ||
1441 | if (rt2x00_get_field32(word0, RXD_W0_MY_BSS)) | ||
1442 | rxdesc->dev_flags |= RXDONE_MY_BSS; | ||
1418 | 1443 | ||
1419 | /* | 1444 | /* |
1420 | * Adjust the skb memory window to the frame boundaries. | 1445 | * Adjust the skb memory window to the frame boundaries. |
@@ -1869,6 +1894,7 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1869 | * This device requires firmware. | 1894 | * This device requires firmware. |
1870 | */ | 1895 | */ |
1871 | __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags); | 1896 | __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags); |
1897 | __set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags); | ||
1872 | 1898 | ||
1873 | /* | 1899 | /* |
1874 | * Set the rssi offset. | 1900 | * Set the rssi offset. |
@@ -1881,80 +1907,6 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1881 | /* | 1907 | /* |
1882 | * IEEE80211 stack callback functions. | 1908 | * IEEE80211 stack callback functions. |
1883 | */ | 1909 | */ |
1884 | static void rt73usb_configure_filter(struct ieee80211_hw *hw, | ||
1885 | unsigned int changed_flags, | ||
1886 | unsigned int *total_flags, | ||
1887 | int mc_count, | ||
1888 | struct dev_addr_list *mc_list) | ||
1889 | { | ||
1890 | struct rt2x00_dev *rt2x00dev = hw->priv; | ||
1891 | u32 reg; | ||
1892 | |||
1893 | /* | ||
1894 | * Mask off any flags we are going to ignore from | ||
1895 | * the total_flags field. | ||
1896 | */ | ||
1897 | *total_flags &= | ||
1898 | FIF_ALLMULTI | | ||
1899 | FIF_FCSFAIL | | ||
1900 | FIF_PLCPFAIL | | ||
1901 | FIF_CONTROL | | ||
1902 | FIF_OTHER_BSS | | ||
1903 | FIF_PROMISC_IN_BSS; | ||
1904 | |||
1905 | /* | ||
1906 | * Apply some rules to the filters: | ||
1907 | * - Some filters imply different filters to be set. | ||
1908 | * - Some things we can't filter out at all. | ||
1909 | * - Multicast filter seems to kill broadcast traffic so never use it. | ||
1910 | */ | ||
1911 | *total_flags |= FIF_ALLMULTI; | ||
1912 | if (*total_flags & FIF_OTHER_BSS || | ||
1913 | *total_flags & FIF_PROMISC_IN_BSS) | ||
1914 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; | ||
1915 | |||
1916 | /* | ||
1917 | * Check if there is any work left for us. | ||
1918 | */ | ||
1919 | if (rt2x00dev->packet_filter == *total_flags) | ||
1920 | return; | ||
1921 | rt2x00dev->packet_filter = *total_flags; | ||
1922 | |||
1923 | /* | ||
1924 | * When in atomic context, reschedule and let rt2x00lib | ||
1925 | * call this function again. | ||
1926 | */ | ||
1927 | if (in_atomic()) { | ||
1928 | queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->filter_work); | ||
1929 | return; | ||
1930 | } | ||
1931 | |||
1932 | /* | ||
1933 | * Start configuration steps. | ||
1934 | * Note that the version error will always be dropped | ||
1935 | * and broadcast frames will always be accepted since | ||
1936 | * there is no filter for it at this time. | ||
1937 | */ | ||
1938 | rt73usb_register_read(rt2x00dev, TXRX_CSR0, ®); | ||
1939 | rt2x00_set_field32(®, TXRX_CSR0_DROP_CRC, | ||
1940 | !(*total_flags & FIF_FCSFAIL)); | ||
1941 | rt2x00_set_field32(®, TXRX_CSR0_DROP_PHYSICAL, | ||
1942 | !(*total_flags & FIF_PLCPFAIL)); | ||
1943 | rt2x00_set_field32(®, TXRX_CSR0_DROP_CONTROL, | ||
1944 | !(*total_flags & FIF_CONTROL)); | ||
1945 | rt2x00_set_field32(®, TXRX_CSR0_DROP_NOT_TO_ME, | ||
1946 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
1947 | rt2x00_set_field32(®, TXRX_CSR0_DROP_TO_DS, | ||
1948 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
1949 | rt2x00_set_field32(®, TXRX_CSR0_DROP_VERSION_ERROR, 1); | ||
1950 | rt2x00_set_field32(®, TXRX_CSR0_DROP_MULTICAST, | ||
1951 | !(*total_flags & FIF_ALLMULTI)); | ||
1952 | rt2x00_set_field32(®, TXRX_CSR0_DROP_BROADCAST, 0); | ||
1953 | rt2x00_set_field32(®, TXRX_CSR0_DROP_ACK_CTS, | ||
1954 | !(*total_flags & FIF_CONTROL)); | ||
1955 | rt73usb_register_write(rt2x00dev, TXRX_CSR0, reg); | ||
1956 | } | ||
1957 | |||
1958 | static int rt73usb_set_retry_limit(struct ieee80211_hw *hw, | 1910 | static int rt73usb_set_retry_limit(struct ieee80211_hw *hw, |
1959 | u32 short_retry, u32 long_retry) | 1911 | u32 short_retry, u32 long_retry) |
1960 | { | 1912 | { |
@@ -2064,7 +2016,7 @@ static const struct ieee80211_ops rt73usb_mac80211_ops = { | |||
2064 | .remove_interface = rt2x00mac_remove_interface, | 2016 | .remove_interface = rt2x00mac_remove_interface, |
2065 | .config = rt2x00mac_config, | 2017 | .config = rt2x00mac_config, |
2066 | .config_interface = rt2x00mac_config_interface, | 2018 | .config_interface = rt2x00mac_config_interface, |
2067 | .configure_filter = rt73usb_configure_filter, | 2019 | .configure_filter = rt2x00mac_configure_filter, |
2068 | .get_stats = rt2x00mac_get_stats, | 2020 | .get_stats = rt2x00mac_get_stats, |
2069 | .set_retry_limit = rt73usb_set_retry_limit, | 2021 | .set_retry_limit = rt73usb_set_retry_limit, |
2070 | .bss_info_changed = rt2x00mac_bss_info_changed, | 2022 | .bss_info_changed = rt2x00mac_bss_info_changed, |
@@ -2093,6 +2045,7 @@ static const struct rt2x00lib_ops rt73usb_rt2x00_ops = { | |||
2093 | .get_tx_data_len = rt73usb_get_tx_data_len, | 2045 | .get_tx_data_len = rt73usb_get_tx_data_len, |
2094 | .kick_tx_queue = rt73usb_kick_tx_queue, | 2046 | .kick_tx_queue = rt73usb_kick_tx_queue, |
2095 | .fill_rxdone = rt73usb_fill_rxdone, | 2047 | .fill_rxdone = rt73usb_fill_rxdone, |
2048 | .config_filter = rt73usb_config_filter, | ||
2096 | .config_intf = rt73usb_config_intf, | 2049 | .config_intf = rt73usb_config_intf, |
2097 | .config_erp = rt73usb_config_erp, | 2050 | .config_erp = rt73usb_config_erp, |
2098 | .config = rt73usb_config, | 2051 | .config = rt73usb_config, |