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/char/synclinkmp.c | |
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/char/synclinkmp.c')
-rw-r--r-- | drivers/char/synclinkmp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index 5768c4136342..c0490cbd0db2 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c | |||
@@ -527,7 +527,7 @@ static int read_proc(char *page, char **start, off_t off, int count,int *eof, v | |||
527 | static int chars_in_buffer(struct tty_struct *tty); | 527 | static int chars_in_buffer(struct tty_struct *tty); |
528 | static void throttle(struct tty_struct * tty); | 528 | static void throttle(struct tty_struct * tty); |
529 | static void unthrottle(struct tty_struct * tty); | 529 | static void unthrottle(struct tty_struct * tty); |
530 | static void set_break(struct tty_struct *tty, int break_state); | 530 | static int set_break(struct tty_struct *tty, int break_state); |
531 | 531 | ||
532 | #if SYNCLINK_GENERIC_HDLC | 532 | #if SYNCLINK_GENERIC_HDLC |
533 | #define dev_to_port(D) (dev_to_hdlc(D)->priv) | 533 | #define dev_to_port(D) (dev_to_hdlc(D)->priv) |
@@ -552,7 +552,7 @@ static int wait_mgsl_event(SLMP_INFO *info, int __user *mask_ptr); | |||
552 | static int tiocmget(struct tty_struct *tty, struct file *file); | 552 | static int tiocmget(struct tty_struct *tty, struct file *file); |
553 | static int tiocmset(struct tty_struct *tty, struct file *file, | 553 | static int tiocmset(struct tty_struct *tty, struct file *file, |
554 | unsigned int set, unsigned int clear); | 554 | unsigned int set, unsigned int clear); |
555 | static void set_break(struct tty_struct *tty, int break_state); | 555 | static int set_break(struct tty_struct *tty, int break_state); |
556 | 556 | ||
557 | static void add_device(SLMP_INFO *info); | 557 | static void add_device(SLMP_INFO *info); |
558 | static void device_init(int adapter_num, struct pci_dev *pdev); | 558 | static void device_init(int adapter_num, struct pci_dev *pdev); |
@@ -1587,7 +1587,7 @@ static void unthrottle(struct tty_struct * tty) | |||
1587 | /* set or clear transmit break condition | 1587 | /* set or clear transmit break condition |
1588 | * break_state -1=set break condition, 0=clear | 1588 | * break_state -1=set break condition, 0=clear |
1589 | */ | 1589 | */ |
1590 | static void set_break(struct tty_struct *tty, int break_state) | 1590 | static int set_break(struct tty_struct *tty, int break_state) |
1591 | { | 1591 | { |
1592 | unsigned char RegValue; | 1592 | unsigned char RegValue; |
1593 | SLMP_INFO * info = (SLMP_INFO *)tty->driver_data; | 1593 | SLMP_INFO * info = (SLMP_INFO *)tty->driver_data; |
@@ -1598,7 +1598,7 @@ static void set_break(struct tty_struct *tty, int break_state) | |||
1598 | __FILE__,__LINE__, info->device_name, break_state); | 1598 | __FILE__,__LINE__, info->device_name, break_state); |
1599 | 1599 | ||
1600 | if (sanity_check(info, tty->name, "set_break")) | 1600 | if (sanity_check(info, tty->name, "set_break")) |
1601 | return; | 1601 | return -EINVAL; |
1602 | 1602 | ||
1603 | spin_lock_irqsave(&info->lock,flags); | 1603 | spin_lock_irqsave(&info->lock,flags); |
1604 | RegValue = read_reg(info, CTL); | 1604 | RegValue = read_reg(info, CTL); |
@@ -1608,6 +1608,7 @@ static void set_break(struct tty_struct *tty, int break_state) | |||
1608 | RegValue &= ~BIT3; | 1608 | RegValue &= ~BIT3; |
1609 | write_reg(info, CTL, RegValue); | 1609 | write_reg(info, CTL, RegValue); |
1610 | spin_unlock_irqrestore(&info->lock,flags); | 1610 | spin_unlock_irqrestore(&info->lock,flags); |
1611 | return 0; | ||
1611 | } | 1612 | } |
1612 | 1613 | ||
1613 | #if SYNCLINK_GENERIC_HDLC | 1614 | #if SYNCLINK_GENERIC_HDLC |