From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Thu, 12 Aug 2010 10:44:29 +0200 Subject: [U-Boot] [PATCH] USB-CDC: called handle_interrupts inside usb_eth_send In-Reply-To: References: <1281562824-6471-1-git-send-email-sbabic@denx.de> Message-ID: <4C63B46D.1080000@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 =====================================================================