Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364415
b: refs/heads/master
c: befefcd
h: refs/heads/master
i:
  364413: 07c5dae
  364411: 29cf309
  364407: 7d21212
  364399: 8c76e7b
  364383: a3e7849
  364351: 00ffcd7
  364287: 034af96
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Mar 25, 2013
1 parent 18ddd6b commit a98d07a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c371de14b9a23aadb57accab0ca2e5dd28de7f16
refs/heads/master: befefcda4bddc52d29248931801961a72aeef28b
27 changes: 27 additions & 0 deletions trunk/drivers/usb/serial/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/usb/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a98d07a

Please sign in to comment.