diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2014-06-14 12:50:38 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-06-14 12:50:38 -0400 |
commit | 083ee297ef88d42d8681710305c3c8e0c618b303 (patch) | |
tree | 9b13ddeb8f39eeefd5bcf3991de02105e905434e /src/hw/usb-ohci.c | |
parent | b53fe2c8c3a8f5bc885b1aab0c3606a55c5f6bca (diff) | |
download | seabios-083ee297ef88d42d8681710305c3c8e0c618b303.tar.gz |
ohci: Update usb command timeouts to use usb_xfer_time()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/hw/usb-ohci.c')
-rw-r--r-- | src/hw/usb-ohci.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/hw/usb-ohci.c b/src/hw/usb-ohci.c index d55b64a9..f566c4b8 100644 --- a/src/hw/usb-ohci.c +++ b/src/hw/usb-ohci.c @@ -434,10 +434,9 @@ ohci_alloc_pipe(struct usbdevice_s *usbdev } static int -wait_ed(struct ohci_ed *ed) +wait_ed(struct ohci_ed *ed, int timeout) { - // XXX - 500ms just a guess - u32 end = timer_calc(500); + u32 end = timer_calc(timeout); for (;;) { if (ed->hwHeadP == ed->hwTailP) return 0; @@ -497,7 +496,7 @@ ohci_control(struct usb_pipe *p, int dir, const void *cmd, int cmdsize pipe->ed.hwINFO &= ~ED_SKIP; writel(&cntl->regs->cmdstatus, OHCI_CLF); - int ret = wait_ed(&pipe->ed); + int ret = wait_ed(&pipe->ed, usb_xfer_time(p, datasize)); pipe->ed.hwINFO |= ED_SKIP; if (ret) ohci_waittick(cntl); |