u-boot/drivers/usb/gadget
Vitaly Kuzmichev 98fae9707f USB-CDC: Prevent rx_req being enqueued twice
After gadget reinitializaton (after tftp has been done once)
packet_received may become equal to 1 due to nuking OUT_EP
while disabling it in eth_reset_config.

rx_submit called from usb_eth_init queues rx_req first time.
But the first call of usb_eth_recv from NetLoop queues rx_req
again due to packet_received = 1.

The following flow shows the path of functions calls when
this happens:

 net/net.c:NetLoop
 |
 +-net/eth.c:eth_init
 |   ether.c:usb_eth_init
 |   |
 |   +-udc_driver:usb_gadget_handle_interrupts
 |   |   udc_driver:...
 |   |     ether.c:eth_setup
 |   |       ether.c:eth_set_config
 |   |         ether.c:eth_reset_config
 |   |           udc_driver:usb_ep_disable
 |   |             udc_driver:nuke
 |   |               ether.c:rx_complete
 |   |                 ether.c: packet_received = 1;
 |   |
 |   +-ether.c:rx_submit
 |       udc_driver:usb_ep_queue --- The first time when rx_req is queued
 |
 +-net/eth.c:eth_rx
     ether.c:usb_eth_recv
     |
     +-udc_driver:usb_gadget_handle_interrupts
     |   udc_driver:... --- no interrupts, returning
     +-ether.c: if (packet_received) { ...
         ether.c:rx_submit
           udc_driver:usb_ep_queue --- The second time!

Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
2010-10-13 12:07:58 +02:00
..
config.c USB-CDC: Fix coding style issues 2010-09-20 21:57:17 +02:00
core.c drivers/usb: regorganisation 2009-04-06 20:40:46 +02:00
ep0.c drivers/usb: regorganisation 2009-04-06 20:40:46 +02:00
ep0.h drivers/usb: regorganisation 2009-04-06 20:40:46 +02:00
epautoconf.c USB-CDC: Fix coding style issues 2010-09-20 21:57:17 +02:00
ether.c USB-CDC: Prevent rx_req being enqueued twice 2010-10-13 12:07:58 +02:00
gadget_chips.h USB-CDC: Fix coding style issues 2010-09-20 21:57:17 +02:00
Makefile USB-CDC: Restuct USB gadget Makefile 2010-09-20 21:57:16 +02:00
mpc8xx_udc.c drivers/usb: regorganisation 2009-04-06 20:40:46 +02:00
omap1510_udc.c drivers/usb: regorganisation 2009-04-06 20:40:46 +02:00
pxa27x_udc.c Support for PXA27X UDC. 2009-04-06 20:40:47 +02:00
spr_udc.c mod change 755 => 644 for multiple files 2010-03-21 22:22:53 +01:00
usbstring.c USB-CDC: Fix coding style issues 2010-09-20 21:57:17 +02:00