aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/nozomi.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-09-16 13:21:52 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 13:20:05 -0400
commit0587102cf9f427c185bfdeb2cef41e13ee0264b1 (patch)
tree94c6dcc7ac230dee166d2f6aa1f9a54bffe5764b /drivers/char/nozomi.c
parent0bca1b913affbd7e2fdaffee62a499659a466eb5 (diff)
tty: icount changeover for other main devices
Again basically cut and paste Convert the main driver set to use the hooks for GICOUNT Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char/nozomi.c')
-rw-r--r--drivers/char/nozomi.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
index 817169cbb245..dd3f9b1f11b4 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/char/nozomi.c
@@ -1804,24 +1804,24 @@ static int ntty_cflags_changed(struct port *port, unsigned long flags,
1804 return ret; 1804 return ret;
1805} 1805}
1806 1806
1807static int ntty_ioctl_tiocgicount(struct port *port, void __user *argp) 1807static int ntty_tiocgicount(struct tty_struct *tty,
1808 struct serial_icounter_struct *icount)
1808{ 1809{
1810 struct port *port = tty->driver_data;
1809 const struct async_icount cnow = port->tty_icount; 1811 const struct async_icount cnow = port->tty_icount;
1810 struct serial_icounter_struct icount; 1812
1811 1813 icount->cts = cnow.cts;
1812 icount.cts = cnow.cts; 1814 icount->dsr = cnow.dsr;
1813 icount.dsr = cnow.dsr; 1815 icount->rng = cnow.rng;
1814 icount.rng = cnow.rng; 1816 icount->dcd = cnow.dcd;
1815 icount.dcd = cnow.dcd; 1817 icount->rx = cnow.rx;
1816 icount.rx = cnow.rx; 1818 icount->tx = cnow.tx;
1817 icount.tx = cnow.tx; 1819 icount->frame = cnow.frame;
1818 icount.frame = cnow.frame; 1820 icount->overrun = cnow.overrun;
1819 icount.overrun = cnow.overrun; 1821 icount->parity = cnow.parity;
1820 icount.parity = cnow.parity; 1822 icount->brk = cnow.brk;
1821 icount.brk = cnow.brk; 1823 icount->buf_overrun = cnow.buf_overrun;
1822 icount.buf_overrun = cnow.buf_overrun; 1824 return 0;
1823
1824 return copy_to_user(argp, &icount, sizeof(icount)) ? -EFAULT : 0;
1825} 1825}
1826 1826
1827static int ntty_ioctl(struct tty_struct *tty, struct file *file, 1827static int ntty_ioctl(struct tty_struct *tty, struct file *file,
@@ -1840,9 +1840,7 @@ static int ntty_ioctl(struct tty_struct *tty, struct file *file,
1840 rval = wait_event_interruptible(port->tty_wait, 1840 rval = wait_event_interruptible(port->tty_wait,
1841 ntty_cflags_changed(port, arg, &cprev)); 1841 ntty_cflags_changed(port, arg, &cprev));
1842 break; 1842 break;
1843 } case TIOCGICOUNT: 1843 }
1844 rval = ntty_ioctl_tiocgicount(port, argp);
1845 break;
1846 default: 1844 default:
1847 DBG1("ERR: 0x%08X, %d", cmd, cmd); 1845 DBG1("ERR: 0x%08X, %d", cmd, cmd);
1848 break; 1846 break;
@@ -1922,6 +1920,7 @@ static const struct tty_operations tty_ops = {
1922 .chars_in_buffer = ntty_chars_in_buffer, 1920 .chars_in_buffer = ntty_chars_in_buffer,
1923 .tiocmget = ntty_tiocmget, 1921 .tiocmget = ntty_tiocmget,
1924 .tiocmset = ntty_tiocmset, 1922 .tiocmset = ntty_tiocmset,
1923 .get_icount = ntty_tiocgicount,
1925 .install = ntty_install, 1924 .install = ntty_install,
1926 .cleanup = ntty_cleanup, 1925 .cleanup = ntty_cleanup,
1927}; 1926};