diff options
author | Johan Hovold <jhovold@gmail.com> | 2010-05-05 17:58:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:42 -0400 |
commit | c23e5fc1f7dba228558b4a46e68f7af89515b13c (patch) | |
tree | add71b10dc2275c98d3439fe3756829c2ec0afc9 /drivers/usb/serial/aircable.c | |
parent | 27c7acf22047fbe4ec4cc36b7c2610dba227697c (diff) |
USB: serial: remove multi-urb write from generic driver
Remove multi-urb write from the generic driver and simplify the
prepare_write_buffer prototype:
int (*prepare_write_buffer)(struct usb_serial_port *port,
void *dest, size_t size);
The default implementation simply fills dest with data from port write
fifo but drivers can override it if they need to process the outgoing
data (e.g. add headers).
Turn ftdi_sio into a generic fifo-based driver, which lowers CPU usage
significantly for small writes while retaining maximum throughput.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/aircable.c')
-rw-r--r-- | drivers/usb/serial/aircable.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c index cac5162937b3..8a990a763c21 100644 --- a/drivers/usb/serial/aircable.c +++ b/drivers/usb/serial/aircable.c | |||
@@ -84,9 +84,10 @@ static const struct usb_device_id id_table[] = { | |||
84 | MODULE_DEVICE_TABLE(usb, id_table); | 84 | MODULE_DEVICE_TABLE(usb, id_table); |
85 | 85 | ||
86 | static int aircable_prepare_write_buffer(struct usb_serial_port *port, | 86 | static int aircable_prepare_write_buffer(struct usb_serial_port *port, |
87 | void **dest, size_t size, const void *src, size_t count) | 87 | void *dest, size_t size) |
88 | { | 88 | { |
89 | unsigned char *buf = *dest; | 89 | int count; |
90 | unsigned char *buf = dest; | ||
90 | 91 | ||
91 | count = kfifo_out_locked(&port->write_fifo, buf + HCI_HEADER_LENGTH, | 92 | count = kfifo_out_locked(&port->write_fifo, buf + HCI_HEADER_LENGTH, |
92 | size - HCI_HEADER_LENGTH, &port->lock); | 93 | size - HCI_HEADER_LENGTH, &port->lock); |
@@ -185,8 +186,6 @@ static struct usb_serial_driver aircable_device = { | |||
185 | .id_table = id_table, | 186 | .id_table = id_table, |
186 | .num_ports = 1, | 187 | .num_ports = 1, |
187 | .bulk_out_size = HCI_COMPLETE_FRAME, | 188 | .bulk_out_size = HCI_COMPLETE_FRAME, |
188 | /* Must modify prepare_write_buffer if multi_urb_write is changed. */ | ||
189 | .multi_urb_write = 0, | ||
190 | .probe = aircable_probe, | 189 | .probe = aircable_probe, |
191 | .process_read_urb = aircable_process_read_urb, | 190 | .process_read_urb = aircable_process_read_urb, |
192 | .prepare_write_buffer = aircable_prepare_write_buffer, | 191 | .prepare_write_buffer = aircable_prepare_write_buffer, |