Loading drivers/char/cyclades.c +14 −14 Original line number Original line Diff line number Diff line Loading @@ -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); Loading Loading @@ -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); Loading Loading @@ -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; /*!!! */ Loading @@ -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) != Loading @@ -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) { Loading Loading @@ -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); Loading Loading @@ -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); Loading drivers/char/isicom.c +13 −15 Original line number Original line Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading @@ -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); Loading Loading @@ -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(); Loading @@ -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)); } } Loading @@ -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; Loading Loading @@ -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; Loading drivers/char/moxa.c +3 −5 Original line number Original line Diff line number Diff line Loading @@ -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; Loading Loading @@ -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) { Loading Loading @@ -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; } } Loading @@ -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); Loading drivers/char/mxser.c +12 −17 Original line number Original line Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading Loading @@ -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); } } Loading Loading @@ -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 }; }; Loading Loading @@ -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) | Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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; Loading @@ -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; Loading drivers/char/riscom8.c +11 −13 Original line number Original line Diff line number Diff line Loading @@ -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 Loading Loading @@ -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); Loading Loading @@ -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; Loading @@ -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; Loading @@ -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; } } Loading Loading @@ -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; } } Loading Loading
drivers/char/cyclades.c +14 −14 Original line number Original line Diff line number Diff line Loading @@ -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); Loading Loading @@ -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); Loading Loading @@ -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; /*!!! */ Loading @@ -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) != Loading @@ -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) { Loading Loading @@ -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); Loading Loading @@ -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); Loading
drivers/char/isicom.c +13 −15 Original line number Original line Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading @@ -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); Loading Loading @@ -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(); Loading @@ -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)); } } Loading @@ -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; Loading Loading @@ -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; Loading
drivers/char/moxa.c +3 −5 Original line number Original line Diff line number Diff line Loading @@ -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; Loading Loading @@ -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) { Loading Loading @@ -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; } } Loading @@ -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); Loading
drivers/char/mxser.c +12 −17 Original line number Original line Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading Loading @@ -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); } } Loading Loading @@ -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 }; }; Loading Loading @@ -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) | Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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; Loading @@ -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; Loading
drivers/char/riscom8.c +11 −13 Original line number Original line Diff line number Diff line Loading @@ -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 Loading Loading @@ -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); Loading Loading @@ -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; Loading @@ -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; Loading @@ -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; } } Loading Loading @@ -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; } } Loading