u-boot/drivers/usb/gadget
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
..
atmel_usba_udc.c USB: gadget: atmel: zero out allocated requests 2014-07-02 15:45:38 +02:00
atmel_usba_udc.h USB: gadget: add atmel usba udc driver 2013-09-24 17:51:35 +02:00
ci_udc.c usb: ci_udc: use var name ep/ci_ep consistently 2014-07-02 15:45:38 +02:00
ci_udc.h usb: ci_udc: remove controller.items array 2014-07-02 15:45:38 +02:00
composite.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
config.c usb: gadget: config: fix unaligned access issues 2013-09-24 17:51:35 +02:00
core.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
designware_udc.c usb: udc: add udc.h include file 2013-10-20 23:46:38 +02:00
ep0.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
ep0.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
epautoconf.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
ether.c usb: gadget: ether: return error from rx_submit if no request 2013-10-20 23:42:39 +02:00
f_dfu.c dfu: add write error handling 2014-08-09 11:16:58 -04:00
f_dfu.h usb: dfu: f_dfu: Provide infrastructure to adjust DFU's Poll Timeout value 2013-12-18 19:53:19 +01:00
f_fastboot.c usb: fastboot: fix potential buffer overflow 2014-06-25 22:44:40 +02:00
f_mass_storage.c usb:composite: clear the whole common buffer 2014-06-25 22:42:07 +02:00
f_thor.c usb:g_dnl:f_thor: remove memset before memcpy 2014-06-25 22:42:40 +02:00
f_thor.h sizes.h - consolidate for all architectures 2014-03-04 12:15:01 -05:00
fotg210.c usb: gadget: fotg210: EP0 fifo empty indication is non-reliable 2014-01-13 12:15:13 +01:00
g_dnl.c USB: gadget: save driver name before registering it 2014-05-05 08:33:13 +02:00
gadget_chips.h usb: mv_udc: Rename to ci_udc 2014-02-06 04:48:15 +01:00
Makefile usb/gadget: add the fastboot gadget 2014-05-08 10:38:30 +02:00
mpc8xx_udc.c usb: udc: add udc.h include file 2013-10-20 23:46:38 +02:00
ndis.h USB: Add USB RNDIS gadget protocol 2011-02-19 20:32:37 +01:00
omap1510_udc.c usb: udc: add udc.h include file 2013-10-20 23:46:38 +02:00
pxa25x_udc.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
pxa25x_udc.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
pxa27x_udc.c usb: udc: add udc.h include file 2013-10-20 23:46:38 +02:00
regs-otg.h driver:usb:s3c_udc: add support for Exynos4x12 2013-12-02 11:22:32 +09:00
rndis.c Coding Style cleanup: remove trailing empty lines 2011-03-27 21:48:08 +02:00
rndis.h USB-RNDIS: Send RNDIS state on disconnecting 2011-02-19 20:32:38 +01:00
s3c_udc_otg.c usb:udc:samsung: Zero copy approach for data passed to Samsung's UDC driver 2014-02-06 02:22:45 +01:00
s3c_udc_otg_xfer_dma.c usb:udc:samsung: Zero copy approach for data passed to Samsung's UDC driver 2014-02-06 02:22:45 +01:00
storage_common.c usb: ums: remove ci_udc special case 2014-05-07 23:36:58 +02:00
usbstring.c usb: handle NULL table in usb_gadget_get_string 2014-04-30 10:30:57 +02:00