Lines Matching +full:usb +full:- +full:port +full:- +full:id

1 // SPDX-License-Identifier: GPL-2.0
3 * AIRcable USB Bluetooth Dongle Driver.
16 * The device simply need some stuff to understand data coming from the usb
29 * I have taken some info from a Greg Kroah-Hartman article:
43 #include <linux/usb.h>
44 #include <linux/usb/serial.h>
46 /* Vendor and Product ID */
63 #define DRIVER_DESC "AIRcable USB Driver"
65 /* ID table that will be registered with USB core */
70 MODULE_DEVICE_TABLE(usb, id_table);
72 static int aircable_prepare_write_buffer(struct usb_serial_port *port, in aircable_prepare_write_buffer() argument
78 count = kfifo_out_locked(&port->write_fifo, buf + HCI_HEADER_LENGTH, in aircable_prepare_write_buffer()
79 size - HCI_HEADER_LENGTH, &port->lock); in aircable_prepare_write_buffer()
91 if (epds->num_bulk_out == 0) { in aircable_calc_num_ports()
92 dev_dbg(&serial->interface->dev, in aircable_calc_num_ports()
93 "ignoring interface with no bulk-out endpoints\n"); in aircable_calc_num_ports()
94 return -ENODEV; in aircable_calc_num_ports()
100 static int aircable_process_packet(struct usb_serial_port *port, in aircable_process_packet() argument
104 len -= HCI_HEADER_LENGTH; in aircable_process_packet()
108 dev_dbg(&port->dev, "%s - malformed packet\n", __func__); in aircable_process_packet()
112 tty_insert_flip_string(&port->port, packet, len); in aircable_process_packet()
119 struct usb_serial_port *port = urb->context; in aircable_process_read_urb() local
120 char *data = urb->transfer_buffer; in aircable_process_read_urb()
126 has_headers = (urb->actual_length > 2 && data[0] == RX_HEADER_0); in aircable_process_read_urb()
129 for (i = 0; i < urb->actual_length; i += HCI_COMPLETE_FRAME) { in aircable_process_read_urb()
130 len = min_t(int, urb->actual_length - i, HCI_COMPLETE_FRAME); in aircable_process_read_urb()
131 count += aircable_process_packet(port, has_headers, in aircable_process_read_urb()
136 tty_flip_buffer_push(&port->port); in aircable_process_read_urb()