diff options
author | Daniel Glöckner <dg@emlix.com> | 2009-05-28 06:53:24 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:46 -0400 |
commit | 2e25134122c25ebb0679b4bbd536fb46c669f9d7 (patch) | |
tree | e839d96eaad759f314517e8ea5e28760dc715347 /drivers/usb/gadget/u_serial.c | |
parent | 9b8e7ba68ad0e4273f4897950de65bc311552cd1 (diff) |
USB: gadget: g_serial: append zlp when tx buffer becomes empty
Some usb serial host drivers expect a short packet before they forward
the data to the application. This is caused by them trying to read more
than one packet at a time. So when the gadget sends an exact multiple
of the maximum packet size, it should append a zero-length packet.
Signed-off-by: Daniel Glöckner <dg@emlix.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/u_serial.c')
-rw-r--r-- | drivers/usb/gadget/u_serial.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c index 0a4d99ab40d8..fc6e709f45b1 100644 --- a/drivers/usb/gadget/u_serial.c +++ b/drivers/usb/gadget/u_serial.c | |||
@@ -371,6 +371,7 @@ __acquires(&port->port_lock) | |||
371 | 371 | ||
372 | req->length = len; | 372 | req->length = len; |
373 | list_del(&req->list); | 373 | list_del(&req->list); |
374 | req->zero = (gs_buf_data_avail(&port->port_write_buf) == 0); | ||
374 | 375 | ||
375 | pr_vdebug(PREFIX "%d: tx len=%d, 0x%02x 0x%02x 0x%02x ...\n", | 376 | pr_vdebug(PREFIX "%d: tx len=%d, 0x%02x 0x%02x 0x%02x ...\n", |
376 | port->port_num, len, *((u8 *)req->buf), | 377 | port->port_num, len, *((u8 *)req->buf), |