Add possibility of bulk reading with short timeout

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-07-18 21:35:22 +02:00
parent aa86530e38
commit d556277751
4 changed files with 26 additions and 10 deletions

View file

@ -436,7 +436,8 @@ grub_uhci_transaction (struct grub_uhci *u, unsigned int endp,
static grub_usb_err_t
grub_uhci_transfer (grub_usb_controller_t dev,
grub_usb_transfer_t transfer)
grub_usb_transfer_t transfer,
int timeout)
{
struct grub_uhci *u = (struct grub_uhci *) dev->data;
grub_uhci_qh_t qh;
@ -496,7 +497,7 @@ grub_uhci_transfer (grub_usb_controller_t dev,
/* Wait until either the transaction completed or an error
occurred. */
endtime = grub_get_time_ms () + 1000;
endtime = grub_get_time_ms () + timeout;
for (;;)
{
grub_uhci_td_t errtd;