aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/isicom.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/isicom.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/isicom.c')
-rw-r--r--drivers/char/isicom.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 5a53c15b0dc2..d4281df10c22 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -199,10 +199,8 @@ struct isi_board {
199struct isi_port { 199struct isi_port {
200 unsigned short magic; 200 unsigned short magic;
201 struct tty_port port; 201 struct tty_port port;
202 int close_delay;
203 u16 channel; 202 u16 channel;
204 u16 status; 203 u16 status;
205 u16 closing_wait;
206 struct isi_board *card; 204 struct isi_board *card;
207 unsigned char *xmit_buf; 205 unsigned char *xmit_buf;
208 int xmit_head; 206 int xmit_head;
@@ -1051,8 +1049,8 @@ static void isicom_close(struct tty_struct *tty, struct file *filp)
1051 tty->closing = 1; 1049 tty->closing = 1;
1052 spin_unlock_irqrestore(&card->card_lock, flags); 1050 spin_unlock_irqrestore(&card->card_lock, flags);
1053 1051
1054 if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE) 1052 if (port->port.closing_wait != ASYNC_CLOSING_WAIT_NONE)
1055 tty_wait_until_sent(tty, port->closing_wait); 1053 tty_wait_until_sent(tty, port->port.closing_wait);
1056 /* indicate to the card that no more data can be received 1054 /* indicate to the card that no more data can be received
1057 on this port */ 1055 on this port */
1058 spin_lock_irqsave(&card->card_lock, flags); 1056 spin_lock_irqsave(&card->card_lock, flags);
@@ -1071,10 +1069,10 @@ static void isicom_close(struct tty_struct *tty, struct file *filp)
1071 1069
1072 if (port->port.blocked_open) { 1070 if (port->port.blocked_open) {
1073 spin_unlock_irqrestore(&card->card_lock, flags); 1071 spin_unlock_irqrestore(&card->card_lock, flags);
1074 if (port->close_delay) { 1072 if (port->port.close_delay) {
1075 pr_dbg("scheduling until time out.\n"); 1073 pr_dbg("scheduling until time out.\n");
1076 msleep_interruptible( 1074 msleep_interruptible(
1077 jiffies_to_msecs(port->close_delay)); 1075 jiffies_to_msecs(port->port.close_delay));
1078 } 1076 }
1079 spin_lock_irqsave(&card->card_lock, flags); 1077 spin_lock_irqsave(&card->card_lock, flags);
1080 wake_up_interruptible(&port->port.open_wait); 1078 wake_up_interruptible(&port->port.open_wait);
@@ -1256,8 +1254,8 @@ static int isicom_set_serial_info(struct isi_port *port,
1256 (newinfo.flags & ASYNC_SPD_MASK)); 1254 (newinfo.flags & ASYNC_SPD_MASK));
1257 1255
1258 if (!capable(CAP_SYS_ADMIN)) { 1256 if (!capable(CAP_SYS_ADMIN)) {
1259 if ((newinfo.close_delay != port->close_delay) || 1257 if ((newinfo.close_delay != port->port.close_delay) ||
1260 (newinfo.closing_wait != port->closing_wait) || 1258 (newinfo.closing_wait != port->port.closing_wait) ||
1261 ((newinfo.flags & ~ASYNC_USR_MASK) != 1259 ((newinfo.flags & ~ASYNC_USR_MASK) !=
1262 (port->port.flags & ~ASYNC_USR_MASK))) { 1260 (port->port.flags & ~ASYNC_USR_MASK))) {
1263 unlock_kernel(); 1261 unlock_kernel();
@@ -1266,8 +1264,8 @@ static int isicom_set_serial_info(struct isi_port *port,
1266 port->port.flags = ((port->port.flags & ~ASYNC_USR_MASK) | 1264 port->port.flags = ((port->port.flags & ~ASYNC_USR_MASK) |
1267 (newinfo.flags & ASYNC_USR_MASK)); 1265 (newinfo.flags & ASYNC_USR_MASK));
1268 } else { 1266 } else {
1269 port->close_delay = newinfo.close_delay; 1267 port->port.close_delay = newinfo.close_delay;
1270 port->closing_wait = newinfo.closing_wait; 1268 port->port.closing_wait = newinfo.closing_wait;
1271 port->port.flags = ((port->port.flags & ~ASYNC_FLAGS) | 1269 port->port.flags = ((port->port.flags & ~ASYNC_FLAGS) |
1272 (newinfo.flags & ASYNC_FLAGS)); 1270 (newinfo.flags & ASYNC_FLAGS));
1273 } 1271 }
@@ -1294,8 +1292,8 @@ static int isicom_get_serial_info(struct isi_port *port,
1294 out_info.irq = port->card->irq; 1292 out_info.irq = port->card->irq;
1295 out_info.flags = port->port.flags; 1293 out_info.flags = port->port.flags;
1296/* out_info.baud_base = ? */ 1294/* out_info.baud_base = ? */
1297 out_info.close_delay = port->close_delay; 1295 out_info.close_delay = port->port.close_delay;
1298 out_info.closing_wait = port->closing_wait; 1296 out_info.closing_wait = port->port.closing_wait;
1299 unlock_kernel(); 1297 unlock_kernel();
1300 if (copy_to_user(info, &out_info, sizeof(out_info))) 1298 if (copy_to_user(info, &out_info, sizeof(out_info)))
1301 return -EFAULT; 1299 return -EFAULT;
@@ -1804,13 +1802,13 @@ static int __init isicom_init(void)
1804 isi_card[idx].ports = port; 1802 isi_card[idx].ports = port;
1805 spin_lock_init(&isi_card[idx].card_lock); 1803 spin_lock_init(&isi_card[idx].card_lock);
1806 for (channel = 0; channel < 16; channel++, port++) { 1804 for (channel = 0; channel < 16; channel++, port++) {
1805 tty_port_init(&port->port);
1807 port->magic = ISICOM_MAGIC; 1806 port->magic = ISICOM_MAGIC;
1808 port->card = &isi_card[idx]; 1807 port->card = &isi_card[idx];
1809 port->channel = channel; 1808 port->channel = channel;
1810 port->close_delay = 50 * HZ/100; 1809 port->port.close_delay = 50 * HZ/100;
1811 port->closing_wait = 3000 * HZ/100; 1810 port->port.closing_wait = 3000 * HZ/100;
1812 port->status = 0; 1811 port->status = 0;
1813 tty_port_init(&port->port);
1814 /* . . . */ 1812 /* . . . */
1815 } 1813 }
1816 isi_card[idx].base = 0; 1814 isi_card[idx].base = 0;