* grub-core/disk/usbms.c: Retry on unknown errors.

Reuse the same tag on retries.
This commit is contained in:
Aleš Nesrsta 2013-12-18 19:00:45 +01:00 committed by Vladimir Serbinenko
parent e3ef0d30cf
commit b9f03772b5
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2013-12-18 Aleš Nesrsta <starous@volny.cz>
* grub-core/disk/usbms.c: Retry on unknown errors.
Reuse the same tag on retries.
2013-12-18 Aleš Nesrsta <starous@volny.cz>
* grub-core/bus/usb/ehci.c: Fix handling of newborn transfers.

View file

@ -298,6 +298,8 @@ grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd,
grub_usb_err_t errCSW = GRUB_USB_ERR_NONE;
int retrycnt = 3 + 1;
tag++;
retry:
retrycnt--;
if (retrycnt == 0)
@ -306,7 +308,7 @@ grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd,
/* Setup the request. */
grub_memset (&cbw, 0, sizeof (cbw));
cbw.signature = grub_cpu_to_le32 (0x43425355);
cbw.tag = tag++;
cbw.tag = tag;
cbw.transfer_length = grub_cpu_to_le32 (size);
cbw.flags = (!read_write) << GRUB_USBMS_DIRECTION_BIT;
cbw.lun = scsi->lun; /* In USB MS CBW are LUN bits on another place than in SCSI CDB, both should be set correctly. */
@ -335,7 +337,7 @@ grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd,
grub_usb_clear_halt (dev->dev, dev->out->endp_addr);
goto CheckCSW;
}
return grub_error (GRUB_ERR_IO, "USB Mass Storage request failed");
goto retry;
}
/* Read/write the data, (maybe) according to specification. */