usb: musb: Fix transmission of bigger buffers

If udc_endpoint_write() was called with bigger payload which does not fit
into one USB packet it is needed to transmit payload in more USB packets.
First packet is transmitted by udc_endpoint_write() call itself and other
packets are put into waiting queue.

Implement function musb_peri_tx() which checks if endpoints are ready for
transmit and continue transmission of waiting queue.

This patch fixes sending big output from printenv command over usbtty
serial console.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>>
This commit is contained in:
Pali Rohár 2021-02-07 14:50:07 +01:00 committed by Marek Vasut
parent 7d7ae28c8b
commit ea7125c4c6

View file

@ -708,21 +708,16 @@ static void musb_peri_rx(u16 intr)
static void musb_peri_tx(u16 intr) static void musb_peri_tx(u16 intr)
{ {
unsigned int ep;
/* Check for EP0 */ /* Check for EP0 */
if (0x01 & intr) if (0x01 & intr)
musb_peri_ep0_tx(); musb_peri_ep0_tx();
/* for (ep = 1; ep < 16; ep++) {
* Use this in the future when handling epN tx if ((1 << ep) & intr)
* udc_endpoint_write(GET_ENDPOINT(udc_device, ep));
* u8 ep; }
*
* for (ep = 1; ep < 16; ep++) {
* if ((1 << ep) & intr) {
* / * handle tx for this endpoint * /
* }
* }
*/
} }
void udc_irq(void) void udc_irq(void)