aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith.Manoharan@atheros.com <Sujith.Manoharan@atheros.com>2010-05-11 06:54:40 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-05-12 16:39:05 -0400
commit1d8af8caccceab91ba65b7f659678b92093f9203 (patch)
tree257e3196c112699dcf8b227a3e7d2147d2399a2d
parent05a30f9cf2a57ebbb2b616b5394e06b893179f13 (diff)
ath9k_htc: Allocate URBs properly
The URBs have to be allocated before uploading the firmware to the target. This is needed to process the target ready message properly. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 74872ca76f9a..453cf56eba78 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -735,6 +735,14 @@ err:
735 return -ENOMEM; 735 return -ENOMEM;
736} 736}
737 737
738static void ath9k_hif_usb_dealloc_urbs(struct hif_device_usb *hif_dev)
739{
740 usb_kill_anchored_urbs(&hif_dev->regout_submitted);
741 ath9k_hif_usb_dealloc_reg_in_urb(hif_dev);
742 ath9k_hif_usb_dealloc_tx_urbs(hif_dev);
743 ath9k_hif_usb_dealloc_rx_urbs(hif_dev);
744}
745
738static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) 746static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev)
739{ 747{
740 int transfer, err; 748 int transfer, err;
@@ -794,14 +802,6 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev,
794 goto err_fw_req; 802 goto err_fw_req;
795 } 803 }
796 804
797 /* Download firmware */
798 ret = ath9k_hif_usb_download_fw(hif_dev);
799 if (ret) {
800 dev_err(&hif_dev->udev->dev,
801 "ath9k_htc: Firmware - %s download failed\n", fw_name);
802 goto err_fw_download;
803 }
804
805 /* Alloc URBs */ 805 /* Alloc URBs */
806 ret = ath9k_hif_usb_alloc_urbs(hif_dev); 806 ret = ath9k_hif_usb_alloc_urbs(hif_dev);
807 if (ret) { 807 if (ret) {
@@ -810,25 +810,25 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev,
810 goto err_urb; 810 goto err_urb;
811 } 811 }
812 812
813 /* Download firmware */
814 ret = ath9k_hif_usb_download_fw(hif_dev);
815 if (ret) {
816 dev_err(&hif_dev->udev->dev,
817 "ath9k_htc: Firmware - %s download failed\n", fw_name);
818 goto err_fw_download;
819 }
820
813 return 0; 821 return 0;
814 822
815err_urb:
816 /* Nothing */
817err_fw_download: 823err_fw_download:
824 ath9k_hif_usb_dealloc_urbs(hif_dev);
825err_urb:
818 release_firmware(hif_dev->firmware); 826 release_firmware(hif_dev->firmware);
819err_fw_req: 827err_fw_req:
820 hif_dev->firmware = NULL; 828 hif_dev->firmware = NULL;
821 return ret; 829 return ret;
822} 830}
823 831
824static void ath9k_hif_usb_dealloc_urbs(struct hif_device_usb *hif_dev)
825{
826 usb_kill_anchored_urbs(&hif_dev->regout_submitted);
827 ath9k_hif_usb_dealloc_reg_in_urb(hif_dev);
828 ath9k_hif_usb_dealloc_tx_urbs(hif_dev);
829 ath9k_hif_usb_dealloc_rx_urbs(hif_dev);
830}
831
832static void ath9k_hif_usb_dev_deinit(struct hif_device_usb *hif_dev) 832static void ath9k_hif_usb_dev_deinit(struct hif_device_usb *hif_dev)
833{ 833{
834 ath9k_hif_usb_dealloc_urbs(hif_dev); 834 ath9k_hif_usb_dealloc_urbs(hif_dev);