]> git.baikalelectronics.ru Git - kernel.git/commit
USB: use kfifo to buffer usb-generic serial writes
authorDavid VomLehn <dvomlehn@cisco.com>
Fri, 28 Aug 2009 19:54:27 +0000 (12:54 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Sep 2009 13:46:34 +0000 (06:46 -0700)
commit992cba666dde93500b7e514840a8b48215b2db03
tree146ad73ff1ee9439263678c5493a5c2d180ad794
parent4684b7bfde941fb4b84821fd4ecfdd4d94182f39
USB: use kfifo to buffer usb-generic serial writes

When do_output_char() attempts to write a carriage return/line feed sequence,
it first checks to see how much buffer room is available. If there are at least
two characters free, it will write the carriage return/line feed with two calls
to tty_put_char(). It calls the tty_operation functions write() for devices that
don't support the tty_operations function put_char(). If the USB generic serial
device's write URB is not in use, it will return the buffer size when asked how
much room is available. The write() of the carriage return will cause it to mark
the write URB busy, so the subsequent write() of the line feed will be ignored.

This patch uses the kfifo infrastructure to implement a write FIFO that
accurately returns the amount of space available in the buffer.

Signed-off-by: David VomLehn <dvomlehn@cisco.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/generic.c
drivers/usb/serial/usb-serial.c
include/linux/usb/serial.h