diff options
author | David S. Miller <davem@davemloft.net> | 2010-05-11 01:53:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-11 01:53:41 -0400 |
commit | de02d72bb3cc5b3d4c873db4ca8291723dd48479 (patch) | |
tree | c937017bdc271d23ef75c4e0214d45e59227b2d9 /drivers/net/wireless/ath/ar9170 | |
parent | f0ecde1466f21edf577b809735f4f35f354777a0 (diff) | |
parent | 79733a865c7fd778ce45e3503962b3a875b0a153 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Diffstat (limited to 'drivers/net/wireless/ath/ar9170')
-rw-r--r-- | drivers/net/wireless/ath/ar9170/usb.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ar9170/usb.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c index 99a6da464bd3..e1c2fcaa8bed 100644 --- a/drivers/net/wireless/ath/ar9170/usb.c +++ b/drivers/net/wireless/ath/ar9170/usb.c | |||
@@ -727,12 +727,16 @@ static void ar9170_usb_firmware_failed(struct ar9170_usb *aru) | |||
727 | { | 727 | { |
728 | struct device *parent = aru->udev->dev.parent; | 728 | struct device *parent = aru->udev->dev.parent; |
729 | 729 | ||
730 | complete(&aru->firmware_loading_complete); | ||
731 | |||
730 | /* unbind anything failed */ | 732 | /* unbind anything failed */ |
731 | if (parent) | 733 | if (parent) |
732 | down(&parent->sem); | 734 | down(&parent->sem); |
733 | device_release_driver(&aru->udev->dev); | 735 | device_release_driver(&aru->udev->dev); |
734 | if (parent) | 736 | if (parent) |
735 | up(&parent->sem); | 737 | up(&parent->sem); |
738 | |||
739 | usb_put_dev(aru->udev); | ||
736 | } | 740 | } |
737 | 741 | ||
738 | static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context) | 742 | static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context) |
@@ -761,6 +765,8 @@ static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context) | |||
761 | if (err) | 765 | if (err) |
762 | goto err_unrx; | 766 | goto err_unrx; |
763 | 767 | ||
768 | complete(&aru->firmware_loading_complete); | ||
769 | usb_put_dev(aru->udev); | ||
764 | return; | 770 | return; |
765 | 771 | ||
766 | err_unrx: | 772 | err_unrx: |
@@ -858,6 +864,7 @@ static int ar9170_usb_probe(struct usb_interface *intf, | |||
858 | init_usb_anchor(&aru->tx_pending); | 864 | init_usb_anchor(&aru->tx_pending); |
859 | init_usb_anchor(&aru->tx_submitted); | 865 | init_usb_anchor(&aru->tx_submitted); |
860 | init_completion(&aru->cmd_wait); | 866 | init_completion(&aru->cmd_wait); |
867 | init_completion(&aru->firmware_loading_complete); | ||
861 | spin_lock_init(&aru->tx_urb_lock); | 868 | spin_lock_init(&aru->tx_urb_lock); |
862 | 869 | ||
863 | aru->tx_pending_urbs = 0; | 870 | aru->tx_pending_urbs = 0; |
@@ -877,6 +884,7 @@ static int ar9170_usb_probe(struct usb_interface *intf, | |||
877 | if (err) | 884 | if (err) |
878 | goto err_freehw; | 885 | goto err_freehw; |
879 | 886 | ||
887 | usb_get_dev(aru->udev); | ||
880 | return request_firmware_nowait(THIS_MODULE, 1, "ar9170.fw", | 888 | return request_firmware_nowait(THIS_MODULE, 1, "ar9170.fw", |
881 | &aru->udev->dev, GFP_KERNEL, aru, | 889 | &aru->udev->dev, GFP_KERNEL, aru, |
882 | ar9170_usb_firmware_step2); | 890 | ar9170_usb_firmware_step2); |
@@ -896,6 +904,9 @@ static void ar9170_usb_disconnect(struct usb_interface *intf) | |||
896 | return; | 904 | return; |
897 | 905 | ||
898 | aru->common.state = AR9170_IDLE; | 906 | aru->common.state = AR9170_IDLE; |
907 | |||
908 | wait_for_completion(&aru->firmware_loading_complete); | ||
909 | |||
899 | ar9170_unregister(&aru->common); | 910 | ar9170_unregister(&aru->common); |
900 | ar9170_usb_cancel_urbs(aru); | 911 | ar9170_usb_cancel_urbs(aru); |
901 | 912 | ||
diff --git a/drivers/net/wireless/ath/ar9170/usb.h b/drivers/net/wireless/ath/ar9170/usb.h index a2ce3b169ceb..919b06046eb3 100644 --- a/drivers/net/wireless/ath/ar9170/usb.h +++ b/drivers/net/wireless/ath/ar9170/usb.h | |||
@@ -71,6 +71,7 @@ struct ar9170_usb { | |||
71 | unsigned int tx_pending_urbs; | 71 | unsigned int tx_pending_urbs; |
72 | 72 | ||
73 | struct completion cmd_wait; | 73 | struct completion cmd_wait; |
74 | struct completion firmware_loading_complete; | ||
74 | int readlen; | 75 | int readlen; |
75 | u8 *readbuf; | 76 | u8 *readbuf; |
76 | 77 | ||