aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2014-09-09 18:24:00 -0400
committerKevin O'Connor <kevin@koconnor.net>2014-09-09 18:24:00 -0400
commit0806e9e206f0a11be750ead10007f12d4f829989 (patch)
tree91a3973ddbe441170242d524ce96b2c8cc1d3b2e
parenta2959d67c00a8719d8b0eff9296d2b10eead0e22 (diff)
downloadseabios-0806e9e206f0a11be750ead10007f12d4f829989.zip
seabios-0806e9e206f0a11be750ead10007f12d4f829989.tar.gz
seabios-0806e9e206f0a11be750ead10007f12d4f829989.tar.bz2
usb: Fix usb_xfer_time() to work when called in 16bit mode.
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>
-rw-r--r--src/hw/usb.c2
1 files changed, 1 insertions, 1 deletions
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;
}