Commit 28f5250b authored by Martin Diehl's avatar Martin Diehl Committed by Greg Kroah-Hartman

[PATCH] usbtest updates

Various small fixes and adds ids for new test firmware.
parent b015fe38
...@@ -109,7 +109,7 @@ static struct urb *simple_alloc_urb ( ...@@ -109,7 +109,7 @@ static struct urb *simple_alloc_urb (
usb_fill_bulk_urb (urb, udev, pipe, 0, bytes, simple_callback, 0); usb_fill_bulk_urb (urb, udev, pipe, 0, bytes, simple_callback, 0);
urb->interval = (udev->speed == USB_SPEED_HIGH) urb->interval = (udev->speed == USB_SPEED_HIGH)
? (INTERRUPT_RATE << 3) ? (INTERRUPT_RATE << 3)
: INTERRUPT_RATE, : INTERRUPT_RATE;
urb->transfer_flags = URB_NO_DMA_MAP; urb->transfer_flags = URB_NO_DMA_MAP;
if (usb_pipein (pipe)) if (usb_pipein (pipe))
urb->transfer_flags |= URB_SHORT_NOT_OK; urb->transfer_flags |= URB_SHORT_NOT_OK;
...@@ -142,7 +142,7 @@ static int simple_io ( ...@@ -142,7 +142,7 @@ static int simple_io (
int retval = 0; int retval = 0;
urb->context = &completion; urb->context = &completion;
while (iterations-- > 0 && retval == 0) { while (retval == 0 && iterations-- > 0) {
init_completion (&completion); init_completion (&completion);
if ((retval = usb_submit_urb (urb, SLAB_KERNEL)) != 0) if ((retval = usb_submit_urb (urb, SLAB_KERNEL)) != 0)
break; break;
...@@ -155,7 +155,7 @@ static int simple_io ( ...@@ -155,7 +155,7 @@ static int simple_io (
if (vary) { if (vary) {
int len = urb->transfer_buffer_length; int len = urb->transfer_buffer_length;
len += max; len += vary;
len %= max; len %= max;
if (len == 0) if (len == 0)
len = (vary < max) ? vary : max; len = (vary < max) ? vary : max;
...@@ -347,7 +347,7 @@ static int set_altsetting (struct usbtest_dev *dev, int alternate) ...@@ -347,7 +347,7 @@ static int set_altsetting (struct usbtest_dev *dev, int alternate)
ep &= USB_ENDPOINT_NUMBER_MASK; ep &= USB_ENDPOINT_NUMBER_MASK;
usb_settoggle (udev, ep, out, 0); usb_settoggle (udev, ep, out, 0);
(out ? udev->epmaxpacketout : udev->epmaxpacketin ) [ep] (out ? udev->epmaxpacketout : udev->epmaxpacketin ) [ep]
= iface_as->endpoint [ep].wMaxPacketSize; = iface_as->endpoint [i].wMaxPacketSize;
} }
return 0; return 0;
...@@ -659,7 +659,7 @@ static int usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *b ...@@ -659,7 +659,7 @@ static int usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *b
break; break;
dbg ("%s TEST 4: read/%d 0..%d bytes %u times", dev->id, dbg ("%s TEST 4: read/%d 0..%d bytes %u times", dev->id,
param->vary, param->length, param->iterations); param->vary, param->length, param->iterations);
urb = simple_alloc_urb (udev, dev->out_pipe, param->length); urb = simple_alloc_urb (udev, dev->in_pipe, param->length);
if (!urb) { if (!urb) {
retval = -ENOMEM; retval = -ENOMEM;
break; break;
...@@ -907,6 +907,14 @@ static struct usbtest_info ez2_info = { ...@@ -907,6 +907,14 @@ static struct usbtest_info ez2_info = {
.alt = 1, .alt = 1,
}; };
/* ezusb family device with dedicated usb test firmware*/
static struct usbtest_info fw_info = {
.name = "usb test device",
.ep_in = 2,
.ep_out = 2,
.alt = 0,
};
#ifdef IBOT2 #ifdef IBOT2
/* this is a nice source of high speed bulk data; /* this is a nice source of high speed bulk data;
* uses an FX2, with firmware provided in the device * uses an FX2, with firmware provided in the device
...@@ -962,6 +970,11 @@ static struct usb_device_id id_table [] = { ...@@ -962,6 +970,11 @@ static struct usb_device_id id_table [] = {
.driver_info = (unsigned long) &ez2_info, .driver_info = (unsigned long) &ez2_info,
}, },
/* re-enumerated usb test device firmware */
{ USB_DEVICE (0xfff0, 0xfff0),
.driver_info = (unsigned long) &fw_info,
},
#ifdef KEYSPAN_19Qi #ifdef KEYSPAN_19Qi
/* Keyspan 19qi uses an21xx (original EZ-USB) */ /* Keyspan 19qi uses an21xx (original EZ-USB) */
// this does not coexist with the real Keyspan 19qi driver! // this does not coexist with the real Keyspan 19qi driver!
......
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