Lines Matching +full:port +full:- +full:number

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 1999 - 2012
6 * Greg Kroah-Hartman ([email protected])
17 /* The maximum number of ports one device can grab at once */
26 * @serial: pointer back to the struct usb_serial owner of this port.
27 * @port: pointer to the corresponding tty_port for this port.
29 * @minor: the minor number of the port
30 * @port_number: the struct usb_serial port number of this port (starts at 0)
31 * @interrupt_in_buffer: pointer to the interrupt in buffer for this port.
32 * @interrupt_in_urb: pointer to the interrupt in struct urb for this port.
34 * for this port.
35 * @interrupt_out_buffer: pointer to the interrupt out buffer for this port.
37 * @interrupt_out_urb: pointer to the interrupt out struct urb for this port.
39 * for this port.
40 * @bulk_in_buffer: pointer to the bulk in buffer for this port.
42 * @read_urb: pointer to the bulk in struct urb for this port.
44 * port.
45 * @bulk_in_buffers: pointers to the bulk in buffers for this port
46 * @read_urbs: pointers to the bulk in urbs for this port
48 * @bulk_out_buffer: pointer to the bulk out buffer for this port.
50 * @write_urb: pointer to the bulk out struct urb for this port.
52 * @bulk_out_buffers: pointers to the bulk out buffers for this port
53 * @write_urbs: pointers to the bulk out urbs for this port
56 * @tx_bytes: number of bytes currently in host stack queues
58 * port.
59 * @flags: usb serial port flags
63 * This structure is used by the usb-serial core and drivers for the specific
68 struct tty_port port; member
111 /* get and set the port private data pointer helper functions */
112 static inline void *usb_get_serial_port_data(struct usb_serial_port *port) in usb_get_serial_port_data() argument
114 return dev_get_drvdata(&port->dev); in usb_get_serial_port_data()
117 static inline void usb_set_serial_port_data(struct usb_serial_port *port, in usb_set_serial_port_data() argument
120 dev_set_drvdata(&port->dev, data); in usb_set_serial_port_data()
124 * usb_serial - structure used by the usb-serial core for a device
129 * @suspend_count: number of suspended (sibling) interfaces
130 * @num_ports: the number of ports this device has
131 * @num_interrupt_in: number of interrupt in endpoints we have
132 * @num_interrupt_out: number of interrupt out endpoints we have
133 * @num_bulk_in: number of bulk in endpoints we have
134 * @num_bulk_out: number of bulk out endpoints we have
135 * @port: array of struct usb_serial_port structures for the different ports.
137 * usb-serial driver is required to manage this data, the usb-serial core
156 struct usb_serial_port *port[MAX_NUM_PORTS]; member
166 return serial->private; in usb_get_serial_data()
171 serial->private = data; in usb_set_serial_data()
186 * usb_serial_driver - describes a usb serial driver
191 * @num_ports: the number of different ports this device will have.
192 * @num_bulk_in: minimum number of bulk-in endpoints
193 * @num_bulk_out: minimum number of bulk-out endpoints
194 * @num_interrupt_in: minimum number of interrupt-in endpoints
195 * @num_interrupt_out: minimum number of interrupt-out endpoints
196 * @bulk_in_size: minimum number of bytes to allocate for bulk-in buffer
197 * (0 = end-point size)
198 * @bulk_out_size: bytes to allocate for bulk-out buffer (0 = end-point size)
200 * device has dynamically. It can also be used to verify the number of
201 * endpoints or to modify the port-endpoint mapping. It will be called
225 * the corresponding tty port functions are called. If they are not
260 int (*port_probe)(struct usb_serial_port *port);
261 void (*port_remove)(struct usb_serial_port *port);
269 int (*open)(struct tty_struct *tty, struct usb_serial_port *port);
270 void (*close)(struct usb_serial_port *port);
271 int (*write)(struct tty_struct *tty, struct usb_serial_port *port,
279 void (*set_termios)(struct tty_struct *tty, struct usb_serial_port *port,
284 bool (*tx_empty)(struct usb_serial_port *port);
293 /* Called by the tty layer for port level work. There may or may not
295 void (*dtr_rts)(struct usb_serial_port *port, int on);
296 int (*carrier_raised)(struct usb_serial_port *port);
308 int (*prepare_write_buffer)(struct usb_serial_port *port,
320 void usb_serial_port_softint(struct usb_serial_port *port);
342 int usb_serial_generic_open(struct tty_struct *tty, struct usb_serial_port *port);
343 int usb_serial_generic_write_start(struct usb_serial_port *port, gfp_t mem_flags);
344 int usb_serial_generic_write(struct tty_struct *tty, struct usb_serial_port *port,
346 void usb_serial_generic_close(struct usb_serial_port *port);
359 int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, gfp_t mem_flags);
361 int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port, void *dest, size_t size);
364 int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch);
365 int usb_serial_handle_break(struct usb_serial_port *port);
367 static inline int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch) in usb_serial_handle_sysrq_char() argument
371 static inline int usb_serial_handle_break(struct usb_serial_port *port) in usb_serial_handle_break() argument
391 dev_dbg(dev, "%s - length = %d, data = %*ph\n", in usb_serial_debug_data()
397 * when port is used as a console.
404 if (!__port->port.console || !__print_once) { \
406 dev_err(&__port->dev, fmt, ##__VA_ARGS__); \
411 * module_usb_serial_driver() - Helper macro for registering a USB Serial driver