]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
TTY: switch tty_insert_flip_char
authorJiri Slaby <jslaby@suse.cz>
Thu, 3 Jan 2013 14:53:03 +0000 (15:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jan 2013 06:21:36 +0000 (22:21 -0800)
Now, we start converting tty buffer functions to actually use
tty_port. This will allow us to get rid of the need of tty in many
call sites. Only tty_port will needed and hence no more
tty_port_tty_get in those paths.

tty_insert_flip_char is the next one to proceed. This one is used all
over the code, so the patch is huge.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
76 files changed:
arch/alpha/kernel/srmcons.c
arch/ia64/hp/sim/simserial.c
arch/mn10300/kernel/mn10300-serial.c
arch/parisc/kernel/pdc_cons.c
arch/um/drivers/chan_kern.c
arch/xtensa/platforms/iss/console.c
drivers/char/pcmcia/synclink_cs.c
drivers/ipack/devices/ipoctal.c
drivers/isdn/i4l/isdn_common.c
drivers/isdn/i4l/isdn_tty.c
drivers/mmc/card/sdio_uart.c
drivers/s390/char/con3215.c
drivers/s390/char/keyboard.h
drivers/s390/char/sclp_tty.c
drivers/staging/dgrp/dgrp_net_ops.c
drivers/staging/fwserial/fwserial.c
drivers/staging/serqt_usb2/serqt_usb2.c
drivers/tty/amiserial.c
drivers/tty/cyclades.c
drivers/tty/hvc/hvc_console.c
drivers/tty/hvc/hvsi.c
drivers/tty/isicom.c
drivers/tty/moxa.c
drivers/tty/mxser.c
drivers/tty/n_gsm.c
drivers/tty/nozomi.c
drivers/tty/rocket.c
drivers/tty/serial/68328serial.c
drivers/tty/serial/ar933x_uart.c
drivers/tty/serial/bcm63xx_uart.c
drivers/tty/serial/bfin_sport_uart.c
drivers/tty/serial/cpm_uart/cpm_uart_core.c
drivers/tty/serial/crisv10.c
drivers/tty/serial/efm32-uart.c
drivers/tty/serial/icom.c
drivers/tty/serial/imx.c
drivers/tty/serial/jsm/jsm_tty.c
drivers/tty/serial/kgdb_nmi.c
drivers/tty/serial/lantiq.c
drivers/tty/serial/lpc32xx_hs.c
drivers/tty/serial/m32r_sio.c
drivers/tty/serial/mpc52xx_uart.c
drivers/tty/serial/mpsc.c
drivers/tty/serial/msm_serial.c
drivers/tty/serial/msm_serial_hs.c
drivers/tty/serial/mux.c
drivers/tty/serial/nwpserial.c
drivers/tty/serial/pmac_zilog.c
drivers/tty/serial/sc26xx.c
drivers/tty/serial/serial_core.c
drivers/tty/serial/sh-sci.c
drivers/tty/serial/sn_console.c
drivers/tty/serial/sunhv.c
drivers/tty/serial/sunsab.c
drivers/tty/serial/sunsu.c
drivers/tty/serial/sunzilog.c
drivers/tty/serial/timbuart.c
drivers/tty/serial/uartlite.c
drivers/tty/serial/ucc_uart.c
drivers/tty/serial/vt8500_serial.c
drivers/tty/synclink.c
drivers/tty/synclink_gt.c
drivers/tty/synclinkmp.c
drivers/tty/vt/keyboard.c
drivers/tty/vt/vt.c
drivers/usb/serial/ark3116.c
drivers/usb/serial/belkin_sa.c
drivers/usb/serial/digi_acceleport.c
drivers/usb/serial/f81232.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/generic.c
drivers/usb/serial/keyspan.c
drivers/usb/serial/pl2303.c
drivers/usb/serial/spcp8x5.c
drivers/usb/serial/ssu100.c
include/linux/tty_flip.h

index 59b7bbad8394af9728adb449cdea12aa3540334c..21b57a66e809ae9168ef4ba06fb715c158db3c40 100644 (file)
@@ -46,13 +46,14 @@ typedef union _srmcons_result {
 static int
 srmcons_do_receive_chars(struct tty_struct *tty)
 {
+       struct tty_port *port = tty->port;
        srmcons_result result;
        int count = 0, loops = 0;
 
        do {
                result.as_long = callback_getc(0);
                if (result.bits.status < 2) {
-                       tty_insert_flip_char(tty, (char)result.bits.c, 0);
+                       tty_insert_flip_char(port, (char)result.bits.c, 0);
                        count++;
                }
        } while((result.bits.status & 1) && (++loops < 10));
index fc3924d18c1f6304e488201be587e1ad0a2c5642..f8ae5d8eb1060400aacc3ca09fe9c849bc39e3b8 100644 (file)
@@ -55,6 +55,7 @@ static struct console *console;
 
 static void receive_chars(struct tty_struct *tty)
 {
+       struct tty_port *port = tty->port;
        unsigned char ch;
        static unsigned char seen_esc = 0;
 
@@ -81,7 +82,7 @@ static void receive_chars(struct tty_struct *tty)
                }
                seen_esc = 0;
 
-               if (tty_insert_flip_char(tty, ch, TTY_NORMAL) == 0)
+               if (tty_insert_flip_char(port, ch, TTY_NORMAL) == 0)
                        break;
        }
        tty_flip_buffer_push(tty);
index 9b2232a78ff9612b07b528cca61cacb70a7b42ac..54ef40ceaaedfeeb2f978b481bf03d34ff5c5639 100644 (file)
@@ -667,14 +667,14 @@ insert:
                else
                        flag = TTY_NORMAL;
 
-               tty_insert_flip_char(tty, ch, flag);
+               tty_insert_flip_char(port, ch, flag);
        }
 
        /* overrun is special, since it's reported immediately, and doesn't
         * affect the current character
         */
        if (overrun)
-               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               tty_insert_flip_char(port, 0, TTY_OVERRUN);
 
        count--;
        if (count <= 0) {
index efc5e7d30530666832bb8e4600d5491fb99fcff6..4d92a379eb2156a5931d387ef1da2f12fe25a9d4 100644 (file)
@@ -147,7 +147,7 @@ static void pdc_console_poll(unsigned long unused)
                data = pdc_console_poll_key(NULL);
                if (data == -1)
                        break;
-               tty_insert_flip_char(tty, data & 0xFF, TTY_NORMAL);
+               tty_insert_flip_char(&tty_port, data & 0xFF, TTY_NORMAL);
                count ++;
        }
 
index 4ff2503a1bb831a7f83535d3b5907bf90bbaee48..795bd8102205447527f72e6d01c8d6467c8712c8 100644 (file)
@@ -81,12 +81,6 @@ static const struct chan_ops not_configged_ops = {
 };
 #endif /* CONFIG_NOCONFIG_CHAN */
 
-static void tty_receive_char(struct tty_struct *tty, char ch)
-{
-       if (tty)
-               tty_insert_flip_char(tty, ch, TTY_NORMAL);
-}
-
 static int open_one_chan(struct chan *chan)
 {
        int fd, err;
@@ -569,7 +563,7 @@ void chan_interrupt(struct line *line, struct tty_struct *tty, int irq)
                }
                err = chan->ops->read(chan->fd, &c, chan->data);
                if (err > 0)
-                       tty_receive_char(tty, c);
+                       tty_insert_flip_char(port, c, TTY_NORMAL);
        } while (err > 0);
 
        if (err == 0)
index 8207a119eee9040ebdbaa778c6cddc9bf630e54c..62447d63890cab3079c75bd8a2ef787520f293a0 100644 (file)
@@ -98,6 +98,7 @@ static int rs_write(struct tty_struct * tty,
 static void rs_poll(unsigned long priv)
 {
        struct tty_struct* tty = (struct tty_struct*) priv;
+       struct tty_port *port = tty->port;
 
        struct timeval tv = { .tv_sec = 0, .tv_usec = 0 };
        int i = 0;
@@ -107,7 +108,7 @@ static void rs_poll(unsigned long priv)
 
        while (__simc(SYS_select_one, 0, XTISS_SELECT_ONE_READ, (int)&tv,0,0)){
                __simc (SYS_read, 0, (unsigned long)&c, 1, 0, 0);
-               tty_insert_flip_char(tty, c, TTY_NORMAL);
+               tty_insert_flip_char(port, c, TTY_NORMAL);
                i++;
        }
 
index 0b1de715f09737e5e3a7366f107fac1965e64a49..9bdfe27b2413658cb9060c7f8fd16561169918a9 100644 (file)
@@ -945,7 +945,7 @@ static void rx_ready_async(MGSLPC_INFO *info, int tcd, struct tty_struct *tty)
                        else if (status & BIT6)
                                flag = TTY_FRAME;
                }
-               work += tty_insert_flip_char(tty, data, flag);
+               work += tty_insert_flip_char(port, data, flag);
        }
        issue_command(info, CHA, CMD_RXFIFO);
 
index 576d53d926776cd270ce4572e6a3e0a1d48857f0..8e0ed663ba9b9840301226f43ec4c5f0e16ebd47 100644 (file)
@@ -136,6 +136,7 @@ static int ipoctal_get_icount(struct tty_struct *tty,
 static void ipoctal_irq_rx(struct ipoctal_channel *channel,
                           struct tty_struct *tty, u8 sr)
 {
+       struct tty_port *port = &channel->tty_port;
        unsigned char value;
        unsigned char flag = TTY_NORMAL;
        u8 isr;
@@ -149,7 +150,7 @@ static void ipoctal_irq_rx(struct ipoctal_channel *channel,
                        if (sr & SR_OVERRUN_ERROR) {
                                channel->stats.overrun_err++;
                                /* Overrun doesn't affect the current character*/
-                               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                               tty_insert_flip_char(port, 0, TTY_OVERRUN);
                        }
                        if (sr & SR_PARITY_ERROR) {
                                channel->stats.parity_err++;
@@ -165,7 +166,7 @@ static void ipoctal_irq_rx(struct ipoctal_channel *channel,
                                flag = TTY_BREAK;
                        }
                }
-               tty_insert_flip_char(tty, value, flag);
+               tty_insert_flip_char(port, value, flag);
 
                /* Check if there are more characters in RX FIFO
                 * If there are more, the isr register for this channel
index 7093169ee0c97e477c387fd2d88d428e74b43ffe..4a387ec021ad949a4d9ce6f0f929b63d038f9f59 100644 (file)
@@ -913,7 +913,7 @@ isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack)
                        while ((count_pull < skb->len) && (len > 0)) {
                                /* push every character but the last to the tty buffer directly */
                                if (count_put)
-                                       tty_insert_flip_char(tty, last, TTY_NORMAL);
+                                       tty_insert_flip_char(port, last, TTY_NORMAL);
                                len--;
                                if (dev->drv[di]->DLEflag & DLEmask) {
                                        last = DLE;
@@ -953,16 +953,16 @@ isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack)
                         * Now we can dequeue it.
                         */
                        if (cisco_hack)
-                               tty_insert_flip_char(tty, last, 0xFF);
+                               tty_insert_flip_char(port, last, 0xFF);
                        else
-                               tty_insert_flip_char(tty, last, TTY_NORMAL);
+                               tty_insert_flip_char(port, last, TTY_NORMAL);
 #ifdef CONFIG_ISDN_AUDIO
                        ISDN_AUDIO_SKB_LOCK(skb) = 0;
 #endif
                        skb = skb_dequeue(&dev->drv[di]->rpqueue[channel]);
                        dev_kfree_skb(skb);
                } else {
-                       tty_insert_flip_char(tty, last, TTY_NORMAL);
+                       tty_insert_flip_char(port, last, TTY_NORMAL);
                        /* Not yet emptied this buff, so it
                         * must stay in the queue, for further calls
                         * but we pull off the data we got until now.
index 4f5bcee7cf329949a5f32fff878b9fabc74c4f38..32d65d4bc848eeb33f0ba5dccdc027c908113467 100644 (file)
@@ -92,11 +92,11 @@ isdn_tty_try_read(modem_info *info, struct sk_buff *skb)
                unsigned char *dp = skb->data;
                while (--l) {
                        if (*dp == DLE)
-                               tty_insert_flip_char(tty, DLE, 0);
-                       tty_insert_flip_char(tty, *dp++, 0);
+                               tty_insert_flip_char(port, DLE, 0);
+                       tty_insert_flip_char(port, *dp++, 0);
                }
                if (*dp == DLE)
-                       tty_insert_flip_char(tty, DLE, 0);
+                       tty_insert_flip_char(port, DLE, 0);
                last = *dp;
        } else {
 #endif
@@ -107,9 +107,9 @@ isdn_tty_try_read(modem_info *info, struct sk_buff *skb)
        }
 #endif
        if (info->emu.mdmreg[REG_CPPP] & BIT_CPPP)
-               tty_insert_flip_char(tty, last, 0xFF);
+               tty_insert_flip_char(port, last, 0xFF);
        else
-               tty_insert_flip_char(tty, last, TTY_NORMAL);
+               tty_insert_flip_char(port, last, TTY_NORMAL);
        tty_flip_buffer_push(tty);
        kfree_skb(skb);
 
@@ -2287,7 +2287,7 @@ isdn_tty_at_cout(char *msg, modem_info *info)
                if (skb) {
                        *sp++ = c;
                } else {
-                       if (tty_insert_flip_char(tty, c, TTY_NORMAL) == 0)
+                       if (tty_insert_flip_char(port, c, TTY_NORMAL) == 0)
                                break;
                }
        }
index bd57a11acc7949e7237be40a442c865c418c61a1..894078be0b9689355b575f7fce4c2ee8904d382c 100644 (file)
@@ -419,7 +419,7 @@ static void sdio_uart_receive_chars(struct sdio_uart_port *port,
 
                if ((*status & port->ignore_status_mask & ~UART_LSR_OE) == 0)
                        if (tty)
-                               tty_insert_flip_char(tty, ch, flag);
+                               tty_insert_flip_char(&port->port, ch, flag);
 
                /*
                 * Overrun is special.  Since it's reported immediately,
@@ -427,7 +427,8 @@ static void sdio_uart_receive_chars(struct sdio_uart_port *port,
                 */
                if (*status & ~port->ignore_status_mask & UART_LSR_OE)
                        if (tty)
-                               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                               tty_insert_flip_char(&port->port, 0,
+                                               TTY_OVERRUN);
 
                *status = sdio_in(port, UART_LSR);
        } while ((*status & UART_LSR_DR) && (max_count-- > 0));
index 40084501c31b7a28d2a436353a16e906c5d3640f..7c72945908801a8dfb3fb64d98435858250f0645 100644 (file)
@@ -411,7 +411,8 @@ static void raw3215_irq(struct ccw_device *cdev, unsigned long intparm,
                                break;
 
                        case CTRLCHAR_CTRL:
-                               tty_insert_flip_char(tty, cchar, TTY_NORMAL);
+                               tty_insert_flip_char(&raw->port, cchar,
+                                               TTY_NORMAL);
                                tty_flip_buffer_push(tty);
                                break;
 
index d0ae2be581910bad288b808fe4e6940c212b4ef8..acab28d4f06b8fa31e0998a03598c990828ff5b7 100644 (file)
@@ -46,7 +46,7 @@ kbd_put_queue(struct tty_port *port, int ch)
        struct tty_struct *tty = tty_port_tty_get(port);
        if (!tty)
                return;
-       tty_insert_flip_char(tty, ch, 0);
+       tty_insert_flip_char(port, ch, 0);
        tty_schedule_flip(tty);
        tty_kref_put(tty);
 }
@@ -58,7 +58,7 @@ kbd_puts_queue(struct tty_port *port, char *cp)
        if (!tty)
                return;
        while (*cp)
-               tty_insert_flip_char(tty, *cp++, 0);
+               tty_insert_flip_char(port, *cp++, 0);
        tty_schedule_flip(tty);
        tty_kref_put(tty);
 }
index 877fbc37c1e7986bd588c6bdf6656e08bb584bc3..c03863a7d455a98c91958a85715a42ba3bd6fd02 100644 (file)
@@ -342,7 +342,7 @@ sclp_tty_input(unsigned char* buf, unsigned int count)
        case CTRLCHAR_SYSRQ:
                break;
        case CTRLCHAR_CTRL:
-               tty_insert_flip_char(tty, cchar, TTY_NORMAL);
+               tty_insert_flip_char(&sclp_port, cchar, TTY_NORMAL);
                tty_flip_buffer_push(tty);
                break;
        case CTRLCHAR_NONE:
@@ -352,7 +352,7 @@ sclp_tty_input(unsigned char* buf, unsigned int count)
                     strncmp((const char *) buf + count - 2, "\252n", 2))) {
                        /* add the auto \n */
                        tty_insert_flip_string(tty, buf, count);
-                       tty_insert_flip_char(tty, '\n', TTY_NORMAL);
+                       tty_insert_flip_char(&sclp_port, '\n', TTY_NORMAL);
                } else
                        tty_insert_flip_string(tty, buf, count - 2);
                tty_flip_buffer_push(tty);
index df3ebcdf7ed8f5dee93254bd61e56398d7f30286..e618a667d84c4f5366ffac833fb102fc040f713c 100644 (file)
@@ -2957,7 +2957,7 @@ check_query:
                            !(I_IGNBRK(ch->ch_tun.un_tty))) {
 
                                tty_buffer_request_room(&ch->port, 1);
-                               tty_insert_flip_char(ch->ch_tun.un_tty, 0, TTY_BREAK);
+                               tty_insert_flip_char(&ch->port, 0, TTY_BREAK);
                                tty_flip_buffer_push(ch->ch_tun.un_tty);
 
                        }
index 85dbdc1eccecf20e62296302eacbe308cac7626f..a2a0c43dec1c34cff78e6423ab44d4f782bf8d5a 100644 (file)
@@ -617,7 +617,7 @@ static int fwtty_rx(struct fwtty_port *port, unsigned char *data, size_t len)
 
        lsr &= port->status_mask;
        if (lsr & ~port->ignore_mask & UART_LSR_OE) {
-               if (!tty_insert_flip_char(tty, 0, TTY_OVERRUN)) {
+               if (!tty_insert_flip_char(&port->port, 0, TTY_OVERRUN)) {
                        err = -EIO;
                        goto out;
                }
index 1b3e995d3a2715c1506cf7fe5672db180d513f5a..14965662d09cc8eb0538b5edf8deb4afd0a32fc6 100644 (file)
@@ -255,12 +255,11 @@ static void ProcessModemStatus(struct quatech_port *qt_port,
        wake_up_interruptible(&qt_port->wait);
 }
 
-static void ProcessRxChar(struct tty_struct *tty, struct usb_serial_port *port,
-                                               unsigned char data)
+static void ProcessRxChar(struct usb_serial_port *port, unsigned char data)
 {
        struct urb *urb = port->read_urb;
        if (urb->actual_length)
-               tty_insert_flip_char(tty, data, TTY_NORMAL);
+               tty_insert_flip_char(&port->port, data, TTY_NORMAL);
 }
 
 static void qt_write_bulk_callback(struct urb *urb)
@@ -335,8 +334,8 @@ static void qt_status_change_check(struct tty_struct *tty,
                        case 0xff:
                                dev_dbg(&port->dev, "No status sequence.\n");
 
-                               ProcessRxChar(tty, port, data[i]);
-                               ProcessRxChar(tty, port, data[i + 1]);
+                               ProcessRxChar(port, data[i]);
+                               ProcessRxChar(port, data[i + 1]);
 
                                i += 2;
                                break;
@@ -345,8 +344,8 @@ static void qt_status_change_check(struct tty_struct *tty,
                                continue;
                }
 
-               if (tty && urb->actual_length)
-                       tty_insert_flip_char(tty, data[i], TTY_NORMAL);
+               if (urb->actual_length)
+                       tty_insert_flip_char(&port->port, data[i], TTY_NORMAL);
 
        }
        tty_flip_buffer_push(tty);
index 9d7d00cdfecbed43a7779432e3185991537cba4e..2e670d0c5366603291801be5ba9af528aafe426a 100644 (file)
@@ -328,9 +328,9 @@ static void receive_chars(struct serial_state *info)
             oe = 1;
          }
        }
-       tty_insert_flip_char(tty, ch, flag);
+       tty_insert_flip_char(&info->tport, ch, flag);
        if (oe == 1)
-               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               tty_insert_flip_char(&info->tport, 0, TTY_OVERRUN);
        tty_flip_buffer_push(tty);
 out:
        return;
index 0b7573dbf439d285743d0475f5c6a8f7b003a676..d1fe9a1f8475e5ae27c7843f43fdce48c9335c00 100644 (file)
@@ -492,34 +492,34 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
                if (tty_buffer_request_room(port, 1)) {
                        if (data & info->read_status_mask) {
                                if (data & CyBREAK) {
-                                       tty_insert_flip_char(tty,
+                                       tty_insert_flip_char(port,
                                                cyy_readb(info, CyRDSR),
                                                TTY_BREAK);
                                        info->icount.rx++;
                                        if (port->flags & ASYNC_SAK)
                                                do_SAK(tty);
                                } else if (data & CyFRAME) {
-                                       tty_insert_flip_char(tty,
+                                       tty_insert_flip_char(port,
                                                cyy_readb(info, CyRDSR),
                                                TTY_FRAME);
                                        info->icount.rx++;
                                        info->idle_stats.frame_errs++;
                                } else if (data & CyPARITY) {
                                        /* Pieces of seven... */
-                                       tty_insert_flip_char(tty,
+                                       tty_insert_flip_char(port,
                                                cyy_readb(info, CyRDSR),
                                                TTY_PARITY);
                                        info->icount.rx++;
                                        info->idle_stats.parity_errs++;
                                } else if (data & CyOVERRUN) {
-                                       tty_insert_flip_char(tty, 0,
+                                       tty_insert_flip_char(port, 0,
                                                        TTY_OVERRUN);
                                        info->icount.rx++;
                                        /* If the flip buffer itself is
                                           overflowing, we still lose
                                           the next incoming character.
                                         */
-                                       tty_insert_flip_char(tty,
+                                       tty_insert_flip_char(port,
                                                cyy_readb(info, CyRDSR),
                                                TTY_FRAME);
                                        info->icount.rx++;
@@ -529,12 +529,12 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
                                /* } else if(data & CyTIMEOUT) { */
                                /* } else if(data & CySPECHAR) { */
                                } else {
-                                       tty_insert_flip_char(tty, 0,
+                                       tty_insert_flip_char(port, 0,
                                                        TTY_NORMAL);
                                        info->icount.rx++;
                                }
                        } else {
-                               tty_insert_flip_char(tty, 0, TTY_NORMAL);
+                               tty_insert_flip_char(port, 0, TTY_NORMAL);
                                info->icount.rx++;
                        }
                } else {
@@ -557,7 +557,7 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
                len = tty_buffer_request_room(port, char_count);
                while (len--) {
                        data = cyy_readb(info, CyRDSR);
-                       tty_insert_flip_char(tty, data, TTY_NORMAL);
+                       tty_insert_flip_char(port, data, TTY_NORMAL);
                        info->idle_stats.recv_bytes++;
                        info->icount.rx++;
 #ifdef CY_16Y_HACK
@@ -992,7 +992,7 @@ static void cyz_handle_rx(struct cyclades_port *info, struct tty_struct *tty)
                                                new_rx_get);
                                new_rx_get = (new_rx_get + 1) &
                                                        (rx_bufsize - 1);
-                               tty_insert_flip_char(tty, data, TTY_NORMAL);
+                               tty_insert_flip_char(port, data, TTY_NORMAL);
                                info->idle_stats.recv_bytes++;
                                info->icount.rx++;
                        }
@@ -1117,17 +1117,17 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
 
                switch (cmd) {
                case C_CM_PR_ERROR:
-                       tty_insert_flip_char(tty, 0, TTY_PARITY);
+                       tty_insert_flip_char(&info->port, 0, TTY_PARITY);
                        info->icount.rx++;
                        special_count++;
                        break;
                case C_CM_FR_ERROR:
-                       tty_insert_flip_char(tty, 0, TTY_FRAME);
+                       tty_insert_flip_char(&info->port, 0, TTY_FRAME);
                        info->icount.rx++;
                        special_count++;
                        break;
                case C_CM_RXBRK:
-                       tty_insert_flip_char(tty, 0, TTY_BREAK);
+                       tty_insert_flip_char(&info->port, 0, TTY_BREAK);
                        info->icount.rx++;
                        special_count++;
                        break;
index 3d2ea92b8505d7721a9fd8025757b1582b86bce2..8c2fe3a0e0911710f6acd1e4aa0eec8ac81c3772 100644 (file)
@@ -672,7 +672,7 @@ int hvc_poll(struct hvc_struct *hp)
                                }
                        }
 #endif /* CONFIG_MAGIC_SYSRQ */
-                       tty_insert_flip_char(tty, buf[i], 0);
+                       tty_insert_flip_char(&hp->port, buf[i], 0);
                }
 
                read_total += n;
index 68357a6e4de997344d0a8e59ffb0cd6612035f93..1f528b8ebf5f9998926301e66cc6e71c2cc77614 100644 (file)
@@ -329,8 +329,7 @@ static void hvsi_recv_query(struct hvsi_struct *hp, uint8_t *packet)
        }
 }
 
-static void hvsi_insert_chars(struct hvsi_struct *hp, struct tty_struct *tty,
-               const char *buf, int len)
+static void hvsi_insert_chars(struct hvsi_struct *hp, const char *buf, int len)
 {
        int i;
 
@@ -346,7 +345,7 @@ static void hvsi_insert_chars(struct hvsi_struct *hp, struct tty_struct *tty,
                        continue;
                }
 #endif /* CONFIG_MAGIC_SYSRQ */
-               tty_insert_flip_char(tty, c, 0);
+               tty_insert_flip_char(&hp->port, c, 0);
        }
 }
 
@@ -359,8 +358,7 @@ static void hvsi_insert_chars(struct hvsi_struct *hp, struct tty_struct *tty,
  * revisited.
  */
 #define TTY_THRESHOLD_THROTTLE 128
-static bool hvsi_recv_data(struct hvsi_struct *hp, struct tty_struct *tty,
-               const uint8_t *packet)
+static bool hvsi_recv_data(struct hvsi_struct *hp, const uint8_t *packet)
 {
        const struct hvsi_header *header = (const struct hvsi_header *)packet;
        const uint8_t *data = packet + sizeof(struct hvsi_header);
@@ -377,7 +375,7 @@ static bool hvsi_recv_data(struct hvsi_struct *hp, struct tty_struct *tty,
                datalen = TTY_THRESHOLD_THROTTLE;
        }
 
-       hvsi_insert_chars(hp, tty, data, datalen);
+       hvsi_insert_chars(hp, data, datalen);
 
        if (overflow > 0) {
                /*
@@ -438,9 +436,7 @@ static int hvsi_load_chunk(struct hvsi_struct *hp, struct tty_struct *tty,
                        case VS_DATA_PACKET_HEADER:
                                if (!is_open(hp))
                                        break;
-                               if (tty == NULL)
-                                       break; /* no tty buffer to put data in */
-                               flip = hvsi_recv_data(hp, tty, packet);
+                               flip = hvsi_recv_data(hp, packet);
                                break;
                        case VS_CONTROL_PACKET_HEADER:
                                hvsi_recv_control(hp, packet, tty, handshake);
@@ -474,12 +470,12 @@ static int hvsi_load_chunk(struct hvsi_struct *hp, struct tty_struct *tty,
        return 1;
 }
 
-static void hvsi_send_overflow(struct hvsi_struct *hp, struct tty_struct *tty)
+static void hvsi_send_overflow(struct hvsi_struct *hp)
 {
        pr_debug("%s: delivering %i bytes overflow\n", __func__,
                        hp->n_throttle);
 
-       hvsi_insert_chars(hp, tty, hp->throttle_buf, hp->n_throttle);
+       hvsi_insert_chars(hp, hp->throttle_buf, hp->n_throttle);
        hp->n_throttle = 0;
 }
 
@@ -514,7 +510,7 @@ static irqreturn_t hvsi_interrupt(int irq, void *arg)
        if (tty && hp->n_throttle && !test_bit(TTY_THROTTLED, &tty->flags)) {
                /* we weren't hung up and we weren't throttled, so we can
                 * deliver the rest now */
-               hvsi_send_overflow(hp, tty);
+               hvsi_send_overflow(hp);
                tty_flip_buffer_push(tty);
        }
        spin_unlock_irqrestore(&hp->lock, flags);
@@ -1001,7 +997,7 @@ static void hvsi_unthrottle(struct tty_struct *tty)
 
        spin_lock_irqsave(&hp->lock, flags);
        if (hp->n_throttle) {
-               hvsi_send_overflow(hp, tty);
+               hvsi_send_overflow(hp);
                tty_flip_buffer_push(tty);
        }
        spin_unlock_irqrestore(&hp->lock, flags);
index e9fc15f00f4820eadf2935c5038e3072bd5070bf..c70144f55fc07db47087f27fd6cf44e7b7143c9c 100644 (file)
@@ -634,7 +634,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id)
                        break;
 
                case 1: /* Received Break !!! */
-                       tty_insert_flip_char(tty, 0, TTY_BREAK);
+                       tty_insert_flip_char(&port->port, 0, TTY_BREAK);
                        if (port->port.flags & ASYNC_SAK)
                                do_SAK(tty);
                        tty_flip_buffer_push(tty);
@@ -658,7 +658,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id)
                insw(base, rp, word_count);
                byte_count -= (word_count << 1);
                if (count & 0x0001) {
-                       tty_insert_flip_char(tty,  inw(base) & 0xff,
+                       tty_insert_flip_char(&port->port, inw(base) & 0xff,
                                TTY_NORMAL);
                        byte_count -= 2;
                }
index fcaac4870d5f77e29a65094dca188048eb538770..f42492db31c921dc56f75a37de5e8ae29329b1c8 100644 (file)
@@ -1429,7 +1429,7 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
                goto put;
 
        if (tty && (intr & IntrBreak) && !I_IGNBRK(tty)) { /* BREAK */
-               tty_insert_flip_char(tty, 0, TTY_BREAK);
+               tty_insert_flip_char(&p->port, 0, TTY_BREAK);
                tty_schedule_flip(tty);
        }
 
index 40113868bec25bad3384fdeec9cfaff13c63aee4..450c4507cb5b00ece2ffc657c3fa5dd532da216f 100644 (file)
@@ -2079,7 +2079,7 @@ static void mxser_receive_chars(struct tty_struct *tty,
                }
                while (gdl--) {
                        ch = inb(port->ioaddr + UART_RX);
-                       tty_insert_flip_char(tty, ch, 0);
+                       tty_insert_flip_char(&port->port, ch, 0);
                        cnt++;
                }
                goto end_intr;
@@ -2118,7 +2118,7 @@ intr_old:
                                } else
                                        flag = TTY_BREAK;
                        }
-                       tty_insert_flip_char(tty, ch, flag);
+                       tty_insert_flip_char(&port->port, ch, flag);
                        cnt++;
                        if (cnt >= recv_room) {
                                if (!port->ldisc_stop_rx)
index 4572117988f8738ecb2979865647cee58de8f21c..769016504c880bfa8f66959e482bc40d3e79a242 100644 (file)
@@ -1070,9 +1070,9 @@ static void gsm_process_modem(struct tty_struct *tty, struct gsm_dlci *dlci,
                if ((mlines & TIOCM_CD) == 0 && (dlci->modem_rx & TIOCM_CD))
                        if (!(tty->termios.c_cflag & CLOCAL))
                                tty_hangup(tty);
-               if (brk & 0x01)
-                       tty_insert_flip_char(tty, 0, TTY_BREAK);
        }
+       if (brk & 0x01)
+               tty_insert_flip_char(&dlci->port, 0, TTY_BREAK);
        dlci->modem_rx = mlines;
 }
 
@@ -1140,6 +1140,7 @@ static void gsm_control_modem(struct gsm_mux *gsm, u8 *data, int clen)
 
 static void gsm_control_rls(struct gsm_mux *gsm, u8 *data, int clen)
 {
+       struct tty_port *port;
        struct tty_struct *tty;
        unsigned int addr = 0 ;
        u8 bits;
@@ -1163,16 +1164,19 @@ static void gsm_control_rls(struct gsm_mux *gsm, u8 *data, int clen)
        bits = *dp;
        if ((bits & 1) == 0)
                return;
-       /* See if we have an uplink tty */
-       tty = tty_port_tty_get(&gsm->dlci[addr]->port);
 
+       port = &gsm->dlci[addr]->port;
+
+       if (bits & 2)
+               tty_insert_flip_char(port, 0, TTY_OVERRUN);
+       if (bits & 4)
+               tty_insert_flip_char(port, 0, TTY_PARITY);
+       if (bits & 8)
+               tty_insert_flip_char(port, 0, TTY_FRAME);
+
+       /* See if we have an uplink tty */
+       tty = tty_port_tty_get(port);
        if (tty) {
-               if (bits & 2)
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
-               if (bits & 4)
-                       tty_insert_flip_char(tty, 0, TTY_PARITY);
-               if (bits & 8)
-                       tty_insert_flip_char(tty, 0, TTY_FRAME);
                tty_flip_buffer_push(tty);
                tty_kref_put(tty);
        }
index a0c69ab04399b80e9ac71e98d5d35045ee2bdef1..437a6366fb7b7daca3f0da92e8ea4ae691c800b0 100644 (file)
@@ -855,7 +855,7 @@ static int receive_data(enum port_type index, struct nozomi *dc)
                read_mem32((u32 *) buf, addr + offset, RECEIVE_BUF_MAX);
 
                if (size == 1) {
-                       tty_insert_flip_char(tty, buf[0], TTY_NORMAL);
+                       tty_insert_flip_char(&port->port, buf[0], TTY_NORMAL);
                        size = 0;
                } else if (size < RECEIVE_BUF_MAX) {
                        size -= tty_insert_flip_string(tty, (char *) buf, size);
index 77d7bc94afaa777280692b8048c4901f17bf79a9..5848a767001aeaf48934af58f1c8491141f1dd9c 100644 (file)
@@ -379,7 +379,8 @@ static void rp_do_receive(struct r_port *info,
                                flag = TTY_OVERRUN;
                        else
                                flag = TTY_NORMAL;
-                       tty_insert_flip_char(tty, CharNStat & 0xff, flag);
+                       tty_insert_flip_char(&info->port, CharNStat & 0xff,
+                                       flag);
                        ToRecv--;
                }
 
index f99a84526f825d16d920eb70ba7ed1f38770be19..3719273cf0be13364b8144b22a23d7b92e845436 100644 (file)
@@ -305,7 +305,7 @@ static void receive_chars(struct m68k_serial *info, struct tty_struct *tty,
                else if (rx & URX_FRAME_ERROR)
                        flag = TTY_FRAME;
 
-               tty_insert_flip_char(tty, ch, flag);
+               tty_insert_flip_char(&info->tport, ch, flag);
 #ifndef CONFIG_XCOPILOT_BUGS
        } while((rx = uart->urx.w) & URX_DATA_READY);
 #endif
index 505c490c0b4484a118ec5133894dbbee2a257db0..6ca5dd615f9e38b2f380d23fe6006d4deb3d3bb4 100644 (file)
@@ -297,10 +297,11 @@ static void ar933x_uart_set_termios(struct uart_port *port,
 
 static void ar933x_uart_rx_chars(struct ar933x_uart_port *up)
 {
+       struct tty_port *port = &up->port.state->port;
        struct tty_struct *tty;
        int max_count = 256;
 
-       tty = tty_port_tty_get(&up->port.state->port);
+       tty = tty_port_tty_get(port);
        do {
                unsigned int rdata;
                unsigned char ch;
@@ -313,11 +314,6 @@ static void ar933x_uart_rx_chars(struct ar933x_uart_port *up)
                ar933x_uart_write(up, AR933X_UART_DATA_REG,
                                  AR933X_UART_DATA_RX_CSR);
 
-               if (!tty) {
-                       /* discard the data if no tty available */
-                       continue;
-               }
-
                up->port.icount.rx++;
                ch = rdata & AR933X_UART_DATA_TX_RX_MASK;
 
@@ -325,7 +321,7 @@ static void ar933x_uart_rx_chars(struct ar933x_uart_port *up)
                        continue;
 
                if ((up->port.ignore_status_mask & AR933X_DUMMY_STATUS_RD) == 0)
-                       tty_insert_flip_char(tty, ch, TTY_NORMAL);
+                       tty_insert_flip_char(port, ch, TTY_NORMAL);
        } while (max_count-- > 0);
 
        if (tty) {
index c76a226080f2f591047bd4336257aa0eef87dd52..de30b190972811f737222a341cf3bacb78a71f67 100644 (file)
@@ -235,6 +235,7 @@ static const char *bcm_uart_type(struct uart_port *port)
  */
 static void bcm_uart_do_rx(struct uart_port *port)
 {
+       struct tty_port *port = &port->state->port;
        struct tty_struct *tty;
        unsigned int max_count;
 
@@ -242,7 +243,7 @@ static void bcm_uart_do_rx(struct uart_port *port)
         * higher than fifo size anyway since we're much faster than
         * serial port */
        max_count = 32;
-       tty = port->state->port.tty;
+       tty = port->tty;
        do {
                unsigned int iestat, c, cstat;
                char flag;
@@ -261,7 +262,7 @@ static void bcm_uart_do_rx(struct uart_port *port)
                        bcm_uart_writel(port, val, UART_CTL_REG);
 
                        port->icount.overrun++;
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       tty_insert_flip_char(port, 0, TTY_OVERRUN);
                }
 
                if (!(iestat & UART_IR_STAT(UART_IR_RXNOTEMPTY)))
@@ -300,7 +301,7 @@ static void bcm_uart_do_rx(struct uart_port *port)
 
 
                if ((cstat & port->ignore_status_mask) == 0)
-                       tty_insert_flip_char(tty, c, flag);
+                       tty_insert_flip_char(port, c, flag);
 
        } while (--max_count);
 
index f5d117379b605653b4e8641e94490b92723e2eb4..e4d3ac2e8992f952c57a142e7dd63c7fb723c508 100644 (file)
@@ -149,7 +149,8 @@ static int sport_uart_setup(struct sport_uart_port *up, int size, int baud_rate)
 static irqreturn_t sport_uart_rx_irq(int irq, void *dev_id)
 {
        struct sport_uart_port *up = dev_id;
-       struct tty_struct *tty = up->port.state->port.tty;
+       struct tty_port *port = &up->port.state->port;
+       struct tty_struct *tty = tport->tty;
        unsigned int ch;
 
        spin_lock(&up->port.lock);
@@ -159,7 +160,7 @@ static irqreturn_t sport_uart_rx_irq(int irq, void *dev_id)
                up->port.icount.rx++;
 
                if (!uart_handle_sysrq_char(&up->port, ch))
-                       tty_insert_flip_char(tty, ch, TTY_NORMAL);
+                       tty_insert_flip_char(port, ch, TTY_NORMAL);
        }
        tty_flip_buffer_push(tty);
 
@@ -182,7 +183,6 @@ static irqreturn_t sport_uart_tx_irq(int irq, void *dev_id)
 static irqreturn_t sport_uart_err_irq(int irq, void *dev_id)
 {
        struct sport_uart_port *up = dev_id;
-       struct tty_struct *tty = up->port.state->port.tty;
        unsigned int stat = SPORT_GET_STAT(up);
 
        spin_lock(&up->port.lock);
@@ -190,7 +190,7 @@ static irqreturn_t sport_uart_err_irq(int irq, void *dev_id)
        /* Overflow in RX FIFO */
        if (stat & ROVF) {
                up->port.icount.overrun++;
-               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               tty_insert_flip_char(&up->port.state->port, 0, TTY_OVERRUN);
                SPORT_PUT_STAT(up, ROVF); /* Clear ROVF bit */
        }
        /* These should not happen */
@@ -205,6 +205,8 @@ static irqreturn_t sport_uart_err_irq(int irq, void *dev_id)
        SSYNC();
 
        spin_unlock(&up->port.lock);
+       /* XXX we don't push the overrun bit to TTY? */
+
        return IRQ_HANDLED;
 }
 
index 42d5eb0125b32baf6b346a833a7a412c2c923cd9..108122f8f3c2fc7e058751f0200b2d425e4f0199 100644 (file)
@@ -303,7 +303,7 @@ static void cpm_uart_int_rx(struct uart_port *port)
                        }
 #endif
                      error_return:
-                       tty_insert_flip_char(tty, ch, flg);
+                       tty_insert_flip_char(tport, ch, flg);
 
                }               /* End while (i--) */
 
index 35ee6a2c6877ef45a599351ff5fd74c8c142fe99..d123066254588fe96bfae8075ea91bafd6f73635 100644 (file)
@@ -1760,8 +1760,7 @@ add_char_and_flag(struct e100_serial *info, unsigned char data, unsigned char fl
 
                info->icount.rx++;
        } else {
-               struct tty_struct *tty = info->port.tty;
-               tty_insert_flip_char(tty, data, flag);
+               tty_insert_flip_char(&info->port, data, flag);
                info->icount.rx++;
        }
 
@@ -2338,8 +2337,7 @@ more_data:
                                        data_in, data_read);
                                char flag = TTY_NORMAL;
                                if (info->errorcode == ERRCODE_INSERT_BREAK) {
-                                       struct tty_struct *tty = info->port.tty;
-                                       tty_insert_flip_char(tty, 0, flag);
+                                       tty_insert_flip_char(&info->port, 0, flag);
                                        info->icount.rx++;
                                }
 
@@ -2353,7 +2351,7 @@ more_data:
                                        info->icount.frame++;
                                        flag = TTY_FRAME;
                                }
-                               tty_insert_flip_char(tty, data, flag);
+                               tty_insert_flip_char(&info->port, data, flag);
                                info->errorcode = 0;
                        }
                        info->break_detected_cnt = 0;
@@ -2369,7 +2367,7 @@ more_data:
                        log_int(rdpc(), 0, 0);
                }
                );
-               tty_insert_flip_char(tty,
+               tty_insert_flip_char(&info->port,
                        IO_EXTRACT(R_SERIAL0_READ, data_in, data_read),
                        TTY_NORMAL);
        } else {
index a8cbb267052145913239f5b0511eb0eee91b23a6..bdf67b0cb8b667723a4fda2719fc38055dae84a9 100644 (file)
@@ -194,8 +194,7 @@ static void efm32_uart_break_ctl(struct uart_port *port, int ctl)
        /* not possible without fiddling with gpios */
 }
 
-static void efm32_uart_rx_chars(struct efm32_uart_port *efm_port,
-               struct tty_struct *tty)
+static void efm32_uart_rx_chars(struct efm32_uart_port *efm_port)
 {
        struct uart_port *port = &efm_port->port;
 
@@ -237,8 +236,8 @@ static void efm32_uart_rx_chars(struct efm32_uart_port *efm_port,
                                        rxdata & UARTn_RXDATAX_RXDATA__MASK))
                        continue;
 
-               if (tty && (rxdata & port->ignore_status_mask) == 0)
-                       tty_insert_flip_char(tty,
+               if ((rxdata & port->ignore_status_mask) == 0)
+                       tty_insert_flip_char(&port->state->port,
                                        rxdata & UARTn_RXDATAX_RXDATA__MASK, flag);
        }
 }
@@ -249,15 +248,16 @@ static irqreturn_t efm32_uart_rxirq(int irq, void *data)
        u32 irqflag = efm32_uart_read32(efm_port, UARTn_IF);
        int handled = IRQ_NONE;
        struct uart_port *port = &efm_port->port;
+       struct tty_port *tport = &port->state->port;
        struct tty_struct *tty;
 
        spin_lock(&port->lock);
 
-       tty = tty_kref_get(port->state->port.tty);
+       tty = tty_kref_get(tport->tty);
 
        if (irqflag & UARTn_IF_RXDATAV) {
                efm32_uart_write32(efm_port, UARTn_IF_RXDATAV, UARTn_IFC);
-               efm32_uart_rx_chars(efm_port, tty);
+               efm32_uart_rx_chars(efm_port);
 
                handled = IRQ_HANDLED;
        }
@@ -265,8 +265,7 @@ static irqreturn_t efm32_uart_rxirq(int irq, void *data)
        if (irqflag & UARTn_IF_RXOF) {
                efm32_uart_write32(efm_port, UARTn_IF_RXOF, UARTn_IFC);
                port->icount.overrun++;
-               if (tty)
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               tty_insert_flip_char(tport, 0, TTY_OVERRUN);
 
                handled = IRQ_HANDLED;
        }
index 72b6334bcf1aacae37068258ec9d4cbd46e6bf3d..2b0b60ff7f01886a02c45b8edbd70845ab4ab0ed 100644 (file)
@@ -734,7 +734,8 @@ static void xmit_interrupt(u16 port_int_reg, struct icom_port *icom_port)
 static void recv_interrupt(u16 port_int_reg, struct icom_port *icom_port)
 {
        short int count, rcv_buff;
-       struct tty_struct *tty = icom_port->uart_port.state->port.tty;
+       struct tty_port *port = &icom_port->uart_port.state->port;
+       struct tty_struct *tty = port->tty;
        unsigned short int status;
        struct uart_icount *icount;
        unsigned long offset;
@@ -812,7 +813,7 @@ static void recv_interrupt(u16 port_int_reg, struct icom_port *icom_port)
 
                }
 
-               tty_insert_flip_char(tty, *(icom_port->recv_buf + offset + count - 1), flag);
+               tty_insert_flip_char(port, *(icom_port->recv_buf + offset + count - 1), flag);
 
                if (status & SA_FLAGS_OVERRUN)
                        /*
@@ -820,7 +821,7 @@ static void recv_interrupt(u16 port_int_reg, struct icom_port *icom_port)
                         * reported immediately, and doesn't
                         * affect the current character
                         */
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       tty_insert_flip_char(port, 0, TTY_OVERRUN);
 ignore_char:
                icom_port->statStg->rcv[rcv_buff].flags = 0;
                icom_port->statStg->rcv[rcv_buff].leLength = 0;
index 1a2488495f697eda21e2d343e4f05058ca7907f9..f60c4028b6e1eb961a062cd2613a42c5e6ef6342 100644 (file)
@@ -517,6 +517,8 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
        struct imx_port *sport = dev_id;
        unsigned int rx, flg, ignored = 0;
        struct tty_struct *tty = sport->port.state->port.tty;
+       struct tty_port *port = &sport->port.state->port;
+       struct tty_struct *tty = port->tty;
        unsigned long flags, temp;
 
        spin_lock_irqsave(&sport->port.lock, flags);
@@ -569,7 +571,7 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
 #endif
                }
 
-               tty_insert_flip_char(tty, rx, flg);
+               tty_insert_flip_char(port, rx, flg);
        }
 
 out:
index 3969e54744cce3a3ffa4cc498cf3d06a53bf5ae8..ac1d36cb2032e27ad102f687262c4ea2713745cf 100644 (file)
@@ -631,13 +631,13 @@ void jsm_input(struct jsm_channel *ch)
                                 * format it likes.
                                 */
                                if (*(ch->ch_equeue +tail +i) & UART_LSR_BI)
-                                       tty_insert_flip_char(tp, *(ch->ch_rqueue +tail +i),  TTY_BREAK);
+                                       tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i),  TTY_BREAK);
                                else if (*(ch->ch_equeue +tail +i) & UART_LSR_PE)
-                                       tty_insert_flip_char(tp, *(ch->ch_rqueue +tail +i), TTY_PARITY);
+                                       tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_PARITY);
                                else if (*(ch->ch_equeue +tail +i) & UART_LSR_FE)
-                                       tty_insert_flip_char(tp, *(ch->ch_rqueue +tail +i), TTY_FRAME);
+                                       tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_FRAME);
                                else
-                                       tty_insert_flip_char(tp, *(ch->ch_rqueue +tail +i), TTY_NORMAL);
+                                       tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_NORMAL);
                        }
                } else {
                        tty_insert_flip_string(tp, ch->ch_rqueue + tail, s) ;
index 6ac2b797a764e6e66362996b1ee08572df1e30c1..ba2ef627d9c673bc5846c66061a75aa0f29dbec2 100644 (file)
@@ -216,7 +216,7 @@ static void kgdb_nmi_tty_receiver(unsigned long data)
                return;
 
        while (kfifo_out(&priv->fifo, &ch, 1))
-               tty_insert_flip_char(priv->port.tty, ch, TTY_NORMAL);
+               tty_insert_flip_char(&priv->port, ch, TTY_NORMAL);
        tty_flip_buffer_push(priv->port.tty);
 
        tty_kref_put(tty);
index 02da071fe1e7e3a4796ae2b43f92739525eed59f..1933fe3c98dd7b1cfe163cc1def6634db653d4af 100644 (file)
@@ -162,7 +162,8 @@ lqasc_enable_ms(struct uart_port *port)
 static int
 lqasc_rx_chars(struct uart_port *port)
 {
-       struct tty_struct *tty = tty_port_tty_get(&port->state->port);
+       struct tty_port *tport = &port->state->port;
+       struct tty_struct *tty = tty_port_tty_get(tport);
        unsigned int ch = 0, rsr = 0, fifocnt;
 
        if (!tty) {
@@ -208,7 +209,7 @@ lqasc_rx_chars(struct uart_port *port)
                }
 
                if ((rsr & port->ignore_status_mask) == 0)
-                       tty_insert_flip_char(tty, ch, flag);
+                       tty_insert_flip_char(tport, ch, flag);
 
                if (rsr & ASCSTATE_ROE)
                        /*
@@ -216,7 +217,7 @@ lqasc_rx_chars(struct uart_port *port)
                         * immediately, and doesn't affect the current
                         * character
                         */
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       tty_insert_flip_char(tport, 0, TTY_OVERRUN);
        }
        if (ch != 0)
                tty_flip_buffer_push(tty);
index 0e86bff3fe2a31b4efc34d2925034e0af0f6e310..5cd180564c033697e37f085be5e4047bcb672ab0 100644 (file)
@@ -257,8 +257,9 @@ static void __serial_uart_flush(struct uart_port *port)
 
 static void __serial_lpc32xx_rx(struct uart_port *port)
 {
+       struct tty_port *tport = &port->state->port;
        unsigned int tmp, flag;
-       struct tty_struct *tty = tty_port_tty_get(&port->state->port);
+       struct tty_struct *tty = tty_port_tty_get(tport);
 
        if (!tty) {
                /* Discard data: no tty available */
@@ -281,10 +282,10 @@ static void __serial_lpc32xx_rx(struct uart_port *port)
                               LPC32XX_HSUART_IIR(port->membase));
                        port->icount.frame++;
                        flag = TTY_FRAME;
-                       tty_insert_flip_char(tty, 0, TTY_FRAME);
+                       tty_insert_flip_char(tport, 0, TTY_FRAME);
                }
 
-               tty_insert_flip_char(tty, (tmp & 0xFF), flag);
+               tty_insert_flip_char(tport, (tmp & 0xFF), flag);
 
                tmp = readl(LPC32XX_HSUART_FIFO(port->membase));
        }
@@ -332,7 +333,8 @@ exit_tx:
 static irqreturn_t serial_lpc32xx_interrupt(int irq, void *dev_id)
 {
        struct uart_port *port = dev_id;
-       struct tty_struct *tty = tty_port_tty_get(&port->state->port);
+       struct tty_port *port = &port->state->port;
+       struct tty_struct *tty = tty_port_tty_get(tport);
        u32 status;
 
        spin_lock(&port->lock);
@@ -356,8 +358,8 @@ static irqreturn_t serial_lpc32xx_interrupt(int irq, void *dev_id)
                writel(LPC32XX_HSU_RX_OE_INT,
                       LPC32XX_HSUART_IIR(port->membase));
                port->icount.overrun++;
+               tty_insert_flip_char(tport, 0, TTY_OVERRUN);
                if (tty) {
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
                        tty_schedule_flip(tty);
                }
        }
index b13949ad34089e01b58af1b597f2d3dc6baa42f4..2e9a390f2ac44364574b3deac7abb18e02d26767 100644 (file)
@@ -300,7 +300,8 @@ static void m32r_sio_enable_ms(struct uart_port *port)
 
 static void receive_chars(struct uart_sio_port *up, int *status)
 {
-       struct tty_struct *tty = up->port.state->port.tty;
+       struct tty_port *port = &up->port.state->port;
+       struct tty_struct *tty = tport->tty;
        unsigned char ch;
        unsigned char flag;
        int max_count = 256;
@@ -355,7 +356,7 @@ static void receive_chars(struct uart_sio_port *up, int *status)
                if (uart_handle_sysrq_char(&up->port, ch))
                        goto ignore_char;
                if ((*status & up->port.ignore_status_mask) == 0)
-                       tty_insert_flip_char(tty, ch, flag);
+                       tty_insert_flip_char(port, ch, flag);
 
                if (*status & UART_LSR_OE) {
                        /*
@@ -363,7 +364,7 @@ static void receive_chars(struct uart_sio_port *up, int *status)
                         * immediately, and doesn't affect the current
                         * character.
                         */
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       tty_insert_flip_char(port, 0, TTY_OVERRUN);
                }
        ignore_char:
                *status = serial_in(up, UART_LSR);
index 7c23c4f4c58d4ddceaadc0a768559692c2f4a185..0145aeb7721cb79f58139314407edb77ae73e528 100644 (file)
@@ -941,7 +941,8 @@ static struct uart_ops mpc52xx_uart_ops = {
 static inline int
 mpc52xx_uart_int_rx_chars(struct uart_port *port)
 {
-       struct tty_struct *tty = port->state->port.tty;
+       struct tty_port *tport = &port->state->port;
+       struct tty_struct *tty = tport->tty;
        unsigned char ch, flag;
        unsigned short status;
 
@@ -986,14 +987,14 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
                        out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STAT);
 
                }
-               tty_insert_flip_char(tty, ch, flag);
+               tty_insert_flip_char(tport, ch, flag);
                if (status & MPC52xx_PSC_SR_OE) {
                        /*
                         * Overrun is special, since it's
                         * reported immediately, and doesn't
                         * affect the current character
                         */
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       tty_insert_flip_char(tport, 0, TTY_OVERRUN);
                        port->icount.overrun++;
                }
        }
index 50366863cfa349fc923244d447229c9864ec5b10..4bcbc66c48c4b2baea2ca8b151c7b404a01a7b2f 100644 (file)
@@ -1040,10 +1040,10 @@ static int mpsc_rx_intr(struct mpsc_port_info *pi)
                                                | SDMA_DESC_CMDSTAT_FR
                                                | SDMA_DESC_CMDSTAT_OR)))
                                && !(cmdstat & pi->port.ignore_status_mask)) {
-                       tty_insert_flip_char(tty, *bp, flag);
+                       tty_insert_flip_char(port, *bp, flag);
                } else {
                        for (i=0; i<bytes_in; i++)
-                               tty_insert_flip_char(tty, *bp++, TTY_NORMAL);
+                               tty_insert_flip_char(port, *bp++, TTY_NORMAL);
 
                        pi->port.icount.rx += bytes_in;
                }
index 95fd39be29349857dd4c4380618e568135a09c1d..e4eb81a127931f34da9553870ffccfd5cc51c8f8 100644 (file)
@@ -91,14 +91,15 @@ static void msm_enable_ms(struct uart_port *port)
 
 static void handle_rx_dm(struct uart_port *port, unsigned int misr)
 {
-       struct tty_struct *tty = port->state->port.tty;
+       struct tty_port *tport = &port->state->port;
+       struct tty_struct *tty = tport->tty;
        unsigned int sr;
        int count = 0;
        struct msm_port *msm_port = UART_TO_MSM(port);
 
        if ((msm_read(port, UART_SR) & UART_SR_OVERRUN)) {
                port->icount.overrun++;
-               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               tty_insert_flip_char(tport, 0, TTY_OVERRUN);
                msm_write(port, UART_CR_CMD_RESET_ERR, UART_CR);
        }
 
@@ -146,7 +147,8 @@ static void handle_rx_dm(struct uart_port *port, unsigned int misr)
 
 static void handle_rx(struct uart_port *port)
 {
-       struct tty_struct *tty = port->state->port.tty;
+       struct tty_port *tport = &port->state->port;
+       struct tty_struct *tty = tport->tty;
        unsigned int sr;
 
        /*
@@ -155,7 +157,7 @@ static void handle_rx(struct uart_port *port)
         */
        if ((msm_read(port, UART_SR) & UART_SR_OVERRUN)) {
                port->icount.overrun++;
-               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               tty_insert_flip_char(tport, 0, TTY_OVERRUN);
                msm_write(port, UART_CR_CMD_RESET_ERR, UART_CR);
        }
 
@@ -186,7 +188,7 @@ static void handle_rx(struct uart_port *port)
                }
 
                if (!uart_handle_sysrq_char(port, c))
-                       tty_insert_flip_char(tty, c, flag);
+                       tty_insert_flip_char(tport, c, flag);
        }
 
        tty_flip_buffer_push(tty);
index 1fa92284ade0d66d0518ecebf372cdb3ddaed6e7..6aa9d470ef549a97ef38ab3b40f67cfcbc5bc438 100644 (file)
@@ -908,6 +908,7 @@ static void msm_hs_dmov_rx_callback(struct msm_dmov_cmd *cmd_ptr,
        unsigned long flags;
        unsigned int flush;
        struct tty_struct *tty;
+       struct tty_port *port;
        struct uart_port *uport;
        struct msm_hs_port *msm_uport;
 
@@ -917,7 +918,8 @@ static void msm_hs_dmov_rx_callback(struct msm_dmov_cmd *cmd_ptr,
        spin_lock_irqsave(&uport->lock, flags);
        clk_enable(msm_uport->clk);
 
-       tty = uport->state->port.tty;
+       port = &uport->state->port;
+       tty = port->tty;
 
        msm_hs_write(uport, UARTDM_CR_ADDR, STALE_EVENT_DISABLE);
 
@@ -926,7 +928,7 @@ static void msm_hs_dmov_rx_callback(struct msm_dmov_cmd *cmd_ptr,
        /* overflow is not connect to data in a FIFO */
        if (unlikely((status & UARTDM_SR_OVERRUN_BMSK) &&
                     (uport->read_status_mask & CREAD))) {
-               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               tty_insert_flip_char(port, 0, TTY_OVERRUN);
                uport->icount.buf_overrun++;
                error_f = 1;
        }
@@ -939,7 +941,7 @@ static void msm_hs_dmov_rx_callback(struct msm_dmov_cmd *cmd_ptr,
                uport->icount.parity++;
                error_f = 1;
                if (uport->ignore_status_mask & IGNPAR)
-                       tty_insert_flip_char(tty, 0, TTY_PARITY);
+                       tty_insert_flip_char(port, 0, TTY_PARITY);
        }
 
        if (error_f)
@@ -1344,7 +1346,6 @@ static irqreturn_t msm_hs_rx_wakeup_isr(int irq, void *dev)
        unsigned long flags;
        struct msm_hs_port *msm_uport = dev;
        struct uart_port *uport = &msm_uport->uport;
-       struct tty_struct *tty = NULL;
 
        spin_lock_irqsave(&uport->lock, flags);
        if (msm_uport->clk_state == MSM_HS_CLK_OFF) {
@@ -1361,8 +1362,7 @@ static irqreturn_t msm_hs_rx_wakeup_isr(int irq, void *dev)
                 * optionally inject char into tty rx */
                msm_hs_request_clock_on_locked(uport);
                if (msm_uport->rx_wakeup.inject_rx) {
-                       tty = uport->state->port.tty;
-                       tty_insert_flip_char(tty,
+                       tty_insert_flip_char(&uport->state->port,
                                             msm_uport->rx_wakeup.rx_to_inject,
                                             TTY_NORMAL);
                        queue_work(msm_hs_workqueue, &msm_uport->rx.tty_work);
index e2775b6df5a54fb252850333bd7a3a8237b7fdfb..83b21686020eda6e8279673b1960c5cc04a74752 100644 (file)
@@ -242,8 +242,9 @@ static void mux_write(struct uart_port *port)
  */
 static void mux_read(struct uart_port *port)
 {
+       struct tty_port *tport = &port->state->port;
        int data;
-       struct tty_struct *tty = port->state->port.tty;
+       struct tty_struct *tty = tport->tty;
        __u32 start_count = port->icount.rx;
 
        while(1) {
@@ -266,7 +267,7 @@ static void mux_read(struct uart_port *port)
                if (uart_handle_sysrq_char(port, data & 0xffu))
                        continue;
 
-               tty_insert_flip_char(tty, data & 0xFF, TTY_NORMAL);
+               tty_insert_flip_char(tport, data & 0xFF, TTY_NORMAL);
        }
        
        if (start_count != port->icount.rx) {
index dd4c31d1aee5d527198b36529524b319a90a4920..10d64a3697fba78827f23ddb83a0b5de933c7868 100644 (file)
@@ -128,7 +128,8 @@ static void nwpserial_config_port(struct uart_port *port, int flags)
 static irqreturn_t nwpserial_interrupt(int irq, void *dev_id)
 {
        struct nwpserial_port *up = dev_id;
-       struct tty_struct *tty = up->port.state->port.tty;
+       struct tty_port *port = &up->port.state->port;
+       struct tty_struct *tty = port->tty;
        irqreturn_t ret;
        unsigned int iir;
        unsigned char ch;
@@ -146,7 +147,7 @@ static irqreturn_t nwpserial_interrupt(int irq, void *dev_id)
                up->port.icount.rx++;
                ch = dcr_read(up->dcr_host, UART_RX);
                if (up->port.ignore_status_mask != NWPSERIAL_STATUS_RXVALID)
-                       tty_insert_flip_char(tty, ch, TTY_NORMAL);
+                       tty_insert_flip_char(port, ch, TTY_NORMAL);
        } while (dcr_read(up->dcr_host, UART_LSR) & UART_LSR_DR);
 
        tty_flip_buffer_push(tty);
index 333c8d012b0e32c9e40881fd1defff6cc52b8b10..73a3f295e7c41a155e64b8bab6b6373af8d53cf4 100644 (file)
@@ -229,6 +229,7 @@ static void pmz_interrupt_control(struct uart_pmac_port *uap, int enable)
 
 static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap)
 {
+       struct tty_port *port;
        struct tty_struct *tty = NULL;
        unsigned char ch, r1, drop, error, flag;
        int loops = 0;
@@ -239,7 +240,8 @@ static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap)
                (void)read_zsdata(uap);
                return NULL;
        }
-       tty = uap->port.state->port.tty;
+       port = &uap->port.state->port;
+       tty = port->tty; /* TOCTOU above */
 
        while (1) {
                error = 0;
@@ -309,10 +311,10 @@ static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap)
 
                if (uap->port.ignore_status_mask == 0xff ||
                    (r1 & uap->port.ignore_status_mask) == 0) {
-                       tty_insert_flip_char(tty, ch, flag);
+                       tty_insert_flip_char(port, ch, flag);
                }
                if (r1 & Rx_OVR)
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       tty_insert_flip_char(port, 0, TTY_OVERRUN);
        next_char:
                /* We can get stuck in an infinite loop getting char 0 when the
                 * line is in a wrong HW state, we break that here.
index aced1dd923d83b46b072434ad558fd2aa1421570..0cd0e4ac12a658d5f60ecdcdd86c3c75c35ac89d 100644 (file)
@@ -138,14 +138,18 @@ static void sc26xx_disable_irq(struct uart_port *port, int mask)
 
 static struct tty_struct *receive_chars(struct uart_port *port)
 {
+       struct tty_port *tport = NULL;
        struct tty_struct *tty = NULL;
        int limit = 10000;
        unsigned char ch;
        char flag;
        u8 status;
 
-       if (port->state != NULL)                /* Unopened serial console */
-               tty = port->state->port.tty;
+       /* FIXME what is this trying to achieve? */
+       if (port->state != NULL) {              /* Unopened serial console */
+               tport = &port->state->port;
+               tty = tport->tty;
+       }
 
        while (limit-- > 0) {
                status = READ_SC_PORT(port, SR);
@@ -185,7 +189,7 @@ static struct tty_struct *receive_chars(struct uart_port *port)
                if (status & port->ignore_status_mask)
                        continue;
 
-               tty_insert_flip_char(tty, ch, flag);
+               tty_insert_flip_char(tport, ch, flag);
        }
        return tty;
 }
index ba7863bbbb4dbe1000ca1ef48d09b7b2aeb2a381..675343a20f24889cdaf7d9e97dc59d60a17dce4f 100644 (file)
@@ -2792,10 +2792,10 @@ EXPORT_SYMBOL_GPL(uart_handle_cts_change);
 void uart_insert_char(struct uart_port *port, unsigned int status,
                 unsigned int overrun, unsigned int ch, unsigned int flag)
 {
-       struct tty_struct *tty = port->state->port.tty;
+       struct tty_port *tport = &port->state->port;
 
        if ((status & port->ignore_status_mask & ~overrun) == 0)
-               if (tty_insert_flip_char(tty, ch, flag) == 0)
+               if (tty_insert_flip_char(tport, ch, flag) == 0)
                        ++port->icount.buf_overrun;
 
        /*
@@ -2803,7 +2803,7 @@ void uart_insert_char(struct uart_port *port, unsigned int status,
         * it doesn't affect the current character.
         */
        if (status & ~port->ignore_status_mask & overrun)
-               if (tty_insert_flip_char(tty, 0, TTY_OVERRUN) == 0)
+               if (tty_insert_flip_char(tport, 0, TTY_OVERRUN) == 0)
                        ++port->icount.buf_overrun;
 }
 EXPORT_SYMBOL_GPL(uart_insert_char);
index cf96314770fbec3d61c01a6b2d6ad2c9a62d2a30..ecef748f5385c6c612a78c4f1668bf29c9b1722c 100644 (file)
@@ -620,7 +620,7 @@ static void sci_receive_chars(struct uart_port *port)
                            sci_port->break_flag)
                                count = 0;
                        else
-                               tty_insert_flip_char(tty, c, TTY_NORMAL);
+                               tty_insert_flip_char(tport, c, TTY_NORMAL);
                } else {
                        for (i = 0; i < count; i++) {
                                char c = serial_port_in(port, SCxRDR);
@@ -662,7 +662,7 @@ static void sci_receive_chars(struct uart_port *port)
                                } else
                                        flag = TTY_NORMAL;
 
-                               tty_insert_flip_char(tty, c, flag);
+                               tty_insert_flip_char(tport, c, flag);
                        }
                }
 
@@ -721,7 +721,8 @@ static int sci_handle_errors(struct uart_port *port)
 {
        int copied = 0;
        unsigned short status = serial_port_in(port, SCxSR);
-       struct tty_struct *tty = port->state->port.tty;
+       struct tty_port *tport = &port->state->port;
+       struct tty_struct *tty = tport->tty;
        struct sci_port *s = to_sci_port(port);
 
        /*
@@ -732,7 +733,7 @@ static int sci_handle_errors(struct uart_port *port)
                        port->icount.overrun++;
 
                        /* overrun error */
-                       if (tty_insert_flip_char(tty, 0, TTY_OVERRUN))
+                       if (tty_insert_flip_char(tport, 0, TTY_OVERRUN))
                                copied++;
 
                        dev_notice(port->dev, "overrun error");
@@ -756,7 +757,7 @@ static int sci_handle_errors(struct uart_port *port)
 
                                dev_dbg(port->dev, "BREAK detected\n");
 
-                               if (tty_insert_flip_char(tty, 0, TTY_BREAK))
+                               if (tty_insert_flip_char(tport, 0, TTY_BREAK))
                                        copied++;
                        }
 
@@ -764,7 +765,7 @@ static int sci_handle_errors(struct uart_port *port)
                        /* frame error */
                        port->icount.frame++;
 
-                       if (tty_insert_flip_char(tty, 0, TTY_FRAME))
+                       if (tty_insert_flip_char(tport, 0, TTY_FRAME))
                                copied++;
 
                        dev_notice(port->dev, "frame error\n");
@@ -775,7 +776,7 @@ static int sci_handle_errors(struct uart_port *port)
                /* parity error */
                port->icount.parity++;
 
-               if (tty_insert_flip_char(tty, 0, TTY_PARITY))
+               if (tty_insert_flip_char(tport, 0, TTY_PARITY))
                        copied++;
 
                dev_notice(port->dev, "parity error");
@@ -789,7 +790,8 @@ static int sci_handle_errors(struct uart_port *port)
 
 static int sci_handle_fifo_overrun(struct uart_port *port)
 {
-       struct tty_struct *tty = port->state->port.tty;
+       struct tty_port *tport = &port->state->port;
+       struct tty_struct *tty = tport->tty;
        struct sci_port *s = to_sci_port(port);
        struct plat_sci_reg *reg;
        int copied = 0;
@@ -803,7 +805,7 @@ static int sci_handle_fifo_overrun(struct uart_port *port)
 
                port->icount.overrun++;
 
-               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               tty_insert_flip_char(tport, 0, TTY_OVERRUN);
                tty_flip_buffer_push(tty);
 
                dev_notice(port->dev, "overrun error\n");
@@ -817,7 +819,8 @@ static int sci_handle_breaks(struct uart_port *port)
 {
        int copied = 0;
        unsigned short status = serial_port_in(port, SCxSR);
-       struct tty_struct *tty = port->state->port.tty;
+       struct tty_port *tport = &port->state->port;
+       struct tty_struct *tty = tport->tty;
        struct sci_port *s = to_sci_port(port);
 
        if (uart_handle_break(port))
@@ -832,7 +835,7 @@ static int sci_handle_breaks(struct uart_port *port)
                port->icount.brk++;
 
                /* Notify of BREAK */
-               if (tty_insert_flip_char(tty, 0, TTY_BREAK))
+               if (tty_insert_flip_char(tport, 0, TTY_BREAK))
                        copied++;
 
                dev_dbg(port->dev, "BREAK detected\n");
@@ -1260,8 +1263,7 @@ static void sci_dma_tx_complete(void *arg)
 }
 
 /* Locking: called with port lock held */
-static int sci_dma_rx_push(struct sci_port *s, struct tty_struct *tty,
-                          size_t count)
+static int sci_dma_rx_push(struct sci_port *s, size_t count)
 {
        struct uart_port *port = &s->port;
        struct tty_port *tport = &port->state->port;
@@ -1285,7 +1287,7 @@ static int sci_dma_rx_push(struct sci_port *s, struct tty_struct *tty,
                return room;
 
        for (i = 0; i < room; i++)
-               tty_insert_flip_char(tty, ((u8 *)sg_virt(&s->sg_rx[active]))[i],
+               tty_insert_flip_char(tport, ((u8 *)sg_virt(&s->sg_rx[active]))[i],
                                     TTY_NORMAL);
 
        port->icount.rx += room;
@@ -1305,7 +1307,7 @@ static void sci_dma_rx_complete(void *arg)
 
        spin_lock_irqsave(&port->lock, flags);
 
-       count = sci_dma_rx_push(s, tty, s->buf_len_rx);
+       count = sci_dma_rx_push(s, s->buf_len_rx);
 
        mod_timer(&s->rx_timer, jiffies + s->rx_timeout);
 
@@ -1418,7 +1420,7 @@ static void work_fn_rx(struct work_struct *work)
                        sh_desc->partial, sh_desc->cookie);
 
                spin_lock_irqsave(&port->lock, flags);
-               count = sci_dma_rx_push(s, tty, sh_desc->partial);
+               count = sci_dma_rx_push(s, sh_desc->partial);
                spin_unlock_irqrestore(&port->lock, flags);
 
                if (count)
index 1c6de9f58699ee7bdb458baeec093694510406e7..283232c64656f7ac7320bf9af5763b5d86400f05 100644 (file)
@@ -457,6 +457,7 @@ static int sn_debug_printf(const char *fmt, ...)
 static void
 sn_receive_chars(struct sn_cons_port *port, unsigned long flags)
 {
+       struct tty_port *tport = NULL;
        int ch;
        struct tty_struct *tty;
 
@@ -472,7 +473,8 @@ sn_receive_chars(struct sn_cons_port *port, unsigned long flags)
 
        if (port->sc_port.state) {
                /* The serial_core stuffs are initialized, use them */
-               tty = port->sc_port.state->port.tty;
+               tport = &port->sc_port.state->port;
+               tty = tport->tty;
        }
        else {
                /* Not registered yet - can't pass to tty layer.  */
@@ -517,7 +519,7 @@ sn_receive_chars(struct sn_cons_port *port, unsigned long flags)
 
                /* record the character to pass up to the tty layer */
                if (tty) {
-                       if(tty_insert_flip_char(tty, ch, TTY_NORMAL) == 0)
+                       if (tty_insert_flip_char(tport, ch, TTY_NORMAL) == 0)
                                break;
                }
                port->sc_port.icount.rx++;
index b9bf9c53f7fd7159089578e9322d174c067897ef..bbb102e3c035ce109e6f5993950853f697c6beb9 100644 (file)
@@ -99,7 +99,7 @@ static int receive_chars_getchar(struct uart_port *port, struct tty_struct *tty)
                        uart_handle_dcd_change(port, 1);
                }
 
-               if (tty == NULL) {
+               if (port->state == NULL) {
                        uart_handle_sysrq_char(port, c);
                        continue;
                }
@@ -109,7 +109,7 @@ static int receive_chars_getchar(struct uart_port *port, struct tty_struct *tty)
                if (uart_handle_sysrq_char(port, c))
                        continue;
 
-               tty_insert_flip_char(tty, c, TTY_NORMAL);
+               tty_insert_flip_char(&port->state->port, c, TTY_NORMAL);
        }
 
        return saw_console_brk;
index bd8b3b6341033b275c376743cd7b2ce6d120b0ed..4abc4d43a8e885480e801842cdc419f0c4892c50 100644 (file)
@@ -111,6 +111,7 @@ static struct tty_struct *
 receive_chars(struct uart_sunsab_port *up,
              union sab82532_irq_status *stat)
 {
+       struct tty_port *port = NULL;
        struct tty_struct *tty = NULL;
        unsigned char buf[32];
        int saw_console_brk = 0;
@@ -118,8 +119,10 @@ receive_chars(struct uart_sunsab_port *up,
        int count = 0;
        int i;
 
-       if (up->port.state != NULL)             /* Unopened serial console */
-               tty = up->port.state->port.tty;
+       if (up->port.state != NULL) {           /* Unopened serial console */
+               port = &up->port.state->port;
+               tty = port->tty;
+       }
 
        /* Read number of BYTES (Character + Status) available. */
        if (stat->sreg.isr0 & SAB82532_ISR0_RPF) {
@@ -160,11 +163,6 @@ receive_chars(struct uart_sunsab_port *up,
        for (i = 0; i < count; i++) {
                unsigned char ch = buf[i], flag;
 
-               if (tty == NULL) {
-                       uart_handle_sysrq_char(&up->port, ch);
-                       continue;
-               }
-
                flag = TTY_NORMAL;
                up->port.icount.rx++;
 
@@ -213,9 +211,9 @@ receive_chars(struct uart_sunsab_port *up,
 
                if ((stat->sreg.isr0 & (up->port.ignore_status_mask & 0xff)) == 0 &&
                    (stat->sreg.isr1 & ((up->port.ignore_status_mask >> 8) & 0xff)) == 0)
-                       tty_insert_flip_char(tty, ch, flag);
+                       tty_insert_flip_char(port, ch, flag);
                if (stat->sreg.isr0 & SAB82532_ISR0_RFO)
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       tty_insert_flip_char(port, 0, TTY_OVERRUN);
        }
 
        if (saw_console_brk)
index 220da3f9724f1398a802d3cdb3f87ca33d1aefed..52325968b06c9395ecb7315756491ab86d7211d8 100644 (file)
@@ -318,7 +318,8 @@ static void sunsu_enable_ms(struct uart_port *port)
 static struct tty_struct *
 receive_chars(struct uart_sunsu_port *up, unsigned char *status)
 {
-       struct tty_struct *tty = up->port.state->port.tty;
+       struct tty_port *port = &up->port.state->port;
+       struct tty_struct *tty = port->tty;
        unsigned char ch, flag;
        int max_count = 256;
        int saw_console_brk = 0;
@@ -376,14 +377,14 @@ receive_chars(struct uart_sunsu_port *up, unsigned char *status)
                if (uart_handle_sysrq_char(&up->port, ch))
                        goto ignore_char;
                if ((*status & up->port.ignore_status_mask) == 0)
-                       tty_insert_flip_char(tty, ch, flag);
+                       tty_insert_flip_char(port, ch, flag);
                if (*status & UART_LSR_OE)
                        /*
                         * Overrun is special, since it's reported
                         * immediately, and doesn't affect the current
                         * character.
                         */
-                        tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                        tty_insert_flip_char(port, 0, TTY_OVERRUN);
        ignore_char:
                *status = serial_inp(up, UART_LSR);
        } while ((*status & UART_LSR_DR) && (max_count-- > 0));
index aef4fab957c3999287b33994014cac951de652b8..4a11be3849f663a2acb43ad21f409b33c90088e3 100644 (file)
@@ -327,13 +327,15 @@ static struct tty_struct *
 sunzilog_receive_chars(struct uart_sunzilog_port *up,
                       struct zilog_channel __iomem *channel)
 {
+       struct tty_port *port = NULL;
        struct tty_struct *tty;
        unsigned char ch, r1, flag;
 
        tty = NULL;
-       if (up->port.state != NULL &&           /* Unopened serial console */
-           up->port.state->port.tty != NULL)   /* Keyboard || mouse */
-               tty = up->port.state->port.tty;
+       if (up->port.state != NULL) {           /* Unopened serial console */
+               port = &up->port.state->port;
+               tty = port->tty;                /* mouse => tty is NULL */
+       }
 
        for (;;) {
 
@@ -366,11 +368,6 @@ sunzilog_receive_chars(struct uart_sunzilog_port *up,
                        continue;
                }
 
-               if (tty == NULL) {
-                       uart_handle_sysrq_char(&up->port, ch);
-                       continue;
-               }
-
                /* A real serial line, record the character and status.  */
                flag = TTY_NORMAL;
                up->port.icount.rx++;
@@ -400,10 +397,10 @@ sunzilog_receive_chars(struct uart_sunzilog_port *up,
 
                if (up->port.ignore_status_mask == 0xff ||
                    (r1 & up->port.ignore_status_mask) == 0) {
-                       tty_insert_flip_char(tty, ch, flag);
+                       tty_insert_flip_char(port, ch, flag);
                }
                if (r1 & Rx_OVR)
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       tty_insert_flip_char(port, 0, TTY_OVERRUN);
        }
 
        return tty;
index 5be0d68fecebb36cda36adf3be7d4583d824b7f7..f40c634f7528aec059ade69354080d89f6076e37 100644 (file)
@@ -91,12 +91,12 @@ static void timbuart_flush_buffer(struct uart_port *port)
 
 static void timbuart_rx_chars(struct uart_port *port)
 {
-       struct tty_struct *tty = port->state->port.tty;
+       struct tty_port *tport = &port->state->port;
 
        while (ioread32(port->membase + TIMBUART_ISR) & RXDP) {
                u8 ch = ioread8(port->membase + TIMBUART_RXFIFO);
                port->icount.rx++;
-               tty_insert_flip_char(tty, ch, TTY_NORMAL);
+               tty_insert_flip_char(tport, ch, TTY_NORMAL);
        }
 
        spin_unlock(&port->lock);
index 89eee43c4e2d9defc6a628098b98c12c9fee5115..5caf1f0ebc8244ef26f7d2730b7d9870c40f1400 100644 (file)
@@ -66,7 +66,7 @@ static struct uart_port ulite_ports[ULITE_NR_UARTS];
 
 static int ulite_receive(struct uart_port *port, int stat)
 {
-       struct tty_struct *tty = port->state->port.tty;
+       struct tty_port *tport = &port->state->port;
        unsigned char ch = 0;
        char flag = TTY_NORMAL;
 
@@ -103,13 +103,13 @@ static int ulite_receive(struct uart_port *port, int stat)
        stat &= ~port->ignore_status_mask;
 
        if (stat & ULITE_STATUS_RXVALID)
-               tty_insert_flip_char(tty, ch, flag);
+               tty_insert_flip_char(tport, ch, flag);
 
        if (stat & ULITE_STATUS_FRAME)
-               tty_insert_flip_char(tty, 0, TTY_FRAME);
+               tty_insert_flip_char(tport, 0, TTY_FRAME);
 
        if (stat & ULITE_STATUS_OVERRUN)
-               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               tty_insert_flip_char(tport, 0, TTY_OVERRUN);
 
        return 1;
 }
index ed047d9ab1e28d39f709d14dcdc88faa75292477..7a2378627fa5d8fc51d56ad9d0f992e7bcf32a43 100644 (file)
@@ -513,7 +513,7 @@ static void qe_uart_int_rx(struct uart_qe_port *qe_port)
                                continue;
 
 error_return:
-                       tty_insert_flip_char(tty, ch, flg);
+                       tty_insert_flip_char(tport, ch, flg);
 
                }
 
@@ -561,7 +561,7 @@ handle_error:
 
        /* Overrun does not affect the current character ! */
        if (status & BD_SC_OV)
-               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               tty_insert_flip_char(tport, 0, TTY_OVERRUN);
 #ifdef SUPPORT_SYSRQ
        port->sysrq = 0;
 #endif
index 8fd181436a6ba246e2247c5be871ac7f3c71c760..7f4112423f3dfe354a8ce9fe05d764b7610b4df7 100644 (file)
@@ -136,7 +136,8 @@ static void vt8500_enable_ms(struct uart_port *port)
 
 static void handle_rx(struct uart_port *port)
 {
-       struct tty_struct *tty = tty_port_tty_get(&port->state->port);
+       struct tty_port *tport = &port->state->port;
+       struct tty_struct *tty = tty_port_tty_get(tport);
        if (!tty) {
                /* Discard data: no tty available */
                int count = (vt8500_read(port, VT8500_URFIDX) & 0x1f00) >> 8;
@@ -151,7 +152,7 @@ static void handle_rx(struct uart_port *port)
         */
        if ((vt8500_read(port, VT8500_URISR) & RXOVER)) {
                port->icount.overrun++;
-               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               tty_insert_flip_char(tport, 0, TTY_OVERRUN);
        }
 
        /* and now the main RX loop */
@@ -174,7 +175,7 @@ static void handle_rx(struct uart_port *port)
                port->icount.rx++;
 
                if (!uart_handle_sysrq_char(port, c))
-                       tty_insert_flip_char(tty, c, flag);
+                       tty_insert_flip_char(tport, c, flag);
        }
 
        tty_flip_buffer_push(tty);
index d42b66195a49756b65f70b4c81d0fcf9d5d38a90..33656b35db058ce2ee0ad7c3be20aa6373198dff 100644 (file)
@@ -1507,13 +1507,13 @@ static void mgsl_isr_receive_data( struct mgsl_struct *info )
                        else if (status & RXSTATUS_FRAMING_ERROR)
                                flag = TTY_FRAME;
                }       /* end of if (error) */
-               tty_insert_flip_char(tty, DataByte, flag);
+               tty_insert_flip_char(&info->port, DataByte, flag);
                if (status & RXSTATUS_OVERRUN) {
                        /* Overrun is special, since it's
                         * reported immediately, and doesn't
                         * affect the current character
                         */
-                       work += tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       work += tty_insert_flip_char(&info->port, 0, TTY_OVERRUN);
                }
        }
 
index 62a0db7ead071e3ed0312c4a8a1a8fc5d49565fe..473d7406db830700aa94f3b1b11f5a4dc286bc55 100644 (file)
@@ -1893,10 +1893,8 @@ static void rx_async(struct slgt_info *info)
                                else if (status & BIT0)
                                        stat = TTY_FRAME;
                        }
-                       if (tty) {
-                               tty_insert_flip_char(tty, ch, stat);
-                               chars++;
-                       }
+                       tty_insert_flip_char(&info->port, ch, stat);
+                       chars++;
                }
 
                if (i < count) {
@@ -2182,7 +2180,7 @@ static void isr_serial(struct slgt_info *info)
                        if (info->port.tty) {
                                if (!(status & info->ignore_status_mask)) {
                                        if (info->read_status_mask & MASK_BREAK) {
-                                               tty_insert_flip_char(info->port.tty, 0, TTY_BREAK);
+                                               tty_insert_flip_char(&info->port, 0, TTY_BREAK);
                                                if (info->port.flags & ASYNC_SAK)
                                                        do_SAK(info->port.tty);
                                        }
index 33b7314cc6c7194f2678187bc0a2bde553eca840..f5794f3d840feb2585b60f8b63d0f4bc921f57ba 100644 (file)
@@ -2131,13 +2131,11 @@ static void isr_rxint(SLMP_INFO * info)
                        /* process break detection if tty control
                         * is not set to ignore it
                         */
-                       if ( tty ) {
-                               if (!(status & info->ignore_status_mask1)) {
-                                       if (info->read_status_mask1 & BRKD) {
-                                               tty_insert_flip_char(tty, 0, TTY_BREAK);
-                                               if (info->port.flags & ASYNC_SAK)
-                                                       do_SAK(tty);
-                                       }
+                       if (!(status & info->ignore_status_mask1)) {
+                               if (info->read_status_mask1 & BRKD) {
+                                       tty_insert_flip_char(&info->port, 0, TTY_BREAK);
+                                       if (tty && (info->port.flags & ASYNC_SAK))
+                                               do_SAK(tty);
                                }
                        }
                }
@@ -2202,26 +2200,22 @@ static void isr_rxrdy(SLMP_INFO * info)
 
                        status &= info->read_status_mask2;
 
-                       if ( tty ) {
-                               if (status & PE)
-                                       flag = TTY_PARITY;
-                               else if (status & FRME)
-                                       flag = TTY_FRAME;
-                               if (status & OVRN) {
-                                       /* Overrun is special, since it's
-                                        * reported immediately, and doesn't
-                                        * affect the current character
-                                        */
-                                       over = true;
-                               }
+                       if (status & PE)
+                               flag = TTY_PARITY;
+                       else if (status & FRME)
+                               flag = TTY_FRAME;
+                       if (status & OVRN) {
+                               /* Overrun is special, since it's
+                                * reported immediately, and doesn't
+                                * affect the current character
+                                */
+                               over = true;
                        }
                }       /* end of if (error) */
 
-               if ( tty ) {
-                       tty_insert_flip_char(tty, DataByte, flag);
-                       if (over)
-                               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
-               }
+               tty_insert_flip_char(&info->port, DataByte, flag);
+               if (over)
+                       tty_insert_flip_char(&info->port, 0, TTY_OVERRUN);
        }
 
        if ( debug_level >= DEBUG_LEVEL_ISR ) {
index 681765baef69345f568ce29bce068601b812db56..5aace4d47cb664c33d3a43ed8a2a351e769047bb 100644 (file)
@@ -309,8 +309,8 @@ static void put_queue(struct vc_data *vc, int ch)
 {
        struct tty_struct *tty = vc->port.tty;
 
+       tty_insert_flip_char(&vc->port, ch, 0);
        if (tty) {
-               tty_insert_flip_char(tty, ch, 0);
                tty_schedule_flip(tty);
        }
 }
@@ -323,7 +323,7 @@ static void puts_queue(struct vc_data *vc, char *cp)
                return;
 
        while (*cp) {
-               tty_insert_flip_char(tty, *cp, 0);
+               tty_insert_flip_char(&vc->port, *cp, 0);
                cp++;
        }
        tty_schedule_flip(tty);
@@ -586,7 +586,7 @@ static void fn_send_intr(struct vc_data *vc)
 
        if (!tty)
                return;
-       tty_insert_flip_char(tty, 0, TTY_BREAK);
+       tty_insert_flip_char(&vc->port, 0, TTY_BREAK);
        tty_schedule_flip(tty);
 }
 
index 8fd89687d068e58b5546a153f8ea894c32782f47..811f2505e9eea74f843cdf2aa07f61043e013330 100644 (file)
@@ -1336,7 +1336,7 @@ static void csi_m(struct vc_data *vc)
 static void respond_string(const char *p, struct tty_struct *tty)
 {
        while (*p) {
-               tty_insert_flip_char(tty, *p, 0);
+               tty_insert_flip_char(tty->port, *p, 0);
                p++;
        }
        tty_schedule_flip(tty);
index e2d653d00ea245ceaece973c958fe5c1a5c3908d..1614feb6a76e26fdf6431ba3c1ce966c52c0529c 100644 (file)
@@ -703,7 +703,7 @@ static void ark3116_process_read_urb(struct urb *urb)
 
                /* overrun is special, not associated with a char */
                if (lsr & UART_LSR_OE)
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
        }
        tty_insert_flip_string_fixed_flag(&port->port, data, tty_flag,
                                                        urb->actual_length);
index a213d1be94620c8c133349e4b91d903f988c0bff..7ba2c0bdcec95f62f09b5462b11e2a05512d7aaa 100644 (file)
@@ -276,7 +276,7 @@ static void belkin_sa_process_read_urb(struct urb *urb)
 
                /* Overrun is special, not associated with a char. */
                if (status & BELKIN_SA_LSR_OE)
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
        }
 
        tty_insert_flip_string_fixed_flag(&port->port, data, tty_flag,
index efbc4035410c63fce87d572dbcea18c8990ba30b..b5fa738512ca785559ecff49c8238949fb52f688 100644 (file)
@@ -1441,7 +1441,7 @@ static int digi_read_inb_callback(struct urb *urb)
 
                /* overrun is special, not associated with a char */
                if (port_status & DIGI_OVERRUN_ERROR)
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
 
                /* break takes precedence over parity, */
                /* which takes precedence over framing errors */
index a8c6430bf1b329e3de5b8394589db16665253d42..6b880c33d25872a4a90e16a888a92e01888443f6 100644 (file)
@@ -133,12 +133,13 @@ static void f81232_process_read_urb(struct urb *urb)
 
        /* overrun is special, not associated with a char */
        if (line_status & UART_OVERRUN_ERROR)
-               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
 
        if (port->port.console && port->sysrq) {
                for (i = 0; i < urb->actual_length; ++i)
                        if (!usb_serial_handle_sysrq_char(port, data[i]))
-                               tty_insert_flip_char(tty, data[i], tty_flag);
+                               tty_insert_flip_char(&port->port, data[i],
+                                               tty_flag);
        } else {
                tty_insert_flip_string_fixed_flag(&port->port, data, tty_flag,
                                                        urb->actual_length);
index 0416d952a448490e8eb150b1ca12eacc89406de1..eb59ba3789adb209d1f99f1de0239ae9ae92a91d 100644 (file)
@@ -1958,9 +1958,8 @@ static int ftdi_prepare_write_buffer(struct usb_serial_port *port,
 
 #define FTDI_RS_ERR_MASK (FTDI_RS_BI | FTDI_RS_PE | FTDI_RS_FE | FTDI_RS_OE)
 
-static int ftdi_process_packet(struct tty_struct *tty,
-               struct usb_serial_port *port, struct ftdi_private *priv,
-               char *packet, int len)
+static int ftdi_process_packet(struct usb_serial_port *port,
+               struct ftdi_private *priv, char *packet, int len)
 {
        int i;
        char status;
@@ -2010,7 +2009,7 @@ static int ftdi_process_packet(struct tty_struct *tty,
                /* Overrun is special, not associated with a char */
                if (packet[1] & FTDI_RS_OE) {
                        priv->icount.overrun++;
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
                }
        }
 
@@ -2029,7 +2028,7 @@ static int ftdi_process_packet(struct tty_struct *tty,
        if (port->port.console && port->sysrq) {
                for (i = 0; i < len; i++, ch++) {
                        if (!usb_serial_handle_sysrq_char(port, *ch))
-                               tty_insert_flip_char(tty, *ch, flag);
+                               tty_insert_flip_char(&port->port, *ch, flag);
                }
        } else {
                tty_insert_flip_string_fixed_flag(&port->port, ch, flag, len);
@@ -2054,7 +2053,7 @@ static void ftdi_process_read_urb(struct urb *urb)
 
        for (i = 0; i < urb->actual_length; i += priv->max_packet_size) {
                len = min_t(int, urb->actual_length - i, priv->max_packet_size);
-               count += ftdi_process_packet(tty, port, priv, &data[i], len);
+               count += ftdi_process_packet(port, priv, &data[i], len);
        }
 
        if (count)
index 2ea70a631996f0fd856159a68392cb209d7a3134..b00110cd56894b939b132243495860b16c279002 100644 (file)
@@ -332,7 +332,7 @@ void usb_serial_generic_process_read_urb(struct urb *urb)
        else {
                for (i = 0; i < urb->actual_length; i++, ch++) {
                        if (!usb_serial_handle_sysrq_char(port, *ch))
-                               tty_insert_flip_char(tty, *ch, TTY_NORMAL);
+                               tty_insert_flip_char(&port->port, *ch, TTY_NORMAL);
                }
        }
        tty_flip_buffer_push(tty);
index 97bc49f68efd19bc80d650813664755714efab94..a4f5caebda437861db8fd014b08f2527622eb16a 100644 (file)
@@ -315,7 +315,7 @@ static void usa26_indat_callback(struct urb *urb)
                        else
                                err = 0;
                        for (i = 1; i < urb->actual_length ; ++i)
-                               tty_insert_flip_char(tty, data[i], err);
+                               tty_insert_flip_char(&port->port, data[i], err);
                } else {
                        /* some bytes had errors, every byte has status */
                        dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
@@ -328,7 +328,8 @@ static void usa26_indat_callback(struct urb *urb)
                                if (stat & RXERROR_PARITY)
                                        flag |= TTY_PARITY;
                                /* XXX should handle break (0x10) */
-                               tty_insert_flip_char(tty, data[i+1], flag);
+                               tty_insert_flip_char(&port->port, data[i+1],
+                                               flag);
                        }
                }
                tty_flip_buffer_push(tty);
@@ -700,7 +701,8 @@ static void usa49_indat_callback(struct urb *urb)
                                if (stat & RXERROR_PARITY)
                                        flag |= TTY_PARITY;
                                /* XXX should handle break (0x10) */
-                               tty_insert_flip_char(tty, data[i+1], flag);
+                               tty_insert_flip_char(&port->port, data[i+1],
+                                               flag);
                        }
                }
                tty_flip_buffer_push(tty);
@@ -751,7 +753,8 @@ static void usa49wg_indat_callback(struct urb *urb)
                                /* no error on any byte */
                                i++;
                                for (x = 1; x < len ; ++x)
-                                       tty_insert_flip_char(tty, data[i++], 0);
+                                       tty_insert_flip_char(&port->port,
+                                                       data[i++], 0);
                        } else {
                                /*
                                 * some bytes had errors, every byte has status
@@ -765,7 +768,7 @@ static void usa49wg_indat_callback(struct urb *urb)
                                        if (stat & RXERROR_PARITY)
                                                flag |= TTY_PARITY;
                                        /* XXX should handle break (0x10) */
-                                       tty_insert_flip_char(tty,
+                                       tty_insert_flip_char(&port->port,
                                                        data[i+1], flag);
                                        i += 2;
                                }
@@ -824,8 +827,8 @@ static void usa90_indat_callback(struct urb *urb)
                                else
                                        err = 0;
                                for (i = 1; i < urb->actual_length ; ++i)
-                                       tty_insert_flip_char(tty, data[i],
-                                                                       err);
+                                       tty_insert_flip_char(&port->port,
+                                                       data[i], err);
                        }  else {
                        /* some bytes had errors, every byte has status */
                                dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
@@ -838,8 +841,8 @@ static void usa90_indat_callback(struct urb *urb)
                                        if (stat & RXERROR_PARITY)
                                                flag |= TTY_PARITY;
                                        /* XXX should handle break (0x10) */
-                                       tty_insert_flip_char(tty, data[i+1],
-                                                                       flag);
+                                       tty_insert_flip_char(&port->port,
+                                                       data[i+1], flag);
                                }
                        }
                }
index 86789b0477c5407c24e940de2f498115e6db8d87..00047f3c7293fd7a83235679af66969f74ebee5d 100644 (file)
@@ -805,12 +805,13 @@ static void pl2303_process_read_urb(struct urb *urb)
 
        /* overrun is special, not associated with a char */
        if (line_status & UART_OVERRUN_ERROR)
-               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
 
        if (port->port.console && port->sysrq) {
                for (i = 0; i < urb->actual_length; ++i)
                        if (!usb_serial_handle_sysrq_char(port, data[i]))
-                               tty_insert_flip_char(tty, data[i], tty_flag);
+                               tty_insert_flip_char(&port->port, data[i],
+                                               tty_flag);
        } else {
                tty_insert_flip_string_fixed_flag(&port->port, data, tty_flag,
                                                        urb->actual_length);
index fa42f1b907d0100d9339a9d417bda40e4ca6bdfa..04e3731527245527b3cb85c17daa7b1ca1cbc32d 100644 (file)
@@ -498,7 +498,7 @@ static void spcp8x5_process_read_urb(struct urb *urb)
 
                /* overrun is special, not associated with a char */
                if (status & UART_OVERRUN_ERROR)
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
 
                if (status & UART_DCD)
                        usb_serial_handle_dcd_change(port, tty,
index 37476c6240c2fca84bc1d31a21851f5058d2e2c8..38713156e957352d6bfce772dcdb9733073887e0 100644 (file)
@@ -582,8 +582,7 @@ static void ssu100_update_lsr(struct usb_serial_port *port, u8 lsr,
 
 }
 
-static int ssu100_process_packet(struct urb *urb,
-                                struct tty_struct *tty)
+static int ssu100_process_packet(struct urb *urb)
 {
        struct usb_serial_port *port = urb->context;
        char *packet = (char *)urb->transfer_buffer;
@@ -598,7 +597,8 @@ static int ssu100_process_packet(struct urb *urb,
                if (packet[2] == 0x00) {
                        ssu100_update_lsr(port, packet[3], &flag);
                        if (flag == TTY_OVERRUN)
-                               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                               tty_insert_flip_char(&port->port, 0,
+                                               TTY_OVERRUN);
                }
                if (packet[2] == 0x01)
                        ssu100_update_msr(port, packet[3]);
@@ -614,7 +614,7 @@ static int ssu100_process_packet(struct urb *urb,
        if (port->port.console && port->sysrq) {
                for (i = 0; i < len; i++, ch++) {
                        if (!usb_serial_handle_sysrq_char(port, *ch))
-                               tty_insert_flip_char(tty, *ch, flag);
+                               tty_insert_flip_char(&port->port, *ch, flag);
                }
        } else
                tty_insert_flip_string_fixed_flag(&port->port, ch, flag, len);
@@ -632,7 +632,7 @@ static void ssu100_process_read_urb(struct urb *urb)
        if (!tty)
                return;
 
-       count = ssu100_process_packet(urb, tty);
+       count = ssu100_process_packet(urb);
 
        if (count)
                tty_flip_buffer_push(tty);
index 743f1d076467307a2e7d5aca1212ab60fef8278f..f9acb578c6ad2683e1e30501f8af908a2527e9ae 100644 (file)
@@ -12,16 +12,16 @@ extern int tty_prepare_flip_string_flags(struct tty_port *port,
                unsigned char **chars, char **flags, size_t size);
 void tty_schedule_flip(struct tty_struct *tty);
 
-static inline int tty_insert_flip_char(struct tty_struct *tty,
+static inline int tty_insert_flip_char(struct tty_port *port,
                                        unsigned char ch, char flag)
 {
-       struct tty_buffer *tb = tty->port->buf.tail;
+       struct tty_buffer *tb = port->buf.tail;
        if (tb && tb->used < tb->size) {
                tb->flag_buf_ptr[tb->used] = flag;
                tb->char_buf_ptr[tb->used++] = ch;
                return 1;
        }
-       return tty_insert_flip_string_flags(tty->port, &ch, &flag, 1);
+       return tty_insert_flip_string_flags(port, &ch, &flag, 1);
 }
 
 static inline int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, size_t size)