diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-03-25 09:13:18 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-25 16:42:00 -0400 |
commit | 3a643d244f09fa1fdd25d48a56a073c1a69583ee (patch) | |
tree | 3cd8423f72f37d66fdd2738409f72779da3911fc /drivers/net/wireless/rt2x00/rt2400pci.c | |
parent | 866a05038481d77cac6fc0186250b4c44e691b42 (diff) |
rt2x00: Fix in_atomic() usage
rt73usb and rt2500usb used in_atomic to determine
if a configuration step should be rescheduled or not.
Since in_atomic() is not a valid method to determine
if sleeping is allowed we should fix the way this is handled
by adding a new flag to rt2x00.
In addition mark LED class support for the drivers broken
since that also uses the broken in_atomic() method but
so far no solution exists to have LED triggers work only
in scheduled context.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2400pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 92 |
1 files changed, 29 insertions, 63 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index c58b1c0abc3c..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, |
@@ -1397,64 +1420,6 @@ static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1397 | /* | 1420 | /* |
1398 | * IEEE80211 stack callback functions. | 1421 | * IEEE80211 stack callback functions. |
1399 | */ | 1422 | */ |
1400 | static void rt2400pci_configure_filter(struct ieee80211_hw *hw, | ||
1401 | unsigned int changed_flags, | ||
1402 | unsigned int *total_flags, | ||
1403 | int mc_count, | ||
1404 | struct dev_addr_list *mc_list) | ||
1405 | { | ||
1406 | struct rt2x00_dev *rt2x00dev = hw->priv; | ||
1407 | u32 reg; | ||
1408 | |||
1409 | /* | ||
1410 | * Mask off any flags we are going to ignore from | ||
1411 | * the total_flags field. | ||
1412 | */ | ||
1413 | *total_flags &= | ||
1414 | FIF_ALLMULTI | | ||
1415 | FIF_FCSFAIL | | ||
1416 | FIF_PLCPFAIL | | ||
1417 | FIF_CONTROL | | ||
1418 | FIF_OTHER_BSS | | ||
1419 | FIF_PROMISC_IN_BSS; | ||
1420 | |||
1421 | /* | ||
1422 | * Apply some rules to the filters: | ||
1423 | * - Some filters imply different filters to be set. | ||
1424 | * - Some things we can't filter out at all. | ||
1425 | */ | ||
1426 | *total_flags |= FIF_ALLMULTI; | ||
1427 | if (*total_flags & FIF_OTHER_BSS || | ||
1428 | *total_flags & FIF_PROMISC_IN_BSS) | ||
1429 | *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; | ||
1430 | |||
1431 | /* | ||
1432 | * Check if there is any work left for us. | ||
1433 | */ | ||
1434 | if (rt2x00dev->packet_filter == *total_flags) | ||
1435 | return; | ||
1436 | rt2x00dev->packet_filter = *total_flags; | ||
1437 | |||
1438 | /* | ||
1439 | * Start configuration steps. | ||
1440 | * Note that the version error will always be dropped | ||
1441 | * since there is no filter for it at this time. | ||
1442 | */ | ||
1443 | rt2x00pci_register_read(rt2x00dev, RXCSR0, ®); | ||
1444 | rt2x00_set_field32(®, RXCSR0_DROP_CRC, | ||
1445 | !(*total_flags & FIF_FCSFAIL)); | ||
1446 | rt2x00_set_field32(®, RXCSR0_DROP_PHYSICAL, | ||
1447 | !(*total_flags & FIF_PLCPFAIL)); | ||
1448 | rt2x00_set_field32(®, RXCSR0_DROP_CONTROL, | ||
1449 | !(*total_flags & FIF_CONTROL)); | ||
1450 | rt2x00_set_field32(®, RXCSR0_DROP_NOT_TO_ME, | ||
1451 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
1452 | rt2x00_set_field32(®, RXCSR0_DROP_TODS, | ||
1453 | !(*total_flags & FIF_PROMISC_IN_BSS)); | ||
1454 | rt2x00_set_field32(®, RXCSR0_DROP_VERSION_ERROR, 1); | ||
1455 | rt2x00pci_register_write(rt2x00dev, RXCSR0, reg); | ||
1456 | } | ||
1457 | |||
1458 | static int rt2400pci_set_retry_limit(struct ieee80211_hw *hw, | 1423 | static int rt2400pci_set_retry_limit(struct ieee80211_hw *hw, |
1459 | u32 short_retry, u32 long_retry) | 1424 | u32 short_retry, u32 long_retry) |
1460 | { | 1425 | { |
@@ -1580,7 +1545,7 @@ static const struct ieee80211_ops rt2400pci_mac80211_ops = { | |||
1580 | .remove_interface = rt2x00mac_remove_interface, | 1545 | .remove_interface = rt2x00mac_remove_interface, |
1581 | .config = rt2x00mac_config, | 1546 | .config = rt2x00mac_config, |
1582 | .config_interface = rt2x00mac_config_interface, | 1547 | .config_interface = rt2x00mac_config_interface, |
1583 | .configure_filter = rt2400pci_configure_filter, | 1548 | .configure_filter = rt2x00mac_configure_filter, |
1584 | .get_stats = rt2x00mac_get_stats, | 1549 | .get_stats = rt2x00mac_get_stats, |
1585 | .set_retry_limit = rt2400pci_set_retry_limit, | 1550 | .set_retry_limit = rt2400pci_set_retry_limit, |
1586 | .bss_info_changed = rt2x00mac_bss_info_changed, | 1551 | .bss_info_changed = rt2x00mac_bss_info_changed, |
@@ -1608,6 +1573,7 @@ static const struct rt2x00lib_ops rt2400pci_rt2x00_ops = { | |||
1608 | .write_tx_data = rt2x00pci_write_tx_data, | 1573 | .write_tx_data = rt2x00pci_write_tx_data, |
1609 | .kick_tx_queue = rt2400pci_kick_tx_queue, | 1574 | .kick_tx_queue = rt2400pci_kick_tx_queue, |
1610 | .fill_rxdone = rt2400pci_fill_rxdone, | 1575 | .fill_rxdone = rt2400pci_fill_rxdone, |
1576 | .config_filter = rt2400pci_config_filter, | ||
1611 | .config_intf = rt2400pci_config_intf, | 1577 | .config_intf = rt2400pci_config_intf, |
1612 | .config_erp = rt2400pci_config_erp, | 1578 | .config_erp = rt2400pci_config_erp, |
1613 | .config = rt2400pci_config, | 1579 | .config = rt2400pci_config, |