diff options
author | Alan Cox <alan@redhat.com> | 2008-07-16 16:57:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:12:38 -0400 |
commit | 44b7d1b37f786c61d0e382b6f72f605f73de284b (patch) | |
tree | 2ac150e99311cde2e841bb6c80ac9d2800c8aff7 /drivers/char/riscom8.c | |
parent | 593573bc55c9e1999b9679da4e477c0220a6fbbd (diff) |
tty: add more tty_port fields
Move more bits into the tty_port structure
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/riscom8.c')
-rw-r--r-- | drivers/char/riscom8.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c index 3ca8957ba327..724b2b20f4b2 100644 --- a/drivers/char/riscom8.c +++ b/drivers/char/riscom8.c | |||
@@ -1032,8 +1032,8 @@ static void rc_close(struct tty_struct *tty, struct file *filp) | |||
1032 | * the line discipline to only process XON/XOFF characters. | 1032 | * the line discipline to only process XON/XOFF characters. |
1033 | */ | 1033 | */ |
1034 | tty->closing = 1; | 1034 | tty->closing = 1; |
1035 | if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE) | 1035 | if (port->port.closing_wait != ASYNC_CLOSING_WAIT_NONE) |
1036 | tty_wait_until_sent(tty, port->closing_wait); | 1036 | tty_wait_until_sent(tty, port->port.closing_wait); |
1037 | /* | 1037 | /* |
1038 | * At this point we stop accepting input. To do this, we | 1038 | * At this point we stop accepting input. To do this, we |
1039 | * disable the receive line status interrupts, and tell the | 1039 | * disable the receive line status interrupts, and tell the |
@@ -1065,8 +1065,8 @@ static void rc_close(struct tty_struct *tty, struct file *filp) | |||
1065 | tty->closing = 0; | 1065 | tty->closing = 0; |
1066 | port->port.tty = NULL; | 1066 | port->port.tty = NULL; |
1067 | if (port->port.blocked_open) { | 1067 | if (port->port.blocked_open) { |
1068 | if (port->close_delay) | 1068 | if (port->port.close_delay) |
1069 | msleep_interruptible(jiffies_to_msecs(port->close_delay)); | 1069 | msleep_interruptible(jiffies_to_msecs(port->port.close_delay)); |
1070 | wake_up_interruptible(&port->port.open_wait); | 1070 | wake_up_interruptible(&port->port.open_wait); |
1071 | } | 1071 | } |
1072 | port->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); | 1072 | port->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); |
@@ -1295,8 +1295,8 @@ static int rc_set_serial_info(struct riscom_port *port, | |||
1295 | (tmp.flags & ASYNC_SPD_MASK)); | 1295 | (tmp.flags & ASYNC_SPD_MASK)); |
1296 | 1296 | ||
1297 | if (!capable(CAP_SYS_ADMIN)) { | 1297 | if (!capable(CAP_SYS_ADMIN)) { |
1298 | if ((tmp.close_delay != port->close_delay) || | 1298 | if ((tmp.close_delay != port->port.close_delay) || |
1299 | (tmp.closing_wait != port->closing_wait) || | 1299 | (tmp.closing_wait != port->port.closing_wait) || |
1300 | ((tmp.flags & ~ASYNC_USR_MASK) != | 1300 | ((tmp.flags & ~ASYNC_USR_MASK) != |
1301 | (port->port.flags & ~ASYNC_USR_MASK))) | 1301 | (port->port.flags & ~ASYNC_USR_MASK))) |
1302 | return -EPERM; | 1302 | return -EPERM; |
@@ -1305,8 +1305,8 @@ static int rc_set_serial_info(struct riscom_port *port, | |||
1305 | } else { | 1305 | } else { |
1306 | port->port.flags = ((port->port.flags & ~ASYNC_FLAGS) | | 1306 | port->port.flags = ((port->port.flags & ~ASYNC_FLAGS) | |
1307 | (tmp.flags & ASYNC_FLAGS)); | 1307 | (tmp.flags & ASYNC_FLAGS)); |
1308 | port->close_delay = tmp.close_delay; | 1308 | port->port.close_delay = tmp.close_delay; |
1309 | port->closing_wait = tmp.closing_wait; | 1309 | port->port.closing_wait = tmp.closing_wait; |
1310 | } | 1310 | } |
1311 | if (change_speed) { | 1311 | if (change_speed) { |
1312 | unsigned long flags; | 1312 | unsigned long flags; |
@@ -1331,8 +1331,8 @@ static int rc_get_serial_info(struct riscom_port *port, | |||
1331 | tmp.irq = bp->irq; | 1331 | tmp.irq = bp->irq; |
1332 | tmp.flags = port->port.flags; | 1332 | tmp.flags = port->port.flags; |
1333 | tmp.baud_base = (RC_OSCFREQ + CD180_TPC/2) / CD180_TPC; | 1333 | tmp.baud_base = (RC_OSCFREQ + CD180_TPC/2) / CD180_TPC; |
1334 | tmp.close_delay = port->close_delay * HZ/100; | 1334 | tmp.close_delay = port->port.close_delay * HZ/100; |
1335 | tmp.closing_wait = port->closing_wait * HZ/100; | 1335 | tmp.closing_wait = port->port.closing_wait * HZ/100; |
1336 | tmp.xmit_fifo_size = CD180_NFIFO; | 1336 | tmp.xmit_fifo_size = CD180_NFIFO; |
1337 | return copy_to_user(retinfo, &tmp, sizeof(tmp)) ? -EFAULT : 0; | 1337 | return copy_to_user(retinfo, &tmp, sizeof(tmp)) ? -EFAULT : 0; |
1338 | } | 1338 | } |
@@ -1549,10 +1549,8 @@ static int __init rc_init_drivers(void) | |||
1549 | } | 1549 | } |
1550 | memset(rc_port, 0, sizeof(rc_port)); | 1550 | memset(rc_port, 0, sizeof(rc_port)); |
1551 | for (i = 0; i < RC_NPORT * RC_NBOARD; i++) { | 1551 | for (i = 0; i < RC_NPORT * RC_NBOARD; i++) { |
1552 | rc_port[i].magic = RISCOM8_MAGIC; | ||
1553 | rc_port[i].close_delay = 50 * HZ / 100; | ||
1554 | rc_port[i].closing_wait = 3000 * HZ / 100; | ||
1555 | tty_port_init(&rc_port[i].port); | 1552 | tty_port_init(&rc_port[i].port); |
1553 | rc_port[i].magic = RISCOM8_MAGIC; | ||
1556 | } | 1554 | } |
1557 | return 0; | 1555 | return 0; |
1558 | } | 1556 | } |