tty: tty_struct dependency clean-ups
Subsystems (18)
cover tty: tty_struct dependency clean-ups
This patch series removes or prepares to remove some of the dependencies on tty_struct within tty_port drivers. This will allow using tty_ports directly for so called UART slave devices.
The first patch fixes a regression from the last round with tty closing. Patches 2-4 are mechanical conversions generated with coccinelle. This is my first adventure into coccinelle, so hopefully I didn't screw things up. :) Only serial_core has some of its tty_struct dependencies removed as those are the drivers we immediately care about supporting slave devices with.
Next up after this are moving some functions to the tty_port ops. I've got some WIP patches for some of that, but nothing ready to send out quite yet.
Rob
Rob Herring (9):
tty: serial_core: add tty NULL check to uart_tx_stopped
tty: remove tty_struct dependency in tty flag macros
tty: move hw_stopped flag to tty_port
tty: move TTY_IO_ERROR flag to tty_port iflags
tty: serial_core: use tty_port_tty_wakeup instead of tty_wakeup
tty: serial_core: introduce tty_port_to_uart_state
tty: serial_core: convert private functions to use tty_port instead of
tty_struct
tty: serial_core: remove dependence on tty->driver_data
tty: serial_core: add tty NULL check in uart_port_startup
arch/ia64/hp/sim/simserial.c | 8 +- drivers/char/pcmcia/synclink_cs.c | 50 +++---- drivers/dma/at_xdmac.c | 4 +- drivers/isdn/i4l/isdn_tty.c | 12 +- drivers/mmc/card/sdio_uart.c | 40 +++--- drivers/net/ppp/ppp_async.c | 6 +- drivers/s390/char/ctrlchar.c | 6 +- drivers/s390/char/tty3270.c | 4 +- drivers/staging/dgnc/dgnc_cls.c | 4 +- drivers/staging/dgnc/dgnc_neo.c | 4 +- drivers/staging/dgnc/dgnc_tty.c | 6 +- drivers/staging/fwserial/fwserial.c | 56 ++++---- drivers/tty/amiserial.c | 74 +++++----- drivers/tty/cyclades.c | 54 +++---- drivers/tty/hvc/hvc_console.c | 4 +- drivers/tty/hvc/hvsi.c | 2 +- drivers/tty/isicom.c | 41 +++--- drivers/tty/moxa.c | 4 +- drivers/tty/mxser.c | 72 +++++----- drivers/tty/n_gsm.c | 8 +- drivers/tty/n_tty.c | 259 +++++++++++++++++----------------- drivers/tty/pty.c | 14 +- drivers/tty/rocket.c | 36 ++--- drivers/tty/serial/bfin_uart.c | 6 +- drivers/tty/serial/crisv10.c | 32 +++-- drivers/tty/serial/etraxfs-uart.c | 2 +- drivers/tty/serial/ioc4_serial.c | 2 +- drivers/tty/serial/jsm/jsm_cls.c | 2 +- drivers/tty/serial/jsm/jsm_neo.c | 2 +- drivers/tty/serial/jsm/jsm_tty.c | 4 +- drivers/tty/serial/serial_core.c | 152 ++++++++++---------- drivers/tty/synclink.c | 56 ++++---- drivers/tty/synclink_gt.c | 52 +++---- drivers/tty/synclinkmp.c | 54 +++---- drivers/tty/tty_audit.c | 4 +- drivers/tty/tty_ioctl.c | 22 +-- drivers/tty/tty_port.c | 16 +-- drivers/tty/vt/keyboard.c | 2 +- drivers/usb/class/cdc-acm.c | 2 +- drivers/usb/serial/ark3116.c | 2 +- drivers/usb/serial/cypress_m8.c | 2 +- drivers/usb/serial/digi_acceleport.c | 4 +- drivers/usb/serial/f81232.c | 12 +- drivers/usb/serial/ftdi_sio.c | 2 +- drivers/usb/serial/generic.c | 2 +- drivers/usb/serial/io_edgeport.c | 22 +-- drivers/usb/serial/io_ti.c | 22 +-- drivers/usb/serial/mct_u232.c | 8 +- drivers/usb/serial/mos7720.c | 12 +- drivers/usb/serial/mos7840.c | 12 +- drivers/usb/serial/mxuport.c | 26 ++-- drivers/usb/serial/pl2303.c | 18 +-- drivers/usb/serial/quatech2.c | 4 +- drivers/usb/serial/ssu100.c | 4 +- drivers/usb/serial/ti_usb_3410_5052.c | 16 +-- drivers/usb/serial/whiteheat.c | 6 +- include/linux/serial_core.h | 2 +- include/linux/tty.h | 171 +++++++++++----------- net/bluetooth/rfcomm/tty.c | 2 +- net/irda/ircomm/ircomm_tty.c | 40 +++--- net/irda/ircomm/ircomm_tty_attach.c | 6 +- net/irda/ircomm/ircomm_tty_ioctl.c | 6 +- 62 files changed, 795 insertions(+), 784 deletions(-)
Signature · 1 line
2.9.3
PATCH 1/9 tty: serial_core: add tty NULL check to uart_tx_stopped
Commit 761ed4a94582 ("tty: serial_core: convert uart_close to use tty_port_close") created a case where a port used for a console does not get shutdown on tty closing. Then a call to uart_tx_stopped() segfaults because the tty is NULL. This could be fixed to restore old behavior, but we also want to allow tty_ports to work without a tty attached. So this change to allow a NULL tty_struct is needed either way.
--- include/linux/serial_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/serial_core.h +1 -1
@@ -412,7 +412,7 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port);static inline int uart_tx_stopped (struct uart_port *port) {struct tty_struct *tty = port->state->port.tty; -if (tty->stopped || port->hw_stopped) +if ((tty && tty->stopped) || port->hw_stopped)return 1 ;return 0 ; }
Signature · 1 line
2.9.3
PATCH 2/9 tty: remove tty_struct dependency in tty flag macros
In reply to Rob HerringIn preparation to support tty drivers having only a tty_port and possibly not a tty_struct, convert all the termios flag macros to take a termios ptr instead of the tty_struct ptr. After this change drivers can be converted to support a termios struct other than tty->termios.
Yes, this is a big, treewide change, but it is mostly contained to drivers/tty and drivers/usb/serial. I don't see another way to do it other than defining a new set of macros.
Converted with the following coccinelle script:
@@
expression tty;
identifier x =~ "(I_IGNBRK|I_BRKINT|I_IGNPAR|I_PARMRK|I_INPCK|\
I_ISTRIP|I_INLCR|I_IGNCR|I_ICRNL|I_IUCLC|I_IXON|I_IXANY|I_IXOFF|\
I_IMAXBEL|I_IUTF8|O_OPOST|O_OLCUC|O_ONLCR|O_OCRNL|O_ONOCR|O_ONLRET|\
O_OFILL|O_OFDEL|O_NLDLY|O_CRDLY|O_TABDLY|O_BSDLY|O_VTDLY|O_FFDLY|\ C_BAUD|C_CSIZE|C_CSTOPB|C_CREAD|C_PARENB|C_PARODD|C_HUPCL|C_CLOCAL|\ C_CIBAUD|C_CRTSCTS|C_CMSPAR|L_ISIG|L_ICANON|L_XCASE|L_ECHO|L_ECHOE|\ L_ECHOK|L_ECHONL|L_NOFLSH|L_TOSTOP|L_ECHOCTL|L_ECHOPRT|L_ECHOKE|\ L_FLUSHO|L_PENDIN|L_IEXTEN|L_EXTPROC|INTR_CHAR|QUIT_CHAR|ERASE_CHAR|\ KILL_CHAR|EOF_CHAR|TIME_CHAR|MIN_CHAR|SWTC_CHAR|START_CHAR|STOP_CHAR|\ SUSP_CHAR|EOL_CHAR|REPRINT_CHAR|DISCARD_CHAR|WERASE_CHAR|LNEXT_CHAR|\
EOL2_CHAR)";
@@
- x(tty)
+ x(&tty->termios)
@@
expression tty;
expression flag;
identifier x =~ "_(I|O|C|L)_FLAG";
@@
- x(tty, flag)
+ x(&tty->termios, flag)
--- arch/ia64/hp/sim/simserial.c | 8 +- drivers/char/pcmcia/synclink_cs.c | 28 ++-- drivers/dma/at_xdmac.c | 4 +- drivers/isdn/i4l/isdn_tty.c | 8 +- drivers/mmc/card/sdio_uart.c | 22 +-- drivers/net/ppp/ppp_async.c | 6 +- drivers/s390/char/ctrlchar.c | 6 +- drivers/s390/char/tty3270.c | 4 +- drivers/staging/dgnc/dgnc_cls.c | 4 +- drivers/staging/dgnc/dgnc_neo.c | 4 +- drivers/staging/dgnc/dgnc_tty.c | 6 +- drivers/staging/fwserial/fwserial.c | 32 ++--- drivers/tty/amiserial.c | 30 ++-- drivers/tty/cyclades.c | 28 ++-- drivers/tty/hvc/hvc_console.c | 4 +- drivers/tty/hvc/hvsi.c | 2 +- drivers/tty/isicom.c | 27 ++-- drivers/tty/moxa.c | 4 +- drivers/tty/mxser.c | 38 ++--- drivers/tty/n_gsm.c | 8 +- drivers/tty/n_tty.c | 259 +++++++++++++++++----------------- drivers/tty/pty.c | 8 +- drivers/tty/rocket.c | 36 ++--- drivers/tty/serial/crisv10.c | 28 ++-- drivers/tty/serial/etraxfs-uart.c | 2 +- drivers/tty/serial/jsm/jsm_cls.c | 2 +- drivers/tty/serial/jsm/jsm_neo.c | 2 +- drivers/tty/serial/jsm/jsm_tty.c | 4 +- drivers/tty/serial/serial_core.c | 16 +-- drivers/tty/synclink.c | 34 ++--- drivers/tty/synclink_gt.c | 34 ++--- drivers/tty/synclinkmp.c | 34 ++--- drivers/tty/tty_audit.c | 4 +- drivers/tty/tty_ioctl.c | 22 +-- drivers/tty/tty_port.c | 10 +- drivers/tty/vt/keyboard.c | 2 +- drivers/usb/class/cdc-acm.c | 2 +- drivers/usb/serial/ark3116.c | 2 +- drivers/usb/serial/cypress_m8.c | 2 +- drivers/usb/serial/digi_acceleport.c | 4 +- drivers/usb/serial/f81232.c | 12 +- drivers/usb/serial/ftdi_sio.c | 2 +- drivers/usb/serial/generic.c | 2 +- drivers/usb/serial/io_edgeport.c | 22 +-- drivers/usb/serial/io_ti.c | 22 +-- drivers/usb/serial/mct_u232.c | 8 +- drivers/usb/serial/mos7720.c | 12 +- drivers/usb/serial/mos7840.c | 12 +- drivers/usb/serial/mxuport.c | 26 ++-- drivers/usb/serial/pl2303.c | 18 +-- drivers/usb/serial/quatech2.c | 4 +- drivers/usb/serial/ssu100.c | 4 +- drivers/usb/serial/ti_usb_3410_5052.c | 16 +-- drivers/usb/serial/whiteheat.c | 6 +- include/linux/tty.h | 164 ++++++++++----------- net/irda/ircomm/ircomm_tty.c | 18 +-- net/irda/ircomm/ircomm_tty_ioctl.c | 4 +- 57 files changed, 571 insertions(+), 561 deletions(-)
arch/ia64/hp/sim/simserial.c +4 -4
@@ -276,8 +276,8 @@ static void rs_send_xchar(struct tty_struct *tty, char ch)*/ static void rs_throttle (struct tty_struct * tty) { -if (I_IXOFF (tty)) -rs_send_xchar (tty,STOP_CHAR (tty)); +if (I_IXOFF (&tty->termios)) +rs_send_xchar (tty,STOP_CHAR (&tty->termios));printk (KERN_INFO "simrs_throttle called\n" ); }
@@ -286,11 +286,11 @@ static void rs_unthrottle(struct tty_struct * tty) {struct serial_state *info = tty->driver_data; -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {if (info->x_char) info->x_char =0 ;else -rs_send_xchar (tty,START_CHAR (tty)); +rs_send_xchar (tty,START_CHAR (&tty->termios)); }printk (KERN_INFO "simrs_unthrottle called\n" ); }
drivers/char/pcmcia/synclink_cs.c +14 -14
@@ -1349,7 +1349,7 @@ static void shutdown(MGSLPC_INFO * info, struct tty_struct *tty)/* TODO:disable interrupts instead of reset to preserve signal states */ reset_device (info); -if (!tty ||C_HUPCL (tty)) { +if (!tty ||C_HUPCL (&tty->termios)) { info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);set_signals (info); }
@@ -1390,7 +1390,7 @@ static void mgslpc_program_hw(MGSLPC_INFO *info, struct tty_struct *tty)port_irq_enable (info, (unsigned char )PVR_DSR |PVR_RI );get_signals (info); -if (info->netcount || (tty &&C_CREAD (tty))) +if (info->netcount || (tty &&C_CREAD (&tty->termios)))rx_start (info);spin_unlock_irqrestore (&info->lock, flags);
@@ -1472,9 +1472,9 @@ static void mgslpc_change_params(MGSLPC_INFO *info, struct tty_struct *tty)/* process tty input control flags */ info->read_status_mask =0 ; -if (I_INPCK (tty)) +if (I_INPCK (&tty->termios)) info->read_status_mask |=BIT7 |BIT6 ; -if (I_IGNPAR (tty)) +if (I_IGNPAR (&tty->termios)) info->ignore_status_mask |=BIT7 |BIT6 ;mgslpc_program_hw (info, tty);
@@ -1723,10 +1723,10 @@ static void mgslpc_throttle(struct tty_struct * tty)if (mgslpc_paranoia_check (info, tty->name,"mgslpc_throttle" ))return ; -if (I_IXOFF (tty)) -mgslpc_send_xchar (tty,STOP_CHAR (tty)); +if (I_IXOFF (&tty->termios)) +mgslpc_send_xchar (tty,STOP_CHAR (&tty->termios)); -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) {spin_lock_irqsave (&info->lock, flags); info->serial_signals &= ~SerialSignal_RTS;set_signals (info);
@@ -1748,14 +1748,14 @@ static void mgslpc_unthrottle(struct tty_struct * tty)if (mgslpc_paranoia_check (info, tty->name,"mgslpc_unthrottle" ))return ; -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {if (info->x_char) info->x_char =0 ;else -mgslpc_send_xchar (tty,START_CHAR (tty)); +mgslpc_send_xchar (tty,START_CHAR (&tty->termios)); } -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) {spin_lock_irqsave (&info->lock, flags); info->serial_signals |= SerialSignal_RTS;set_signals (info);
@@ -2299,7 +2299,7 @@ static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_termmgslpc_change_params (info, tty);/* Handle transition to B0 status */ -if ((old_termios->c_cflag &CBAUD ) && !C_BAUD (tty)) { +if ((old_termios->c_cflag &CBAUD ) && !C_BAUD (&tty->termios)) { info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);spin_lock_irqsave (&info->lock, flags);set_signals (info);
@@ -2307,9 +2307,9 @@ static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_term }/* Handle transition away from B0 status */ -if (!(old_termios->c_cflag &CBAUD ) &&C_BAUD (tty)) { +if (!(old_termios->c_cflag &CBAUD ) &&C_BAUD (&tty->termios)) { info->serial_signals |= SerialSignal_DTR; -if (!C_CRTSCTS (tty) || !tty_throttled (tty)) +if (!C_CRTSCTS (&tty->termios) || !tty_throttled (tty)) info->serial_signals |= SerialSignal_RTS;spin_lock_irqsave (&info->lock, flags);set_signals (info);
@@ -2317,7 +2317,7 @@ static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_term }/* Handle turning off CRTSCTS */ -if (old_termios->c_cflag &CRTSCTS && !C_CRTSCTS (tty)) { +if (old_termios->c_cflag &CRTSCTS && !C_CRTSCTS (&tty->termios)) { tty->hw_stopped =0 ;tx_release (tty); }
drivers/dma/at_xdmac.c +2 -2
@@ -560,7 +560,7 @@ static int at_xdmac_compute_chan_conf(struct dma_chan *chan,dev_err (chan2dev (chan),"invalid src maxburst value\n" );return -EINVAL ; } - atchan->cfg |=AT_XDMAC_CC_CSIZE (csize); + atchan->cfg |=AT_XDMAC_CC_CSIZE (&csize->termios); dwidth =ffs (atchan->sconfig.src_addr_width) -1 ;if (dwidth <0 ) {dev_err (chan2dev (chan),"invalid src addr width value\n" );
@@ -583,7 +583,7 @@ static int at_xdmac_compute_chan_conf(struct dma_chan *chan,dev_err (chan2dev (chan),"invalid src maxburst value\n" );return -EINVAL ; } - atchan->cfg |=AT_XDMAC_CC_CSIZE (csize); + atchan->cfg |=AT_XDMAC_CC_CSIZE (&csize->termios); dwidth =ffs (atchan->sconfig.dst_addr_width) -1 ;if (dwidth <0 ) {dev_err (chan2dev (chan),"invalid dst addr width value\n" );
drivers/isdn/i4l/isdn_tty.c +4 -4
@@ -1290,8 +1290,8 @@ isdn_tty_throttle(struct tty_struct *tty)if (isdn_tty_paranoia_check (info, tty->name,"isdn_tty_throttle" ))return ; -if (I_IXOFF (tty)) - info->x_char =STOP_CHAR (tty); +if (I_IXOFF (&tty->termios)) + info->x_char =STOP_CHAR (&tty->termios); info->mcr &= ~UART_MCR_RTS ; }
@@ -1302,11 +1302,11 @@ isdn_tty_unthrottle(struct tty_struct *tty)if (isdn_tty_paranoia_check (info, tty->name,"isdn_tty_unthrottle" ))return ; -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {if (info->x_char) info->x_char =0 ;else - info->x_char =START_CHAR (tty); + info->x_char =START_CHAR (&tty->termios); } info->mcr |=UART_MCR_RTS ; }
drivers/mmc/card/sdio_uart.c +11 -11
@@ -493,7 +493,7 @@ static void sdio_uart_check_modem_status(struct sdio_uart_port *port)if (status &UART_MSR_DCTS ) { port->icount.cts++; tty =tty_port_tty_get (&port->port); -if (tty &&C_CRTSCTS (tty)) { +if (tty &&C_CRTSCTS (&tty->termios)) {int cts = (status &UART_MSR_CTS );if (tty->hw_stopped) {if (cts) {
@@ -648,10 +648,10 @@ static int sdio_uart_activate(struct tty_port *tport, struct tty_struct *tty)sdio_uart_change_speed (port, &tty->termios,NULL ); -if (C_BAUD (tty)) +if (C_BAUD (&tty->termios))sdio_uart_set_mctrl (port,TIOCM_RTS |TIOCM_DTR ); -if (C_CRTSCTS (tty)) +if (C_CRTSCTS (&tty->termios))if (!(sdio_uart_get_mctrl (port) &TIOCM_CTS )) tty->hw_stopped =1 ;
@@ -833,18 +833,18 @@ static void sdio_uart_throttle(struct tty_struct *tty) {struct sdio_uart_port *port = tty->driver_data; -if (!I_IXOFF (tty) && !C_CRTSCTS (tty)) +if (!I_IXOFF (&tty->termios) && !C_CRTSCTS (&tty->termios))return ;if (sdio_uart_claim_func (port) !=0 )return ; -if (I_IXOFF (tty)) { - port->x_char =STOP_CHAR (tty); +if (I_IXOFF (&tty->termios)) { + port->x_char =STOP_CHAR (&tty->termios);sdio_uart_start_tx (port); } -if (C_CRTSCTS (tty)) +if (C_CRTSCTS (&tty->termios))sdio_uart_clear_mctrl (port,TIOCM_RTS );sdio_uart_irq (port->func);
@@ -855,22 +855,22 @@ static void sdio_uart_unthrottle(struct tty_struct *tty) {struct sdio_uart_port *port = tty->driver_data; -if (!I_IXOFF (tty) && !C_CRTSCTS (tty)) +if (!I_IXOFF (&tty->termios) && !C_CRTSCTS (&tty->termios))return ;if (sdio_uart_claim_func (port) !=0 )return ; -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {if (port->x_char) { port->x_char =0 ; }else { - port->x_char =START_CHAR (tty); + port->x_char =START_CHAR (&tty->termios);sdio_uart_start_tx (port); } } -if (C_CRTSCTS (tty)) +if (C_CRTSCTS (&tty->termios))sdio_uart_set_mctrl (port,TIOCM_RTS );sdio_uart_irq (port->func);
drivers/net/ppp/ppp_async.c +3 -3
@@ -913,10 +913,10 @@ ppp_async_input(struct asyncppp *ap, const unsigned char *buf,process_input_packet (ap); }else if (c ==PPP_ESCAPE ) { ap->state |=SC_ESCAPE ; - }else if (I_IXON (ap->tty)) { -if (c ==START_CHAR (ap->tty)) + }else if (I_IXON (&ap->tty->termios)) { +if (c ==START_CHAR (&ap->tty->termios))start_tty (ap->tty); -else if (c ==STOP_CHAR (ap->tty)) +else if (c ==STOP_CHAR (&ap->tty->termios))stop_tty (ap->tty); }/* otherwise it's a char in the recv ACCM */
drivers/s390/char/ctrlchar.c +3 -3
@@ -68,11 +68,11 @@ ctrlchar_handle(const unsigned char *buf, int len, struct tty_struct *tty)switch (tolower (buf[1 ])) {case 'c' : -return INTR_CHAR (tty) |CTRLCHAR_CTRL ; +return INTR_CHAR (&tty->termios) |CTRLCHAR_CTRL ;case 'd' : -return EOF_CHAR (tty) |CTRLCHAR_CTRL ; +return EOF_CHAR (&tty->termios) |CTRLCHAR_CTRL ;case 'z' : -return SUSP_CHAR (tty) |CTRLCHAR_CTRL ; +return SUSP_CHAR (&tty->termios) |CTRLCHAR_CTRL ; }return CTRLCHAR_NONE ; }
drivers/s390/char/tty3270.c +2 -2
@@ -1782,8 +1782,8 @@ tty3270_set_termios(struct tty_struct *tty, struct ktermios *old)if (!tp)return ;spin_lock_bh (&tp->view.lock); -if (L_ICANON (tty)) { - new =L_ECHO (tty) ?TF_INPUT :TF_INPUTN ; +if (L_ICANON (&tty->termios)) { + new =L_ECHO (&tty->termios) ?TF_INPUT :TF_INPUTN ;if (new != tp->inattr) { tp->inattr = new;tty3270_update_prompt (tp,NULL ,0 );
drivers/staging/dgnc/dgnc_cls.c +2 -2
@@ -519,9 +519,9 @@ static void cls_param(struct tty_struct *tty)*/ if (!(ch->ch_tun.un_flags &UN_ISOPEN ) && (un->un_type ==DGNC_PRINT )) - baud =C_BAUD (ch->ch_pun.un_tty) &0xff ; + baud =C_BAUD (&ch->ch_pun.un_tty->termios) &0xff ;else - baud =C_BAUD (ch->ch_tun.un_tty) &0xff ; + baud =C_BAUD (&ch->ch_tun.un_tty->termios) &0xff ;if (ch->ch_c_cflag &CBAUDEX ) iindex =1 ;
drivers/staging/dgnc/dgnc_neo.c +2 -2
@@ -668,9 +668,9 @@ static void neo_param(struct tty_struct *tty)/* Only use the TXPrint baud rate if the terminal unit is NOT open */ if (!(ch->ch_tun.un_flags &UN_ISOPEN ) && (un->un_type ==DGNC_PRINT )) - baud =C_BAUD (ch->ch_pun.un_tty) &0xff ; + baud =C_BAUD (&ch->ch_pun.un_tty->termios) &0xff ;else - baud =C_BAUD (ch->ch_tun.un_tty) &0xff ; + baud =C_BAUD (&ch->ch_tun.un_tty->termios) &0xff ;if (ch->ch_c_cflag &CBAUDEX ) iindex =1 ;
drivers/staging/dgnc/dgnc_tty.c +3 -3
@@ -509,7 +509,7 @@ void dgnc_input(struct channel_t *ch)*/ if (!tp || (tp->magic !=TTY_MAGIC ) || !(ch->ch_tun.un_flags &UN_ISOPEN ) || - !C_CREAD (tp) || + !C_CREAD (&tp->termios) || (ch->ch_tun.un_flags &UN_CLOSING )) { ch->ch_r_head = tail;
@@ -592,7 +592,7 @@ void dgnc_input(struct channel_t *ch)* and error byte and send them to the buffer one at * a time. */ -if (I_PARMRK (tp) ||I_BRKINT (tp) ||I_INPCK (tp)) { +if (I_PARMRK (&tp->termios) ||I_BRKINT (&tp->termios) ||I_INPCK (&tp->termios)) {for (i =0 ; i < s; i++) {unsigned char ch = *(ch_pos + i);char flag =TTY_NORMAL ;
@@ -2593,7 +2593,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,spin_unlock_irqrestore (&ch->ch_lock, flags); - rc =put_user (C_CLOCAL (tty) ?1 :0 , + rc =put_user (C_CLOCAL (&tty->termios) ?1 :0 , (unsigned long __user *)arg);return rc;
drivers/staging/fwserial/fwserial.c +16 -16
@@ -328,7 +328,7 @@ static void fwtty_update_port_status(struct fwtty_port *port,if (delta &TIOCM_CAR ) { tty =tty_port_tty_get (&port->port); -if (tty && !C_CLOCAL (tty)) { +if (tty && !C_CLOCAL (&tty->termios)) {if (status &TIOCM_CAR )wake_up_interruptible (&port->port.open_wait);else
@@ -339,7 +339,7 @@ static void fwtty_update_port_status(struct fwtty_port *port,if (delta &TIOCM_CTS ) { tty =tty_port_tty_get (&port->port); -if (tty &&C_CRTSCTS (tty)) { +if (tty &&C_CRTSCTS (&tty->termios)) {if (tty->hw_stopped) {if (status &TIOCM_CTS ) { tty->hw_stopped =0 ;
@@ -465,7 +465,7 @@ static void fwtty_throttle_port(struct fwtty_port *port) old = port->mctrl; port->mctrl |=OOB_RX_THROTTLE ; -if (C_CRTSCTS (tty)) +if (C_CRTSCTS (&tty->termios)) port->mctrl &= ~TIOCM_RTS ;if (~old &OOB_RX_THROTTLE )__fwtty_write_port_status (port);
@@ -943,11 +943,11 @@ static unsigned int set_termios(struct fwtty_port *port, struct tty_struct *tty)tty_termios_encode_baud_rate (&tty->termios, baud, baud);/* compute bit count of 2 frames */ - frame =12 + ((C_CSTOPB (tty)) ?4 :2 ) + ((C_PARENB (tty)) ?2 :0 ); + frame =12 + ((C_CSTOPB (&tty->termios)) ?4 :2 ) + ((C_PARENB (&tty->termios)) ?2 :0 ); -switch (C_CSIZE (tty)) { +switch (C_CSIZE (&tty->termios)) {case CS5 : - frame -= (C_CSTOPB (tty)) ?1 :0 ; + frame -= (C_CSTOPB (&tty->termios)) ?1 :0 ;break ;case CS6 : frame +=2 ;
@@ -963,17 +963,17 @@ static unsigned int set_termios(struct fwtty_port *port, struct tty_struct *tty) port->cps = (baud <<1 ) / frame; port->status_mask =UART_LSR_OE ; -if (_I_FLAG (tty,BRKINT |PARMRK )) +if (_I_FLAG (&tty->termios,BRKINT |PARMRK )) port->status_mask |=UART_LSR_BI ; port->ignore_mask =0 ; -if (I_IGNBRK (tty)) { +if (I_IGNBRK (&tty->termios)) { port->ignore_mask |=UART_LSR_BI ; -if (I_IGNPAR (tty)) +if (I_IGNPAR (&tty->termios)) port->ignore_mask |=UART_LSR_OE ; } - port->write_only = !C_CREAD (tty); + port->write_only = !C_CREAD (&tty->termios);/* turn off echo and newline xlat if loopback */ if (port->loopback) {
@@ -1013,7 +1013,7 @@ static int fwtty_port_activate(struct tty_port *tty_port, port->mctrl =TIOCM_DTR |TIOCM_RTS ; } -if (C_CRTSCTS (tty) && ~port->mstatus &TIOCM_CTS ) +if (C_CRTSCTS (&tty->termios) && ~port->mstatus &TIOCM_CTS ) tty->hw_stopped =1 ;__fwtty_write_port_status (port);
@@ -1185,13 +1185,13 @@ static void fwtty_unthrottle(struct tty_struct *tty) {struct fwtty_port *port = tty->driver_data; -fwtty_dbg (port,"CRTSCTS: %d\n" ,C_CRTSCTS (tty) !=0 ); +fwtty_dbg (port,"CRTSCTS: %d\n" ,C_CRTSCTS (&tty->termios) !=0 );fwtty_profile_fifo (port, port->stats.unthrottle);spin_lock_bh (&port->lock); port->mctrl &= ~OOB_RX_THROTTLE ; -if (C_CRTSCTS (tty)) +if (C_CRTSCTS (&tty->termios)) port->mctrl |=TIOCM_RTS ;__fwtty_write_port_status (port);spin_unlock_bh (&port->lock);
@@ -1306,7 +1306,7 @@ static void fwtty_set_termios(struct tty_struct *tty, struct ktermios *old)if ((baud ==0 ) && (old->c_cflag &CBAUD )) { port->mctrl &= ~(TIOCM_DTR |TIOCM_RTS ); }else if ((baud !=0 ) && !(old->c_cflag &CBAUD )) { -if (C_CRTSCTS (tty) || !tty_throttled (tty)) +if (C_CRTSCTS (&tty->termios) || !tty_throttled (tty)) port->mctrl |=TIOCM_DTR |TIOCM_RTS ;else port->mctrl |=TIOCM_DTR ;
@@ -1315,11 +1315,11 @@ static void fwtty_set_termios(struct tty_struct *tty, struct ktermios *old)spin_unlock_bh (&port->lock);if (old->c_cflag &CRTSCTS ) { -if (!C_CRTSCTS (tty)) { +if (!C_CRTSCTS (&tty->termios)) { tty->hw_stopped =0 ;fwtty_restart_tx (port); } - }else if (C_CRTSCTS (tty) && ~port->mstatus &TIOCM_CTS ) { + }else if (C_CRTSCTS (&tty->termios) && ~port->mstatus &TIOCM_CTS ) { tty->hw_stopped =1 ; } }
drivers/tty/amiserial.c +15 -15
@@ -562,7 +562,7 @@ static int startup(struct tty_struct *tty, struct serial_state *info) current_ctl_bits = ciab.pra & (SER_DCD |SER_CTS |SER_DSR ); info->MCR =0 ; -if (C_BAUD (tty)) +if (C_BAUD (&tty->termios)) info->MCR =SER_DTR |SER_RTS ;rtsdtr_ctrl (info->MCR);
@@ -639,7 +639,7 @@ static void shutdown(struct tty_struct *tty, struct serial_state *info) custom.adkcon =AC_UARTBRK ;mb (); -if (C_HUPCL (tty)) +if (C_HUPCL (&tty->termios)) info->MCR &= ~(SER_DTR |SER_RTS );rtsdtr_ctrl (info->MCR);
@@ -742,24 +742,24 @@ static void change_speed(struct tty_struct *tty, struct serial_state *info,*/ info->read_status_mask =UART_LSR_OE |UART_LSR_DR ; -if (I_INPCK (tty)) +if (I_INPCK (&tty->termios)) info->read_status_mask |=UART_LSR_FE |UART_LSR_PE ; -if (I_BRKINT (tty) ||I_PARMRK (tty)) +if (I_BRKINT (&tty->termios) ||I_PARMRK (&tty->termios)) info->read_status_mask |=UART_LSR_BI ;/* * Characters to ignore */ info->ignore_status_mask =0 ; -if (I_IGNPAR (tty)) +if (I_IGNPAR (&tty->termios)) info->ignore_status_mask |=UART_LSR_PE |UART_LSR_FE ; -if (I_IGNBRK (tty)) { +if (I_IGNBRK (&tty->termios)) { info->ignore_status_mask |=UART_LSR_BI ;/* * If we're ignore parity and break indicators, ignore * overruns too. (For real raw support). */ -if (I_IGNPAR (tty)) +if (I_IGNPAR (&tty->termios)) info->ignore_status_mask |=UART_LSR_OE ; }/*
@@ -966,10 +966,10 @@ static void rs_throttle(struct tty_struct * tty)if (serial_paranoia_check (info, tty->name,"rs_throttle" ))return ; -if (I_IXOFF (tty)) -rs_send_xchar (tty,STOP_CHAR (tty)); +if (I_IXOFF (&tty->termios)) +rs_send_xchar (tty,STOP_CHAR (&tty->termios)); -if (C_CRTSCTS (tty)) +if (C_CRTSCTS (&tty->termios)) info->MCR &= ~SER_RTS ;local_irq_save (flags);
@@ -988,13 +988,13 @@ static void rs_unthrottle(struct tty_struct * tty)if (serial_paranoia_check (info, tty->name,"rs_unthrottle" ))return ; -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {if (info->x_char) info->x_char =0 ;else -rs_send_xchar (tty,START_CHAR (tty)); +rs_send_xchar (tty,START_CHAR (&tty->termios)); } -if (C_CRTSCTS (tty)) +if (C_CRTSCTS (&tty->termios)) info->MCR |=SER_RTS ;local_irq_save (flags);rtsdtr_ctrl (info->MCR);
@@ -1337,7 +1337,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)/* Handle transition away from B0 status */ if (!(old_termios->c_cflag &CBAUD ) && (cflag &CBAUD )) { info->MCR |=SER_DTR ; -if (!C_CRTSCTS (tty) || !tty_throttled (tty)) +if (!C_CRTSCTS (&tty->termios) || !tty_throttled (tty)) info->MCR |=SER_RTS ;local_irq_save (flags);rtsdtr_ctrl (info->MCR);
@@ -1345,7 +1345,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) }/* Handle turning off CRTSCTS */ -if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (tty)) { +if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios)) { tty->hw_stopped =0 ;rs_start (tty); }
drivers/tty/cyclades.c +14 -14
@@ -1438,7 +1438,7 @@ static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty) info->port.xmit_buf =NULL ;free_page ((unsigned long )temp); } -if (C_HUPCL (tty)) +if (C_HUPCL (&tty->termios))cyy_change_rts_dtr (info,0 ,TIOCM_RTS |TIOCM_DTR );cyy_issue_cmd (info, CyCHAN_CTL | CyDIS_RCVR);
@@ -1467,7 +1467,7 @@ static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty)free_page ((unsigned long )temp); } -if (C_HUPCL (tty)) +if (C_HUPCL (&tty->termios))tty_port_lower_dtr_rts (&info->port);set_bit (TTY_IO_ERROR , &tty->flags);
@@ -2112,8 +2112,8 @@ static void cy_set_line_char(struct cyclades_port *info, struct tty_struct *tty)/* set line characteristics according configuration */ -cyy_writeb (info, CySCHR1,START_CHAR (tty)); -cyy_writeb (info, CySCHR2,STOP_CHAR (tty)); +cyy_writeb (info, CySCHR1,START_CHAR (&tty->termios)); +cyy_writeb (info, CySCHR2,STOP_CHAR (&tty->termios));cyy_writeb (info, CyCOR1, info->cor1);cyy_writeb (info, CyCOR2, info->cor2);cyy_writeb (info, CyCOR3, info->cor3);
@@ -2130,7 +2130,7 @@ static void cy_set_line_char(struct cyclades_port *info, struct tty_struct *tty)/* 10ms rx timeout */ cflags = CyCTS; -if (!C_CLOCAL (tty)) +if (!C_CLOCAL (&tty->termios)) cflags |= CyDSR | CyRI | CyDCD;/* without modem intr */ cyy_writeb (info, CySRER,cyy_readb (info, CySRER) | CyMdmCh);
@@ -2784,7 +2784,7 @@ static void cy_set_termios(struct tty_struct *tty, struct ktermios *old_termios)cy_set_line_char (info, tty); -if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (tty)) { +if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios)) { tty->hw_stopped =0 ;cy_start (tty); }
@@ -2821,9 +2821,9 @@ static void cy_send_xchar(struct tty_struct *tty, char ch) channel = info->line - card->first_line;if (cy_is_Z (card)) { -if (ch ==STOP_CHAR (tty)) +if (ch ==STOP_CHAR (&tty->termios))cyz_issue_cmd (card, channel,C_CM_SENDXOFF ,0L ); -else if (ch ==START_CHAR (tty)) +else if (ch ==START_CHAR (&tty->termios))cyz_issue_cmd (card, channel,C_CM_SENDXON ,0L ); } }
@@ -2848,14 +2848,14 @@ static void cy_throttle(struct tty_struct *tty) card = info->card; -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {if (!cy_is_Z (card)) -cy_send_xchar (tty,STOP_CHAR (tty)); +cy_send_xchar (tty,STOP_CHAR (&tty->termios));else info->throttle =1 ; } -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) {if (!cy_is_Z (card)) {spin_lock_irqsave (&card->card_lock, flags);cyy_change_rts_dtr (info,0 ,TIOCM_RTS );
@@ -2885,14 +2885,14 @@ static void cy_unthrottle(struct tty_struct *tty)if (serial_paranoia_check (info, tty->name,"cy_unthrottle" ))return ; -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {if (info->x_char) info->x_char =0 ;else -cy_send_xchar (tty,START_CHAR (tty)); +cy_send_xchar (tty,START_CHAR (&tty->termios)); } -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) { card = info->card;if (!cy_is_Z (card)) {spin_lock_irqsave (&card->card_lock, flags);
drivers/tty/hvc/hvc_console.c +2 -2
@@ -368,7 +368,7 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)printk (KERN_ERR "hvc_open: request_irq failed with rc %d.\n" , rc); }else /* We are ready... raise DTR/RTS */ -if (C_BAUD (tty)) +if (C_BAUD (&tty->termios))if (hp->ops->dtr_rts) hp->ops->dtr_rts (hp,1 );
@@ -403,7 +403,7 @@ static void hvc_close(struct tty_struct *tty, struct file * filp)/* We are done with the tty pointer now. */ tty_port_tty_set (&hp->port,NULL ); -if (C_HUPCL (tty)) +if (C_HUPCL (&tty->termios))if (hp->ops->dtr_rts) hp->ops->dtr_rts (hp,0 );
drivers/tty/hvc/hvsi.c +1 -1
@@ -246,7 +246,7 @@ static void hvsi_recv_control(struct hvsi_struct *hp, uint8_t *packet,/* CD went away; no more connection */ pr_debug ("hvsi%i: CD dropped\n" , hp->index); hp->mctrl &=TIOCM_CD ; -if (tty && !C_CLOCAL (tty)) +if (tty && !C_CLOCAL (&tty->termios))tty_hangup (tty); }break ;
drivers/tty/isicom.c +14 -13
@@ -691,7 +691,7 @@ static void isicom_config_port(struct tty_struct *tty)unsigned char flow_ctrl;/* FIXME: Switch to new tty baud API */ - baud =C_BAUD (tty); + baud =C_BAUD (&tty->termios);if (baud &CBAUDEX ) { baud &= ~CBAUDEX ;
@@ -733,7 +733,7 @@ static void isicom_config_port(struct tty_struct *tty)outw (0x8000 | (channel << shift_count) |0x03 , base);outw (linuxb_to_isib[baud] <<8 |0x03 , base); channel_setup =0 ; -switch (C_CSIZE (tty)) { +switch (C_CSIZE (&tty->termios)) {case CS5 : channel_setup |=ISICOM_CS5 ;break ;
@@ -748,37 +748,38 @@ static void isicom_config_port(struct tty_struct *tty)break ; } -if (C_CSTOPB (tty)) +if (C_CSTOPB (&tty->termios)) channel_setup |=ISICOM_2SB ; -if (C_PARENB (tty)) { +if (C_PARENB (&tty->termios)) { channel_setup |=ISICOM_EVPAR ; -if (C_PARODD (tty)) +if (C_PARODD (&tty->termios)) channel_setup |=ISICOM_ODPAR ; }outw (channel_setup, base);InterruptTheCard (base); } -tty_port_set_check_carrier (&port->port, !C_CLOCAL (tty)); +tty_port_set_check_carrier (&port->port, !C_CLOCAL (&tty->termios));/* flow control settings ...*/ flow_ctrl =0 ; -tty_port_set_cts_flow (&port->port,C_CRTSCTS (tty)); -if (C_CRTSCTS (tty)) +tty_port_set_cts_flow (&port->port,C_CRTSCTS (&tty->termios)); +if (C_CRTSCTS (&tty->termios)) flow_ctrl |=ISICOM_CTSRTS ; -if (I_IXON (tty)) +if (I_IXON (&tty->termios)) flow_ctrl |=ISICOM_RESPOND_XONXOFF ; -if (I_IXOFF (tty)) +if (I_IXOFF (&tty->termios)) flow_ctrl |=ISICOM_INITIATE_XONXOFF ;if (WaitTillCardIsFree (base) ==0 ) {outw (0x8000 | (channel << shift_count) |0x04 , base);outw (flow_ctrl <<8 |0x05 , base); -outw ((STOP_CHAR (tty)) <<8 | (START_CHAR (tty)), base); +outw ((STOP_CHAR (&tty->termios)) <<8 | (START_CHAR (&tty->termios)), + base);InterruptTheCard (base); }/* rx enabled -> enable port for rx on the card */ -if (C_CREAD (tty)) { +if (C_CREAD (&tty->termios)) { card->port_status |= (1 << channel);outw (card->port_status, base +0x02 ); }
@@ -1199,7 +1200,7 @@ static void isicom_set_termios(struct tty_struct *tty,isicom_config_port (tty);spin_unlock_irqrestore (&port->card->card_lock, flags); -if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (tty)) { +if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios)) { tty->hw_stopped =0 ;isicom_start (tty); }
drivers/tty/moxa.c +2 -2
@@ -1323,7 +1323,7 @@ static void moxa_set_termios(struct tty_struct *tty,if (ch ==NULL )return ;moxa_set_tty_param (tty, old_termios); -if (!(old_termios->c_cflag &CLOCAL ) &&C_CLOCAL (tty)) +if (!(old_termios->c_cflag &CLOCAL ) &&C_CLOCAL (&tty->termios))wake_up_interruptible (&ch->port.open_wait); }
@@ -1420,7 +1420,7 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,if (!inited) goto put; -if (tty && (intr & IntrBreak) && !I_IGNBRK (tty)) {/* BREAK */ +if (tty && (intr & IntrBreak) && !I_IGNBRK (&tty->termios)) {/* BREAK */ tty_insert_flip_char (&p->port,0 ,TTY_BREAK );tty_schedule_flip (&p->port); }
drivers/tty/mxser.c +20 -18
@@ -615,7 +615,7 @@ static int mxser_set_baud(struct tty_struct *tty, long newspd)outb (cval, info->ioaddr +UART_LCR );/* reset DLAB */ #ifdef BOTHER -if (C_BAUD (tty) ==BOTHER ) { +if (C_BAUD (&tty->termios) ==BOTHER ) { quot = info->baud_base % newspd; quot *=8 ;if (quot % newspd > newspd /2 ) {
@@ -755,21 +755,21 @@ static int mxser_change_speed(struct tty_struct *tty,* Set up parity check flag */ info->read_status_mask =UART_LSR_OE |UART_LSR_THRE |UART_LSR_DR ; -if (I_INPCK (tty)) +if (I_INPCK (&tty->termios)) info->read_status_mask |=UART_LSR_FE |UART_LSR_PE ; -if (I_BRKINT (tty) ||I_PARMRK (tty)) +if (I_BRKINT (&tty->termios) ||I_PARMRK (&tty->termios)) info->read_status_mask |=UART_LSR_BI ; info->ignore_status_mask =0 ; -if (I_IGNBRK (tty)) { +if (I_IGNBRK (&tty->termios)) { info->ignore_status_mask |=UART_LSR_BI ; info->read_status_mask |=UART_LSR_BI ;/* * If we're ignore parity and break indicators, ignore * overruns too. (For real raw support). */ -if (I_IGNPAR (tty)) { +if (I_IGNPAR (&tty->termios)) { info->ignore_status_mask |=UART_LSR_OE | UART_LSR_PE |
@@ -781,16 +781,18 @@ static int mxser_change_speed(struct tty_struct *tty, } }if (info->board->chip_flag) { -mxser_set_must_xon1_value (info->ioaddr,START_CHAR (tty)); -mxser_set_must_xoff1_value (info->ioaddr,STOP_CHAR (tty)); -if (I_IXON (tty)) { +mxser_set_must_xon1_value (info->ioaddr, +START_CHAR (&tty->termios)); +mxser_set_must_xoff1_value (info->ioaddr, +STOP_CHAR (&tty->termios)); +if (I_IXON (&tty->termios)) {mxser_enable_must_rx_software_flow_control ( info->ioaddr); }else {mxser_disable_must_rx_software_flow_control ( info->ioaddr); } -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {mxser_enable_must_tx_software_flow_control ( info->ioaddr); }else {
@@ -1081,7 +1083,7 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)mutex_lock (&port->mutex);mxser_close_port (port);mxser_flush_buffer (tty); -if (tty_port_initialized (port) &&C_HUPCL (tty)) +if (tty_port_initialized (port) &&C_HUPCL (&tty->termios))tty_port_lower_dtr_rts (port);mxser_shutdown_port (port);tty_port_set_initialized (port,0 );
@@ -1846,19 +1848,19 @@ static void mxser_stoprx(struct tty_struct *tty)struct mxser_port *info = tty->driver_data; info->ldisc_stop_rx =1 ; -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {if (info->board->chip_flag) { info->IER &= ~MOXA_MUST_RECV_ISR ;outb (info->IER, info->ioaddr +UART_IER ); }else { - info->x_char =STOP_CHAR (tty); + info->x_char =STOP_CHAR (&tty->termios);outb (0 , info->ioaddr +UART_IER ); info->IER |=UART_IER_THRI ;outb (info->IER, info->ioaddr +UART_IER ); } } -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) { info->MCR &= ~UART_MCR_RTS ;outb (info->MCR, info->ioaddr +UART_MCR ); }
@@ -1879,7 +1881,7 @@ static void mxser_unthrottle(struct tty_struct *tty)/* startrx */ info->ldisc_stop_rx =0 ; -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {if (info->x_char) info->x_char =0 ;else {
@@ -1887,7 +1889,7 @@ static void mxser_unthrottle(struct tty_struct *tty) info->IER |=MOXA_MUST_RECV_ISR ;outb (info->IER, info->ioaddr +UART_IER ); }else { - info->x_char =START_CHAR (tty); + info->x_char =START_CHAR (&tty->termios);outb (0 , info->ioaddr +UART_IER ); info->IER |=UART_IER_THRI ;outb (info->IER, info->ioaddr +UART_IER );
@@ -1895,7 +1897,7 @@ static void mxser_unthrottle(struct tty_struct *tty) } } -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) { info->MCR |=UART_MCR_RTS ;outb (info->MCR, info->ioaddr +UART_MCR ); }
@@ -1943,13 +1945,13 @@ static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termimxser_change_speed (tty, old_termios);spin_unlock_irqrestore (&info->slock, flags); -if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (tty)) { +if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios)) { tty->hw_stopped =0 ;mxser_start (tty); }/* Handle sw stopped */ -if ((old_termios->c_iflag &IXON ) && !I_IXON (tty)) { +if ((old_termios->c_iflag &IXON ) && !I_IXON (&tty->termios)) { tty->stopped =0 ;if (info->board->chip_flag) {
drivers/tty/n_gsm.c +4 -4
@@ -1066,7 +1066,7 @@ static void gsm_process_modem(struct tty_struct *tty, struct gsm_dlci *dlci,/* Carrier drop -> hangup */ if (tty) {if ((mlines &TIOCM_CD ) ==0 && (dlci->modem_rx &TIOCM_CD )) -if (!C_CLOCAL (tty)) +if (!C_CLOCAL (&tty->termios))tty_hangup (tty); }if (brk &0x01 )
@@ -2972,7 +2972,7 @@ static void gsmtty_close(struct tty_struct *tty, struct file *filp)if (tty_port_close_start (&dlci->port, tty, filp) ==0 )return ;gsm_dlci_begin_close (dlci); -if (tty_port_initialized (&dlci->port) &&C_HUPCL (tty)) +if (tty_port_initialized (&dlci->port) &&C_HUPCL (&tty->termios))tty_port_lower_dtr_rts (&dlci->port);tty_port_close_end (&dlci->port, tty);tty_port_tty_set (&dlci->port,NULL );
@@ -3116,7 +3116,7 @@ static void gsmtty_throttle(struct tty_struct *tty)struct gsm_dlci *dlci = tty->driver_data;if (dlci->state ==DLCI_CLOSED )return ; -if (C_CRTSCTS (tty)) +if (C_CRTSCTS (&tty->termios)) dlci->modem_tx &= ~TIOCM_DTR ; dlci->throttled =1 ;/* Send an MSC with DTR cleared */
@@ -3128,7 +3128,7 @@ static void gsmtty_unthrottle(struct tty_struct *tty)struct gsm_dlci *dlci = tty->driver_data;if (dlci->state ==DLCI_CLOSED )return ; -if (C_CRTSCTS (tty)) +if (C_CRTSCTS (&tty->termios)) dlci->modem_tx |=TIOCM_DTR ; dlci->throttled =0 ;/* Send an MSC with DTR set */
drivers/tty/n_tty.c +131 -128
648 lines not on this page · raw message
drivers/tty/pty.c +4 -4
@@ -261,13 +261,13 @@ static void pty_set_termios(struct tty_struct *tty, {/* See if packet mode change of state. */ if (tty->link && tty->link->packet) { -int extproc = (old_termios->c_lflag &EXTPROC ) |L_EXTPROC (tty); +int extproc = (old_termios->c_lflag &EXTPROC ) |L_EXTPROC (&tty->termios);int old_flow = ((old_termios->c_iflag &IXON ) && (old_termios->c_cc[VSTOP ] =='\023' ) && (old_termios->c_cc[VSTART ] =='\021' )); -int new_flow = (I_IXON (tty) && -STOP_CHAR (tty) =='\023' && -START_CHAR (tty) =='\021' ); +int new_flow = (I_IXON (&tty->termios) && +STOP_CHAR (&tty->termios) =='\023' && +START_CHAR (&tty->termios) =='\021' );if ((old_flow != new_flow) || extproc) {spin_lock_irq (&tty->ctrl_lock);if (old_flow != new_flow) {
drivers/tty/rocket.c +18 -18
@@ -786,15 +786,15 @@ static void configure_r_port(struct tty_struct *tty, struct r_port *info,* Handle software flow control in the board */ #ifdef ROCKET_SOFT_FLOW -if (I_IXON (tty)) { +if (I_IXON (&tty->termios)) {sEnTxSoftFlowCtl (cp); -if (I_IXANY (tty)) { +if (I_IXANY (&tty->termios)) {sEnIXANY (cp); }else {sDisIXANY (cp); } -sSetTxXONChar (cp,START_CHAR (tty)); -sSetTxXOFFChar (cp,STOP_CHAR (tty)); +sSetTxXONChar (cp,START_CHAR (&tty->termios)); +sSetTxXOFFChar (cp,STOP_CHAR (&tty->termios)); }else {sDisTxSoftFlowCtl (cp);sDisIXANY (cp);
@@ -806,24 +806,24 @@ static void configure_r_port(struct tty_struct *tty, struct r_port *info,* Set up ignore/read mask words */ info->read_status_mask =STMRCVROVRH |0xFF ; -if (I_INPCK (tty)) +if (I_INPCK (&tty->termios)) info->read_status_mask |=STMFRAMEH |STMPARITYH ; -if (I_BRKINT (tty) ||I_PARMRK (tty)) +if (I_BRKINT (&tty->termios) ||I_PARMRK (&tty->termios)) info->read_status_mask |=STMBREAKH ;/* * Characters to ignore */ info->ignore_status_mask =0 ; -if (I_IGNPAR (tty)) +if (I_IGNPAR (&tty->termios)) info->ignore_status_mask |=STMFRAMEH |STMPARITYH ; -if (I_IGNBRK (tty)) { +if (I_IGNBRK (&tty->termios)) { info->ignore_status_mask |=STMBREAKH ;/* * If we're ignoring parity and break indicators, * ignore overruns too. (For real raw support). */ -if (I_IGNPAR (tty)) +if (I_IGNPAR (&tty->termios)) info->ignore_status_mask |=STMRCVROVRH ; }
@@ -960,7 +960,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp) tty->alt_speed =460800 ;configure_r_port (tty, info,NULL ); -if (C_BAUD (tty)) { +if (C_BAUD (&tty->termios)) {sSetDTR (cp);sSetRTS (cp); }
@@ -1019,7 +1019,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp)sFlushRxFIFO (cp);sFlushTxFIFO (cp);sClrRTS (cp); -if (C_HUPCL (tty)) +if (C_HUPCL (&tty->termios))sClrDTR (cp);rp_flush_buffer (tty);
@@ -1086,18 +1086,18 @@ static void rp_set_termios(struct tty_struct *tty, cp = &info->channel;/* Handle transition to B0 status */ -if ((old_termios->c_cflag &CBAUD ) && !C_BAUD (tty)) { +if ((old_termios->c_cflag &CBAUD ) && !C_BAUD (&tty->termios)) {sClrDTR (cp);sClrRTS (cp); }/* Handle transition away from B0 status */ -if (!(old_termios->c_cflag &CBAUD ) &&C_BAUD (tty)) { +if (!(old_termios->c_cflag &CBAUD ) &&C_BAUD (&tty->termios)) {sSetRTS (cp);sSetDTR (cp); } -if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (tty)) +if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios))rp_start (tty); }
@@ -1366,8 +1366,8 @@ static void rp_throttle(struct tty_struct *tty)if (rocket_paranoia_check (info,"rp_throttle" ))return ; -if (I_IXOFF (tty)) -rp_send_xchar (tty,STOP_CHAR (tty)); +if (I_IXOFF (&tty->termios)) +rp_send_xchar (tty,STOP_CHAR (&tty->termios));sClrRTS (&info->channel); }
@@ -1382,8 +1382,8 @@ static void rp_unthrottle(struct tty_struct *tty)if (rocket_paranoia_check (info,"rp_unthrottle" ))return ; -if (I_IXOFF (tty)) -rp_send_xchar (tty,START_CHAR (tty)); +if (I_IXOFF (&tty->termios)) +rp_send_xchar (tty,START_CHAR (&tty->termios));sSetRTS (&info->channel); }
drivers/tty/serial/crisv10.c +15 -13
@@ -1411,9 +1411,9 @@ rs_stop(struct tty_struct *tty) info->xmit.tail,SERIAL_XMIT_SIZE))); xoff =IO_FIELD (R_SERIAL0_XOFF , xoff_char, -STOP_CHAR (info->port.tty)); +STOP_CHAR (&info->port.tty->termios)); xoff |=IO_STATE (R_SERIAL0_XOFF , tx_stop, stop); -if (I_IXON (tty)) +if (I_IXON (&tty->termios)) xoff |=IO_STATE (R_SERIAL0_XOFF , auto_xoff, enable); *((unsigned long *)&info->ioport[REG_XOFF ]) = xoff;
@@ -1433,9 +1433,10 @@ rs_start(struct tty_struct *tty)DFLOW (DEBUG_LOG (info->line,"XOFF rs_start xmit %i\n" ,CIRC_CNT (info->xmit.head, info->xmit.tail,SERIAL_XMIT_SIZE ))); - xoff =IO_FIELD (R_SERIAL0_XOFF , xoff_char,STOP_CHAR (tty)); + xoff =IO_FIELD (R_SERIAL0_XOFF , xoff_char, +STOP_CHAR (&tty->termios)); xoff |=IO_STATE (R_SERIAL0_XOFF , tx_stop, enable); -if (I_IXON (tty)) +if (I_IXON (&tty->termios)) xoff |=IO_STATE (R_SERIAL0_XOFF , auto_xoff, enable); *((unsigned long *)&info->ioport[REG_XOFF ]) = xoff;
@@ -2906,7 +2907,8 @@ change_speed(struct e100_serial *info) info->ioport[REG_TR_CTRL ] = info->tx_ctrl; info->ioport[REG_REC_CTRL ] = info->rx_ctrl; - xoff =IO_FIELD (R_SERIAL0_XOFF , xoff_char,STOP_CHAR (info->port.tty)); + xoff =IO_FIELD (R_SERIAL0_XOFF , xoff_char, +STOP_CHAR (&info->port.tty->termios)); xoff |=IO_STATE (R_SERIAL0_XOFF , tx_stop, enable);if (info->port.tty->termios.c_iflag &IXON ) { DFLOW(DEBUG_LOG(info->line, "FLOW XOFF enabled 0x%02X\n",
@@ -3164,12 +3166,12 @@ rs_throttle(struct tty_struct * tty)DFLOW (DEBUG_LOG (info->line,"rs_throttle\n" ));/* Do RTS before XOFF since XOFF might take some time */ -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) {/* Turn off RTS line */ e100_rts (info,0 ); } -if (I_IXOFF (tty)) -rs_send_xchar (tty,STOP_CHAR (tty)); +if (I_IXOFF (&tty->termios)) +rs_send_xchar (tty,STOP_CHAR (&tty->termios)); }
@@ -3183,16 +3185,16 @@ rs_unthrottle(struct tty_struct * tty)DFLOW (DEBUG_LOG (info->line,"rs_unthrottle ldisc\n" ));DFLOW (DEBUG_LOG (info->line,"rs_unthrottle flip.count: %i\n" , tty->flip.count));/* Do RTS before XOFF since XOFF might take some time */ -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) {/* Assert RTS line */ e100_rts (info,1 ); } -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {if (info->x_char) info->x_char =0 ;else -rs_send_xchar (tty,START_CHAR (tty)); +rs_send_xchar (tty,START_CHAR (&tty->termios)); } }
@@ -3551,7 +3553,7 @@ rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)change_speed (info);/* Handle turning off CRTSCTS */ -if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (tty)) +if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios))rs_start (tty); }
@@ -3760,7 +3762,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp,return 0 ; } -if (C_CLOCAL (tty)) +if (C_CLOCAL (&tty->termios)) do_clocal =1 ;/*
drivers/tty/serial/etraxfs-uart.c +1 -1
@@ -777,7 +777,7 @@ etraxfs_uart_set_termios(struct uart_port *port, struct ktermios *termios,if (up->port.state && up->port.state->port.tty && (up->port.state->port.tty->termios.c_iflag &IXON )) { - xoff.chr =STOP_CHAR (up->port.state->port.tty); + xoff.chr =STOP_CHAR (&up->port.state->port.tty->termios); xoff.automatic = regk_ser_yes; }else xoff.automatic = regk_ser_no;
drivers/tty/serial/jsm/jsm_cls.c +1 -1
@@ -718,7 +718,7 @@ static void cls_param(struct jsm_channel *ch)return ; } - cflag =C_BAUD (ch->uart_port.state->port.tty); + cflag =C_BAUD (&ch->uart_port.state->port.tty->termios); baud =9600 ;for (i =0 ; i <ARRAY_SIZE (baud_rates); i++) {if (baud_rates[i].cflag == cflag) {
drivers/tty/serial/jsm/jsm_neo.c +1 -1
@@ -987,7 +987,7 @@ static void neo_param(struct jsm_channel *ch) { 50, B50 }, }; - cflag =C_BAUD (ch->uart_port.state->port.tty); + cflag =C_BAUD (&ch->uart_port.state->port.tty->termios); baud =9600 ;for (i =0 ; i <ARRAY_SIZE (baud_rates); i++) {if (baud_rates[i].cflag == cflag) {
drivers/tty/serial/jsm/jsm_tty.c +2 -2
@@ -568,7 +568,7 @@ void jsm_input(struct jsm_channel *ch)*If the device is not open, or CREAD is off, flush *input data and return immediately. */ -if (!tp || !C_CREAD (tp)) { +if (!tp || !C_CREAD (&tp->termios)) { jsm_dbg(READ, &ch->ch_bd->pci_dev, "input. dropping %d bytes on port %d...\n",
@@ -616,7 +616,7 @@ void jsm_input(struct jsm_channel *ch)* a time. */ -if (I_PARMRK (tp) ||I_BRKINT (tp) ||I_INPCK (tp)) { +if (I_PARMRK (&tp->termios) ||I_BRKINT (&tp->termios) ||I_INPCK (&tp->termios)) {for (i =0 ; i < s; i++) {/* * Give the Linux ld the flags in the
drivers/tty/serial/serial_core.c +8 -8
@@ -211,7 +211,7 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,* Setup the RTS and DTR signals once the * port is open and ready to respond. */ -if (init_hw &&C_BAUD (tty)) +if (init_hw &&C_BAUD (&tty->termios))uart_set_mctrl (uport,TIOCM_RTS |TIOCM_DTR ); }
@@ -269,7 +269,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)if (uport &&uart_console (uport) && tty) uport->cons->cflag = tty->termios.c_cflag; -if (!tty ||C_HUPCL (tty)) +if (!tty ||C_HUPCL (&tty->termios))uart_clear_mctrl (uport,TIOCM_DTR |TIOCM_RTS );uart_port_shutdown (port);
@@ -671,9 +671,9 @@ static void uart_throttle(struct tty_struct *tty)if (!port)return ; -if (I_IXOFF (tty)) +if (I_IXOFF (&tty->termios)) mask |=UPSTAT_AUTOXOFF ; -if (C_CRTSCTS (tty)) +if (C_CRTSCTS (&tty->termios)) mask |=UPSTAT_AUTORTS ;if (port->status & mask) {
@@ -685,7 +685,7 @@ static void uart_throttle(struct tty_struct *tty)uart_clear_mctrl (port,TIOCM_RTS );if (mask &UPSTAT_AUTOXOFF ) -uart_send_xchar (tty,STOP_CHAR (tty)); +uart_send_xchar (tty,STOP_CHAR (&tty->termios));uart_port_deref (port); }
@@ -700,9 +700,9 @@ static void uart_unthrottle(struct tty_struct *tty)if (!port)return ; -if (I_IXOFF (tty)) +if (I_IXOFF (&tty->termios)) mask |=UPSTAT_AUTOXOFF ; -if (C_CRTSCTS (tty)) +if (C_CRTSCTS (&tty->termios)) mask |=UPSTAT_AUTORTS ;if (port->status & mask) {
@@ -714,7 +714,7 @@ static void uart_unthrottle(struct tty_struct *tty)uart_set_mctrl (port,TIOCM_RTS );if (mask &UPSTAT_AUTOXOFF ) -uart_send_xchar (tty,START_CHAR (tty)); +uart_send_xchar (tty,START_CHAR (&tty->termios));uart_port_deref (port); }
drivers/tty/synclink.c +17 -17
@@ -1969,19 +1969,19 @@ static void mgsl_change_params(struct mgsl_struct *info)/* process tty input control flags */ info->read_status_mask =RXSTATUS_OVERRUN ; -if (I_INPCK (info->port.tty)) +if (I_INPCK (&info->port.tty->termios)) info->read_status_mask |=RXSTATUS_PARITY_ERROR |RXSTATUS_FRAMING_ERROR ; -if (I_BRKINT (info->port.tty) ||I_PARMRK (info->port.tty)) +if (I_BRKINT (&info->port.tty->termios) ||I_PARMRK (&info->port.tty->termios)) info->read_status_mask |=RXSTATUS_BREAK_RECEIVED ; -if (I_IGNPAR (info->port.tty)) +if (I_IGNPAR (&info->port.tty->termios)) info->ignore_status_mask |=RXSTATUS_PARITY_ERROR |RXSTATUS_FRAMING_ERROR ; -if (I_IGNBRK (info->port.tty)) { +if (I_IGNBRK (&info->port.tty->termios)) { info->ignore_status_mask |=RXSTATUS_BREAK_RECEIVED ;/* If ignoring parity and break indicators, ignore * overruns too. (For real raw support). */ -if (I_IGNPAR (info->port.tty)) +if (I_IGNPAR (&info->port.tty->termios)) info->ignore_status_mask |=RXSTATUS_OVERRUN ; }
@@ -2350,10 +2350,10 @@ static void mgsl_throttle(struct tty_struct * tty)if (mgsl_paranoia_check (info, tty->name,"mgsl_throttle" ))return ; -if (I_IXOFF (tty)) -mgsl_send_xchar (tty,STOP_CHAR (tty)); +if (I_IXOFF (&tty->termios)) +mgsl_send_xchar (tty,STOP_CHAR (&tty->termios)); -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) {spin_lock_irqsave (&info->irq_spinlock,flags); info->serial_signals &= ~SerialSignal_RTS;usc_set_serial_signals (info);
@@ -2380,14 +2380,14 @@ static void mgsl_unthrottle(struct tty_struct * tty)if (mgsl_paranoia_check (info, tty->name,"mgsl_unthrottle" ))return ; -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {if (info->x_char) info->x_char =0 ;else -mgsl_send_xchar (tty,START_CHAR (tty)); +mgsl_send_xchar (tty,START_CHAR (&tty->termios)); } -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) {spin_lock_irqsave (&info->irq_spinlock,flags); info->serial_signals |= SerialSignal_RTS;usc_set_serial_signals (info);
@@ -3029,7 +3029,7 @@ static void mgsl_set_termios(struct tty_struct *tty, struct ktermios *old_termiomgsl_change_params (info);/* Handle transition to B0 status */ -if ((old_termios->c_cflag &CBAUD ) && !C_BAUD (tty)) { +if ((old_termios->c_cflag &CBAUD ) && !C_BAUD (&tty->termios)) { info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);spin_lock_irqsave (&info->irq_spinlock,flags);usc_set_serial_signals (info);
@@ -3037,9 +3037,9 @@ static void mgsl_set_termios(struct tty_struct *tty, struct ktermios *old_termio }/* Handle transition away from B0 status */ -if (!(old_termios->c_cflag &CBAUD ) &&C_BAUD (tty)) { +if (!(old_termios->c_cflag &CBAUD ) &&C_BAUD (&tty->termios)) { info->serial_signals |= SerialSignal_DTR; -if (!C_CRTSCTS (tty) || !tty_throttled (tty)) +if (!C_CRTSCTS (&tty->termios) || !tty_throttled (tty)) info->serial_signals |= SerialSignal_RTS;spin_lock_irqsave (&info->irq_spinlock,flags);usc_set_serial_signals (info);
@@ -3047,7 +3047,7 @@ static void mgsl_set_termios(struct tty_struct *tty, struct ktermios *old_termio }/* Handle turning off CRTSCTS */ -if (old_termios->c_cflag &CRTSCTS && !C_CRTSCTS (tty)) { +if (old_termios->c_cflag &CRTSCTS && !C_CRTSCTS (&tty->termios)) { tty->hw_stopped =0 ;mgsl_start (tty); }
@@ -3266,7 +3266,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,return 0 ; } -if (C_CLOCAL (tty)) +if (C_CLOCAL (&tty->termios)) do_clocal = true;/* Wait for carrier detect and the line to become
@@ -3289,7 +3289,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, port->blocked_open++;while (1 ) { -if (C_BAUD (tty) &&tty_port_initialized (port)) +if (C_BAUD (&tty->termios) &&tty_port_initialized (port))tty_port_raise_dtr_rts (port);set_current_state (TASK_INTERRUPTIBLE );
drivers/tty/synclink_gt.c +17 -17
@@ -774,7 +774,7 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios)change_params (info);/* Handle transition to B0 status */ -if ((old_termios->c_cflag &CBAUD ) && !C_BAUD (tty)) { +if ((old_termios->c_cflag &CBAUD ) && !C_BAUD (&tty->termios)) { info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR);spin_lock_irqsave (&info->lock,flags);set_signals (info);
@@ -782,9 +782,9 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios) }/* Handle transition away from B0 status */ -if (!(old_termios->c_cflag &CBAUD ) &&C_BAUD (tty)) { +if (!(old_termios->c_cflag &CBAUD ) &&C_BAUD (&tty->termios)) { info->signals |= SerialSignal_DTR; -if (!C_CRTSCTS (tty) || !tty_throttled (tty)) +if (!C_CRTSCTS (&tty->termios) || !tty_throttled (tty)) info->signals |= SerialSignal_RTS;spin_lock_irqsave (&info->lock,flags);set_signals (info);
@@ -792,7 +792,7 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios) }/* Handle turning off CRTSCTS */ -if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (tty)) { +if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios)) { tty->hw_stopped =0 ;tx_release (tty); }
@@ -1355,9 +1355,9 @@ static void throttle(struct tty_struct * tty)if (sanity_check (info, tty->name,"throttle" ))return ;DBGINFO (("%s throttle\n" , info->device_name)); -if (I_IXOFF (tty)) -send_xchar (tty,STOP_CHAR (tty)); -if (C_CRTSCTS (tty)) { +if (I_IXOFF (&tty->termios)) +send_xchar (tty,STOP_CHAR (&tty->termios)); +if (C_CRTSCTS (&tty->termios)) {spin_lock_irqsave (&info->lock,flags); info->signals &= ~SerialSignal_RTS;set_signals (info);
@@ -1376,13 +1376,13 @@ static void unthrottle(struct tty_struct * tty)if (sanity_check (info, tty->name,"unthrottle" ))return ;DBGINFO (("%s unthrottle\n" , info->device_name)); -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {if (info->x_char) info->x_char =0 ;else -send_xchar (tty,START_CHAR (tty)); +send_xchar (tty,START_CHAR (&tty->termios)); } -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) {spin_lock_irqsave (&info->lock,flags); info->signals |= SerialSignal_RTS;set_signals (info);
@@ -2582,18 +2582,18 @@ static void change_params(struct slgt_info *info)/* process tty input control flags */ info->read_status_mask =IRQ_RXOVER ; -if (I_INPCK (info->port.tty)) +if (I_INPCK (&info->port.tty->termios)) info->read_status_mask |=MASK_PARITY |MASK_FRAMING ; -if (I_BRKINT (info->port.tty) ||I_PARMRK (info->port.tty)) +if (I_BRKINT (&info->port.tty->termios) ||I_PARMRK (&info->port.tty->termios)) info->read_status_mask |=MASK_BREAK ; -if (I_IGNPAR (info->port.tty)) +if (I_IGNPAR (&info->port.tty->termios)) info->ignore_status_mask |=MASK_PARITY |MASK_FRAMING ; -if (I_IGNBRK (info->port.tty)) { +if (I_IGNBRK (&info->port.tty->termios)) { info->ignore_status_mask |=MASK_BREAK ;/* If ignoring parity and break indicators, ignore * overruns too. (For real raw support). */ -if (I_IGNPAR (info->port.tty)) +if (I_IGNPAR (&info->port.tty->termios)) info->ignore_status_mask |=MASK_OVERRUN ; }
@@ -3268,7 +3268,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,return 0 ; } -if (C_CLOCAL (tty)) +if (C_CLOCAL (&tty->termios)) do_clocal = true;/* Wait for carrier detect and the line to become
@@ -3287,7 +3287,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, port->blocked_open++;while (1 ) { -if (C_BAUD (tty) &&tty_port_initialized (port)) +if (C_BAUD (&tty->termios) &&tty_port_initialized (port))tty_port_raise_dtr_rts (port);set_current_state (TASK_INTERRUPTIBLE );
drivers/tty/synclinkmp.c +17 -17
@@ -871,7 +871,7 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios)change_params (info);/* Handle transition to B0 status */ -if ((old_termios->c_cflag &CBAUD ) && !C_BAUD (tty)) { +if ((old_termios->c_cflag &CBAUD ) && !C_BAUD (&tty->termios)) { info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);spin_lock_irqsave (&info->lock,flags);set_signals (info);
@@ -879,9 +879,9 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios) }/* Handle transition away from B0 status */ -if (!(old_termios->c_cflag &CBAUD ) &&C_BAUD (tty)) { +if (!(old_termios->c_cflag &CBAUD ) &&C_BAUD (&tty->termios)) { info->serial_signals |= SerialSignal_DTR; -if (!C_CRTSCTS (tty) || !tty_throttled (tty)) +if (!C_CRTSCTS (&tty->termios) || !tty_throttled (tty)) info->serial_signals |= SerialSignal_RTS;spin_lock_irqsave (&info->lock,flags);set_signals (info);
@@ -889,7 +889,7 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios) }/* Handle turning off CRTSCTS */ -if (old_termios->c_cflag &CRTSCTS && !C_CRTSCTS (tty)) { +if (old_termios->c_cflag &CRTSCTS && !C_CRTSCTS (&tty->termios)) { tty->hw_stopped =0 ;tx_release (tty); }
@@ -1464,10 +1464,10 @@ static void throttle(struct tty_struct * tty)if (sanity_check (info, tty->name,"throttle" ))return ; -if (I_IXOFF (tty)) -send_xchar (tty,STOP_CHAR (tty)); +if (I_IXOFF (&tty->termios)) +send_xchar (tty,STOP_CHAR (&tty->termios)); -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) {spin_lock_irqsave (&info->lock,flags); info->serial_signals &= ~SerialSignal_RTS;set_signals (info);
@@ -1489,14 +1489,14 @@ static void unthrottle(struct tty_struct * tty)if (sanity_check (info, tty->name,"unthrottle" ))return ; -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) {if (info->x_char) info->x_char =0 ;else -send_xchar (tty,START_CHAR (tty)); +send_xchar (tty,START_CHAR (&tty->termios)); } -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) {spin_lock_irqsave (&info->lock,flags); info->serial_signals |= SerialSignal_RTS;set_signals (info);
@@ -2819,18 +2819,18 @@ static void change_params(SLMP_INFO *info)/* process tty input control flags */ info->read_status_mask2 =OVRN ; -if (I_INPCK (info->port.tty)) +if (I_INPCK (&info->port.tty->termios)) info->read_status_mask2 |=PE |FRME ; -if (I_BRKINT (info->port.tty) ||I_PARMRK (info->port.tty)) +if (I_BRKINT (&info->port.tty->termios) ||I_PARMRK (&info->port.tty->termios)) info->read_status_mask1 |=BRKD ; -if (I_IGNPAR (info->port.tty)) +if (I_IGNPAR (&info->port.tty->termios)) info->ignore_status_mask2 |=PE |FRME ; -if (I_IGNBRK (info->port.tty)) { +if (I_IGNBRK (&info->port.tty->termios)) { info->ignore_status_mask1 |=BRKD ;/* If ignoring parity and break indicators, ignore * overruns too. (For real raw support). */ -if (I_IGNPAR (info->port.tty)) +if (I_IGNPAR (&info->port.tty->termios)) info->ignore_status_mask2 |=OVRN ; }
@@ -3285,7 +3285,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,return 0 ; } -if (C_CLOCAL (tty)) +if (C_CLOCAL (&tty->termios)) do_clocal = true;/* Wait for carrier detect and the line to become
@@ -3308,7 +3308,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, port->blocked_open++;while (1 ) { -if (C_BAUD (tty) &&tty_port_initialized (port)) +if (C_BAUD (&tty->termios) &&tty_port_initialized (port))tty_port_raise_dtr_rts (port);set_current_state (TASK_INTERRUPTIBLE );
drivers/tty/tty_audit.c +2 -2
@@ -204,7 +204,7 @@ static struct tty_audit_buf *tty_audit_buf_get(void)void tty_audit_add_data (struct tty_struct *tty,const void *data,size_t size) {struct tty_audit_buf *buf; -unsigned int icanon = !!L_ICANON (tty); +unsigned int icanon = !!L_ICANON (&tty->termios);unsigned int audit_tty;dev_t dev;
@@ -219,7 +219,7 @@ void tty_audit_add_data(struct tty_struct *tty, const void *data, size_t size) && tty->driver->subtype == PTY_TYPE_MASTER)return ; -if ((~audit_tty &AUDIT_TTY_LOG_PASSWD ) && icanon && !L_ECHO (tty)) +if ((~audit_tty &AUDIT_TTY_LOG_PASSWD ) && icanon && !L_ECHO (&tty->termios))return ; buf =tty_audit_buf_get ();
drivers/tty/tty_ioctl.c +12 -10
@@ -719,16 +719,16 @@ static int get_sgflags(struct tty_struct *tty) {int flags =0 ; -if (!L_ICANON (tty)) { -if (L_ISIG (tty)) +if (!L_ICANON (&tty->termios)) { +if (L_ISIG (&tty->termios)) flags |=0x02 ;/* cbreak */ else flags |=0x20 ;/* raw */ } -if (L_ECHO (tty)) +if (L_ECHO (&tty->termios)) flags |=0x08 ;/* echo */ -if (O_OPOST (tty)) -if (O_ONLCR (tty)) +if (O_OPOST (&tty->termios)) +if (O_ONLCR (&tty->termios)) flags |=0x10 ;/* crmod */ return flags; }
@@ -908,7 +908,7 @@ static int tty_change_softcar(struct tty_struct *tty, int arg) tty->termios.c_cflag |= bit;if (tty->ops->set_termios) tty->ops->set_termios (tty, &old); -if (C_CLOCAL (tty) != bit) +if (C_CLOCAL (&tty->termios) != bit) ret = -EINVAL ;up_write (&tty->termios_rwsem);return ret;
@@ -1140,12 +1140,14 @@ int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,spin_unlock_irq (&tty->flow_lock);break ;case TCIOFF : -if (STOP_CHAR (tty) != __DISABLED_CHAR) - retval =tty_send_xchar (tty,STOP_CHAR (tty)); +if (STOP_CHAR (&tty->termios) != __DISABLED_CHAR) + retval =tty_send_xchar (tty, +STOP_CHAR (&tty->termios));break ;case TCION : -if (START_CHAR (tty) != __DISABLED_CHAR) - retval =tty_send_xchar (tty,START_CHAR (tty)); +if (START_CHAR (&tty->termios) != __DISABLED_CHAR) + retval =tty_send_xchar (tty, +START_CHAR (&tty->termios));break ;default :return -EINVAL ;
drivers/tty/tty_port.c +5 -5
@@ -210,7 +210,7 @@ static void tty_port_shutdown(struct tty_port *port, struct tty_struct *tty)* Drop DTR/RTS if HUPCL is set. This causes any attached * modem to hang up the line. */ -if (tty &&C_HUPCL (tty)) +if (tty &&C_HUPCL (&tty->termios))tty_port_lower_dtr_rts (port);if (port->ops->shutdown)
@@ -260,7 +260,7 @@ void tty_port_tty_hangup(struct tty_port *port, bool check_clocal) {struct tty_struct *tty =tty_port_tty_get (port); -if (tty && (!check_clocal || !C_CLOCAL (tty))) +if (tty && (!check_clocal || !C_CLOCAL (&tty->termios)))tty_hangup (tty);tty_kref_put (tty); }
@@ -371,13 +371,13 @@ int tty_port_block_til_ready(struct tty_port *port, }if (filp->f_flags &O_NONBLOCK ) {/* Indicate we are open */ -if (C_BAUD (tty)) +if (C_BAUD (&tty->termios))tty_port_raise_dtr_rts (port);tty_port_set_active (port,1 );return 0 ; } -if (C_CLOCAL (tty)) +if (C_CLOCAL (&tty->termios)) do_clocal =1 ;/* Block waiting until we can proceed. We may need to wait for the
@@ -394,7 +394,7 @@ int tty_port_block_til_ready(struct tty_port *port,while (1 ) {/* Indicate we are open */ -if (C_BAUD (tty) &&tty_port_initialized (port)) +if (C_BAUD (&tty->termios) &&tty_port_initialized (port))tty_port_raise_dtr_rts (port);prepare_to_wait (&port->open_wait, &wait,TASK_INTERRUPTIBLE );
drivers/tty/vt/keyboard.c +1 -1
@@ -1380,7 +1380,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)if (rep && (!vc_kbd_mode (kbd,VC_REPEAT ) || - (tty && !L_ECHO (tty) &&tty_chars_in_buffer (tty)))) { + (tty && !L_ECHO (&tty->termios) &&tty_chars_in_buffer (tty)))) {/* * Don't repeat a key if the input buffers are not empty and the * characters get aren't echoed locally. This makes key repeat
drivers/usb/class/cdc-acm.c +1 -1
@@ -1067,7 +1067,7 @@ static void acm_tty_set_termios(struct tty_struct *tty,/* FIXME: Needs to clear unsupported bits in the termios */ acm->clocal = ((termios->c_cflag &CLOCAL ) !=0 ); -if (C_BAUD (tty) ==B0 ) { +if (C_BAUD (&tty->termios) ==B0 ) { newline.dwDTERate = acm->line.dwDTERate; newctrl &= ~ACM_CTRL_DTR ; }else if (termios_old && (termios_old->c_cflag &CBAUD ) ==B0 ) {
drivers/usb/serial/ark3116.c +1 -1
@@ -324,7 +324,7 @@ static void ark3116_set_termios(struct tty_struct *tty,mutex_unlock (&priv->hw_lock);/* check for software flow control */ -if (I_IXOFF (tty) ||I_IXON (tty)) { +if (I_IXOFF (&tty->termios) ||I_IXON (&tty->termios)) {dev_warn (&serial->dev->dev,"%s: don't know how to do software flow control\n" ,KBUILD_MODNAME );
drivers/usb/serial/cypress_m8.c +1 -1
@@ -1164,7 +1164,7 @@ static void cypress_read_int_callback(struct urb *urb)/* hangup, as defined in acm.c... this might be a bad place for it * though */ -if (tty && !C_CLOCAL (tty) && !(priv->current_status &UART_CD )) { +if (tty && !C_CLOCAL (&tty->termios) && !(priv->current_status &UART_CD )) {dev_dbg (dev,"%s - calling hangup\n" , __func__);tty_hangup (tty); goto continue_read;
drivers/usb/serial/digi_acceleport.c +2 -2
@@ -699,7 +699,7 @@ static void digi_set_termios(struct tty_struct *tty,/* don't set RTS if using hardware flow control */ /* and throttling input */ modem_signals =TIOCM_DTR ; -if (!C_CRTSCTS (tty) || !tty_throttled (tty)) +if (!C_CRTSCTS (&tty->termios) || !tty_throttled (tty)) modem_signals |=TIOCM_RTS ;digi_set_modem_signals (port, modem_signals,1 ); }
@@ -1509,7 +1509,7 @@ static int digi_read_oob_callback(struct urb *urb) rts =0 ;if (tty) - rts =C_CRTSCTS (tty); + rts =C_CRTSCTS (&tty->termios);if (tty && opcode ==DIGI_CMD_READ_INPUT_SIGNALS ) {spin_lock (&priv->dp_port_lock);
drivers/usb/serial/f81232.c +6 -6
@@ -447,7 +447,7 @@ static void f81232_set_termios(struct tty_struct *tty,if (old_termios && !tty_termios_hw_change (&tty->termios, old_termios))return ; -if (C_BAUD (tty) ==B0 ) +if (C_BAUD (&tty->termios) ==B0 )f81232_set_mctrl (port,0 ,TIOCM_DTR |TIOCM_RTS );else if (old_termios && (old_termios->c_cflag &CBAUD ) ==B0 )f81232_set_mctrl (port,TIOCM_DTR |TIOCM_RTS ,0 );
@@ -461,20 +461,20 @@ static void f81232_set_termios(struct tty_struct *tty,f81232_set_baudrate (port, baudrate); } -if (C_PARENB (tty)) { +if (C_PARENB (&tty->termios)) { new_lcr |=UART_LCR_PARITY ; -if (!C_PARODD (tty)) +if (!C_PARODD (&tty->termios)) new_lcr |=UART_LCR_EPAR ; -if (C_CMSPAR (tty)) +if (C_CMSPAR (&tty->termios)) new_lcr |=UART_LCR_SPAR ; } -if (C_CSTOPB (tty)) +if (C_CSTOPB (&tty->termios)) new_lcr |=UART_LCR_STOP ; -switch (C_CSIZE (tty)) { +switch (C_CSIZE (&tty->termios)) {case CS5 : new_lcr |=UART_LCR_WLEN5 ;break ;
drivers/usb/serial/ftdi_sio.c +1 -1
@@ -2224,7 +2224,7 @@ static void ftdi_set_termios(struct tty_struct *tty,* The vendor didn't bother with a custom VID/PID of * course. */ -if (C_CSIZE (tty) ==CS6 ) { +if (C_CSIZE (&tty->termios) ==CS6 ) {dev_warn (ddev,"requested CSIZE setting not supported\n" ); termios->c_cflag &= ~CSIZE ;
drivers/usb/serial/generic.c +1 -1
@@ -596,7 +596,7 @@ void usb_serial_handle_dcd_change(struct usb_serial_port *usb_port,if (status)wake_up_interruptible (&port->open_wait); -else if (tty && !C_CLOCAL (tty)) +else if (tty && !C_CLOCAL (&tty->termios))tty_hangup (tty); }EXPORT_SYMBOL_GPL (usb_serial_handle_dcd_change);
drivers/usb/serial/io_edgeport.c +11 -11
@@ -1390,15 +1390,15 @@ static void edge_throttle(struct tty_struct *tty) }/* if we are implementing XON/XOFF, send the stop character */ -if (I_IXOFF (tty)) { -unsigned char stop_char =STOP_CHAR (tty); +if (I_IXOFF (&tty->termios)) { +unsigned char stop_char =STOP_CHAR (&tty->termios); status =edge_write (tty, port, &stop_char,1 );if (status <=0 )return ; }/* if we are implementing RTS/CTS, toggle that line */ -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) { edge_port->shadowMCR &= ~MCR_RTS ; status =send_cmd_write_uart_register (edge_port,MCR , edge_port->shadowMCR);
@@ -1428,14 +1428,14 @@ static void edge_unthrottle(struct tty_struct *tty) }/* if we are implementing XON/XOFF, send the start character */ -if (I_IXOFF (tty)) { -unsigned char start_char =START_CHAR (tty); +if (I_IXOFF (&tty->termios)) { +unsigned char start_char =START_CHAR (&tty->termios); status =edge_write (tty, port, &start_char,1 );if (status <=0 )return ; }/* if we are implementing RTS/CTS, toggle that line */ -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) { edge_port->shadowMCR |=MCR_RTS ;send_cmd_write_uart_register (edge_port,MCR , edge_port->shadowMCR);
@@ -2457,9 +2457,9 @@ static void change_port_settings(struct tty_struct *tty,/* if we are implementing XON/XOFF, set the start and stop character in the device */ -if (I_IXOFF (tty) ||I_IXON (tty)) { -unsigned char stop_char =STOP_CHAR (tty); -unsigned char start_char =START_CHAR (tty); +if (I_IXOFF (&tty->termios) ||I_IXON (&tty->termios)) { +unsigned char stop_char =STOP_CHAR (&tty->termios); +unsigned char start_char =START_CHAR (&tty->termios);if (!edge_serial->is_epic || edge_serial->epic_descriptor.Supports.IOSPSetXChar) {
@@ -2470,7 +2470,7 @@ static void change_port_settings(struct tty_struct *tty, }/* if we are implementing INBOUND XON/XOFF */ -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) { rxFlow |=IOSP_RX_FLOW_XON_XOFF ;dev_dbg (dev,"%s - INBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x\n" , __func__, start_char, stop_char);
@@ -2479,7 +2479,7 @@ static void change_port_settings(struct tty_struct *tty, }/* if we are implementing OUTBOUND XON/XOFF */ -if (I_IXON (tty)) { +if (I_IXON (&tty->termios)) { txFlow |=IOSP_TX_FLOW_XON_XOFF ;dev_dbg (dev,"%s - OUTBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x\n" , __func__, start_char, stop_char);
drivers/usb/serial/io_ti.c +11 -11
@@ -1585,7 +1585,7 @@ static void handle_new_msr(struct edgeport_port *edge_port, __u8 msr) tty =tty_port_tty_get (&edge_port->port->port);/* handle CTS flow control */ -if (tty &&C_CRTSCTS (tty)) { +if (tty &&C_CRTSCTS (&tty->termios)) {if (msr &EDGEPORT_MSR_CTS )tty_wakeup (tty); }
@@ -2155,8 +2155,8 @@ static void edge_throttle(struct tty_struct *tty)return ;/* if we are implementing XON/XOFF, send the stop character */ -if (I_IXOFF (tty)) { -unsigned char stop_char =STOP_CHAR (tty); +if (I_IXOFF (&tty->termios)) { +unsigned char stop_char =STOP_CHAR (&tty->termios); status =edge_write (tty, port, &stop_char,1 );if (status <=0 ) {dev_err (&port->dev,"%s - failed to write stop character, %d\n" , __func__, status);
@@ -2167,7 +2167,7 @@ static void edge_throttle(struct tty_struct *tty)* if we are implementing RTS/CTS, stop reads * and the Edgeport will clear the RTS line */ -if (C_CRTSCTS (tty)) +if (C_CRTSCTS (&tty->termios))stop_read (edge_port); }
@@ -2182,8 +2182,8 @@ static void edge_unthrottle(struct tty_struct *tty)return ;/* if we are implementing XON/XOFF, send the start character */ -if (I_IXOFF (tty)) { -unsigned char start_char =START_CHAR (tty); +if (I_IXOFF (&tty->termios)) { +unsigned char start_char =START_CHAR (&tty->termios); status =edge_write (tty, port, &start_char,1 );if (status <=0 ) {dev_err (&port->dev,"%s - failed to write start character, %d\n" , __func__, status);
@@ -2193,7 +2193,7 @@ static void edge_unthrottle(struct tty_struct *tty)* if we are implementing RTS/CTS, restart reads * are the Edgeport will assert the RTS line */ -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) { status =restart_read (edge_port);if (status) dev_err(&port->dev,
@@ -2318,11 +2318,11 @@ static void change_port_settings(struct tty_struct *tty,* if we are implementing XON/XOFF, set the start and stop * character in the device */ - config->cXon =START_CHAR (tty); - config->cXoff =STOP_CHAR (tty); + config->cXon =START_CHAR (&tty->termios); + config->cXoff =STOP_CHAR (&tty->termios);/* if we are implementing INBOUND XON/XOFF */ -if (I_IXOFF (tty)) { +if (I_IXOFF (&tty->termios)) { config->wFlags |=UMP_MASK_UART_FLAGS_IN_X ;dev_dbg (dev,"%s - INBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x\n" , __func__, config->cXon, config->cXoff);
@@ -2330,7 +2330,7 @@ static void change_port_settings(struct tty_struct *tty,dev_dbg (dev,"%s - INBOUND XON/XOFF is disabled\n" , __func__);/* if we are implementing OUTBOUND XON/XOFF */ -if (I_IXON (tty)) { +if (I_IXON (&tty->termios)) { config->wFlags |=UMP_MASK_UART_FLAGS_OUT_X ;dev_dbg (dev,"%s - OUTBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x\n" , __func__, config->cXon, config->cXoff);
drivers/usb/serial/mct_u232.c +4 -4
@@ -230,7 +230,7 @@ static int mct_u232_set_baud_rate(struct tty_struct *tty,"failed (error = %d)\n" ,MCT_U232_SET_UNKNOWN1_REQUEST , rc); -if (port &&C_CRTSCTS (tty)) +if (port &&C_CRTSCTS (&tty->termios)) cts_enable_byte =1 ; dev_dbg(&port->dev, "set_baud_rate: send second control message, data = %02X\n",
@@ -435,7 +435,7 @@ static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port)* either. */ spin_lock_irqsave (&priv->lock, flags); -if (tty &&C_BAUD (tty)) +if (tty &&C_BAUD (&tty->termios)) priv->control_state =TIOCM_DTR |TIOCM_RTS ;else priv->control_state =0 ;
@@ -743,7 +743,7 @@ static void mct_u232_throttle(struct tty_struct *tty)spin_lock_irq (&priv->lock); priv->rx_flags |=THROTTLED ; -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) { priv->control_state &= ~TIOCM_RTS ; control_state = priv->control_state;spin_unlock_irq (&priv->lock);
@@ -760,7 +760,7 @@ static void mct_u232_unthrottle(struct tty_struct *tty)unsigned int control_state;spin_lock_irq (&priv->lock); -if ((priv->rx_flags &THROTTLED ) &&C_CRTSCTS (tty)) { +if ((priv->rx_flags &THROTTLED ) &&C_CRTSCTS (&tty->termios)) { priv->rx_flags &= ~THROTTLED ; priv->control_state |=TIOCM_RTS ; control_state = priv->control_state;
drivers/usb/serial/mos7720.c +6 -6
@@ -1300,15 +1300,15 @@ static void mos7720_throttle(struct tty_struct *tty) }/* if we are implementing XON/XOFF, send the stop character */ -if (I_IXOFF (tty)) { -unsigned char stop_char =STOP_CHAR (tty); +if (I_IXOFF (&tty->termios)) { +unsigned char stop_char =STOP_CHAR (&tty->termios); status =mos7720_write (tty, port, &stop_char,1 );if (status <=0 )return ; }/* if we are implementing RTS/CTS, toggle that line */ -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) { mos7720_port->shadowMCR &= ~UART_MCR_RTS ;write_mos_reg (port->serial, port->port_number,MOS7720_MCR , mos7720_port->shadowMCR);
@@ -1330,15 +1330,15 @@ static void mos7720_unthrottle(struct tty_struct *tty) }/* if we are implementing XON/XOFF, send the start character */ -if (I_IXOFF (tty)) { -unsigned char start_char =START_CHAR (tty); +if (I_IXOFF (&tty->termios)) { +unsigned char start_char =START_CHAR (&tty->termios); status =mos7720_write (tty, port, &start_char,1 );if (status <=0 )return ; }/* if we are implementing RTS/CTS, toggle that line */ -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) { mos7720_port->shadowMCR |=UART_MCR_RTS ;write_mos_reg (port->serial, port->port_number,MOS7720_MCR , mos7720_port->shadowMCR);
drivers/usb/serial/mos7840.c +6 -6
@@ -1418,14 +1418,14 @@ static void mos7840_throttle(struct tty_struct *tty) }/* if we are implementing XON/XOFF, send the stop character */ -if (I_IXOFF (tty)) { -unsigned char stop_char =STOP_CHAR (tty); +if (I_IXOFF (&tty->termios)) { +unsigned char stop_char =STOP_CHAR (&tty->termios); status =mos7840_write (tty, port, &stop_char,1 );if (status <=0 )return ; }/* if we are implementing RTS/CTS, toggle that line */ -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) { mos7840_port->shadowMCR &= ~MCR_RTS ; status =mos7840_set_uart_reg (port,MODEM_CONTROL_REGISTER , mos7840_port->shadowMCR);
@@ -1458,15 +1458,15 @@ static void mos7840_unthrottle(struct tty_struct *tty) }/* if we are implementing XON/XOFF, send the start character */ -if (I_IXOFF (tty)) { -unsigned char start_char =START_CHAR (tty); +if (I_IXOFF (&tty->termios)) { +unsigned char start_char =START_CHAR (&tty->termios); status =mos7840_write (tty, port, &start_char,1 );if (status <=0 )return ; }/* if we are implementing RTS/CTS, toggle that line */ -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) { mos7840_port->shadowMCR |=MCR_RTS ; status =mos7840_set_uart_reg (port,MODEM_CONTROL_REGISTER , mos7840_port->shadowMCR);
drivers/usb/serial/mxuport.c +13 -13
@@ -775,8 +775,8 @@ static int mxuport_set_termios_flow(struct tty_struct *tty,struct usb_serial_port *port, struct usb_serial *serial) { - u8 xon = START_CHAR(tty); -u8 xoff =STOP_CHAR (tty); + u8 xon = START_CHAR(&tty->termios); +u8 xoff =STOP_CHAR (&tty->termios);int enable;int err;u8 *buf;
@@ -787,7 +787,7 @@ static int mxuport_set_termios_flow(struct tty_struct *tty,return -ENOMEM ;/* S/W flow control settings */ -if (I_IXOFF (tty) ||I_IXON (tty)) { +if (I_IXOFF (&tty->termios) ||I_IXON (&tty->termios)) { enable =1 ; buf[0 ] = xon; buf[1 ] = xoff;
@@ -813,17 +813,17 @@ static int mxuport_set_termios_flow(struct tty_struct *tty,/* H/W flow control settings */ if (!old_termios || -C_CRTSCTS (tty) != (old_termios->c_cflag &CRTSCTS )) { -if (C_CRTSCTS (tty)) +C_CRTSCTS (&tty->termios) != (old_termios->c_cflag &CRTSCTS )) { +if (C_CRTSCTS (&tty->termios)) rts =MX_RTS_HW ;else rts =MX_RTS_ENABLE ; } -if (C_BAUD (tty)) { +if (C_BAUD (&tty->termios)) {if (old_termios && (old_termios->c_cflag &CBAUD ) ==B0 ) {/* Raise DTR and RTS */ -if (C_CRTSCTS (tty)) +if (C_CRTSCTS (&tty->termios)) rts =MX_RTS_HW ;else rts =MX_RTS_ENABLE ;
@@ -867,7 +867,7 @@ static void mxuport_set_termios(struct tty_struct *tty,return ;/* Set data bit of termios */ -switch (C_CSIZE (tty)) { +switch (C_CSIZE (&tty->termios)) {case CS5 : data_bits =MX_WORDLENGTH_5 ;break ;
@@ -884,14 +884,14 @@ static void mxuport_set_termios(struct tty_struct *tty, }/* Set parity of termios */ -if (C_PARENB (tty)) { -if (C_CMSPAR (tty)) { -if (C_PARODD (tty)) +if (C_PARENB (&tty->termios)) { +if (C_CMSPAR (&tty->termios)) { +if (C_PARODD (&tty->termios)) parity =MX_PARITY_MARK ;else parity =MX_PARITY_SPACE ; }else { -if (C_PARODD (tty)) +if (C_PARODD (&tty->termios)) parity =MX_PARITY_ODD ;else parity =MX_PARITY_EVEN ;
@@ -901,7 +901,7 @@ static void mxuport_set_termios(struct tty_struct *tty, }/* Set stop bit of termios */ -if (C_CSTOPB (tty)) +if (C_CSTOPB (&tty->termios)) stop_bits =MX_STOP_BITS_2 ;else stop_bits =MX_STOP_BITS_1 ;
drivers/usb/serial/pl2303.c +9 -9
@@ -499,7 +499,7 @@ static void pl2303_set_termios(struct tty_struct *tty,pl2303_get_line_request (port, buf); -switch (C_CSIZE (tty)) { +switch (C_CSIZE (&tty->termios)) {case CS5 : buf[6 ] =5 ;break ;
@@ -521,12 +521,12 @@ static void pl2303_set_termios(struct tty_struct *tty,/* For reference buf[4]=0 is 1 stop bits */ /* For reference buf[4]=1 is 1.5 stop bits */ /* For reference buf[4]=2 is 2 stop bits */ -if (C_CSTOPB (tty)) { +if (C_CSTOPB (&tty->termios)) {/* * NOTE: Comply with "real" UARTs / RS232: * use 1.5 instead of 2 stop bits with 5 data bits */ -if (C_CSIZE (tty) ==CS5 ) { +if (C_CSIZE (&tty->termios) ==CS5 ) { buf[4 ] =1 ;dev_dbg (&port->dev,"stop bits = 1.5\n" ); }else {
@@ -538,14 +538,14 @@ static void pl2303_set_termios(struct tty_struct *tty,dev_dbg (&port->dev,"stop bits = 1\n" ); } -if (C_PARENB (tty)) { +if (C_PARENB (&tty->termios)) {/* For reference buf[5]=0 is none parity */ /* For reference buf[5]=1 is odd parity */ /* For reference buf[5]=2 is even parity */ /* For reference buf[5]=3 is mark parity */ /* For reference buf[5]=4 is space parity */ -if (C_PARODD (tty)) { -if (C_CMSPAR (tty)) { +if (C_PARODD (&tty->termios)) { +if (C_CMSPAR (&tty->termios)) { buf[5 ] =3 ;dev_dbg (&port->dev,"parity = mark\n" ); }else {
@@ -553,7 +553,7 @@ static void pl2303_set_termios(struct tty_struct *tty,dev_dbg (&port->dev,"parity = odd\n" ); } }else { -if (C_CMSPAR (tty)) { +if (C_CMSPAR (&tty->termios)) { buf[5 ] =4 ;dev_dbg (&port->dev,"parity = space\n" ); }else {
@@ -587,7 +587,7 @@ static void pl2303_set_termios(struct tty_struct *tty,/* change control lines if we are switching to or from B0 */ spin_lock_irqsave (&priv->lock, flags); control = priv->line_control; -if (C_BAUD (tty) ==B0 ) +if (C_BAUD (&tty->termios) ==B0 ) priv->line_control &= ~(CONTROL_DTR |CONTROL_RTS );else if (old_termios && (old_termios->c_cflag &CBAUD ) ==B0 ) priv->line_control |= (CONTROL_DTR |CONTROL_RTS );
@@ -599,7 +599,7 @@ static void pl2303_set_termios(struct tty_struct *tty,spin_unlock_irqrestore (&priv->lock, flags); } -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) {if (spriv->quirks &PL2303_QUIRK_LEGACY )pl2303_vendor_write (serial,0x0 ,0x41 );else
drivers/usb/serial/quatech2.c +2 -2
@@ -321,8 +321,8 @@ static void qt2_set_termios(struct tty_struct *tty,dev_err (&port->dev,"%s - set HW flow control failed: %i\n" , __func__, status); -if (I_IXOFF (tty) ||I_IXON (tty)) { -u16 x = ((u16) (START_CHAR (tty) <<8 ) | (u16) (STOP_CHAR (tty))); +if (I_IXOFF (&tty->termios) ||I_IXON (&tty->termios)) { +u16 x = ((u16) (START_CHAR (&tty->termios) <<8 ) | (u16) (STOP_CHAR (&tty->termios))); status =qt2_control_msg (dev,QT_SW_FLOW_CONTROL_MASK , x, port_priv->device_port);
drivers/usb/serial/ssu100.c +2 -2
@@ -258,8 +258,8 @@ static void ssu100_set_termios(struct tty_struct *tty,if (result <0 )dev_dbg (&port->dev,"%s - set HW flow control failed\n" , __func__); -if (I_IXOFF (tty) ||I_IXON (tty)) { -u16 x = ((u16)(START_CHAR (tty) <<8 ) | (u16)(STOP_CHAR (tty))); +if (I_IXOFF (&tty->termios) ||I_IXON (&tty->termios)) { +u16 x = ((u16)(START_CHAR (&tty->termios) <<8 ) | (u16)(STOP_CHAR (&tty->termios))); result =ssu100_control_msg (dev,QT_SW_FLOW_CONTROL_MASK , x,0 );
drivers/usb/serial/ti_usb_3410_5052.c +8 -8
@@ -903,7 +903,7 @@ static void ti_throttle(struct tty_struct *tty)if (tport ==NULL )return ; -if (I_IXOFF (tty) ||C_CRTSCTS (tty)) +if (I_IXOFF (&tty->termios) ||C_CRTSCTS (&tty->termios))ti_stop_read (tport, tty); }
@@ -918,7 +918,7 @@ static void ti_unthrottle(struct tty_struct *tty)if (tport ==NULL )return ; -if (I_IXOFF (tty) ||C_CRTSCTS (tty)) { +if (I_IXOFF (&tty->termios) ||C_CRTSCTS (&tty->termios)) { status =ti_restart_read (tport, tty);if (status) dev_err(&port->dev, "%s - cannot restart read, %d\n",
@@ -1027,16 +1027,16 @@ static void ti_set_termios(struct tty_struct *tty,ti_restart_read (tport, tty); } -if (I_IXOFF (tty) ||I_IXON (tty)) { - config->cXon =START_CHAR (tty); - config->cXoff =STOP_CHAR (tty); +if (I_IXOFF (&tty->termios) ||I_IXON (&tty->termios)) { + config->cXon =START_CHAR (&tty->termios); + config->cXoff =STOP_CHAR (&tty->termios); -if (I_IXOFF (tty)) +if (I_IXOFF (&tty->termios)) config->wFlags |=TI_UART_ENABLE_X_IN ;else ti_restart_read (tport, tty); -if (I_IXON (tty)) +if (I_IXON (&tty->termios)) config->wFlags |=TI_UART_ENABLE_X_OUT ; }
@@ -1549,7 +1549,7 @@ static void ti_handle_new_msr(struct ti_port *tport, __u8 msr)/* handle CTS flow control */ tty =tty_port_tty_get (&tport->tp_port->port); -if (tty &&C_CRTSCTS (tty)) { +if (tty &&C_CRTSCTS (&tty->termios)) {if (msr &TI_MSR_CTS )tty_wakeup (tty); }
drivers/usb/serial/whiteheat.c +3 -3
@@ -726,14 +726,14 @@ static void firm_setup_port(struct tty_struct *tty) (port_settings.hflow & WHITEHEAT_HFLOW_DTR) ? "DTR" : "");/* determine software flow control */ -if (I_IXOFF (tty)) +if (I_IXOFF (&tty->termios)) port_settings.sflow =WHITEHEAT_SFLOW_RXTX ;else port_settings.sflow =WHITEHEAT_SFLOW_NONE ;dev_dbg (dev,"%s - software flow control = %c\n" , __func__, port_settings.sflow); - port_settings.xon =START_CHAR (tty); - port_settings.xoff =STOP_CHAR (tty); + port_settings.xon =START_CHAR (&tty->termios); + port_settings.xoff =STOP_CHAR (&tty->termios);dev_dbg (dev,"%s - XON = %2x, XOFF = %2x\n" , __func__, port_settings.xon, port_settings.xoff);/* get the baud rate wanted */
include/linux/tty.h +82 -82
170 lines not on this page · raw message
net/irda/ircomm/ircomm_tty.c +9 -9
@@ -288,14 +288,14 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,if (filp->f_flags &O_NONBLOCK ) {/* nonblock mode is set */ -if (C_BAUD (tty)) +if (C_BAUD (&tty->termios))tty_port_raise_dtr_rts (port);tty_port_set_active (port,1 );pr_debug ("%s(), O_NONBLOCK requested!\n" , __func__);return 0 ; } -if (C_CLOCAL (tty)) { +if (C_CLOCAL (&tty->termios)) {pr_debug ("%s(), doing CLOCAL!\n" , __func__); do_clocal =1 ; }
@@ -319,7 +319,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,spin_unlock_irqrestore (&port->lock, flags);while (1 ) { -if (C_BAUD (tty) &&tty_port_initialized (port)) +if (C_BAUD (&tty->termios) &&tty_port_initialized (port))tty_port_raise_dtr_rts (port);set_current_state (TASK_INTERRUPTIBLE );
@@ -802,11 +802,11 @@ static void ircomm_tty_throttle(struct tty_struct *tty) IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);/* Software flow control? */ -if (I_IXOFF (tty)) -ircomm_tty_send_xchar (tty,STOP_CHAR (tty)); +if (I_IXOFF (&tty->termios)) +ircomm_tty_send_xchar (tty,STOP_CHAR (&tty->termios));/* Hardware flow control? */ -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) { self->settings.dte &= ~IRCOMM_RTS ; self->settings.dte |=IRCOMM_DELTA_RTS ;
@@ -831,11 +831,11 @@ static void ircomm_tty_unthrottle(struct tty_struct *tty) IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);/* Using software flow control? */ -if (I_IXOFF (tty)) -ircomm_tty_send_xchar (tty,START_CHAR (tty)); +if (I_IXOFF (&tty->termios)) +ircomm_tty_send_xchar (tty,START_CHAR (&tty->termios));/* Using hardware flow control? */ -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (&tty->termios)) { self->settings.dte |= (IRCOMM_RTS |IRCOMM_DELTA_RTS );ircomm_param_request (self,IRCOMM_DTE , TRUE);
net/irda/ircomm/ircomm_tty_ioctl.c +2 -2
@@ -162,13 +162,13 @@ void ircomm_tty_set_termios(struct tty_struct *tty,/* Handle transition away from B0 status */ if (!(old_termios->c_cflag &CBAUD ) && (cflag &CBAUD )) { self->settings.dte |=IRCOMM_DTR ; -if (!C_CRTSCTS (tty) || !tty_throttled (tty)) +if (!C_CRTSCTS (&tty->termios) || !tty_throttled (tty)) self->settings.dte |=IRCOMM_RTS ;ircomm_param_request (self,IRCOMM_DTE , TRUE); }/* Handle turning off CRTSCTS */ -if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (tty)) +if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios)) { tty->hw_stopped =0 ;ircomm_tty_start (tty);
Signature · 1 line
2.9.3
Re: [PATCH 2/9] tty: remove tty_struct dependency in tty flag macros
Quoted 4 lines · Rob Herring
In preparation to support tty drivers having only a
tty_portand possibly not atty_struct, convert all the termios flag macros to take a termios ptr instead of thetty_structptr. After this change drivers can be converted to support a termios struct other thantty->termios.
[...]
Quoted 14 lines
drivers/dma/at_xdmac.c +1
-1@@ -560,7 +560,7 @@ static int at_xdmac_compute_chan_conf(struct dma_chan *chan,dev_err (chan2dev (chan),"invalid src maxburst value\n" );return -EINVAL ; } - atchan->cfg |=AT_XDMAC_CC_CSIZE (csize); + atchan->cfg |=AT_XDMAC_CC_CSIZE (&csize->termios); dwidth =ffs (atchan->sconfig.src_addr_width) -1 ;if (dwidth <0 ) {dev_err (chan2dev (chan),"invalid src addr width value\n" );
drivers/dma/at_xdmac.c static int at_xdmac_compute_chan_conf(struct dma_chan *chan, · line 589
Quoted 8 lines
drivers/dma/at_xdmac.c +1
-1@@ -583,7 +583,7 @@ static int at_xdmac_compute_chan_conf(struct dma_chan *chan,dev_err (chan2dev (chan),"invalid src maxburst value\n" );return -EINVAL ; } - atchan->cfg |=AT_XDMAC_CC_CSIZE (csize); + atchan->cfg |=AT_XDMAC_CC_CSIZE (&csize->termios); dwidth =ffs (atchan->sconfig.dst_addr_width) -1 ;if (dwidth <0 ) {dev_err (chan2dev (chan),"invalid dst addr width value\n" );
This file needs to be dropped. There were a few false matches and I missed this one.
Rob
PATCH 3/9 tty: move hw_stopped flag to tty_port
In reply to Rob Herringhw_stopped is a property of the tty port rather than the tty, so move it to tty_port struct and remove another dependency on tty_struct from drivers.
Converted with coccinelle:
@@
identifier t;
@@
- t->hw_stopped
+ t->port->hw_stopped
@@
expression port;
@@
- port.tty->hw_stopped
+ port.hw_stopped
--- drivers/char/pcmcia/synclink_cs.c | 16 ++++++++-------- drivers/mmc/card/sdio_uart.c | 14 +++++++------- drivers/staging/fwserial/fwserial.c | 20 +++++++++---------- drivers/tty/amiserial.c | 38 ++++++++++++++++++------------------- drivers/tty/cyclades.c | 14 +++++++------- drivers/tty/isicom.c | 14 +++++++------- drivers/tty/mxser.c | 28 +++++++++++++-------------- drivers/tty/serial/bfin_uart.c | 6 +++--- drivers/tty/synclink.c | 16 ++++++++-------- drivers/tty/synclink_gt.c | 14 +++++++------- drivers/tty/synclinkmp.c | 16 ++++++++-------- include/linux/tty.h | 2 +- net/irda/ircomm/ircomm_tty.c | 20 +++++++++---------- net/irda/ircomm/ircomm_tty_attach.c | 6 +++--- net/irda/ircomm/ircomm_tty_ioctl.c | 2 +- 15 files changed, 113 insertions(+), 113 deletions(-)
drivers/char/pcmcia/synclink_cs.c +8 -8
@@ -987,7 +987,7 @@ static void tx_done(MGSLPC_INFO *info, struct tty_struct *tty) else#endif { -if (tty && (tty->stopped || tty->hw_stopped)) { +if (tty && (tty->stopped || tty->port->hw_stopped)) {tx_stop (info);return ; }
@@ -1007,7 +1007,7 @@ static void tx_ready(MGSLPC_INFO *info, struct tty_struct *tty)if (!info->tx_active)return ; }else { -if (tty && (tty->stopped || tty->hw_stopped)) { +if (tty && (tty->stopped || tty->port->hw_stopped)) {tx_stop (info);return ; }
@@ -1058,11 +1058,11 @@ static void cts_change(MGSLPC_INFO *info, struct tty_struct *tty)wake_up_interruptible (&info->event_wait_q);if (tty &&tty_port_cts_enabled (&info->port)) { -if (tty->hw_stopped) { +if (tty->port->hw_stopped) {if (info->serial_signals & SerialSignal_CTS) {if (debug_level >=DEBUG_LEVEL_ISR )printk ("CTS tx start..." ); - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;tx_start (info, tty); info->pending_bh |=BH_TRANSMIT ;return ;
@@ -1071,7 +1071,7 @@ static void cts_change(MGSLPC_INFO *info, struct tty_struct *tty)if (!(info->serial_signals & SerialSignal_CTS)) {if (debug_level >=DEBUG_LEVEL_ISR )printk ("CTS tx stop..." ); - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ;tx_stop (info); } }
@@ -1528,7 +1528,7 @@ static void mgslpc_flush_chars(struct tty_struct *tty)return ;if (info->tx_count <=0 || tty->stopped || - tty->hw_stopped || !info->tx_buf) + tty->port->hw_stopped || !info->tx_buf)return ;if (debug_level >=DEBUG_LEVEL_INFO )
@@ -1596,7 +1596,7 @@ static int mgslpc_write(struct tty_struct * tty, ret += c; } start: -if (info->tx_count && !tty->stopped && !tty->hw_stopped) { +if (info->tx_count && !tty->stopped && !tty->port->hw_stopped) {spin_lock_irqsave (&info->lock, flags);if (!info->tx_active)tx_start (info, tty);
@@ -2318,7 +2318,7 @@ static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_term/* Handle turning off CRTSCTS */ if (old_termios->c_cflag &CRTSCTS && !C_CRTSCTS (&tty->termios)) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;tx_release (tty); } }
drivers/mmc/card/sdio_uart.c +7 -7
@@ -445,7 +445,7 @@ static void sdio_uart_transmit_chars(struct sdio_uart_port *port) tty =tty_port_tty_get (&port->port);if (tty ==NULL || !kfifo_len (xmit) || - tty->stopped || tty->hw_stopped) { + tty->stopped || tty->port->hw_stopped) {sdio_uart_stop_tx (port);tty_kref_put (tty);return ;
@@ -495,15 +495,15 @@ static void sdio_uart_check_modem_status(struct sdio_uart_port *port) tty =tty_port_tty_get (&port->port);if (tty &&C_CRTSCTS (&tty->termios)) {int cts = (status &UART_MSR_CTS ); -if (tty->hw_stopped) { +if (tty->port->hw_stopped) {if (cts) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;sdio_uart_start_tx (port);tty_wakeup (tty); } }else {if (!cts) { - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ;sdio_uart_stop_tx (port); } }
@@ -653,7 +653,7 @@ static int sdio_uart_activate(struct tty_port *tport, struct tty_struct *tty)if (C_CRTSCTS (&tty->termios))if (!(sdio_uart_get_mctrl (port) &TIOCM_CTS )) - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ;clear_bit (TTY_IO_ERROR , &tty->flags);
@@ -902,14 +902,14 @@ static void sdio_uart_set_termios(struct tty_struct *tty,/* Handle turning off CRTSCTS */ if ((old_termios->c_cflag &CRTSCTS ) && !(cflag &CRTSCTS )) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;sdio_uart_start_tx (port); }/* Handle turning on CRTSCTS */ if (!(old_termios->c_cflag &CRTSCTS ) && (cflag &CRTSCTS )) {if (!(sdio_uart_get_mctrl (port) &TIOCM_CTS )) { - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ;sdio_uart_stop_tx (port); } }
drivers/staging/fwserial/fwserial.c +10 -10
@@ -340,9 +340,9 @@ static void fwtty_update_port_status(struct fwtty_port *port,if (delta &TIOCM_CTS ) { tty =tty_port_tty_get (&port->port);if (tty &&C_CRTSCTS (&tty->termios)) { -if (tty->hw_stopped) { +if (tty->port->hw_stopped) {if (status &TIOCM_CTS ) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;if (port->loopback)__fwtty_restart_tx (port);else
@@ -350,7 +350,7 @@ static void fwtty_update_port_status(struct fwtty_port *port, } }else {if (~status &TIOCM_CTS ) - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ; } }tty_kref_put (tty);
@@ -358,9 +358,9 @@ static void fwtty_update_port_status(struct fwtty_port *port, }else if (delta &OOB_TX_THROTTLE ) { tty =tty_port_tty_get (&port->port);if (tty) { -if (tty->hw_stopped) { +if (tty->port->hw_stopped) {if (~status &OOB_TX_THROTTLE ) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;if (port->loopback)__fwtty_restart_tx (port);else
@@ -368,7 +368,7 @@ static void fwtty_update_port_status(struct fwtty_port *port, } }else {if (status &OOB_TX_THROTTLE ) - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ; } }tty_kref_put (tty);
@@ -735,7 +735,7 @@ static int fwtty_tx(struct fwtty_port *port, bool drain)/* try to write as many dma transactions out as possible */ n = -EAGAIN ; -while (!tty->stopped && !tty->hw_stopped && +while (!tty->stopped && !tty->port->hw_stopped && !test_bit (STOP_TX , &port->flags)) { txn =kmem_cache_alloc (fwtty_txn_cache,GFP_ATOMIC );if (!txn) {
@@ -1014,7 +1014,7 @@ static int fwtty_port_activate(struct tty_port *tty_port, }if (C_CRTSCTS (&tty->termios) && ~port->mstatus &TIOCM_CTS ) - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ;__fwtty_write_port_status (port);spin_unlock_bh (&port->lock);
@@ -1316,11 +1316,11 @@ static void fwtty_set_termios(struct tty_struct *tty, struct ktermios *old)if (old->c_cflag &CRTSCTS ) {if (!C_CRTSCTS (&tty->termios)) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;fwtty_restart_tx (port); } }else if (C_CRTSCTS (&tty->termios) && ~port->mstatus &TIOCM_CTS ) { - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ; } }
drivers/tty/amiserial.c +19 -19
@@ -16,7 +16,7 @@* Richard Lucock 28/12/99 * * Copyright (C) 1991, 1992 Linus Torvalds -* Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, +* Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, * 1998, 1999 Theodore Ts'o * */
@@ -237,7 +237,7 @@ static void rs_start(struct tty_struct *tty)* rs_interrupt() should try to keep the interrupt handler as fast as * possible. After you are done making modifications, it is not a bad * idea to do: -* +* * gcc -S -DKERNEL -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer serial.c * * and look at the resulting assemble code in serial.s.
@@ -347,7 +347,7 @@ static void transmit_chars(struct serial_state *info) }if (info->xmit.head == info->xmit.tail || info->tport.tty->stopped - || info->tport.tty->hw_stopped) { + || info->tport.hw_stopped) { info->IER &= ~UART_IER_THRI ; custom.intena =IF_TBE ;mb ();
@@ -414,12 +414,12 @@ static void check_modem_status(struct serial_state *info) } }if (tty_port_cts_enabled (port)) { -if (port->tty->hw_stopped) { +if (port->hw_stopped) {if (!(status &SER_CTS )) {#if (defined(SERIAL_DEBUG_INTR ) || defined(SERIAL_DEBUG_FLOW ))printk ("CTS tx start..." );#endif - port->tty->hw_stopped =0 ; + port->hw_stopped =0 ; info->IER |=UART_IER_THRI ; custom.intena =IF_SETCLR |IF_TBE ;mb ();
@@ -434,7 +434,7 @@ static void check_modem_status(struct serial_state *info)#if (defined(SERIAL_DEBUG_INTR ) || defined(SERIAL_DEBUG_FLOW ))printk ("CTS tx stop..." );#endif - port->tty->hw_stopped =1 ; + port->hw_stopped =1 ; info->IER &= ~UART_IER_THRI ;/* disable Tx interrupt and remove any pending interrupts */ custom.intena =IF_TBE ;
@@ -756,7 +756,7 @@ static void change_speed(struct tty_struct *tty, struct serial_state *info,if (I_IGNBRK (&tty->termios)) { info->ignore_status_mask |=UART_LSR_BI ;/* -* If we're ignore parity and break indicators, ignore +* If we're ignore parity and break indicators, ignore * overruns too. (For real raw support). */ if (I_IGNPAR (&tty->termios))
@@ -824,7 +824,7 @@ static void rs_flush_chars(struct tty_struct *tty)if (info->xmit.head == info->xmit.tail || tty->stopped - || tty->hw_stopped + || tty->port->hw_stopped || !info->xmit.buf)return ;
@@ -871,7 +871,7 @@ static int rs_write(struct tty_struct * tty, const unsigned char *buf, int countif (info->xmit.head != info->xmit.tail && !tty->stopped - && !tty->hw_stopped + && !tty->port->hw_stopped && !(info->IER &UART_IER_THRI )) { info->IER |=UART_IER_THRI ;local_irq_disable ();
@@ -950,7 +950,7 @@ static void rs_send_xchar(struct tty_struct *tty, char ch)/* * ------------------------------------------------------------ * rs_throttle() -* +* * This routine is called by the upper-layer tty layer to signal that * incoming characters should be throttled. * ------------------------------------------------------------
@@ -1011,7 +1011,7 @@ static int get_serial_info(struct tty_struct *tty, struct serial_state *state, struct serial_struct __user * retinfo) {struct serial_struct tmp; - +if (!retinfo)return -EFAULT ;memset (&tmp,0 ,sizeof (tmp));
@@ -1049,7 +1049,7 @@ static int set_serial_info(struct tty_struct *tty, struct serial_state *state,tty_unlock (tty);return -EINVAL ; } - +if (!serial_isroot ()) { if ((new_serial.baud_base != state->baud_base) || (new_serial.close_delay != port->close_delay) ||
@@ -1111,7 +1111,7 @@ check_and_exit:* release the bus after transmitting. This must be done when * the transmit shift register is empty, not be done when the * transmit holding register is empty. This functionality -* allows an RS485 driver to be written in user space. +* allows an RS485 driver to be written in user space. */ static int get_lsr_info (struct serial_state *info,unsigned int __user *value) {
@@ -1283,7 +1283,7 @@ static int rs_ioctl(struct tty_struct *tty,local_irq_save (flags); cnow = info->icount;/* atomic copy */ local_irq_restore (flags); -if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && +if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) { ret = -EIO ;/* no change => error */ break ;
@@ -1346,7 +1346,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)/* Handle turning off CRTSCTS */ if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios)) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;rs_start (tty); }
@@ -1365,7 +1365,7 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)/* * ------------------------------------------------------------ * rs_close() -* +* * This routine is called when the serial port gets closed. First, we * wait for the last remaining data to be sent. Then, we unlink its * async structure from the interrupt chain if necessary, and we free
@@ -1407,7 +1407,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) }shutdown (tty, state);rs_flush_buffer (tty); - +tty_ldisc_flush (tty); port->tty =NULL ;
@@ -1435,7 +1435,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)* Set the check interval to be 1/5 of the estimated time to * send a single character, and make it at least 1. The check * interval should also be less than the timeout. -* +* * Note: we have to use pretty tight timings here to satisfy * the NIST-PCTS. */
@@ -1699,7 +1699,7 @@ static int __init amiga_serial_probe(struct platform_device *pdev) state = rs_table; state->port = (int )&custom.serdatr;/* Just to give it a value */ state->custom_divisor =0 ; - state->icount.cts = state->icount.dsr = + state->icount.cts = state->icount.dsr = state->icount.rng = state->icount.dcd =0 ; state->icount.rx = state->icount.tx =0 ; state->icount.frame = state->icount.parity =0 ;
drivers/tty/cyclades.c +7 -7
@@ -633,7 +633,7 @@ static void cyy_chip_tx(struct cyclades_card *cinfo, unsigned int chip, cyy_readb(info, CySRER) & ~CyTxRdy); goto done; } -if (tty->stopped || tty->hw_stopped) { +if (tty->stopped || tty->port->hw_stopped) {cyy_writeb (info, CySRER,cyy_readb (info, CySRER) & ~CyTxRdy); goto done;
@@ -719,11 +719,11 @@ static void cyy_chip_modem(struct cyclades_card *cinfo, int chip,tty_hangup (tty); }if ((mdm_change & CyCTS) &&tty_port_cts_enabled (&info->port)) { -if (tty->hw_stopped) { +if (tty->port->hw_stopped) {if (mdm_status & CyCTS) {/* cy_start isn't used because... !!! */ - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;cyy_writeb (info, CySRER,cyy_readb (info, CySRER) | CyTxRdy);tty_wakeup (tty);
@@ -732,7 +732,7 @@ static void cyy_chip_modem(struct cyclades_card *cinfo, int chip,if (!(mdm_status & CyCTS)) {/* cy_stop isn't used because ... !!! */ - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ;cyy_writeb (info, CySRER,cyy_readb (info, CySRER) & ~CyTxRdy); }
@@ -1800,7 +1800,7 @@ static int cy_write(struct tty_struct *tty, const unsigned char *buf, int count) info->idle_stats.xmit_bytes += ret; info->idle_stats.xmit_idle = jiffies; -if (info->xmit_cnt && !tty->stopped && !tty->hw_stopped) +if (info->xmit_cnt && !tty->stopped && !tty->port->hw_stopped)start_xmit (info);return ret;
@@ -1858,7 +1858,7 @@ static void cy_flush_chars(struct tty_struct *tty)if (serial_paranoia_check (info, tty->name,"cy_flush_chars" ))return ; -if (info->xmit_cnt <=0 || tty->stopped || tty->hw_stopped || +if (info->xmit_cnt <=0 || tty->stopped || tty->port->hw_stopped || !info->port.xmit_buf)return ;
@@ -2785,7 +2785,7 @@ static void cy_set_termios(struct tty_struct *tty, struct ktermios *old_termios)cy_set_line_char (info, tty);if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios)) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;cy_start (tty); }#if 0
drivers/tty/isicom.c +7 -7
@@ -443,7 +443,7 @@ static void isicom_tx(unsigned long _data)continue ; txcount =min_t (short,TX_SIZE , port->xmit_cnt); -if (txcount <=0 || tty->stopped || tty->hw_stopped) +if (txcount <=0 || tty->stopped || tty->port->hw_stopped)continue ;if (!(inw (base +0x02 ) & (1 << port->channel)))
@@ -601,16 +601,16 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id) }if (tty_port_cts_enabled (&port->port)) { -if (tty->hw_stopped) { +if (tty->port->hw_stopped) {if (header &ISI_CTS ) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;/* start tx ing */ port->status |= (ISI_TXOK |ISI_CTS );tty_wakeup (tty); } }else if (!(header &ISI_CTS )) { - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ;/* stop tx ing */ port->status &= ~(ISI_TXOK |ISI_CTS ); }
@@ -966,7 +966,7 @@ static int isicom_write(struct tty_struct *tty, const unsigned char *buf, count -= cnt; total += cnt; } -if (port->xmit_cnt && !tty->stopped && !tty->hw_stopped) +if (port->xmit_cnt && !tty->stopped && !tty->port->hw_stopped) port->status |=ISI_TXOK ;spin_unlock_irqrestore (&card->card_lock, flags);return total;
@@ -1003,7 +1003,7 @@ static void isicom_flush_chars(struct tty_struct *tty)if (isicom_paranoia_check (port, tty->name,"isicom_flush_chars" ))return ; -if (port->xmit_cnt <=0 || tty->stopped || tty->hw_stopped || +if (port->xmit_cnt <=0 || tty->stopped || tty->port->hw_stopped || !port->port.xmit_buf)return ;
@@ -1201,7 +1201,7 @@ static void isicom_set_termios(struct tty_struct *tty,spin_unlock_irqrestore (&port->card->card_lock, flags);if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios)) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;isicom_start (tty); } }
drivers/tty/mxser.c +14 -14
@@ -718,9 +718,9 @@ static int mxser_change_speed(struct tty_struct *tty, info->MCR |=UART_MCR_AFE ; }else { status =inb (info->ioaddr +UART_MSR ); -if (tty->hw_stopped) { +if (tty->port->hw_stopped) {if (status &UART_MSR_CTS ) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;if (info->type !=PORT_16550A && !info->board->chip_flag) { outb(info->IER & ~UART_IER_THRI,
@@ -734,7 +734,7 @@ static int mxser_change_speed(struct tty_struct *tty, } }else {if (!(status &UART_MSR_CTS )) { - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ;if ((info->type !=PORT_16550A ) && (!info->board->chip_flag)) { info->IER &= ~UART_IER_THRI ;
@@ -829,9 +829,9 @@ static void mxser_check_modem_status(struct tty_struct *tty, }if (tty_port_cts_enabled (&port->port)) { -if (tty->hw_stopped) { +if (tty->port->hw_stopped) {if (status &UART_MSR_CTS ) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;if ((port->type !=PORT_16550A ) && (!port->board->chip_flag)) {
@@ -845,7 +845,7 @@ static void mxser_check_modem_status(struct tty_struct *tty, } }else {if (!(status &UART_MSR_CTS )) { - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ;if (port->type !=PORT_16550A && !port->board->chip_flag) { port->IER &= ~UART_IER_THRI ;
@@ -1123,7 +1123,7 @@ static int mxser_write(struct tty_struct *tty, const unsigned char *buf, int cou }if (info->xmit_cnt && !tty->stopped) { -if (!tty->hw_stopped || +if (!tty->port->hw_stopped || (info->type ==PORT_16550A ) || (info->board->chip_flag)) {spin_lock_irqsave (&info->slock, flags);
@@ -1154,7 +1154,7 @@ static int mxser_put_char(struct tty_struct *tty, unsigned char ch) info->xmit_cnt++;spin_unlock_irqrestore (&info->slock, flags);if (!tty->stopped) { -if (!tty->hw_stopped || +if (!tty->port->hw_stopped || (info->type ==PORT_16550A ) || info->board->chip_flag) {spin_lock_irqsave (&info->slock, flags);
@@ -1174,7 +1174,7 @@ static void mxser_flush_chars(struct tty_struct *tty)unsigned long flags;if (info->xmit_cnt <=0 || tty->stopped || !info->port.xmit_buf || - (tty->hw_stopped && info->type !=PORT_16550A && + (tty->port->hw_stopped && info->type !=PORT_16550A && !info->board->chip_flag))return ;
@@ -1778,7 +1778,7 @@ static int mxser_ioctl(struct tty_struct *tty,else info->mon_data.hold_reason |=NPPI_NOTIFY_XOFFXENT ; -if (tty->hw_stopped) +if (tty->port->hw_stopped) info->mon_data.hold_reason |=NPPI_NOTIFY_CTSHOLD ;else info->mon_data.hold_reason &= ~NPPI_NOTIFY_CTSHOLD ;
@@ -1946,7 +1946,7 @@ static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termispin_unlock_irqrestore (&info->slock, flags);if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios)) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;mxser_start (tty); }
@@ -2172,9 +2172,9 @@ static void mxser_transmit_chars(struct tty_struct *tty, struct mxser_port *portreturn ;if (port->xmit_cnt <=0 || tty->stopped || - (tty->hw_stopped && - (port->type !=PORT_16550A ) && - (!port->board->chip_flag))) { + (tty->port->hw_stopped && + (port->type !=PORT_16550A ) && + (!port->board->chip_flag))) { port->IER &= ~UART_IER_THRI ;outb (port->IER, port->ioaddr +UART_IER );return ;
drivers/tty/serial/bfin_uart.c +3 -3
@@ -113,14 +113,14 @@ static irqreturn_t bfin_serial_mctrl_cts_int(int irq, void *dev_id)#ifdef SERIAL_BFIN_HARD_CTSRTS UART_CLEAR_SCTS (uart); -if (uport->hw_stopped) { +if (uport->port->hw_stopped) {if (status) { - uport->hw_stopped =0 ; + uport->port->hw_stopped =0 ;uart_write_wakeup (uport); } }else {if (!status) - uport->hw_stopped =1 ; + uport->port->hw_stopped =1 ; }#else uart_handle_cts_change (uport, status &TIOCM_CTS );
drivers/tty/synclink.c +8 -8
@@ -1259,7 +1259,7 @@ static void mgsl_isr_transmit_status( struct mgsl_struct *info ) else#endif { -if (info->port.tty->stopped || info->port.tty->hw_stopped) { +if (info->port.tty->stopped || info->port.hw_stopped) {usc_stop_transmitter (info);return ; }
@@ -1357,11 +1357,11 @@ static void mgsl_isr_io_pin( struct mgsl_struct *info )if (tty_port_cts_enabled (&info->port) && (status &MISCSTATUS_CTS_LATCHED ) ) { -if (info->port.tty->hw_stopped) { +if (info->port.hw_stopped) {if (status &MISCSTATUS_CTS ) {if ( debug_level >=DEBUG_LEVEL_ISR )printk ("CTS tx start..." ); - info->port.tty->hw_stopped =0 ; + info->port.hw_stopped =0 ;usc_start_transmitter (info); info->pending_bh |=BH_TRANSMIT ;return ;
@@ -1371,7 +1371,7 @@ static void mgsl_isr_io_pin( struct mgsl_struct *info )if ( debug_level >=DEBUG_LEVEL_ISR )printk ("CTS tx stop..." );if (info->port.tty) - info->port.tty->hw_stopped =1 ; + info->port.hw_stopped =1 ;usc_stop_transmitter (info); } }
@@ -1405,7 +1405,7 @@ static void mgsl_isr_transmit_data( struct mgsl_struct *info )usc_ClearIrqPendingBits ( info,TRANSMIT_DATA ); -if (info->port.tty->stopped || info->port.tty->hw_stopped) { +if (info->port.tty->stopped || info->port.hw_stopped) {usc_stop_transmitter (info);return ; }
@@ -2050,7 +2050,7 @@ static void mgsl_flush_chars(struct tty_struct *tty)if (mgsl_paranoia_check (info, tty->name,"mgsl_flush_chars" ))return ; -if (info->xmit_cnt <=0 || tty->stopped || tty->hw_stopped || +if (info->xmit_cnt <=0 || tty->stopped || tty->port->hw_stopped || !info->xmit_buf)return ;
@@ -2190,7 +2190,7 @@ static int mgsl_write(struct tty_struct * tty, } } -if (info->xmit_cnt && !tty->stopped && !tty->hw_stopped) { +if (info->xmit_cnt && !tty->stopped && !tty->port->hw_stopped) {spin_lock_irqsave (&info->irq_spinlock,flags);if (!info->tx_active)usc_start_transmitter (info);
@@ -3048,7 +3048,7 @@ static void mgsl_set_termios(struct tty_struct *tty, struct ktermios *old_termio/* Handle turning off CRTSCTS */ if (old_termios->c_cflag &CRTSCTS && !C_CRTSCTS (&tty->termios)) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;mgsl_start (tty); }
drivers/tty/synclink_gt.c +7 -7
@@ -793,7 +793,7 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios)/* Handle turning off CRTSCTS */ if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios)) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;tx_release (tty); } }
@@ -825,7 +825,7 @@ static int write(struct tty_struct *tty,if (!info->tx_buf || (count > info->max_frame_size))return -EIO ; -if (!count || tty->stopped || tty->hw_stopped) +if (!count || tty->stopped || tty->port->hw_stopped)return 0 ;spin_lock_irqsave (&info->lock, flags);
@@ -947,7 +947,7 @@ static void flush_chars(struct tty_struct *tty)DBGINFO (("%s flush_chars entry tx_count=%d\n" , info->device_name, info->tx_count));if (info->tx_count <=0 || tty->stopped || - tty->hw_stopped || !info->tx_buf) + tty->port->hw_stopped || !info->tx_buf)return ;DBGINFO (("%s flush_chars start transmit\n" , info->device_name));
@@ -2039,15 +2039,15 @@ static void cts_change(struct slgt_info *info, unsigned short status)if (tty_port_cts_enabled (&info->port)) {if (info->port.tty) { -if (info->port.tty->hw_stopped) { +if (info->port.hw_stopped) {if (info->signals & SerialSignal_CTS) { - info->port.tty->hw_stopped =0 ; + info->port.hw_stopped =0 ; info->pending_bh |=BH_TRANSMIT ;return ; } }else {if (!(info->signals & SerialSignal_CTS)) - info->port.tty->hw_stopped =1 ; + info->port.hw_stopped =1 ; } } }
@@ -2323,7 +2323,7 @@ static void isr_txeom(struct slgt_info *info, unsigned short status) else#endif { -if (info->port.tty && (info->port.tty->stopped || info->port.tty->hw_stopped)) { +if (info->port.tty && (info->port.tty->stopped || info->port.hw_stopped)) {tx_stop (info);return ; }
drivers/tty/synclinkmp.c +8 -8
@@ -890,7 +890,7 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios)/* Handle turning off CRTSCTS */ if (old_termios->c_cflag &CRTSCTS && !C_CRTSCTS (&tty->termios)) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;tx_release (tty); } }
@@ -969,7 +969,7 @@ static int write(struct tty_struct *tty,tx_load_dma_buffer (info, info->tx_buf, info->tx_count); } start: -if (info->tx_count && !tty->stopped && !tty->hw_stopped) { +if (info->tx_count && !tty->stopped && !tty->port->hw_stopped) {spin_lock_irqsave (&info->lock,flags);if (!info->tx_active)tx_start (info);
@@ -1149,7 +1149,7 @@ static void flush_chars(struct tty_struct *tty)if (sanity_check (info, tty->name,"flush_chars" ))return ; -if (info->tx_count <=0 || tty->stopped || tty->hw_stopped || +if (info->tx_count <=0 || tty->stopped || tty->port->hw_stopped || !info->tx_buf)return ;
@@ -2261,7 +2261,7 @@ static void isr_txeom(SLMP_INFO * info, unsigned char status) else#endif { -if (info->port.tty && (info->port.tty->stopped || info->port.tty->hw_stopped)) { +if (info->port.tty && (info->port.tty->stopped || info->port.hw_stopped)) {tx_stop (info);return ; }
@@ -2316,7 +2316,7 @@ static void isr_txrdy(SLMP_INFO * info)return ; } -if (info->port.tty && (info->port.tty->stopped || info->port.tty->hw_stopped)) { +if (info->port.tty && (info->port.tty->stopped || info->port.hw_stopped)) {tx_stop (info);return ; }
@@ -2481,11 +2481,11 @@ static void isr_io_pin( SLMP_INFO *info, u16 status )if (tty_port_cts_enabled (&info->port) && (status &MISCSTATUS_CTS_LATCHED ) ) {if ( info->port.tty ) { -if (info->port.tty->hw_stopped) { +if (info->port.hw_stopped) {if (status & SerialSignal_CTS) {if ( debug_level >=DEBUG_LEVEL_ISR )printk ("CTS tx start..." ); - info->port.tty->hw_stopped =0 ; + info->port.hw_stopped =0 ;tx_start (info); info->pending_bh |=BH_TRANSMIT ;return ;
@@ -2494,7 +2494,7 @@ static void isr_io_pin( SLMP_INFO *info, u16 status )if (!(status & SerialSignal_CTS)) {if ( debug_level >=DEBUG_LEVEL_ISR )printk ("CTS tx stop..." ); - info->port.tty->hw_stopped =1 ; + info->port.hw_stopped =1 ;tx_stop (info); } }
include/linux/tty.h +1 -1
@@ -228,6 +228,7 @@ struct tty_port {int count;/* Usage count */ wait_queue_head_t open_wait;/* Open waiters */ wait_queue_head_t delta_msr_wait;/* Modem status change */ +int hw_stopped;unsigned long flags;/* User TTY flags ASYNC_ */ unsigned long iflags;/* Internal flags TTY_PORT_ */ unsigned char console:1, /* port is a console */
@@ -300,7 +301,6 @@ struct tty_struct { unsigned long stopped:1, /* flow_lock */ flow_stopped:1, unused:BITS_PER_LONG - 2; -int hw_stopped; unsigned long ctrl_status:8, /* ctrl_lock */ packet:1, unused_ctrl:BITS_PER_LONG - 9;
net/irda/ircomm/ircomm_tty.c +10 -10
@@ -552,7 +552,7 @@ static void ircomm_tty_do_softint(struct work_struct *work)dev_kfree_skb (ctrl_skb); } -if (tty->hw_stopped) +if (tty->port->hw_stopped) goto put;/* Unlink transmit buffer */
@@ -595,7 +595,7 @@ static int ircomm_tty_write(struct tty_struct *tty,int size;pr_debug ("%s(), count=%d, hw_stopped=%d\n" , __func__ , count, - tty->hw_stopped); + tty->port->hw_stopped); IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;);
@@ -736,7 +736,7 @@ static int ircomm_tty_write_room(struct tty_struct *tty)/* Check if we are allowed to transmit any data. * hw_stopped is the regular flow control. * Jean II */ -if (tty->hw_stopped) +if (tty->port->hw_stopped) ret =0 ;else {spin_lock_irqsave (&self->spinlock, flags);
@@ -1016,10 +1016,10 @@ void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self) } }if (tty &&tty_port_cts_enabled (&self->port)) { -if (tty->hw_stopped) { +if (tty->port->hw_stopped) {if (status &IRCOMM_CTS ) {pr_debug ("%s(), CTS tx start...\n" , __func__); - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;/* Wake up processes blocked on open */ wake_up_interruptible (&self->port.open_wait);
@@ -1030,7 +1030,7 @@ void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self) }else {if (!(status &IRCOMM_CTS )) {pr_debug ("%s(), CTS tx stop...\n" , __func__); - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ; } } }
@@ -1066,7 +1066,7 @@ static int ircomm_tty_data_indication(void *instance, void *sap,* Devices like WinCE can do this, and since they don't send any * params, we can just as well declare the hardware for running. */ -if (tty->hw_stopped && (self->flow ==FLOW_START )) { +if (tty->port->hw_stopped && (self->flow ==FLOW_START )) {pr_debug ("%s(), polling for line settings!\n" , __func__);ircomm_param_request (self,IRCOMM_POLL , TRUE);
@@ -1136,7 +1136,7 @@ static void ircomm_tty_flow_indication(void *instance, void *sap,case FLOW_START :pr_debug ("%s(), hw start!\n" , __func__);if (tty) - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;/* ircomm_tty_do_softint will take care of the rest */ schedule_work (&self->tqueue);
@@ -1145,7 +1145,7 @@ static void ircomm_tty_flow_indication(void *instance, void *sap,case FLOW_STOP :pr_debug ("%s(), hw stopped!\n" , __func__);if (tty) - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ;break ; }
@@ -1282,7 +1282,7 @@ static void ircomm_tty_line_info(struct ircomm_tty_cb *self, struct seq_file *m) tty =tty_port_tty_get (&self->port);if (tty) {seq_printf (m,"Hardware: %s\n" , - tty->hw_stopped ?"Stopped" :"Running" ); + tty->port->hw_stopped ?"Stopped" :"Running" );tty_kref_put (tty); } }
net/irda/ircomm/ircomm_tty_attach.c +3 -3
@@ -140,7 +140,7 @@ int ircomm_tty_attach_cable(struct ircomm_tty_cb *self)/* Make sure nobody tries to write before the link is up */ tty =tty_port_tty_get (&self->port);if (tty) { - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ;tty_kref_put (tty); }
@@ -405,7 +405,7 @@ void ircomm_tty_disconnect_indication(void *instance, void *sap, self->flow =FLOW_STOP ;/* Stop data transfers */ - tty->hw_stopped =1 ; + tty->port->hw_stopped =1 ;ircomm_tty_do_event (self,IRCOMM_TTY_DISCONNECT_INDICATION ,NULL ,NULL );
@@ -563,7 +563,7 @@ void ircomm_tty_link_established(struct ircomm_tty_cb *self) }else {pr_debug ("%s(), starting hardware!\n" , __func__); - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;/* Wake up processes blocked on open */ wake_up_interruptible (&self->port.open_wait);
net/irda/ircomm/ircomm_tty_ioctl.c +1 -1
@@ -170,7 +170,7 @@ void ircomm_tty_set_termios(struct tty_struct *tty,/* Handle turning off CRTSCTS */ if ((old_termios->c_cflag &CRTSCTS ) && !C_CRTSCTS (&tty->termios)) { - tty->hw_stopped =0 ; + tty->port->hw_stopped =0 ;ircomm_tty_start (tty); } }
Signature · 1 line
2.9.3
Re: [PATCH 3/9] tty: move hw_stopped flag to tty_port
Quoted 5 lines · On Fri, 9 Sep 2016 17:37:04 -0500 Rob Herring <[email protected]> wrote:
hw_stoppedis a property of the tty port rather than the tty, so move it totty_portstruct and remove another dependency ontty_structfrom drivers.Converted with coccinelle:
This one makes sense. It's moving the object to the right place
PATCH 4/9 tty: move TTY_IO_ERROR flag to tty_port iflags
In reply to Rob HerringTTY_IO_ERROR is a property of the tty port rather than the tty, so move it to tty_port struct and remove another dependency on tty_struct from drivers.
Partially converted with coccinelle:
@@
identifier t;
identifier func;
@@
- func(TTY_IO_ERROR, &t->flags)
+ func(TTY_PORT_IO_ERROR, &t->port->iflags)
@@
expression port;
identifier func;
@@
- func(TTY_IO_ERROR, &port.tty->flags)
+ func(TTY_PORT_IO_ERROR, &port.iflags)
--- drivers/char/pcmcia/synclink_cs.c | 6 +++--- drivers/isdn/i4l/isdn_tty.c | 4 ++-- drivers/mmc/card/sdio_uart.c | 4 ++-- drivers/staging/fwserial/fwserial.c | 4 ++-- drivers/tty/amiserial.c | 6 +++--- drivers/tty/cyclades.c | 12 ++++++------ drivers/tty/mxser.c | 6 +++--- drivers/tty/pty.c | 6 +++--- drivers/tty/serial/crisv10.c | 4 ++-- drivers/tty/serial/ioc4_serial.c | 2 +- drivers/tty/serial/serial_core.c | 5 ++--- drivers/tty/synclink.c | 6 +++--- drivers/tty/synclink_gt.c | 4 ++-- drivers/tty/synclinkmp.c | 4 ++-- drivers/tty/tty_port.c | 6 +++--- include/linux/tty.h | 5 +++-- net/bluetooth/rfcomm/tty.c | 2 +- net/irda/ircomm/ircomm_tty.c | 2 +- 18 files changed, 44 insertions(+), 44 deletions(-)
drivers/char/pcmcia/synclink_cs.c +3 -3
@@ -1300,7 +1300,7 @@ static int startup(MGSLPC_INFO * info, struct tty_struct *tty)if (retval) {if (capable (CAP_SYS_ADMIN ) && tty) -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);release_resources (info);return retval; }
@@ -1309,7 +1309,7 @@ static int startup(MGSLPC_INFO * info, struct tty_struct *tty)mgslpc_change_params (info, tty);if (tty) -clear_bit (TTY_IO_ERROR , &tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);tty_port_set_initialized (&info->port,1 );
@@ -1359,7 +1359,7 @@ static void shutdown(MGSLPC_INFO * info, struct tty_struct *tty)release_resources (info);if (tty) -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);tty_port_set_initialized (&info->port,0 ); }
drivers/isdn/i4l/isdn_tty.c +2 -2
@@ -1060,7 +1060,7 @@ isdn_tty_startup(modem_info *info)*/ info->mcr =UART_MCR_DTR |UART_MCR_RTS |UART_MCR_OUT2 ;if (info->port.tty) -clear_bit (TTY_IO_ERROR , &info->port.tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &info->port.iflags);/* * and set the speed of the serial port */
@@ -1097,7 +1097,7 @@ isdn_tty_shutdown(modem_info *info) } }if (info->port.tty) -set_bit (TTY_IO_ERROR , &info->port.tty->flags); +set_bit (TTY_PORT_IO_ERROR , &info->port.iflags);tty_port_set_initialized (&info->port,0 ); }
drivers/mmc/card/sdio_uart.c +2 -2
@@ -607,7 +607,7 @@ static int sdio_uart_activate(struct tty_port *tport, struct tty_struct *tty)* Set the TTY IO error marker - we will only clear this * once we have successfully opened the port. */ -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);kfifo_reset (&port->xmit_fifo);
@@ -655,7 +655,7 @@ static int sdio_uart_activate(struct tty_port *tport, struct tty_struct *tty)if (!(sdio_uart_get_mctrl (port) &TIOCM_CTS )) tty->port->hw_stopped =1 ; -clear_bit (TTY_IO_ERROR , &tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);/* Kick the IRQ handler once while we're still holding the host lock */ sdio_uart_irq (port->func);
drivers/staging/fwserial/fwserial.c +2 -2
@@ -992,7 +992,7 @@ static int fwtty_port_activate(struct tty_port *tty_port,unsigned int baud;int err; -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags); err = dma_fifo_alloc(&port->tx_fifo, FWTTY_PORT_TXFIFO_LEN, cache_line_size(),
@@ -1019,7 +1019,7 @@ static int fwtty_port_activate(struct tty_port *tty_port,__fwtty_write_port_status (port);spin_unlock_bh (&port->lock); -clear_bit (TTY_IO_ERROR , &tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);return 0 ; }
drivers/tty/amiserial.c +3 -3
@@ -547,7 +547,7 @@ static int startup(struct tty_struct *tty, struct serial_state *info) retval =request_irq (IRQ_AMIGA_VERTB , ser_vbl_int,0 ,"serial status" , info);if (retval) {if (serial_isroot ()) { -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags); retval =0 ; } goto errout;
@@ -566,7 +566,7 @@ static int startup(struct tty_struct *tty, struct serial_state *info) info->MCR =SER_DTR |SER_RTS ;rtsdtr_ctrl (info->MCR); -clear_bit (TTY_IO_ERROR , &tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &tty->port->iflags); info->xmit.head = info->xmit.tail =0 ;/*
@@ -643,7 +643,7 @@ static void shutdown(struct tty_struct *tty, struct serial_state *info) info->MCR &= ~(SER_DTR |SER_RTS );rtsdtr_ctrl (info->MCR); -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);tty_port_set_initialized (&info->tport,0 );local_irq_restore (flags);
drivers/tty/cyclades.c +6 -6
@@ -1281,7 +1281,7 @@ static int cy_startup(struct cyclades_port *info, struct tty_struct *tty) goto errout;if (!info->type) { -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags); goto errout; }
@@ -1364,7 +1364,7 @@ static int cy_startup(struct cyclades_port *info, struct tty_struct *tty)tty_port_set_initialized (&info->port,1 ); -clear_bit (TTY_IO_ERROR , &tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &tty->port->iflags); info->xmit_cnt = info->xmit_head = info->xmit_tail =0 ; info->breakon = info->breakoff =0 ;memset ((char *)&info->idle_stats,0 ,sizeof (info->idle_stats));
@@ -1445,7 +1445,7 @@ static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty)/* it may be appropriate to clear _XMIT at some later date (after testing)!!! */ -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);tty_port_set_initialized (&info->port,0 );spin_unlock_irqrestore (&card->card_lock, flags); }else {
@@ -1470,7 +1470,7 @@ static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty)if (C_HUPCL (&tty->termios))tty_port_lower_dtr_rts (&info->port); -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);tty_port_set_initialized (&info->port,0 );spin_unlock_irqrestore (&card->card_lock, flags);
@@ -2147,7 +2147,7 @@ static void cy_set_line_char(struct cyclades_port *info, struct tty_struct *tty)else cyy_change_rts_dtr (info,TIOCM_DTR ,0 ); -clear_bit (TTY_IO_ERROR , &tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);spin_unlock_irqrestore (&card->card_lock, flags); }else {
@@ -2267,7 +2267,7 @@ static void cy_set_line_char(struct cyclades_port *info, struct tty_struct *tty) "was %x\n", info->line, retval); } -clear_bit (TTY_IO_ERROR , &tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &tty->port->iflags); } }/* set_line_char */
drivers/tty/mxser.c +3 -3
@@ -870,7 +870,7 @@ static int mxser_activate(struct tty_port *port, struct tty_struct *tty)spin_lock_irqsave (&info->slock, flags);if (!info->ioaddr || !info->type) { -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);free_page (page);spin_unlock_irqrestore (&info->slock, flags);return 0 ;
@@ -897,7 +897,7 @@ static int mxser_activate(struct tty_port *port, struct tty_struct *tty)if (inb (info->ioaddr +UART_LSR ) ==0xff ) {spin_unlock_irqrestore (&info->slock, flags);if (capable (CAP_SYS_ADMIN )) { -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);return 0 ; }else return -ENODEV ;
@@ -935,7 +935,7 @@ static int mxser_activate(struct tty_port *port, struct tty_struct *tty) (void )inb (info->ioaddr +UART_IIR ); (void )inb (info->ioaddr +UART_MSR ); -clear_bit (TTY_IO_ERROR , &tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &tty->port->iflags); info->xmit_cnt = info->xmit_head = info->xmit_tail =0 ;/*
drivers/tty/pty.c +3 -3
@@ -49,7 +49,7 @@ static void pty_close(struct tty_struct *tty, struct file *filp)if (tty->count >2 )return ; } -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);wake_up_interruptible (&tty->read_wait);wake_up_interruptible (&tty->write_wait);spin_lock_irq (&tty->ctrl_lock);
@@ -246,13 +246,13 @@ static int pty_open(struct tty_struct *tty, struct file *filp)if (tty->driver->subtype ==PTY_TYPE_SLAVE && tty->link->count !=1 ) goto out; -clear_bit (TTY_IO_ERROR , &tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);clear_bit (TTY_OTHER_CLOSED , &tty->link->flags);set_bit (TTY_THROTTLED , &tty->flags);return 0 ; out: -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);return -EIO ; }
drivers/tty/serial/crisv10.c +2 -2
@@ -2659,7 +2659,7 @@ startup(struct e100_serial * info) }if (info->port.tty) -clear_bit (TTY_IO_ERROR , &info->port.tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &info->port.iflags); info->xmit.head = info->xmit.tail =0 ; info->first_recv_buffer = info->last_recv_buffer =NULL ;
@@ -2775,7 +2775,7 @@ shutdown(struct e100_serial * info) }if (info->port.tty) -set_bit (TTY_IO_ERROR , &info->port.tty->flags); +set_bit (TTY_PORT_IO_ERROR , &info->port.iflags);tty_port_set_initialized (&info->port,0 );local_irq_restore (flags);
drivers/tty/serial/ioc4_serial.c +1 -1
@@ -2442,7 +2442,7 @@ static void ic4_shutdown(struct uart_port *the_port)wake_up_interruptible (&state->port.delta_msr_wait);if (state->port.tty) -set_bit (TTY_IO_ERROR , &state->port.tty->flags); +set_bit (TTY_PORT_IO_ERROR , &state->port.iflags);spin_lock_irqsave (&the_port->lock, port_flags);set_notification (port,N_ALL ,0 );
drivers/tty/serial/serial_core.c +2 -3
@@ -237,7 +237,7 @@ static int uart_startup(struct tty_struct *tty, struct uart_state *state, retval =uart_port_startup (tty, state, init_hw);if (retval) -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &port->iflags);return retval; }
@@ -257,8 +257,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)/* * Set the TTY IO error marker */ -if (tty) -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &port->iflags);if (tty_port_initialized (port)) {tty_port_set_initialized (port,0 );
drivers/tty/synclink.c +3 -3
@@ -1780,7 +1780,7 @@ static int startup(struct mgsl_struct * info)if ( retval ) {if (capable (CAP_SYS_ADMIN ) && info->port.tty) -set_bit (TTY_IO_ERROR , &info->port.tty->flags); +set_bit (TTY_PORT_IO_ERROR , &info->port.iflags);mgsl_release_resources (info);return retval; }
@@ -1789,7 +1789,7 @@ static int startup(struct mgsl_struct * info)mgsl_change_params (info);if (info->port.tty) -clear_bit (TTY_IO_ERROR , &info->port.tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &info->port.iflags);tty_port_set_initialized (&info->port,1 );
@@ -1854,7 +1854,7 @@ static void shutdown(struct mgsl_struct * info)mgsl_release_resources (info);if (info->port.tty) -set_bit (TTY_IO_ERROR , &info->port.tty->flags); +set_bit (TTY_PORT_IO_ERROR , &info->port.iflags);tty_port_set_initialized (&info->port,0 ); }/* end of shutdown() */
drivers/tty/synclink_gt.c +2 -2
@@ -2440,7 +2440,7 @@ static int startup(struct slgt_info *info)change_params (info);if (info->port.tty) -clear_bit (TTY_IO_ERROR , &info->port.tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &info->port.iflags);tty_port_set_initialized (&info->port,1 );
@@ -2487,7 +2487,7 @@ static void shutdown(struct slgt_info *info)spin_unlock_irqrestore (&info->lock,flags);if (info->port.tty) -set_bit (TTY_IO_ERROR , &info->port.tty->flags); +set_bit (TTY_PORT_IO_ERROR , &info->port.iflags);tty_port_set_initialized (&info->port,0 ); }
drivers/tty/synclinkmp.c +2 -2
@@ -2660,7 +2660,7 @@ static int startup(SLMP_INFO * info)mod_timer (&info->status_timer, jiffies +msecs_to_jiffies (10 ));if (info->port.tty) -clear_bit (TTY_IO_ERROR , &info->port.tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &info->port.iflags);tty_port_set_initialized (&info->port,1 );
@@ -2703,7 +2703,7 @@ static void shutdown(SLMP_INFO * info)spin_unlock_irqrestore (&info->lock,flags);if (info->port.tty) -set_bit (TTY_IO_ERROR , &info->port.tty->flags); +set_bit (TTY_PORT_IO_ERROR , &info->port.iflags);tty_port_set_initialized (&info->port,0 ); }
drivers/tty/tty_port.c +3 -3
@@ -239,7 +239,7 @@ void tty_port_hangup(struct tty_port *port) port->count =0 ; tty = port->tty;if (tty) -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags); port->tty =NULL ;spin_unlock_irqrestore (&port->lock, flags);tty_port_set_active (port,0 );
@@ -531,7 +531,7 @@ void tty_port_close(struct tty_port *port, struct tty_struct *tty,if (tty_port_close_start (port, tty, filp) ==0 )return ;tty_port_shutdown (port, tty); -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);tty_port_close_end (port, tty);tty_port_tty_set (port,NULL ); }
@@ -580,7 +580,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,mutex_lock (&port->mutex);if (!tty_port_initialized (port)) { -clear_bit (TTY_IO_ERROR , &tty->flags); +clear_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);if (port->ops->activate) {int retval = port->ops->activate (port, tty);if (retval) {
include/linux/tty.h +3 -2
@@ -256,6 +256,8 @@ struct tty_port {#define TTY_PORT_CTS_FLOW 3/* h/w flow control enabled */ #define TTY_PORT_CHECK_CD 4/* carrier detect enabled */ +#define TTY_PORT_IO_ERROR 3/* device has I/O error */ +/* * Where all of the state associated with a tty is kept while the tty * is open. Since the termios state should be kept even if the tty
@@ -347,7 +349,6 @@ struct tty_file_private {* clear_bit() to make things atomic. */ #define TTY_THROTTLED 0/* Call unthrottle() at threshold min */ -#define TTY_IO_ERROR 1/* Cause an I/O error (may be no ldisc too) */ #define TTY_OTHER_CLOSED 2/* Other side (if any) has closed */ #define TTY_EXCLUSIVE 3/* Exclusive open mode */ #define TTY_DO_WRITE_WAKEUP 5/* Call write_wakeup after queuing new */
@@ -374,7 +375,7 @@ static inline void tty_set_flow_change(struct tty_struct *tty, int val)static inline bool tty_io_error (struct tty_struct *tty) { -return test_bit (TTY_IO_ERROR , &tty->flags); +return test_bit (TTY_PORT_IO_ERROR , &tty->port->flags); }static inline bool tty_throttled (struct tty_struct *tty)
net/bluetooth/rfcomm/tty.c +1 -1
@@ -115,7 +115,7 @@ static int rfcomm_dev_activate(struct tty_port *port, struct tty_struct *tty) err =rfcomm_dlc_open (dev->dlc, &dev->src, &dev->dst, dev->channel);if (err) -set_bit (TTY_IO_ERROR , &tty->flags); +set_bit (TTY_PORT_IO_ERROR , &tty->port->iflags);return err; }
net/irda/ircomm/ircomm_tty.c +1 -1
@@ -927,7 +927,7 @@ static void ircomm_tty_hangup(struct tty_struct *tty)spin_lock_irqsave (&port->lock, flags);if (port->tty) { -set_bit (TTY_IO_ERROR , &port->tty->flags); +set_bit (TTY_PORT_IO_ERROR , &port->iflags);tty_kref_put (port->tty); } port->tty =NULL ;
Signature · 1 line
2.9.3
Re: [PATCH 4/9] tty: move TTY_IO_ERROR flag to tty_port iflags
Quoted 13 lines · On Fri, 9 Sep 2016 17:37:05 -0500 Rob Herring <[email protected]> wrote:
TTY_IO_ERRORis a property of the tty port rather than the tty, so move it totty_portstruct and remove another dependency ontty_structfrom drivers.Partially converted with coccinelle:
@@
identifier t;
identifier func;
@@
-func(TTY_IO_ERROR, &t->flags)
+func(TTY_PORT_IO_ERROR, &t->port->iflags)
Quoted 6 lines
@@
expression port;
identifier func;
@@
-func(TTY_IO_ERROR, &port.tty->flags)
+func(TTY_PORT_IO_ERROR, &port.iflags)
Again this makes sense to move the object to the right structure.
I'm not convinced your recipe is a correct and reliable translation because you don't capture the flag being cleared if the tty object is freed and then a new one allocated. That needs further review IMHO
Alan
PATCH 5/9 tty: serial_core: use tty_port_tty_wakeup instead of tty_wakeup
In reply to Rob HerringIn preparation to use a tty_port without a tty, call the tty_port helper tty_port_tty_wakeup instead of tty_wakeup directly.
--- drivers/tty/serial/serial_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/serial_core.c +2 -2
@@ -111,7 +111,7 @@ void uart_write_wakeup(struct uart_port *port)* closed. No cookie for you. */ BUG_ON (!state); -tty_wakeup (state->port.tty); +tty_port_tty_wakeup (&state->port); }static void uart_stop (struct tty_struct *tty)
@@ -631,7 +631,7 @@ static void uart_flush_buffer(struct tty_struct *tty)if (port->ops->flush_buffer) port->ops->flush_buffer (port);uart_port_unlock (port, flags); -tty_wakeup (tty); +tty_port_tty_wakeup (&state->port); }/*
Signature · 1 line
2.9.3
PATCH 6/9 tty: serial_core: introduce tty_port_to_uart_state
In reply to Rob HerringThe uart_state is a container of tty_port. Add an inline to convert tty_port ptr to uart_state ptr and convert existing container_of users.
--- drivers/tty/serial/serial_core.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/tty/serial/serial_core.c +9 -4
@@ -93,6 +93,11 @@ static inline void uart_port_deref(struct uart_port *uport)uart_port_deref (__uport); \ }) +static inline struct uart_state *tty_port_to_uart_state (struct tty_port *port) +{ + return container_of(port, struct uart_state, port); +} +static inline struct uart_port *uart_port_check (struct uart_state *state) {lockdep_assert_held (&state->port.mutex);
@@ -720,7 +725,7 @@ static void uart_unthrottle(struct tty_struct *tty)static int uart_get_info (struct tty_port *port,struct serial_struct *retinfo) { - struct uart_state *state = container_of(port, struct uart_state, port); +struct uart_state *state =tty_port_to_uart_state (port);struct uart_port *uport;int ret = -ENODEV ;
@@ -1603,7 +1608,7 @@ static void uart_hangup(struct tty_struct *tty)/* uport == NULL if uart_port has already been removed */ static void uart_port_shutdown (struct tty_port *port) { - struct uart_state *state = container_of(port, struct uart_state, port); +struct uart_state *state =tty_port_to_uart_state (port);struct uart_port *uport =uart_port_check (state);/*
@@ -1630,7 +1635,7 @@ static void uart_port_shutdown(struct tty_port *port)static int uart_carrier_raised (struct tty_port *port) { - struct uart_state *state = container_of(port, struct uart_state, port); +struct uart_state *state =tty_port_to_uart_state (port);struct uart_port *uport;int mctrl;
@@ -1655,7 +1660,7 @@ static int uart_carrier_raised(struct tty_port *port)static void uart_dtr_rts (struct tty_port *port,int onoff) { - struct uart_state *state = container_of(port, struct uart_state, port); +struct uart_state *state =tty_port_to_uart_state (port);struct uart_port *uport; uport =uart_port_ref (state);
Signature · 1 line
2.9.3
PATCH 7/9 tty: serial_core: convert private functions to use tty_port instead of tty_struct
In reply to Rob Herring--- drivers/tty/serial/serial_core.c | 72 +++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 38 deletions(-)
drivers/tty/serial/serial_core.c +34 -38
@@ -51,8 +51,7 @@ static struct lock_class_key port_lock_key;#define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8) -static void uart_change_speed (struct tty_struct *tty,struct uart_state *state, -struct ktermios *old_termios); +static void uart_change_speed (struct tty_port *port,struct ktermios *old_termios);static void uart_wait_until_sent (struct tty_struct *tty,int timeout);static void uart_change_pm (struct uart_state *state,enum uart_pm_state pm_state);
@@ -131,11 +130,8 @@ static void uart_stop(struct tty_struct *tty)uart_port_unlock (port, flags); } -static void __uart_start (struct tty_struct *tty) +static void __uart_start (struct uart_port *port) { -struct uart_state *state = tty->driver_data; -struct uart_port *port = state->uart_port; -if (port && !uart_tx_stopped (port)) port->ops->start_tx (port); }
@@ -147,7 +143,7 @@ static void uart_start(struct tty_struct *tty)unsigned long flags; port =uart_port_lock (state, flags); -__uart_start (tty); +__uart_start (port);uart_port_unlock (port, flags); }
@@ -172,9 +168,10 @@ uart_update_mctrl(struct uart_port *port, unsigned int set, unsigned int clear)* Startup the port. This will be called once per open. All calls * will be serialised by the per-port mutex. */ -static int uart_port_startup (struct tty_struct *tty,struct uart_state *state, -int init_hw) +static int uart_port_startup (struct tty_port *port,int init_hw) { +struct tty_struct *tty = port->tty; +struct uart_state *state =tty_port_to_uart_state (port);struct uart_port *uport =uart_port_check (state);unsigned long page;int retval =0 ;
@@ -210,7 +207,7 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,/* * Initialise the hardware port settings. */ -uart_change_speed (tty, state,NULL ); +uart_change_speed (port,NULL );/* * Setup the RTS and DTR signals once the
@@ -231,16 +228,14 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,return retval; } -static int uart_startup (struct tty_struct *tty,struct uart_state *state, -int init_hw) +static int uart_startup (struct tty_port *port,int init_hw) { -struct tty_port *port = &state->port;int retval;if (tty_port_initialized (port))return 0 ; - retval =uart_port_startup (tty, state, init_hw); + retval =uart_port_startup (port, init_hw);if (retval)set_bit (TTY_PORT_IO_ERROR , &port->iflags);
@@ -254,10 +249,11 @@ static int uart_startup(struct tty_struct *tty, struct uart_state *state,* * uport == NULL if uart_port has already been removed */ -static void uart_shutdown (struct tty_struct *tty,struct uart_state *state) +static void uart_shutdown (struct tty_port *port) { +struct tty_struct *tty = port->tty; +struct uart_state *state =tty_port_to_uart_state (port);struct uart_port *uport =uart_port_check (state); -struct tty_port *port = &state->port;/* * Set the TTY IO error marker
@@ -473,9 +469,10 @@ uart_get_divisor(struct uart_port *port, unsigned int baud)EXPORT_SYMBOL (uart_get_divisor);/* Caller holds port mutex */ -static void uart_change_speed (struct tty_struct *tty,struct uart_state *state, -struct ktermios *old_termios) +static void uart_change_speed (struct tty_port *port,struct ktermios *old_termios) { +struct tty_struct *tty = port->tty; +struct uart_state *state =tty_port_to_uart_state (port);struct uart_port *uport =uart_port_check (state);struct ktermios *termios;int hw_stopped;
@@ -513,7 +510,7 @@ static void uart_change_speed(struct tty_struct *tty, struct uart_state *state, uport->ops->stop_tx (uport); }else {if (hw_stopped) -__uart_start (tty); +__uart_start (uport); }spin_unlock_irq (&uport->lock); }
@@ -549,7 +546,7 @@ static int uart_write(struct tty_struct *tty, const unsigned char *buf, int count) {struct uart_state *state = tty->driver_data; -struct uart_port *port; +struct uart_port *uport;struct circ_buf *circ;unsigned long flags;int c, ret =0 ;
@@ -567,8 +564,8 @@ static int uart_write(struct tty_struct *tty,if (!circ->buf)return 0 ; - port =uart_port_lock (state, flags); -while (port) { + uport =uart_port_lock (state, flags); +while (uport) { c =CIRC_SPACE_TO_END (circ->head, circ->tail,UART_XMIT_SIZE );if (count < c) c = count;
@@ -581,8 +578,8 @@ static int uart_write(struct tty_struct *tty, ret += c; } -__uart_start (tty); -uart_port_unlock (port, flags); +__uart_start (uport); +uart_port_unlock (uport, flags);return ret; }
@@ -778,7 +775,7 @@ static int uart_get_info_user(struct tty_port *port,return 0 ; } -static int uart_set_info (struct tty_struct *tty,struct tty_port *port, +static int uart_set_info (struct tty_port *port,struct uart_state *state,struct serial_struct *new_info) {
@@ -865,7 +862,7 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port,* We need to shutdown the serial port at the old * port/type/irq combination. */ -uart_shutdown (tty, state); +uart_shutdown (port); }if (change_port) {
@@ -965,10 +962,10 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port, current->comm, tty_name(port->tty)); } -uart_change_speed (tty, state,NULL ); +uart_change_speed (port,NULL ); } }else { - retval =uart_startup (tty, state,1 ); + retval =uart_startup (port,1 );if (retval >0 ) retval =0 ; }
@@ -994,7 +991,7 @@ static int uart_set_info_user(struct tty_struct *tty, struct uart_state *state,* under us. */ mutex_lock (&port->mutex); - retval =uart_set_info (tty, port, state, &new_serial); + retval =uart_set_info (port, state, &new_serial);mutex_unlock (&port->mutex);return retval; }
@@ -1117,7 +1114,7 @@ static int uart_do_autoconfig(struct tty_struct *tty,struct uart_state *state) ret = -EBUSY ;if (tty_port_users (port) ==1 ) { -uart_shutdown (tty, state); +uart_shutdown (port);/* * If we already have a port type configured,
@@ -1136,7 +1133,7 @@ static int uart_do_autoconfig(struct tty_struct *tty,struct uart_state *state)*/ uport->ops->config_port (uport, flags); - ret =uart_startup (tty, state,1 ); + ret =uart_startup (port,1 );if (ret >0 ) ret =0 ; }
@@ -1402,6 +1399,7 @@ static void uart_set_ldisc(struct tty_struct *tty)static void uart_set_termios (struct tty_struct *tty,struct ktermios *old_termios) { +struct tty_port *port = tty->port;struct uart_state *state = tty->driver_data;struct uart_port *uport;unsigned int cflag = tty->termios.c_cflag;
@@ -1438,7 +1436,7 @@ static void uart_set_termios(struct tty_struct *tty, goto out; } -uart_change_speed (tty, state, old_termios); +uart_change_speed (port, old_termios);/* reload cflag from termios; port driver may have overriden flags */ cflag = tty->termios.c_cflag;
@@ -1591,7 +1589,7 @@ static void uart_hangup(struct tty_struct *tty)if (tty_port_active (port)) {uart_flush_buffer (tty); -uart_shutdown (tty, state); +uart_shutdown (port);spin_lock_irqsave (&port->lock, flags); port->count =0 ;spin_unlock_irqrestore (&port->lock, flags);
@@ -1714,7 +1712,7 @@ static int uart_port_activate(struct tty_port *port, struct tty_struct *tty)/* * Start up the serial port. */ -return uart_startup (tty, state,0 ); +return uart_startup (port,0 ); }static const char *uart_type (struct uart_port *port)
@@ -2194,11 +2192,9 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)spin_unlock_irq (&uport->lock);if (console_suspend_enabled || !uart_console (uport)) {/* Protected by port mutex for now */ -struct tty_struct *tty = port->tty; ret = ops->startup (uport);if (ret ==0 ) { -if (tty) -uart_change_speed (tty, state,NULL ); +uart_change_speed (port,NULL );spin_lock_irq (&uport->lock); ops->set_mctrl (uport, uport->mctrl); ops->start_tx (uport);
@@ -2210,7 +2206,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)* Clear the "initialized" flag so we won't try * to call the low level drivers shutdown method. */ -uart_shutdown (tty, state); +uart_shutdown (port); } }
Signature · 1 line
2.9.3
PATCH 8/9 tty: serial_core: remove dependence on tty->driver_data
In reply to Rob HerringAs the uart_state contains tty_port, use that to get the uart_state ptr.
--- drivers/tty/serial/serial_core.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/tty/serial/serial_core.c +20 -20
@@ -120,7 +120,7 @@ void uart_write_wakeup(struct uart_port *port)static void uart_stop (struct tty_struct *tty) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct uart_port *port;unsigned long flags;
@@ -138,7 +138,7 @@ static void __uart_start(struct uart_port *port)static void uart_start (struct tty_struct *tty) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct uart_port *port;unsigned long flags;
@@ -517,7 +517,7 @@ static void uart_change_speed(struct tty_port *port, struct ktermios *old_termiostatic int uart_put_char (struct tty_struct *tty,unsigned char c) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct uart_port *port;struct circ_buf *circ;unsigned long flags;
@@ -545,7 +545,7 @@ static void uart_flush_chars(struct tty_struct *tty)static int uart_write (struct tty_struct *tty,const unsigned char *buf,int count) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct uart_port *uport;struct circ_buf *circ;unsigned long flags;
@@ -585,7 +585,7 @@ static int uart_write(struct tty_struct *tty,static int uart_write_room (struct tty_struct *tty) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct uart_port *port;unsigned long flags;int ret;
@@ -598,7 +598,7 @@ static int uart_write_room(struct tty_struct *tty)static int uart_chars_in_buffer (struct tty_struct *tty) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct uart_port *port;unsigned long flags;int ret;
@@ -611,7 +611,7 @@ static int uart_chars_in_buffer(struct tty_struct *tty)static void uart_flush_buffer (struct tty_struct *tty) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct uart_port *port;unsigned long flags;
@@ -642,7 +642,7 @@ static void uart_flush_buffer(struct tty_struct *tty)*/ static void uart_send_xchar (struct tty_struct *tty,char ch) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct uart_port *port;unsigned long flags;
@@ -664,7 +664,7 @@ static void uart_send_xchar(struct tty_struct *tty, char ch)static void uart_throttle (struct tty_struct *tty) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct uart_port *port;upstat_t mask =0 ;
@@ -693,7 +693,7 @@ static void uart_throttle(struct tty_struct *tty)static void uart_unthrottle (struct tty_struct *tty) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct uart_port *port;upstat_t mask =0 ;
@@ -1026,7 +1026,7 @@ static int uart_get_lsr_info(struct tty_struct *tty,static int uart_tiocmget (struct tty_struct *tty) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct tty_port *port = &state->port;struct uart_port *uport;int result = -EIO ;
@@ -1050,7 +1050,7 @@ out:static int uart_tiocmset (struct tty_struct *tty,unsigned int set,unsigned int clear) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct tty_port *port = &state->port;struct uart_port *uport;int ret = -EIO ;
@@ -1071,7 +1071,7 @@ out:static int uart_break_ctl (struct tty_struct *tty,int break_state) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct tty_port *port = &state->port;struct uart_port *uport;int ret = -EIO ;
@@ -1221,7 +1221,7 @@ static int uart_wait_modem_status(struct uart_state *state, unsigned long arg)static int uart_get_icount (struct tty_struct *tty,struct serial_icounter_struct *icount) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct uart_icount cnow;struct uart_port *uport;
@@ -1295,7 +1295,7 @@ static int uart_set_rs485_config(struct uart_port *port,static int uart_ioctl (struct tty_struct *tty,unsigned int cmd,unsigned long arg) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct tty_port *port = &state->port;struct uart_port *uport;void __user *uarg = (void __user *)arg;
@@ -1386,7 +1386,7 @@ out:static void uart_set_ldisc (struct tty_struct *tty) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct uart_port *uport;mutex_lock (&state->port.mutex);
@@ -1400,7 +1400,7 @@ static void uart_set_termios(struct tty_struct *tty, struct ktermios *old_termios) {struct tty_port *port = tty->port; -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (port);struct uart_port *uport;unsigned int cflag = tty->termios.c_cflag;unsigned int iflag_mask =IGNBRK |BRKINT |IGNPAR |PARMRK |INPCK ;
@@ -1461,7 +1461,7 @@ out:*/ static void uart_close (struct tty_struct *tty,struct file *filp) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct tty_port *port;if (!state) {
@@ -1512,7 +1512,7 @@ static void uart_tty_port_shutdown(struct tty_port *port)static void uart_wait_until_sent (struct tty_struct *tty,int timeout) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct uart_port *port;unsigned long char_time, expire;
@@ -1576,7 +1576,7 @@ static void uart_wait_until_sent(struct tty_struct *tty, int timeout)*/ static void uart_hangup (struct tty_struct *tty) { -struct uart_state *state = tty->driver_data; +struct uart_state *state =tty_port_to_uart_state (tty->port);struct tty_port *port = &state->port;struct uart_port *uport;unsigned long flags;
Signature · 1 line
2.9.3
PATCH 9/9 tty: serial_core: add tty NULL check in uart_port_startup
In reply to Rob HerringIf we don't have a tty when calling uart_port_startup, skip the baudrate and modem control setup which depend on tty->termios struct. Either tty_port clients will configure the line in a separate call or we'll move termios into the tty_port.
--- drivers/tty/serial/serial_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/serial_core.c +1 -1
@@ -199,7 +199,7 @@ static int uart_port_startup(struct tty_port *port, int init_hw) } retval = uport->ops->startup (uport); -if (retval ==0 ) { +if (retval ==0 && tty) {if (uart_console (uport) && uport->cons->cflag) { tty->termios.c_cflag = uport->cons->cflag; uport->cons->cflag =0 ;
Signature · 1 line
2.9.3
Re: [PATCH 9/9] tty: serial_core: add tty NULL check in uart_port_startup
Quoted 4 lines · On Fri, 9 Sep 2016 17:37:10 -0500 Rob Herring <[email protected]> wrote:
If we don't have a tty when calling
uart_port_startup, skip the baudrate and modem control setup which depend ontty->termiosstruct. Eithertty_portclients will configure the line in a separate call or we'll move termios into thetty_port.
I don't think getting rid of the tty object makes any sense whatsoever just create a kernel one.
Either way the giant churny patch and this hack should be deferred in favour of moving the termios structure into the tty port (and the locks for it) and doing the right job once.
The termios does I agree belong in the tty_port so irrespective of final direction fixing that is a right move.
Alan
Quoted 3 lines · On Fri, 9 Sep 2016 17:37:01 -0500 Rob Herring <[email protected]> wrote:
This patch series removes or prepares to remove some of the dependencies on
tty_structwithintty_portdrivers. This will allow usingtty_portsdirectly for so called UART slave devices.
You can create a tty_struct kernel side with the two tiny changes I posted before. Why do you want to do invasive tree wide changes when you can do simple ones ?
Quoted 3 lines
Next up after this are moving some functions to the
tty_portops. I've got some WIP patches for some of that, but nothing ready to send out quite yet.
I think before this lot happens you need to decide where these structures belong. Termios and termios_locked for example could live in the tty_port as the physical tty is incapable of having multiple sets of terminal data at once.
Really though this looks to me like *MASSIVE* churn for now purpose. Create a tty_struct kernel side, and use that, the needed patch is then tiny.
so IMHO NAK
Alan
Quoted 10 lines · One Thousand Gnomes
Quoted 3 lines · On Fri, 9 Sep 2016 17:37:01 -0500 Rob Herring <[email protected]> wrote:
This patch series removes or prepares to remove some of the dependencies on
tty_structwithintty_portdrivers. This will allow usingtty_portsdirectly for so called UART slave devices.You can create a
tty_structkernel side with the two tiny changes I posted before. Why do you want to do invasive tree wide changes when you can do simple ones ?
Well, I don't want to do invasive changes, but I thought the idea was to use tty_port struct without a tty_struct.
Quoted 8 lines
Quoted 3 lines
Next up after this are moving some functions to the
tty_portops. I've got some WIP patches for some of that, but nothing ready to send out quite yet.I think before this lot happens you need to decide where these structures belong. Termios and
termios_lockedfor example could live in thetty_portas the physical tty is incapable of having multiple sets of terminal data at once.
I was planning to keep termios out of tty_port and make clients of tty_port carry it if for nothing else not quite understanding all the details around the lifetime, init and locking of it. If there's always a tty_struct then there's not much point moving it other than which struct makes more sense. But that would cause some churn.
Rob
Quoted 9 lines · On Sun, 11 Sep 2016 22:05:07 -0500 Rob Herring <[email protected]> wrote:
Quoted 7 lines · One Thousand Gnomes
Quoted 3 lines · On Fri, 9 Sep 2016 17:37:01 -0500 Rob Herring <[email protected]> wrote:
This patch series removes or prepares to remove some of the dependencies on
tty_structwithintty_portdrivers. This will allow usingtty_portsdirectly for so called UART slave devices.
Quoted 6 lines
Quoted 3 lines
You can create a
tty_structkernel side with the two tiny changes I posted before. Why do you want to do invasive tree wide changes when you can do simple ones ?Well, I don't want to do invasive changes, but I thought the idea was to use
tty_portstruct without atty_struct.
I posted some tiny patches to break the file/tty requirement in the base tty code for comment a while ago and they were very tiny for most ldiscs (n_tty unsurprisingly wouldn't work this way but does anyone need kernel mode n_tty ?)
Moving termios into the tty_port is IMHO a good thing to do whichever approach is taken.
Quoted 5 lines
I was planning to keep termios out of
tty_portand make clients oftty_portcarry it if for nothing else not quite understanding all the details around the lifetime, init and locking of it. If there's always atty_structthen there's not much point moving it other than which struct makes more sense. But that would cause some churn.
The termios lifetime is the lifetime of the port, although it may get reset at some times.
Alan
Greg Kroah-Hartman
maintainerQuoted 11 lines · Rob Herring
This patch series removes or prepares to remove some of the dependencies on
tty_structwithintty_portdrivers. This will allow usingtty_portsdirectly for so called UART slave devices.The first patch fixes a regression from the last round with tty closing. Patches 2-4 are mechanical conversions generated with coccinelle. This is my first adventure into coccinelle, so hopefully I didn't screw things up. :) Only
serial_corehas some of itstty_structdependencies removed as those are the drivers we immediately care about supporting slave devices with.
Quoted 3 lines
Next up after this are moving some functions to the
tty_portops. I've got some WIP patches for some of that, but nothing ready to send out quite yet.
I've applied the first patch here, and wanted to apply patch 3, but it depended on #2, so I'll wait for your next round of patches.
thanks,
greg k-h