ehci: Fail for multi-transaction interrupt transfers
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
Thu, 9 Aug 2012 21:50:44 +0000 (23:50 +0200)
committerMarek Vasut <marex@denx.de>
Sat, 1 Sep 2012 14:21:51 +0000 (16:21 +0200)
Interrupt transfers requiring several transactions are not supported by
submit_int_msg() because bInterval is ignored. This patch returns a failure code
and prints an error message in this case.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Ilya Yanok <ilya.yanok@cogentembedded.com>
Cc: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
drivers/usb/host/ehci-hcd.c

index 5b3b9062f79490876c4f114bfa700d1e6bc4b157..2a0038931f01738d724c415865627cec2fdb1921 100644 (file)
@@ -819,8 +819,17 @@ int
 submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
               int length, int interval)
 {
-
        debug("dev=%p, pipe=%lu, buffer=%p, length=%d, interval=%d",
              dev, pipe, buffer, length, interval);
+
+       /*
+        * Interrupt transfers requiring several transactions are not supported
+        * because bInterval is ignored.
+        */
+       if (length > usb_maxpacket(dev, pipe)) {
+               printf("%s: Interrupt transfers requiring several transactions "
+                       "are not supported.\n", __func__);
+               return -1;
+       }
        return ehci_submit_async(dev, pipe, buffer, length, NULL);
 }