From a98d07a86f1389fa4555f81f956730c1e8443073 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Thu, 21 Mar 2013 12:36:54 +0100 Subject: [PATCH] --- yaml --- r: 364415 b: refs/heads/master c: befefcda4bddc52d29248931801961a72aeef28b h: refs/heads/master i: 364413: 07c5dae0e37b3184b2a34a5c039ad892f035ce83 364411: 29cf3090157c71f28de0c7e248ffb0dfa33fd4e1 364407: 7d21212b2c56fb35e1a006413689594462300beb 364399: 8c76e7b022a059280293a55227346504e14a4b93 364383: a3e7849fbd00939f2b40a1cba4dbb7226cee5082 364351: 00ffcd7c4a9f3e022a99ff71451163b5fa0251b5 364287: 034af96b57df450eb6a8acab04e9850878167a7f v: v3 --- [refs] | 2 +- trunk/drivers/usb/serial/generic.c | 27 +++++++++++++++++++++++++++ trunk/include/linux/usb/serial.h | 2 ++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 0c3794003c9a..f6f1d939ed0f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c371de14b9a23aadb57accab0ca2e5dd28de7f16 +refs/heads/master: befefcda4bddc52d29248931801961a72aeef28b diff --git a/trunk/drivers/usb/serial/generic.c b/trunk/drivers/usb/serial/generic.c index 18bc74e20fe1..5e55761b2cb8 100644 --- a/trunk/drivers/usb/serial/generic.c +++ b/trunk/drivers/usb/serial/generic.c @@ -476,6 +476,33 @@ int usb_serial_generic_tiocmiwait(struct tty_struct *tty, unsigned long arg) } EXPORT_SYMBOL_GPL(usb_serial_generic_tiocmiwait); +int usb_serial_generic_get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount) +{ + struct usb_serial_port *port = tty->driver_data; + struct async_icount cnow; + unsigned long flags; + + spin_lock_irqsave(&port->lock, flags); + cnow = port->icount; /* atomic copy */ + spin_unlock_irqrestore(&port->lock, flags); + + icount->cts = cnow.cts; + icount->dsr = cnow.dsr; + icount->rng = cnow.rng; + icount->dcd = cnow.dcd; + icount->tx = cnow.tx; + icount->rx = cnow.rx; + icount->frame = cnow.frame; + icount->parity = cnow.parity; + icount->overrun = cnow.overrun; + icount->brk = cnow.brk; + icount->buf_overrun = cnow.buf_overrun; + + return 0; +} +EXPORT_SYMBOL_GPL(usb_serial_generic_get_icount); + #ifdef CONFIG_MAGIC_SYSRQ int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch) { diff --git a/trunk/include/linux/usb/serial.h b/trunk/include/linux/usb/serial.h index 47c8d2c506c8..c786ee7fca8f 100644 --- a/trunk/include/linux/usb/serial.h +++ b/trunk/include/linux/usb/serial.h @@ -335,6 +335,8 @@ extern void usb_serial_generic_throttle(struct tty_struct *tty); extern void usb_serial_generic_unthrottle(struct tty_struct *tty); extern int usb_serial_generic_tiocmiwait(struct tty_struct *tty, unsigned long arg); +extern int usb_serial_generic_get_icount(struct tty_struct *tty, + struct serial_icounter_struct *icount); extern int usb_serial_generic_register(void); extern void usb_serial_generic_deregister(void); extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port,