u-boot-brain/drivers/usb
Stephen Warren 3ee9593fce dfu: add write error handling
Fix calls to dfu_write() and dfu_flush() to detect errors in the I/O
itself. This could happen due to problems with the storage medium, or
simply when trying to write a FAT/ext file that is larger than the buffer
dfu_mmc.c maintains for this purpose.

Signal the error by switching the DFU state/status. This will be picked
up by the DFU client when it sends the next DFU request. Note that errors
can't simply be returned from e.g. dnload_request_complete(), since that
function has no way to pass errors back to the DFU client; a call to
dnload_request_complete() simply means that a USB OUT completed.

This error state/status needs to be cleared when the next DFU client
connects. While there is a DFU_CLRSTATUS request, no DFU client seems to
send this. Hence, clear this when selecting the USB alternate setting on
the USB interface.

Finally, dfu.c relies on a call to dfu_flush() to clear up the internal
state of the write transaction. Now that errors in dfu_write() are
detected, dfu_flush() may no longer be called for every transaction.
Separate out the cleanup code into a new function, and call it whenever
dfu_write() fails, as well as from any call to dfu_flush().

Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-08-09 11:16:58 -04:00
..
eth usb: eth: smsc95xx: add LAN9500A device ID 2014-06-25 22:46:28 +02:00
gadget dfu: add write error handling 2014-08-09 11:16:58 -04:00
host driver/usb: include upper/lower_32_bits() from linux/compat.h 2014-07-22 07:44:24 -04:00
musb usb: create common header virtual root hub descriptors 2014-03-10 18:53:36 +01:00
musb-new musb-new, dfu: first send request answer then call completions 2014-05-08 10:38:30 +02:00
phy usb: phy: omap_usb_phy: implement usb_phy_power() for AM437x 2014-07-09 22:11:51 +02:00
ulpi drivers: usb: convert makefiles to Kbuild style 2013-10-31 13:25:38 -04:00