aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/rocket.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-07-16 16:57:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-20 20:12:38 -0400
commit44b7d1b37f786c61d0e382b6f72f605f73de284b (patch)
tree2ac150e99311cde2e841bb6c80ac9d2800c8aff7 /drivers/char/rocket.c
parent593573bc55c9e1999b9679da4e477c0220a6fbbd (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/rocket.c')
-rw-r--r--drivers/char/rocket.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index bc35b900f9c6..e670eae2f510 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -72,6 +72,7 @@
72#include <linux/tty.h> 72#include <linux/tty.h>
73#include <linux/tty_driver.h> 73#include <linux/tty_driver.h>
74#include <linux/tty_flip.h> 74#include <linux/tty_flip.h>
75#include <linux/serial.h>
75#include <linux/string.h> 76#include <linux/string.h>
76#include <linux/fcntl.h> 77#include <linux/fcntl.h>
77#include <linux/ptrace.h> 78#include <linux/ptrace.h>
@@ -81,7 +82,7 @@
81#include <linux/completion.h> 82#include <linux/completion.h>
82#include <linux/wait.h> 83#include <linux/wait.h>
83#include <linux/pci.h> 84#include <linux/pci.h>
84#include <asm/uaccess.h> 85#include <linux/uaccess.h>
85#include <asm/atomic.h> 86#include <asm/atomic.h>
86#include <asm/unaligned.h> 87#include <asm/unaligned.h>
87#include <linux/bitops.h> 88#include <linux/bitops.h>
@@ -648,8 +649,8 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev)
648 info->board = board; 649 info->board = board;
649 info->aiop = aiop; 650 info->aiop = aiop;
650 info->chan = chan; 651 info->chan = chan;
651 info->closing_wait = 3000; 652 info->port.closing_wait = 3000;
652 info->close_delay = 50; 653 info->port.close_delay = 50;
653 init_waitqueue_head(&info->port.open_wait); 654 init_waitqueue_head(&info->port.open_wait);
654 init_completion(&info->close_wait); 655 init_completion(&info->close_wait);
655 info->flags &= ~ROCKET_MODE_MASK; 656 info->flags &= ~ROCKET_MODE_MASK;
@@ -1137,8 +1138,8 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
1137 /* 1138 /*
1138 * Wait for the transmit buffer to clear 1139 * Wait for the transmit buffer to clear
1139 */ 1140 */
1140 if (info->closing_wait != ROCKET_CLOSING_WAIT_NONE) 1141 if (info->port.closing_wait != ROCKET_CLOSING_WAIT_NONE)
1141 tty_wait_until_sent(tty, info->closing_wait); 1142 tty_wait_until_sent(tty, info->port.closing_wait);
1142 /* 1143 /*
1143 * Before we drop DTR, make sure the UART transmitter 1144 * Before we drop DTR, make sure the UART transmitter
1144 * has completely drained; this is especially 1145 * has completely drained; this is especially
@@ -1168,8 +1169,8 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
1168 clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]); 1169 clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]);
1169 1170
1170 if (info->port.blocked_open) { 1171 if (info->port.blocked_open) {
1171 if (info->close_delay) { 1172 if (info->port.close_delay) {
1172 msleep_interruptible(jiffies_to_msecs(info->close_delay)); 1173 msleep_interruptible(jiffies_to_msecs(info->port.close_delay));
1173 } 1174 }
1174 wake_up_interruptible(&info->port.open_wait); 1175 wake_up_interruptible(&info->port.open_wait);
1175 } else { 1176 } else {
@@ -1327,8 +1328,8 @@ static int get_config(struct r_port *info, struct rocket_config __user *retinfo)
1327 memset(&tmp, 0, sizeof (tmp)); 1328 memset(&tmp, 0, sizeof (tmp));
1328 tmp.line = info->line; 1329 tmp.line = info->line;
1329 tmp.flags = info->flags; 1330 tmp.flags = info->flags;
1330 tmp.close_delay = info->close_delay; 1331 tmp.close_delay = info->port.close_delay;
1331 tmp.closing_wait = info->closing_wait; 1332 tmp.closing_wait = info->port.closing_wait;
1332 tmp.port = rcktpt_io_addr[(info->line >> 5) & 3]; 1333 tmp.port = rcktpt_io_addr[(info->line >> 5) & 3];
1333 1334
1334 if (copy_to_user(retinfo, &tmp, sizeof (*retinfo))) 1335 if (copy_to_user(retinfo, &tmp, sizeof (*retinfo)))
@@ -1353,8 +1354,8 @@ static int set_config(struct r_port *info, struct rocket_config __user *new_info
1353 } 1354 }
1354 1355
1355 info->flags = ((info->flags & ~ROCKET_FLAGS) | (new_serial.flags & ROCKET_FLAGS)); 1356 info->flags = ((info->flags & ~ROCKET_FLAGS) | (new_serial.flags & ROCKET_FLAGS));
1356 info->close_delay = new_serial.close_delay; 1357 info->port.close_delay = new_serial.close_delay;
1357 info->closing_wait = new_serial.closing_wait; 1358 info->port.closing_wait = new_serial.closing_wait;
1358 1359
1359 if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_HI) 1360 if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_HI)
1360 info->port.tty->alt_speed = 57600; 1361 info->port.tty->alt_speed = 57600;