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>
This commit is contained in:
@ -85,7 +85,7 @@ static irqreturn_t scc_rx_int(int irq, void *data);
|
||||
static irqreturn_t scc_stat_int(int irq, void *data);
|
||||
static irqreturn_t scc_spcond_int(int irq, void *data);
|
||||
static void scc_setsignals(struct scc_port *port, int dtr, int rts);
|
||||
static void scc_break_ctl(struct tty_struct *tty, int break_state);
|
||||
static int scc_break_ctl(struct tty_struct *tty, int break_state);
|
||||
|
||||
static struct tty_driver *scc_driver;
|
||||
|
||||
@ -942,7 +942,7 @@ static int scc_ioctl(struct tty_struct *tty, struct file *file,
|
||||
}
|
||||
|
||||
|
||||
static void scc_break_ctl(struct tty_struct *tty, int break_state)
|
||||
static int scc_break_ctl(struct tty_struct *tty, int break_state)
|
||||
{
|
||||
struct scc_port *port = (struct scc_port *)tty->driver_data;
|
||||
unsigned long flags;
|
||||
@ -952,6 +952,7 @@ static void scc_break_ctl(struct tty_struct *tty, int break_state)
|
||||
SCCmod(TX_CTRL_REG, ~TCR_SEND_BREAK,
|
||||
break_state ? TCR_SEND_BREAK : 0);
|
||||
local_irq_restore(flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user