* grub-core/disk/usbms.c: Retry on unknown errors.
Reuse the same tag on retries.
This commit is contained in:
parent
e3ef0d30cf
commit
b9f03772b5
2 changed files with 9 additions and 2 deletions
|
@ -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>
|
2013-12-18 Aleš Nesrsta <starous@volny.cz>
|
||||||
|
|
||||||
* grub-core/bus/usb/ehci.c: Fix handling of newborn transfers.
|
* grub-core/bus/usb/ehci.c: Fix handling of newborn transfers.
|
||||||
|
|
|
@ -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;
|
grub_usb_err_t errCSW = GRUB_USB_ERR_NONE;
|
||||||
int retrycnt = 3 + 1;
|
int retrycnt = 3 + 1;
|
||||||
|
|
||||||
|
tag++;
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
retrycnt--;
|
retrycnt--;
|
||||||
if (retrycnt == 0)
|
if (retrycnt == 0)
|
||||||
|
@ -306,7 +308,7 @@ grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd,
|
||||||
/* Setup the request. */
|
/* Setup the request. */
|
||||||
grub_memset (&cbw, 0, sizeof (cbw));
|
grub_memset (&cbw, 0, sizeof (cbw));
|
||||||
cbw.signature = grub_cpu_to_le32 (0x43425355);
|
cbw.signature = grub_cpu_to_le32 (0x43425355);
|
||||||
cbw.tag = tag++;
|
cbw.tag = tag;
|
||||||
cbw.transfer_length = grub_cpu_to_le32 (size);
|
cbw.transfer_length = grub_cpu_to_le32 (size);
|
||||||
cbw.flags = (!read_write) << GRUB_USBMS_DIRECTION_BIT;
|
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. */
|
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);
|
grub_usb_clear_halt (dev->dev, dev->out->endp_addr);
|
||||||
goto CheckCSW;
|
goto CheckCSW;
|
||||||
}
|
}
|
||||||
return grub_error (GRUB_ERR_IO, "USB Mass Storage request failed");
|
goto retry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read/write the data, (maybe) according to specification. */
|
/* Read/write the data, (maybe) according to specification. */
|
||||||
|
|
Loading…
Add table
Reference in a new issue