[SeaBIOS] [PATCH 1/2] usb: Fix usb_xfer_time() to work when called in 16bit mode.

Kevin O'Connor kevin at koconnor.net
Wed Sep 10 01:35:15 CEST 2014

Make sure to wrap accesses to the usb_pipe struct with GET_LOWFLAT so
that it works in 16bit mode.  This bug impacts both ehci and uhci usb
controllers (it should not impact ohci and xhci as those never call
the function in 16bit mode).

Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
 src/hw/usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/hw/usb.c b/src/hw/usb.c
index 46b46be..930b5d9 100644
--- a/src/hw/usb.c
+++ b/src/hw/usb.c
@@ -195,7 +195,7 @@ usb_xfer_time(struct usb_pipe *pipe, int datalen)
     // set_address commands where we don't want to stall the boot if
     // the device doesn't actually exist.  Add 100ms to account for
     // any controller delays.
-    if (!pipe->devaddr)
+    if (!GET_LOWFLAT(pipe->devaddr))
         return USB_TIME_STATUS + 100;
     return USB_TIME_COMMAND + 100;

More information about the SeaBIOS mailing list