Ejemplo n.º 1
0
/* Push data to tty layer and resubmit the bulk read URB */
static void flush_and_resubmit_read_urb(struct usb_serial_port *port)
{
	struct urb *urb = port->read_urb;
	struct tty_struct *tty = port->port.tty;
	int room;

	/* Push data to tty */
	if (tty && urb->actual_length) {
		room = tty_buffer_request_room(tty, urb->actual_length);
		if (room) {
			tty_insert_flip_string(tty, urb->transfer_buffer, room);
			tty_flip_buffer_push(tty);
		}
	}

	resubmit_read_urb(port, GFP_ATOMIC);
}
Ejemplo n.º 2
0
void usb_serial_generic_unthrottle (struct usb_serial_port *port)
{
	int was_throttled;
	unsigned long flags;

	dbg("%s - port %d", __FUNCTION__, port->number);

	/* Clear the throttle flags */
	spin_lock_irqsave(&port->lock, flags);
	was_throttled = port->throttled;
	port->throttled = port->throttle_req = 0;
	spin_unlock_irqrestore(&port->lock, flags);

	if (was_throttled) {
		/* Resume reading from device */
		resubmit_read_urb(port, GFP_KERNEL);
	}
}