Minor - USB OHCI interrupt queue should be one larger.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 28 Feb 2010 07:36:32 +0000 (02:36 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 10 Mar 2010 00:59:52 +0000 (19:59 -0500)
One of the entries in the queue can't be used, so the total queue size
needs to be one larger than it currently is.

src/usb-ohci.c

index 28bbdc664c4744b3b86cb473458f02603641a3c7..0048e2b48dc586db08dd4ae3d251ee2042ebf182 100644 (file)
@@ -429,7 +429,7 @@ ohci_alloc_intr_pipe(struct usb_pipe *dummy, int frameexp)
     int devaddr = dummy->devaddr | (dummy->ep << 7);
     // Determine number of entries needed for 2 timer ticks.
     int ms = 1<<frameexp;
-    int count = DIV_ROUND_UP(PIT_TICK_INTERVAL * 1000 * 2, PIT_TICK_RATE * ms);
+    int count = DIV_ROUND_UP(PIT_TICK_INTERVAL * 1000 * 2, PIT_TICK_RATE * ms)+1;
     struct ohci_pipe *pipe = malloc_low(sizeof(*pipe));
     struct ohci_td *tds = malloc_low(sizeof(*tds) * count);
     void *data = malloc_low(maxpacket * count);