Commit adc8d746 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

tty: move the termios object into the tty

This will let us sort out a whole pile of tty related races. The
alternative would be to keep points and refcount the termios objects.
However
1. They are tiny anyway
2. Many devices don't use the stored copies
3. We can remove a pty special case
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6d31a88c
...@@ -338,7 +338,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) ...@@ -338,7 +338,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
{ {
/* Handle turning off CRTSCTS */ /* Handle turning off CRTSCTS */
if ((old_termios->c_cflag & CRTSCTS) && if ((old_termios->c_cflag & CRTSCTS) &&
!(tty->termios->c_cflag & CRTSCTS)) { !(tty->termios.c_cflag & CRTSCTS)) {
tty->hw_stopped = 0; tty->hw_stopped = 0;
} }
} }
......
...@@ -58,7 +58,7 @@ static int ath_wakeup_ar3k(struct tty_struct *tty) ...@@ -58,7 +58,7 @@ static int ath_wakeup_ar3k(struct tty_struct *tty)
return status; return status;
/* Disable Automatic RTSCTS */ /* Disable Automatic RTSCTS */
memcpy(&ktermios, tty->termios, sizeof(ktermios)); ktermios = tty->termios;
ktermios.c_cflag &= ~CRTSCTS; ktermios.c_cflag &= ~CRTSCTS;
tty_set_termios(tty, &ktermios); tty_set_termios(tty, &ktermios);
......
...@@ -446,8 +446,8 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old) ...@@ -446,8 +446,8 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old)
goto out; goto out;
} }
iflag = tty->termios->c_iflag; iflag = tty->termios.c_iflag;
cflag = tty->termios->c_cflag; cflag = tty->termios.c_cflag;
old_cflag = old ? old->c_cflag : cflag; old_cflag = old ? old->c_cflag : cflag;
gig_dbg(DEBUG_IF, "%u: iflag %x cflag %x old %x", gig_dbg(DEBUG_IF, "%u: iflag %x cflag %x old %x",
cs->minor_index, iflag, cflag, old_cflag); cs->minor_index, iflag, cflag, old_cflag);
......
...@@ -1009,15 +1009,15 @@ isdn_tty_change_speed(modem_info *info) ...@@ -1009,15 +1009,15 @@ isdn_tty_change_speed(modem_info *info)
quot; quot;
int i; int i;
if (!port->tty || !port->tty->termios) if (!port->tty)
return; return;
cflag = port->tty->termios->c_cflag; cflag = port->tty->termios.c_cflag;
quot = i = cflag & CBAUD; quot = i = cflag & CBAUD;
if (i & CBAUDEX) { if (i & CBAUDEX) {
i &= ~CBAUDEX; i &= ~CBAUDEX;
if (i < 1 || i > 2) if (i < 1 || i > 2)
port->tty->termios->c_cflag &= ~CBAUDEX; port->tty->termios.c_cflag &= ~CBAUDEX;
else else
i += 15; i += 15;
} }
...@@ -1097,7 +1097,7 @@ isdn_tty_shutdown(modem_info *info) ...@@ -1097,7 +1097,7 @@ isdn_tty_shutdown(modem_info *info)
#endif #endif
isdn_unlock_drivers(); isdn_unlock_drivers();
info->msr &= ~UART_MSR_RI; info->msr &= ~UART_MSR_RI;
if (!info->port.tty || (info->port.tty->termios->c_cflag & HUPCL)) { if (!info->port.tty || (info->port.tty->termios.c_cflag & HUPCL)) {
info->mcr &= ~(UART_MCR_DTR | UART_MCR_RTS); info->mcr &= ~(UART_MCR_DTR | UART_MCR_RTS);
if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) { if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) {
isdn_tty_modem_reset_regs(info, 0); isdn_tty_modem_reset_regs(info, 0);
...@@ -1469,13 +1469,13 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) ...@@ -1469,13 +1469,13 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
if (!old_termios) if (!old_termios)
isdn_tty_change_speed(info); isdn_tty_change_speed(info);
else { else {
if (tty->termios->c_cflag == old_termios->c_cflag && if (tty->termios.c_cflag == old_termios->c_cflag &&
tty->termios->c_ispeed == old_termios->c_ispeed && tty->termios.c_ispeed == old_termios->c_ispeed &&
tty->termios->c_ospeed == old_termios->c_ospeed) tty->termios.c_ospeed == old_termios->c_ospeed)
return; return;
isdn_tty_change_speed(info); isdn_tty_change_speed(info);
if ((old_termios->c_cflag & CRTSCTS) && if ((old_termios->c_cflag & CRTSCTS) &&
!(tty->termios->c_cflag & CRTSCTS)) !(tty->termios.c_cflag & CRTSCTS))
tty->hw_stopped = 0; tty->hw_stopped = 0;
} }
} }
......
...@@ -518,7 +518,7 @@ static void sdio_uart_check_modem_status(struct sdio_uart_port *port) ...@@ -518,7 +518,7 @@ static void sdio_uart_check_modem_status(struct sdio_uart_port *port)
if (status & UART_MSR_DCTS) { if (status & UART_MSR_DCTS) {
port->icount.cts++; port->icount.cts++;
tty = tty_port_tty_get(&port->port); tty = tty_port_tty_get(&port->port);
if (tty && (tty->termios->c_cflag & CRTSCTS)) { if (tty && (tty->termios.c_cflag & CRTSCTS)) {
int cts = (status & UART_MSR_CTS); int cts = (status & UART_MSR_CTS);
if (tty->hw_stopped) { if (tty->hw_stopped) {
if (cts) { if (cts) {
...@@ -671,12 +671,12 @@ static int sdio_uart_activate(struct tty_port *tport, struct tty_struct *tty) ...@@ -671,12 +671,12 @@ static int sdio_uart_activate(struct tty_port *tport, struct tty_struct *tty)
port->ier = UART_IER_RLSI|UART_IER_RDI|UART_IER_RTOIE|UART_IER_UUE; port->ier = UART_IER_RLSI|UART_IER_RDI|UART_IER_RTOIE|UART_IER_UUE;
port->mctrl = TIOCM_OUT2; port->mctrl = TIOCM_OUT2;
sdio_uart_change_speed(port, tty->termios, NULL); sdio_uart_change_speed(port, &tty->termios, NULL);
if (tty->termios->c_cflag & CBAUD) if (tty->termios.c_cflag & CBAUD)
sdio_uart_set_mctrl(port, TIOCM_RTS | TIOCM_DTR); sdio_uart_set_mctrl(port, TIOCM_RTS | TIOCM_DTR);
if (tty->termios->c_cflag & CRTSCTS) if (tty->termios.c_cflag & CRTSCTS)
if (!(sdio_uart_get_mctrl(port) & TIOCM_CTS)) if (!(sdio_uart_get_mctrl(port) & TIOCM_CTS))
tty->hw_stopped = 1; tty->hw_stopped = 1;
...@@ -850,7 +850,7 @@ static void sdio_uart_throttle(struct tty_struct *tty) ...@@ -850,7 +850,7 @@ static void sdio_uart_throttle(struct tty_struct *tty)
{ {
struct sdio_uart_port *port = tty->driver_data; struct sdio_uart_port *port = tty->driver_data;
if (!I_IXOFF(tty) && !(tty->termios->c_cflag & CRTSCTS)) if (!I_IXOFF(tty) && !(tty->termios.c_cflag & CRTSCTS))
return; return;
if (sdio_uart_claim_func(port) != 0) if (sdio_uart_claim_func(port) != 0)
...@@ -861,7 +861,7 @@ static void sdio_uart_throttle(struct tty_struct *tty) ...@@ -861,7 +861,7 @@ static void sdio_uart_throttle(struct tty_struct *tty)
sdio_uart_start_tx(port); sdio_uart_start_tx(port);
} }
if (tty->termios->c_cflag & CRTSCTS) if (tty->termios.c_cflag & CRTSCTS)
sdio_uart_clear_mctrl(port, TIOCM_RTS); sdio_uart_clear_mctrl(port, TIOCM_RTS);
sdio_uart_irq(port->func); sdio_uart_irq(port->func);
...@@ -872,7 +872,7 @@ static void sdio_uart_unthrottle(struct tty_struct *tty) ...@@ -872,7 +872,7 @@ static void sdio_uart_unthrottle(struct tty_struct *tty)
{ {
struct sdio_uart_port *port = tty->driver_data; struct sdio_uart_port *port = tty->driver_data;
if (!I_IXOFF(tty) && !(tty->termios->c_cflag & CRTSCTS)) if (!I_IXOFF(tty) && !(tty->termios.c_cflag & CRTSCTS))
return; return;
if (sdio_uart_claim_func(port) != 0) if (sdio_uart_claim_func(port) != 0)
...@@ -887,7 +887,7 @@ static void sdio_uart_unthrottle(struct tty_struct *tty) ...@@ -887,7 +887,7 @@ static void sdio_uart_unthrottle(struct tty_struct *tty)
} }
} }
if (tty->termios->c_cflag & CRTSCTS) if (tty->termios.c_cflag & CRTSCTS)
sdio_uart_set_mctrl(port, TIOCM_RTS); sdio_uart_set_mctrl(port, TIOCM_RTS);
sdio_uart_irq(port->func); sdio_uart_irq(port->func);
...@@ -898,12 +898,12 @@ static void sdio_uart_set_termios(struct tty_struct *tty, ...@@ -898,12 +898,12 @@ static void sdio_uart_set_termios(struct tty_struct *tty,
struct ktermios *old_termios) struct ktermios *old_termios)
{ {
struct sdio_uart_port *port = tty->driver_data; struct sdio_uart_port *port = tty->driver_data;
unsigned int cflag = tty->termios->c_cflag; unsigned int cflag = tty->termios.c_cflag;
if (sdio_uart_claim_func(port) != 0) if (sdio_uart_claim_func(port) != 0)
return; return;
sdio_uart_change_speed(port, tty->termios, old_termios); sdio_uart_change_speed(port, &tty->termios, old_termios);
/* Handle transition to B0 status */ /* Handle transition to B0 status */
if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD))
......
...@@ -124,8 +124,8 @@ static int irtty_change_speed(struct sir_dev *dev, unsigned speed) ...@@ -124,8 +124,8 @@ static int irtty_change_speed(struct sir_dev *dev, unsigned speed)
tty = priv->tty; tty = priv->tty;
mutex_lock(&tty->termios_mutex); mutex_lock(&tty->termios_mutex);
old_termios = *(tty->termios); old_termios = tty->termios;
cflag = tty->termios->c_cflag; cflag = tty->termios.c_cflag;
tty_encode_baud_rate(tty, speed, speed); tty_encode_baud_rate(tty, speed, speed);
if (tty->ops->set_termios) if (tty->ops->set_termios)
tty->ops->set_termios(tty, &old_termios); tty->ops->set_termios(tty, &old_termios);
...@@ -281,15 +281,15 @@ static inline void irtty_stop_receiver(struct tty_struct *tty, int stop) ...@@ -281,15 +281,15 @@ static inline void irtty_stop_receiver(struct tty_struct *tty, int stop)
int cflag; int cflag;
mutex_lock(&tty->termios_mutex); mutex_lock(&tty->termios_mutex);
old_termios = *(tty->termios); old_termios = tty->termios;
cflag = tty->termios->c_cflag; cflag = tty->termios.c_cflag;
if (stop) if (stop)
cflag &= ~CREAD; cflag &= ~CREAD;
else else
cflag |= CREAD; cflag |= CREAD;
tty->termios->c_cflag = cflag; tty->termios.c_cflag = cflag;
if (tty->ops->set_termios) if (tty->ops->set_termios)
tty->ops->set_termios(tty, &old_termios); tty->ops->set_termios(tty, &old_termios);
mutex_unlock(&tty->termios_mutex); mutex_unlock(&tty->termios_mutex);
......
...@@ -1107,7 +1107,6 @@ static void _hso_serial_set_termios(struct tty_struct *tty, ...@@ -1107,7 +1107,6 @@ static void _hso_serial_set_termios(struct tty_struct *tty,
struct ktermios *old) struct ktermios *old)
{ {
struct hso_serial *serial = tty->driver_data; struct hso_serial *serial = tty->driver_data;
struct ktermios *termios;
if (!serial) { if (!serial) {
printk(KERN_ERR "%s: no tty structures", __func__); printk(KERN_ERR "%s: no tty structures", __func__);
...@@ -1119,16 +1118,15 @@ static void _hso_serial_set_termios(struct tty_struct *tty, ...@@ -1119,16 +1118,15 @@ static void _hso_serial_set_termios(struct tty_struct *tty,
/* /*
* Fix up unsupported bits * Fix up unsupported bits
*/ */
termios = tty->termios; tty->termios.c_iflag &= ~IXON; /* disable enable XON/XOFF flow control */
termios->c_iflag &= ~IXON; /* disable enable XON/XOFF flow control */
termios->c_cflag &= tty->termios.c_cflag &=
~(CSIZE /* no size */ ~(CSIZE /* no size */
| PARENB /* disable parity bit */ | PARENB /* disable parity bit */
| CBAUD /* clear current baud rate */ | CBAUD /* clear current baud rate */
| CBAUDEX); /* clear current buad rate */ | CBAUDEX); /* clear current buad rate */
termios->c_cflag |= CS8; /* character size 8 bits */ tty->termios.c_cflag |= CS8; /* character size 8 bits */
/* baud rate 115200 */ /* baud rate 115200 */
tty_encode_baud_rate(tty, 115200, 115200); 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,14 +1423,14 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)
if (old) if (old)
D5("Termios called with: cflags new[%d] - old[%d]", D5("Termios called with: cflags new[%d] - old[%d]",
tty->termios->c_cflag, old->c_cflag); tty->termios.c_cflag, old->c_cflag);
/* the actual setup */ /* the actual setup */
spin_lock_irqsave(&serial->serial_lock, flags); spin_lock_irqsave(&serial->serial_lock, flags);
if (serial->port.count) if (serial->port.count)
_hso_serial_set_termios(tty, old); _hso_serial_set_termios(tty, old);
else else
tty->termios = old; tty->termios = *old;
spin_unlock_irqrestore(&serial->serial_lock, flags); spin_unlock_irqrestore(&serial->serial_lock, flags);
/* done */ /* done */
......
...@@ -646,7 +646,7 @@ static void shutdown(struct tty_struct *tty, struct serial_state *info) ...@@ -646,7 +646,7 @@ static void shutdown(struct tty_struct *tty, struct serial_state *info)
custom.adkcon = AC_UARTBRK; custom.adkcon = AC_UARTBRK;
mb(); mb();
if (tty->termios->c_cflag & HUPCL) if (tty->termios.c_cflag & HUPCL)
info->MCR &= ~(SER_DTR|SER_RTS); info->MCR &= ~(SER_DTR|SER_RTS);
rtsdtr_ctrl(info->MCR); rtsdtr_ctrl(info->MCR);
...@@ -670,7 +670,7 @@ static void change_speed(struct tty_struct *tty, struct serial_state *info, ...@@ -670,7 +670,7 @@ static void change_speed(struct tty_struct *tty, struct serial_state *info,
int bits; int bits;
unsigned long flags; unsigned long flags;
cflag = tty->termios->c_cflag; cflag = tty->termios.c_cflag;
/* Byte size is always 8 bits plus parity bit if requested */ /* Byte size is always 8 bits plus parity bit if requested */
...@@ -707,8 +707,8 @@ static void change_speed(struct tty_struct *tty, struct serial_state *info, ...@@ -707,8 +707,8 @@ static void change_speed(struct tty_struct *tty, struct serial_state *info,
/* If the quotient is zero refuse the change */ /* If the quotient is zero refuse the change */
if (!quot && old_termios) { if (!quot && old_termios) {
/* FIXME: Will need updating for new tty in the end */ /* FIXME: Will need updating for new tty in the end */
tty->termios->c_cflag &= ~CBAUD; tty->termios.c_cflag &= ~CBAUD;
tty->termios->c_cflag |= (old_termios->c_cflag & CBAUD); tty->termios.c_cflag |= (old_termios->c_cflag & CBAUD);
baud = tty_get_baud_rate(tty); baud = tty_get_baud_rate(tty);
if (!baud) if (!baud)
baud = 9600; baud = 9600;
...@@ -984,7 +984,7 @@ static void rs_throttle(struct tty_struct * tty) ...@@ -984,7 +984,7 @@ static void rs_throttle(struct tty_struct * tty)
if (I_IXOFF(tty)) if (I_IXOFF(tty))
rs_send_xchar(tty, STOP_CHAR(tty)); rs_send_xchar(tty, STOP_CHAR(tty));
if (tty->termios->c_cflag & CRTSCTS) if (tty->termios.c_cflag & CRTSCTS)
info->MCR &= ~SER_RTS; info->MCR &= ~SER_RTS;
local_irq_save(flags); local_irq_save(flags);
...@@ -1012,7 +1012,7 @@ static void rs_unthrottle(struct tty_struct * tty) ...@@ -1012,7 +1012,7 @@ static void rs_unthrottle(struct tty_struct * tty)
else else
rs_send_xchar(tty, START_CHAR(tty)); rs_send_xchar(tty, START_CHAR(tty));
} }
if (tty->termios->c_cflag & CRTSCTS) if (tty->termios.c_cflag & CRTSCTS)
info->MCR |= SER_RTS; info->MCR |= SER_RTS;
local_irq_save(flags); local_irq_save(flags);
rtsdtr_ctrl(info->MCR); rtsdtr_ctrl(info->MCR);
...@@ -1330,7 +1330,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) ...@@ -1330,7 +1330,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
{ {
struct serial_state *info = tty->driver_data; struct serial_state *info = tty->driver_data;
unsigned long flags; unsigned long flags;
unsigned int cflag = tty->termios->c_cflag; unsigned int cflag = tty->termios.c_cflag;
change_speed(tty, info, old_termios); change_speed(tty, info, old_termios);
...@@ -1347,7 +1347,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) ...@@ -1347,7 +1347,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
if (!(old_termios->c_cflag & CBAUD) && if (!(old_termios->c_cflag & CBAUD) &&
(cflag & CBAUD)) { (cflag & CBAUD)) {
info->MCR |= SER_DTR; info->MCR |= SER_DTR;
if (!(tty->termios->c_cflag & CRTSCTS) || if (!(tty->termios.c_cflag & CRTSCTS) ||
!test_bit(TTY_THROTTLED, &tty->flags)) { !test_bit(TTY_THROTTLED, &tty->flags)) {
info->MCR |= SER_RTS; info->MCR |= SER_RTS;
} }
...@@ -1358,7 +1358,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) ...@@ -1358,7 +1358,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
/* Handle turning off CRTSCTS */ /* Handle turning off CRTSCTS */
if ((old_termios->c_cflag & CRTSCTS) && if ((old_termios->c_cflag & CRTSCTS) &&
!(tty->termios->c_cflag & CRTSCTS)) { !(tty->termios.c_cflag & CRTSCTS)) {
tty->hw_stopped = 0; tty->hw_stopped = 0;
rs_start(tty); rs_start(tty);
} }
...@@ -1371,7 +1371,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) ...@@ -1371,7 +1371,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
* or not. Hence, this may change..... * or not. Hence, this may change.....
*/ */
if (!(old_termios->c_cflag & CLOCAL) && if (!(old_termios->c_cflag & CLOCAL) &&
(tty->termios->c_cflag & CLOCAL)) (tty->termios.c_cflag & CLOCAL))
wake_up_interruptible(&info->open_wait); wake_up_interruptible(&info->open_wait);
#endif #endif
} }
......
...@@ -1459,7 +1459,7 @@ static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty) ...@@ -1459,7 +1459,7 @@ static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty)
info->port.xmit_buf = NULL; info->port.xmit_buf = NULL;
free_page((unsigned long)temp); free_page((unsigned long)temp);
} }
if (tty->termios->c_cflag & HUPCL) if (tty->termios.c_cflag & HUPCL)
cyy_change_rts_dtr(info, 0, TIOCM_RTS | TIOCM_DTR); cyy_change_rts_dtr(info, 0, TIOCM_RTS | TIOCM_DTR);
cyy_issue_cmd(info, CyCHAN_CTL | CyDIS_RCVR); 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,7 +1488,7 @@ static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty)
free_page((unsigned long)temp); free_page((unsigned long)temp);
} }
if (tty->termios->c_cflag & HUPCL) if (tty->termios.c_cflag & HUPCL)
tty_port_lower_dtr_rts(&info->port); tty_port_lower_dtr_rts(&info->port);
set_bit(TTY_IO_ERROR, &tty->flags); 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,14 +1999,11 @@ static void cy_set_line_char(struct cyclades_port *info, struct tty_struct *tty)
int baud, baud_rate = 0; int baud, baud_rate = 0;
int i; int i;
if (!tty->termios) /* XXX can this happen at all? */
return;
if (info->line == -1) if (info->line == -1)
return; return;
cflag = tty->termios->c_cflag; cflag = tty->termios.c_cflag;
iflag = tty->termios->c_iflag; iflag = tty->termios.c_iflag;
/* /*
* Set up the tty->alt_speed kludge * 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,7 +2822,7 @@ static void cy_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
cy_set_line_char(info, tty); cy_set_line_char(info, tty);
if ((old_termios->c_cflag & CRTSCTS) && if ((old_termios->c_cflag & CRTSCTS) &&
!(tty->termios->c_cflag & CRTSCTS)) { !(tty->termios.c_cflag & CRTSCTS)) {
tty->hw_stopped = 0; tty->hw_stopped = 0;
cy_start(tty); cy_start(tty);
} }
...@@ -2837,7 +2834,7 @@ static void cy_set_termios(struct tty_struct *tty, struct ktermios *old_termios) ...@@ -2837,7 +2834,7 @@ static void cy_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
* or not. Hence, this may change..... * or not. Hence, this may change.....
*/ */
if (!(old_termios->c_cflag & CLOCAL) && if (!(old_termios->c_cflag & CLOCAL) &&
(tty->termios->c_cflag & CLOCAL)) (tty->termios.c_cflag & CLOCAL))
wake_up_interruptible(&info->port.open_wait); wake_up_interruptible(&info->port.open_wait);
#endif #endif
} /* cy_set_termios */ } /* cy_set_termios */
...@@ -2899,7 +2896,7 @@ static void cy_throttle(struct tty_struct *tty) ...@@ -2899,7 +2896,7 @@ static void cy_throttle(struct tty_struct *tty)
info->throttle = 1; info->throttle = 1;
} }
if (tty->termios->c_cflag & CRTSCTS) { if (tty->termios.c_cflag & CRTSCTS) {
if (!cy_is_Z(card)) { if (!cy_is_Z(card)) {
spin_lock_irqsave(&card->card_lock, flags); spin_lock_irqsave(&card->card_lock, flags);
cyy_change_rts_dtr(info, 0, TIOCM_RTS); cyy_change_rts_dtr(info, 0, TIOCM_RTS);
...@@ -2938,7 +2935,7 @@ static void cy_unthrottle(struct tty_struct *tty) ...@@ -2938,7 +2935,7 @@ static void cy_unthrottle(struct tty_struct *tty)
cy_send_xchar(tty, START_CHAR(tty)); cy_send_xchar(tty, START_CHAR(tty));
} }
if (tty->termios->c_cflag & CRTSCTS) { if (tty->termios.c_cflag & CRTSCTS) {
card = info->card; card = info->card;
if (!cy_is_Z(card)) { if (!cy_is_Z(card)) {
spin_lock_irqsave(&card->card_lock, flags); spin_lock_irqsave(&card->card_lock, flags);
......
...@@ -400,7 +400,7 @@ void hvsilib_close(struct hvsi_priv *pv, struct hvc_struct *hp) ...@@ -400,7 +400,7 @@ void hvsilib_close(struct hvsi_priv *pv, struct hvc_struct *hp)
spin_unlock_irqrestore(&hp->lock, flags); spin_unlock_irqrestore(&hp->lock, flags);
/* Clear our own DTR */ /* Clear our own DTR */
if (!pv->tty || (pv->tty->termios->c_cflag & HUPCL)) if (!pv->tty || (pv->tty->termios.c_cflag & HUPCL))
hvsilib_write_mctrl(pv, 0); hvsilib_write_mctrl(pv, 0);
/* Tear down the connection */ /* Tear down the connection */
......
...@@ -702,7 +702,7 @@ static void isicom_config_port(struct tty_struct *tty) ...@@ -702,7 +702,7 @@ static void isicom_config_port(struct tty_struct *tty)
/* 1,2,3,4 => 57.6, 115.2, 230, 460 kbps resp. */ /* 1,2,3,4 => 57.6, 115.2, 230, 460 kbps resp. */
if (baud < 1 || baud > 4) if (baud < 1 || baud > 4)
tty->termios->c_cflag &= ~CBAUDEX; tty->termios.c_cflag &= ~CBAUDEX;
else else
baud += 15; baud += 15;
} }
...@@ -1196,8 +1196,8 @@ static void isicom_set_termios(struct tty_struct *tty, ...@@ -1196,8 +1196,8 @@ static void isicom_set_termios(struct tty_struct *tty,
if (isicom_paranoia_check(port, tty->name, "isicom_set_termios")) if (isicom_paranoia_check(port, tty->name, "isicom_set_termios"))
return; return;
if (tty->termios->c_cflag == old_termios->c_cflag && if (tty->termios.c_cflag == old_termios->c_cflag &&
tty->termios->c_iflag == old_termios->c_iflag) tty->termios.c_iflag == old_termios->c_iflag)
return; return;
spin_lock_irqsave(&port->card->card_lock, flags); spin_lock_irqsave(&port->card->card_lock, flags);
...@@ -1205,7 +1205,7 @@ static void isicom_set_termios(struct tty_struct *tty, ...@@ -1205,7 +1205,7 @@ static void isicom_set_termios(struct tty_struct *tty,
spin_unlock_irqrestore(&port->card->card_lock, flags); spin_unlock_irqrestore(&port->card->card_lock, flags);
if ((old_termios->c_cflag & CRTSCTS) && if ((old_termios->c_cflag & CRTSCTS) &&
!(tty->termios->c_cflag & CRTSCTS)) { !(tty->termios.c_cflag & CRTSCTS)) {
tty->hw_stopped = 0; tty->hw_stopped = 0;
isicom_start(tty); isicom_start(tty);
} }
......
...@@ -367,10 +367,10 @@ static int moxa_ioctl(struct tty_struct *tty, ...@@ -367,10 +367,10 @@ static int moxa_ioctl(struct tty_struct *tty,
tmp.dcd = 1; tmp.dcd = 1;
ttyp = tty_port_tty_get(&p->port); ttyp = tty_port_tty_get(&p->port);
if (!ttyp || !ttyp->termios) if (!ttyp)
tmp.cflag = p->cflag; tmp.cflag = p->cflag;
else else
tmp.cflag = ttyp->termios->c_cflag; tmp.cflag = ttyp->termios.c_cflag;
tty_kref_put(ttyp); tty_kref_put(ttyp);
copy: copy:
if (copy_to_user(argm, &tmp, sizeof(tmp))) if (copy_to_user(argm, &tmp, sizeof(tmp)))
...@@ -1178,7 +1178,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp) ...@@ -1178,7 +1178,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
mutex_lock(&ch->port.mutex); mutex_lock(&ch->port.mutex);
if (!(ch->port.flags & ASYNC_INITIALIZED)) { if (!(ch->port.flags & ASYNC_INITIALIZED)) {
ch->statusflags = 0; ch->statusflags = 0;
moxa_set_tty_param(tty, tty->termios); moxa_set_tty_param(tty, &tty->termios);
MoxaPortLineCtrl(ch, 1, 1); MoxaPortLineCtrl(ch, 1, 1);
MoxaPortEnable(ch); MoxaPortEnable(ch);
MoxaSetFifo(ch, ch->type == PORT_16550A); MoxaSetFifo(ch, ch->type == PORT_16550A);
...@@ -1193,7 +1193,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp) ...@@ -1193,7 +1193,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
static void moxa_close(struct tty_struct *tty, struct file *filp) static void moxa_close(struct tty_struct *tty, struct file *filp)
{ {
struct moxa_port *ch = tty->driver_data; struct moxa_port *ch = tty->driver_data;
ch->cflag = tty->termios->c_cflag; ch->cflag = tty->termios.c_cflag;
tty_port_close(&ch->port, tty, filp); tty_port_close(&ch->port, tty, filp);
} }
...@@ -1464,7 +1464,7 @@ static void moxa_poll(unsigned long ignored) ...@@ -1464,7 +1464,7 @@ static void moxa_poll(unsigned long ignored)
static void moxa_set_tty_param(struct tty_struct *tty, struct ktermios *old_termios) static void moxa_set_tty_param(struct tty_struct *tty, struct ktermios *old_termios)
{ {
register struct ktermios *ts = tty->termios; register struct ktermios *ts = &tty->termios;
struct moxa_port *ch = tty->driver_data; struct moxa_port *ch = tty->driver_data;
int rts, cts, txflow, rxflow, xany, baud; int rts, cts, txflow, rxflow, xany, baud;
......
...@@ -643,7 +643,7 @@ static int mxser_change_speed(struct tty_struct *tty, ...@@ -643,7 +643,7 @@ static int mxser_change_speed(struct tty_struct *tty,
int ret = 0; int ret = 0;
unsigned char status; unsigned char status;
cflag = tty->termios->c_cflag; cflag =