]> xenbits.xensource.com Git - seabios.git/commitdiff
uhci: Increase bulk transfer STACKTDS to 16
authorKevin O'Connor <kevin@koconnor.net>
Wed, 31 Dec 2014 06:42:38 +0000 (01:42 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 1 Jan 2015 18:51:22 +0000 (13:51 -0500)
Increase the number of simultaneous transfer descriptors that the
driver will build for uhci.  The old value of 4 was a leftover from
when SeaBIOS had a tiny 512 byte extra stack - now that there is a 2K
extra stack there is plenty of space for additional descriptors.
Using a value of 16 should allow for an entire 1ms frame of bulk
transfer content to be setup in advance (assuming the max packet size
is 64 bytes).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/hw/usb-uhci.c

index 7ef50d118c912ecf3817fc07844e9a93cc665bff..06a1d4e1771b9ae2e320f7a2d4d440b4403f8657 100644 (file)
@@ -500,7 +500,7 @@ uhci_send_control(struct usb_pipe *p, int dir, const void *cmd, int cmdsize
     return ret;
 }
 
-#define STACKTDS 4
+#define STACKTDS 16
 #define TDALIGN 16
 
 int
@@ -517,7 +517,7 @@ uhci_send_bulk(struct usb_pipe *p, int dir, void *data, int datasize)
                    | (GET_LOWFLAT(pipe->pipe.ep) << 7));
     int toggle = GET_LOWFLAT(pipe->toggle) ? TD_TOKEN_TOGGLE : 0;
 
-    // Allocate 4 tds on stack (16byte aligned)
+    // Allocate 16 tds on stack (16byte aligned)
     u8 tdsbuf[sizeof(struct uhci_td) * STACKTDS + TDALIGN - 1];
     struct uhci_td *tds = (void*)ALIGN((u32)tdsbuf, TDALIGN);
     memset(tds, 0, sizeof(*tds) * STACKTDS);