Matthew Garrett | 0d45619 | 2010-04-01 12:31:07 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Definitions for USB serial mobile broadband cards |
| 3 | */ |
| 4 | |
| 5 | #ifndef __LINUX_USB_USB_WWAN |
| 6 | #define __LINUX_USB_USB_WWAN |
| 7 | |
| 8 | extern void usb_wwan_dtr_rts(struct usb_serial_port *port, int on); |
| 9 | extern int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port); |
| 10 | extern void usb_wwan_close(struct usb_serial_port *port); |
Johan Hovold | b8f0e82 | 2012-10-25 10:29:16 +0200 | [diff] [blame] | 11 | extern int usb_wwan_port_probe(struct usb_serial_port *port); |
Bjørn Mork | a1028f0 | 2012-07-27 01:11:41 +0200 | [diff] [blame] | 12 | extern int usb_wwan_port_remove(struct usb_serial_port *port); |
Matthew Garrett | 0d45619 | 2010-04-01 12:31:07 -0400 | [diff] [blame] | 13 | extern int usb_wwan_write_room(struct tty_struct *tty); |
Alan Cox | 60b33c1 | 2011-02-14 16:26:14 +0000 | [diff] [blame] | 14 | extern int usb_wwan_tiocmget(struct tty_struct *tty); |
Alan Cox | 20b9d17 | 2011-02-14 16:26:50 +0000 | [diff] [blame] | 15 | extern int usb_wwan_tiocmset(struct tty_struct *tty, |
Matthew Garrett | 0d45619 | 2010-04-01 12:31:07 -0400 | [diff] [blame] | 16 | unsigned int set, unsigned int clear); |
Alan Cox | 00a0d0d | 2011-02-14 16:27:06 +0000 | [diff] [blame] | 17 | extern int usb_wwan_ioctl(struct tty_struct *tty, |
Dan Williams | 02303f7 | 2010-11-19 16:04:00 -0600 | [diff] [blame] | 18 | unsigned int cmd, unsigned long arg); |
Matthew Garrett | 0d45619 | 2010-04-01 12:31:07 -0400 | [diff] [blame] | 19 | extern int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, |
| 20 | const unsigned char *buf, int count); |
| 21 | extern int usb_wwan_chars_in_buffer(struct tty_struct *tty); |
| 22 | #ifdef CONFIG_PM |
| 23 | extern int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message); |
| 24 | extern int usb_wwan_resume(struct usb_serial *serial); |
| 25 | #endif |
| 26 | |
| 27 | /* per port private data */ |
| 28 | |
| 29 | #define N_IN_URB 4 |
| 30 | #define N_OUT_URB 4 |
| 31 | #define IN_BUFLEN 4096 |
| 32 | #define OUT_BUFLEN 4096 |
| 33 | |
| 34 | struct usb_wwan_intf_private { |
| 35 | spinlock_t susp_lock; |
| 36 | unsigned int suspended:1; |
David Ward | 669e729 | 2015-09-16 12:27:57 -0400 | [diff] [blame] | 37 | unsigned int use_send_setup:1; |
Matthew Garrett | 0d45619 | 2010-04-01 12:31:07 -0400 | [diff] [blame] | 38 | int in_flight; |
Johan Hovold | c1c0180 | 2014-05-26 19:23:20 +0200 | [diff] [blame] | 39 | unsigned int open_ports; |
Matthew Garrett | 0d45619 | 2010-04-01 12:31:07 -0400 | [diff] [blame] | 40 | void *private; |
| 41 | }; |
| 42 | |
| 43 | struct usb_wwan_port_private { |
| 44 | /* Input endpoints and buffer for this port */ |
| 45 | struct urb *in_urbs[N_IN_URB]; |
| 46 | u8 *in_buffer[N_IN_URB]; |
| 47 | /* Output endpoints and buffer for this port */ |
| 48 | struct urb *out_urbs[N_OUT_URB]; |
| 49 | u8 *out_buffer[N_OUT_URB]; |
| 50 | unsigned long out_busy; /* Bit vector of URBs in use */ |
Matthew Garrett | 0d45619 | 2010-04-01 12:31:07 -0400 | [diff] [blame] | 51 | struct usb_anchor delayed; |
| 52 | |
| 53 | /* Settings for the port */ |
| 54 | int rts_state; /* Handshaking pins (outputs) */ |
| 55 | int dtr_state; |
| 56 | int cts_state; /* Handshaking pins (inputs) */ |
| 57 | int dsr_state; |
| 58 | int dcd_state; |
| 59 | int ri_state; |
| 60 | |
| 61 | unsigned long tx_start_time[N_OUT_URB]; |
| 62 | }; |
| 63 | |
| 64 | #endif /* __LINUX_USB_USB_WWAN */ |