diff options
author | Reinette Chatre <reinette.chatre@intel.com> | 2010-05-10 18:08:11 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-05-10 18:08:11 -0400 |
commit | a15707d80ee9a0e0812c5f1a1ed8e41e0a6e52f3 (patch) | |
tree | b1774dad1d72b70d88ab6c51ff4b87697dfca57a /drivers/net/wireless/ath | |
parent | 9459d59fbf0bc82ff4c804679fa8bc22788eca63 (diff) | |
parent | 562db532760827f6ce30801a08e6b568848bc9f2 (diff) |
Merge branch 'wireless-2.6' into wireless-next-2.6
Conflicts:
drivers/net/wireless/iwlwifi/iwl-dev.h
Diffstat (limited to 'drivers/net/wireless/ath')
-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 0259bb46247..c7405b642fe 100644 --- a/drivers/net/wireless/ath/ar9170/usb.c +++ b/drivers/net/wireless/ath/ar9170/usb.c | |||
@@ -736,12 +736,16 @@ static void ar9170_usb_firmware_failed(struct ar9170_usb *aru) | |||
736 | { | 736 | { |
737 | struct device *parent = aru->udev->dev.parent; | 737 | struct device *parent = aru->udev->dev.parent; |
738 | 738 | ||
739 | complete(&aru->firmware_loading_complete); | ||
740 | |||
739 | /* unbind anything failed */ | 741 | /* unbind anything failed */ |
740 | if (parent) | 742 | if (parent) |
741 | down(&parent->sem); | 743 | down(&parent->sem); |
742 | device_release_driver(&aru->udev->dev); | 744 | device_release_driver(&aru->udev->dev); |
743 | if (parent) | 745 | if (parent) |
744 | up(&parent->sem); | 746 | up(&parent->sem); |
747 | |||
748 | usb_put_dev(aru->udev); | ||
745 | } | 749 | } |
746 | 750 | ||
747 | static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context) | 751 | static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context) |
@@ -770,6 +774,8 @@ static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context) | |||
770 | if (err) | 774 | if (err) |
771 | goto err_unrx; | 775 | goto err_unrx; |
772 | 776 | ||
777 | complete(&aru->firmware_loading_complete); | ||
778 | usb_put_dev(aru->udev); | ||
773 | return; | 779 | return; |
774 | 780 | ||
775 | err_unrx: | 781 | err_unrx: |
@@ -867,6 +873,7 @@ static int ar9170_usb_probe(struct usb_interface *intf, | |||
867 | init_usb_anchor(&aru->tx_pending); | 873 | init_usb_anchor(&aru->tx_pending); |
868 | init_usb_anchor(&aru->tx_submitted); | 874 | init_usb_anchor(&aru->tx_submitted); |
869 | init_completion(&aru->cmd_wait); | 875 | init_completion(&aru->cmd_wait); |
876 | init_completion(&aru->firmware_loading_complete); | ||
870 | spin_lock_init(&aru->tx_urb_lock); | 877 | spin_lock_init(&aru->tx_urb_lock); |
871 | 878 | ||
872 | aru->tx_pending_urbs = 0; | 879 | aru->tx_pending_urbs = 0; |
@@ -886,6 +893,7 @@ static int ar9170_usb_probe(struct usb_interface *intf, | |||
886 | if (err) | 893 | if (err) |
887 | goto err_freehw; | 894 | goto err_freehw; |
888 | 895 | ||
896 | usb_get_dev(aru->udev); | ||
889 | return request_firmware_nowait(THIS_MODULE, 1, "ar9170.fw", | 897 | return request_firmware_nowait(THIS_MODULE, 1, "ar9170.fw", |
890 | &aru->udev->dev, GFP_KERNEL, aru, | 898 | &aru->udev->dev, GFP_KERNEL, aru, |
891 | ar9170_usb_firmware_step2); | 899 | ar9170_usb_firmware_step2); |
@@ -905,6 +913,9 @@ static void ar9170_usb_disconnect(struct usb_interface *intf) | |||
905 | return; | 913 | return; |
906 | 914 | ||
907 | aru->common.state = AR9170_IDLE; | 915 | aru->common.state = AR9170_IDLE; |
916 | |||
917 | wait_for_completion(&aru->firmware_loading_complete); | ||
918 | |||
908 | ar9170_unregister(&aru->common); | 919 | ar9170_unregister(&aru->common); |
909 | ar9170_usb_cancel_urbs(aru); | 920 | ar9170_usb_cancel_urbs(aru); |
910 | 921 | ||
diff --git a/drivers/net/wireless/ath/ar9170/usb.h b/drivers/net/wireless/ath/ar9170/usb.h index a2ce3b169ce..919b06046eb 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 | ||