diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hif_usb.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hif_usb.c | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 6576f683dba0..0de3c3d3c245 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
@@ -35,8 +35,14 @@ static struct usb_device_id ath9k_hif_usb_ids[] = { | |||
35 | { USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */ | 35 | { USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */ |
36 | { USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */ | 36 | { USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */ |
37 | { USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */ | 37 | { USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */ |
38 | { USB_DEVICE(0x13D3, 0x3346) }, /* IMC Networks */ | ||
39 | { USB_DEVICE(0x13D3, 0x3348) }, /* Azurewave */ | ||
40 | { USB_DEVICE(0x13D3, 0x3349) }, /* Azurewave */ | ||
41 | { USB_DEVICE(0x13D3, 0x3350) }, /* Azurewave */ | ||
38 | { USB_DEVICE(0x04CA, 0x4605) }, /* Liteon */ | 42 | { USB_DEVICE(0x04CA, 0x4605) }, /* Liteon */ |
39 | { USB_DEVICE(0x083A, 0xA704) }, /* SMC Networks */ | 43 | { USB_DEVICE(0x083A, 0xA704) }, /* SMC Networks */ |
44 | { USB_DEVICE(0x040D, 0x3801) }, /* VIA */ | ||
45 | { USB_DEVICE(0x1668, 0x1200) }, /* Verizon */ | ||
40 | { }, | 46 | { }, |
41 | }; | 47 | }; |
42 | 48 | ||
@@ -540,11 +546,11 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb) | |||
540 | return; | 546 | return; |
541 | } | 547 | } |
542 | 548 | ||
543 | usb_fill_int_urb(urb, hif_dev->udev, | 549 | usb_fill_bulk_urb(urb, hif_dev->udev, |
544 | usb_rcvbulkpipe(hif_dev->udev, | 550 | usb_rcvbulkpipe(hif_dev->udev, |
545 | USB_REG_IN_PIPE), | 551 | USB_REG_IN_PIPE), |
546 | nskb->data, MAX_REG_IN_BUF_SIZE, | 552 | nskb->data, MAX_REG_IN_BUF_SIZE, |
547 | ath9k_hif_usb_reg_in_cb, nskb, 1); | 553 | ath9k_hif_usb_reg_in_cb, nskb); |
548 | 554 | ||
549 | ret = usb_submit_urb(urb, GFP_ATOMIC); | 555 | ret = usb_submit_urb(urb, GFP_ATOMIC); |
550 | if (ret) { | 556 | if (ret) { |
@@ -720,11 +726,11 @@ static int ath9k_hif_usb_alloc_reg_in_urb(struct hif_device_usb *hif_dev) | |||
720 | if (!skb) | 726 | if (!skb) |
721 | goto err; | 727 | goto err; |
722 | 728 | ||
723 | usb_fill_int_urb(hif_dev->reg_in_urb, hif_dev->udev, | 729 | usb_fill_bulk_urb(hif_dev->reg_in_urb, hif_dev->udev, |
724 | usb_rcvbulkpipe(hif_dev->udev, | 730 | usb_rcvbulkpipe(hif_dev->udev, |
725 | USB_REG_IN_PIPE), | 731 | USB_REG_IN_PIPE), |
726 | skb->data, MAX_REG_IN_BUF_SIZE, | 732 | skb->data, MAX_REG_IN_BUF_SIZE, |
727 | ath9k_hif_usb_reg_in_cb, skb, 1); | 733 | ath9k_hif_usb_reg_in_cb, skb); |
728 | 734 | ||
729 | if (usb_submit_urb(hif_dev->reg_in_urb, GFP_KERNEL) != 0) | 735 | if (usb_submit_urb(hif_dev->reg_in_urb, GFP_KERNEL) != 0) |
730 | goto err; | 736 | goto err; |
@@ -805,6 +811,8 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) | |||
805 | case 0x7010: | 811 | case 0x7010: |
806 | case 0x7015: | 812 | case 0x7015: |
807 | case 0x9018: | 813 | case 0x9018: |
814 | case 0xA704: | ||
815 | case 0x1200: | ||
808 | firm_offset = AR7010_FIRMWARE_TEXT; | 816 | firm_offset = AR7010_FIRMWARE_TEXT; |
809 | break; | 817 | break; |
810 | default: | 818 | default: |
@@ -843,14 +851,6 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev) | |||
843 | goto err_fw_req; | 851 | goto err_fw_req; |
844 | } | 852 | } |
845 | 853 | ||
846 | /* Alloc URBs */ | ||
847 | ret = ath9k_hif_usb_alloc_urbs(hif_dev); | ||
848 | if (ret) { | ||
849 | dev_err(&hif_dev->udev->dev, | ||
850 | "ath9k_htc: Unable to allocate URBs\n"); | ||
851 | goto err_urb; | ||
852 | } | ||
853 | |||
854 | /* Download firmware */ | 854 | /* Download firmware */ |
855 | ret = ath9k_hif_usb_download_fw(hif_dev); | 855 | ret = ath9k_hif_usb_download_fw(hif_dev); |
856 | if (ret) { | 856 | if (ret) { |
@@ -866,16 +866,22 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev) | |||
866 | */ | 866 | */ |
867 | for (idx = 0; idx < alt->desc.bNumEndpoints; idx++) { | 867 | for (idx = 0; idx < alt->desc.bNumEndpoints; idx++) { |
868 | endp = &alt->endpoint[idx].desc; | 868 | endp = &alt->endpoint[idx].desc; |
869 | if (((endp->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK) | 869 | if ((endp->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) |
870 | == 0x04) && | 870 | == USB_ENDPOINT_XFER_INT) { |
871 | ((endp->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) | ||
872 | == USB_ENDPOINT_XFER_INT)) { | ||
873 | endp->bmAttributes &= ~USB_ENDPOINT_XFERTYPE_MASK; | 871 | endp->bmAttributes &= ~USB_ENDPOINT_XFERTYPE_MASK; |
874 | endp->bmAttributes |= USB_ENDPOINT_XFER_BULK; | 872 | endp->bmAttributes |= USB_ENDPOINT_XFER_BULK; |
875 | endp->bInterval = 0; | 873 | endp->bInterval = 0; |
876 | } | 874 | } |
877 | } | 875 | } |
878 | 876 | ||
877 | /* Alloc URBs */ | ||
878 | ret = ath9k_hif_usb_alloc_urbs(hif_dev); | ||
879 | if (ret) { | ||
880 | dev_err(&hif_dev->udev->dev, | ||
881 | "ath9k_htc: Unable to allocate URBs\n"); | ||
882 | goto err_urb; | ||
883 | } | ||
884 | |||
879 | return 0; | 885 | return 0; |
880 | 886 | ||
881 | err_fw_download: | 887 | err_fw_download: |
@@ -929,6 +935,8 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface, | |||
929 | case 0x7010: | 935 | case 0x7010: |
930 | case 0x7015: | 936 | case 0x7015: |
931 | case 0x9018: | 937 | case 0x9018: |
938 | case 0xA704: | ||
939 | case 0x1200: | ||
932 | if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x0202) | 940 | if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x0202) |
933 | hif_dev->fw_name = FIRMWARE_AR7010_1_1; | 941 | hif_dev->fw_name = FIRMWARE_AR7010_1_1; |
934 | else | 942 | else |
@@ -1016,6 +1024,13 @@ static int ath9k_hif_usb_suspend(struct usb_interface *interface, | |||
1016 | struct hif_device_usb *hif_dev = | 1024 | struct hif_device_usb *hif_dev = |
1017 | (struct hif_device_usb *) usb_get_intfdata(interface); | 1025 | (struct hif_device_usb *) usb_get_intfdata(interface); |
1018 | 1026 | ||
1027 | /* | ||
1028 | * The device has to be set to FULLSLEEP mode in case no | ||
1029 | * interface is up. | ||
1030 | */ | ||
1031 | if (!(hif_dev->flags & HIF_USB_START)) | ||
1032 | ath9k_htc_suspend(hif_dev->htc_handle); | ||
1033 | |||
1019 | ath9k_hif_usb_dealloc_urbs(hif_dev); | 1034 | ath9k_hif_usb_dealloc_urbs(hif_dev); |
1020 | 1035 | ||
1021 | return 0; | 1036 | return 0; |