]> xenbits.xensource.com Git - seabios.git/commitdiff
usb: Fix usb_xfer_time() to work when called in 16bit mode.
authorKevin O'Connor <kevin@koconnor.net>
Tue, 9 Sep 2014 22:24:00 +0000 (18:24 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 9 Sep 2014 22:24:00 +0000 (18:24 -0400)
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@koconnor.net>
src/hw/usb.c

index 46b46be8fe115980604c945f13ecece83705c879..930b5d9b7b4ff34ac9408918fa5a249aa843255e 100644 (file)
@@ -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;
 }