diff options
author | Johan Hovold <jhovold@gmail.com> | 2010-03-17 18:05:57 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:34 -0400 |
commit | 231543206452f5c42bace54b5c13dfe5a0313812 (patch) | |
tree | cbefc56d6c37f50c895a37c47161ac5733cda24c /include/linux/usb/serial.h | |
parent | 0f3d5bae2bdacce6c6c1d116809d6b3d50338df7 (diff) |
USB: serial: generalise generic read implementation
Add process_read_urb to usb_serial_driver so that a driver can rely on
the generic read (and throttle) mechanism but still do device specific
processing of incoming data (such as adding tty_flags before pushing to
line discipline).
The default generic implementation handles sysrq for consoles but
otherwise simply pushes to tty.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/usb/serial.h')
-rw-r--r-- | include/linux/usb/serial.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 53f6dc65e87e..ff8872eba3ac 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -272,6 +272,8 @@ struct usb_serial_driver { | |||
272 | void (*write_int_callback)(struct urb *urb); | 272 | void (*write_int_callback)(struct urb *urb); |
273 | void (*read_bulk_callback)(struct urb *urb); | 273 | void (*read_bulk_callback)(struct urb *urb); |
274 | void (*write_bulk_callback)(struct urb *urb); | 274 | void (*write_bulk_callback)(struct urb *urb); |
275 | /* Called by the generic read bulk callback */ | ||
276 | void (*process_read_urb)(struct urb *urb); | ||
275 | }; | 277 | }; |
276 | #define to_usb_serial_driver(d) \ | 278 | #define to_usb_serial_driver(d) \ |
277 | container_of(d, struct usb_serial_driver, driver) | 279 | container_of(d, struct usb_serial_driver, driver) |
@@ -323,6 +325,7 @@ extern int usb_serial_generic_register(int debug); | |||
323 | extern void usb_serial_generic_deregister(void); | 325 | extern void usb_serial_generic_deregister(void); |
324 | extern int usb_serial_generic_submit_read_urb(struct usb_serial_port *port, | 326 | extern int usb_serial_generic_submit_read_urb(struct usb_serial_port *port, |
325 | gfp_t mem_flags); | 327 | gfp_t mem_flags); |
328 | extern void usb_serial_generic_process_read_urb(struct urb *urb); | ||
326 | extern int usb_serial_handle_sysrq_char(struct tty_struct *tty, | 329 | extern int usb_serial_handle_sysrq_char(struct tty_struct *tty, |
327 | struct usb_serial_port *port, | 330 | struct usb_serial_port *port, |
328 | unsigned int ch); | 331 | unsigned int ch); |