ChangeSet 1.1557.49.21, 2004/02/18 13:13:04-08:00, david-b@pacbell.net [PATCH] USB: usbtest, two more protocol cases [USB] usbtest, two more control queueing subtests From Alan Stern. This adds two more "short control read" test cases, both padding the "expected" transfer to end-of-packet. We need both hosts and devices/gadgets to behave correctly here. drivers/usb/misc/usbtest.c | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletion(-) diff -Nru a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c --- a/drivers/usb/misc/usbtest.c Thu Feb 19 17:21:22 2004 +++ b/drivers/usb/misc/usbtest.c Thu Feb 19 17:21:22 2004 @@ -724,7 +724,7 @@ int last; }; -#define NUM_SUBCASES 13 /* how many test subcases here? */ +#define NUM_SUBCASES 15 /* how many test subcases here? */ struct subcase { struct usb_ctrlrequest setup; @@ -952,7 +952,24 @@ req.wValue = cpu_to_le16 (USB_DT_STRING << 8); // string == 0, for language IDs len = sizeof (struct usb_interface_descriptor); + // may succeed when > 4 languages expected = EREMOTEIO; // or EPIPE, if no strings + break; + case 13: // short read, resembling case 10 + req.wValue = cpu_to_le16 ((USB_DT_CONFIG << 8) | 0); + // last data packet "should" be DATA1, not DATA0 + len = 1024 - udev->epmaxpacketin [0]; + expected = -EREMOTEIO; + break; + case 14: // short read; try to fill the last packet + req.wValue = cpu_to_le16 ((USB_DT_DEVICE << 8) | 0); + // device descriptor size == 18 bytes + len = udev->epmaxpacketin [0]; + switch (len) { + case 8: len = 24; break; + case 16: len = 32; break; + } + expected = -EREMOTEIO; break; default: err ("bogus number of ctrl queue testcases!");