License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-2.6-block.git] / drivers / usb / serial / usb-wwan.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
0d456194
MG
2/*
3 * Definitions for USB serial mobile broadband cards
4 */
5
6#ifndef __LINUX_USB_USB_WWAN
7#define __LINUX_USB_USB_WWAN
8
9extern void usb_wwan_dtr_rts(struct usb_serial_port *port, int on);
10extern int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port);
11extern void usb_wwan_close(struct usb_serial_port *port);
b8f0e820 12extern int usb_wwan_port_probe(struct usb_serial_port *port);
a1028f0a 13extern int usb_wwan_port_remove(struct usb_serial_port *port);
0d456194 14extern int usb_wwan_write_room(struct tty_struct *tty);
60b33c13 15extern int usb_wwan_tiocmget(struct tty_struct *tty);
20b9d177 16extern int usb_wwan_tiocmset(struct tty_struct *tty,
0d456194 17 unsigned int set, unsigned int clear);
00a0d0d6 18extern int usb_wwan_ioctl(struct tty_struct *tty,
02303f73 19 unsigned int cmd, unsigned long arg);
0d456194
MG
20extern int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
21 const unsigned char *buf, int count);
22extern int usb_wwan_chars_in_buffer(struct tty_struct *tty);
23#ifdef CONFIG_PM
24extern int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message);
25extern int usb_wwan_resume(struct usb_serial *serial);
26#endif
27
28/* per port private data */
29
30#define N_IN_URB 4
31#define N_OUT_URB 4
32#define IN_BUFLEN 4096
33#define OUT_BUFLEN 4096
34
35struct usb_wwan_intf_private {
36 spinlock_t susp_lock;
37 unsigned int suspended:1;
669e729f 38 unsigned int use_send_setup:1;
0d456194 39 int in_flight;
c1c01803 40 unsigned int open_ports;
0d456194
MG
41 void *private;
42};
43
44struct usb_wwan_port_private {
45 /* Input endpoints and buffer for this port */
46 struct urb *in_urbs[N_IN_URB];
47 u8 *in_buffer[N_IN_URB];
48 /* Output endpoints and buffer for this port */
49 struct urb *out_urbs[N_OUT_URB];
50 u8 *out_buffer[N_OUT_URB];
51 unsigned long out_busy; /* Bit vector of URBs in use */
0d456194
MG
52 struct usb_anchor delayed;
53
54 /* Settings for the port */
55 int rts_state; /* Handshaking pins (outputs) */
56 int dtr_state;
57 int cts_state; /* Handshaking pins (inputs) */
58 int dsr_state;
59 int dcd_state;
60 int ri_state;
61
62 unsigned long tx_start_time[N_OUT_URB];
63};
64
65#endif /* __LINUX_USB_USB_WWAN */