提交 44b7d1b3 编写于 作者: A Alan Cox 提交者: Linus Torvalds

tty: add more tty_port fields

Move more bits into the tty_port structure
Signed-off-by: NAlan Cox <alan@redhat.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 593573bc
...@@ -2677,8 +2677,8 @@ static void cy_close(struct tty_struct *tty, struct file *filp) ...@@ -2677,8 +2677,8 @@ static void cy_close(struct tty_struct *tty, struct file *filp)
*/ */
tty->closing = 1; tty->closing = 1;
spin_unlock_irqrestore(&card->card_lock, flags); spin_unlock_irqrestore(&card->card_lock, flags);
if (info->closing_wait != CY_CLOSING_WAIT_NONE) if (info->port.closing_wait != CY_CLOSING_WAIT_NONE)
tty_wait_until_sent(tty, info->closing_wait); tty_wait_until_sent(tty, info->port.closing_wait);
spin_lock_irqsave(&card->card_lock, flags); spin_lock_irqsave(&card->card_lock, flags);
...@@ -2734,9 +2734,9 @@ static void cy_close(struct tty_struct *tty, struct file *filp) ...@@ -2734,9 +2734,9 @@ static void cy_close(struct tty_struct *tty, struct file *filp)
info->port.tty = NULL; info->port.tty = NULL;
if (info->port.blocked_open) { if (info->port.blocked_open) {
spin_unlock_irqrestore(&card->card_lock, flags); spin_unlock_irqrestore(&card->card_lock, flags);
if (info->close_delay) { if (info->port.close_delay) {
msleep_interruptible(jiffies_to_msecs msleep_interruptible(jiffies_to_msecs
(info->close_delay)); (info->port.close_delay));
} }
wake_up_interruptible(&info->port.open_wait); wake_up_interruptible(&info->port.open_wait);
spin_lock_irqsave(&card->card_lock, flags); spin_lock_irqsave(&card->card_lock, flags);
...@@ -3382,8 +3382,8 @@ get_serial_info(struct cyclades_port *info, ...@@ -3382,8 +3382,8 @@ get_serial_info(struct cyclades_port *info,
cinfo->first_line; cinfo->first_line;
tmp.irq = cinfo->irq; tmp.irq = cinfo->irq;
tmp.flags = info->port.flags; tmp.flags = info->port.flags;
tmp.close_delay = info->close_delay; tmp.close_delay = info->port.close_delay;
tmp.closing_wait = info->closing_wait; tmp.closing_wait = info->port.closing_wait;
tmp.baud_base = info->baud; tmp.baud_base = info->baud;
tmp.custom_divisor = info->custom_divisor; tmp.custom_divisor = info->custom_divisor;
tmp.hub6 = 0; /*!!! */ tmp.hub6 = 0; /*!!! */
...@@ -3402,7 +3402,7 @@ set_serial_info(struct cyclades_port *info, ...@@ -3402,7 +3402,7 @@ set_serial_info(struct cyclades_port *info,
old_info = *info; old_info = *info;
if (!capable(CAP_SYS_ADMIN)) { if (!capable(CAP_SYS_ADMIN)) {
if (new_serial.close_delay != info->close_delay || if (new_serial.close_delay != info->port.close_delay ||
new_serial.baud_base != info->baud || new_serial.baud_base != info->baud ||
(new_serial.flags & ASYNC_FLAGS & (new_serial.flags & ASYNC_FLAGS &
~ASYNC_USR_MASK) != ~ASYNC_USR_MASK) !=
...@@ -3424,8 +3424,8 @@ set_serial_info(struct cyclades_port *info, ...@@ -3424,8 +3424,8 @@ set_serial_info(struct cyclades_port *info,
info->custom_divisor = new_serial.custom_divisor; info->custom_divisor = new_serial.custom_divisor;
info->port.flags = (info->port.flags & ~ASYNC_FLAGS) | info->port.flags = (info->port.flags & ~ASYNC_FLAGS) |
(new_serial.flags & ASYNC_FLAGS); (new_serial.flags & ASYNC_FLAGS);
info->close_delay = new_serial.close_delay * HZ / 100; info->port.close_delay = new_serial.close_delay * HZ / 100;
info->closing_wait = new_serial.closing_wait * HZ / 100; info->port.closing_wait = new_serial.closing_wait * HZ / 100;
check_and_exit: check_and_exit:
if (info->port.flags & ASYNC_INITIALIZED) { if (info->port.flags & ASYNC_INITIALIZED) {
...@@ -3971,11 +3971,11 @@ cy_ioctl(struct tty_struct *tty, struct file *file, ...@@ -3971,11 +3971,11 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
break; break;
#endif /* CONFIG_CYZ_INTR */ #endif /* CONFIG_CYZ_INTR */
case CYSETWAIT: case CYSETWAIT:
info->closing_wait = (unsigned short)arg * HZ / 100; info->port.closing_wait = (unsigned short)arg * HZ / 100;
ret_val = 0; ret_val = 0;
break; break;
case CYGETWAIT: case CYGETWAIT:
ret_val = info->closing_wait / (HZ / 100); ret_val = info->port.closing_wait / (HZ / 100);
break; break;
case TIOCGSERIAL: case TIOCGSERIAL:
ret_val = get_serial_info(info, argp); ret_val = get_serial_info(info, argp);
...@@ -4376,13 +4376,13 @@ static int __devinit cy_init_card(struct cyclades_card *cinfo) ...@@ -4376,13 +4376,13 @@ static int __devinit cy_init_card(struct cyclades_card *cinfo)
for (port = cinfo->first_line; port < cinfo->first_line + nports; for (port = cinfo->first_line; port < cinfo->first_line + nports;
port++) { port++) {
info = &cinfo->ports[port - cinfo->first_line]; info = &cinfo->ports[port - cinfo->first_line];
tty_port_init(&info->port);
info->magic = CYCLADES_MAGIC; info->magic = CYCLADES_MAGIC;
info->card = cinfo; info->card = cinfo;
info->line = port; info->line = port;
info->closing_wait = CLOSING_WAIT_DELAY;
info->close_delay = 5 * HZ / 10;
tty_port_init(&info->port); info->port.closing_wait = CLOSING_WAIT_DELAY;
info->port.close_delay = 5 * HZ / 10;
info->port.flags = STD_COM_FLAGS; info->port.flags = STD_COM_FLAGS;
init_completion(&info->shutdown_wait); init_completion(&info->shutdown_wait);
init_waitqueue_head(&info->delta_msr_wait); init_waitqueue_head(&info->delta_msr_wait);
......
...@@ -199,10 +199,8 @@ struct isi_board { ...@@ -199,10 +199,8 @@ struct isi_board {
struct isi_port { struct isi_port {
unsigned short magic; unsigned short magic;
struct tty_port port; struct tty_port port;
int close_delay;
u16 channel; u16 channel;
u16 status; u16 status;
u16 closing_wait;
struct isi_board *card; struct isi_board *card;
unsigned char *xmit_buf; unsigned char *xmit_buf;
int xmit_head; int xmit_head;
...@@ -1051,8 +1049,8 @@ static void isicom_close(struct tty_struct *tty, struct file *filp) ...@@ -1051,8 +1049,8 @@ static void isicom_close(struct tty_struct *tty, struct file *filp)
tty->closing = 1; tty->closing = 1;
spin_unlock_irqrestore(&card->card_lock, flags); spin_unlock_irqrestore(&card->card_lock, flags);
if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE) if (port->port.closing_wait != ASYNC_CLOSING_WAIT_NONE)
tty_wait_until_sent(tty, port->closing_wait); tty_wait_until_sent(tty, port->port.closing_wait);
/* indicate to the card that no more data can be received /* indicate to the card that no more data can be received
on this port */ on this port */
spin_lock_irqsave(&card->card_lock, flags); spin_lock_irqsave(&card->card_lock, flags);
...@@ -1071,10 +1069,10 @@ static void isicom_close(struct tty_struct *tty, struct file *filp) ...@@ -1071,10 +1069,10 @@ static void isicom_close(struct tty_struct *tty, struct file *filp)
if (port->port.blocked_open) { if (port->port.blocked_open) {
spin_unlock_irqrestore(&card->card_lock, flags); spin_unlock_irqrestore(&card->card_lock, flags);
if (port->close_delay) { if (port->port.close_delay) {
pr_dbg("scheduling until time out.\n"); pr_dbg("scheduling until time out.\n");
msleep_interruptible( msleep_interruptible(
jiffies_to_msecs(port->close_delay)); jiffies_to_msecs(port->port.close_delay));
} }
spin_lock_irqsave(&card->card_lock, flags); spin_lock_irqsave(&card->card_lock, flags);
wake_up_interruptible(&port->port.open_wait); wake_up_interruptible(&port->port.open_wait);
...@@ -1256,8 +1254,8 @@ static int isicom_set_serial_info(struct isi_port *port, ...@@ -1256,8 +1254,8 @@ static int isicom_set_serial_info(struct isi_port *port,
(newinfo.flags & ASYNC_SPD_MASK)); (newinfo.flags & ASYNC_SPD_MASK));
if (!capable(CAP_SYS_ADMIN)) { if (!capable(CAP_SYS_ADMIN)) {
if ((newinfo.close_delay != port->close_delay) || if ((newinfo.close_delay != port->port.close_delay) ||
(newinfo.closing_wait != port->closing_wait) || (newinfo.closing_wait != port->port.closing_wait) ||
((newinfo.flags & ~ASYNC_USR_MASK) != ((newinfo.flags & ~ASYNC_USR_MASK) !=
(port->port.flags & ~ASYNC_USR_MASK))) { (port->port.flags & ~ASYNC_USR_MASK))) {
unlock_kernel(); unlock_kernel();
...@@ -1266,8 +1264,8 @@ static int isicom_set_serial_info(struct isi_port *port, ...@@ -1266,8 +1264,8 @@ static int isicom_set_serial_info(struct isi_port *port,
port->port.flags = ((port->port.flags & ~ASYNC_USR_MASK) | port->port.flags = ((port->port.flags & ~ASYNC_USR_MASK) |
(newinfo.flags & ASYNC_USR_MASK)); (newinfo.flags & ASYNC_USR_MASK));
} else { } else {
port->close_delay = newinfo.close_delay; port->port.close_delay = newinfo.close_delay;
port->closing_wait = newinfo.closing_wait; port->port.closing_wait = newinfo.closing_wait;
port->port.flags = ((port->port.flags & ~ASYNC_FLAGS) | port->port.flags = ((port->port.flags & ~ASYNC_FLAGS) |
(newinfo.flags & ASYNC_FLAGS)); (newinfo.flags & ASYNC_FLAGS));
} }
...@@ -1294,8 +1292,8 @@ static int isicom_get_serial_info(struct isi_port *port, ...@@ -1294,8 +1292,8 @@ static int isicom_get_serial_info(struct isi_port *port,
out_info.irq = port->card->irq; out_info.irq = port->card->irq;
out_info.flags = port->port.flags; out_info.flags = port->port.flags;
/* out_info.baud_base = ? */ /* out_info.baud_base = ? */
out_info.close_delay = port->close_delay; out_info.close_delay = port->port.close_delay;
out_info.closing_wait = port->closing_wait; out_info.closing_wait = port->port.closing_wait;
unlock_kernel(); unlock_kernel();
if (copy_to_user(info, &out_info, sizeof(out_info))) if (copy_to_user(info, &out_info, sizeof(out_info)))
return -EFAULT; return -EFAULT;
...@@ -1804,13 +1802,13 @@ static int __init isicom_init(void) ...@@ -1804,13 +1802,13 @@ static int __init isicom_init(void)
isi_card[idx].ports = port; isi_card[idx].ports = port;
spin_lock_init(&isi_card[idx].card_lock); spin_lock_init(&isi_card[idx].card_lock);
for (channel = 0; channel < 16; channel++, port++) { for (channel = 0; channel < 16; channel++, port++) {
tty_port_init(&port->port);
port->magic = ISICOM_MAGIC; port->magic = ISICOM_MAGIC;
port->card = &isi_card[idx]; port->card = &isi_card[idx];
port->channel = channel; port->channel = channel;
port->close_delay = 50 * HZ/100; port->port.close_delay = 50 * HZ/100;
port->closing_wait = 3000 * HZ/100; port->port.closing_wait = 3000 * HZ/100;
port->status = 0; port->status = 0;
tty_port_init(&port->port);
/* . . . */ /* . . . */
} }
isi_card[idx].base = 0; isi_card[idx].base = 0;
......
...@@ -135,7 +135,6 @@ struct moxa_port { ...@@ -135,7 +135,6 @@ struct moxa_port {
void __iomem *tableAddr; void __iomem *tableAddr;
int type; int type;
int close_delay;
int cflag; int cflag;
unsigned long statusflags; unsigned long statusflags;
...@@ -822,10 +821,9 @@ static int moxa_init_board(struct moxa_board_conf *brd, struct device *dev) ...@@ -822,10 +821,9 @@ static int moxa_init_board(struct moxa_board_conf *brd, struct device *dev)
} }
for (i = 0, p = brd->ports; i < MAX_PORTS_PER_BOARD; i++, p++) { for (i = 0, p = brd->ports; i < MAX_PORTS_PER_BOARD; i++, p++) {
tty_port_init(&p->port);
p->type = PORT_16550A; p->type = PORT_16550A;
p->close_delay = 5 * HZ / 10;
p->cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; p->cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
tty_port_init(&p->port);
} }
switch (brd->boardType) { switch (brd->boardType) {
...@@ -2124,7 +2122,7 @@ static int moxa_get_serial_info(struct moxa_port *info, ...@@ -2124,7 +2122,7 @@ static int moxa_get_serial_info(struct moxa_port *info,
.line = info->port.tty->index, .line = info->port.tty->index,
.flags = info->port.flags, .flags = info->port.flags,
.baud_base = 921600, .baud_base = 921600,
.close_delay = info->close_delay .close_delay = info->port.close_delay
}; };
return copy_to_user(retinfo, &tmp, sizeof(*retinfo)) ? -EFAULT : 0; return copy_to_user(retinfo, &tmp, sizeof(*retinfo)) ? -EFAULT : 0;
} }
...@@ -2148,7 +2146,7 @@ static int moxa_set_serial_info(struct moxa_port *info, ...@@ -2148,7 +2146,7 @@ static int moxa_set_serial_info(struct moxa_port *info,
(info->port.flags & ~ASYNC_USR_MASK))) (info->port.flags & ~ASYNC_USR_MASK)))
return -EPERM; return -EPERM;
} else } else
info->close_delay = new_serial.close_delay * HZ / 100; info->port.close_delay = new_serial.close_delay * HZ / 100;
new_serial.flags = (new_serial.flags & ~ASYNC_FLAGS); new_serial.flags = (new_serial.flags & ~ASYNC_FLAGS);
new_serial.flags |= (info->port.flags & ASYNC_FLAGS); new_serial.flags |= (info->port.flags & ASYNC_FLAGS);
......
...@@ -243,10 +243,7 @@ struct mxser_port { ...@@ -243,10 +243,7 @@ struct mxser_port {
unsigned char ldisc_stop_rx; unsigned char ldisc_stop_rx;
int custom_divisor; int custom_divisor;
int close_delay;
unsigned short closing_wait;
unsigned char err_shadow; unsigned char err_shadow;
unsigned long event;
struct async_icount icount; /* kernel counters for 4 input interrupts */ struct async_icount icount; /* kernel counters for 4 input interrupts */
int timeout; int timeout;
...@@ -1199,8 +1196,8 @@ static void mxser_close(struct tty_struct *tty, struct file *filp) ...@@ -1199,8 +1196,8 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
* the line discipline to only process XON/XOFF characters. * the line discipline to only process XON/XOFF characters.
*/ */
tty->closing = 1; tty->closing = 1;
if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE) if (info->port.closing_wait != ASYNC_CLOSING_WAIT_NONE)
tty_wait_until_sent(tty, info->closing_wait); tty_wait_until_sent(tty, info->port.closing_wait);
/* /*
* At this point we stop accepting input. To do this, we * At this point we stop accepting input. To do this, we
* disable the receive line status interrupts, and tell the * disable the receive line status interrupts, and tell the
...@@ -1231,11 +1228,10 @@ static void mxser_close(struct tty_struct *tty, struct file *filp) ...@@ -1231,11 +1228,10 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
tty_ldisc_flush(tty); tty_ldisc_flush(tty);
tty->closing = 0; tty->closing = 0;
info->event = 0;
info->port.tty = NULL; info->port.tty = NULL;
if (info->port.blocked_open) { if (info->port.blocked_open) {
if (info->close_delay) if (info->port.close_delay)
schedule_timeout_interruptible(info->close_delay); schedule_timeout_interruptible(info->port.close_delay);
wake_up_interruptible(&info->port.open_wait); wake_up_interruptible(&info->port.open_wait);
} }
...@@ -1370,8 +1366,8 @@ static int mxser_get_serial_info(struct mxser_port *info, ...@@ -1370,8 +1366,8 @@ static int mxser_get_serial_info(struct mxser_port *info,
.irq = info->board->irq, .irq = info->board->irq,
.flags = info->port.flags, .flags = info->port.flags,
.baud_base = info->baud_base, .baud_base = info->baud_base,
.close_delay = info->close_delay, .close_delay = info->port.close_delay,
.closing_wait = info->closing_wait, .closing_wait = info->port.closing_wait,
.custom_divisor = info->custom_divisor, .custom_divisor = info->custom_divisor,
.hub6 = 0 .hub6 = 0
}; };
...@@ -1402,7 +1398,7 @@ static int mxser_set_serial_info(struct mxser_port *info, ...@@ -1402,7 +1398,7 @@ static int mxser_set_serial_info(struct mxser_port *info,
if (!capable(CAP_SYS_ADMIN)) { if (!capable(CAP_SYS_ADMIN)) {
if ((new_serial.baud_base != info->baud_base) || if ((new_serial.baud_base != info->baud_base) ||
(new_serial.close_delay != info->close_delay) || (new_serial.close_delay != info->port.close_delay) ||
((new_serial.flags & ~ASYNC_USR_MASK) != (info->port.flags & ~ASYNC_USR_MASK))) ((new_serial.flags & ~ASYNC_USR_MASK) != (info->port.flags & ~ASYNC_USR_MASK)))
return -EPERM; return -EPERM;
info->port.flags = ((info->port.flags & ~ASYNC_USR_MASK) | info->port.flags = ((info->port.flags & ~ASYNC_USR_MASK) |
...@@ -1414,8 +1410,8 @@ static int mxser_set_serial_info(struct mxser_port *info, ...@@ -1414,8 +1410,8 @@ static int mxser_set_serial_info(struct mxser_port *info,
*/ */
info->port.flags = ((info->port.flags & ~ASYNC_FLAGS) | info->port.flags = ((info->port.flags & ~ASYNC_FLAGS) |
(new_serial.flags & ASYNC_FLAGS)); (new_serial.flags & ASYNC_FLAGS));
info->close_delay = new_serial.close_delay * HZ / 100; info->port.close_delay = new_serial.close_delay * HZ / 100;
info->closing_wait = new_serial.closing_wait * HZ / 100; info->port.closing_wait = new_serial.closing_wait * HZ / 100;
info->port.tty->low_latency = info->port.tty->low_latency =
(info->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; (info->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0;
info->port.tty->low_latency = 0; info->port.tty->low_latency = 0;
...@@ -2214,7 +2210,6 @@ static void mxser_hangup(struct tty_struct *tty) ...@@ -2214,7 +2210,6 @@ static void mxser_hangup(struct tty_struct *tty)
mxser_flush_buffer(tty); mxser_flush_buffer(tty);
mxser_shutdown(info); mxser_shutdown(info);
info->event = 0;
info->port.count = 0; info->port.count = 0;
info->port.flags &= ~ASYNC_NORMAL_ACTIVE; info->port.flags &= ~ASYNC_NORMAL_ACTIVE;
info->port.tty = NULL; info->port.tty = NULL;
...@@ -2545,6 +2540,7 @@ static int __devinit mxser_initbrd(struct mxser_board *brd, ...@@ -2545,6 +2540,7 @@ static int __devinit mxser_initbrd(struct mxser_board *brd,
for (i = 0; i < brd->info->nports; i++) { for (i = 0; i < brd->info->nports; i++) {
info = &brd->ports[i]; info = &brd->ports[i];
tty_port_init(&info->port);
info->board = brd; info->board = brd;
info->stop_rx = 0; info->stop_rx = 0;
info->ldisc_stop_rx = 0; info->ldisc_stop_rx = 0;
...@@ -2559,10 +2555,9 @@ static int __devinit mxser_initbrd(struct mxser_board *brd, ...@@ -2559,10 +2555,9 @@ static int __devinit mxser_initbrd(struct mxser_board *brd,
process_txrx_fifo(info); process_txrx_fifo(info);
info->custom_divisor = info->baud_base * 16; info->custom_divisor = info->baud_base * 16;
info->close_delay = 5 * HZ / 10; info->port.close_delay = 5 * HZ / 10;
info->closing_wait = 30 * HZ; info->port.closing_wait = 30 * HZ;
info->normal_termios = mxvar_sdriver->init_termios; info->normal_termios = mxvar_sdriver->init_termios;
tty_port_init(&info->port);
init_waitqueue_head(&info->delta_msr_wait); init_waitqueue_head(&info->delta_msr_wait);
memset(&info->mon_data, 0, sizeof(struct mxser_mon)); memset(&info->mon_data, 0, sizeof(struct mxser_mon));
info->err_shadow = 0; info->err_shadow = 0;
......
...@@ -1032,8 +1032,8 @@ static void rc_close(struct tty_struct *tty, struct file *filp) ...@@ -1032,8 +1032,8 @@ static void rc_close(struct tty_struct *tty, struct file *filp)
* the line discipline to only process XON/XOFF characters. * the line discipline to only process XON/XOFF characters.
*/ */
tty->closing = 1; tty->closing = 1;
if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE) if (port->port.closing_wait != ASYNC_CLOSING_WAIT_NONE)
tty_wait_until_sent(tty, port->closing_wait); tty_wait_until_sent(tty, port->port.closing_wait);
/* /*
* At this point we stop accepting input. To do this, we * At this point we stop accepting input. To do this, we
* disable the receive line status interrupts, and tell the * 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,8 +1065,8 @@ static void rc_close(struct tty_struct *tty, struct file *filp)
tty->closing = 0; tty->closing = 0;
port->port.tty = NULL; port->port.tty = NULL;
if (port->port.blocked_open) { if (port->port.blocked_open) {
if (port->close_delay) if (port->port.close_delay)
msleep_interruptible(jiffies_to_msecs(port->close_delay)); msleep_interruptible(jiffies_to_msecs(port->port.close_delay));
wake_up_interruptible(&port->port.open_wait); wake_up_interruptible(&port->port.open_wait);
} }
port->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); port->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
...@@ -1295,8 +1295,8 @@ static int rc_set_serial_info(struct riscom_port *port, ...@@ -1295,8 +1295,8 @@ static int rc_set_serial_info(struct riscom_port *port,
(tmp.flags & ASYNC_SPD_MASK)); (tmp.flags & ASYNC_SPD_MASK));
if (!capable(CAP_SYS_ADMIN)) { if (!capable(CAP_SYS_ADMIN)) {
if ((tmp.close_delay != port->close_delay) || if ((tmp.close_delay != port->port.close_delay) ||
(tmp.closing_wait != port->closing_wait) || (tmp.closing_wait != port->port.closing_wait) ||
((tmp.flags & ~ASYNC_USR_MASK) != ((tmp.flags & ~ASYNC_USR_MASK) !=
(port->port.flags & ~ASYNC_USR_MASK))) (port->port.flags & ~ASYNC_USR_MASK)))
return -EPERM; return -EPERM;
...@@ -1305,8 +1305,8 @@ static int rc_set_serial_info(struct riscom_port *port, ...@@ -1305,8 +1305,8 @@ static int rc_set_serial_info(struct riscom_port *port,
} else { } else {
port->port.flags = ((port->port.flags & ~ASYNC_FLAGS) | port->port.flags = ((port->port.flags & ~ASYNC_FLAGS) |
(tmp.flags & ASYNC_FLAGS)); (tmp.flags & ASYNC_FLAGS));
port->close_delay = tmp.close_delay; port->port.close_delay = tmp.close_delay;
port->closing_wait = tmp.closing_wait; port->port.closing_wait = tmp.closing_wait;
} }
if (change_speed) { if (change_speed) {
unsigned long flags; unsigned long flags;
...@@ -1331,8 +1331,8 @@ static int rc_get_serial_info(struct riscom_port *port, ...@@ -1331,8 +1331,8 @@ static int rc_get_serial_info(struct riscom_port *port,
tmp.irq = bp->irq; tmp.irq = bp->irq;
tmp.flags = port->port.flags; tmp.flags = port->port.flags;
tmp.baud_base = (RC_OSCFREQ + CD180_TPC/2) / CD180_TPC; tmp.baud_base = (RC_OSCFREQ + CD180_TPC/2) / CD180_TPC;
tmp.close_delay = port->close_delay * HZ/100; tmp.close_delay = port->port.close_delay * HZ/100;
tmp.closing_wait = port->closing_wait * HZ/100; tmp.closing_wait = port->port.closing_wait * HZ/100;
tmp.xmit_fifo_size = CD180_NFIFO; tmp.xmit_fifo_size = CD180_NFIFO;
return copy_to_user(retinfo, &tmp, sizeof(tmp)) ? -EFAULT : 0; return copy_to_user(retinfo, &tmp, sizeof(tmp)) ? -EFAULT : 0;
} }
...@@ -1549,10 +1549,8 @@ static int __init rc_init_drivers(void) ...@@ -1549,10 +1549,8 @@ static int __init rc_init_drivers(void)
} }
memset(rc_port, 0, sizeof(rc_port)); memset(rc_port, 0, sizeof(rc_port));
for (i = 0; i < RC_NPORT * RC_NBOARD; i++) { for (i = 0; i < RC_NPORT * RC_NBOARD; i++) {
rc_port[i].magic = RISCOM8_MAGIC;
rc_port[i].close_delay = 50 * HZ / 100;
rc_port[i].closing_wait = 3000 * HZ / 100;
tty_port_init(&rc_port[i].port); tty_port_init(&rc_port[i].port);
rc_port[i].magic = RISCOM8_MAGIC;
} }
return 0; return 0;
} }
......
...@@ -69,14 +69,12 @@ struct riscom_port { ...@@ -69,14 +69,12 @@ struct riscom_port {
struct tty_port port; struct tty_port port;
int baud_base; int baud_base;
int timeout; int timeout;
int close_delay;
int custom_divisor; int custom_divisor;
int xmit_head; int xmit_head;
int xmit_tail; int xmit_tail;
int xmit_cnt; int xmit_cnt;
short wakeup_chars; short wakeup_chars;
short break_length; short break_length;
unsigned short closing_wait;
unsigned char mark_mask; unsigned char mark_mask;
unsigned char IER; unsigned char IER;
unsigned char MSVR; unsigned char MSVR;
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/tty_driver.h> #include <linux/tty_driver.h>
#include <linux/tty_flip.h> #include <linux/tty_flip.h>
#include <linux/serial.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
...@@ -81,7 +82,7 @@ ...@@ -81,7 +82,7 @@
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <asm/uaccess.h> #include <linux/uaccess.h>
#include <asm/atomic.h> #include <asm/atomic.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <linux/bitops.h> #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,8 +649,8 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev)
info->board = board; info->board = board;
info->aiop = aiop; info->aiop = aiop;
info->chan = chan; info->chan = chan;
info->closing_wait = 3000; info->port.closing_wait = 3000;
info->close_delay = 50; info->port.close_delay = 50;
init_waitqueue_head(&info->port.open_wait); init_waitqueue_head(&info->port.open_wait);
init_completion(&info->close_wait); init_completion(&info->close_wait);
info->flags &= ~ROCKET_MODE_MASK; info->flags &= ~ROCKET_MODE_MASK;
...@@ -1137,8 +1138,8 @@ static void rp_close(struct tty_struct *tty, struct file *filp) ...@@ -1137,8 +1138,8 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
/* /*
* Wait for the transmit buffer to clear * Wait for the transmit buffer to clear
*/ */
if (info->closing_wait != ROCKET_CLOSING_WAIT_NONE) if (info->port.closing_wait != ROCKET_CLOSING_WAIT_NONE)
tty_wait_until_sent(tty, info->closing_wait); tty_wait_until_sent(tty, info->port.closing_wait);
/* /*
* Before we drop DTR, make sure the UART transmitter * Before we drop DTR, make sure the UART transmitter
* has completely drained; this is especially * has completely drained; this is especially
...@@ -1168,8 +1169,8 @@ static void rp_close(struct tty_struct *tty, struct file *filp) ...@@ -1168,8 +1169,8 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]); clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]);
if (info->port.blocked_open) { if (info->port.blocked_open) {
if (info->close_delay) { if (info->port.close_delay) {
msleep_interruptible(jiffies_to_msecs(info->close_delay)); msleep_interruptible(jiffies_to_msecs(info->port.close_delay));
} }
wake_up_interruptible(&info->port.open_wait); wake_up_interruptible(&info->port.open_wait);
} else { } else {
...@@ -1327,8 +1328,8 @@ static int get_config(struct r_port *info, struct rocket_config __user *retinfo) ...@@ -1327,8 +1328,8 @@ static int get_config(struct r_port *info, struct rocket_config __user *retinfo)
memset(&tmp, 0, sizeof (tmp)); memset(&tmp, 0, sizeof (tmp));
tmp.line = info->line; tmp.line = info->line;
tmp.flags = info->flags; tmp.flags = info->flags;
tmp.close_delay = info->close_delay; tmp.close_delay = info->port.close_delay;
tmp.closing_wait = info->closing_wait; tmp.closing_wait = info->port.closing_wait;
tmp.port = rcktpt_io_addr[(info->line >> 5) & 3]; tmp.port = rcktpt_io_addr[(info->line >> 5) & 3];
if (copy_to_user(retinfo, &tmp, sizeof (*retinfo))) 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,8 +1354,8 @@ static int set_config(struct r_port *info, struct rocket_config __user *new_info
} }
info->flags = ((info->flags & ~ROCKET_FLAGS) | (new_serial.flags & ROCKET_FLAGS)); info->flags = ((info->flags & ~ROCKET_FLAGS) | (new_serial.flags & ROCKET_FLAGS));
info->close_delay = new_serial.close_delay; info->port.close_delay = new_serial.close_delay;
info->closing_wait = new_serial.closing_wait; info->port.closing_wait = new_serial.closing_wait;
if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_HI) if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_HI)
info->port.tty->alt_speed = 57600; info->port.tty->alt_speed = 57600;
......
...@@ -64,8 +64,8 @@ struct rocket_version { ...@@ -64,8 +64,8 @@ struct rocket_version {
/* /*
* For closing_wait and closing_wait2 * For closing_wait and closing_wait2
*/ */
#define ROCKET_CLOSING_WAIT_NONE 65535 #define ROCKET_CLOSING_WAIT_NONE ASYNC_CLOSING_WAIT_NONE
#define ROCKET_CLOSING_WAIT_INF 0 #define ROCKET_CLOSING_WAIT_INF ASYNC_CLOSING_WAIT_INF
/* /*
* Rocketport ioctls -- "RP" * Rocketport ioctls -- "RP"
......
...@@ -1133,8 +1133,6 @@ struct r_port { ...@@ -1133,8 +1133,6 @@ struct r_port {
unsigned int chan:3; unsigned int chan:3;
CONTROLLER_t *ctlp; CONTROLLER_t *ctlp;
CHANNEL_t channel; CHANNEL_t channel;
int closing_wait;
int close_delay;
int intmask; int intmask;
int xmit_fifo_room; /* room in xmit fifo */ int xmit_fifo_room; /* room in xmit fifo */
unsigned char *xmit_buf; unsigned char *xmit_buf;
......
...@@ -608,9 +608,9 @@ static inline struct specialix_port * sx_get_port(struct specialix_board * bp, ...@@ -608,9 +608,9 @@ static inline struct specialix_port * sx_get_port(struct specialix_board * bp,
dprintk (SX_DEBUG_CHAN, "channel: %d\n", channel); dprintk (SX_DEBUG_CHAN, "channel: %d\n", channel);
if (channel < CD186x_NCH) { if (channel < CD186x_NCH) {
port = &sx_port[board_No(bp) * SX_NPORT + channel]; port = &sx_port[board_No(bp) * SX_NPORT + channel];
dprintk (SX_DEBUG_CHAN, "port: %d %p flags: 0x%x\n",board_No(bp) * SX_NPORT + channel, port, port->flags & ASYNC_INITIALIZED); dprintk (SX_DEBUG_CHAN, "port: %d %p flags: 0x%lx\n",board_No(bp) * SX_NPORT + channel, port, port->port.flags & ASYNC_INITIALIZED);
if (port->flags & ASYNC_INITIALIZED) { if (port->port.flags & ASYNC_INITIALIZED) {
dprintk (SX_DEBUG_CHAN, "port: %d %p\n", channel, port); dprintk (SX_DEBUG_CHAN, "port: %d %p\n", channel, port);
func_exit(); func_exit();
return port; return port;
...@@ -637,7 +637,7 @@ static inline void sx_receive_exc(struct specialix_board * bp) ...@@ -637,7 +637,7 @@ static inline void sx_receive_exc(struct specialix_board * bp)
func_exit(); func_exit();
return; return;
} }
tty = port->tty; tty = port->port.tty;
status = sx_in(bp, CD186x_RCSR); status = sx_in(bp, CD186x_RCSR);
...@@ -673,7 +673,7 @@ static inline void sx_receive_exc(struct specialix_board * bp) ...@@ -673,7 +673,7 @@ static inline void sx_receive_exc(struct specialix_board * bp)
dprintk(SX_DEBUG_RX, "sx%d: port %d: Handling break...\n", dprintk(SX_DEBUG_RX, "sx%d: port %d: Handling break...\n",
board_No(bp), port_No(port)); board_No(bp), port_No(port));
flag = TTY_BREAK; flag = TTY_BREAK;
if (port->flags & ASYNC_SAK) if (port->port.flags & ASYNC_SAK)
do_SAK(tty); do_SAK(tty);
} else if (status & RCSR_PE) } else if (status & RCSR_PE)
...@@ -707,7 +707,7 @@ static inline void sx_receive(struct specialix_board * bp) ...@@ -707,7 +707,7 @@ static inline void sx_receive(struct specialix_board * bp)
func_exit(); func_exit();
return; return;
} }
tty = port->tty; tty = port->port.tty;
count = sx_in(bp, CD186x_RDCR); count = sx_in(bp, CD186x_RDCR);
dprintk (SX_DEBUG_RX, "port: %p: count: %d\n", port, count); dprintk (SX_DEBUG_RX, "port: %p: count: %d\n", port, count);
...@@ -734,7 +734,7 @@ static inline void sx_transmit(struct specialix_board * bp) ...@@ -734,7 +734,7 @@ static inline void sx_transmit(struct specialix_board * bp)
return; return;
} }
dprintk (SX_DEBUG_TX, "port: %p\n", port); dprintk (SX_DEBUG_TX, "port: %p\n", port);
tty = port->tty; tty = port->port.tty;
if (port->IER & IER_TXEMPTY) { if (port->IER & IER_TXEMPTY) {
/* FIFO drained */ /* FIFO drained */
...@@ -811,7 +811,7 @@ static inline void sx_check_modem(struct specialix_board * bp) ...@@ -811,7 +811,7 @@ static inline void sx_check_modem(struct specialix_board * bp)
if (!(port = sx_get_port(bp, "Modem"))) if (!(port = sx_get_port(bp, "Modem")))
return; return;
tty = port->tty; tty = port->port.tty;
mcr = sx_in(bp, CD186x_MCR); mcr = sx_in(bp, CD186x_MCR);
printk ("mcr = %02x.\n", mcr); printk ("mcr = %02x.\n", mcr);
...@@ -821,7 +821,7 @@ static inline void sx_check_modem(struct specialix_board * bp) ...@@ -821,7 +821,7 @@ static inline void sx_check_modem(struct specialix_board * bp)
msvr_cd = sx_in(bp, CD186x_MSVR) & MSVR_CD; msvr_cd = sx_in(bp, CD186x_MSVR) & MSVR_CD;
if (msvr_cd) { if (msvr_cd) {
dprintk (SX_DEBUG_SIGNALS, "Waking up guys in open.\n"); dprintk (SX_DEBUG_SIGNALS, "Waking up guys in open.\n");
wake_up_interruptible(&port->open_wait); wake_up_interruptible(&port->port.open_wait);
} else { } else {
dprintk (SX_DEBUG_SIGNALS, "Sending HUP.\n"); dprintk (SX_DEBUG_SIGNALS, "Sending HUP.\n");
tty_hangup(tty); tty_hangup(tty);
...@@ -1030,7 +1030,7 @@ static void sx_change_speed(struct specialix_board *bp, struct specialix_port *p ...@@ -1030,7 +1030,7 @@ static void sx_change_speed(struct specialix_board *bp, struct specialix_port *p
func_enter(); func_enter();
if (!(tty = port->tty) || !tty->termios) { if (!(tty = port->port.tty) || !tty->termios) {
func_exit(); func_exit();
return; return;
} }
...@@ -1052,9 +1052,9 @@ static void sx_change_speed(struct specialix_board *bp, struct specialix_port *p ...@@ -1052,9 +1052,9 @@ static void sx_change_speed(struct specialix_board *bp, struct specialix_port *p
baud = tty_get_baud_rate(tty); baud = tty_get_baud_rate(tty);
if (baud == 38400) { if (baud == 38400) {
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) if ((port->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
baud = 57600; baud = 57600;
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) if ((port->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
baud = 115200; baud = 115200;
} }
...@@ -1244,7 +1244,7 @@ static int sx_setup_port(struct specialix_board *bp, struct specialix_port *port ...@@ -1244,7 +1244,7 @@ static int sx_setup_port(struct specialix_board *bp, struct specialix_port *port
func_enter(); func_enter();
if (port->flags & ASYNC_INITIALIZED) { if (port->port.flags & ASYNC_INITIALIZED) {
func_exit(); func_exit();
return 0; return 0;
} }
...@@ -1268,12 +1268,12 @@ static int sx_setup_port(struct specialix_board *bp, struct specialix_port *port ...@@ -1268,12 +1268,12 @@ static int sx_setup_port(struct specialix_board *bp, struct specialix_port *port
spin_lock_irqsave(&port->lock, flags); spin_lock_irqsave(&port->lock, flags);
if (port->tty) if (port->port.tty)
clear_bit(TTY_IO_ERROR, &port->tty->flags); clear_bit(TTY_IO_ERROR, &port->port.tty->flags);
port->xmit_cnt = port->xmit_head = port->xmit_tail = 0; port->xmit_cnt = port->xmit_head = port->xmit_tail = 0;
sx_change_speed(bp, port); sx_change_speed(bp, port);
port->flags |= ASYNC_INITIALIZED; port->port.flags |= ASYNC_INITIALIZED;
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
...@@ -1292,7 +1292,7 @@ static void sx_shutdown_port(struct specialix_board *bp, struct specialix_port * ...@@ -1292,7 +1292,7 @@ static void sx_shutdown_port(struct specialix_board *bp, struct specialix_port *
func_enter(); func_enter();
if (!(port->flags & ASYNC_INITIALIZED)) { if (!(port->port.flags & ASYNC_INITIALIZED)) {
func_exit(); func_exit();
return; return;
} }
...@@ -1315,7 +1315,7 @@ static void sx_shutdown_port(struct specialix_board *bp, struct specialix_port * ...@@ -1315,7 +1315,7 @@ static void sx_shutdown_port(struct specialix_board *bp, struct specialix_port *
spin_lock_irqsave(&bp->lock, flags); spin_lock_irqsave(&bp->lock, flags);
sx_out(bp, CD186x_CAR, port_No(port)); sx_out(bp, CD186x_CAR, port_No(port));
if (!(tty = port->tty) || C_HUPCL(tty)) { if (!(tty = port->port.tty) || C_HUPCL(tty)) {
/* Drop DTR */ /* Drop DTR */
sx_out(bp, CD186x_MSVDTR, 0); sx_out(bp, CD186x_MSVDTR, 0);
} }
...@@ -1330,7 +1330,7 @@ static void sx_shutdown_port(struct specialix_board *bp, struct specialix_port * ...@@ -1330,7 +1330,7 @@ static void sx_shutdown_port(struct specialix_board *bp, struct specialix_port *
spin_unlock_irqrestore(&bp->lock, flags); spin_unlock_irqrestore(&bp->lock, flags);
if (tty) if (tty)
set_bit(TTY_IO_ERROR, &tty->flags); set_bit(TTY_IO_ERROR, &tty->flags);
port->flags &= ~ASYNC_INITIALIZED; port->port.flags &= ~ASYNC_INITIALIZED;
if (!bp->count) if (!bp->count)
sx_shutdown_board(bp); sx_shutdown_board(bp);
...@@ -1354,9 +1354,9 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, ...@@ -1354,9 +1354,9 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
* If the device is in the middle of being closed, then block * If the device is in the middle of being closed, then block
* until it's done, and then try again. * until it's done, and then try again.
*/ */
if (tty_hung_up_p(filp) || port->flags & ASYNC_CLOSING) { if (tty_hung_up_p(filp) || port->port.flags & ASYNC_CLOSING) {
interruptible_sleep_on(&port->close_wait); interruptible_sleep_on(&port->port.close_wait);
if (port->flags & ASYNC_HUP_NOTIFY) { if (port->port.flags & ASYNC_HUP_NOTIFY) {
func_exit(); func_exit();
return -EAGAIN; return -EAGAIN;
} else { } else {
...@@ -1371,7 +1371,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, ...@@ -1371,7 +1371,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
*/ */
if ((filp->f_flags & O_NONBLOCK) || if ((filp->f_flags & O_NONBLOCK) ||
(tty->flags & (1 << TTY_IO_ERROR))) { (tty->flags & (1 << TTY_IO_ERROR))) {
port->flags |= ASYNC_NORMAL_ACTIVE; port->port.flags |= ASYNC_NORMAL_ACTIVE;
func_exit(); func_exit();
return 0; return 0;
} }
...@@ -1387,13 +1387,13 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, ...@@ -1387,13 +1387,13 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
* exit, either normal or abnormal. * exit, either normal or abnormal.
*/ */
retval = 0; retval = 0;
add_wait_queue(&port->open_wait, &wait); add_wait_queue(&port->port.open_wait, &wait);
spin_lock_irqsave(&port->lock, flags); spin_lock_irqsave(&port->lock, flags);
if (!tty_hung_up_p(filp)) { if (!tty_hung_up_p(filp)) {
port->count--; port->port.count--;
} }
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
port->blocked_open++; port->port.blocked_open++;
while (1) { while (1) {
spin_lock_irqsave(&bp->lock, flags); spin_lock_irqsave(&bp->lock, flags);
sx_out(bp, CD186x_CAR, port_No(port)); sx_out(bp, CD186x_CAR, port_No(port));
...@@ -1410,14 +1410,14 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, ...@@ -1410,14 +1410,14 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
spin_unlock_irqrestore(&bp->lock, flags); spin_unlock_irqrestore(&bp->lock, flags);
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
if (tty_hung_up_p(filp) || if (tty_hung_up_p(filp) ||
!(port->flags & ASYNC_INITIALIZED)) { !(port->port.flags & ASYNC_INITIALIZED)) {
if (port->flags & ASYNC_HUP_NOTIFY) if (port->port.flags & ASYNC_HUP_NOTIFY)
retval = -EAGAIN; retval = -EAGAIN;
else else
retval = -ERESTARTSYS; retval = -ERESTARTSYS;
break; break;
} }
if (!(port->flags & ASYNC_CLOSING) && if (!(port->port.flags & ASYNC_CLOSING) &&
(do_clocal || CD)) (do_clocal || CD))
break; break;
if (signal_pending(current)) { if (signal_pending(current)) {
...@@ -1428,19 +1428,19 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, ...@@ -1428,19 +1428,19 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
} }
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
remove_wait_queue(&port->open_wait, &wait); remove_wait_queue(&port->port.open_wait, &wait);
spin_lock_irqsave(&port->lock, flags); spin_lock_irqsave(&port->lock, flags);
if (!tty_hung_up_p(filp)) { if (!tty_hung_up_p(filp)) {
port->count++; port->port.count++;
} }
port->blocked_open--; port->port.blocked_open--;
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
if (retval) { if (retval) {
func_exit(); func_exit();
return retval; return retval;
} }
port->flags |= ASYNC_NORMAL_ACTIVE; port->port.flags |= ASYNC_NORMAL_ACTIVE;
func_exit(); func_exit();
return 0; return 0;
} }
...@@ -1484,10 +1484,10 @@ static int sx_open(struct tty_struct * tty, struct file * filp) ...@@ -1484,10 +1484,10 @@ static int sx_open(struct tty_struct * tty, struct file * filp)
} }
spin_lock_irqsave(&bp->lock, flags); spin_lock_irqsave(&bp->lock, flags);
port->count++; port->port.count++;
bp->count++; bp->count++;
tty->driver_data = port; tty->driver_data = port;
port->tty = tty; port->port.tty = tty;
spin_unlock_irqrestore(&bp->lock, flags); spin_unlock_irqrestore(&bp->lock, flags);
if ((error = sx_setup_port(bp, port))) { if ((error = sx_setup_port(bp, port))) {
...@@ -1547,15 +1547,15 @@ static void sx_close(struct tty_struct * tty, struct file * filp) ...@@ -1547,15 +1547,15 @@ static void sx_close(struct tty_struct * tty, struct file * filp)
} }
bp = port_Board(port); bp = port_Board(port);
if ((tty->count == 1) && (port->count != 1)) { if ((tty->count == 1) && (port->port.count != 1)) {
printk(KERN_ERR "sx%d: sx_close: bad port count;" printk(KERN_ERR "sx%d: sx_close: bad port count;"
" tty->count is 1, port count is %d\n", " tty->count is 1, port count is %d\n",
board_No(bp), port->count); board_No(bp), port->port.count);
port->count = 1; port->port.count = 1;
} }
if (port->count > 1) { if (port->port.count > 1) {
port->count--; port->port.count--;
bp->count--; bp->count--;
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
...@@ -1563,7 +1563,7 @@ static void sx_close(struct tty_struct * tty, struct file * filp) ...@@ -1563,7 +1563,7 @@ static void sx_close(struct tty_struct * tty, struct file * filp)
func_exit(); func_exit();
return; return;
} }
port->flags |= ASYNC_CLOSING; port->port.flags |= ASYNC_CLOSING;
/* /*
* Now we wait for the transmit buffer to clear; and we notify * Now we wait for the transmit buffer to clear; and we notify
* the line discipline to only process XON/XOFF characters. * the line discipline to only process XON/XOFF characters.
...@@ -1571,8 +1571,8 @@ static void sx_close(struct tty_struct * tty, struct file * filp) ...@@ -1571,8 +1571,8 @@ static void sx_close(struct tty_struct * tty, struct file * filp)
tty->closing = 1; tty->closing = 1;
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
dprintk (SX_DEBUG_OPEN, "Closing\n"); dprintk (SX_DEBUG_OPEN, "Closing\n");
if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE) { if (port->port.closing_wait != ASYNC_CLOSING_WAIT_NONE) {
tty_wait_until_sent(tty, port->closing_wait); tty_wait_until_sent(tty, port->port.closing_wait);
} }
/* /*
* At this point we stop accepting input. To do this, we * At this point we stop accepting input. To do this, we
...@@ -1582,7 +1582,7 @@ static void sx_close(struct tty_struct * tty, struct file * filp) ...@@ -1582,7 +1582,7 @@ static void sx_close(struct tty_struct * tty, struct file * filp)
*/ */
dprintk (SX_DEBUG_OPEN, "Closed\n"); dprintk (SX_DEBUG_OPEN, "Closed\n");
port->IER &= ~IER_RXD; port->IER &= ~IER_RXD;
if (port->flags & ASYNC_INITIALIZED) { if (port->port.flags & ASYNC_INITIALIZED) {
port->IER &= ~IER_TXRDY; port->IER &= ~IER_TXRDY;
port->IER |= IER_TXEMPTY; port->IER |= IER_TXEMPTY;
spin_lock_irqsave(&bp->lock, flags); spin_lock_irqsave(&bp->lock, flags);
...@@ -1611,10 +1611,10 @@ static void sx_close(struct tty_struct * tty, struct file * filp) ...@@ -1611,10 +1611,10 @@ static void sx_close(struct tty_struct * tty, struct file * filp)
board_No(bp), bp->count, tty->index); board_No(bp), bp->count, tty->index);
bp->count = 0; bp->count = 0;
} }
if (--port->count < 0) { if (--port->port.count < 0) {
printk(KERN_ERR "sx%d: sx_close: bad port count for tty%d: %d\n", printk(KERN_ERR "sx%d: sx_close: bad port count for tty%d: %d\n",
board_No(bp), port_No(port), port->count); board_No(bp), port_No(port), port->port.count);
port->count = 0; port->port.count = 0;
} }
sx_shutdown_port(bp, port); sx_shutdown_port(bp, port);
...@@ -1622,16 +1622,16 @@ static void sx_close(struct tty_struct * tty, struct file * filp) ...@@ -1622,16 +1622,16 @@ static void sx_close(struct tty_struct * tty, struct file * filp)
tty_ldisc_flush(tty); tty_ldisc_flush(tty);
spin_lock_irqsave(&port->lock, flags); spin_lock_irqsave(&port->lock, flags);
tty->closing = 0; tty->closing = 0;
port->tty = NULL; port->port.tty = NULL;
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
if (port->blocked_open) { if (port->port.blocked_open) {
if (port->close_delay) { if (port->port.close_delay) {
msleep_interruptible(jiffies_to_msecs(port->close_delay)); msleep_interruptible(jiffies_to_msecs(port->port.close_delay));
} }
wake_up_interruptible(&port->open_wait); wake_up_interruptible(&port->port.open_wait);
} }
port->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); port->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
wake_up_interruptible(&port->close_wait); wake_up_interruptible(&port->port.close_wait);
func_exit(); func_exit();
} }
...@@ -1815,7 +1815,7 @@ static int sx_tiocmget(struct tty_struct *tty, struct file *file) ...@@ -1815,7 +1815,7 @@ static int sx_tiocmget(struct tty_struct *tty, struct file *file)
dprintk (SX_DEBUG_INIT, "Got msvr[%d] = %02x, car = %d.\n", dprintk (SX_DEBUG_INIT, "Got msvr[%d] = %02x, car = %d.\n",
port_No(port), status, sx_in (bp, CD186x_CAR)); port_No(port), status, sx_in (bp, CD186x_CAR));
dprintk (SX_DEBUG_INIT, "sx_port = %p, port = %p\n", sx_port, port); dprintk (SX_DEBUG_INIT, "sx_port = %p, port = %p\n", sx_port, port);
if (SX_CRTSCTS(port->tty)) { if (SX_CRTSCTS(port->port.tty)) {
result = /* (status & MSVR_RTS) ? */ TIOCM_DTR /* : 0) */ result = /* (status & MSVR_RTS) ? */ TIOCM_DTR /* : 0) */
| ((status & MSVR_DTR) ? TIOCM_RTS : 0) | ((status & MSVR_DTR) ? TIOCM_RTS : 0)
| ((status & MSVR_CD) ? TIOCM_CAR : 0) | ((status & MSVR_CD) ? TIOCM_CAR : 0)
...@@ -1857,7 +1857,7 @@ static int sx_tiocmset(struct tty_struct *tty, struct file *file, ...@@ -1857,7 +1857,7 @@ static int sx_tiocmset(struct tty_struct *tty, struct file *file,
/* if (set & TIOCM_DTR) /* if (set & TIOCM_DTR)
port->MSVR |= MSVR_DTR; */ port->MSVR |= MSVR_DTR; */
if (SX_CRTSCTS(port->tty)) { if (SX_CRTSCTS(port->port.tty)) {
if (set & TIOCM_RTS) if (set & TIOCM_RTS)
port->MSVR |= MSVR_DTR; port->MSVR |= MSVR_DTR;
} else { } else {
...@@ -1869,7 +1869,7 @@ static int sx_tiocmset(struct tty_struct *tty, struct file *file, ...@@ -1869,7 +1869,7 @@ static int sx_tiocmset(struct tty_struct *tty, struct file *file,
port->MSVR &= ~MSVR_RTS; */ port->MSVR &= ~MSVR_RTS; */
/* if (clear & TIOCM_DTR) /* if (clear & TIOCM_DTR)
port->MSVR &= ~MSVR_DTR; */ port->MSVR &= ~MSVR_DTR; */
if (SX_CRTSCTS(port->tty)) { if (SX_CRTSCTS(port->port.tty)) {
if (clear & TIOCM_RTS) if (clear & TIOCM_RTS)
port->MSVR &= ~MSVR_DTR; port->MSVR &= ~MSVR_DTR;
} else { } else {
...@@ -1929,27 +1929,27 @@ static inline int sx_set_serial_info(struct specialix_port * port, ...@@ -1929,27 +1929,27 @@ static inline int sx_set_serial_info(struct specialix_port * port,
lock_kernel(); lock_kernel();
change_speed = ((port->flags & ASYNC_SPD_MASK) != change_speed = ((port->port.flags & ASYNC_SPD_MASK) !=
(tmp.flags & ASYNC_SPD_MASK)); (tmp.flags & ASYNC_SPD_MASK));
change_speed |= (tmp.custom_divisor != port->custom_divisor); change_speed |= (tmp.custom_divisor != port->custom_divisor);
if (!capable(CAP_SYS_ADMIN)) { if (!capable(CAP_SYS_ADMIN)) {
if ((tmp.close_delay != port->close_delay) || if ((tmp.close_delay != port->port.close_delay) ||
(tmp.closing_wait != port->closing_wait) || (tmp.closing_wait != port->port.closing_wait) ||
((tmp.flags & ~ASYNC_USR_MASK) != ((tmp.flags & ~ASYNC_USR_MASK) !=
(port->flags & ~ASYNC_USR_MASK))) { (port->port.flags & ~ASYNC_USR_MASK))) {
func_exit(); func_exit();
unlock_kernel(); unlock_kernel();
return -EPERM; return -EPERM;
} }
port->flags = ((port->flags & ~ASYNC_USR_MASK) | port->port.flags = ((port->port.flags & ~ASYNC_USR_MASK) |
(tmp.flags & ASYNC_USR_MASK)); (tmp.flags & ASYNC_USR_MASK));
port->custom_divisor = tmp.custom_divisor; port->custom_divisor = tmp.custom_divisor;
} else { } else {
port->flags = ((port->flags & ~ASYNC_FLAGS) | port->port.flags = ((port->port.flags & ~ASYNC_FLAGS) |
(tmp.flags & ASYNC_FLAGS)); (tmp.flags & ASYNC_FLAGS));
port->close_delay = tmp.close_delay; port->port.close_delay = tmp.close_delay;
port->closing_wait = tmp.closing_wait; port->port.closing_wait = tmp.closing_wait;
port->custom_divisor = tmp.custom_divisor; port->custom_divisor = tmp.custom_divisor;
} }
if (change_speed) { if (change_speed) {
...@@ -1975,10 +1975,10 @@ static inline int sx_get_serial_info(struct specialix_port * port, ...@@ -1975,10 +1975,10 @@ static inline int sx_get_serial_info(struct specialix_port * port,
tmp.line = port - sx_port; tmp.line = port - sx_port;
tmp.port = bp->base; tmp.port = bp->base;
tmp.irq = bp->irq; tmp.irq = bp->irq;
tmp.flags = port->flags; tmp.flags = port->port.flags;
tmp.baud_base = (SX_OSCFREQ + CD186x_TPC/2) / CD186x_TPC; tmp.baud_base = (SX_OSCFREQ + CD186x_TPC/2) / CD186x_TPC;
tmp.close_delay = port->close_delay * HZ/100; tmp.close_delay = port->port.close_delay * HZ/100;
tmp.closing_wait = port->closing_wait * HZ/100; tmp.closing_wait = port->port.closing_wait * HZ/100;
tmp.custom_divisor = port->custom_divisor; tmp.custom_divisor = port->custom_divisor;
tmp.xmit_fifo_size = CD186x_NFIFO; tmp.xmit_fifo_size = CD186x_NFIFO;
unlock_kernel(); unlock_kernel();
...@@ -2199,17 +2199,17 @@ static void sx_hangup(struct tty_struct * tty) ...@@ -2199,17 +2199,17 @@ static void sx_hangup(struct tty_struct * tty)
sx_shutdown_port(bp, port); sx_shutdown_port(bp, port);
spin_lock_irqsave(&port->lock, flags); spin_lock_irqsave(&port->lock, flags);
bp->count -= port->count; bp->count -= port->port.count;
if (bp->count < 0) { if (bp->count < 0) {
printk(KERN_ERR "sx%d: sx_hangup: bad board count: %d port: %d\n", printk(KERN_ERR "sx%d: sx_hangup: bad board count: %d port: %d\n",
board_No(bp), bp->count, tty->index); board_No(bp), bp->count, tty->index);
bp->count = 0; bp->count = 0;
} }
port->count = 0; port->port.count = 0;
port->flags &= ~ASYNC_NORMAL_ACTIVE; port->port.flags &= ~ASYNC_NORMAL_ACTIVE;
port->tty = NULL; port->port.tty = NULL;
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
wake_up_interruptible(&port->open_wait); wake_up_interruptible(&port->port.open_wait);
func_exit(); func_exit();
} }
...@@ -2224,10 +2224,6 @@ static void sx_set_termios(struct tty_struct * tty, struct ktermios * old_termio ...@@ -2224,10 +2224,6 @@ static void sx_set_termios(struct tty_struct * tty, struct ktermios * old_termio
if (sx_paranoia_check(port, tty->name, "sx_set_termios")) if (sx_paranoia_check(port, tty->name, "sx_set_termios"))
return; return;
if (tty->termios->c_cflag == old_termios->c_cflag &&
tty->termios->c_iflag == old_termios->c_iflag)
return;
bp = port_Board(port); bp = port_Board(port);
spin_lock_irqsave(&port->lock, flags); spin_lock_irqsave(&port->lock, flags);
sx_change_speed(port_Board(port), port); sx_change_speed(port_Board(port), port);
...@@ -2297,10 +2293,7 @@ static int sx_init_drivers(void) ...@@ -2297,10 +2293,7 @@ static int sx_init_drivers(void)
memset(sx_port, 0, sizeof(sx_port)); memset(sx_port, 0, sizeof(sx_port));
for (i = 0; i < SX_NPORT * SX_NBOARD; i++) { for (i = 0; i < SX_NPORT * SX_NBOARD; i++) {
sx_port[i].magic = SPECIALIX_MAGIC; sx_port[i].magic = SPECIALIX_MAGIC;
sx_port[i].close_delay = 50 * HZ/100; tty_port_init(&sx_port[i].port);
sx_port[i].closing_wait = 3000 * HZ/100;
init_waitqueue_head(&sx_port[i].open_wait);
init_waitqueue_head(&sx_port[i].close_wait);
spin_lock_init(&sx_port[i].lock); spin_lock_init(&sx_port[i].lock);
} }
......
...@@ -107,23 +107,17 @@ struct specialix_board { ...@@ -107,23 +107,17 @@ struct specialix_board {
struct specialix_port { struct specialix_port {
int magic; int magic;
struct tty_port port;
int baud_base; int baud_base;
int flags; int flags;
struct tty_struct * tty;
int count;
int blocked_open;
int timeout; int timeout;
int close_delay;
unsigned char * xmit_buf; unsigned char * xmit_buf;
int custom_divisor; int custom_divisor;
int xmit_head; int xmit_head;
int xmit_tail; int xmit_tail;
int xmit_cnt; int xmit_cnt;
wait_queue_head_t open_wait;
wait_queue_head_t close_wait;
short wakeup_chars; short wakeup_chars;
short break_length; short break_length;
unsigned short closing_wait;
unsigned char mark_mask; unsigned char mark_mask;
unsigned char IER; unsigned char IER;
unsigned char MSVR; unsigned char MSVR;
......
...@@ -2395,6 +2395,7 @@ static int sx_init_portstructs(int nboards, int nports) ...@@ -2395,6 +2395,7 @@ static int sx_init_portstructs(int nboards, int nports)
board->ports = port; board->ports = port;
for (j = 0; j < boards[i].nports; j++) { for (j = 0; j < boards[i].nports; j++) {
sx_dprintk(SX_DEBUG_INIT, "initing port %d\n", j); sx_dprintk(SX_DEBUG_INIT, "initing port %d\n", j);
tty_port_init(&port->gs.port);
port->gs.magic = SX_MAGIC; port->gs.magic = SX_MAGIC;
port->gs.close_delay = HZ / 2; port->gs.close_delay = HZ / 2;
port->gs.closing_wait = 30 * HZ; port->gs.closing_wait = 30 * HZ;
...@@ -2407,7 +2408,6 @@ static int sx_init_portstructs(int nboards, int nports) ...@@ -2407,7 +2408,6 @@ static int sx_init_portstructs(int nboards, int nports)
/* /*
* Initializing wait queue * Initializing wait queue
*/ */
tty_port_init(&port->gs.port);
port++; port++;
} }
} }
......
...@@ -183,8 +183,6 @@ struct mgsl_struct { ...@@ -183,8 +183,6 @@ struct mgsl_struct {
struct tty_port port; struct tty_port port;
int line; int line;
int hw_version; int hw_version;
unsigned short close_delay;
unsigned short closing_wait; /* time to wait before closing */
struct mgsl_icount icount; struct mgsl_icount icount;
...@@ -3142,11 +3140,11 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp) ...@@ -3142,11 +3140,11 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp)
/* wait for transmit data to clear all layers */ /* wait for transmit data to clear all layers */
if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE) { if (info->port.closing_wait != ASYNC_CLOSING_WAIT_NONE) {
if (debug_level >= DEBUG_LEVEL_INFO) if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):mgsl_close(%s) calling tty_wait_until_sent\n", printk("%s(%d):mgsl_close(%s) calling tty_wait_until_sent\n",
__FILE__,__LINE__, info->device_name ); __FILE__,__LINE__, info->device_name );
tty_wait_until_sent(tty, info->closing_wait); tty_wait_until_sent(tty, info->port.closing_wait);
} }
if (info->port.flags & ASYNC_INITIALIZED) if (info->port.flags & ASYNC_INITIALIZED)
...@@ -3162,8 +3160,8 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp) ...@@ -3162,8 +3160,8 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp)
info->port.tty = NULL; info->port.tty = NULL;
if (info->port.blocked_open) { if (info->port.blocked_open) {
if (info->close_delay) { if (info->port.close_delay) {
msleep_interruptible(jiffies_to_msecs(info->close_delay)); msleep_interruptible(jiffies_to_msecs(info->port.close_delay));
} }
wake_up_interruptible(&info->port.open_wait); wake_up_interruptible(&info->port.open_wait);
} }
...@@ -4326,12 +4324,12 @@ static struct mgsl_struct* mgsl_allocate_device(void) ...@@ -4326,12 +4324,12 @@ static struct mgsl_struct* mgsl_allocate_device(void)
if (!info) { if (!info) {
printk("Error can't allocate device instance data\n"); printk("Error can't allocate device instance data\n");
} else { } else {
tty_port_init(&info->port);
info->magic = MGSL_MAGIC; info->magic = MGSL_MAGIC;
INIT_WORK(&info->task, mgsl_bh_handler); INIT_WORK(&info->task, mgsl_bh_handler);
info->max_frame_size = 4096; info->max_frame_size = 4096;
info->close_delay = 5*HZ/10; info->port.close_delay = 5*HZ/10;
info->closing_wait = 30*HZ; info->port.closing_wait = 30*HZ;
tty_port_init(&info->port);
init_waitqueue_head(&info->status_event_wait_q); init_waitqueue_head(&info->status_event_wait_q);
init_waitqueue_head(&info->event_wait_q); init_waitqueue_head(&info->event_wait_q);
spin_lock_init(&info->irq_spinlock); spin_lock_init(&info->irq_spinlock);
......
...@@ -261,8 +261,6 @@ struct slgt_info { ...@@ -261,8 +261,6 @@ struct slgt_info {
struct slgt_info *port_array[SLGT_MAX_PORTS]; struct slgt_info *port_array[SLGT_MAX_PORTS];
int line; /* tty line instance number */ int line; /* tty line instance number */
unsigned short close_delay;
unsigned short closing_wait; /* time to wait before closing */
struct mgsl_icount icount; struct mgsl_icount icount;
...@@ -758,9 +756,9 @@ static void close(struct tty_struct *tty, struct file *filp) ...@@ -758,9 +756,9 @@ static void close(struct tty_struct *tty, struct file *filp)
/* wait for transmit data to clear all layers */ /* wait for transmit data to clear all layers */
if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE) { if (info->port.closing_wait != ASYNC_CLOSING_WAIT_NONE) {
DBGINFO(("%s call tty_wait_until_sent\n", info->device_name)); DBGINFO(("%s call tty_wait_until_sent\n", info->device_name));
tty_wait_until_sent(tty, info->closing_wait); tty_wait_until_sent(tty, info->port.closing_wait);
} }
if (info->port.flags & ASYNC_INITIALIZED) if (info->port.flags & ASYNC_INITIALIZED)
...@@ -774,8 +772,8 @@ static void close(struct tty_struct *tty, struct file *filp) ...@@ -774,8 +772,8 @@ static void close(struct tty_struct *tty, struct file *filp)
info->port.tty = NULL; info->port.tty = NULL;
if (info->port.blocked_open) { if (info->port.blocked_open) {
if (info->close_delay) { if (info->port.close_delay) {
msleep_interruptible(jiffies_to_msecs(info->close_delay)); msleep_interruptible(jiffies_to_msecs(info->port.close_delay));
} }
wake_up_interruptible(&info->port.open_wait); wake_up_interruptible(&info->port.open_wait);
} }
...@@ -3448,13 +3446,13 @@ static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev ...@@ -3448,13 +3446,13 @@ static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev
DBGERR(("%s device alloc failed adapter=%d port=%d\n", DBGERR(("%s device alloc failed adapter=%d port=%d\n",
driver_name, adapter_num, port_num)); driver_name, adapter_num, port_num));
} else { } else {
tty_port_init(&info->port);
info->magic = MGSL_MAGIC; info->magic = MGSL_MAGIC;
INIT_WORK(&info->task, bh_handler); INIT_WORK(&info->task, bh_handler);
info->max_frame_size = 4096; info->max_frame_size = 4096;
info->raw_rx_size = DMABUFSIZE; info->raw_rx_size = DMABUFSIZE;
info->close_delay = 5*HZ/10; info->port.close_delay = 5*HZ/10;
info->closing_wait = 30*HZ; info->port.closing_wait = 30*HZ;
tty_port_init(&info->port);
init_waitqueue_head(&info->status_event_wait_q); init_waitqueue_head(&info->status_event_wait_q);
init_waitqueue_head(&info->event_wait_q); init_waitqueue_head(&info->event_wait_q);
spin_lock_init(&info->netlock); spin_lock_init(&info->netlock);
......
...@@ -846,11 +846,11 @@ static void close(struct tty_struct *tty, struct file *filp) ...@@ -846,11 +846,11 @@ static void close(struct tty_struct *tty, struct file *filp)
/* wait for transmit data to clear all layers */ /* wait for transmit data to clear all layers */
if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE) { if (info->port.closing_wait != ASYNC_CLOSING_WAIT_NONE) {
if (debug_level >= DEBUG_LEVEL_INFO) if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):%s close() calling tty_wait_until_sent\n", printk("%s(%d):%s close() calling tty_wait_until_sent\n",
__FILE__,__LINE__, info->device_name ); __FILE__,__LINE__, info->device_name );
tty_wait_until_sent(tty, info->closing_wait); tty_wait_until_sent(tty, info->port.closing_wait);
} }
if (info->port.flags & ASYNC_INITIALIZED) if (info->port.flags & ASYNC_INITIALIZED)
...@@ -866,8 +866,8 @@ static void close(struct tty_struct *tty, struct file *filp) ...@@ -866,8 +866,8 @@ static void close(struct tty_struct *tty, struct file *filp)
info->port.tty = NULL; info->port.tty = NULL;
if (info->port.blocked_open) { if (info->port.blocked_open) {
if (info->close_delay) { if (info->port.close_delay) {
msleep_interruptible(jiffies_to_msecs(info->close_delay)); msleep_interruptible(jiffies_to_msecs(info->port.close_delay));
} }
wake_up_interruptible(&info->port.open_wait); wake_up_interruptible(&info->port.open_wait);
} }
...@@ -3802,12 +3802,12 @@ static SLMP_INFO *alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev) ...@@ -3802,12 +3802,12 @@ static SLMP_INFO *alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev)
printk("%s(%d) Error can't allocate device instance data for adapter %d, port %d\n", printk("%s(%d) Error can't allocate device instance data for adapter %d, port %d\n",
__FILE__,__LINE__, adapter_num, port_num); __FILE__,__LINE__, adapter_num, port_num);
} else { } else {
tty_port_init(&info->port);
info->magic = MGSL_MAGIC; info->magic = MGSL_MAGIC;
INIT_WORK(&info->task, bh_handler); INIT_WORK(&info->task, bh_handler);
info->max_frame_size = 4096; info->max_frame_size = 4096;
info->close_delay = 5*HZ/10; info->port.close_delay = 5*HZ/10;
info->closing_wait = 30*HZ; info->port.closing_wait = 30*HZ;
tty_port_init(&info->port);
init_waitqueue_head(&info->status_event_wait_q); init_waitqueue_head(&info->status_event_wait_q);
init_waitqueue_head(&info->event_wait_q); init_waitqueue_head(&info->event_wait_q);
spin_lock_init(&info->netlock); spin_lock_init(&info->netlock);
......
...@@ -2094,6 +2094,8 @@ void tty_port_init(struct tty_port *port) ...@@ -2094,6 +2094,8 @@ void tty_port_init(struct tty_port *port)
init_waitqueue_head(&port->open_wait); init_waitqueue_head(&port->open_wait);
init_waitqueue_head(&port->close_wait); init_waitqueue_head(&port->close_wait);
mutex_init(&port->mutex); mutex_init(&port->mutex);
port->close_delay = (50 * HZ) / 100;
port->closing_wait = (3000 * HZ) / 100;
} }
EXPORT_SYMBOL(tty_port_init); EXPORT_SYMBOL(tty_port_init);
......
...@@ -567,8 +567,6 @@ struct cyclades_port { ...@@ -567,8 +567,6 @@ struct cyclades_port {
int chip_rev; int chip_rev;
int custom_divisor; int custom_divisor;
u8 x_char; /* to be pushed out ASAP */ u8 x_char; /* to be pushed out ASAP */
int close_delay;
unsigned short closing_wait;
int breakon; int breakon;
int breakoff; int breakoff;
int xmit_head; int xmit_head;
...@@ -586,8 +584,8 @@ struct cyclades_port { ...@@ -586,8 +584,8 @@ struct cyclades_port {
}; };
#define CLOSING_WAIT_DELAY 30*HZ #define CLOSING_WAIT_DELAY 30*HZ
#define CY_CLOSING_WAIT_NONE 65535 #define CY_CLOSING_WAIT_NONE ASYNC_CLOSING_WAIT_NONE
#define CY_CLOSING_WAIT_INF 0 #define CY_CLOSING_WAIT_INF ASYNC_CLOSING_WAIT_INF
#define CyMAX_CHIPS_PER_CARD 8 #define CyMAX_CHIPS_PER_CARD 8
......
...@@ -188,6 +188,8 @@ struct tty_port { ...@@ -188,6 +188,8 @@ struct tty_port {
unsigned long flags; /* TTY flags ASY_*/ unsigned long flags; /* TTY flags ASY_*/
struct mutex mutex; /* Locking */ struct mutex mutex; /* Locking */
unsigned char *xmit_buf; /* Optional buffer */ unsigned char *xmit_buf; /* Optional buffer */
int close_delay; /* Close port delay */
int closing_wait; /* Delay for output */
}; };
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册