Release 4.7 drivers/usb/serial/generic.c
/*
* USB Serial Converter Generic functions
*
* Copyright (C) 2010 - 2013 Johan Hovold (jhovold@gmail.com)
* Copyright (C) 1999 - 2002 Greg Kroah-Hartman (greg@kroah.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version
* 2 as published by the Free Software Foundation.
*/
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/sysrq.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/uaccess.h>
#include <linux/kfifo.h>
#include <linux/serial.h>
#ifdef CONFIG_USB_SERIAL_GENERIC
static __u16 vendor = 0x05f9;
static __u16 product = 0xffff;
module_param(vendor, ushort, 0);
MODULE_PARM_DESC(vendor, "User specified USB idVendor");
module_param(product, ushort, 0);
MODULE_PARM_DESC(product, "User specified USB idProduct");
static struct usb_device_id generic_device_ids[2];
/* Initially all zeroes. */
struct usb_serial_driver usb_serial_generic_device = {
.driver = {
.owner = THIS_MODULE,
.name = "generic",
},
.id_table = generic_device_ids,
.num_ports = 1,
.throttle = usb_serial_generic_throttle,
.unthrottle = usb_serial_generic_unthrottle,
.resume = usb_serial_generic_resume,
};
static struct usb_serial_driver * const serial_drivers[] = {
&usb_serial_generic_device, NULL
};
#endif
int usb_serial_generic_register(void)
{
int retval = 0;
#ifdef CONFIG_USB_SERIAL_GENERIC
generic_device_ids[0].idVendor = vendor;
generic_device_ids[0].idProduct = product;
generic_device_ids[0].match_flags =
USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;
retval = usb_serial_register_drivers(serial_drivers,
"usbserial_generic", generic_device_ids);
#endif
return retval;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
greg kroah-hartman | greg kroah-hartman | 57 | 95.00% | 4 | 66.67% |
alan stern | alan stern | 3 | 5.00% | 2 | 33.33% |
| Total | 60 | 100.00% | 6 | 100.00% |
void usb_serial_generic_deregister(void)
{
#ifdef CONFIG_USB_SERIAL_GENERIC
usb_serial_deregister_drivers(serial_drivers);
#endif
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
greg kroah-hartman | greg kroah-hartman | 15 | 88.24% | 2 | 66.67% |
alan stern | alan stern | 2 | 11.76% | 1 | 33.33% |
| Total | 17 | 100.00% | 3 | 100.00% |
int usb_serial_generic_open(struct tty_struct *tty, struct usb_serial_port *port)
{
int result = 0;
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
port->throttled = 0;
port->throttle_req = 0;
spin_unlock_irqrestore(&port->lock, flags);
if (port->bulk_in_size)
result = usb_serial_generic_submit_read_urbs(port, GFP_KERNEL);
return result;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
joris van rantwijk | joris van rantwijk | 36 | 48.65% | 1 | 20.00% |
greg kroah-hartman | greg kroah-hartman | 30 | 40.54% | 1 | 20.00% |
alan cox | alan cox | 5 | 6.76% | 1 | 20.00% |
johan hovold | johan hovold | 3 | 4.05% | 2 | 40.00% |
| Total | 74 | 100.00% | 5 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_generic_open);
void usb_serial_generic_close(struct usb_serial_port *port)
{
unsigned long flags;
int i;
if (port->bulk_out_size) {
for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i)
usb_kill_urb(port->write_urbs[i]);
spin_lock_irqsave(&port->lock, flags);
kfifo_reset_out(&port->write_fifo);
spin_unlock_irqrestore(&port->lock, flags);
}
if (port->bulk_in_size) {
for (i = 0; i < ARRAY_SIZE(port->read_urbs); ++i)
usb_kill_urb(port->read_urbs[i]);
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johan hovold | johan hovold | 93 | 79.49% | 5 | 71.43% |
greg kroah-hartman | greg kroah-hartman | 24 | 20.51% | 2 | 28.57% |
| Total | 117 | 100.00% | 7 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_generic_close);
int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port,
void *dest, size_t size)
{
return kfifo_out_locked(&port->write_fifo, dest, size, &port->lock);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johan hovold | johan hovold | 24 | 68.57% | 3 | 75.00% |
jason wessel | jason wessel | 11 | 31.43% | 1 | 25.00% |
| Total | 35 | 100.00% | 4 | 100.00% |
/**
* usb_serial_generic_write_start - start writing buffered data
* @port: usb-serial port
* @mem_flags: flags to use for memory allocations
*
* Serialised using USB_SERIAL_WRITE_BUSY flag.
*
* Return: Zero on success or if busy, otherwise a negative errno value.
*/
int usb_serial_generic_write_start(struct usb_serial_port *port,
gfp_t mem_flags)
{
struct urb *urb;
int count, result;
unsigned long flags;
int i;
if (test_and_set_bit_lock(USB_SERIAL_WRITE_BUSY, &port->flags))
return 0;
retry:
spin_lock_irqsave(&port->lock, flags);
if (!port->write_urbs_free || !kfifo_len(&port->write_fifo)) {
clear_bit_unlock(USB_SERIAL_WRITE_BUSY, &port->flags);
spin_unlock_irqrestore(&port->lock, flags);
return 0;
}
i = (int)find_first_bit(&port->write_urbs_free,
ARRAY_SIZE(port->write_urbs));
spin_unlock_irqrestore(&port->lock, flags);
urb = port->write_urbs[i];
count = port->serial->type->prepare_write_buffer(port,
urb->transfer_buffer,
port->bulk_out_size);
urb->transfer_buffer_length = count;
usb_serial_debug_data(&port->dev, __func__, count, urb->transfer_buffer);
spin_lock_irqsave(&port->lock, flags);
port->tx_bytes += count;
spin_unlock_irqrestore(&port->lock, flags);
clear_bit(i, &port->write_urbs_free);
result = usb_submit_urb(urb, mem_flags);
if (result) {
dev_err_console(port, "%s - error submitting urb: %d\n",
__func__, result);
set_bit(i, &port->write_urbs_free);
spin_lock_irqsave(&port->lock, flags);
port->tx_bytes -= count;
spin_unlock_irqrestore(&port->lock, flags);
clear_bit_unlock(USB_SERIAL_WRITE_BUSY, &port->flags);
return result;
}
goto retry; /* try sending off another urb */
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johan hovold | johan hovold | 195 | 66.10% | 10 | 52.63% |
greg kroah-hartman | greg kroah-hartman | 77 | 26.10% | 4 | 21.05% |
jiri kosina | jiri kosina | 10 | 3.39% | 1 | 5.26% |
david vomlehn | david vomlehn | 9 | 3.05% | 1 | 5.26% |
harvey harrison | harvey harrison | 2 | 0.68% | 1 | 5.26% |
stefani seibold | stefani seibold | 2 | 0.68% | 2 | 10.53% |
| Total | 295 | 100.00% | 19 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_generic_write_start);
/**
* usb_serial_generic_write - generic write function
* @tty: tty for the port
* @port: usb-serial port
* @buf: data to write
* @count: number of bytes to write
*
* Return: The number of characters buffered, which may be anything from
* zero to @count, or a negative errno value.
*/
int usb_serial_generic_write(struct tty_struct *tty,
struct usb_serial_port *port, const unsigned char *buf, int count)
{
int result;
if (!port->bulk_out_size)
return -ENODEV;
if (!count)
return 0;
count = kfifo_in_locked(&port->write_fifo, buf, count, &port->lock);
result = usb_serial_generic_write_start(port, GFP_ATOMIC);
if (result)
return result;
return count;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
david vomlehn | david vomlehn | 57 | 67.86% | 1 | 10.00% |
johan hovold | johan hovold | 17 | 20.24% | 5 | 50.00% |
stefani seibold | stefani seibold | 7 | 8.33% | 3 | 30.00% |
greg kroah-hartman | greg kroah-hartman | 3 | 3.57% | 1 | 10.00% |
| Total | 84 | 100.00% | 10 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_generic_write);
int usb_serial_generic_write_room(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
unsigned long flags;
int room;
if (!port->bulk_out_size)
return 0;
spin_lock_irqsave(&port->lock, flags);
room = kfifo_avail(&port->write_fifo);
spin_unlock_irqrestore(&port->lock, flags);
dev_dbg(&port->dev, "%s - returns %d\n", __func__, room);
return room;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
greg kroah-hartman | greg kroah-hartman | 31 | 37.35% | 2 | 25.00% |
jason wessel | jason wessel | 24 | 28.92% | 1 | 12.50% |
johan hovold | johan hovold | 10 | 12.05% | 1 | 12.50% |
alan cox | alan cox | 10 | 12.05% | 1 | 12.50% |
david vomlehn | david vomlehn | 5 | 6.02% | 1 | 12.50% |
stefani seibold | stefani seibold | 2 | 2.41% | 1 | 12.50% |
harvey harrison | harvey harrison | 1 | 1.20% | 1 | 12.50% |
| Total | 83 | 100.00% | 8 | 100.00% |
int usb_serial_generic_chars_in_buffer(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
unsigned long flags;
int chars;
if (!port->bulk_out_size)
return 0;
spin_lock_irqsave(&port->lock, flags);
chars = kfifo_len(&port->write_fifo) + port->tx_bytes;
spin_unlock_irqrestore(&port->lock, flags);
dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars);
return chars;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
greg kroah-hartman | greg kroah-hartman | 30 | 34.48% | 2 | 18.18% |
johan hovold | johan hovold | 17 | 19.54% | 3 | 27.27% |
jason wessel | jason wessel | 14 | 16.09% | 1 | 9.09% |
stefani seibold | stefani seibold | 11 | 12.64% | 2 | 18.18% |
alan cox | alan cox | 10 | 11.49% | 1 | 9.09% |
david vomlehn | david vomlehn | 4 | 4.60% | 1 | 9.09% |
harvey harrison | harvey harrison | 1 | 1.15% | 1 | 9.09% |
| Total | 87 | 100.00% | 11 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_generic_chars_in_buffer);
void usb_serial_generic_wait_until_sent(struct tty_struct *tty, long timeout)
{
struct usb_serial_port *port = tty->driver_data;
unsigned int bps;
unsigned long period;
unsigned long expire;
bps = tty_get_baud_rate(tty);
if (!bps)
bps = 9600; /* B0 */
/*
* Use a poll-period of roughly the time it takes to send one
* character or at least one jiffy.
*/
period = max_t(unsigned long, (10 * HZ / bps), 1);
if (timeout)
period = min_t(unsigned long, period, timeout);
dev_dbg(&port->dev, "%s - timeout = %u ms, period = %u ms\n",
__func__, jiffies_to_msecs(timeout),
jiffies_to_msecs(period));
expire = jiffies + timeout;
while (!port->serial->type->tx_empty(port)) {
schedule_timeout_interruptible(period);
if (signal_pending(current))
break;
if (timeout && time_after(jiffies, expire))
break;
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johan hovold | johan hovold | 149 | 100.00% | 2 | 100.00% |
| Total | 149 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_generic_wait_until_sent);
static int usb_serial_generic_submit_read_urb(struct usb_serial_port *port,
int index, gfp_t mem_flags)
{
int res;
if (!test_and_clear_bit(index, &port->read_urbs_free))
return 0;
dev_dbg(&port->dev, "%s - urb %d\n", __func__, index);
res = usb_submit_urb(port->read_urbs[index], mem_flags);
if (res) {
if (res != -EPERM && res != -ENODEV) {
dev_err(&port->dev,
"%s - usb_submit_urb failed: %d\n",
__func__, res);
}
set_bit(index, &port->read_urbs_free);
return res;
}
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johan hovold | johan hovold | 68 | 59.65% | 5 | 38.46% |
greg kroah-hartman | greg kroah-hartman | 34 | 29.82% | 4 | 30.77% |
jeremiah mahler | jeremiah mahler | 5 | 4.39% | 1 | 7.69% |
oliver neukum | oliver neukum | 4 | 3.51% | 1 | 7.69% |
joris van rantwijk | joris van rantwijk | 2 | 1.75% | 1 | 7.69% |
harvey harrison | harvey harrison | 1 | 0.88% | 1 | 7.69% |
| Total | 114 | 100.00% | 13 | 100.00% |
int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port,
gfp_t mem_flags)
{
int res;
int i;
for (i = 0; i < ARRAY_SIZE(port->read_urbs); ++i) {
res = usb_serial_generic_submit_read_urb(port, i, mem_flags);
if (res)
goto err;
}
return 0;
err:
for (; i >= 0; --i)
usb_kill_urb(port->read_urbs[i]);
return res;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johan hovold | johan hovold | 85 | 100.00% | 3 | 100.00% |
| Total | 85 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_generic_submit_read_urbs);
void usb_serial_generic_process_read_urb(struct urb *urb)
{
struct usb_serial_port *port = urb->context;
char *ch = (char *)urb->transfer_buffer;
int i;
if (!urb->actual_length)
return;
/*
* The per character mucking around with sysrq path it too slow for
* stuff like 3G modems, so shortcircuit it in the 99.9999999% of
* cases where the USB serial is not a console anyway.
*/
if (!port->port.console || !port->sysrq) {
tty_insert_flip_string(&port->port, ch, urb->actual_length);
} else {
for (i = 0; i < urb->actual_length; i++, ch++) {
if (!usb_serial_handle_sysrq_char(port, *ch))
tty_insert_flip_char(&port->port, *ch, TTY_NORMAL);
}
}
tty_flip_buffer_push(&port->port);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jason wessel | jason wessel | 43 | 33.59% | 2 | 16.67% |
oliver neukum | oliver neukum | 28 | 21.88% | 1 | 8.33% |
alan cox | alan cox | 27 | 21.09% | 2 | 16.67% |
johan hovold | johan hovold | 18 | 14.06% | 4 | 33.33% |
jiri slaby | jiri slaby | 12 | 9.38% | 3 | 25.00% |
| Total | 128 | 100.00% | 12 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_generic_process_read_urb);
void usb_serial_generic_read_bulk_callback(struct urb *urb)
{
struct usb_serial_port *port = urb->context;
unsigned char *data = urb->transfer_buffer;
unsigned long flags;
int i;
for (i = 0; i < ARRAY_SIZE(port->read_urbs); ++i) {
if (urb == port->read_urbs[i])
break;
}
set_bit(i, &port->read_urbs_free);
dev_dbg(&port->dev, "%s - urb %d, len %d\n", __func__, i,
urb->actual_length);
switch (urb->status) {
case 0:
break;
case -ENOENT:
case -ECONNRESET:
case -ESHUTDOWN:
dev_dbg(&port->dev, "%s - urb stopped: %d\n",
__func__, urb->status);
return;
case -EPIPE:
dev_err(&port->dev, "%s - urb stopped: %d\n",
__func__, urb->status);
return;
default:
dev_dbg(&port->dev, "%s - nonzero urb status: %d\n",
__func__, urb->status);
goto resubmit;
}
usb_serial_debug_data(&port->dev, __func__, urb->actual_length, data);
port->serial->type->process_read_urb(urb);
resubmit:
/* Throttle the device if requested by tty */
spin_lock_irqsave(&port->lock, flags);
port->throttled = port->throttle_req;
if (!port->throttled) {
spin_unlock_irqrestore(&port->lock, flags);
usb_serial_generic_submit_read_urb(port, i, GFP_ATOMIC);
} else {
spin_unlock_irqrestore(&port->lock, flags);
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johan hovold | johan hovold | 133 | 50.00% | 6 | 42.86% |
joris van rantwijk | joris van rantwijk | 83 | 31.20% | 1 | 7.14% |
pete zaitcev | pete zaitcev | 13 | 4.89% | 1 | 7.14% |
greg kroah-hartman | greg kroah-hartman | 12 | 4.51% | 1 | 7.14% |
borislav petkov | borislav petkov | 10 | 3.76% | 1 | 7.14% |
alan cox | alan cox | 7 | 2.63% | 1 | 7.14% |
oliver neukum | oliver neukum | 4 | 1.50% | 1 | 7.14% |
harvey harrison | harvey harrison | 3 | 1.13% | 1 | 7.14% |
jeremiah mahler | jeremiah mahler | 1 | 0.38% | 1 | 7.14% |
| Total | 266 | 100.00% | 14 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_generic_read_bulk_callback);
void usb_serial_generic_write_bulk_callback(struct urb *urb)
{
unsigned long flags;
struct usb_serial_port *port = urb->context;
int i;
for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i) {
if (port->write_urbs[i] == urb)
break;
}
spin_lock_irqsave(&port->lock, flags);
port->tx_bytes -= urb->transfer_buffer_length;
set_bit(i, &port->write_urbs_free);
spin_unlock_irqrestore(&port->lock, flags);
switch (urb->status) {
case 0:
break;
case -ENOENT:
case -ECONNRESET:
case -ESHUTDOWN:
dev_dbg(&port->dev, "%s - urb stopped: %d\n",
__func__, urb->status);
return;
case -EPIPE:
dev_err_console(port, "%s - urb stopped: %d\n",
__func__, urb->status);
return;
default:
dev_err_console(port, "%s - nonzero urb status: %d\n",
__func__, urb->status);
goto resubmit;
}
resubmit:
usb_serial_generic_write_start(port, GFP_ATOMIC);
usb_serial_port_softint(port);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johan hovold | johan hovold | 137 | 73.66% | 8 | 57.14% |
greg kroah-hartman | greg kroah-hartman | 37 | 19.89% | 4 | 28.57% |
david vomlehn | david vomlehn | 8 | 4.30% | 1 | 7.14% |
jason wessel | jason wessel | 4 | 2.15% | 1 | 7.14% |
| Total | 186 | 100.00% | 14 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_generic_write_bulk_callback);
void usb_serial_generic_throttle(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
port->throttle_req = 1;
spin_unlock_irqrestore(&port->lock, flags);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
joris van rantwijk | joris van rantwijk | 38 | 77.55% | 1 | 50.00% |
alan cox | alan cox | 11 | 22.45% | 1 | 50.00% |
| Total | 49 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_generic_throttle);
void usb_serial_generic_unthrottle(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
int was_throttled;
spin_lock_irq(&port->lock);
was_throttled = port->throttled;
port->throttled = port->throttle_req = 0;
spin_unlock_irq(&port->lock);
if (was_throttled)
usb_serial_generic_submit_read_urbs(port, GFP_KERNEL);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
joris van rantwijk | joris van rantwijk | 49 | 75.38% | 1 | 25.00% |
alan cox | alan cox | 11 | 16.92% | 1 | 25.00% |
johan hovold | johan hovold | 5 | 7.69% | 2 | 50.00% |
| Total | 65 | 100.00% | 4 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_generic_unthrottle);
static bool usb_serial_generic_msr_changed(struct tty_struct *tty,
unsigned long arg, struct async_icount *cprev)
{
struct usb_serial_port *port = tty->driver_data;
struct async_icount cnow;
unsigned long flags;
bool ret;
/*
* Use tty-port initialised flag to detect all hangups including the
* one generated at USB-device disconnect.
*/
if (!tty_port_initialized(&port->port))
return true;
spin_lock_irqsave(&port->lock, flags);
cnow = port->icount; /* atomic copy*/
spin_unlock_irqrestore(&port->lock, flags);
ret = ((arg & TIOCM_RNG) && (cnow.rng != cprev->rng)) ||
((arg & TIOCM_DSR) && (cnow.dsr != cprev->dsr)) ||
((arg & TIOCM_CD) && (cnow.dcd != cprev->dcd)) ||
((arg & TIOCM_CTS) && (cnow.cts != cprev->cts));
*cprev = cnow;
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johan hovold | johan hovold | 163 | 99.39% | 2 | 66.67% |
peter hurley | peter hurley | 1 | 0.61% | 1 | 33.33% |
| Total | 164 | 100.00% | 3 | 100.00% |
int usb_serial_generic_tiocmiwait(struct tty_struct *tty, unsigned long arg)
{
struct usb_serial_port *port = tty->driver_data;
struct async_icount cnow;
unsigned long flags;
int ret;
spin_lock_irqsave(&port->lock, flags);
cnow = port->icount; /* atomic copy */
spin_unlock_irqrestore(&port->lock, flags);
ret = wait_event_interruptible(port->port.delta_msr_wait,
usb_serial_generic_msr_changed(tty, arg, &cnow));
if (!ret && !tty_port_initialized(&port->port))
ret = -EIO;
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johan hovold | johan hovold | 103 | 99.04% | 2 | 66.67% |
peter hurley | peter hurley | 1 | 0.96% | 1 | 33.33% |
| Total | 104 | 100.00% | 3 | 100.00% |
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;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johan hovold | johan hovold | 150 | 100.00% | 1 | 100.00% |
| Total | 150 | 100.00% | 1 | 100.00% |
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)
{
if (port->sysrq && port->port.console) {
if (ch && time_before(jiffies, port->sysrq)) {
handle_sysrq(ch);
port->sysrq = 0;
return 1;
}
port->sysrq = 0;
}
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jason wessel | jason wessel | 66 | 100.00% | 3 | 100.00% |
| Total | 66 | 100.00% | 3 | 100.00% |
#else
int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch)
{
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
randy dunlap | randy dunlap | 17 | 100.00% | 1 | 100.00% |
| Total | 17 | 100.00% | 1 | 100.00% |
#endif
EXPORT_SYMBOL_GPL(usb_serial_handle_sysrq_char);
int usb_serial_handle_break(struct usb_serial_port *port)
{
if (!port->sysrq) {
port->sysrq = jiffies + HZ*5;
return 1;
}
port->sysrq = 0;
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jason wessel | jason wessel | 41 | 100.00% | 1 | 100.00% |
| Total | 41 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_handle_break);
/**
* usb_serial_handle_dcd_change - handle a change of carrier detect state
* @port: usb-serial port
* @tty: tty for the port
* @status: new carrier detect status, nonzero if active
*/
void usb_serial_handle_dcd_change(struct usb_serial_port *usb_port,
struct tty_struct *tty, unsigned int status)
{
struct tty_port *port = &usb_port->port;
dev_dbg(&usb_port->dev, "%s - status %d\n", __func__, status);
if (tty) {
struct tty_ldisc *ld = tty_ldisc_ref(tty);
if (ld) {
if (ld->ops->dcd_change)
ld->ops->dcd_change(tty, status);
tty_ldisc_deref(ld);
}
}
if (status)
wake_up_interruptible(&port->open_wait);
else if (tty && !C_CLOCAL(tty))
tty_hangup(tty);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
libor pechacek | libor pechacek | 64 | 54.70% | 1 | 25.00% |
paul chavent | paul chavent | 46 | 39.32% | 1 | 25.00% |
greg kroah-hartman | greg kroah-hartman | 6 | 5.13% | 1 | 25.00% |
johan hovold | johan hovold | 1 | 0.85% | 1 | 25.00% |
| Total | 117 | 100.00% | 4 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_handle_dcd_change);
int usb_serial_generic_resume(struct usb_serial *serial)
{
struct usb_serial_port *port;
int i, c = 0, r;
for (i = 0; i < serial->num_ports; i++) {
port = serial->port[i];
if (!tty_port_initialized(&port->port))
continue;
if (port->bulk_in_size) {
r = usb_serial_generic_submit_read_urbs(port,
GFP_NOIO);
if (r < 0)
c++;
}
if (port->bulk_out_size) {
r = usb_serial_generic_write_start(port, GFP_NOIO);
if (r < 0)
c++;
}
}
return c ? -EIO : 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
david vomlehn | david vomlehn | 113 | 92.62% | 1 | 16.67% |
johan hovold | johan hovold | 5 | 4.10% | 3 | 50.00% |
alan stern | alan stern | 3 | 2.46% | 1 | 16.67% |
peter hurley | peter hurley | 1 | 0.82% | 1 | 16.67% |
| Total | 122 | 100.00% | 6 | 100.00% |
EXPORT_SYMBOL_GPL(usb_serial_generic_resume);
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johan hovold | johan hovold | 1426 | 48.60% | 37 | 40.22% |
greg kroah-hartman | greg kroah-hartman | 481 | 16.39% | 19 | 20.65% |
jason wessel | jason wessel | 222 | 7.57% | 4 | 4.35% |
joris van rantwijk | joris van rantwijk | 216 | 7.36% | 1 | 1.09% |
david vomlehn | david vomlehn | 204 | 6.95% | 1 | 1.09% |
alan cox | alan cox | 82 | 2.79% | 4 | 4.35% |
libor pechacek | libor pechacek | 69 | 2.35% | 1 | 1.09% |
paul chavent | paul chavent | 46 | 1.57% | 1 | 1.09% |
oliver neukum | oliver neukum | 41 | 1.40% | 2 | 2.17% |
randy dunlap | randy dunlap | 27 | 0.92% | 1 | 1.09% |
alan stern | alan stern | 26 | 0.89% | 3 | 3.26% |
stefani seibold | stefani seibold | 22 | 0.75% | 5 | 5.43% |
pete zaitcev | pete zaitcev | 13 | 0.44% | 1 | 1.09% |
jiri slaby | jiri slaby | 12 | 0.41% | 3 | 3.26% |
jiri kosina | jiri kosina | 10 | 0.34% | 1 | 1.09% |
borislav petkov | borislav petkov | 10 | 0.34% | 1 | 1.09% |
harvey harrison | harvey harrison | 8 | 0.27% | 1 | 1.09% |
jeremiah mahler | jeremiah mahler | 6 | 0.20% | 2 | 2.17% |
luiz fernando capitulino | luiz fernando capitulino | 5 | 0.17% | 1 | 1.09% |
peter hurley | peter hurley | 3 | 0.10% | 1 | 1.09% |
david brownell | david brownell | 3 | 0.10% | 1 | 1.09% |
kai germaschewski | kai germaschewski | 2 | 0.07% | 1 | 1.09% |
| Total | 2934 | 100.00% | 92 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.