Lines Matching +full:serial +full:- +full:number
1 // SPDX-License-Identifier: GPL-2.0
3 * USB Serial Converter stuff
5 * Copyright (C) 1999 - 2012
6 * Greg Kroah-Hartman (greg@kroah.com)
19 #include <linux/serial.h>
22 /* The maximum number of ports one device can grab at once */
25 /* USB serial flags */
31 * @serial: pointer back to the struct usb_serial owner of this port.
34 * @minor: the minor number of the port
35 * @port_number: the struct usb_serial port number of this port (starts at 0)
61 * @tx_bytes: number of bytes currently in host stack queues
64 * @flags: usb serial port flags
67 * @dev: pointer to the serial device
69 * This structure is used by the usb-serial core and drivers for the specific
73 struct usb_serial *serial; member
121 return dev_get_drvdata(&port->dev); in usb_get_serial_port_data()
127 dev_set_drvdata(&port->dev, data); in usb_set_serial_port_data()
131 * usb_serial - structure used by the usb-serial core for a device
135 * @num_ports: the number of ports this device has
136 * @num_interrupt_in: number of interrupt in endpoints we have
137 * @num_interrupt_out: number of interrupt out endpoints we have
138 * @num_bulk_in: number of bulk in endpoints we have
139 * @num_bulk_out: number of bulk out endpoints we have
142 * usb-serial driver is required to manage this data, the usb-serial core
167 /* get and set the serial private data pointer helper functions */
168 static inline void *usb_get_serial_data(struct usb_serial *serial) in usb_get_serial_data() argument
170 return serial->private; in usb_get_serial_data()
173 static inline void usb_set_serial_data(struct usb_serial *serial, void *data) in usb_set_serial_data() argument
175 serial->private = data; in usb_set_serial_data()
190 * usb_serial_driver - describes a usb serial driver
195 * @num_ports: the number of different ports this device will have.
196 * @num_bulk_in: minimum number of bulk-in endpoints
197 * @num_bulk_out: minimum number of bulk-out endpoints
198 * @num_interrupt_in: minimum number of interrupt-in endpoints
199 * @num_interrupt_out: minimum number of interrupt-out endpoints
200 * @bulk_in_size: minimum number of bytes to allocate for bulk-in buffer
201 * (0 = end-point size)
202 * @bulk_out_size: bytes to allocate for bulk-out buffer (0 = end-point size)
204 * device has dynamically. It can also be used to verify the number of
205 * endpoints or to modify the port-endpoint mapping. It will be called
226 * This structure is defines a USB Serial driver. It provides all of
227 * the information that the USB serial core code needs. If the function
228 * pointers are defined, then the USB serial core code will call them when
230 * called, the generic serial function will be used instead.
256 int (*probe)(struct usb_serial *serial, const struct usb_device_id *id);
257 int (*attach)(struct usb_serial *serial);
258 int (*calc_num_ports)(struct usb_serial *serial,
261 void (*disconnect)(struct usb_serial *serial);
262 void (*release)(struct usb_serial *serial);
267 int (*suspend)(struct usb_serial *serial, pm_message_t message);
268 int (*resume)(struct usb_serial *serial);
269 int (*reset_resume)(struct usb_serial *serial);
271 /* serial function calls */
301 /* Called by the usb serial hooks to allow the user to rework the
326 /* USB Serial console functions */
330 void usb_serial_console_disconnect(struct usb_serial *serial);
334 static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} in usb_serial_console_disconnect() argument
339 void usb_serial_put(struct usb_serial *serial);
345 int usb_serial_generic_resume(struct usb_serial *serial);
389 dev_dbg(dev, "%s - length = %d, data = %*ph\n", in usb_serial_debug_data()
402 if (!__port->port.console || !__print_once) { \
404 dev_err(&__port->dev, fmt, ##__VA_ARGS__); \
409 * module_usb_serial_driver() - Helper macro for registering a USB Serial driver
413 * Helper macro for USB serial drivers which do not do anything special