diff options
-rw-r--r-- | drivers/net/wireless/ath/carl9170/carl9170.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/carl9170/usb.c | 31 |
2 files changed, 28 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/carl9170/carl9170.h b/drivers/net/wireless/ath/carl9170/carl9170.h index 8596aba34f96..237d0cda1bcb 100644 --- a/drivers/net/wireless/ath/carl9170/carl9170.h +++ b/drivers/net/wireless/ath/carl9170/carl9170.h | |||
@@ -256,6 +256,7 @@ struct ar9170 { | |||
256 | atomic_t rx_work_urbs; | 256 | atomic_t rx_work_urbs; |
257 | atomic_t rx_pool_urbs; | 257 | atomic_t rx_pool_urbs; |
258 | kernel_ulong_t features; | 258 | kernel_ulong_t features; |
259 | bool usb_ep_cmd_is_bulk; | ||
259 | 260 | ||
260 | /* firmware settings */ | 261 | /* firmware settings */ |
261 | struct completion fw_load_wait; | 262 | struct completion fw_load_wait; |
diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c index f35c7f30f9a6..c9f93310c0d6 100644 --- a/drivers/net/wireless/ath/carl9170/usb.c +++ b/drivers/net/wireless/ath/carl9170/usb.c | |||
@@ -621,9 +621,16 @@ int __carl9170_exec_cmd(struct ar9170 *ar, struct carl9170_cmd *cmd, | |||
621 | goto err_free; | 621 | goto err_free; |
622 | } | 622 | } |
623 | 623 | ||
624 | usb_fill_int_urb(urb, ar->udev, usb_sndintpipe(ar->udev, | 624 | if (ar->usb_ep_cmd_is_bulk) |
625 | AR9170_USB_EP_CMD), cmd, cmd->hdr.len + 4, | 625 | usb_fill_bulk_urb(urb, ar->udev, |
626 | carl9170_usb_cmd_complete, ar, 1); | 626 | usb_sndbulkpipe(ar->udev, AR9170_USB_EP_CMD), |
627 | cmd, cmd->hdr.len + 4, | ||
628 | carl9170_usb_cmd_complete, ar); | ||
629 | else | ||
630 | usb_fill_int_urb(urb, ar->udev, | ||
631 | usb_sndintpipe(ar->udev, AR9170_USB_EP_CMD), | ||
632 | cmd, cmd->hdr.len + 4, | ||
633 | carl9170_usb_cmd_complete, ar, 1); | ||
627 | 634 | ||
628 | if (free_buf) | 635 | if (free_buf) |
629 | urb->transfer_flags |= URB_FREE_BUFFER; | 636 | urb->transfer_flags |= URB_FREE_BUFFER; |
@@ -1032,9 +1039,10 @@ static void carl9170_usb_firmware_step2(const struct firmware *fw, | |||
1032 | static int carl9170_usb_probe(struct usb_interface *intf, | 1039 | static int carl9170_usb_probe(struct usb_interface *intf, |
1033 | const struct usb_device_id *id) | 1040 | const struct usb_device_id *id) |
1034 | { | 1041 | { |
1042 | struct usb_endpoint_descriptor *ep; | ||
1035 | struct ar9170 *ar; | 1043 | struct ar9170 *ar; |
1036 | struct usb_device *udev; | 1044 | struct usb_device *udev; |
1037 | int err; | 1045 | int i, err; |
1038 | 1046 | ||
1039 | err = usb_reset_device(interface_to_usbdev(intf)); | 1047 | err = usb_reset_device(interface_to_usbdev(intf)); |
1040 | if (err) | 1048 | if (err) |
@@ -1050,6 +1058,21 @@ static int carl9170_usb_probe(struct usb_interface *intf, | |||
1050 | ar->intf = intf; | 1058 | ar->intf = intf; |
1051 | ar->features = id->driver_info; | 1059 | ar->features = id->driver_info; |
1052 | 1060 | ||
1061 | /* We need to remember the type of endpoint 4 because it differs | ||
1062 | * between high- and full-speed configuration. The high-speed | ||
1063 | * configuration specifies it as interrupt and the full-speed | ||
1064 | * configuration as bulk endpoint. This information is required | ||
1065 | * later when sending urbs to that endpoint. | ||
1066 | */ | ||
1067 | for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; ++i) { | ||
1068 | ep = &intf->cur_altsetting->endpoint[i].desc; | ||
1069 | |||
1070 | if (usb_endpoint_num(ep) == AR9170_USB_EP_CMD && | ||
1071 | usb_endpoint_dir_out(ep) && | ||
1072 | usb_endpoint_type(ep) == USB_ENDPOINT_XFER_BULK) | ||
1073 | ar->usb_ep_cmd_is_bulk = true; | ||
1074 | } | ||
1075 | |||
1053 | usb_set_intfdata(intf, ar); | 1076 | usb_set_intfdata(intf, ar); |
1054 | SET_IEEE80211_DEV(ar->hw, &intf->dev); | 1077 | SET_IEEE80211_DEV(ar->hw, &intf->dev); |
1055 | 1078 | ||