Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: move the termios object into the tty

This will let us sort out a whole pile of tty related races. The
alternative would be to keep points and refcount the termios objects.
However
1. They are tiny anyway
2. Many devices don't use the stored copies
3. We can remove a pty special case

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alan Cox and committed by
Greg Kroah-Hartman
adc8d746 6d31a88c

+408 -434
+1 -1
arch/ia64/hp/sim/simserial.c
··· 338 338 { 339 339 /* Handle turning off CRTSCTS */ 340 340 if ((old_termios->c_cflag & CRTSCTS) && 341 - !(tty->termios->c_cflag & CRTSCTS)) { 341 + !(tty->termios.c_cflag & CRTSCTS)) { 342 342 tty->hw_stopped = 0; 343 343 } 344 344 }
+1 -1
drivers/bluetooth/hci_ath.c
··· 58 58 return status; 59 59 60 60 /* Disable Automatic RTSCTS */ 61 - memcpy(&ktermios, tty->termios, sizeof(ktermios)); 61 + ktermios = tty->termios; 62 62 ktermios.c_cflag &= ~CRTSCTS; 63 63 tty_set_termios(tty, &ktermios); 64 64
+2 -2
drivers/isdn/gigaset/interface.c
··· 446 446 goto out; 447 447 } 448 448 449 - iflag = tty->termios->c_iflag; 450 - cflag = tty->termios->c_cflag; 449 + iflag = tty->termios.c_iflag; 450 + cflag = tty->termios.c_cflag; 451 451 old_cflag = old ? old->c_cflag : cflag; 452 452 gig_dbg(DEBUG_IF, "%u: iflag %x cflag %x old %x", 453 453 cs->minor_index, iflag, cflag, old_cflag);
+8 -8
drivers/isdn/i4l/isdn_tty.c
··· 1009 1009 quot; 1010 1010 int i; 1011 1011 1012 - if (!port->tty || !port->tty->termios) 1012 + if (!port->tty) 1013 1013 return; 1014 - cflag = port->tty->termios->c_cflag; 1014 + cflag = port->tty->termios.c_cflag; 1015 1015 1016 1016 quot = i = cflag & CBAUD; 1017 1017 if (i & CBAUDEX) { 1018 1018 i &= ~CBAUDEX; 1019 1019 if (i < 1 || i > 2) 1020 - port->tty->termios->c_cflag &= ~CBAUDEX; 1020 + port->tty->termios.c_cflag &= ~CBAUDEX; 1021 1021 else 1022 1022 i += 15; 1023 1023 } ··· 1097 1097 #endif 1098 1098 isdn_unlock_drivers(); 1099 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 1101 info->mcr &= ~(UART_MCR_DTR | UART_MCR_RTS); 1102 1102 if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) { 1103 1103 isdn_tty_modem_reset_regs(info, 0); ··· 1469 1469 if (!old_termios) 1470 1470 isdn_tty_change_speed(info); 1471 1471 else { 1472 - if (tty->termios->c_cflag == old_termios->c_cflag && 1473 - tty->termios->c_ispeed == old_termios->c_ispeed && 1474 - tty->termios->c_ospeed == old_termios->c_ospeed) 1472 + if (tty->termios.c_cflag == old_termios->c_cflag && 1473 + tty->termios.c_ispeed == old_termios->c_ispeed && 1474 + tty->termios.c_ospeed == old_termios->c_ospeed) 1475 1475 return; 1476 1476 isdn_tty_change_speed(info); 1477 1477 if ((old_termios->c_cflag & CRTSCTS) && 1478 - !(tty->termios->c_cflag & CRTSCTS)) 1478 + !(tty->termios.c_cflag & CRTSCTS)) 1479 1479 tty->hw_stopped = 0; 1480 1480 } 1481 1481 }
+10 -10
drivers/mmc/card/sdio_uart.c
··· 518 518 if (status & UART_MSR_DCTS) { 519 519 port->icount.cts++; 520 520 tty = tty_port_tty_get(&port->port); 521 - if (tty && (tty->termios->c_cflag & CRTSCTS)) { 521 + if (tty && (tty->termios.c_cflag & CRTSCTS)) { 522 522 int cts = (status & UART_MSR_CTS); 523 523 if (tty->hw_stopped) { 524 524 if (cts) { ··· 671 671 port->ier = UART_IER_RLSI|UART_IER_RDI|UART_IER_RTOIE|UART_IER_UUE; 672 672 port->mctrl = TIOCM_OUT2; 673 673 674 - sdio_uart_change_speed(port, tty->termios, NULL); 674 + sdio_uart_change_speed(port, &tty->termios, NULL); 675 675 676 - if (tty->termios->c_cflag & CBAUD) 676 + if (tty->termios.c_cflag & CBAUD) 677 677 sdio_uart_set_mctrl(port, TIOCM_RTS | TIOCM_DTR); 678 678 679 - if (tty->termios->c_cflag & CRTSCTS) 679 + if (tty->termios.c_cflag & CRTSCTS) 680 680 if (!(sdio_uart_get_mctrl(port) & TIOCM_CTS)) 681 681 tty->hw_stopped = 1; 682 682 ··· 850 850 { 851 851 struct sdio_uart_port *port = tty->driver_data; 852 852 853 - if (!I_IXOFF(tty) && !(tty->termios->c_cflag & CRTSCTS)) 853 + if (!I_IXOFF(tty) && !(tty->termios.c_cflag & CRTSCTS)) 854 854 return; 855 855 856 856 if (sdio_uart_claim_func(port) != 0) ··· 861 861 sdio_uart_start_tx(port); 862 862 } 863 863 864 - if (tty->termios->c_cflag & CRTSCTS) 864 + if (tty->termios.c_cflag & CRTSCTS) 865 865 sdio_uart_clear_mctrl(port, TIOCM_RTS); 866 866 867 867 sdio_uart_irq(port->func); ··· 872 872 { 873 873 struct sdio_uart_port *port = tty->driver_data; 874 874 875 - if (!I_IXOFF(tty) && !(tty->termios->c_cflag & CRTSCTS)) 875 + if (!I_IXOFF(tty) && !(tty->termios.c_cflag & CRTSCTS)) 876 876 return; 877 877 878 878 if (sdio_uart_claim_func(port) != 0) ··· 887 887 } 888 888 } 889 889 890 - if (tty->termios->c_cflag & CRTSCTS) 890 + if (tty->termios.c_cflag & CRTSCTS) 891 891 sdio_uart_set_mctrl(port, TIOCM_RTS); 892 892 893 893 sdio_uart_irq(port->func); ··· 898 898 struct ktermios *old_termios) 899 899 { 900 900 struct sdio_uart_port *port = tty->driver_data; 901 - unsigned int cflag = tty->termios->c_cflag; 901 + unsigned int cflag = tty->termios.c_cflag; 902 902 903 903 if (sdio_uart_claim_func(port) != 0) 904 904 return; 905 905 906 - sdio_uart_change_speed(port, tty->termios, old_termios); 906 + sdio_uart_change_speed(port, &tty->termios, old_termios); 907 907 908 908 /* Handle transition to B0 status */ 909 909 if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD))
+5 -5
drivers/net/irda/irtty-sir.c
··· 124 124 tty = priv->tty; 125 125 126 126 mutex_lock(&tty->termios_mutex); 127 - old_termios = *(tty->termios); 128 - cflag = tty->termios->c_cflag; 127 + old_termios = tty->termios; 128 + cflag = tty->termios.c_cflag; 129 129 tty_encode_baud_rate(tty, speed, speed); 130 130 if (tty->ops->set_termios) 131 131 tty->ops->set_termios(tty, &old_termios); ··· 281 281 int cflag; 282 282 283 283 mutex_lock(&tty->termios_mutex); 284 - old_termios = *(tty->termios); 285 - cflag = tty->termios->c_cflag; 284 + old_termios = tty->termios; 285 + cflag = tty->termios.c_cflag; 286 286 287 287 if (stop) 288 288 cflag &= ~CREAD; 289 289 else 290 290 cflag |= CREAD; 291 291 292 - tty->termios->c_cflag = cflag; 292 + tty->termios.c_cflag = cflag; 293 293 if (tty->ops->set_termios) 294 294 tty->ops->set_termios(tty, &old_termios); 295 295 mutex_unlock(&tty->termios_mutex);
+5 -7
drivers/net/usb/hso.c
··· 1107 1107 struct ktermios *old) 1108 1108 { 1109 1109 struct hso_serial *serial = tty->driver_data; 1110 - struct ktermios *termios; 1111 1110 1112 1111 if (!serial) { 1113 1112 printk(KERN_ERR "%s: no tty structures", __func__); ··· 1118 1119 /* 1119 1120 * Fix up unsupported bits 1120 1121 */ 1121 - termios = tty->termios; 1122 - termios->c_iflag &= ~IXON; /* disable enable XON/XOFF flow control */ 1122 + tty->termios.c_iflag &= ~IXON; /* disable enable XON/XOFF flow control */ 1123 1123 1124 - termios->c_cflag &= 1124 + tty->termios.c_cflag &= 1125 1125 ~(CSIZE /* no size */ 1126 1126 | PARENB /* disable parity bit */ 1127 1127 | CBAUD /* clear current baud rate */ 1128 1128 | CBAUDEX); /* clear current buad rate */ 1129 1129 1130 - termios->c_cflag |= CS8; /* character size 8 bits */ 1130 + tty->termios.c_cflag |= CS8; /* character size 8 bits */ 1131 1131 1132 1132 /* baud rate 115200 */ 1133 1133 tty_encode_baud_rate(tty, 115200, 115200); ··· 1423 1425 1424 1426 if (old) 1425 1427 D5("Termios called with: cflags new[%d] - old[%d]", 1426 - tty->termios->c_cflag, old->c_cflag); 1428 + tty->termios.c_cflag, old->c_cflag); 1427 1429 1428 1430 /* the actual setup */ 1429 1431 spin_lock_irqsave(&serial->serial_lock, flags); 1430 1432 if (serial->port.count) 1431 1433 _hso_serial_set_termios(tty, old); 1432 1434 else 1433 - tty->termios = old; 1435 + tty->termios = *old; 1434 1436 spin_unlock_irqrestore(&serial->serial_lock, flags); 1435 1437 1436 1438 /* done */
+10 -10
drivers/tty/amiserial.c
··· 646 646 custom.adkcon = AC_UARTBRK; 647 647 mb(); 648 648 649 - if (tty->termios->c_cflag & HUPCL) 649 + if (tty->termios.c_cflag & HUPCL) 650 650 info->MCR &= ~(SER_DTR|SER_RTS); 651 651 rtsdtr_ctrl(info->MCR); 652 652 ··· 670 670 int bits; 671 671 unsigned long flags; 672 672 673 - cflag = tty->termios->c_cflag; 673 + cflag = tty->termios.c_cflag; 674 674 675 675 /* Byte size is always 8 bits plus parity bit if requested */ 676 676 ··· 707 707 /* If the quotient is zero refuse the change */ 708 708 if (!quot && old_termios) { 709 709 /* FIXME: Will need updating for new tty in the end */ 710 - tty->termios->c_cflag &= ~CBAUD; 711 - tty->termios->c_cflag |= (old_termios->c_cflag & CBAUD); 710 + tty->termios.c_cflag &= ~CBAUD; 711 + tty->termios.c_cflag |= (old_termios->c_cflag & CBAUD); 712 712 baud = tty_get_baud_rate(tty); 713 713 if (!baud) 714 714 baud = 9600; ··· 984 984 if (I_IXOFF(tty)) 985 985 rs_send_xchar(tty, STOP_CHAR(tty)); 986 986 987 - if (tty->termios->c_cflag & CRTSCTS) 987 + if (tty->termios.c_cflag & CRTSCTS) 988 988 info->MCR &= ~SER_RTS; 989 989 990 990 local_irq_save(flags); ··· 1012 1012 else 1013 1013 rs_send_xchar(tty, START_CHAR(tty)); 1014 1014 } 1015 - if (tty->termios->c_cflag & CRTSCTS) 1015 + if (tty->termios.c_cflag & CRTSCTS) 1016 1016 info->MCR |= SER_RTS; 1017 1017 local_irq_save(flags); 1018 1018 rtsdtr_ctrl(info->MCR); ··· 1330 1330 { 1331 1331 struct serial_state *info = tty->driver_data; 1332 1332 unsigned long flags; 1333 - unsigned int cflag = tty->termios->c_cflag; 1333 + unsigned int cflag = tty->termios.c_cflag; 1334 1334 1335 1335 change_speed(tty, info, old_termios); 1336 1336 ··· 1347 1347 if (!(old_termios->c_cflag & CBAUD) && 1348 1348 (cflag & CBAUD)) { 1349 1349 info->MCR |= SER_DTR; 1350 - if (!(tty->termios->c_cflag & CRTSCTS) || 1350 + if (!(tty->termios.c_cflag & CRTSCTS) || 1351 1351 !test_bit(TTY_THROTTLED, &tty->flags)) { 1352 1352 info->MCR |= SER_RTS; 1353 1353 } ··· 1358 1358 1359 1359 /* Handle turning off CRTSCTS */ 1360 1360 if ((old_termios->c_cflag & CRTSCTS) && 1361 - !(tty->termios->c_cflag & CRTSCTS)) { 1361 + !(tty->termios.c_cflag & CRTSCTS)) { 1362 1362 tty->hw_stopped = 0; 1363 1363 rs_start(tty); 1364 1364 } ··· 1371 1371 * or not. Hence, this may change..... 1372 1372 */ 1373 1373 if (!(old_termios->c_cflag & CLOCAL) && 1374 - (tty->termios->c_cflag & CLOCAL)) 1374 + (tty->termios.c_cflag & CLOCAL)) 1375 1375 wake_up_interruptible(&info->open_wait); 1376 1376 #endif 1377 1377 }
+8 -11
drivers/tty/cyclades.c
··· 1459 1459 info->port.xmit_buf = NULL; 1460 1460 free_page((unsigned long)temp); 1461 1461 } 1462 - if (tty->termios->c_cflag & HUPCL) 1462 + if (tty->termios.c_cflag & HUPCL) 1463 1463 cyy_change_rts_dtr(info, 0, TIOCM_RTS | TIOCM_DTR); 1464 1464 1465 1465 cyy_issue_cmd(info, CyCHAN_CTL | CyDIS_RCVR); ··· 1488 1488 free_page((unsigned long)temp); 1489 1489 } 1490 1490 1491 - if (tty->termios->c_cflag & HUPCL) 1491 + if (tty->termios.c_cflag & HUPCL) 1492 1492 tty_port_lower_dtr_rts(&info->port); 1493 1493 1494 1494 set_bit(TTY_IO_ERROR, &tty->flags); ··· 1999 1999 int baud, baud_rate = 0; 2000 2000 int i; 2001 2001 2002 - if (!tty->termios) /* XXX can this happen at all? */ 2003 - return; 2004 - 2005 2002 if (info->line == -1) 2006 2003 return; 2007 2004 2008 - cflag = tty->termios->c_cflag; 2009 - iflag = tty->termios->c_iflag; 2005 + cflag = tty->termios.c_cflag; 2006 + iflag = tty->termios.c_iflag; 2010 2007 2011 2008 /* 2012 2009 * Set up the tty->alt_speed kludge ··· 2822 2825 cy_set_line_char(info, tty); 2823 2826 2824 2827 if ((old_termios->c_cflag & CRTSCTS) && 2825 - !(tty->termios->c_cflag & CRTSCTS)) { 2828 + !(tty->termios.c_cflag & CRTSCTS)) { 2826 2829 tty->hw_stopped = 0; 2827 2830 cy_start(tty); 2828 2831 } ··· 2834 2837 * or not. Hence, this may change..... 2835 2838 */ 2836 2839 if (!(old_termios->c_cflag & CLOCAL) && 2837 - (tty->termios->c_cflag & CLOCAL)) 2840 + (tty->termios.c_cflag & CLOCAL)) 2838 2841 wake_up_interruptible(&info->port.open_wait); 2839 2842 #endif 2840 2843 } /* cy_set_termios */ ··· 2896 2899 info->throttle = 1; 2897 2900 } 2898 2901 2899 - if (tty->termios->c_cflag & CRTSCTS) { 2902 + if (tty->termios.c_cflag & CRTSCTS) { 2900 2903 if (!cy_is_Z(card)) { 2901 2904 spin_lock_irqsave(&card->card_lock, flags); 2902 2905 cyy_change_rts_dtr(info, 0, TIOCM_RTS); ··· 2935 2938 cy_send_xchar(tty, START_CHAR(tty)); 2936 2939 } 2937 2940 2938 - if (tty->termios->c_cflag & CRTSCTS) { 2941 + if (tty->termios.c_cflag & CRTSCTS) { 2939 2942 card = info->card; 2940 2943 if (!cy_is_Z(card)) { 2941 2944 spin_lock_irqsave(&card->card_lock, flags);
+1 -1
drivers/tty/hvc/hvsi_lib.c
··· 400 400 spin_unlock_irqrestore(&hp->lock, flags); 401 401 402 402 /* Clear our own DTR */ 403 - if (!pv->tty || (pv->tty->termios->c_cflag & HUPCL)) 403 + if (!pv->tty || (pv->tty->termios.c_cflag & HUPCL)) 404 404 hvsilib_write_mctrl(pv, 0); 405 405 406 406 /* Tear down the connection */
+4 -4
drivers/tty/isicom.c
··· 702 702 703 703 /* 1,2,3,4 => 57.6, 115.2, 230, 460 kbps resp. */ 704 704 if (baud < 1 || baud > 4) 705 - tty->termios->c_cflag &= ~CBAUDEX; 705 + tty->termios.c_cflag &= ~CBAUDEX; 706 706 else 707 707 baud += 15; 708 708 } ··· 1196 1196 if (isicom_paranoia_check(port, tty->name, "isicom_set_termios")) 1197 1197 return; 1198 1198 1199 - if (tty->termios->c_cflag == old_termios->c_cflag && 1200 - tty->termios->c_iflag == old_termios->c_iflag) 1199 + if (tty->termios.c_cflag == old_termios->c_cflag && 1200 + tty->termios.c_iflag == old_termios->c_iflag) 1201 1201 return; 1202 1202 1203 1203 spin_lock_irqsave(&port->card->card_lock, flags); ··· 1205 1205 spin_unlock_irqrestore(&port->card->card_lock, flags); 1206 1206 1207 1207 if ((old_termios->c_cflag & CRTSCTS) && 1208 - !(tty->termios->c_cflag & CRTSCTS)) { 1208 + !(tty->termios.c_cflag & CRTSCTS)) { 1209 1209 tty->hw_stopped = 0; 1210 1210 isicom_start(tty); 1211 1211 }
+5 -5
drivers/tty/moxa.c
··· 367 367 tmp.dcd = 1; 368 368 369 369 ttyp = tty_port_tty_get(&p->port); 370 - if (!ttyp || !ttyp->termios) 370 + if (!ttyp) 371 371 tmp.cflag = p->cflag; 372 372 else 373 - tmp.cflag = ttyp->termios->c_cflag; 373 + tmp.cflag = ttyp->termios.c_cflag; 374 374 tty_kref_put(ttyp); 375 375 copy: 376 376 if (copy_to_user(argm, &tmp, sizeof(tmp))) ··· 1178 1178 mutex_lock(&ch->port.mutex); 1179 1179 if (!(ch->port.flags & ASYNC_INITIALIZED)) { 1180 1180 ch->statusflags = 0; 1181 - moxa_set_tty_param(tty, tty->termios); 1181 + moxa_set_tty_param(tty, &tty->termios); 1182 1182 MoxaPortLineCtrl(ch, 1, 1); 1183 1183 MoxaPortEnable(ch); 1184 1184 MoxaSetFifo(ch, ch->type == PORT_16550A); ··· 1193 1193 static void moxa_close(struct tty_struct *tty, struct file *filp) 1194 1194 { 1195 1195 struct moxa_port *ch = tty->driver_data; 1196 - ch->cflag = tty->termios->c_cflag; 1196 + ch->cflag = tty->termios.c_cflag; 1197 1197 tty_port_close(&ch->port, tty, filp); 1198 1198 } 1199 1199 ··· 1464 1464 1465 1465 static void moxa_set_tty_param(struct tty_struct *tty, struct ktermios *old_termios) 1466 1466 { 1467 - register struct ktermios *ts = tty->termios; 1467 + register struct ktermios *ts = &tty->termios; 1468 1468 struct moxa_port *ch = tty->driver_data; 1469 1469 int rts, cts, txflow, rxflow, xany, baud; 1470 1470
+10 -10
drivers/tty/mxser.c
··· 643 643 int ret = 0; 644 644 unsigned char status; 645 645 646 - cflag = tty->termios->c_cflag; 646 + cflag = tty->termios.c_cflag; 647 647 if (!info->ioaddr) 648 648 return ret; 649 649 ··· 1520 1520 1521 1521 tty = tty_port_tty_get(port); 1522 1522 1523 - if (!tty || !tty->termios) 1523 + if (!tty) 1524 1524 ms.cflag = ip->normal_termios.c_cflag; 1525 1525 else 1526 - ms.cflag = tty->termios->c_cflag; 1526 + ms.cflag = tty->termios.c_cflag; 1527 1527 tty_kref_put(tty); 1528 1528 spin_lock_irq(&ip->slock); 1529 1529 status = inb(ip->ioaddr + UART_MSR); ··· 1589 1589 1590 1590 tty = tty_port_tty_get(&ip->port); 1591 1591 1592 - if (!tty || !tty->termios) { 1592 + if (!tty) { 1593 1593 cflag = ip->normal_termios.c_cflag; 1594 1594 iflag = ip->normal_termios.c_iflag; 1595 1595 me->baudrate[p] = tty_termios_baud_rate(&ip->normal_termios); 1596 1596 } else { 1597 - cflag = tty->termios->c_cflag; 1598 - iflag = tty->termios->c_iflag; 1597 + cflag = tty->termios.c_cflag; 1598 + iflag = tty->termios.c_iflag; 1599 1599 me->baudrate[p] = tty_get_baud_rate(tty); 1600 1600 } 1601 1601 tty_kref_put(tty); ··· 1853 1853 } 1854 1854 } 1855 1855 1856 - if (tty->termios->c_cflag & CRTSCTS) { 1856 + if (tty->termios.c_cflag & CRTSCTS) { 1857 1857 info->MCR &= ~UART_MCR_RTS; 1858 1858 outb(info->MCR, info->ioaddr + UART_MCR); 1859 1859 } ··· 1890 1890 } 1891 1891 } 1892 1892 1893 - if (tty->termios->c_cflag & CRTSCTS) { 1893 + if (tty->termios.c_cflag & CRTSCTS) { 1894 1894 info->MCR |= UART_MCR_RTS; 1895 1895 outb(info->MCR, info->ioaddr + UART_MCR); 1896 1896 } ··· 1939 1939 spin_unlock_irqrestore(&info->slock, flags); 1940 1940 1941 1941 if ((old_termios->c_cflag & CRTSCTS) && 1942 - !(tty->termios->c_cflag & CRTSCTS)) { 1942 + !(tty->termios.c_cflag & CRTSCTS)) { 1943 1943 tty->hw_stopped = 0; 1944 1944 mxser_start(tty); 1945 1945 } 1946 1946 1947 1947 /* Handle sw stopped */ 1948 1948 if ((old_termios->c_iflag & IXON) && 1949 - !(tty->termios->c_iflag & IXON)) { 1949 + !(tty->termios.c_iflag & IXON)) { 1950 1950 tty->stopped = 0; 1951 1951 1952 1952 if (info->board->chip_flag) {
+4 -4
drivers/tty/n_gsm.c
··· 1061 1061 /* Carrier drop -> hangup */ 1062 1062 if (tty) { 1063 1063 if ((mlines & TIOCM_CD) == 0 && (dlci->modem_rx & TIOCM_CD)) 1064 - if (!(tty->termios->c_cflag & CLOCAL)) 1064 + if (!(tty->termios.c_cflag & CLOCAL)) 1065 1065 tty_hangup(tty); 1066 1066 if (brk & 0x01) 1067 1067 tty_insert_flip_char(tty, 0, TTY_BREAK); ··· 3043 3043 the RPN control message. This however rapidly gets nasty as we 3044 3044 then have to remap modem signals each way according to whether 3045 3045 our virtual cable is null modem etc .. */ 3046 - tty_termios_copy_hw(tty->termios, old); 3046 + tty_termios_copy_hw(&tty->termios, old); 3047 3047 } 3048 3048 3049 3049 static void gsmtty_throttle(struct tty_struct *tty) 3050 3050 { 3051 3051 struct gsm_dlci *dlci = tty->driver_data; 3052 - if (tty->termios->c_cflag & CRTSCTS) 3052 + if (tty->termios.c_cflag & CRTSCTS) 3053 3053 dlci->modem_tx &= ~TIOCM_DTR; 3054 3054 dlci->throttled = 1; 3055 3055 /* Send an MSC with DTR cleared */ ··· 3059 3059 static void gsmtty_unthrottle(struct tty_struct *tty) 3060 3060 { 3061 3061 struct gsm_dlci *dlci = tty->driver_data; 3062 - if (tty->termios->c_cflag & CRTSCTS) 3062 + if (tty->termios.c_cflag & CRTSCTS) 3063 3063 dlci->modem_tx |= TIOCM_DTR; 3064 3064 dlci->throttled = 0; 3065 3065 /* Send an MSC with DTR set */
+1 -1
drivers/tty/n_tty.c
··· 1466 1466 BUG_ON(!tty); 1467 1467 1468 1468 if (old) 1469 - canon_change = (old->c_lflag ^ tty->termios->c_lflag) & ICANON; 1469 + canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON; 1470 1470 if (canon_change) { 1471 1471 memset(&tty->read_flags, 0, sizeof tty->read_flags); 1472 1472 tty->canon_head = tty->read_tail;
+6 -17
drivers/tty/pty.c
··· 231 231 static void pty_set_termios(struct tty_struct *tty, 232 232 struct ktermios *old_termios) 233 233 { 234 - tty->termios->c_cflag &= ~(CSIZE | PARENB); 235 - tty->termios->c_cflag |= (CS8 | CREAD); 234 + tty->termios.c_cflag &= ~(CSIZE | PARENB); 235 + tty->termios.c_cflag |= (CS8 | CREAD); 236 236 } 237 237 238 238 /** ··· 315 315 driver->other->ttys[idx] = o_tty; 316 316 driver->ttys[idx] = tty; 317 317 } else { 318 - tty->termios = kzalloc(sizeof(struct ktermios[2]), GFP_KERNEL); 319 - if (tty->termios == NULL) 320 - goto err_deinit_tty; 321 - *tty->termios = driver->init_termios; 322 - tty->termios_locked = tty->termios + 1; 323 - 324 - o_tty->termios = kzalloc(sizeof(struct ktermios[2]), 325 - GFP_KERNEL); 326 - if (o_tty->termios == NULL) 327 - goto err_free_termios; 328 - *o_tty->termios = driver->other->init_termios; 329 - o_tty->termios_locked = o_tty->termios + 1; 318 + memset(&tty->termios_locked, 0, sizeof(tty->termios_locked)); 319 + tty->termios = driver->init_termios; 320 + memset(&o_tty->termios_locked, 0, sizeof(tty->termios_locked)); 321 + o_tty->termios = driver->other->init_termios; 330 322 } 331 323 332 324 /* ··· 341 349 err_free_termios: 342 350 if (legacy) 343 351 tty_free_termios(tty); 344 - else 345 - kfree(tty->termios); 346 352 err_deinit_tty: 347 353 deinitialize_tty_struct(o_tty); 348 354 module_put(o_tty->driver->owner); ··· 531 541 { 532 542 tty_driver_remove_tty(tty->driver, tty); 533 543 /* We have our own method as we don't use the tty index */ 534 - kfree(tty->termios); 535 544 } 536 545 537 546 /* We have no need to install and remove our tty objects as devpts does all
+9 -9
drivers/tty/rocket.c
··· 720 720 unsigned rocketMode; 721 721 int bits, baud, divisor; 722 722 CHANNEL_t *cp; 723 - struct ktermios *t = tty->termios; 723 + struct ktermios *t = &tty->termios; 724 724 725 725 cp = &info->channel; 726 726 cflag = t->c_cflag; ··· 978 978 tty->alt_speed = 460800; 979 979 980 980 configure_r_port(tty, info, NULL); 981 - if (tty->termios->c_cflag & CBAUD) { 981 + if (tty->termios.c_cflag & CBAUD) { 982 982 sSetDTR(cp); 983 983 sSetRTS(cp); 984 984 } ··· 1089 1089 if (rocket_paranoia_check(info, "rp_set_termios")) 1090 1090 return; 1091 1091 1092 - cflag = tty->termios->c_cflag; 1092 + cflag = tty->termios.c_cflag; 1093 1093 1094 1094 /* 1095 1095 * This driver doesn't support CS5 or CS6 1096 1096 */ 1097 1097 if (((cflag & CSIZE) == CS5) || ((cflag & CSIZE) == CS6)) 1098 - tty->termios->c_cflag = 1098 + tty->termios.c_cflag = 1099 1099 ((cflag & ~CSIZE) | (old_termios->c_cflag & CSIZE)); 1100 1100 /* Or CMSPAR */ 1101 - tty->termios->c_cflag &= ~CMSPAR; 1101 + tty->termios.c_cflag &= ~CMSPAR; 1102 1102 1103 1103 configure_r_port(tty, info, old_termios); 1104 1104 1105 1105 cp = &info->channel; 1106 1106 1107 1107 /* Handle transition to B0 status */ 1108 - if ((old_termios->c_cflag & CBAUD) && !(tty->termios->c_cflag & CBAUD)) { 1108 + if ((old_termios->c_cflag & CBAUD) && !(tty->termios.c_cflag & CBAUD)) { 1109 1109 sClrDTR(cp); 1110 1110 sClrRTS(cp); 1111 1111 } 1112 1112 1113 1113 /* Handle transition away from B0 status */ 1114 - if (!(old_termios->c_cflag & CBAUD) && (tty->termios->c_cflag & CBAUD)) { 1115 - if (!tty->hw_stopped || !(tty->termios->c_cflag & CRTSCTS)) 1114 + if (!(old_termios->c_cflag & CBAUD) && (tty->termios.c_cflag & CBAUD)) { 1115 + if (!tty->hw_stopped || !(tty->termios.c_cflag & CRTSCTS)) 1116 1116 sSetRTS(cp); 1117 1117 sSetDTR(cp); 1118 1118 } 1119 1119 1120 - if ((old_termios->c_cflag & CRTSCTS) && !(tty->termios->c_cflag & CRTSCTS)) { 1120 + if ((old_termios->c_cflag & CRTSCTS) && !(tty->termios.c_cflag & CRTSCTS)) { 1121 1121 tty->hw_stopped = 0; 1122 1122 rp_start(tty); 1123 1123 }
+1 -1
drivers/tty/serial/bfin_uart.c
··· 182 182 * To avoid losting RX interrupt, we reset IR function 183 183 * before sending data. 184 184 */ 185 - if (tty->termios->c_line == N_IRDA) 185 + if (tty->termios.c_line == N_IRDA) 186 186 bfin_serial_reset_irda(port); 187 187 188 188 #ifdef CONFIG_SERIAL_BFIN_DMA
+13 -13
drivers/tty/serial/crisv10.c
··· 955 955 /* Calculate the chartime depending on baudrate, numbor of bits etc. */ 956 956 static void update_char_time(struct e100_serial * info) 957 957 { 958 - tcflag_t cflags = info->port.tty->termios->c_cflag; 958 + tcflag_t cflags = info->port.tty->termios.c_cflag; 959 959 int bits; 960 960 961 961 /* calc. number of bits / data byte */ ··· 1473 1473 xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, 1474 1474 STOP_CHAR(info->port.tty)); 1475 1475 xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, stop); 1476 - if (tty->termios->c_iflag & IXON ) { 1476 + if (tty->termios.c_iflag & IXON ) { 1477 1477 xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); 1478 1478 } 1479 1479 ··· 1496 1496 info->xmit.tail,SERIAL_XMIT_SIZE))); 1497 1497 xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(tty)); 1498 1498 xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable); 1499 - if (tty->termios->c_iflag & IXON ) { 1499 + if (tty->termios.c_iflag & IXON ) { 1500 1500 xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); 1501 1501 } 1502 1502 ··· 2929 2929 descr[i].buf = 0; 2930 2930 } 2931 2931 2932 - if (!info->port.tty || (info->port.tty->termios->c_cflag & HUPCL)) { 2932 + if (!info->port.tty || (info->port.tty->termios.c_cflag & HUPCL)) { 2933 2933 /* hang up DTR and RTS if HUPCL is enabled */ 2934 2934 e100_dtr(info, 0); 2935 2935 e100_rts(info, 0); /* could check CRTSCTS before doing this */ ··· 2953 2953 unsigned long flags; 2954 2954 /* first some safety checks */ 2955 2955 2956 - if (!info->port.tty || !info->port.tty->termios) 2956 + if (!info->port.tty) 2957 2957 return; 2958 2958 if (!info->ioport) 2959 2959 return; 2960 2960 2961 - cflag = info->port.tty->termios->c_cflag; 2961 + cflag = info->port.tty->termios.c_cflag; 2962 2962 2963 2963 /* possibly, the tx/rx should be disabled first to do this safely */ 2964 2964 ··· 3088 3088 info->ioport[REG_REC_CTRL] = info->rx_ctrl; 3089 3089 xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->port.tty)); 3090 3090 xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable); 3091 - if (info->port.tty->termios->c_iflag & IXON ) { 3091 + if (info->port.tty->termios.c_iflag & IXON ) { 3092 3092 DFLOW(DEBUG_LOG(info->line, "FLOW XOFF enabled 0x%02X\n", 3093 3093 STOP_CHAR(info->port.tty))); 3094 3094 xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); ··· 3355 3355 DFLOW(DEBUG_LOG(info->line,"rs_throttle %lu\n", tty->ldisc.chars_in_buffer(tty))); 3356 3356 3357 3357 /* Do RTS before XOFF since XOFF might take some time */ 3358 - if (tty->termios->c_cflag & CRTSCTS) { 3358 + if (tty->termios.c_cflag & CRTSCTS) { 3359 3359 /* Turn off RTS line */ 3360 3360 e100_rts(info, 0); 3361 3361 } ··· 3377 3377 DFLOW(DEBUG_LOG(info->line,"rs_unthrottle ldisc %d\n", tty->ldisc.chars_in_buffer(tty))); 3378 3378 DFLOW(DEBUG_LOG(info->line,"rs_unthrottle flip.count: %i\n", tty->flip.count)); 3379 3379 /* Do RTS before XOFF since XOFF might take some time */ 3380 - if (tty->termios->c_cflag & CRTSCTS) { 3380 + if (tty->termios.c_cflag & CRTSCTS) { 3381 3381 /* Assert RTS line */ 3382 3382 e100_rts(info, 1); 3383 3383 } ··· 3748 3748 3749 3749 /* Handle turning off CRTSCTS */ 3750 3750 if ((old_termios->c_cflag & CRTSCTS) && 3751 - !(tty->termios->c_cflag & CRTSCTS)) { 3751 + !(tty->termios.c_cflag & CRTSCTS)) { 3752 3752 tty->hw_stopped = 0; 3753 3753 rs_start(tty); 3754 3754 } ··· 3815 3815 * separate termios for callout and dialin. 3816 3816 */ 3817 3817 if (info->flags & ASYNC_NORMAL_ACTIVE) 3818 - info->normal_termios = *tty->termios; 3818 + info->normal_termios = tty->termios; 3819 3819 /* 3820 3820 * Now we wait for the transmit buffer to clear; and we notify 3821 3821 * the line discipline to only process XON/XOFF characters. ··· 3998 3998 return 0; 3999 3999 } 4000 4000 4001 - if (tty->termios->c_cflag & CLOCAL) { 4001 + if (tty->termios.c_cflag & CLOCAL) { 4002 4002 do_clocal = 1; 4003 4003 } 4004 4004 ··· 4219 4219 } 4220 4220 4221 4221 if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { 4222 - *tty->termios = info->normal_termios; 4222 + tty->termios = info->normal_termios; 4223 4223 change_speed(info); 4224 4224 } 4225 4225
+1 -1
drivers/tty/serial/ioc4_serial.c
··· 1803 1803 ioc4_set_proto(port, the_port->mapbase); 1804 1804 1805 1805 /* set the speed of the serial port */ 1806 - ioc4_change_speed(the_port, state->port.tty->termios, 1806 + ioc4_change_speed(the_port, &state->port.tty->termios, 1807 1807 (struct ktermios *)0); 1808 1808 1809 1809 return 0;
+4 -4
drivers/tty/serial/jsm/jsm_tty.c
··· 161 161 struct ktermios *termios; 162 162 163 163 spin_lock_irqsave(&port->lock, lock_flags); 164 - termios = port->state->port.tty->termios; 164 + termios = &port->state->port.tty->termios; 165 165 if (ch == termios->c_cc[VSTART]) 166 166 channel->ch_bd->bd_ops->send_start_character(channel); 167 167 ··· 250 250 channel->ch_cached_lsr = 0; 251 251 channel->ch_stops_sent = 0; 252 252 253 - termios = port->state->port.tty->termios; 253 + termios = &port->state->port.tty->termios; 254 254 channel->ch_c_cflag = termios->c_cflag; 255 255 channel->ch_c_iflag = termios->c_iflag; 256 256 channel->ch_c_oflag = termios->c_oflag; ··· 283 283 jsm_printk(CLOSE, INFO, &channel->ch_bd->pci_dev, "start\n"); 284 284 285 285 bd = channel->ch_bd; 286 - ts = port->state->port.tty->termios; 286 + ts = &port->state->port.tty->termios; 287 287 288 288 channel->ch_flags &= ~(CH_STOPI); 289 289 ··· 567 567 *input data and return immediately. 568 568 */ 569 569 if (!tp || 570 - !(tp->termios->c_cflag & CREAD) ) { 570 + !(tp->termios.c_cflag & CREAD) ) { 571 571 572 572 jsm_printk(READ, INFO, &ch->ch_bd->pci_dev, 573 573 "input. dropping %d bytes on port %d...\n", data_len, ch->ch_portnum);
+1 -1
drivers/tty/serial/samsung.c
··· 1035 1035 if (tty == NULL) 1036 1036 goto exit; 1037 1037 1038 - termios = tty->termios; 1038 + termios = &tty->termios; 1039 1039 1040 1040 if (termios == NULL) { 1041 1041 printk(KERN_WARNING "%s: no termios?\n", __func__);
+14 -14
drivers/tty/serial/serial_core.c
··· 159 159 retval = uport->ops->startup(uport); 160 160 if (retval == 0) { 161 161 if (uart_console(uport) && uport->cons->cflag) { 162 - tty->termios->c_cflag = uport->cons->cflag; 162 + tty->termios.c_cflag = uport->cons->cflag; 163 163 uport->cons->cflag = 0; 164 164 } 165 165 /* ··· 172 172 * Setup the RTS and DTR signals once the 173 173 * port is open and ready to respond. 174 174 */ 175 - if (tty->termios->c_cflag & CBAUD) 175 + if (tty->termios.c_cflag & CBAUD) 176 176 uart_set_mctrl(uport, TIOCM_RTS | TIOCM_DTR); 177 177 } 178 178 ··· 240 240 /* 241 241 * Turn off DTR and RTS early. 242 242 */ 243 - if (!tty || (tty->termios->c_cflag & HUPCL)) 243 + if (!tty || (tty->termios.c_cflag & HUPCL)) 244 244 uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS); 245 245 246 246 uart_port_shutdown(port); ··· 440 440 * If we have no tty, termios, or the port does not exist, 441 441 * then we can't set the parameters for this port. 442 442 */ 443 - if (!tty || !tty->termios || uport->type == PORT_UNKNOWN) 443 + if (!tty || uport->type == PORT_UNKNOWN) 444 444 return; 445 445 446 - termios = tty->termios; 446 + termios = &tty->termios; 447 447 448 448 /* 449 449 * Set flags based on termios cflag ··· 614 614 if (I_IXOFF(tty)) 615 615 uart_send_xchar(tty, STOP_CHAR(tty)); 616 616 617 - if (tty->termios->c_cflag & CRTSCTS) 617 + if (tty->termios.c_cflag & CRTSCTS) 618 618 uart_clear_mctrl(state->uart_port, TIOCM_RTS); 619 619 } 620 620 ··· 630 630 uart_send_xchar(tty, START_CHAR(tty)); 631 631 } 632 632 633 - if (tty->termios->c_cflag & CRTSCTS) 633 + if (tty->termios.c_cflag & CRTSCTS) 634 634 uart_set_mctrl(port, TIOCM_RTS); 635 635 } 636 636 ··· 1187 1187 struct uart_port *uport = state->uart_port; 1188 1188 1189 1189 if (uport->ops->set_ldisc) 1190 - uport->ops->set_ldisc(uport, tty->termios->c_line); 1190 + uport->ops->set_ldisc(uport, tty->termios.c_line); 1191 1191 } 1192 1192 1193 1193 static void uart_set_termios(struct tty_struct *tty, ··· 1195 1195 { 1196 1196 struct uart_state *state = tty->driver_data; 1197 1197 unsigned long flags; 1198 - unsigned int cflag = tty->termios->c_cflag; 1198 + unsigned int cflag = tty->termios.c_cflag; 1199 1199 1200 1200 1201 1201 /* ··· 1206 1206 */ 1207 1207 #define RELEVANT_IFLAG(iflag) ((iflag) & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) 1208 1208 if ((cflag ^ old_termios->c_cflag) == 0 && 1209 - tty->termios->c_ospeed == old_termios->c_ospeed && 1210 - tty->termios->c_ispeed == old_termios->c_ispeed && 1211 - RELEVANT_IFLAG(tty->termios->c_iflag ^ old_termios->c_iflag) == 0) { 1209 + tty->termios.c_ospeed == old_termios->c_ospeed && 1210 + tty->termios.c_ispeed == old_termios->c_ispeed && 1211 + RELEVANT_IFLAG(tty->termios.c_iflag ^ old_termios->c_iflag) == 0) { 1212 1212 return; 1213 1213 } 1214 1214 ··· 1960 1960 /* 1961 1961 * If that's unset, use the tty termios setting. 1962 1962 */ 1963 - if (port->tty && port->tty->termios && termios.c_cflag == 0) 1964 - termios = *(port->tty->termios); 1963 + if (port->tty && termios.c_cflag == 0) 1964 + termios = port->tty->termios; 1965 1965 1966 1966 if (console_suspend_enabled) 1967 1967 uart_change_pm(state, 0);
+18 -18
drivers/tty/synclink.c
··· 1840 1840 usc_DisableInterrupts(info,RECEIVE_DATA + RECEIVE_STATUS + 1841 1841 TRANSMIT_DATA + TRANSMIT_STATUS + IO_PIN + MISC ); 1842 1842 usc_DisableDmaInterrupts(info,DICR_MASTER + DICR_TRANSMIT + DICR_RECEIVE); 1843 - 1843 + 1844 1844 /* Disable DMAEN (Port 7, Bit 14) */ 1845 1845 /* This disconnects the DMA request signal from the ISA bus */ 1846 1846 /* on the ISA adapter. This has no effect for the PCI adapter */ 1847 1847 usc_OutReg(info, PCR, (u16)((usc_InReg(info, PCR) | BIT15) | BIT14)); 1848 - 1848 + 1849 1849 /* Disable INTEN (Port 6, Bit12) */ 1850 1850 /* This disconnects the IRQ request signal to the ISA bus */ 1851 1851 /* on the ISA adapter. This has no effect for the PCI adapter */ 1852 1852 usc_OutReg(info, PCR, (u16)((usc_InReg(info, PCR) | BIT13) | BIT12)); 1853 - 1854 - if (!info->port.tty || info->port.tty->termios->c_cflag & HUPCL) { 1853 + 1854 + if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) { 1855 1855 info->serial_signals &= ~(SerialSignal_DTR + SerialSignal_RTS); 1856 1856 usc_set_serial_signals(info); 1857 1857 } 1858 - 1858 + 1859 1859 spin_unlock_irqrestore(&info->irq_spinlock,flags); 1860 1860 1861 1861 mgsl_release_resources(info); ··· 1895 1895 usc_EnableInterrupts(info, IO_PIN); 1896 1896 usc_get_serial_signals(info); 1897 1897 1898 - if (info->netcount || info->port.tty->termios->c_cflag & CREAD) 1898 + if (info->netcount || info->port.tty->termios.c_cflag & CREAD) 1899 1899 usc_start_receiver(info); 1900 1900 1901 1901 spin_unlock_irqrestore(&info->irq_spinlock,flags); ··· 1908 1908 unsigned cflag; 1909 1909 int bits_per_char; 1910 1910 1911 - if (!info->port.tty || !info->port.tty->termios) 1911 + if (!info->port.tty) 1912 1912 return; 1913 1913 1914 1914 if (debug_level >= DEBUG_LEVEL_INFO) 1915 1915 printk("%s(%d):mgsl_change_params(%s)\n", 1916 1916 __FILE__,__LINE__, info->device_name ); 1917 1917 1918 - cflag = info->port.tty->termios->c_cflag; 1918 + cflag = info->port.tty->termios.c_cflag; 1919 1919 1920 1920 /* if B0 rate (hangup) specified then negate DTR and RTS */ 1921 1921 /* otherwise assert DTR and RTS */ ··· 2367 2367 2368 2368 if (I_IXOFF(tty)) 2369 2369 mgsl_send_xchar(tty, STOP_CHAR(tty)); 2370 - 2371 - if (tty->termios->c_cflag & CRTSCTS) { 2370 + 2371 + if (tty->termios.c_cflag & CRTSCTS) { 2372 2372 spin_lock_irqsave(&info->irq_spinlock,flags); 2373 2373 info->serial_signals &= ~SerialSignal_RTS; 2374 2374 usc_set_serial_signals(info); ··· 2401 2401 else 2402 2402 mgsl_send_xchar(tty, START_CHAR(tty)); 2403 2403 } 2404 - 2405 - if (tty->termios->c_cflag & CRTSCTS) { 2404 + 2405 + if (tty->termios.c_cflag & CRTSCTS) { 2406 2406 spin_lock_irqsave(&info->irq_spinlock,flags); 2407 2407 info->serial_signals |= SerialSignal_RTS; 2408 2408 usc_set_serial_signals(info); ··· 3045 3045 3046 3046 /* Handle transition to B0 status */ 3047 3047 if (old_termios->c_cflag & CBAUD && 3048 - !(tty->termios->c_cflag & CBAUD)) { 3048 + !(tty->termios.c_cflag & CBAUD)) { 3049 3049 info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR); 3050 3050 spin_lock_irqsave(&info->irq_spinlock,flags); 3051 3051 usc_set_serial_signals(info); ··· 3054 3054 3055 3055 /* Handle transition away from B0 status */ 3056 3056 if (!(old_termios->c_cflag & CBAUD) && 3057 - tty->termios->c_cflag & CBAUD) { 3057 + tty->termios.c_cflag & CBAUD) { 3058 3058 info->serial_signals |= SerialSignal_DTR; 3059 - if (!(tty->termios->c_cflag & CRTSCTS) || 3059 + if (!(tty->termios.c_cflag & CRTSCTS) || 3060 3060 !test_bit(TTY_THROTTLED, &tty->flags)) { 3061 3061 info->serial_signals |= SerialSignal_RTS; 3062 3062 } ··· 3067 3067 3068 3068 /* Handle turning off CRTSCTS */ 3069 3069 if (old_termios->c_cflag & CRTSCTS && 3070 - !(tty->termios->c_cflag & CRTSCTS)) { 3070 + !(tty->termios.c_cflag & CRTSCTS)) { 3071 3071 tty->hw_stopped = 0; 3072 3072 mgsl_start(tty); 3073 3073 } ··· 3287 3287 return 0; 3288 3288 } 3289 3289 3290 - if (tty->termios->c_cflag & CLOCAL) 3290 + if (tty->termios.c_cflag & CLOCAL) 3291 3291 do_clocal = true; 3292 3292 3293 3293 /* Wait for carrier detect and the line to become ··· 3313 3313 port->blocked_open++; 3314 3314 3315 3315 while (1) { 3316 - if (tty->termios->c_cflag & CBAUD) 3316 + if (tty->termios.c_cflag & CBAUD) 3317 3317 tty_port_raise_dtr_rts(port); 3318 3318 3319 3319 set_current_state(TASK_INTERRUPTIBLE);
+12 -12
drivers/tty/synclinkmp.c
··· 873 873 874 874 /* Handle transition to B0 status */ 875 875 if (old_termios->c_cflag & CBAUD && 876 - !(tty->termios->c_cflag & CBAUD)) { 876 + !(tty->termios.c_cflag & CBAUD)) { 877 877 info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR); 878 878 spin_lock_irqsave(&info->lock,flags); 879 879 set_signals(info); ··· 882 882 883 883 /* Handle transition away from B0 status */ 884 884 if (!(old_termios->c_cflag & CBAUD) && 885 - tty->termios->c_cflag & CBAUD) { 885 + tty->termios.c_cflag & CBAUD) { 886 886 info->serial_signals |= SerialSignal_DTR; 887 - if (!(tty->termios->c_cflag & CRTSCTS) || 887 + if (!(tty->termios.c_cflag & CRTSCTS) || 888 888 !test_bit(TTY_THROTTLED, &tty->flags)) { 889 889 info->serial_signals |= SerialSignal_RTS; 890 890 } ··· 895 895 896 896 /* Handle turning off CRTSCTS */ 897 897 if (old_termios->c_cflag & CRTSCTS && 898 - !(tty->termios->c_cflag & CRTSCTS)) { 898 + !(tty->termios.c_cflag & CRTSCTS)) { 899 899 tty->hw_stopped = 0; 900 900 tx_release(tty); 901 901 } ··· 1473 1473 if (I_IXOFF(tty)) 1474 1474 send_xchar(tty, STOP_CHAR(tty)); 1475 1475 1476 - if (tty->termios->c_cflag & CRTSCTS) { 1476 + if (tty->termios.c_cflag & CRTSCTS) { 1477 1477 spin_lock_irqsave(&info->lock,flags); 1478 1478 info->serial_signals &= ~SerialSignal_RTS; 1479 1479 set_signals(info); ··· 1502 1502 send_xchar(tty, START_CHAR(tty)); 1503 1503 } 1504 1504 1505 - if (tty->termios->c_cflag & CRTSCTS) { 1505 + if (tty->termios.c_cflag & CRTSCTS) { 1506 1506 spin_lock_irqsave(&info->lock,flags); 1507 1507 info->serial_signals |= SerialSignal_RTS; 1508 1508 set_signals(info); ··· 2708 2708 2709 2709 reset_port(info); 2710 2710 2711 - if (!info->port.tty || info->port.tty->termios->c_cflag & HUPCL) { 2711 + if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) { 2712 2712 info->serial_signals &= ~(SerialSignal_DTR + SerialSignal_RTS); 2713 2713 set_signals(info); 2714 2714 } ··· 2749 2749 2750 2750 get_signals(info); 2751 2751 2752 - if (info->netcount || (info->port.tty && info->port.tty->termios->c_cflag & CREAD) ) 2752 + if (info->netcount || (info->port.tty && info->port.tty->termios.c_cflag & CREAD) ) 2753 2753 rx_start(info); 2754 2754 2755 2755 spin_unlock_irqrestore(&info->lock,flags); ··· 2762 2762 unsigned cflag; 2763 2763 int bits_per_char; 2764 2764 2765 - if (!info->port.tty || !info->port.tty->termios) 2765 + if (!info->port.tty) 2766 2766 return; 2767 2767 2768 2768 if (debug_level >= DEBUG_LEVEL_INFO) 2769 2769 printk("%s(%d):%s change_params()\n", 2770 2770 __FILE__,__LINE__, info->device_name ); 2771 2771 2772 - cflag = info->port.tty->termios->c_cflag; 2772 + cflag = info->port.tty->termios.c_cflag; 2773 2773 2774 2774 /* if B0 rate (hangup) specified then negate DTR and RTS */ 2775 2775 /* otherwise assert DTR and RTS */ ··· 3306 3306 return 0; 3307 3307 } 3308 3308 3309 - if (tty->termios->c_cflag & CLOCAL) 3309 + if (tty->termios.c_cflag & CLOCAL) 3310 3310 do_clocal = true; 3311 3311 3312 3312 /* Wait for carrier detect and the line to become ··· 3332 3332 port->blocked_open++; 3333 3333 3334 3334 while (1) { 3335 - if (tty->termios->c_cflag & CBAUD) 3335 + if (tty->termios.c_cflag & CBAUD) 3336 3336 tty_port_raise_dtr_rts(port); 3337 3337 3338 3338 set_current_state(TASK_INTERRUPTIBLE);
+8 -18
drivers/tty/tty_io.c
··· 1251 1251 1252 1252 tp = tty->driver->termios[idx]; 1253 1253 if (tp == NULL) { 1254 - tp = kzalloc(sizeof(struct ktermios[2]), GFP_KERNEL); 1254 + tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL); 1255 1255 if (tp == NULL) 1256 1256 return -ENOMEM; 1257 - memcpy(tp, &tty->driver->init_termios, 1258 - sizeof(struct ktermios)); 1257 + *tp = tty->driver->init_termios; 1259 1258 tty->driver->termios[idx] = tp; 1260 1259 } 1261 - tty->termios = tp; 1262 - tty->termios_locked = tp + 1; 1260 + tty->termios = *tp; 1263 1261 1264 1262 /* Compatibility until drivers always set this */ 1265 - tty->termios->c_ispeed = tty_termios_input_baud_rate(tty->termios); 1266 - tty->termios->c_ospeed = tty_termios_baud_rate(tty->termios); 1263 + tty->termios.c_ispeed = tty_termios_input_baud_rate(&tty->termios); 1264 + tty->termios.c_ospeed = tty_termios_baud_rate(&tty->termios); 1267 1265 return 0; 1268 1266 } 1269 1267 EXPORT_SYMBOL_GPL(tty_init_termios); ··· 1440 1442 /* Kill this flag and push into drivers for locking etc */ 1441 1443 if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { 1442 1444 /* FIXME: Locking on ->termios array */ 1443 - tp = tty->termios; 1445 + tp = tty->driver->termios[idx]; 1444 1446 tty->driver->termios[idx] = NULL; 1445 1447 kfree(tp); 1446 1448 } 1449 + else 1450 + *tty->driver->termios[idx] = tty->termios; 1447 1451 } 1448 1452 EXPORT_SYMBOL(tty_free_termios); 1449 1453 ··· 1575 1575 __func__, idx, tty->name); 1576 1576 return -1; 1577 1577 } 1578 - if (tty->termios != tty->driver->termios[idx]) { 1579 - printk(KERN_DEBUG "%s: driver.termios[%d] not termios for (%s)\n", 1580 - __func__, idx, tty->name); 1581 - return -1; 1582 - } 1583 1578 if (tty->driver->other) { 1584 1579 if (o_tty != tty->driver->other->ttys[idx]) { 1585 1580 printk(KERN_DEBUG "%s: other->table[%d] not o_tty for (%s)\n", 1586 - __func__, idx, tty->name); 1587 - return -1; 1588 - } 1589 - if (o_tty->termios != tty->driver->other->termios[idx]) { 1590 - printk(KERN_DEBUG "%s: other->termios[%d] not o_termios for (%s)\n", 1591 1581 __func__, idx, tty->name); 1592 1582 return -1; 1593 1583 }
+62 -62
drivers/tty/tty_ioctl.c
··· 410 410 411 411 void tty_encode_baud_rate(struct tty_struct *tty, speed_t ibaud, speed_t obaud) 412 412 { 413 - tty_termios_encode_baud_rate(tty->termios, ibaud, obaud); 413 + tty_termios_encode_baud_rate(&tty->termios, ibaud, obaud); 414 414 } 415 415 EXPORT_SYMBOL_GPL(tty_encode_baud_rate); 416 416 ··· 427 427 428 428 speed_t tty_get_baud_rate(struct tty_struct *tty) 429 429 { 430 - speed_t baud = tty_termios_baud_rate(tty->termios); 430 + speed_t baud = tty_termios_baud_rate(&tty->termios); 431 431 432 432 if (baud == 38400 && tty->alt_speed) { 433 433 if (!tty->warned) { ··· 509 509 /* FIXME: we need to decide on some locking/ordering semantics 510 510 for the set_termios notification eventually */ 511 511 mutex_lock(&tty->termios_mutex); 512 - old_termios = *tty->termios; 513 - *tty->termios = *new_termios; 514 - unset_locked_termios(tty->termios, &old_termios, tty->termios_locked); 512 + old_termios = tty->termios; 513 + tty->termios = *new_termios; 514 + unset_locked_termios(&tty->termios, &old_termios, &tty->termios_locked); 515 515 516 516 /* See if packet mode change of state. */ 517 517 if (tty->link && tty->link->packet) { 518 518 int extproc = (old_termios.c_lflag & EXTPROC) | 519 - (tty->termios->c_lflag & EXTPROC); 519 + (tty->termios.c_lflag & EXTPROC); 520 520 int old_flow = ((old_termios.c_iflag & IXON) && 521 521 (old_termios.c_cc[VSTOP] == '\023') && 522 522 (old_termios.c_cc[VSTART] == '\021')); ··· 542 542 if (tty->ops->set_termios) 543 543 (*tty->ops->set_termios)(tty, &old_termios); 544 544 else 545 - tty_termios_copy_hw(tty->termios, &old_termios); 545 + tty_termios_copy_hw(&tty->termios, &old_termios); 546 546 547 547 ld = tty_ldisc_ref(tty); 548 548 if (ld != NULL) { ··· 578 578 return retval; 579 579 580 580 mutex_lock(&tty->termios_mutex); 581 - memcpy(&tmp_termios, tty->termios, sizeof(struct ktermios)); 581 + tmp_termios = tty->termios; 582 582 mutex_unlock(&tty->termios_mutex); 583 583 584 584 if (opt & TERMIOS_TERMIO) { ··· 632 632 static void copy_termios(struct tty_struct *tty, struct ktermios *kterm) 633 633 { 634 634 mutex_lock(&tty->termios_mutex); 635 - memcpy(kterm, tty->termios, sizeof(struct ktermios)); 635 + *kterm = tty->termios; 636 636 mutex_unlock(&tty->termios_mutex); 637 637 } 638 638 639 639 static void copy_termios_locked(struct tty_struct *tty, struct ktermios *kterm) 640 640 { 641 641 mutex_lock(&tty->termios_mutex); 642 - memcpy(kterm, tty->termios_locked, sizeof(struct ktermios)); 642 + *kterm = tty->termios_locked; 643 643 mutex_unlock(&tty->termios_mutex); 644 644 } 645 645 ··· 707 707 { 708 708 int flags = 0; 709 709 710 - if (!(tty->termios->c_lflag & ICANON)) { 711 - if (tty->termios->c_lflag & ISIG) 710 + if (!(tty->termios.c_lflag & ICANON)) { 711 + if (tty->termios.c_lflag & ISIG) 712 712 flags |= 0x02; /* cbreak */ 713 713 else 714 714 flags |= 0x20; /* raw */ 715 715 } 716 - if (tty->termios->c_lflag & ECHO) 716 + if (tty->termios.c_lflag & ECHO) 717 717 flags |= 0x08; /* echo */ 718 - if (tty->termios->c_oflag & OPOST) 719 - if (tty->termios->c_oflag & ONLCR) 718 + if (tty->termios.c_oflag & OPOST) 719 + if (tty->termios.c_oflag & ONLCR) 720 720 flags |= 0x10; /* crmod */ 721 721 return flags; 722 722 } ··· 726 726 struct sgttyb tmp; 727 727 728 728 mutex_lock(&tty->termios_mutex); 729 - tmp.sg_ispeed = tty->termios->c_ispeed; 730 - tmp.sg_ospeed = tty->termios->c_ospeed; 731 - tmp.sg_erase = tty->termios->c_cc[VERASE]; 732 - tmp.sg_kill = tty->termios->c_cc[VKILL]; 729 + tmp.sg_ispeed = tty->termios.c_ispeed; 730 + tmp.sg_ospeed = tty->termios.c_ospeed; 731 + tmp.sg_erase = tty->termios.c_cc[VERASE]; 732 + tmp.sg_kill = tty->termios.c_cc[VKILL]; 733 733 tmp.sg_flags = get_sgflags(tty); 734 734 mutex_unlock(&tty->termios_mutex); 735 735 ··· 738 738 739 739 static void set_sgflags(struct ktermios *termios, int flags) 740 740 { 741 - termios->c_iflag = ICRNL | IXON; 742 - termios->c_oflag = 0; 743 - termios->c_lflag = ISIG | ICANON; 741 + termios.c_iflag = ICRNL | IXON; 742 + termios.c_oflag = 0; 743 + termios.c_lflag = ISIG | ICANON; 744 744 if (flags & 0x02) { /* cbreak */ 745 - termios->c_iflag = 0; 746 - termios->c_lflag &= ~ICANON; 745 + termios.c_iflag = 0; 746 + termios.c_lflag &= ~ICANON; 747 747 } 748 748 if (flags & 0x08) { /* echo */ 749 - termios->c_lflag |= ECHO | ECHOE | ECHOK | 749 + termios.c_lflag |= ECHO | ECHOE | ECHOK | 750 750 ECHOCTL | ECHOKE | IEXTEN; 751 751 } 752 752 if (flags & 0x10) { /* crmod */ 753 - termios->c_oflag |= OPOST | ONLCR; 753 + termios.c_oflag |= OPOST | ONLCR; 754 754 } 755 755 if (flags & 0x20) { /* raw */ 756 - termios->c_iflag = 0; 757 - termios->c_lflag &= ~(ISIG | ICANON); 756 + termios.c_iflag = 0; 757 + termios.c_lflag &= ~(ISIG | ICANON); 758 758 } 759 - if (!(termios->c_lflag & ICANON)) { 760 - termios->c_cc[VMIN] = 1; 761 - termios->c_cc[VTIME] = 0; 759 + if (!(termios.c_lflag & ICANON)) { 760 + termios.c_cc[VMIN] = 1; 761 + termios.c_cc[VTIME] = 0; 762 762 } 763 763 } 764 764 ··· 787 787 return -EFAULT; 788 788 789 789 mutex_lock(&tty->termios_mutex); 790 - termios = *tty->termios; 790 + termios = tty->termios; 791 791 termios.c_cc[VERASE] = tmp.sg_erase; 792 792 termios.c_cc[VKILL] = tmp.sg_kill; 793 793 set_sgflags(&termios, tmp.sg_flags); ··· 808 808 struct tchars tmp; 809 809 810 810 mutex_lock(&tty->termios_mutex); 811 - tmp.t_intrc = tty->termios->c_cc[VINTR]; 812 - tmp.t_quitc = tty->termios->c_cc[VQUIT]; 813 - tmp.t_startc = tty->termios->c_cc[VSTART]; 814 - tmp.t_stopc = tty->termios->c_cc[VSTOP]; 815 - tmp.t_eofc = tty->termios->c_cc[VEOF]; 816 - tmp.t_brkc = tty->termios->c_cc[VEOL2]; /* what is brkc anyway? */ 811 + tmp.t_intrc = tty->termios.c_cc[VINTR]; 812 + tmp.t_quitc = tty->termios.c_cc[VQUIT]; 813 + tmp.t_startc = tty->termios.c_cc[VSTART]; 814 + tmp.t_stopc = tty->termios.c_cc[VSTOP]; 815 + tmp.t_eofc = tty->termios.c_cc[VEOF]; 816 + tmp.t_brkc = tty->termios.c_cc[VEOL2]; /* what is brkc anyway? */ 817 817 mutex_unlock(&tty->termios_mutex); 818 818 return copy_to_user(tchars, &tmp, sizeof(tmp)) ? -EFAULT : 0; 819 819 } ··· 825 825 if (copy_from_user(&tmp, tchars, sizeof(tmp))) 826 826 return -EFAULT; 827 827 mutex_lock(&tty->termios_mutex); 828 - tty->termios->c_cc[VINTR] = tmp.t_intrc; 829 - tty->termios->c_cc[VQUIT] = tmp.t_quitc; 830 - tty->termios->c_cc[VSTART] = tmp.t_startc; 831 - tty->termios->c_cc[VSTOP] = tmp.t_stopc; 832 - tty->termios->c_cc[VEOF] = tmp.t_eofc; 833 - tty->termios->c_cc[VEOL2] = tmp.t_brkc; /* what is brkc anyway? */ 828 + tty->termios.c_cc[VINTR] = tmp.t_intrc; 829 + tty->termios.c_cc[VQUIT] = tmp.t_quitc; 830 + tty->termios.c_cc[VSTART] = tmp.t_startc; 831 + tty->termios.c_cc[VSTOP] = tmp.t_stopc; 832 + tty->termios.c_cc[VEOF] = tmp.t_eofc; 833 + tty->termios.c_cc[VEOL2] = tmp.t_brkc; /* what is brkc anyway? */ 834 834 mutex_unlock(&tty->termios_mutex); 835 835 return 0; 836 836 } ··· 842 842 struct ltchars tmp; 843 843 844 844 mutex_lock(&tty->termios_mutex); 845 - tmp.t_suspc = tty->termios->c_cc[VSUSP]; 845 + tmp.t_suspc = tty->termios.c_cc[VSUSP]; 846 846 /* what is dsuspc anyway? */ 847 - tmp.t_dsuspc = tty->termios->c_cc[VSUSP]; 848 - tmp.t_rprntc = tty->termios->c_cc[VREPRINT]; 847 + tmp.t_dsuspc = tty->termios.c_cc[VSUSP]; 848 + tmp.t_rprntc = tty->termios.c_cc[VREPRINT]; 849 849 /* what is flushc anyway? */ 850 - tmp.t_flushc = tty->termios->c_cc[VEOL2]; 851 - tmp.t_werasc = tty->termios->c_cc[VWERASE]; 852 - tmp.t_lnextc = tty->termios->c_cc[VLNEXT]; 850 + tmp.t_flushc = tty->termios.c_cc[VEOL2]; 851 + tmp.t_werasc = tty->termios.c_cc[VWERASE]; 852 + tmp.t_lnextc = tty->termios.c_cc[VLNEXT]; 853 853 mutex_unlock(&tty->termios_mutex); 854 854 return copy_to_user(ltchars, &tmp, sizeof(tmp)) ? -EFAULT : 0; 855 855 } ··· 862 862 return -EFAULT; 863 863 864 864 mutex_lock(&tty->termios_mutex); 865 - tty->termios->c_cc[VSUSP] = tmp.t_suspc; 865 + tty->termios.c_cc[VSUSP] = tmp.t_suspc; 866 866 /* what is dsuspc anyway? */ 867 - tty->termios->c_cc[VEOL2] = tmp.t_dsuspc; 868 - tty->termios->c_cc[VREPRINT] = tmp.t_rprntc; 867 + tty->termios.c_cc[VEOL2] = tmp.t_dsuspc; 868 + tty->termios.c_cc[VREPRINT] = tmp.t_rprntc; 869 869 /* what is flushc anyway? */ 870 - tty->termios->c_cc[VEOL2] = tmp.t_flushc; 871 - tty->termios->c_cc[VWERASE] = tmp.t_werasc; 872 - tty->termios->c_cc[VLNEXT] = tmp.t_lnextc; 870 + tty->termios.c_cc[VEOL2] = tmp.t_flushc; 871 + tty->termios.c_cc[VWERASE] = tmp.t_werasc; 872 + tty->termios.c_cc[VLNEXT] = tmp.t_lnextc; 873 873 mutex_unlock(&tty->termios_mutex); 874 874 return 0; 875 875 } ··· 920 920 struct ktermios old; 921 921 922 922 mutex_lock(&tty->termios_mutex); 923 - old = *tty->termios; 924 - tty->termios->c_cflag &= ~CLOCAL; 925 - tty->termios->c_cflag |= bit; 923 + old = tty->termios; 924 + tty->termios.c_cflag &= ~CLOCAL; 925 + tty->termios.c_cflag |= bit; 926 926 if (tty->ops->set_termios) 927 927 tty->ops->set_termios(tty, &old); 928 - if ((tty->termios->c_cflag & CLOCAL) != bit) 928 + if ((tty->termios.c_cflag & CLOCAL) != bit) 929 929 ret = -EINVAL; 930 930 mutex_unlock(&tty->termios_mutex); 931 931 return ret; ··· 1031 1031 (struct termios __user *) arg)) 1032 1032 return -EFAULT; 1033 1033 mutex_lock(&real_tty->termios_mutex); 1034 - memcpy(real_tty->termios_locked, &kterm, sizeof(struct ktermios)); 1034 + real_tty->termios_locked = kterm; 1035 1035 mutex_unlock(&real_tty->termios_mutex); 1036 1036 return 0; 1037 1037 #else ··· 1048 1048 (struct termios __user *) arg)) 1049 1049 return -EFAULT; 1050 1050 mutex_lock(&real_tty->termios_mutex); 1051 - memcpy(real_tty->termios_locked, &kterm, sizeof(struct ktermios)); 1051 + real_tty->termios_locked = kterm; 1052 1052 mutex_unlock(&real_tty->termios_mutex); 1053 1053 return ret; 1054 1054 #endif
+5 -5
drivers/tty/tty_ldisc.c
··· 413 413 static void tty_set_termios_ldisc(struct tty_struct *tty, int num) 414 414 { 415 415 mutex_lock(&tty->termios_mutex); 416 - tty->termios->c_line = num; 416 + tty->termios.c_line = num; 417 417 mutex_unlock(&tty->termios_mutex); 418 418 } 419 419 ··· 722 722 static void tty_reset_termios(struct tty_struct *tty) 723 723 { 724 724 mutex_lock(&tty->termios_mutex); 725 - *tty->termios = tty->driver->init_termios; 726 - tty->termios->c_ispeed = tty_termios_input_baud_rate(tty->termios); 727 - tty->termios->c_ospeed = tty_termios_baud_rate(tty->termios); 725 + tty->termios = tty->driver->init_termios; 726 + tty->termios.c_ispeed = tty_termios_input_baud_rate(&tty->termios); 727 + tty->termios.c_ospeed = tty_termios_baud_rate(&tty->termios); 728 728 mutex_unlock(&tty->termios_mutex); 729 729 } 730 730 ··· 846 846 847 847 if (reset == 0) { 848 848 849 - if (!tty_ldisc_reinit(tty, tty->termios->c_line)) 849 + if (!tty_ldisc_reinit(tty, tty->termios.c_line)) 850 850 err = tty_ldisc_open(tty, tty->ldisc); 851 851 else 852 852 err = 1;
+3 -3
drivers/tty/tty_port.c
··· 255 255 } 256 256 if (filp->f_flags & O_NONBLOCK) { 257 257 /* Indicate we are open */ 258 - if (tty->termios->c_cflag & CBAUD) 258 + if (tty->termios.c_cflag & CBAUD) 259 259 tty_port_raise_dtr_rts(port); 260 260 port->flags |= ASYNC_NORMAL_ACTIVE; 261 261 return 0; ··· 279 279 280 280 while (1) { 281 281 /* Indicate we are open */ 282 - if (tty->termios->c_cflag & CBAUD) 282 + if (tty->termios.c_cflag & CBAUD) 283 283 tty_port_raise_dtr_rts(port); 284 284 285 285 prepare_to_wait(&port->open_wait, &wait, TASK_INTERRUPTIBLE); ··· 378 378 379 379 /* Drop DTR/RTS if HUPCL is set. This causes any attached modem to 380 380 hang up the line */ 381 - if (tty->termios->c_cflag & HUPCL) 381 + if (tty->termios.c_cflag & HUPCL) 382 382 tty_port_lower_dtr_rts(port); 383 383 384 384 /* Don't call port->drop for the last reference. Callers will want
+2 -2
drivers/tty/vt/vt.c
··· 2823 2823 tty->winsize.ws_col = vc_cons[currcons].d->vc_cols; 2824 2824 } 2825 2825 if (vc->vc_utf) 2826 - tty->termios->c_iflag |= IUTF8; 2826 + tty->termios.c_iflag |= IUTF8; 2827 2827 else 2828 - tty->termios->c_iflag &= ~IUTF8; 2828 + tty->termios.c_iflag &= ~IUTF8; 2829 2829 unlock: 2830 2830 console_unlock(); 2831 2831 return ret;
+1 -1
drivers/usb/class/cdc-acm.c
··· 826 826 struct ktermios *termios_old) 827 827 { 828 828 struct acm *acm = tty->driver_data; 829 - struct ktermios *termios = tty->termios; 829 + struct ktermios *termios = &tty->termios; 830 830 struct usb_cdc_line_coding newline; 831 831 int newctrl = acm->ctrlout; 832 832
+2 -2
drivers/usb/serial/ark3116.c
··· 215 215 216 216 static void ark3116_init_termios(struct tty_struct *tty) 217 217 { 218 - struct ktermios *termios = tty->termios; 218 + struct ktermios *termios = &tty->termios; 219 219 *termios = tty_std_termios; 220 220 termios->c_cflag = B9600 | CS8 221 221 | CREAD | HUPCL | CLOCAL; ··· 229 229 { 230 230 struct usb_serial *serial = port->serial; 231 231 struct ark3116_private *priv = usb_get_serial_port_data(port); 232 - struct ktermios *termios = tty->termios; 232 + struct ktermios *termios = &tty->termios; 233 233 unsigned int cflag = termios->c_cflag; 234 234 int bps = tty_get_baud_rate(tty); 235 235 int quot;
+1 -1
drivers/usb/serial/belkin_sa.c
··· 307 307 unsigned long control_state; 308 308 int bad_flow_control; 309 309 speed_t baud; 310 - struct ktermios *termios = tty->termios; 310 + struct ktermios *termios = &tty->termios; 311 311 312 312 iflag = termios->c_iflag; 313 313 cflag = termios->c_cflag;
+4 -4
drivers/usb/serial/cp210x.c
··· 469 469 470 470 if (tty) { 471 471 cp210x_get_termios_port(tty->driver_data, 472 - &tty->termios->c_cflag, &baud); 472 + &tty->termios.c_cflag, &baud); 473 473 tty_encode_baud_rate(tty, baud, baud); 474 474 } 475 475 ··· 631 631 { 632 632 u32 baud; 633 633 634 - baud = tty->termios->c_ospeed; 634 + baud = tty->termios.c_ospeed; 635 635 636 636 /* This maps the requested rate to a rate valid on cp2102 or cp2103, 637 637 * or to an arbitrary rate in [1M,2M]. ··· 665 665 if (!tty) 666 666 return; 667 667 668 - cflag = tty->termios->c_cflag; 668 + cflag = tty->termios.c_cflag; 669 669 old_cflag = old_termios->c_cflag; 670 670 671 - if (tty->termios->c_ospeed != old_termios->c_ospeed) 671 + if (tty->termios.c_ospeed != old_termios->c_ospeed) 672 672 cp210x_change_speed(tty, port, old_termios); 673 673 674 674 /* If the number of data bits is to be updated */
+20 -20
drivers/usb/serial/cypress_m8.c
··· 922 922 early enough */ 923 923 if (!priv->termios_initialized) { 924 924 if (priv->chiptype == CT_EARTHMATE) { 925 - *(tty->termios) = tty_std_termios; 926 - tty->termios->c_cflag = B4800 | CS8 | CREAD | HUPCL | 925 + tty->termios = tty_std_termios; 926 + tty->termios.c_cflag = B4800 | CS8 | CREAD | HUPCL | 927 927 CLOCAL; 928 - tty->termios->c_ispeed = 4800; 929 - tty->termios->c_ospeed = 4800; 928 + tty->termios.c_ispeed = 4800; 929 + tty->termios.c_ospeed = 4800; 930 930 } else if (priv->chiptype == CT_CYPHIDCOM) { 931 - *(tty->termios) = tty_std_termios; 932 - tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | 931 + tty->termios = tty_std_termios; 932 + tty->termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | 933 933 CLOCAL; 934 - tty->termios->c_ispeed = 9600; 935 - tty->termios->c_ospeed = 9600; 934 + tty->termios.c_ispeed = 9600; 935 + tty->termios.c_ospeed = 9600; 936 936 } else if (priv->chiptype == CT_CA42V2) { 937 - *(tty->termios) = tty_std_termios; 938 - tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | 937 + tty->termios = tty_std_termios; 938 + tty->termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | 939 939 CLOCAL; 940 - tty->termios->c_ispeed = 9600; 941 - tty->termios->c_ospeed = 9600; 940 + tty->termios.c_ispeed = 9600; 941 + tty->termios.c_ospeed = 9600; 942 942 } 943 943 priv->termios_initialized = 1; 944 944 } 945 945 spin_unlock_irqrestore(&priv->lock, flags); 946 946 947 947 /* Unsupported features need clearing */ 948 - tty->termios->c_cflag &= ~(CMSPAR|CRTSCTS); 948 + tty->termios.c_cflag &= ~(CMSPAR|CRTSCTS); 949 949 950 - cflag = tty->termios->c_cflag; 951 - iflag = tty->termios->c_iflag; 950 + cflag = tty->termios.c_cflag; 951 + iflag = tty->termios.c_iflag; 952 952 953 953 /* check if there are new settings */ 954 954 if (old_termios) { 955 955 spin_lock_irqsave(&priv->lock, flags); 956 - priv->tmp_termios = *(tty->termios); 956 + priv->tmp_termios = tty->termios; 957 957 spin_unlock_irqrestore(&priv->lock, flags); 958 958 } 959 959 ··· 1021 1021 "4800bps."); 1022 1022 /* define custom termios settings for NMEA protocol */ 1023 1023 1024 - tty->termios->c_iflag /* input modes - */ 1024 + tty->termios.c_iflag /* input modes - */ 1025 1025 &= ~(IGNBRK /* disable ignore break */ 1026 1026 | BRKINT /* disable break causes interrupt */ 1027 1027 | PARMRK /* disable mark parity errors */ ··· 1031 1031 | ICRNL /* disable translate CR to NL */ 1032 1032 | IXON); /* disable enable XON/XOFF flow control */ 1033 1033 1034 - tty->termios->c_oflag /* output modes */ 1034 + tty->termios.c_oflag /* output modes */ 1035 1035 &= ~OPOST; /* disable postprocess output char */ 1036 1036 1037 - tty->termios->c_lflag /* line discipline modes */ 1037 + tty->termios.c_lflag /* line discipline modes */ 1038 1038 &= ~(ECHO /* disable echo input characters */ 1039 1039 | ECHONL /* disable echo new line */ 1040 1040 | ICANON /* disable erase, kill, werase, and rprnt ··· 1200 1200 1201 1201 /* hangup, as defined in acm.c... this might be a bad place for it 1202 1202 * though */ 1203 - if (tty && !(tty->termios->c_cflag & CLOCAL) && 1203 + if (tty && !(tty->termios.c_cflag & CLOCAL) && 1204 1204 !(priv->current_status & UART_CD)) { 1205 1205 dbg("%s - calling hangup", __func__); 1206 1206 tty_hangup(tty);
+7 -7
drivers/usb/serial/digi_acceleport.c
··· 687 687 struct usb_serial_port *port, struct ktermios *old_termios) 688 688 { 689 689 struct digi_port *priv = usb_get_serial_port_data(port); 690 - unsigned int iflag = tty->termios->c_iflag; 691 - unsigned int cflag = tty->termios->c_cflag; 690 + unsigned int iflag = tty->termios.c_iflag; 691 + unsigned int cflag = tty->termios.c_cflag; 692 692 unsigned int old_iflag = old_termios->c_iflag; 693 693 unsigned int old_cflag = old_termios->c_cflag; 694 694 unsigned char buf[32]; ··· 709 709 /* don't set RTS if using hardware flow control */ 710 710 /* and throttling input */ 711 711 modem_signals = TIOCM_DTR; 712 - if (!(tty->termios->c_cflag & CRTSCTS) || 712 + if (!(tty->termios.c_cflag & CRTSCTS) || 713 713 !test_bit(TTY_THROTTLED, &tty->flags)) 714 714 modem_signals |= TIOCM_RTS; 715 715 digi_set_modem_signals(port, modem_signals, 1); ··· 748 748 } 749 749 } 750 750 /* set parity */ 751 - tty->termios->c_cflag &= ~CMSPAR; 751 + tty->termios.c_cflag &= ~CMSPAR; 752 752 753 753 if ((cflag&(PARENB|PARODD)) != (old_cflag&(PARENB|PARODD))) { 754 754 if (cflag&PARENB) { ··· 1124 1124 1125 1125 /* set termios settings */ 1126 1126 if (tty) { 1127 - not_termios.c_cflag = ~tty->termios->c_cflag; 1128 - not_termios.c_iflag = ~tty->termios->c_iflag; 1127 + not_termios.c_cflag = ~tty->termios.c_cflag; 1128 + not_termios.c_iflag = ~tty->termios.c_iflag; 1129 1129 digi_set_termios(tty, port, &not_termios); 1130 1130 } 1131 1131 return 0; ··· 1500 1500 1501 1501 rts = 0; 1502 1502 if (tty) 1503 - rts = tty->termios->c_cflag & CRTSCTS; 1503 + rts = tty->termios.c_cflag & CRTSCTS; 1504 1504 1505 1505 if (tty && opcode == DIGI_CMD_READ_INPUT_SIGNALS) { 1506 1506 spin_lock(&priv->dp_port_lock);
+1 -1
drivers/usb/serial/empeg.c
··· 87 87 88 88 static void empeg_init_termios(struct tty_struct *tty) 89 89 { 90 - struct ktermios *termios = tty->termios; 90 + struct ktermios *termios = &tty->termios; 91 91 92 92 /* 93 93 * The empeg-car player wants these particular tty settings.
+1 -1
drivers/usb/serial/f81232.c
··· 173 173 /* FIXME - Stubbed out for now */ 174 174 175 175 /* Don't change anything if nothing has changed */ 176 - if (!tty_termios_hw_change(tty->termios, old_termios)) 176 + if (!tty_termios_hw_change(&tty->termios, old_termios)) 177 177 return; 178 178 179 179 /* Do the real work here... */
+1 -1
drivers/usb/serial/ftdi_sio.c
··· 2081 2081 { 2082 2082 struct usb_device *dev = port->serial->dev; 2083 2083 struct ftdi_private *priv = usb_get_serial_port_data(port); 2084 - struct ktermios *termios = tty->termios; 2084 + struct ktermios *termios = &tty->termios; 2085 2085 unsigned int cflag = termios->c_cflag; 2086 2086 __u16 urb_value; /* will hold the new flags */ 2087 2087
+6 -6
drivers/usb/serial/io_edgeport.c
··· 1458 1458 } 1459 1459 1460 1460 /* if we are implementing RTS/CTS, toggle that line */ 1461 - if (tty->termios->c_cflag & CRTSCTS) { 1461 + if (tty->termios.c_cflag & CRTSCTS) { 1462 1462 edge_port->shadowMCR &= ~MCR_RTS; 1463 1463 status = send_cmd_write_uart_register(edge_port, MCR, 1464 1464 edge_port->shadowMCR); ··· 1497 1497 return; 1498 1498 } 1499 1499 /* if we are implementing RTS/CTS, toggle that line */ 1500 - if (tty->termios->c_cflag & CRTSCTS) { 1500 + if (tty->termios.c_cflag & CRTSCTS) { 1501 1501 edge_port->shadowMCR |= MCR_RTS; 1502 1502 send_cmd_write_uart_register(edge_port, MCR, 1503 1503 edge_port->shadowMCR); ··· 1516 1516 struct edgeport_port *edge_port = usb_get_serial_port_data(port); 1517 1517 unsigned int cflag; 1518 1518 1519 - cflag = tty->termios->c_cflag; 1519 + cflag = tty->termios.c_cflag; 1520 1520 dbg("%s - clfag %08x iflag %08x", __func__, 1521 - tty->termios->c_cflag, tty->termios->c_iflag); 1521 + tty->termios.c_cflag, tty->termios.c_iflag); 1522 1522 dbg("%s - old clfag %08x old iflag %08x", __func__, 1523 1523 old_termios->c_cflag, old_termios->c_iflag); 1524 1524 ··· 1987 1987 tty = tty_port_tty_get(&edge_port->port->port); 1988 1988 if (tty) { 1989 1989 change_port_settings(tty, 1990 - edge_port, tty->termios); 1990 + edge_port, &tty->termios); 1991 1991 tty_kref_put(tty); 1992 1992 } 1993 1993 ··· 2570 2570 return; 2571 2571 } 2572 2572 2573 - cflag = tty->termios->c_cflag; 2573 + cflag = tty->termios.c_cflag; 2574 2574 2575 2575 switch (cflag & CSIZE) { 2576 2576 case CS5:
+6 -6
drivers/usb/serial/io_ti.c
··· 1870 1870 1871 1871 /* set up the port settings */ 1872 1872 if (tty) 1873 - edge_set_termios(tty, port, tty->termios); 1873 + edge_set_termios(tty, port, &tty->termios); 1874 1874 1875 1875 /* open up the port */ 1876 1876 ··· 2272 2272 2273 2273 config = kmalloc (sizeof (*config), GFP_KERNEL); 2274 2274 if (!config) { 2275 - *tty->termios = *old_termios; 2275 + tty->termios = *old_termios; 2276 2276 dev_err(&edge_port->port->dev, "%s - out of memory\n", 2277 2277 __func__); 2278 2278 return; 2279 2279 } 2280 2280 2281 - cflag = tty->termios->c_cflag; 2281 + cflag = tty->termios.c_cflag; 2282 2282 2283 2283 config->wFlags = 0; 2284 2284 ··· 2362 2362 } else 2363 2363 dbg("%s - OUTBOUND XON/XOFF is disabled", __func__); 2364 2364 2365 - tty->termios->c_cflag &= ~CMSPAR; 2365 + tty->termios.c_cflag &= ~CMSPAR; 2366 2366 2367 2367 /* Round the baud rate */ 2368 2368 baud = tty_get_baud_rate(tty); ··· 2408 2408 struct edgeport_port *edge_port = usb_get_serial_port_data(port); 2409 2409 unsigned int cflag; 2410 2410 2411 - cflag = tty->termios->c_cflag; 2411 + cflag = tty->termios.c_cflag; 2412 2412 2413 2413 dbg("%s - clfag %08x iflag %08x", __func__, 2414 - tty->termios->c_cflag, tty->termios->c_iflag); 2414 + tty->termios.c_cflag, tty->termios.c_iflag); 2415 2415 dbg("%s - old clfag %08x old iflag %08x", __func__, 2416 2416 old_termios->c_cflag, old_termios->c_iflag); 2417 2417 dbg("%s - port %d", __func__, port->number);
+1 -1
drivers/usb/serial/ir-usb.c
··· 381 381 ir_xbof = ir_xbof_change(xbof) ; 382 382 383 383 /* Only speed changes are supported */ 384 - tty_termios_copy_hw(tty->termios, old_termios); 384 + tty_termios_copy_hw(&tty->termios, old_termios); 385 385 tty_encode_baud_rate(tty, baud, baud); 386 386 387 387 /*
+14 -14
drivers/usb/serial/iuu_phoenix.c
··· 921 921 { 922 922 const u32 supported_mask = CMSPAR|PARENB|PARODD; 923 923 struct iuu_private *priv = usb_get_serial_port_data(port); 924 - unsigned int cflag = tty->termios->c_cflag; 924 + unsigned int cflag = tty->termios.c_cflag; 925 925 int status; 926 926 u32 actual; 927 927 u32 parity; ··· 930 930 u32 newval = cflag & supported_mask; 931 931 932 932 /* Just use the ospeed. ispeed should be the same. */ 933 - baud = tty->termios->c_ospeed; 933 + baud = tty->termios.c_ospeed; 934 934 935 935 dbg("%s - enter c_ospeed or baud=%d", __func__, baud); 936 936 ··· 961 961 * settings back over and then adjust them 962 962 */ 963 963 if (old_termios) 964 - tty_termios_copy_hw(tty->termios, old_termios); 964 + tty_termios_copy_hw(&tty->termios, old_termios); 965 965 if (status != 0) /* Set failed - return old bits */ 966 966 return; 967 967 /* Re-encode speed, parity and csize */ 968 968 tty_encode_baud_rate(tty, baud, baud); 969 - tty->termios->c_cflag &= ~(supported_mask|CSIZE); 970 - tty->termios->c_cflag |= newval | csize; 969 + tty->termios.c_cflag &= ~(supported_mask|CSIZE); 970 + tty->termios.c_cflag |= newval | csize; 971 971 } 972 972 973 973 static void iuu_close(struct usb_serial_port *port) ··· 993 993 994 994 static void iuu_init_termios(struct tty_struct *tty) 995 995 { 996 - *(tty->termios) = tty_std_termios; 997 - tty->termios->c_cflag = CLOCAL | CREAD | CS8 | B9600 996 + tty->termios = tty_std_termios; 997 + tty->termios.c_cflag = CLOCAL | CREAD | CS8 | B9600 998 998 | TIOCM_CTS | CSTOPB | PARENB; 999 - tty->termios->c_ispeed = 9600; 1000 - tty->termios->c_ospeed = 9600; 1001 - tty->termios->c_lflag = 0; 1002 - tty->termios->c_oflag = 0; 1003 - tty->termios->c_iflag = 0; 999 + tty->termios.c_ispeed = 9600; 1000 + tty->termios.c_ospeed = 9600; 1001 + tty->termios.c_lflag = 0; 1002 + tty->termios.c_oflag = 0; 1003 + tty->termios.c_iflag = 0; 1004 1004 } 1005 1005 1006 1006 static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port) ··· 1012 1012 u32 actual; 1013 1013 struct iuu_private *priv = usb_get_serial_port_data(port); 1014 1014 1015 - baud = tty->termios->c_ospeed; 1016 - tty->termios->c_ispeed = baud; 1015 + baud = tty->termios.c_ospeed; 1016 + tty->termios.c_ispeed = baud; 1017 1017 /* Re-encode speed */ 1018 1018 tty_encode_baud_rate(tty, baud, baud); 1019 1019
+3 -3
drivers/usb/serial/keyspan.c
··· 158 158 159 159 p_priv = usb_get_serial_port_data(port); 160 160 d_details = p_priv->device_details; 161 - cflag = tty->termios->c_cflag; 161 + cflag = tty->termios.c_cflag; 162 162 device_port = port->number - port->serial->minor; 163 163 164 164 /* Baud rate calculation takes baud rate as an integer ··· 179 179 p_priv->flow_control = (cflag & CRTSCTS)? flow_cts: flow_none; 180 180 181 181 /* Mark/Space not supported */ 182 - tty->termios->c_cflag &= ~CMSPAR; 182 + tty->termios.c_cflag &= ~CMSPAR; 183 183 184 184 keyspan_send_setup(port, 0); 185 185 } ··· 1089 1089 1090 1090 device_port = port->number - port->serial->minor; 1091 1091 if (tty) { 1092 - cflag = tty->termios->c_cflag; 1092 + cflag = tty->termios.c_cflag; 1093 1093 /* Baud rate calculation takes baud rate as an integer 1094 1094 so other rates can be generated if desired. */ 1095 1095 baud_rate = tty_get_baud_rate(tty);
+2 -2
drivers/usb/serial/keyspan_pda.c
··· 338 338 7[EOMS]1: 10 bit, b0/b7 is parity 339 339 7[EOMS]2: 11 bit, b0/b7 is parity, extra bit always (mark?) 340 340 341 - HW flow control is dictated by the tty->termios->c_cflags & CRTSCTS 341 + HW flow control is dictated by the tty->termios.c_cflags & CRTSCTS 342 342 bit. 343 343 344 344 For now, just do baud. */ ··· 353 353 } 354 354 /* Only speed can change so copy the old h/w parameters 355 355 then encode the new speed */ 356 - tty_termios_copy_hw(tty->termios, old_termios); 356 + tty_termios_copy_hw(&tty->termios, old_termios); 357 357 tty_encode_baud_rate(tty, speed, speed); 358 358 } 359 359
+9 -9
drivers/usb/serial/kl5kusb105.c
··· 311 311 312 312 /* set up termios structure */ 313 313 spin_lock_irqsave(&priv->lock, flags); 314 - priv->termios.c_iflag = tty->termios->c_iflag; 315 - priv->termios.c_oflag = tty->termios->c_oflag; 316 - priv->termios.c_cflag = tty->termios->c_cflag; 317 - priv->termios.c_lflag = tty->termios->c_lflag; 314 + priv->termios.c_iflag = tty->termios.c_iflag; 315 + priv->termios.c_oflag = tty->termios.c_oflag; 316 + priv->termios.c_cflag = tty->termios.c_cflag; 317 + priv->termios.c_lflag = tty->termios.c_lflag; 318 318 for (i = 0; i < NCCS; i++) 319 - priv->termios.c_cc[i] = tty->termios->c_cc[i]; 319 + priv->termios.c_cc[i] = tty->termios.c_cc[i]; 320 320 priv->cfg.pktlen = cfg->pktlen; 321 321 priv->cfg.baudrate = cfg->baudrate; 322 322 priv->cfg.databits = cfg->databits; ··· 445 445 struct ktermios *old_termios) 446 446 { 447 447 struct klsi_105_private *priv = usb_get_serial_port_data(port); 448 - unsigned int iflag = tty->termios->c_iflag; 448 + unsigned int iflag = tty->termios.c_iflag; 449 449 unsigned int old_iflag = old_termios->c_iflag; 450 - unsigned int cflag = tty->termios->c_cflag; 450 + unsigned int cflag = tty->termios.c_cflag; 451 451 unsigned int old_cflag = old_termios->c_cflag; 452 452 struct klsi_105_port_settings *cfg; 453 453 unsigned long flags; ··· 560 560 if ((cflag & (PARENB|PARODD)) != (old_cflag & (PARENB|PARODD)) 561 561 || (cflag & CSTOPB) != (old_cflag & CSTOPB)) { 562 562 /* Not currently supported */ 563 - tty->termios->c_cflag &= ~(PARENB|PARODD|CSTOPB); 563 + tty->termios.c_cflag &= ~(PARENB|PARODD|CSTOPB); 564 564 #if 0 565 565 priv->last_lcr = 0; 566 566 ··· 587 587 || (iflag & IXON) != (old_iflag & IXON) 588 588 || (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) { 589 589 /* Not currently supported */ 590 - tty->termios->c_cflag &= ~CRTSCTS; 590 + tty->termios.c_cflag &= ~CRTSCTS; 591 591 /* Drop DTR/RTS if no flow control otherwise assert */ 592 592 #if 0 593 593 if ((iflag & IXOFF) || (iflag & IXON) || (cflag & CRTSCTS))
+7 -7
drivers/usb/serial/kobil_sct.c
··· 191 191 static void kobil_init_termios(struct tty_struct *tty) 192 192 { 193 193 /* Default to echo off and other sane device settings */ 194 - tty->termios->c_lflag = 0; 195 - tty->termios->c_lflag &= ~(ISIG | ICANON | ECHO | IEXTEN | XCASE); 196 - tty->termios->c_iflag = IGNBRK | IGNPAR | IXOFF; 194 + tty->termios.c_lflag = 0; 195 + tty->termios.c_lflag &= ~(ISIG | ICANON | ECHO | IEXTEN | XCASE); 196 + tty->termios.c_lflag = IGNBRK | IGNPAR | IXOFF; 197 197 /* do NOT translate CR to CR-NL (0x0A -> 0x0A 0x0D) */ 198 - tty->termios->c_oflag &= ~ONLCR; 198 + tty->termios.c_oflag &= ~ONLCR; 199 199 } 200 200 201 201 static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port) ··· 581 581 struct kobil_private *priv; 582 582 int result; 583 583 unsigned short urb_val = 0; 584 - int c_cflag = tty->termios->c_cflag; 584 + int c_cflag = tty->termios.c_cflag; 585 585 speed_t speed; 586 586 587 587 priv = usb_get_serial_port_data(port); 588 588 if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID || 589 589 priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) { 590 590 /* This device doesn't support ioctl calls */ 591 - *tty->termios = *old; 591 + tty->termios = *old; 592 592 return; 593 593 } 594 594 ··· 612 612 urb_val |= SUSBCR_SPASB_EvenParity; 613 613 } else 614 614 urb_val |= SUSBCR_SPASB_NoParity; 615 - tty->termios->c_cflag &= ~CMSPAR; 615 + tty->termios.c_cflag &= ~CMSPAR; 616 616 tty_encode_baud_rate(tty, speed, speed); 617 617 618 618 result = usb_control_msg(port->serial->dev,
+2 -2
drivers/usb/serial/mct_u232.c
··· 454 454 * either. 455 455 */ 456 456 spin_lock_irqsave(&priv->lock, flags); 457 - if (tty && (tty->termios->c_cflag & CBAUD)) 457 + if (tty && (tty->termios.c_cflag & CBAUD)) 458 458 priv->control_state = TIOCM_DTR | TIOCM_RTS; 459 459 else 460 460 priv->control_state = 0; ··· 634 634 { 635 635 struct usb_serial *serial = port->serial; 636 636 struct mct_u232_private *priv = usb_get_serial_port_data(port); 637 - struct ktermios *termios = tty->termios; 637 + struct ktermios *termios = &tty->termios; 638 638 unsigned int cflag = termios->c_cflag; 639 639 unsigned int old_cflag = old_termios->c_cflag; 640 640 unsigned long flags;
+7 -7
drivers/usb/serial/mos7720.c
··· 1349 1349 } 1350 1350 1351 1351 /* if we are implementing RTS/CTS, toggle that line */ 1352 - if (tty->termios->c_cflag & CRTSCTS) { 1352 + if (tty->termios.c_cflag & CRTSCTS) { 1353 1353 mos7720_port->shadowMCR &= ~UART_MCR_RTS; 1354 1354 write_mos_reg(port->serial, port->number - port->serial->minor, 1355 1355 MCR, mos7720_port->shadowMCR); ··· 1383 1383 } 1384 1384 1385 1385 /* if we are implementing RTS/CTS, toggle that line */ 1386 - if (tty->termios->c_cflag & CRTSCTS) { 1386 + if (tty->termios.c_cflag & CRTSCTS) { 1387 1387 mos7720_port->shadowMCR |= UART_MCR_RTS; 1388 1388 write_mos_reg(port->serial, port->number - port->serial->minor, 1389 1389 MCR, mos7720_port->shadowMCR); ··· 1604 1604 lStop = 0x00; /* 1 stop bit */ 1605 1605 lParity = 0x00; /* No parity */ 1606 1606 1607 - cflag = tty->termios->c_cflag; 1608 - iflag = tty->termios->c_iflag; 1607 + cflag = tty->termios.c_cflag; 1608 + iflag = tty->termios.c_iflag; 1609 1609 1610 1610 /* Change the number of bits */ 1611 1611 switch (cflag & CSIZE) { ··· 1753 1753 1754 1754 dbg("%s\n", "setting termios - ASPIRE"); 1755 1755 1756 - cflag = tty->termios->c_cflag; 1756 + cflag = tty->termios.c_cflag; 1757 1757 1758 1758 dbg("%s - cflag %08x iflag %08x", __func__, 1759 - tty->termios->c_cflag, 1760 - RELEVANT_IFLAG(tty->termios->c_iflag)); 1759 + tty->termios.c_cflag, 1760 + RELEVANT_IFLAG(tty->termios.c_iflag)); 1761 1761 1762 1762 dbg("%s - old cflag %08x old iflag %08x", __func__, 1763 1763 old_termios->c_cflag,
+6 -6
drivers/usb/serial/mos7840.c
··· 1649 1649 return; 1650 1650 } 1651 1651 /* if we are implementing RTS/CTS, toggle that line */ 1652 - if (tty->termios->c_cflag & CRTSCTS) { 1652 + if (tty->termios.c_cflag & CRTSCTS) { 1653 1653 mos7840_port->shadowMCR &= ~MCR_RTS; 1654 1654 status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER, 1655 1655 mos7840_port->shadowMCR); ··· 1692 1692 } 1693 1693 1694 1694 /* if we are implementing RTS/CTS, toggle that line */ 1695 - if (tty->termios->c_cflag & CRTSCTS) { 1695 + if (tty->termios.c_cflag & CRTSCTS) { 1696 1696 mos7840_port->shadowMCR |= MCR_RTS; 1697 1697 status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER, 1698 1698 mos7840_port->shadowMCR); ··· 1998 1998 lStop = LCR_STOP_1; 1999 1999 lParity = LCR_PAR_NONE; 2000 2000 2001 - cflag = tty->termios->c_cflag; 2002 - iflag = tty->termios->c_iflag; 2001 + cflag = tty->termios.c_cflag; 2002 + iflag = tty->termios.c_iflag; 2003 2003 2004 2004 /* Change the number of bits */ 2005 2005 if (cflag & CSIZE) { ··· 2159 2159 2160 2160 dbg("%s", "setting termios - "); 2161 2161 2162 - cflag = tty->termios->c_cflag; 2162 + cflag = tty->termios.c_cflag; 2163 2163 2164 2164 dbg("%s - clfag %08x iflag %08x", __func__, 2165 - tty->termios->c_cflag, RELEVANT_IFLAG(tty->termios->c_iflag)); 2165 + tty->termios.c_cflag, RELEVANT_IFLAG(tty->termios.c_iflag)); 2166 2166 dbg("%s - old clfag %08x old iflag %08x", __func__, 2167 2167 old_termios->c_cflag, RELEVANT_IFLAG(old_termios->c_iflag)); 2168 2168 dbg("%s - port %d", __func__, port->number);
+5 -5
drivers/usb/serial/oti6858.c
··· 404 404 405 405 static void oti6858_init_termios(struct tty_struct *tty) 406 406 { 407 - *(tty->termios) = tty_std_termios; 408 - tty->termios->c_cflag = B38400 | CS8 | CREAD | HUPCL | CLOCAL; 409 - tty->termios->c_ispeed = 38400; 410 - tty->termios->c_ospeed = 38400; 407 + tty->termios = tty_std_termios; 408 + tty->termios.c_cflag = B38400 | CS8 | CREAD | HUPCL | CLOCAL; 409 + tty->termios.c_ispeed = 38400; 410 + tty->termios.c_ospeed = 38400; 411 411 } 412 412 413 413 static void oti6858_set_termios(struct tty_struct *tty, ··· 425 425 return; 426 426 } 427 427 428 - cflag = tty->termios->c_cflag; 428 + cflag = tty->termios.c_cflag; 429 429 430 430 spin_lock_irqsave(&priv->lock, flags); 431 431 divisor = priv->pending_setup.divisor;
+3 -3
drivers/usb/serial/pl2303.c
··· 260 260 serial settings even to the same values as before. Thus 261 261 we actually need to filter in this specific case */ 262 262 263 - if (!tty_termios_hw_change(tty->termios, old_termios)) 263 + if (!tty_termios_hw_change(&tty->termios, old_termios)) 264 264 return; 265 265 266 - cflag = tty->termios->c_cflag; 266 + cflag = tty->termios.c_cflag; 267 267 268 268 buf = kzalloc(7, GFP_KERNEL); 269 269 if (!buf) { 270 270 dev_err(&port->dev, "%s - out of memory.\n", __func__); 271 271 /* Report back no change occurred */ 272 - *tty->termios = *old_termios; 272 + tty->termios = *old_termios; 273 273 return; 274 274 } 275 275
+2 -2
drivers/usb/serial/quatech2.c
··· 275 275 { 276 276 struct usb_device *dev = port->serial->dev; 277 277 struct qt2_port_private *port_priv; 278 - struct ktermios *termios = tty->termios; 278 + struct ktermios *termios = &tty->termios; 279 279 u16 baud; 280 280 unsigned int cflag = termios->c_cflag; 281 281 u16 new_lcr = 0; ··· 408 408 port_priv->device_port = (u8) device_port; 409 409 410 410 if (tty) 411 - qt2_set_termios(tty, port, tty->termios); 411 + qt2_set_termios(tty, port, &tty->termios); 412 412 413 413 return 0; 414 414
+1 -1
drivers/usb/serial/sierra.c
··· 385 385 static void sierra_set_termios(struct tty_struct *tty, 386 386 struct usb_serial_port *port, struct ktermios *old_termios) 387 387 { 388 - tty_termios_copy_hw(tty->termios, old_termios); 388 + tty_termios_copy_hw(&tty->termios, old_termios); 389 389 sierra_send_setup(port); 390 390 } 391 391
+6 -6
drivers/usb/serial/spcp8x5.c
··· 316 316 static void spcp8x5_init_termios(struct tty_struct *tty) 317 317 { 318 318 /* for the 1st time call this function */ 319 - *(tty->termios) = tty_std_termios; 320 - tty->termios->c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL; 321 - tty->termios->c_ispeed = 115200; 322 - tty->termios->c_ospeed = 115200; 319 + tty->termios = tty_std_termios; 320 + tty->termios.c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL; 321 + tty->termios.c_ispeed = 115200; 322 + tty->termios.c_ospeed = 115200; 323 323 } 324 324 325 325 /* set the serial param for transfer. we should check if we really need to ··· 330 330 struct usb_serial *serial = port->serial; 331 331 struct spcp8x5_private *priv = usb_get_serial_port_data(port); 332 332 unsigned long flags; 333 - unsigned int cflag = tty->termios->c_cflag; 333 + unsigned int cflag = tty->termios.c_cflag; 334 334 unsigned int old_cflag = old_termios->c_cflag; 335 335 unsigned short uartdata; 336 336 unsigned char buf[2] = {0, 0}; ··· 340 340 341 341 342 342 /* check that they really want us to change something */ 343 - if (!tty_termios_hw_change(tty->termios, old_termios)) 343 + if (!tty_termios_hw_change(&tty->termios, old_termios)) 344 344 return; 345 345 346 346 /* set DTR/RTS active */
+2 -2
drivers/usb/serial/ssu100.c
··· 216 216 struct ktermios *old_termios) 217 217 { 218 218 struct usb_device *dev = port->serial->dev; 219 - struct ktermios *termios = tty->termios; 219 + struct ktermios *termios = &tty->termios; 220 220 u16 baud, divisor, remainder; 221 221 unsigned int cflag = termios->c_cflag; 222 222 u16 urb_value = 0; /* will hold the new flags */ ··· 322 322 dbg("%s - set uart failed", __func__); 323 323 324 324 if (tty) 325 - ssu100_set_termios(tty, port, tty->termios); 325 + ssu100_set_termios(tty, port, &tty->termios); 326 326 327 327 return usb_serial_generic_open(tty, port); 328 328 }
+5 -5
drivers/usb/serial/ti_usb_3410_5052.c
··· 520 520 } 521 521 522 522 if (tty) 523 - ti_set_termios(tty, port, tty->termios); 523 + ti_set_termios(tty, port, &tty->termios); 524 524 525 525 dbg("%s - sending TI_OPEN_PORT", __func__); 526 526 status = ti_command_out_sync(tdev, TI_OPEN_PORT, ··· 562 562 usb_clear_halt(dev, port->read_urb->pipe); 563 563 564 564 if (tty) 565 - ti_set_termios(tty, port, tty->termios); 565 + ti_set_termios(tty, port, &tty->termios); 566 566 567 567 dbg("%s - sending TI_OPEN_PORT (2)", __func__); 568 568 status = ti_command_out_sync(tdev, TI_OPEN_PORT, ··· 831 831 int port_number = port->number - port->serial->minor; 832 832 unsigned int mcr; 833 833 834 - cflag = tty->termios->c_cflag; 835 - iflag = tty->termios->c_iflag; 834 + cflag = tty->termios.c_cflag; 835 + iflag = tty->termios.c_iflag; 836 836 837 837 dbg("%s - cflag %08x, iflag %08x", __func__, cflag, iflag); 838 838 dbg("%s - old clfag %08x, old iflag %08x", __func__, ··· 871 871 } 872 872 873 873 /* CMSPAR isn't supported by this driver */ 874 - tty->termios->c_cflag &= ~CMSPAR; 874 + tty->termios.c_cflag &= ~CMSPAR; 875 875 876 876 if (cflag & PARENB) { 877 877 if (cflag & PARODD) {
+1 -1
drivers/usb/serial/usb-serial.c
··· 423 423 if (port->serial->type->set_termios) 424 424 port->serial->type->set_termios(tty, port, old); 425 425 else 426 - tty_termios_copy_hw(tty->termios, old); 426 + tty_termios_copy_hw(&tty->termios, old); 427 427 } 428 428 429 429 static int serial_break(struct tty_struct *tty, int break_state)
+1 -1
drivers/usb/serial/usb_wwan.c
··· 67 67 struct usb_wwan_intf_private *intfdata = port->serial->private; 68 68 69 69 /* Doesn't support option setting */ 70 - tty_termios_copy_hw(tty->termios, old_termios); 70 + tty_termios_copy_hw(&tty->termios, old_termios); 71 71 72 72 if (intfdata->send_setup) 73 73 intfdata->send_setup(port);
+1 -1
drivers/usb/serial/whiteheat.c
··· 724 724 { 725 725 struct usb_serial_port *port = tty->driver_data; 726 726 struct whiteheat_port_settings port_settings; 727 - unsigned int cflag = tty->termios->c_cflag; 727 + unsigned int cflag = tty->termios.c_cflag; 728 728 729 729 port_settings.port = port->number + 1; 730 730
+22 -22
include/linux/tty.h
··· 103 103 #define TTY_PARITY 3 104 104 #define TTY_OVERRUN 4 105 105 106 - #define INTR_CHAR(tty) ((tty)->termios->c_cc[VINTR]) 107 - #define QUIT_CHAR(tty) ((tty)->termios->c_cc[VQUIT]) 108 - #define ERASE_CHAR(tty) ((tty)->termios->c_cc[VERASE]) 109 - #define KILL_CHAR(tty) ((tty)->termios->c_cc[VKILL]) 110 - #define EOF_CHAR(tty) ((tty)->termios->c_cc[VEOF]) 111 - #define TIME_CHAR(tty) ((tty)->termios->c_cc[VTIME]) 112 - #define MIN_CHAR(tty) ((tty)->termios->c_cc[VMIN]) 113 - #define SWTC_CHAR(tty) ((tty)->termios->c_cc[VSWTC]) 114 - #define START_CHAR(tty) ((tty)->termios->c_cc[VSTART]) 115 - #define STOP_CHAR(tty) ((tty)->termios->c_cc[VSTOP]) 116 - #define SUSP_CHAR(tty) ((tty)->termios->c_cc[VSUSP]) 117 - #define EOL_CHAR(tty) ((tty)->termios->c_cc[VEOL]) 118 - #define REPRINT_CHAR(tty) ((tty)->termios->c_cc[VREPRINT]) 119 - #define DISCARD_CHAR(tty) ((tty)->termios->c_cc[VDISCARD]) 120 - #define WERASE_CHAR(tty) ((tty)->termios->c_cc[VWERASE]) 121 - #define LNEXT_CHAR(tty) ((tty)->termios->c_cc[VLNEXT]) 122 - #define EOL2_CHAR(tty) ((tty)->termios->c_cc[VEOL2]) 106 + #define INTR_CHAR(tty) ((tty)->termios.c_cc[VINTR]) 107 + #define QUIT_CHAR(tty) ((tty)->termios.c_cc[VQUIT]) 108 + #define ERASE_CHAR(tty) ((tty)->termios.c_cc[VERASE]) 109 + #define KILL_CHAR(tty) ((tty)->termios.c_cc[VKILL]) 110 + #define EOF_CHAR(tty) ((tty)->termios.c_cc[VEOF]) 111 + #define TIME_CHAR(tty) ((tty)->termios.c_cc[VTIME]) 112 + #define MIN_CHAR(tty) ((tty)->termios.c_cc[VMIN]) 113 + #define SWTC_CHAR(tty) ((tty)->termios.c_cc[VSWTC]) 114 + #define START_CHAR(tty) ((tty)->termios.c_cc[VSTART]) 115 + #define STOP_CHAR(tty) ((tty)->termios.c_cc[VSTOP]) 116 + #define SUSP_CHAR(tty) ((tty)->termios.c_cc[VSUSP]) 117 + #define EOL_CHAR(tty) ((tty)->termios.c_cc[VEOL]) 118 + #define REPRINT_CHAR(tty) ((tty)->termios.c_cc[VREPRINT]) 119 + #define DISCARD_CHAR(tty) ((tty)->termios.c_cc[VDISCARD]) 120 + #define WERASE_CHAR(tty) ((tty)->termios.c_cc[VWERASE]) 121 + #define LNEXT_CHAR(tty) ((tty)->termios.c_cc[VLNEXT]) 122 + #define EOL2_CHAR(tty) ((tty)->termios.c_cc[VEOL2]) 123 123 124 - #define _I_FLAG(tty, f) ((tty)->termios->c_iflag & (f)) 125 - #define _O_FLAG(tty, f) ((tty)->termios->c_oflag & (f)) 126 - #define _C_FLAG(tty, f) ((tty)->termios->c_cflag & (f)) 127 - #define _L_FLAG(tty, f) ((tty)->termios->c_lflag & (f)) 124 + #define _I_FLAG(tty, f) ((tty)->termios.c_iflag & (f)) 125 + #define _O_FLAG(tty, f) ((tty)->termios.c_oflag & (f)) 126 + #define _C_FLAG(tty, f) ((tty)->termios.c_cflag & (f)) 127 + #define _L_FLAG(tty, f) ((tty)->termios.c_lflag & (f)) 128 128 129 129 #define I_IGNBRK(tty) _I_FLAG((tty), IGNBRK) 130 130 #define I_BRKINT(tty) _I_FLAG((tty), BRKINT) ··· 271 271 struct mutex termios_mutex; 272 272 spinlock_t ctrl_lock; 273 273 /* Termios values are protected by the termios mutex */ 274 - struct ktermios *termios, *termios_locked; 274 + struct ktermios termios, termios_locked; 275 275 struct termiox *termiox; /* May be NULL for unsupported */ 276 276 char name[64]; 277 277 struct pid *pgrp; /* Protected by ctrl lock */
+1 -1
net/bluetooth/rfcomm/tty.c
··· 866 866 867 867 static void rfcomm_tty_set_termios(struct tty_struct *tty, struct ktermios *old) 868 868 { 869 - struct ktermios *new = tty->termios; 869 + struct ktermios *new = &tty->termios; 870 870 int old_baud_rate = tty_termios_baud_rate(old); 871 871 int new_baud_rate = tty_termios_baud_rate(new); 872 872
+6 -6
net/irda/ircomm/ircomm_tty.c
··· 292 292 return 0; 293 293 } 294 294 295 - if (tty->termios->c_cflag & CLOCAL) { 295 + if (tty->termios.c_cflag & CLOCAL) { 296 296 IRDA_DEBUG(1, "%s(), doing CLOCAL!\n", __func__ ); 297 297 do_clocal = 1; 298 298 } ··· 319 319 port->blocked_open++; 320 320 321 321 while (1) { 322 - if (tty->termios->c_cflag & CBAUD) 322 + if (tty->termios.c_cflag & CBAUD) 323 323 tty_port_raise_dtr_rts(port); 324 324 325 325 current->state = TASK_INTERRUPTIBLE; ··· 421 421 * 422 422 * Note this is completely usafe and doesn't work properly 423 423 */ 424 - tty->termios->c_iflag = 0; 425 - tty->termios->c_oflag = 0; 424 + tty->termios.c_iflag = 0; 425 + tty->termios.c_oflag = 0; 426 426 427 427 /* Insert into hash */ 428 428 /* FIXME there is a window from find to here */ ··· 842 842 ircomm_tty_send_xchar(tty, STOP_CHAR(tty)); 843 843 844 844 /* Hardware flow control? */ 845 - if (tty->termios->c_cflag & CRTSCTS) { 845 + if (tty->termios.c_cflag & CRTSCTS) { 846 846 self->settings.dte &= ~IRCOMM_RTS; 847 847 self->settings.dte |= IRCOMM_DELTA_RTS; 848 848 ··· 874 874 } 875 875 876 876 /* Using hardware flow control? */ 877 - if (tty->termios->c_cflag & CRTSCTS) { 877 + if (tty->termios.c_cflag & CRTSCTS) { 878 878 self->settings.dte |= (IRCOMM_RTS|IRCOMM_DELTA_RTS); 879 879 880 880 ircomm_param_request(self, IRCOMM_DTE, TRUE);
+5 -5
net/irda/ircomm/ircomm_tty_ioctl.c
··· 63 63 if (!self->ircomm) 64 64 return; 65 65 66 - cflag = tty->termios->c_cflag; 66 + cflag = tty->termios.c_cflag; 67 67 68 68 /* byte size and parity */ 69 69 switch (cflag & CSIZE) { ··· 149 149 struct ktermios *old_termios) 150 150 { 151 151 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; 152 - unsigned int cflag = tty->termios->c_cflag; 152 + unsigned int cflag = tty->termios.c_cflag; 153 153 154 154 IRDA_DEBUG(2, "%s()\n", __func__ ); 155 155 156 156 if ((cflag == old_termios->c_cflag) && 157 - (RELEVANT_IFLAG(tty->termios->c_iflag) == 157 + (RELEVANT_IFLAG(tty->termios.c_iflag) == 158 158 RELEVANT_IFLAG(old_termios->c_iflag))) 159 159 { 160 160 return; ··· 173 173 if (!(old_termios->c_cflag & CBAUD) && 174 174 (cflag & CBAUD)) { 175 175 self->settings.dte |= IRCOMM_DTR; 176 - if (!(tty->termios->c_cflag & CRTSCTS) || 176 + if (!(tty->termios.c_cflag & CRTSCTS) || 177 177 !test_bit(TTY_THROTTLED, &tty->flags)) { 178 178 self->settings.dte |= IRCOMM_RTS; 179 179 } ··· 182 182 183 183 /* Handle turning off CRTSCTS */ 184 184 if ((old_termios->c_cflag & CRTSCTS) && 185 - !(tty->termios->c_cflag & CRTSCTS)) 185 + !(tty->termios.c_cflag & CRTSCTS)) 186 186 { 187 187 tty->hw_stopped = 0; 188 188 ircomm_tty_start(tty);