diff options
author | Johan Hovold <jhovold@gmail.com> | 2010-03-17 18:06:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:35 -0400 |
commit | eaa3bcb06aed1ac1d6d9e3edd3b5f72ea57a6ac0 (patch) | |
tree | a55b216df6a5977ab8d502df44397ef7ebbb11bc /drivers/usb/serial/usb-serial.c | |
parent | 25d514ca227e1ac81d0906a4ccf2aa171f50a600 (diff) |
USB: serial: generalise write buffer preparation
Generalise write buffer preparation.
This allows for drivers to manipulate (e.g. add headers) to bulk out
data before it is sent.
This adds a new function pointer to usb_serial_driver:
int (*prepare_write_buffer)(struct usb_serial_port *port,
void **dest, size_t size, const void *src, size_t count);
The function is generic and can be used with either kfifo-based or
multi-urb writes:
If *dest is NULL the implementation should allocate dest.
If src is NULL the implementation should use the port write fifo.
If not set, a generic implementation is used which simply uses memcpy or
kfifo_out.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 1b924425089f..8249fd8381fb 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -1299,6 +1299,7 @@ static void fixup_generic(struct usb_serial_driver *device) | |||
1299 | set_to_generic_if_null(device, disconnect); | 1299 | set_to_generic_if_null(device, disconnect); |
1300 | set_to_generic_if_null(device, release); | 1300 | set_to_generic_if_null(device, release); |
1301 | set_to_generic_if_null(device, process_read_urb); | 1301 | set_to_generic_if_null(device, process_read_urb); |
1302 | set_to_generic_if_null(device, prepare_write_buffer); | ||
1302 | } | 1303 | } |
1303 | 1304 | ||
1304 | int usb_serial_register(struct usb_serial_driver *driver) | 1305 | int usb_serial_register(struct usb_serial_driver *driver) |