aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/usbtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/misc/usbtest.c')
-rw-r--r--drivers/usb/misc/usbtest.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index bb10846affc3..bd6d00802eab 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -359,8 +359,10 @@ static int simple_io(
359 urb->context = &completion; 359 urb->context = &completion;
360 while (retval == 0 && iterations-- > 0) { 360 while (retval == 0 && iterations-- > 0) {
361 init_completion(&completion); 361 init_completion(&completion);
362 if (usb_pipeout(urb->pipe)) 362 if (usb_pipeout(urb->pipe)) {
363 simple_fill_buf(urb); 363 simple_fill_buf(urb);
364 urb->transfer_flags |= URB_ZERO_PACKET;
365 }
364 retval = usb_submit_urb(urb, GFP_KERNEL); 366 retval = usb_submit_urb(urb, GFP_KERNEL);
365 if (retval != 0) 367 if (retval != 0)
366 break; 368 break;
@@ -1583,8 +1585,8 @@ static struct urb *iso_alloc_urb(
1583 1585
1584 if (bytes < 0 || !desc) 1586 if (bytes < 0 || !desc)
1585 return NULL; 1587 return NULL;
1586 maxp = 0x7ff & le16_to_cpu(desc->wMaxPacketSize); 1588 maxp = 0x7ff & usb_endpoint_maxp(desc);
1587 maxp *= 1 + (0x3 & (le16_to_cpu(desc->wMaxPacketSize) >> 11)); 1589 maxp *= 1 + (0x3 & (usb_endpoint_maxp(desc) >> 11));
1588 packets = DIV_ROUND_UP(bytes, maxp); 1590 packets = DIV_ROUND_UP(bytes, maxp);
1589 1591
1590 urb = usb_alloc_urb(packets, GFP_KERNEL); 1592 urb = usb_alloc_urb(packets, GFP_KERNEL);
@@ -1654,7 +1656,7 @@ test_iso_queue(struct usbtest_dev *dev, struct usbtest_param *param,
1654 "... iso period %d %sframes, wMaxPacket %04x\n", 1656 "... iso period %d %sframes, wMaxPacket %04x\n",
1655 1 << (desc->bInterval - 1), 1657 1 << (desc->bInterval - 1),
1656 (udev->speed == USB_SPEED_HIGH) ? "micro" : "", 1658 (udev->speed == USB_SPEED_HIGH) ? "micro" : "",
1657 le16_to_cpu(desc->wMaxPacketSize)); 1659 usb_endpoint_maxp(desc));
1658 1660
1659 for (i = 0; i < param->sglen; i++) { 1661 for (i = 0; i < param->sglen; i++) {
1660 urbs[i] = iso_alloc_urb(udev, pipe, desc, 1662 urbs[i] = iso_alloc_urb(udev, pipe, desc,
@@ -2298,25 +2300,8 @@ usbtest_probe(struct usb_interface *intf, const struct usb_device_id *id)
2298 2300
2299 usb_set_intfdata(intf, dev); 2301 usb_set_intfdata(intf, dev);
2300 dev_info(&intf->dev, "%s\n", info->name); 2302 dev_info(&intf->dev, "%s\n", info->name);
2301 dev_info(&intf->dev, "%s speed {control%s%s%s%s%s} tests%s\n", 2303 dev_info(&intf->dev, "%s {control%s%s%s%s%s} tests%s\n",
2302 ({ char *tmp; 2304 usb_speed_string(udev->speed),
2303 switch (udev->speed) {
2304 case USB_SPEED_LOW:
2305 tmp = "low";
2306 break;
2307 case USB_SPEED_FULL:
2308 tmp = "full";
2309 break;
2310 case USB_SPEED_HIGH:
2311 tmp = "high";
2312 break;
2313 case USB_SPEED_SUPER:
2314 tmp = "super";
2315 break;
2316 default:
2317 tmp = "unknown";
2318 break;
2319 }; tmp; }),
2320 info->ctrl_out ? " in/out" : "", 2305 info->ctrl_out ? " in/out" : "",
2321 rtest, wtest, 2306 rtest, wtest,
2322 irtest, iwtest, 2307 irtest, iwtest,