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