aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/capi/capi.c3
-rw-r--r--drivers/isdn/gigaset/interface.c7
-rw-r--r--drivers/isdn/i4l/isdn_tty.c41
3 files changed, 30 insertions, 21 deletions
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 38c4bd87b2c9..c679867c2ccd 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -234,7 +234,8 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci)
234 234
235 mp->minor = minor; 235 mp->minor = minor;
236 236
237 dev = tty_register_device(capinc_tty_driver, minor, NULL); 237 dev = tty_port_register_device(&mp->port, capinc_tty_driver, minor,
238 NULL);
238 if (IS_ERR(dev)) 239 if (IS_ERR(dev))
239 goto err_out2; 240 goto err_out2;
240 241
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
index a6d9fd2858f7..67abf3ff45e8 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -446,8 +446,8 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old)
446 goto out; 446 goto out;
447 } 447 }
448 448
449 iflag = tty->termios->c_iflag; 449 iflag = tty->termios.c_iflag;
450 cflag = tty->termios->c_cflag; 450 cflag = tty->termios.c_cflag;
451 old_cflag = old ? old->c_cflag : cflag; 451 old_cflag = old ? old->c_cflag : cflag;
452 gig_dbg(DEBUG_IF, "%u: iflag %x cflag %x old %x", 452 gig_dbg(DEBUG_IF, "%u: iflag %x cflag %x old %x",
453 cs->minor_index, iflag, cflag, old_cflag); 453 cs->minor_index, iflag, cflag, old_cflag);
@@ -524,7 +524,8 @@ void gigaset_if_init(struct cardstate *cs)
524 tasklet_init(&cs->if_wake_tasklet, if_wake, (unsigned long) cs); 524 tasklet_init(&cs->if_wake_tasklet, if_wake, (unsigned long) cs);
525 525
526 mutex_lock(&cs->mutex); 526 mutex_lock(&cs->mutex);
527 cs->tty_dev = tty_register_device(drv->tty, cs->minor_index, NULL); 527 cs->tty_dev = tty_port_register_device(&cs->port, drv->tty,
528 cs->minor_index, NULL);
528 529
529 if (!IS_ERR(cs->tty_dev)) 530 if (!IS_ERR(cs->tty_dev))
530 dev_set_drvdata(cs->tty_dev, cs); 531 dev_set_drvdata(cs->tty_dev, cs);
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 7bc50670d7d9..b817809f763c 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -1009,15 +1009,15 @@ isdn_tty_change_speed(modem_info *info)
1009 quot; 1009 quot;
1010 int i; 1010 int i;
1011 1011
1012 if (!port->tty || !port->tty->termios) 1012 if (!port->tty)
1013 return; 1013 return;
1014 cflag = port->tty->termios->c_cflag; 1014 cflag = port->tty->termios.c_cflag;
1015 1015
1016 quot = i = cflag & CBAUD; 1016 quot = i = cflag & CBAUD;
1017 if (i & CBAUDEX) { 1017 if (i & CBAUDEX) {
1018 i &= ~CBAUDEX; 1018 i &= ~CBAUDEX;
1019 if (i < 1 || i > 2) 1019 if (i < 1 || i > 2)
1020 port->tty->termios->c_cflag &= ~CBAUDEX; 1020 port->tty->termios.c_cflag &= ~CBAUDEX;
1021 else 1021 else
1022 i += 15; 1022 i += 15;
1023 } 1023 }
@@ -1097,7 +1097,7 @@ isdn_tty_shutdown(modem_info *info)
1097#endif 1097#endif
1098 isdn_unlock_drivers(); 1098 isdn_unlock_drivers();
1099 info->msr &= ~UART_MSR_RI; 1099 info->msr &= ~UART_MSR_RI;
1100 if (!info->port.tty || (info->port.tty->termios->c_cflag & HUPCL)) { 1100 if (!info->port.tty || (info->port.tty->termios.c_cflag & HUPCL)) {
1101 info->mcr &= ~(UART_MCR_DTR | UART_MCR_RTS); 1101 info->mcr &= ~(UART_MCR_DTR | UART_MCR_RTS);
1102 if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) { 1102 if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) {
1103 isdn_tty_modem_reset_regs(info, 0); 1103 isdn_tty_modem_reset_regs(info, 0);
@@ -1469,13 +1469,13 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1469 if (!old_termios) 1469 if (!old_termios)
1470 isdn_tty_change_speed(info); 1470 isdn_tty_change_speed(info);
1471 else { 1471 else {
1472 if (tty->termios->c_cflag == old_termios->c_cflag && 1472 if (tty->termios.c_cflag == old_termios->c_cflag &&
1473 tty->termios->c_ispeed == old_termios->c_ispeed && 1473 tty->termios.c_ispeed == old_termios->c_ispeed &&
1474 tty->termios->c_ospeed == old_termios->c_ospeed) 1474 tty->termios.c_ospeed == old_termios->c_ospeed)
1475 return; 1475 return;
1476 isdn_tty_change_speed(info); 1476 isdn_tty_change_speed(info);
1477 if ((old_termios->c_cflag & CRTSCTS) && 1477 if ((old_termios->c_cflag & CRTSCTS) &&
1478 !(tty->termios->c_cflag & CRTSCTS)) 1478 !(tty->termios.c_cflag & CRTSCTS))
1479 tty->hw_stopped = 0; 1479 tty->hw_stopped = 0;
1480 } 1480 }
1481} 1481}
@@ -1486,6 +1486,18 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1486 * ------------------------------------------------------------ 1486 * ------------------------------------------------------------
1487 */ 1487 */
1488 1488
1489static int isdn_tty_install(struct tty_driver *driver, struct tty_struct *tty)
1490{
1491 modem_info *info = &dev->mdm.info[tty->index];
1492
1493 if (isdn_tty_paranoia_check(info, tty->name, __func__))
1494 return -ENODEV;
1495
1496 tty->driver_data = info;
1497
1498 return tty_port_install(&info->port, driver, tty);
1499}
1500
1489/* 1501/*
1490 * This routine is called whenever a serial port is opened. It 1502 * This routine is called whenever a serial port is opened. It
1491 * enables interrupts for a serial port, linking in its async structure into 1503 * enables interrupts for a serial port, linking in its async structure into
@@ -1495,22 +1507,16 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1495static int 1507static int
1496isdn_tty_open(struct tty_struct *tty, struct file *filp) 1508isdn_tty_open(struct tty_struct *tty, struct file *filp)
1497{ 1509{
1498 struct tty_port *port; 1510 modem_info *info = tty->driver_data;
1499 modem_info *info; 1511 struct tty_port *port = &info->port;
1500 int retval; 1512 int retval;
1501 1513
1502 info = &dev->mdm.info[tty->index];
1503 if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_open"))
1504 return -ENODEV;
1505 port = &info->port;
1506#ifdef ISDN_DEBUG_MODEM_OPEN 1514#ifdef ISDN_DEBUG_MODEM_OPEN
1507 printk(KERN_DEBUG "isdn_tty_open %s, count = %d\n", tty->name, 1515 printk(KERN_DEBUG "isdn_tty_open %s, count = %d\n", tty->name,
1508 port->count); 1516 port->count);
1509#endif 1517#endif
1510 port->count++; 1518 port->count++;
1511 tty->driver_data = info;
1512 port->tty = tty; 1519 port->tty = tty;
1513 tty->port = port;
1514 /* 1520 /*
1515 * Start up serial port 1521 * Start up serial port
1516 */ 1522 */
@@ -1738,6 +1744,7 @@ modem_write_profile(atemu *m)
1738} 1744}
1739 1745
1740static const struct tty_operations modem_ops = { 1746static const struct tty_operations modem_ops = {
1747 .install = isdn_tty_install,
1741 .open = isdn_tty_open, 1748 .open = isdn_tty_open,
1742 .close = isdn_tty_close, 1749 .close = isdn_tty_close,
1743 .write = isdn_tty_write, 1750 .write = isdn_tty_write,
@@ -1782,7 +1789,7 @@ isdn_tty_modem_init(void)
1782 m->tty_modem->subtype = SERIAL_TYPE_NORMAL; 1789 m->tty_modem->subtype = SERIAL_TYPE_NORMAL;
1783 m->tty_modem->init_termios = tty_std_termios; 1790 m->tty_modem->init_termios = tty_std_termios;
1784 m->tty_modem->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; 1791 m->tty_modem->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
1785 m->tty_modem->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; 1792 m->tty_modem->flags = TTY_DRIVER_REAL_RAW;
1786 m->tty_modem->driver_name = "isdn_tty"; 1793 m->tty_modem->driver_name = "isdn_tty";
1787 tty_set_operations(m->tty_modem, &modem_ops); 1794 tty_set_operations(m->tty_modem, &modem_ops);
1788 retval = tty_register_driver(m->tty_modem); 1795 retval = tty_register_driver(m->tty_modem);