aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-sched.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index ebcca9700671..88419c6823a8 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -707,6 +707,7 @@ iso_stream_init (
707 } else { 707 } else {
708 u32 addr; 708 u32 addr;
709 int think_time; 709 int think_time;
710 int hs_transfers;
710 711
711 addr = dev->ttport << 24; 712 addr = dev->ttport << 24;
712 if (!ehci_is_TDI(ehci) 713 if (!ehci_is_TDI(ehci)
@@ -719,6 +720,7 @@ iso_stream_init (
719 think_time = dev->tt ? dev->tt->think_time : 0; 720 think_time = dev->tt ? dev->tt->think_time : 0;
720 stream->tt_usecs = NS_TO_US (think_time + usb_calc_bus_time ( 721 stream->tt_usecs = NS_TO_US (think_time + usb_calc_bus_time (
721 dev->speed, is_input, 1, maxp)); 722 dev->speed, is_input, 1, maxp));
723 hs_transfers = max (1u, (maxp + 187) / 188);
722 if (is_input) { 724 if (is_input) {
723 u32 tmp; 725 u32 tmp;
724 726
@@ -727,12 +729,11 @@ iso_stream_init (
727 stream->usecs = HS_USECS_ISO (1); 729 stream->usecs = HS_USECS_ISO (1);
728 stream->raw_mask = 1; 730 stream->raw_mask = 1;
729 731
730 /* pessimistic c-mask */ 732 /* c-mask as specified in USB 2.0 11.18.4 3.c */
731 tmp = usb_calc_bus_time (USB_SPEED_FULL, 1, 0, maxp) 733 tmp = (1 << (hs_transfers + 2)) - 1;
732 / (125 * 1000); 734 stream->raw_mask |= tmp << (8 + 2);
733 stream->raw_mask |= 3 << (tmp + 9);
734 } else 735 } else
735 stream->raw_mask = smask_out [maxp / 188]; 736 stream->raw_mask = smask_out [hs_transfers - 1];
736 bandwidth = stream->usecs + stream->c_usecs; 737 bandwidth = stream->usecs + stream->c_usecs;
737 bandwidth /= 1 << (interval + 2); 738 bandwidth /= 1 << (interval + 2);
738 739