aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ar9170
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-05-12 03:05:35 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-12 03:05:35 -0400
commit278554bd6579206921f5d8a523649a7a57f8850d (patch)
tree4e6c527daf0910e455b3aa72e2c96b0479e430be /drivers/net/wireless/ath/ar9170
parent5a147e8bf982f9dd414c1dd751fe02c1942506b2 (diff)
parentcea0d767c29669bf89f86e4aee46ef462d2ebae8 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: Documentation/feature-removal-schedule.txt drivers/net/wireless/ath/ar9170/usb.c drivers/scsi/iscsi_tcp.c net/ipv4/ipmr.c
Diffstat (limited to 'drivers/net/wireless/ath/ar9170')
-rw-r--r--drivers/net/wireless/ath/ar9170/usb.c11
-rw-r--r--drivers/net/wireless/ath/ar9170/usb.h1
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 c8121a6a9d3a..8663660ea4c6 100644
--- a/drivers/net/wireless/ath/ar9170/usb.c
+++ b/drivers/net/wireless/ath/ar9170/usb.c
@@ -738,12 +738,16 @@ static void ar9170_usb_firmware_failed(struct ar9170_usb *aru)
738{ 738{
739 struct device *parent = aru->udev->dev.parent; 739 struct device *parent = aru->udev->dev.parent;
740 740
741 complete(&aru->firmware_loading_complete);
742
741 /* unbind anything failed */ 743 /* unbind anything failed */
742 if (parent) 744 if (parent)
743 device_lock(parent); 745 device_lock(parent);
744 device_release_driver(&aru->udev->dev); 746 device_release_driver(&aru->udev->dev);
745 if (parent) 747 if (parent)
746 device_unlock(parent); 748 device_unlock(parent);
749
750 usb_put_dev(aru->udev);
747} 751}
748 752
749static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context) 753static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context)
@@ -772,6 +776,8 @@ static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context)
772 if (err) 776 if (err)
773 goto err_unrx; 777 goto err_unrx;
774 778
779 complete(&aru->firmware_loading_complete);
780 usb_put_dev(aru->udev);
775 return; 781 return;
776 782
777 err_unrx: 783 err_unrx:
@@ -869,6 +875,7 @@ static int ar9170_usb_probe(struct usb_interface *intf,
869 init_usb_anchor(&aru->tx_pending); 875 init_usb_anchor(&aru->tx_pending);
870 init_usb_anchor(&aru->tx_submitted); 876 init_usb_anchor(&aru->tx_submitted);
871 init_completion(&aru->cmd_wait); 877 init_completion(&aru->cmd_wait);
878 init_completion(&aru->firmware_loading_complete);
872 spin_lock_init(&aru->tx_urb_lock); 879 spin_lock_init(&aru->tx_urb_lock);
873 880
874 aru->tx_pending_urbs = 0; 881 aru->tx_pending_urbs = 0;
@@ -888,6 +895,7 @@ static int ar9170_usb_probe(struct usb_interface *intf,
888 if (err) 895 if (err)
889 goto err_freehw; 896 goto err_freehw;
890 897
898 usb_get_dev(aru->udev);
891 return request_firmware_nowait(THIS_MODULE, 1, "ar9170.fw", 899 return request_firmware_nowait(THIS_MODULE, 1, "ar9170.fw",
892 &aru->udev->dev, GFP_KERNEL, aru, 900 &aru->udev->dev, GFP_KERNEL, aru,
893 ar9170_usb_firmware_step2); 901 ar9170_usb_firmware_step2);
@@ -907,6 +915,9 @@ static void ar9170_usb_disconnect(struct usb_interface *intf)
907 return; 915 return;
908 916
909 aru->common.state = AR9170_IDLE; 917 aru->common.state = AR9170_IDLE;
918
919 wait_for_completion(&aru->firmware_loading_complete);
920
910 ar9170_unregister(&aru->common); 921 ar9170_unregister(&aru->common);
911 ar9170_usb_cancel_urbs(aru); 922 ar9170_usb_cancel_urbs(aru);
912 923
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