diff options
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/airo.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ar9170/hw.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ar9170/usb.c | 114 | ||||
-rw-r--r-- | drivers/net/wireless/at76c50x-usb.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/recv.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/b43/dma.c | 50 | ||||
-rw-r--r-- | drivers/net/wireless/b43/main.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_common.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_common.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/rx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/hw.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54common.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54spi.c | 25 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54usb.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00pci.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 2 |
21 files changed, 199 insertions, 106 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index f21a6171c691..c36d3a3d655f 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -6713,11 +6713,11 @@ static int airo_set_auth(struct net_device *dev, | |||
6713 | local->config.authType = AUTH_ENCRYPT; | 6713 | local->config.authType = AUTH_ENCRYPT; |
6714 | } else | 6714 | } else |
6715 | return -EINVAL; | 6715 | return -EINVAL; |
6716 | break; | ||
6717 | 6716 | ||
6718 | /* Commit the changes to flags if needed */ | 6717 | /* Commit the changes to flags if needed */ |
6719 | if (local->config.authType != currentAuthType) | 6718 | if (local->config.authType != currentAuthType) |
6720 | set_bit (FLAG_COMMIT, &local->flags); | 6719 | set_bit (FLAG_COMMIT, &local->flags); |
6720 | break; | ||
6721 | } | 6721 | } |
6722 | 6722 | ||
6723 | case IW_AUTH_WPA_ENABLED: | 6723 | case IW_AUTH_WPA_ENABLED: |
diff --git a/drivers/net/wireless/ar9170/hw.h b/drivers/net/wireless/ar9170/hw.h index 13091bd9d815..53e250a4278f 100644 --- a/drivers/net/wireless/ar9170/hw.h +++ b/drivers/net/wireless/ar9170/hw.h | |||
@@ -310,7 +310,7 @@ struct ar9170_tx_control { | |||
310 | 310 | ||
311 | struct ar9170_rx_head { | 311 | struct ar9170_rx_head { |
312 | u8 plcp[12]; | 312 | u8 plcp[12]; |
313 | }; | 313 | } __packed; |
314 | 314 | ||
315 | struct ar9170_rx_tail { | 315 | struct ar9170_rx_tail { |
316 | union { | 316 | union { |
@@ -318,16 +318,16 @@ struct ar9170_rx_tail { | |||
318 | u8 rssi_ant0, rssi_ant1, rssi_ant2, | 318 | u8 rssi_ant0, rssi_ant1, rssi_ant2, |
319 | rssi_ant0x, rssi_ant1x, rssi_ant2x, | 319 | rssi_ant0x, rssi_ant1x, rssi_ant2x, |
320 | rssi_combined; | 320 | rssi_combined; |
321 | }; | 321 | } __packed; |
322 | u8 rssi[7]; | 322 | u8 rssi[7]; |
323 | }; | 323 | } __packed; |
324 | 324 | ||
325 | u8 evm_stream0[6], evm_stream1[6]; | 325 | u8 evm_stream0[6], evm_stream1[6]; |
326 | u8 phy_err; | 326 | u8 phy_err; |
327 | u8 SAidx, DAidx; | 327 | u8 SAidx, DAidx; |
328 | u8 error; | 328 | u8 error; |
329 | u8 status; | 329 | u8 status; |
330 | }; | 330 | } __packed; |
331 | 331 | ||
332 | #define AR9170_ENC_ALG_NONE 0x0 | 332 | #define AR9170_ENC_ALG_NONE 0x0 |
333 | #define AR9170_ENC_ALG_WEP64 0x1 | 333 | #define AR9170_ENC_ALG_WEP64 0x1 |
diff --git a/drivers/net/wireless/ar9170/usb.c b/drivers/net/wireless/ar9170/usb.c index ad296840893e..fddda477095c 100644 --- a/drivers/net/wireless/ar9170/usb.c +++ b/drivers/net/wireless/ar9170/usb.c | |||
@@ -59,6 +59,8 @@ static struct usb_device_id ar9170_usb_ids[] = { | |||
59 | { USB_DEVICE(0x0cf3, 0x9170) }, | 59 | { USB_DEVICE(0x0cf3, 0x9170) }, |
60 | /* Atheros TG121N */ | 60 | /* Atheros TG121N */ |
61 | { USB_DEVICE(0x0cf3, 0x1001) }, | 61 | { USB_DEVICE(0x0cf3, 0x1001) }, |
62 | /* Cace Airpcap NX */ | ||
63 | { USB_DEVICE(0xcace, 0x0300) }, | ||
62 | /* D-Link DWA 160A */ | 64 | /* D-Link DWA 160A */ |
63 | { USB_DEVICE(0x07d1, 0x3c10) }, | 65 | { USB_DEVICE(0x07d1, 0x3c10) }, |
64 | /* Netgear WNDA3100 */ | 66 | /* Netgear WNDA3100 */ |
@@ -67,6 +69,8 @@ static struct usb_device_id ar9170_usb_ids[] = { | |||
67 | { USB_DEVICE(0x0846, 0x9001) }, | 69 | { USB_DEVICE(0x0846, 0x9001) }, |
68 | /* Zydas ZD1221 */ | 70 | /* Zydas ZD1221 */ |
69 | { USB_DEVICE(0x0ace, 0x1221) }, | 71 | { USB_DEVICE(0x0ace, 0x1221) }, |
72 | /* ZyXEL NWD271N */ | ||
73 | { USB_DEVICE(0x0586, 0x3417) }, | ||
70 | /* Z-Com UB81 BG */ | 74 | /* Z-Com UB81 BG */ |
71 | { USB_DEVICE(0x0cde, 0x0023) }, | 75 | { USB_DEVICE(0x0cde, 0x0023) }, |
72 | /* Z-Com UB82 ABG */ | 76 | /* Z-Com UB82 ABG */ |
@@ -619,6 +623,39 @@ static int ar9170_usb_open(struct ar9170 *ar) | |||
619 | return 0; | 623 | return 0; |
620 | } | 624 | } |
621 | 625 | ||
626 | static int ar9170_usb_init_device(struct ar9170_usb *aru) | ||
627 | { | ||
628 | int err; | ||
629 | |||
630 | err = ar9170_usb_alloc_rx_irq_urb(aru); | ||
631 | if (err) | ||
632 | goto err_out; | ||
633 | |||
634 | err = ar9170_usb_alloc_rx_bulk_urbs(aru); | ||
635 | if (err) | ||
636 | goto err_unrx; | ||
637 | |||
638 | err = ar9170_usb_upload_firmware(aru); | ||
639 | if (err) { | ||
640 | err = ar9170_echo_test(&aru->common, 0x60d43110); | ||
641 | if (err) { | ||
642 | /* force user invention, by disabling the device */ | ||
643 | err = usb_driver_set_configuration(aru->udev, -1); | ||
644 | dev_err(&aru->udev->dev, "device is in a bad state. " | ||
645 | "please reconnect it!\n"); | ||
646 | goto err_unrx; | ||
647 | } | ||
648 | } | ||
649 | |||
650 | return 0; | ||
651 | |||
652 | err_unrx: | ||
653 | ar9170_usb_cancel_urbs(aru); | ||
654 | |||
655 | err_out: | ||
656 | return err; | ||
657 | } | ||
658 | |||
622 | static int ar9170_usb_probe(struct usb_interface *intf, | 659 | static int ar9170_usb_probe(struct usb_interface *intf, |
623 | const struct usb_device_id *id) | 660 | const struct usb_device_id *id) |
624 | { | 661 | { |
@@ -654,32 +691,16 @@ static int ar9170_usb_probe(struct usb_interface *intf, | |||
654 | 691 | ||
655 | err = ar9170_usb_reset(aru); | 692 | err = ar9170_usb_reset(aru); |
656 | if (err) | 693 | if (err) |
657 | goto err_unlock; | 694 | goto err_freehw; |
658 | 695 | ||
659 | err = ar9170_usb_request_firmware(aru); | 696 | err = ar9170_usb_request_firmware(aru); |
660 | if (err) | 697 | if (err) |
661 | goto err_unlock; | 698 | goto err_freehw; |
662 | 699 | ||
663 | err = ar9170_usb_alloc_rx_irq_urb(aru); | 700 | err = ar9170_usb_init_device(aru); |
664 | if (err) | 701 | if (err) |
665 | goto err_freefw; | 702 | goto err_freefw; |
666 | 703 | ||
667 | err = ar9170_usb_alloc_rx_bulk_urbs(aru); | ||
668 | if (err) | ||
669 | goto err_unrx; | ||
670 | |||
671 | err = ar9170_usb_upload_firmware(aru); | ||
672 | if (err) { | ||
673 | err = ar9170_echo_test(&aru->common, 0x60d43110); | ||
674 | if (err) { | ||
675 | /* force user invention, by disabling the device */ | ||
676 | err = usb_driver_set_configuration(aru->udev, -1); | ||
677 | dev_err(&aru->udev->dev, "device is in a bad state. " | ||
678 | "please reconnect it!\n"); | ||
679 | goto err_unrx; | ||
680 | } | ||
681 | } | ||
682 | |||
683 | err = ar9170_usb_open(ar); | 704 | err = ar9170_usb_open(ar); |
684 | if (err) | 705 | if (err) |
685 | goto err_unrx; | 706 | goto err_unrx; |
@@ -699,7 +720,7 @@ err_freefw: | |||
699 | release_firmware(aru->init_values); | 720 | release_firmware(aru->init_values); |
700 | release_firmware(aru->firmware); | 721 | release_firmware(aru->firmware); |
701 | 722 | ||
702 | err_unlock: | 723 | err_freehw: |
703 | usb_set_intfdata(intf, NULL); | 724 | usb_set_intfdata(intf, NULL); |
704 | usb_put_dev(udev); | 725 | usb_put_dev(udev); |
705 | ieee80211_free_hw(ar->hw); | 726 | ieee80211_free_hw(ar->hw); |
@@ -726,12 +747,65 @@ static void ar9170_usb_disconnect(struct usb_interface *intf) | |||
726 | ieee80211_free_hw(aru->common.hw); | 747 | ieee80211_free_hw(aru->common.hw); |
727 | } | 748 | } |
728 | 749 | ||
750 | #ifdef CONFIG_PM | ||
751 | static int ar9170_suspend(struct usb_interface *intf, | ||
752 | pm_message_t message) | ||
753 | { | ||
754 | struct ar9170_usb *aru = usb_get_intfdata(intf); | ||
755 | |||
756 | if (!aru) | ||
757 | return -ENODEV; | ||
758 | |||
759 | aru->common.state = AR9170_IDLE; | ||
760 | ar9170_usb_cancel_urbs(aru); | ||
761 | |||
762 | return 0; | ||
763 | } | ||
764 | |||
765 | static int ar9170_resume(struct usb_interface *intf) | ||
766 | { | ||
767 | struct ar9170_usb *aru = usb_get_intfdata(intf); | ||
768 | int err; | ||
769 | |||
770 | if (!aru) | ||
771 | return -ENODEV; | ||
772 | |||
773 | usb_unpoison_anchored_urbs(&aru->rx_submitted); | ||
774 | usb_unpoison_anchored_urbs(&aru->tx_submitted); | ||
775 | |||
776 | /* | ||
777 | * FIXME: firmware upload will fail on resume. | ||
778 | * but this is better than a hang! | ||
779 | */ | ||
780 | |||
781 | err = ar9170_usb_init_device(aru); | ||
782 | if (err) | ||
783 | goto err_unrx; | ||
784 | |||
785 | err = ar9170_usb_open(&aru->common); | ||
786 | if (err) | ||
787 | goto err_unrx; | ||
788 | |||
789 | return 0; | ||
790 | |||
791 | err_unrx: | ||
792 | aru->common.state = AR9170_IDLE; | ||
793 | ar9170_usb_cancel_urbs(aru); | ||
794 | |||
795 | return err; | ||
796 | } | ||
797 | #endif /* CONFIG_PM */ | ||
798 | |||
729 | static struct usb_driver ar9170_driver = { | 799 | static struct usb_driver ar9170_driver = { |
730 | .name = "ar9170usb", | 800 | .name = "ar9170usb", |
731 | .probe = ar9170_usb_probe, | 801 | .probe = ar9170_usb_probe, |
732 | .disconnect = ar9170_usb_disconnect, | 802 | .disconnect = ar9170_usb_disconnect, |
733 | .id_table = ar9170_usb_ids, | 803 | .id_table = ar9170_usb_ids, |
734 | .soft_unbind = 1, | 804 | .soft_unbind = 1, |
805 | #ifdef CONFIG_PM | ||
806 | .suspend = ar9170_suspend, | ||
807 | .resume = ar9170_resume, | ||
808 | #endif /* CONFIG_PM */ | ||
735 | }; | 809 | }; |
736 | 810 | ||
737 | static int __init ar9170_init(void) | 811 | static int __init ar9170_init(void) |
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c index c220c9758d09..69248ded5102 100644 --- a/drivers/net/wireless/at76c50x-usb.c +++ b/drivers/net/wireless/at76c50x-usb.c | |||
@@ -250,6 +250,8 @@ static struct usb_device_id dev_table[] = { | |||
250 | { USB_DEVICE(0x03eb, 0x7617), USB_DEVICE_DATA(BOARD_505A) }, | 250 | { USB_DEVICE(0x03eb, 0x7617), USB_DEVICE_DATA(BOARD_505A) }, |
251 | /* Siemens Gigaset USB WLAN Adapter 11 */ | 251 | /* Siemens Gigaset USB WLAN Adapter 11 */ |
252 | { USB_DEVICE(0x1690, 0x0701), USB_DEVICE_DATA(BOARD_505A) }, | 252 | { USB_DEVICE(0x1690, 0x0701), USB_DEVICE_DATA(BOARD_505A) }, |
253 | /* OQO Model 01+ Internal Wi-Fi */ | ||
254 | { USB_DEVICE(0x1557, 0x0002), USB_DEVICE_DATA(BOARD_505A) }, | ||
253 | /* | 255 | /* |
254 | * at76c505amx-rfmd | 256 | * at76c505amx-rfmd |
255 | */ | 257 | */ |
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c index 71cb18d6757d..dd1f30156740 100644 --- a/drivers/net/wireless/ath9k/recv.c +++ b/drivers/net/wireless/ath9k/recv.c | |||
@@ -493,6 +493,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
493 | int hdrlen, padsize, retval; | 493 | int hdrlen, padsize, retval; |
494 | bool decrypt_error = false; | 494 | bool decrypt_error = false; |
495 | u8 keyix; | 495 | u8 keyix; |
496 | __le16 fc; | ||
496 | 497 | ||
497 | spin_lock_bh(&sc->rx.rxbuflock); | 498 | spin_lock_bh(&sc->rx.rxbuflock); |
498 | 499 | ||
@@ -606,6 +607,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
606 | /* see if any padding is done by the hw and remove it */ | 607 | /* see if any padding is done by the hw and remove it */ |
607 | hdr = (struct ieee80211_hdr *)skb->data; | 608 | hdr = (struct ieee80211_hdr *)skb->data; |
608 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 609 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
610 | fc = hdr->frame_control; | ||
609 | 611 | ||
610 | /* The MAC header is padded to have 32-bit boundary if the | 612 | /* The MAC header is padded to have 32-bit boundary if the |
611 | * packet payload is non-zero. The general calculation for | 613 | * packet payload is non-zero. The general calculation for |
@@ -690,7 +692,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
690 | sc->rx.rxotherant = 0; | 692 | sc->rx.rxotherant = 0; |
691 | } | 693 | } |
692 | 694 | ||
693 | if (ieee80211_is_beacon(hdr->frame_control) && | 695 | if (ieee80211_is_beacon(fc) && |
694 | (sc->sc_flags & SC_OP_WAIT_FOR_BEACON)) { | 696 | (sc->sc_flags & SC_OP_WAIT_FOR_BEACON)) { |
695 | sc->sc_flags &= ~SC_OP_WAIT_FOR_BEACON; | 697 | sc->sc_flags &= ~SC_OP_WAIT_FOR_BEACON; |
696 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP); | 698 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP); |
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index e228c1de6e11..eae680b53052 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c | |||
@@ -555,11 +555,32 @@ address_error: | |||
555 | return 1; | 555 | return 1; |
556 | } | 556 | } |
557 | 557 | ||
558 | static bool b43_rx_buffer_is_poisoned(struct b43_dmaring *ring, struct sk_buff *skb) | ||
559 | { | ||
560 | unsigned char *f = skb->data + ring->frameoffset; | ||
561 | |||
562 | return ((f[0] & f[1] & f[2] & f[3] & f[4] & f[5] & f[6] & f[7]) == 0xFF); | ||
563 | } | ||
564 | |||
565 | static void b43_poison_rx_buffer(struct b43_dmaring *ring, struct sk_buff *skb) | ||
566 | { | ||
567 | struct b43_rxhdr_fw4 *rxhdr; | ||
568 | unsigned char *frame; | ||
569 | |||
570 | /* This poisons the RX buffer to detect DMA failures. */ | ||
571 | |||
572 | rxhdr = (struct b43_rxhdr_fw4 *)(skb->data); | ||
573 | rxhdr->frame_len = 0; | ||
574 | |||
575 | B43_WARN_ON(ring->rx_buffersize < ring->frameoffset + sizeof(struct b43_plcp_hdr6) + 2); | ||
576 | frame = skb->data + ring->frameoffset; | ||
577 | memset(frame, 0xFF, sizeof(struct b43_plcp_hdr6) + 2 /* padding */); | ||
578 | } | ||
579 | |||
558 | static int setup_rx_descbuffer(struct b43_dmaring *ring, | 580 | static int setup_rx_descbuffer(struct b43_dmaring *ring, |
559 | struct b43_dmadesc_generic *desc, | 581 | struct b43_dmadesc_generic *desc, |
560 | struct b43_dmadesc_meta *meta, gfp_t gfp_flags) | 582 | struct b43_dmadesc_meta *meta, gfp_t gfp_flags) |
561 | { | 583 | { |
562 | struct b43_rxhdr_fw4 *rxhdr; | ||
563 | dma_addr_t dmaaddr; | 584 | dma_addr_t dmaaddr; |
564 | struct sk_buff *skb; | 585 | struct sk_buff *skb; |
565 | 586 | ||
@@ -568,6 +589,7 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring, | |||
568 | skb = __dev_alloc_skb(ring->rx_buffersize, gfp_flags); | 589 | skb = __dev_alloc_skb(ring->rx_buffersize, gfp_flags); |
569 | if (unlikely(!skb)) | 590 | if (unlikely(!skb)) |
570 | return -ENOMEM; | 591 | return -ENOMEM; |
592 | b43_poison_rx_buffer(ring, skb); | ||
571 | dmaaddr = map_descbuffer(ring, skb->data, ring->rx_buffersize, 0); | 593 | dmaaddr = map_descbuffer(ring, skb->data, ring->rx_buffersize, 0); |
572 | if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) { | 594 | if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) { |
573 | /* ugh. try to realloc in zone_dma */ | 595 | /* ugh. try to realloc in zone_dma */ |
@@ -578,6 +600,7 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring, | |||
578 | skb = __dev_alloc_skb(ring->rx_buffersize, gfp_flags); | 600 | skb = __dev_alloc_skb(ring->rx_buffersize, gfp_flags); |
579 | if (unlikely(!skb)) | 601 | if (unlikely(!skb)) |
580 | return -ENOMEM; | 602 | return -ENOMEM; |
603 | b43_poison_rx_buffer(ring, skb); | ||
581 | dmaaddr = map_descbuffer(ring, skb->data, | 604 | dmaaddr = map_descbuffer(ring, skb->data, |
582 | ring->rx_buffersize, 0); | 605 | ring->rx_buffersize, 0); |
583 | if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) { | 606 | if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) { |
@@ -592,9 +615,6 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring, | |||
592 | ring->ops->fill_descriptor(ring, desc, dmaaddr, | 615 | ring->ops->fill_descriptor(ring, desc, dmaaddr, |
593 | ring->rx_buffersize, 0, 0, 0); | 616 | ring->rx_buffersize, 0, 0, 0); |
594 | 617 | ||
595 | rxhdr = (struct b43_rxhdr_fw4 *)(skb->data); | ||
596 | rxhdr->frame_len = 0; | ||
597 | |||
598 | return 0; | 618 | return 0; |
599 | } | 619 | } |
600 | 620 | ||
@@ -1483,12 +1503,17 @@ static void dma_rx(struct b43_dmaring *ring, int *slot) | |||
1483 | len = le16_to_cpu(rxhdr->frame_len); | 1503 | len = le16_to_cpu(rxhdr->frame_len); |
1484 | } while (len == 0 && i++ < 5); | 1504 | } while (len == 0 && i++ < 5); |
1485 | if (unlikely(len == 0)) { | 1505 | if (unlikely(len == 0)) { |
1486 | /* recycle the descriptor buffer. */ | 1506 | dmaaddr = meta->dmaaddr; |
1487 | sync_descbuffer_for_device(ring, meta->dmaaddr, | 1507 | goto drop_recycle_buffer; |
1488 | ring->rx_buffersize); | ||
1489 | goto drop; | ||
1490 | } | 1508 | } |
1491 | } | 1509 | } |
1510 | if (unlikely(b43_rx_buffer_is_poisoned(ring, skb))) { | ||
1511 | /* Something went wrong with the DMA. | ||
1512 | * The device did not touch the buffer and did not overwrite the poison. */ | ||
1513 | b43dbg(ring->dev->wl, "DMA RX: Dropping poisoned buffer.\n"); | ||
1514 | dmaaddr = meta->dmaaddr; | ||
1515 | goto drop_recycle_buffer; | ||
1516 | } | ||
1492 | if (unlikely(len > ring->rx_buffersize)) { | 1517 | if (unlikely(len > ring->rx_buffersize)) { |
1493 | /* The data did not fit into one descriptor buffer | 1518 | /* The data did not fit into one descriptor buffer |
1494 | * and is split over multiple buffers. | 1519 | * and is split over multiple buffers. |
@@ -1501,6 +1526,7 @@ static void dma_rx(struct b43_dmaring *ring, int *slot) | |||
1501 | while (1) { | 1526 | while (1) { |
1502 | desc = ops->idx2desc(ring, *slot, &meta); | 1527 | desc = ops->idx2desc(ring, *slot, &meta); |
1503 | /* recycle the descriptor buffer. */ | 1528 | /* recycle the descriptor buffer. */ |
1529 | b43_poison_rx_buffer(ring, meta->skb); | ||
1504 | sync_descbuffer_for_device(ring, meta->dmaaddr, | 1530 | sync_descbuffer_for_device(ring, meta->dmaaddr, |
1505 | ring->rx_buffersize); | 1531 | ring->rx_buffersize); |
1506 | *slot = next_slot(ring, *slot); | 1532 | *slot = next_slot(ring, *slot); |
@@ -1519,8 +1545,7 @@ static void dma_rx(struct b43_dmaring *ring, int *slot) | |||
1519 | err = setup_rx_descbuffer(ring, desc, meta, GFP_ATOMIC); | 1545 | err = setup_rx_descbuffer(ring, desc, meta, GFP_ATOMIC); |
1520 | if (unlikely(err)) { | 1546 | if (unlikely(err)) { |
1521 | b43dbg(ring->dev->wl, "DMA RX: setup_rx_descbuffer() failed\n"); | 1547 | b43dbg(ring->dev->wl, "DMA RX: setup_rx_descbuffer() failed\n"); |
1522 | sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize); | 1548 | goto drop_recycle_buffer; |
1523 | goto drop; | ||
1524 | } | 1549 | } |
1525 | 1550 | ||
1526 | unmap_descbuffer(ring, dmaaddr, ring->rx_buffersize, 0); | 1551 | unmap_descbuffer(ring, dmaaddr, ring->rx_buffersize, 0); |
@@ -1530,6 +1555,11 @@ static void dma_rx(struct b43_dmaring *ring, int *slot) | |||
1530 | b43_rx(ring->dev, skb, rxhdr); | 1555 | b43_rx(ring->dev, skb, rxhdr); |
1531 | drop: | 1556 | drop: |
1532 | return; | 1557 | return; |
1558 | |||
1559 | drop_recycle_buffer: | ||
1560 | /* Poison and recycle the RX buffer. */ | ||
1561 | b43_poison_rx_buffer(ring, skb); | ||
1562 | sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize); | ||
1533 | } | 1563 | } |
1534 | 1564 | ||
1535 | void b43_dma_rx(struct b43_dmaring *ring) | 1565 | void b43_dma_rx(struct b43_dmaring *ring) |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 4896e0831114..79b685e300c7 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -3974,6 +3974,11 @@ static void setup_struct_phy_for_init(struct b43_wldev *dev, | |||
3974 | phy->next_txpwr_check_time = jiffies; | 3974 | phy->next_txpwr_check_time = jiffies; |
3975 | /* PHY TX errors counter. */ | 3975 | /* PHY TX errors counter. */ |
3976 | atomic_set(&phy->txerr_cnt, B43_PHY_TX_BADNESS_LIMIT); | 3976 | atomic_set(&phy->txerr_cnt, B43_PHY_TX_BADNESS_LIMIT); |
3977 | |||
3978 | #if B43_DEBUG | ||
3979 | phy->phy_locked = 0; | ||
3980 | phy->radio_locked = 0; | ||
3981 | #endif | ||
3977 | } | 3982 | } |
3978 | 3983 | ||
3979 | static void setup_struct_wldev_for_init(struct b43_wldev *dev) | 3984 | static void setup_struct_wldev_for_init(struct b43_wldev *dev) |
diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c index 026b61c03fb9..e176b6e0d9cf 100644 --- a/drivers/net/wireless/b43/phy_common.c +++ b/drivers/net/wireless/b43/phy_common.c | |||
@@ -131,12 +131,16 @@ void b43_radio_lock(struct b43_wldev *dev) | |||
131 | { | 131 | { |
132 | u32 macctl; | 132 | u32 macctl; |
133 | 133 | ||
134 | #if B43_DEBUG | ||
135 | B43_WARN_ON(dev->phy.radio_locked); | ||
136 | dev->phy.radio_locked = 1; | ||
137 | #endif | ||
138 | |||
134 | macctl = b43_read32(dev, B43_MMIO_MACCTL); | 139 | macctl = b43_read32(dev, B43_MMIO_MACCTL); |
135 | B43_WARN_ON(macctl & B43_MACCTL_RADIOLOCK); | ||
136 | macctl |= B43_MACCTL_RADIOLOCK; | 140 | macctl |= B43_MACCTL_RADIOLOCK; |
137 | b43_write32(dev, B43_MMIO_MACCTL, macctl); | 141 | b43_write32(dev, B43_MMIO_MACCTL, macctl); |
138 | /* Commit the write and wait for the device | 142 | /* Commit the write and wait for the firmware |
139 | * to exit any radio register access. */ | 143 | * to finish any radio register access. */ |
140 | b43_read32(dev, B43_MMIO_MACCTL); | 144 | b43_read32(dev, B43_MMIO_MACCTL); |
141 | udelay(10); | 145 | udelay(10); |
142 | } | 146 | } |
@@ -145,11 +149,15 @@ void b43_radio_unlock(struct b43_wldev *dev) | |||
145 | { | 149 | { |
146 | u32 macctl; | 150 | u32 macctl; |
147 | 151 | ||
152 | #if B43_DEBUG | ||
153 | B43_WARN_ON(!dev->phy.radio_locked); | ||
154 | dev->phy.radio_locked = 0; | ||
155 | #endif | ||
156 | |||
148 | /* Commit any write */ | 157 | /* Commit any write */ |
149 | b43_read16(dev, B43_MMIO_PHY_VER); | 158 | b43_read16(dev, B43_MMIO_PHY_VER); |
150 | /* unlock */ | 159 | /* unlock */ |
151 | macctl = b43_read32(dev, B43_MMIO_MACCTL); | 160 | macctl = b43_read32(dev, B43_MMIO_MACCTL); |
152 | B43_WARN_ON(!(macctl & B43_MACCTL_RADIOLOCK)); | ||
153 | macctl &= ~B43_MACCTL_RADIOLOCK; | 161 | macctl &= ~B43_MACCTL_RADIOLOCK; |
154 | b43_write32(dev, B43_MMIO_MACCTL, macctl); | 162 | b43_write32(dev, B43_MMIO_MACCTL, macctl); |
155 | } | 163 | } |
diff --git a/drivers/net/wireless/b43/phy_common.h b/drivers/net/wireless/b43/phy_common.h index c9f5430d1d7d..b2d99101947b 100644 --- a/drivers/net/wireless/b43/phy_common.h +++ b/drivers/net/wireless/b43/phy_common.h | |||
@@ -245,8 +245,10 @@ struct b43_phy { | |||
245 | atomic_t txerr_cnt; | 245 | atomic_t txerr_cnt; |
246 | 246 | ||
247 | #ifdef CONFIG_B43_DEBUG | 247 | #ifdef CONFIG_B43_DEBUG |
248 | /* PHY registers locked by b43_phy_lock()? */ | 248 | /* PHY registers locked (w.r.t. firmware) */ |
249 | bool phy_locked; | 249 | bool phy_locked; |
250 | /* Radio registers locked (w.r.t. firmware) */ | ||
251 | bool radio_locked; | ||
250 | #endif /* B43_DEBUG */ | 252 | #endif /* B43_DEBUG */ |
251 | }; | 253 | }; |
252 | 254 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index ce729281ff62..da61ecd62882 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -4075,7 +4075,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
4075 | if (!static_key) { | 4075 | if (!static_key) { |
4076 | sta_id = iwl3945_hw_find_station(priv, addr); | 4076 | sta_id = iwl3945_hw_find_station(priv, addr); |
4077 | if (sta_id == IWL_INVALID_STATION) { | 4077 | if (sta_id == IWL_INVALID_STATION) { |
4078 | IWL_DEBUG_MAC80211(priv, "leave - %pMnot in station map.\n", | 4078 | IWL_DEBUG_MAC80211(priv, "leave - %pM not in station map.\n", |
4079 | addr); | 4079 | addr); |
4080 | return -EINVAL; | 4080 | return -EINVAL; |
4081 | } | 4081 | } |
@@ -4913,6 +4913,8 @@ static int iwl3945_setup_mac(struct iwl_priv *priv) | |||
4913 | 4913 | ||
4914 | hw->wiphy->custom_regulatory = true; | 4914 | hw->wiphy->custom_regulatory = true; |
4915 | 4915 | ||
4916 | hw->wiphy->max_scan_ssids = 1; /* WILL FIX */ | ||
4917 | |||
4916 | /* Default value; 4 EDCA QOS priorities */ | 4918 | /* Default value; 4 EDCA QOS priorities */ |
4917 | hw->queues = 4; | 4919 | hw->queues = 4; |
4918 | 4920 | ||
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c index 63d7e19ce9bd..8e669775cb5d 100644 --- a/drivers/net/wireless/libertas/rx.c +++ b/drivers/net/wireless/libertas/rx.c | |||
@@ -170,6 +170,7 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) | |||
170 | lbs_deb_rx("rx err: frame received with bad length\n"); | 170 | lbs_deb_rx("rx err: frame received with bad length\n"); |
171 | dev->stats.rx_length_errors++; | 171 | dev->stats.rx_length_errors++; |
172 | ret = 0; | 172 | ret = 0; |
173 | dev_kfree_skb(skb); | ||
173 | goto done; | 174 | goto done; |
174 | } | 175 | } |
175 | 176 | ||
@@ -181,6 +182,7 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) | |||
181 | lbs_pr_alert("rxpd not ok\n"); | 182 | lbs_pr_alert("rxpd not ok\n"); |
182 | dev->stats.rx_errors++; | 183 | dev->stats.rx_errors++; |
183 | ret = 0; | 184 | ret = 0; |
185 | dev_kfree_skb(skb); | ||
184 | goto done; | 186 | goto done; |
185 | } | 187 | } |
186 | 188 | ||
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 57a0268d1bae..b5dbf6d9e517 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -3720,12 +3720,12 @@ err_free_reg: | |||
3720 | return rc; | 3720 | return rc; |
3721 | } | 3721 | } |
3722 | 3722 | ||
3723 | static void __devexit mwl8k_remove(struct pci_dev *pdev) | 3723 | static void __devexit mwl8k_shutdown(struct pci_dev *pdev) |
3724 | { | 3724 | { |
3725 | printk(KERN_ERR "===>%s(%u)\n", __func__, __LINE__); | 3725 | printk(KERN_ERR "===>%s(%u)\n", __func__, __LINE__); |
3726 | } | 3726 | } |
3727 | 3727 | ||
3728 | static void __devexit mwl8k_shutdown(struct pci_dev *pdev) | 3728 | static void __devexit mwl8k_remove(struct pci_dev *pdev) |
3729 | { | 3729 | { |
3730 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); | 3730 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
3731 | struct mwl8k_priv *priv; | 3731 | struct mwl8k_priv *priv; |
diff --git a/drivers/net/wireless/orinoco/hw.c b/drivers/net/wireless/orinoco/hw.c index 081428d9409e..632fac86a308 100644 --- a/drivers/net/wireless/orinoco/hw.c +++ b/drivers/net/wireless/orinoco/hw.c | |||
@@ -372,15 +372,13 @@ int __orinoco_hw_set_tkip_key(hermes_t *hw, int key_idx, int set_tx, | |||
372 | } | 372 | } |
373 | 373 | ||
374 | /* Wait upto 100ms for tx queue to empty */ | 374 | /* Wait upto 100ms for tx queue to empty */ |
375 | k = 100; | 375 | for (k = 100; k > 0; k--) { |
376 | do { | ||
377 | k--; | ||
378 | udelay(1000); | 376 | udelay(1000); |
379 | ret = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_TXQUEUEEMPTY, | 377 | ret = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_TXQUEUEEMPTY, |
380 | &xmitting); | 378 | &xmitting); |
381 | if (ret) | 379 | if (ret || !xmitting) |
382 | break; | 380 | break; |
383 | } while ((k > 0) && xmitting); | 381 | } |
384 | 382 | ||
385 | if (k == 0) | 383 | if (k == 0) |
386 | ret = -ETIMEDOUT; | 384 | ret = -ETIMEDOUT; |
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h index 2dda5fe418b6..ecf8b6ed5a47 100644 --- a/drivers/net/wireless/p54/p54.h +++ b/drivers/net/wireless/p54/p54.h | |||
@@ -14,9 +14,9 @@ | |||
14 | * published by the Free Software Foundation. | 14 | * published by the Free Software Foundation. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #ifdef CONFIG_MAC80211_LEDS | 17 | #ifdef CONFIG_P54_LEDS |
18 | #include <linux/leds.h> | 18 | #include <linux/leds.h> |
19 | #endif /* CONFIG_MAC80211_LEDS */ | 19 | #endif /* CONFIG_P54_LEDS */ |
20 | 20 | ||
21 | enum p54_control_frame_types { | 21 | enum p54_control_frame_types { |
22 | P54_CONTROL_TYPE_SETUP = 0, | 22 | P54_CONTROL_TYPE_SETUP = 0, |
@@ -116,7 +116,7 @@ enum fw_state { | |||
116 | FW_STATE_RESETTING, | 116 | FW_STATE_RESETTING, |
117 | }; | 117 | }; |
118 | 118 | ||
119 | #ifdef CONFIG_MAC80211_LEDS | 119 | #ifdef CONFIG_P54_LEDS |
120 | 120 | ||
121 | #define P54_LED_MAX_NAME_LEN 31 | 121 | #define P54_LED_MAX_NAME_LEN 31 |
122 | 122 | ||
@@ -129,7 +129,7 @@ struct p54_led_dev { | |||
129 | unsigned int registered; | 129 | unsigned int registered; |
130 | }; | 130 | }; |
131 | 131 | ||
132 | #endif /* CONFIG_MAC80211_LEDS */ | 132 | #endif /* CONFIG_P54_LEDS */ |
133 | 133 | ||
134 | struct p54_common { | 134 | struct p54_common { |
135 | struct ieee80211_hw *hw; | 135 | struct ieee80211_hw *hw; |
@@ -177,10 +177,10 @@ struct p54_common { | |||
177 | u8 privacy_caps; | 177 | u8 privacy_caps; |
178 | u8 rx_keycache_size; | 178 | u8 rx_keycache_size; |
179 | /* LED management */ | 179 | /* LED management */ |
180 | #ifdef CONFIG_MAC80211_LEDS | 180 | #ifdef CONFIG_P54_LEDS |
181 | struct p54_led_dev assoc_led; | 181 | struct p54_led_dev assoc_led; |
182 | struct p54_led_dev tx_led; | 182 | struct p54_led_dev tx_led; |
183 | #endif /* CONFIG_MAC80211_LEDS */ | 183 | #endif /* CONFIG_P54_LEDS */ |
184 | u16 softled_state; /* bit field of glowing LEDs */ | 184 | u16 softled_state; /* bit field of glowing LEDs */ |
185 | }; | 185 | }; |
186 | 186 | ||
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 0c1b0577d4ee..c8f0232ee5e0 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -2543,8 +2543,6 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len) | |||
2543 | priv->basic_rate_mask = 0x15f; | 2543 | priv->basic_rate_mask = 0x15f; |
2544 | skb_queue_head_init(&priv->tx_queue); | 2544 | skb_queue_head_init(&priv->tx_queue); |
2545 | dev->flags = IEEE80211_HW_RX_INCLUDES_FCS | | 2545 | dev->flags = IEEE80211_HW_RX_INCLUDES_FCS | |
2546 | IEEE80211_HW_SUPPORTS_PS | | ||
2547 | IEEE80211_HW_PS_NULLFUNC_STACK | | ||
2548 | IEEE80211_HW_SIGNAL_DBM | | 2546 | IEEE80211_HW_SIGNAL_DBM | |
2549 | IEEE80211_HW_NOISE_DBM; | 2547 | IEEE80211_HW_NOISE_DBM; |
2550 | 2548 | ||
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c index 2b222aaa6f0a..d1fe577de3d4 100644 --- a/drivers/net/wireless/p54/p54spi.c +++ b/drivers/net/wireless/p54/p54spi.c | |||
@@ -457,9 +457,10 @@ static int p54spi_wq_tx(struct p54s_priv *priv) | |||
457 | struct ieee80211_tx_info *info; | 457 | struct ieee80211_tx_info *info; |
458 | struct p54_tx_info *minfo; | 458 | struct p54_tx_info *minfo; |
459 | struct p54s_tx_info *dinfo; | 459 | struct p54s_tx_info *dinfo; |
460 | unsigned long flags; | ||
460 | int ret = 0; | 461 | int ret = 0; |
461 | 462 | ||
462 | spin_lock_bh(&priv->tx_lock); | 463 | spin_lock_irqsave(&priv->tx_lock, flags); |
463 | 464 | ||
464 | while (!list_empty(&priv->tx_pending)) { | 465 | while (!list_empty(&priv->tx_pending)) { |
465 | entry = list_entry(priv->tx_pending.next, | 466 | entry = list_entry(priv->tx_pending.next, |
@@ -467,7 +468,7 @@ static int p54spi_wq_tx(struct p54s_priv *priv) | |||
467 | 468 | ||
468 | list_del_init(&entry->tx_list); | 469 | list_del_init(&entry->tx_list); |
469 | 470 | ||
470 | spin_unlock_bh(&priv->tx_lock); | 471 | spin_unlock_irqrestore(&priv->tx_lock, flags); |
471 | 472 | ||
472 | dinfo = container_of((void *) entry, struct p54s_tx_info, | 473 | dinfo = container_of((void *) entry, struct p54s_tx_info, |
473 | tx_list); | 474 | tx_list); |
@@ -479,16 +480,14 @@ static int p54spi_wq_tx(struct p54s_priv *priv) | |||
479 | 480 | ||
480 | ret = p54spi_tx_frame(priv, skb); | 481 | ret = p54spi_tx_frame(priv, skb); |
481 | 482 | ||
482 | spin_lock_bh(&priv->tx_lock); | ||
483 | |||
484 | if (ret < 0) { | 483 | if (ret < 0) { |
485 | p54_free_skb(priv->hw, skb); | 484 | p54_free_skb(priv->hw, skb); |
486 | goto out; | 485 | return ret; |
487 | } | 486 | } |
488 | } | ||
489 | 487 | ||
490 | out: | 488 | spin_lock_irqsave(&priv->tx_lock, flags); |
491 | spin_unlock_bh(&priv->tx_lock); | 489 | } |
490 | spin_unlock_irqrestore(&priv->tx_lock, flags); | ||
492 | return ret; | 491 | return ret; |
493 | } | 492 | } |
494 | 493 | ||
@@ -498,12 +497,13 @@ static void p54spi_op_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
498 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 497 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
499 | struct p54_tx_info *mi = (struct p54_tx_info *) info->rate_driver_data; | 498 | struct p54_tx_info *mi = (struct p54_tx_info *) info->rate_driver_data; |
500 | struct p54s_tx_info *di = (struct p54s_tx_info *) mi->data; | 499 | struct p54s_tx_info *di = (struct p54s_tx_info *) mi->data; |
500 | unsigned long flags; | ||
501 | 501 | ||
502 | BUILD_BUG_ON(sizeof(*di) > sizeof((mi->data))); | 502 | BUILD_BUG_ON(sizeof(*di) > sizeof((mi->data))); |
503 | 503 | ||
504 | spin_lock_bh(&priv->tx_lock); | 504 | spin_lock_irqsave(&priv->tx_lock, flags); |
505 | list_add_tail(&di->tx_list, &priv->tx_pending); | 505 | list_add_tail(&di->tx_list, &priv->tx_pending); |
506 | spin_unlock_bh(&priv->tx_lock); | 506 | spin_unlock_irqrestore(&priv->tx_lock, flags); |
507 | 507 | ||
508 | queue_work(priv->hw->workqueue, &priv->work); | 508 | queue_work(priv->hw->workqueue, &priv->work); |
509 | } | 509 | } |
@@ -604,6 +604,7 @@ out: | |||
604 | static void p54spi_op_stop(struct ieee80211_hw *dev) | 604 | static void p54spi_op_stop(struct ieee80211_hw *dev) |
605 | { | 605 | { |
606 | struct p54s_priv *priv = dev->priv; | 606 | struct p54s_priv *priv = dev->priv; |
607 | unsigned long flags; | ||
607 | 608 | ||
608 | if (mutex_lock_interruptible(&priv->mutex)) { | 609 | if (mutex_lock_interruptible(&priv->mutex)) { |
609 | /* FIXME: how to handle this error? */ | 610 | /* FIXME: how to handle this error? */ |
@@ -615,9 +616,9 @@ static void p54spi_op_stop(struct ieee80211_hw *dev) | |||
615 | cancel_work_sync(&priv->work); | 616 | cancel_work_sync(&priv->work); |
616 | 617 | ||
617 | p54spi_power_off(priv); | 618 | p54spi_power_off(priv); |
618 | spin_lock_bh(&priv->tx_lock); | 619 | spin_lock_irqsave(&priv->tx_lock, flags); |
619 | INIT_LIST_HEAD(&priv->tx_pending); | 620 | INIT_LIST_HEAD(&priv->tx_pending); |
620 | spin_unlock_bh(&priv->tx_lock); | 621 | spin_unlock_irqrestore(&priv->tx_lock, flags); |
621 | 622 | ||
622 | priv->fw_state = FW_STATE_OFF; | 623 | priv->fw_state = FW_STATE_OFF; |
623 | mutex_unlock(&priv->mutex); | 624 | mutex_unlock(&priv->mutex); |
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index da6640afc835..6cc6cbc9234f 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -71,6 +71,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
71 | {USB_DEVICE(0x1260, 0xee22)}, /* SMC 2862W-G version 2 */ | 71 | {USB_DEVICE(0x1260, 0xee22)}, /* SMC 2862W-G version 2 */ |
72 | {USB_DEVICE(0x13b1, 0x000a)}, /* Linksys WUSB54G ver 2 */ | 72 | {USB_DEVICE(0x13b1, 0x000a)}, /* Linksys WUSB54G ver 2 */ |
73 | {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */ | 73 | {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */ |
74 | {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */ | ||
74 | {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ | 75 | {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ |
75 | {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ | 76 | {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ |
76 | {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */ | 77 | {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */ |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 05f94e21b423..5752aaae906b 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -646,10 +646,8 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
646 | * Register HW. | 646 | * Register HW. |
647 | */ | 647 | */ |
648 | status = ieee80211_register_hw(rt2x00dev->hw); | 648 | status = ieee80211_register_hw(rt2x00dev->hw); |
649 | if (status) { | 649 | if (status) |
650 | rt2x00lib_remove_hw(rt2x00dev); | ||
651 | return status; | 650 | return status; |
652 | } | ||
653 | 651 | ||
654 | set_bit(DEVICE_STATE_REGISTERED_HW, &rt2x00dev->flags); | 652 | set_bit(DEVICE_STATE_REGISTERED_HW, &rt2x00dev->flags); |
655 | 653 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 43fa0f849003..9730b4f8fd26 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
@@ -369,8 +369,6 @@ int rt2x00pci_suspend(struct pci_dev *pci_dev, pm_message_t state) | |||
369 | if (retval) | 369 | if (retval) |
370 | return retval; | 370 | return retval; |
371 | 371 | ||
372 | rt2x00pci_free_reg(rt2x00dev); | ||
373 | |||
374 | pci_save_state(pci_dev); | 372 | pci_save_state(pci_dev); |
375 | pci_disable_device(pci_dev); | 373 | pci_disable_device(pci_dev); |
376 | return pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state)); | 374 | return pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state)); |
@@ -381,7 +379,6 @@ int rt2x00pci_resume(struct pci_dev *pci_dev) | |||
381 | { | 379 | { |
382 | struct ieee80211_hw *hw = pci_get_drvdata(pci_dev); | 380 | struct ieee80211_hw *hw = pci_get_drvdata(pci_dev); |
383 | struct rt2x00_dev *rt2x00dev = hw->priv; | 381 | struct rt2x00_dev *rt2x00dev = hw->priv; |
384 | int retval; | ||
385 | 382 | ||
386 | if (pci_set_power_state(pci_dev, PCI_D0) || | 383 | if (pci_set_power_state(pci_dev, PCI_D0) || |
387 | pci_enable_device(pci_dev) || | 384 | pci_enable_device(pci_dev) || |
@@ -390,20 +387,7 @@ int rt2x00pci_resume(struct pci_dev *pci_dev) | |||
390 | return -EIO; | 387 | return -EIO; |
391 | } | 388 | } |
392 | 389 | ||
393 | retval = rt2x00pci_alloc_reg(rt2x00dev); | 390 | return rt2x00lib_resume(rt2x00dev); |
394 | if (retval) | ||
395 | return retval; | ||
396 | |||
397 | retval = rt2x00lib_resume(rt2x00dev); | ||
398 | if (retval) | ||
399 | goto exit_free_reg; | ||
400 | |||
401 | return 0; | ||
402 | |||
403 | exit_free_reg: | ||
404 | rt2x00pci_free_reg(rt2x00dev); | ||
405 | |||
406 | return retval; | ||
407 | } | 391 | } |
408 | EXPORT_SYMBOL_GPL(rt2x00pci_resume); | 392 | EXPORT_SYMBOL_GPL(rt2x00pci_resume); |
409 | #endif /* CONFIG_PM */ | 393 | #endif /* CONFIG_PM */ |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index 7d50ca82375e..501544882c2c 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -702,8 +702,6 @@ int rt2x00usb_suspend(struct usb_interface *usb_intf, pm_message_t state) | |||
702 | if (retval) | 702 | if (retval) |
703 | return retval; | 703 | return retval; |
704 | 704 | ||
705 | rt2x00usb_free_reg(rt2x00dev); | ||
706 | |||
707 | /* | 705 | /* |
708 | * Decrease usbdev refcount. | 706 | * Decrease usbdev refcount. |
709 | */ | 707 | */ |
@@ -717,24 +715,10 @@ int rt2x00usb_resume(struct usb_interface *usb_intf) | |||
717 | { | 715 | { |
718 | struct ieee80211_hw *hw = usb_get_intfdata(usb_intf); | 716 | struct ieee80211_hw *hw = usb_get_intfdata(usb_intf); |
719 | struct rt2x00_dev *rt2x00dev = hw->priv; | 717 | struct rt2x00_dev *rt2x00dev = hw->priv; |
720 | int retval; | ||
721 | 718 | ||
722 | usb_get_dev(interface_to_usbdev(usb_intf)); | 719 | usb_get_dev(interface_to_usbdev(usb_intf)); |
723 | 720 | ||
724 | retval = rt2x00usb_alloc_reg(rt2x00dev); | 721 | return rt2x00lib_resume(rt2x00dev); |
725 | if (retval) | ||
726 | return retval; | ||
727 | |||
728 | retval = rt2x00lib_resume(rt2x00dev); | ||
729 | if (retval) | ||
730 | goto exit_free_reg; | ||
731 | |||
732 | return 0; | ||
733 | |||
734 | exit_free_reg: | ||
735 | rt2x00usb_free_reg(rt2x00dev); | ||
736 | |||
737 | return retval; | ||
738 | } | 722 | } |
739 | EXPORT_SYMBOL_GPL(rt2x00usb_resume); | 723 | EXPORT_SYMBOL_GPL(rt2x00usb_resume); |
740 | #endif /* CONFIG_PM */ | 724 | #endif /* CONFIG_PM */ |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 420fff42c0dd..853b2b279b64 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -2369,6 +2369,8 @@ static struct usb_device_id rt73usb_device_table[] = { | |||
2369 | /* Buffalo */ | 2369 | /* Buffalo */ |
2370 | { USB_DEVICE(0x0411, 0x00d8), USB_DEVICE_DATA(&rt73usb_ops) }, | 2370 | { USB_DEVICE(0x0411, 0x00d8), USB_DEVICE_DATA(&rt73usb_ops) }, |
2371 | { USB_DEVICE(0x0411, 0x00f4), USB_DEVICE_DATA(&rt73usb_ops) }, | 2371 | { USB_DEVICE(0x0411, 0x00f4), USB_DEVICE_DATA(&rt73usb_ops) }, |
2372 | { USB_DEVICE(0x0411, 0x0116), USB_DEVICE_DATA(&rt73usb_ops) }, | ||
2373 | { USB_DEVICE(0x0411, 0x0119), USB_DEVICE_DATA(&rt73usb_ops) }, | ||
2372 | /* CNet */ | 2374 | /* CNet */ |
2373 | { USB_DEVICE(0x1371, 0x9022), USB_DEVICE_DATA(&rt73usb_ops) }, | 2375 | { USB_DEVICE(0x1371, 0x9022), USB_DEVICE_DATA(&rt73usb_ops) }, |
2374 | { USB_DEVICE(0x1371, 0x9032), USB_DEVICE_DATA(&rt73usb_ops) }, | 2376 | { USB_DEVICE(0x1371, 0x9032), USB_DEVICE_DATA(&rt73usb_ops) }, |