[U-Boot] [PATCH] USB-CDC: called handle_interrupts inside usb_eth_send

Stefano Babic sbabic at denx.de
Thu Aug 12 10:44:29 CEST 2010


Remy Bohmer wrote:
> Hi Stefano,
> 

Hi Remy,

>> +       packet_sent=0;
> This line breaks the at91sam9261 code. Can you please fix this?

This means to me that tx_complete() is not called for at91sam9261, as it
supposed to be (or better, as I supposed..).

I see that packet_sent is reset only in the eth_init() function. Does it
mean that usb_eth_send() does not wait for tx completion in the case of
 at91sam9261 ?

I supposed (and I manage in this way..) that packet_sent is used as flag
to detect when a single packet is really transmitted, and in this way is
used when I call usb_handle_interrupts(). The callback stored into the
USB request is tx_complete() that is the one responsible to set the
flag. So the simple mechanism is that usb_eth_send clear the flag and
wait until tx_complete sets it. It seems now to me that on at91sam9261
usb_eth_send() waits only for the first packet, and then it does not
wait anymore. How can we be sure that the packet is really transmitted ?

Should I protect the line with some AT91 CONFIG or am I missing something ?

Best regards,
Stefano


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================


More information about the U-Boot mailing list