aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2009-12-03 14:35:59 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 14:55:27 -0500
commit3342ecda3ffb059f2ffd765a71d9579f0aa036eb (patch)
treec7c30e7609d1217d0a4fe982777b42813f5b3ba7 /drivers/usb
parent36d0344c254a7b333272757f858c403ea3a2d29f (diff)
USB: usbtmc: Use usb_clear_halt() instead of custom code.
Make the USB Test & Measurement driver use usb_clear_halt() instead of usb_control_msg() to clear a stalled endpoint. This will allow devices to be tested under an xHCI host controller. The endpoint stall will not be cleared in the internal xHCI hardware state unless usb_clear_halt() is used. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: Steve Holland <sdh4@iastate.edu> Cc: Oliver Neukum <oliver@neukum.org> Cc: Jouni Ryno <Jouni.Ryno@fmi.fi> Cc: Gergely Imreh <imrehg@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/class/usbtmc.c36
1 files changed, 8 insertions, 28 deletions
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 619cc9975209..7c5f4e32c920 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -347,13 +347,8 @@ usbtmc_abort_bulk_out_check_status:
347 goto exit; 347 goto exit;
348 348
349usbtmc_abort_bulk_out_clear_halt: 349usbtmc_abort_bulk_out_clear_halt:
350 rv = usb_control_msg(data->usb_dev, 350 rv = usb_clear_halt(data->usb_dev,
351 usb_sndctrlpipe(data->usb_dev, 0), 351 usb_sndbulkpipe(data->usb_dev, data->bulk_out));
352 USB_REQ_CLEAR_FEATURE,
353 USB_DIR_OUT | USB_TYPE_STANDARD |
354 USB_RECIP_ENDPOINT,
355 USB_ENDPOINT_HALT, data->bulk_out, buffer,
356 0, USBTMC_TIMEOUT);
357 352
358 if (rv < 0) { 353 if (rv < 0) {
359 dev_err(dev, "usb_control_msg returned %d\n", rv); 354 dev_err(dev, "usb_control_msg returned %d\n", rv);
@@ -708,14 +703,8 @@ usbtmc_clear_check_status:
708 703
709usbtmc_clear_bulk_out_halt: 704usbtmc_clear_bulk_out_halt:
710 705
711 rv = usb_control_msg(data->usb_dev, 706 rv = usb_clear_halt(data->usb_dev,
712 usb_sndctrlpipe(data->usb_dev, 0), 707 usb_sndbulkpipe(data->usb_dev, data->bulk_out));
713 USB_REQ_CLEAR_FEATURE,
714 USB_DIR_OUT | USB_TYPE_STANDARD |
715 USB_RECIP_ENDPOINT,
716 USB_ENDPOINT_HALT,
717 data->bulk_out, buffer, 0,
718 USBTMC_TIMEOUT);
719 if (rv < 0) { 708 if (rv < 0) {
720 dev_err(dev, "usb_control_msg returned %d\n", rv); 709 dev_err(dev, "usb_control_msg returned %d\n", rv);
721 goto exit; 710 goto exit;
@@ -736,13 +725,8 @@ static int usbtmc_ioctl_clear_out_halt(struct usbtmc_device_data *data)
736 if (!buffer) 725 if (!buffer)
737 return -ENOMEM; 726 return -ENOMEM;
738 727
739 rv = usb_control_msg(data->usb_dev, 728 rv = usb_clear_halt(data->usb_dev,
740 usb_sndctrlpipe(data->usb_dev, 0), 729 usb_sndbulkpipe(data->usb_dev, data->bulk_out));
741 USB_REQ_CLEAR_FEATURE,
742 USB_DIR_OUT | USB_TYPE_STANDARD |
743 USB_RECIP_ENDPOINT,
744 USB_ENDPOINT_HALT, data->bulk_out,
745 buffer, 0, USBTMC_TIMEOUT);
746 730
747 if (rv < 0) { 731 if (rv < 0) {
748 dev_err(&data->usb_dev->dev, "usb_control_msg returned %d\n", 732 dev_err(&data->usb_dev->dev, "usb_control_msg returned %d\n",
@@ -765,12 +749,8 @@ static int usbtmc_ioctl_clear_in_halt(struct usbtmc_device_data *data)
765 if (!buffer) 749 if (!buffer)
766 return -ENOMEM; 750 return -ENOMEM;
767 751
768 rv = usb_control_msg(data->usb_dev, usb_sndctrlpipe(data->usb_dev, 0), 752 rv = usb_clear_halt(data->usb_dev,
769 USB_REQ_CLEAR_FEATURE, 753 usb_rcvbulkpipe(data->usb_dev, data->bulk_in));
770 USB_DIR_OUT | USB_TYPE_STANDARD |
771 USB_RECIP_ENDPOINT,
772 USB_ENDPOINT_HALT, data->bulk_in, buffer, 0,
773 USBTMC_TIMEOUT);
774 754
775 if (rv < 0) { 755 if (rv < 0) {
776 dev_err(&data->usb_dev->dev, "usb_control_msg returned %d\n", 756 dev_err(&data->usb_dev->dev, "usb_control_msg returned %d\n",