From c23e5fc1f7dba228558b4a46e68f7af89515b13c Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 5 May 2010 23:58:13 +0200 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- include/linux/usb/serial.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 70b6d6b28997..061c997ae0cf 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h @@ -67,7 +67,6 @@ enum port_dev_state { * @write_urbs: pointers to the bulk out urbs for this port * @write_urbs_free: status bitmap the for bulk out urbs * @tx_bytes: number of bytes currently in host stack queues - * @tx_urbs: number of urbs currently in host stack queues * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this * port. * @flags: usb serial port flags @@ -112,7 +111,6 @@ struct usb_serial_port { __u8 bulk_out_endpointAddress; int tx_bytes; - int tx_urbs; unsigned long flags; wait_queue_head_t write_wait; @@ -238,8 +236,6 @@ struct usb_serial_driver { struct usb_driver *usb_driver; struct usb_dynids dynids; - unsigned char multi_urb_write:1; - size_t bulk_in_size; size_t bulk_out_size; @@ -291,7 +287,7 @@ struct usb_serial_driver { void (*process_read_urb)(struct urb *urb); /* Called by the generic write implementation */ int (*prepare_write_buffer)(struct usb_serial_port *port, - void **dest, size_t size, const void *src, size_t count); + void *dest, size_t size); }; #define to_usb_serial_driver(d) \ container_of(d, struct usb_serial_driver, driver) @@ -345,7 +341,7 @@ extern int usb_serial_generic_submit_read_urb(struct usb_serial_port *port, gfp_t mem_flags); extern void usb_serial_generic_process_read_urb(struct urb *urb); extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port, - void **dest, size_t size, const void *src, size_t count); + void *dest, size_t size); extern int usb_serial_handle_sysrq_char(struct tty_struct *tty, struct usb_serial_port *port, unsigned int ch); -- cgit v1.2.2