diff options
author | Alan Cox <alan@redhat.com> | 2008-07-22 06:18:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-22 16:03:28 -0400 |
commit | 9e98966c7bb94355689478bc84cc3e0c190f977e (patch) | |
tree | 928aebbfee524a48aa94a3d3def5249c8846a79a /drivers/usb | |
parent | abbe629ae4011d2020047f41bea9f9e4b0ec4361 (diff) |
tty: rework break handling
Some hardware needs to do break handling itself and may have partial
support only. Make break_ctl return an error code. Add a tty driver flag
so you can indicate driver hardware side break support.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 9 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 95ae6377d7e5..0725b1871f23 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -732,13 +732,16 @@ static void acm_tty_unthrottle(struct tty_struct *tty) | |||
732 | tasklet_schedule(&acm->urb_task); | 732 | tasklet_schedule(&acm->urb_task); |
733 | } | 733 | } |
734 | 734 | ||
735 | static void acm_tty_break_ctl(struct tty_struct *tty, int state) | 735 | static int acm_tty_break_ctl(struct tty_struct *tty, int state) |
736 | { | 736 | { |
737 | struct acm *acm = tty->driver_data; | 737 | struct acm *acm = tty->driver_data; |
738 | int retval; | ||
738 | if (!ACM_READY(acm)) | 739 | if (!ACM_READY(acm)) |
739 | return; | 740 | return -EINVAL; |
740 | if (acm_send_break(acm, state ? 0xffff : 0)) | 741 | retval = acm_send_break(acm, state ? 0xffff : 0); |
742 | if (retval < 0) | ||
741 | dbg("send break failed"); | 743 | dbg("send break failed"); |
744 | return retval; | ||
742 | } | 745 | } |
743 | 746 | ||
744 | static int acm_tty_tiocmget(struct tty_struct *tty, struct file *file) | 747 | static int acm_tty_tiocmget(struct tty_struct *tty, struct file *file) |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 51917b0f079a..8c2d531eedea 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -395,7 +395,7 @@ static void serial_set_termios(struct tty_struct *tty, struct ktermios *old) | |||
395 | tty_termios_copy_hw(tty->termios, old); | 395 | tty_termios_copy_hw(tty->termios, old); |
396 | } | 396 | } |
397 | 397 | ||
398 | static void serial_break(struct tty_struct *tty, int break_state) | 398 | static int serial_break(struct tty_struct *tty, int break_state) |
399 | { | 399 | { |
400 | struct usb_serial_port *port = tty->driver_data; | 400 | struct usb_serial_port *port = tty->driver_data; |
401 | 401 | ||
@@ -409,6 +409,7 @@ static void serial_break(struct tty_struct *tty, int break_state) | |||
409 | port->serial->type->break_ctl(tty, break_state); | 409 | port->serial->type->break_ctl(tty, break_state); |
410 | unlock_kernel(); | 410 | unlock_kernel(); |
411 | } | 411 | } |
412 | return 0; | ||
412 | } | 413 | } |
413 | 414 | ||
414 | static int serial_read_proc(char *page, char **start, off_t off, int count, | 415 | static int serial_read_proc(char *page, char **start, off_t off, int count, |