diff options
author | Jiri Slaby <jslaby@suse.cz> | 2012-04-02 07:54:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-09 14:17:03 -0400 |
commit | 042b9e7c2bef3bc2b250921fee0ae52125812643 (patch) | |
tree | 1282c060ab8da29efde6656ecd257f34b9fe0a7a /drivers/isdn/i4l | |
parent | 4330d663fed02ace2feba1ab3795ab0c08148a28 (diff) |
TTY: isdn, define tty_port_operations
Add there .carrier_raised. It is taken from current block_til_ready.
We will need tty_port->ops->carrier_raised for
tty_port_block_til_ready helper.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/isdn/i4l')
-rw-r--r-- | drivers/isdn/i4l/isdn_tty.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 50d7246b37a1..b41a80a453d7 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c | |||
@@ -1485,6 +1485,7 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) | |||
1485 | * isdn_tty_open() and friends | 1485 | * isdn_tty_open() and friends |
1486 | * ------------------------------------------------------------ | 1486 | * ------------------------------------------------------------ |
1487 | */ | 1487 | */ |
1488 | |||
1488 | static int | 1489 | static int |
1489 | isdn_tty_block_til_ready(struct tty_struct *tty, struct file *filp, modem_info *info) | 1490 | isdn_tty_block_til_ready(struct tty_struct *tty, struct file *filp, modem_info *info) |
1490 | { | 1491 | { |
@@ -1552,7 +1553,7 @@ isdn_tty_block_til_ready(struct tty_struct *tty, struct file *filp, modem_info * | |||
1552 | break; | 1553 | break; |
1553 | } | 1554 | } |
1554 | if (!(port->flags & ASYNC_CLOSING) && | 1555 | if (!(port->flags & ASYNC_CLOSING) && |
1555 | (do_clocal || (info->msr & UART_MSR_DCD))) { | 1556 | (do_clocal || tty_port_carrier_raised(port))) { |
1556 | break; | 1557 | break; |
1557 | } | 1558 | } |
1558 | if (signal_pending(current)) { | 1559 | if (signal_pending(current)) { |
@@ -1848,6 +1849,16 @@ static const struct tty_operations modem_ops = { | |||
1848 | .tiocmset = isdn_tty_tiocmset, | 1849 | .tiocmset = isdn_tty_tiocmset, |
1849 | }; | 1850 | }; |
1850 | 1851 | ||
1852 | static int isdn_tty_carrier_raised(struct tty_port *port) | ||
1853 | { | ||
1854 | modem_info *info = container_of(port, modem_info, port); | ||
1855 | return info->msr & UART_MSR_DCD; | ||
1856 | } | ||
1857 | |||
1858 | static const struct tty_port_operations isdn_tty_port_ops = { | ||
1859 | .carrier_raised = isdn_tty_carrier_raised, | ||
1860 | }; | ||
1861 | |||
1851 | int | 1862 | int |
1852 | isdn_tty_modem_init(void) | 1863 | isdn_tty_modem_init(void) |
1853 | { | 1864 | { |
@@ -1884,6 +1895,7 @@ isdn_tty_modem_init(void) | |||
1884 | } | 1895 | } |
1885 | #endif | 1896 | #endif |
1886 | tty_port_init(&info->port); | 1897 | tty_port_init(&info->port); |
1898 | info->port.ops = &isdn_tty_port_ops; | ||
1887 | spin_lock_init(&info->readlock); | 1899 | spin_lock_init(&info->readlock); |
1888 | sprintf(info->last_cause, "0000"); | 1900 | sprintf(info->last_cause, "0000"); |
1889 | sprintf(info->last_num, "none"); | 1901 | sprintf(info->last_num, "none"); |