aboutsummaryrefslogtreecommitdiff
path: root/src/hw
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2014-06-14 12:50:38 -0400
committerKevin O'Connor <kevin@koconnor.net>2014-06-14 12:50:38 -0400
commit083ee297ef88d42d8681710305c3c8e0c618b303 (patch)
tree9b13ddeb8f39eeefd5bcf3991de02105e905434e /src/hw
parentb53fe2c8c3a8f5bc885b1aab0c3606a55c5f6bca (diff)
downloadseabios-083ee297ef88d42d8681710305c3c8e0c618b303.zip
seabios-083ee297ef88d42d8681710305c3c8e0c618b303.tar.gz
seabios-083ee297ef88d42d8681710305c3c8e0c618b303.tar.bz2
ohci: Update usb command timeouts to use usb_xfer_time()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/hw')
-rw-r--r--src/hw/usb-ohci.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/hw/usb-ohci.c b/src/hw/usb-ohci.c
index d55b64a..f566c4b 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);