USB: Add SuperSpeed to the list of USB device speeds.
[safe/jmp/linux-2.6] / drivers / usb / core / urb.c
index 3376055..02eb0ef 100644 (file)
@@ -351,6 +351,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
        if (xfertype == USB_ENDPOINT_XFER_ISOC) {
                int     n, len;
 
+               /* FIXME SuperSpeed isoc endpoints have up to 16 bursts */
                /* "high bandwidth" mode, 1-3 packets/uframe? */
                if (dev->speed == USB_SPEED_HIGH) {
                        int     mult = 1 + ((max >> 11) & 0x03);
@@ -426,6 +427,11 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
                        return -EINVAL;
                /* too big? */
                switch (dev->speed) {
+               case USB_SPEED_SUPER:   /* units are 125us */
+                       /* Handle up to 2^(16-1) microframes */
+                       if (urb->interval > (1 << 15))
+                               return -EINVAL;
+                       max = 1 << 15;
                case USB_SPEED_HIGH:    /* units are microframes */
                        /* NOTE usb handles 2^15 */
                        if (urb->interval > (1024 * 8))