Commit 3342ecda authored by Sarah Sharp's avatar Sarah Sharp Committed by Greg Kroah-Hartman

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: default avatarSarah 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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 36d0344c
...@@ -347,13 +347,8 @@ static int usbtmc_ioctl_abort_bulk_out(struct usbtmc_device_data *data) ...@@ -347,13 +347,8 @@ static int usbtmc_ioctl_abort_bulk_out(struct usbtmc_device_data *data)
goto exit; goto exit;
usbtmc_abort_bulk_out_clear_halt: usbtmc_abort_bulk_out_clear_halt:
rv = usb_control_msg(data->usb_dev, rv = usb_clear_halt(data->usb_dev,
usb_sndctrlpipe(data->usb_dev, 0), usb_sndbulkpipe(data->usb_dev, data->bulk_out));
USB_REQ_CLEAR_FEATURE,
USB_DIR_OUT | USB_TYPE_STANDARD |
USB_RECIP_ENDPOINT,
USB_ENDPOINT_HALT, data->bulk_out, buffer,
0, USBTMC_TIMEOUT);
if (rv < 0) { if (rv < 0) {
dev_err(dev, "usb_control_msg returned %d\n", rv); dev_err(dev, "usb_control_msg returned %d\n", rv);
...@@ -708,14 +703,8 @@ static int usbtmc_ioctl_clear(struct usbtmc_device_data *data) ...@@ -708,14 +703,8 @@ static int usbtmc_ioctl_clear(struct usbtmc_device_data *data)
usbtmc_clear_bulk_out_halt: usbtmc_clear_bulk_out_halt:
rv = usb_control_msg(data->usb_dev, rv = usb_clear_halt(data->usb_dev,
usb_sndctrlpipe(data->usb_dev, 0), usb_sndbulkpipe(data->usb_dev, data->bulk_out));
USB_REQ_CLEAR_FEATURE,
USB_DIR_OUT | USB_TYPE_STANDARD |
USB_RECIP_ENDPOINT,
USB_ENDPOINT_HALT,
data->bulk_out, buffer, 0,
USBTMC_TIMEOUT);
if (rv < 0) { if (rv < 0) {
dev_err(dev, "usb_control_msg returned %d\n", rv); dev_err(dev, "usb_control_msg returned %d\n", rv);
goto exit; goto exit;
...@@ -736,13 +725,8 @@ static int usbtmc_ioctl_clear_out_halt(struct usbtmc_device_data *data) ...@@ -736,13 +725,8 @@ static int usbtmc_ioctl_clear_out_halt(struct usbtmc_device_data *data)
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
rv = usb_control_msg(data->usb_dev, rv = usb_clear_halt(data->usb_dev,
usb_sndctrlpipe(data->usb_dev, 0), usb_sndbulkpipe(data->usb_dev, data->bulk_out));
USB_REQ_CLEAR_FEATURE,
USB_DIR_OUT | USB_TYPE_STANDARD |
USB_RECIP_ENDPOINT,
USB_ENDPOINT_HALT, data->bulk_out,
buffer, 0, USBTMC_TIMEOUT);
if (rv < 0) { if (rv < 0) {
dev_err(&data->usb_dev->dev, "usb_control_msg returned %d\n", 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,12 +749,8 @@ static int usbtmc_ioctl_clear_in_halt(struct usbtmc_device_data *data)
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
rv = usb_control_msg(data->usb_dev, usb_sndctrlpipe(data->usb_dev, 0), rv = usb_clear_halt(data->usb_dev,
USB_REQ_CLEAR_FEATURE, usb_rcvbulkpipe(data->usb_dev, data->bulk_in));
USB_DIR_OUT | USB_TYPE_STANDARD |
USB_RECIP_ENDPOINT,
USB_ENDPOINT_HALT, data->bulk_in, buffer, 0,
USBTMC_TIMEOUT);
if (rv < 0) { if (rv < 0) {
dev_err(&data->usb_dev->dev, "usb_control_msg returned %d\n", dev_err(&data->usb_dev->dev, "usb_control_msg returned %d\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment