aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2010-05-05 17:58:13 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:42 -0400
commitc23e5fc1f7dba228558b4a46e68f7af89515b13c (patch)
treeadd71b10dc2275c98d3439fe3756829c2ec0afc9 /include
parent27c7acf22047fbe4ec4cc36b7c2610dba227697c (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 'include')
-rw-r--r--include/linux/usb/serial.h8
1 files changed, 2 insertions, 6 deletions
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 {
67 * @write_urbs: pointers to the bulk out urbs for this port 67 * @write_urbs: pointers to the bulk out urbs for this port
68 * @write_urbs_free: status bitmap the for bulk out urbs 68 * @write_urbs_free: status bitmap the for bulk out urbs
69 * @tx_bytes: number of bytes currently in host stack queues 69 * @tx_bytes: number of bytes currently in host stack queues
70 * @tx_urbs: number of urbs currently in host stack queues
71 * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this 70 * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this
72 * port. 71 * port.
73 * @flags: usb serial port flags 72 * @flags: usb serial port flags
@@ -112,7 +111,6 @@ struct usb_serial_port {
112 __u8 bulk_out_endpointAddress; 111 __u8 bulk_out_endpointAddress;
113 112
114 int tx_bytes; 113 int tx_bytes;
115 int tx_urbs;
116 114
117 unsigned long flags; 115 unsigned long flags;
118 wait_queue_head_t write_wait; 116 wait_queue_head_t write_wait;
@@ -238,8 +236,6 @@ struct usb_serial_driver {
238 struct usb_driver *usb_driver; 236 struct usb_driver *usb_driver;
239 struct usb_dynids dynids; 237 struct usb_dynids dynids;
240 238
241 unsigned char multi_urb_write:1;
242
243 size_t bulk_in_size; 239 size_t bulk_in_size;
244 size_t bulk_out_size; 240 size_t bulk_out_size;
245 241
@@ -291,7 +287,7 @@ struct usb_serial_driver {
291 void (*process_read_urb)(struct urb *urb); 287 void (*process_read_urb)(struct urb *urb);
292 /* Called by the generic write implementation */ 288 /* Called by the generic write implementation */
293 int (*prepare_write_buffer)(struct usb_serial_port *port, 289 int (*prepare_write_buffer)(struct usb_serial_port *port,
294 void **dest, size_t size, const void *src, size_t count); 290 void *dest, size_t size);
295}; 291};
296#define to_usb_serial_driver(d) \ 292#define to_usb_serial_driver(d) \
297 container_of(d, struct usb_serial_driver, driver) 293 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,
345 gfp_t mem_flags); 341 gfp_t mem_flags);
346extern void usb_serial_generic_process_read_urb(struct urb *urb); 342extern void usb_serial_generic_process_read_urb(struct urb *urb);
347extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port, 343extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port,
348 void **dest, size_t size, const void *src, size_t count); 344 void *dest, size_t size);
349extern int usb_serial_handle_sysrq_char(struct tty_struct *tty, 345extern int usb_serial_handle_sysrq_char(struct tty_struct *tty,
350 struct usb_serial_port *port, 346 struct usb_serial_port *port,
351 unsigned int ch); 347 unsigned int ch);