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:
@@ -2897,9 +2897,9 @@ static int tiocmset(struct tty_struct *tty, struct file *file,
|
||||
*
|
||||
* Arguments: tty pointer to tty instance data
|
||||
* break_state -1=set break condition, 0=clear
|
||||
* Return Value: None
|
||||
* Return Value: error code
|
||||
*/
|
||||
static void mgsl_break(struct tty_struct *tty, int break_state)
|
||||
static int mgsl_break(struct tty_struct *tty, int break_state)
|
||||
{
|
||||
struct mgsl_struct * info = (struct mgsl_struct *)tty->driver_data;
|
||||
unsigned long flags;
|
||||
@@ -2909,7 +2909,7 @@ static void mgsl_break(struct tty_struct *tty, int break_state)
|
||||
__FILE__,__LINE__, info->device_name, break_state);
|
||||
|
||||
if (mgsl_paranoia_check(info, tty->name, "mgsl_break"))
|
||||
return;
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_irqsave(&info->irq_spinlock,flags);
|
||||
if (break_state == -1)
|
||||
@@ -2917,6 +2917,7 @@ static void mgsl_break(struct tty_struct *tty, int break_state)
|
||||
else
|
||||
usc_OutReg(info,IOCR,(u16)(usc_InReg(info,IOCR) & ~BIT7));
|
||||
spin_unlock_irqrestore(&info->irq_spinlock,flags);
|
||||
return 0;
|
||||
|
||||
} /* end of mgsl_break() */
|
||||
|
||||
|
Reference in New Issue
Block a user