diff options
Diffstat (limited to 'drivers/char/tty_ioctl.c')
-rw-r--r-- | drivers/char/tty_ioctl.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index 1bdd2bf4f37d..d4b6d64e858b 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c | |||
@@ -62,7 +62,7 @@ void tty_wait_until_sent(struct tty_struct * tty, long timeout) | |||
62 | if (!timeout) | 62 | if (!timeout) |
63 | timeout = MAX_SCHEDULE_TIMEOUT; | 63 | timeout = MAX_SCHEDULE_TIMEOUT; |
64 | if (wait_event_interruptible_timeout(tty->write_wait, | 64 | if (wait_event_interruptible_timeout(tty->write_wait, |
65 | !tty->driver->chars_in_buffer(tty), timeout)) | 65 | !tty->driver->chars_in_buffer(tty), timeout) < 0) |
66 | return; | 66 | return; |
67 | if (tty->driver->wait_until_sent) | 67 | if (tty->driver->wait_until_sent) |
68 | tty->driver->wait_until_sent(tty, timeout); | 68 | tty->driver->wait_until_sent(tty, timeout); |
@@ -365,6 +365,25 @@ void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old) | |||
365 | EXPORT_SYMBOL(tty_termios_copy_hw); | 365 | EXPORT_SYMBOL(tty_termios_copy_hw); |
366 | 366 | ||
367 | /** | 367 | /** |
368 | * tty_termios_hw_change - check for setting change | ||
369 | * @a: termios | ||
370 | * @b: termios to compare | ||
371 | * | ||
372 | * Check if any of the bits that affect a dumb device have changed | ||
373 | * between the two termios structures, or a speed change is needed. | ||
374 | */ | ||
375 | |||
376 | int tty_termios_hw_change(struct ktermios *a, struct ktermios *b) | ||
377 | { | ||
378 | if (a->c_ispeed != b->c_ispeed || a->c_ospeed != b->c_ospeed) | ||
379 | return 1; | ||
380 | if ((a->c_cflag ^ b->c_cflag) & ~(HUPCL | CREAD | CLOCAL)) | ||
381 | return 1; | ||
382 | return 0; | ||
383 | } | ||
384 | EXPORT_SYMBOL(tty_termios_hw_change); | ||
385 | |||
386 | /** | ||
368 | * change_termios - update termios values | 387 | * change_termios - update termios values |
369 | * @tty: tty to update | 388 | * @tty: tty to update |
370 | * @new_termios: desired new value | 389 | * @new_termios: desired new value |