Set the "depth" flag on bulk transactions. Since SeaBIOS doesn't use bandwidth reclamation, without the depth flag the uhci controller will only transfer one bulk packet per 1 ms frame. This results in a maximum of 64 bytes per millisecond, which severely limits the transfer rate.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/hw/usb-uhci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/hw/usb-uhci.c b/src/hw/usb-uhci.c index 6dcc340..7ef50d1 100644 --- a/src/hw/usb-uhci.c +++ b/src/hw/usb-uhci.c @@ -537,9 +537,9 @@ uhci_send_bulk(struct usb_pipe *p, int dir, void *data, int datasize) int transfer = datasize; if (transfer > maxpacket) transfer = maxpacket; - struct uhci_td *nexttd_fl = MAKE_FLATPTR(GET_SEG(SS) - , &tds[tdpos % STACKTDS]); - td->link = (transfer==datasize ? UHCI_PTR_TERM : (u32)nexttd_fl); + u32 nexttd = (u32)MAKE_FLATPTR(GET_SEG(SS), &tds[tdpos % STACKTDS]); + td->link = (transfer==datasize + ? UHCI_PTR_TERM : (nexttd | UHCI_PTR_DEPTH)); td->token = (uhci_explen(transfer) | toggle | (devaddr << TD_TOKEN_DEVADDR_SHIFT) | (dir ? USB_PID_IN : USB_PID_OUT));
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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hw/usb-uhci.c b/src/hw/usb-uhci.c index 7ef50d1..4eea979 100644 --- a/src/hw/usb-uhci.c +++ b/src/hw/usb-uhci.c @@ -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
On Wed, Dec 31, 2014 at 11:32:12AM -0500, Kevin O'Connor wrote:
Set the "depth" flag on bulk transactions. Since SeaBIOS doesn't use bandwidth reclamation, without the depth flag the uhci controller will only transfer one bulk packet per 1 ms frame. This results in a maximum of 64 bytes per millisecond, which severely limits the transfer rate.
FYI, I committed these two patches.
-Kevin