| 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); | 
|  | 11 | extern int usb_wwan_startup(struct usb_serial *serial); | 
|  | 12 | extern void usb_wwan_disconnect(struct usb_serial *serial); | 
|  | 13 | extern void usb_wwan_release(struct usb_serial *serial); | 
|  | 14 | extern int usb_wwan_write_room(struct tty_struct *tty); | 
|  | 15 | extern void usb_wwan_set_termios(struct tty_struct *tty, | 
|  | 16 | struct usb_serial_port *port, | 
|  | 17 | struct ktermios *old); | 
| Alan Cox | 60b33c1 | 2011-02-14 16:26:14 +0000 | [diff] [blame] | 18 | extern int usb_wwan_tiocmget(struct tty_struct *tty); | 
| Alan Cox | 20b9d17 | 2011-02-14 16:26:50 +0000 | [diff] [blame] | 19 | extern int usb_wwan_tiocmset(struct tty_struct *tty, | 
| Matthew Garrett | 0d45619 | 2010-04-01 12:31:07 -0400 | [diff] [blame] | 20 | unsigned int set, unsigned int clear); | 
| Alan Cox | 00a0d0d | 2011-02-14 16:27:06 +0000 | [diff] [blame] | 21 | extern int usb_wwan_ioctl(struct tty_struct *tty, | 
| Dan Williams | 02303f7 | 2010-11-19 16:04:00 -0600 | [diff] [blame] | 22 | unsigned int cmd, unsigned long arg); | 
| Matthew Garrett | 0d45619 | 2010-04-01 12:31:07 -0400 | [diff] [blame] | 23 | extern int usb_wwan_send_setup(struct usb_serial_port *port); | 
|  | 24 | extern int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, | 
|  | 25 | const unsigned char *buf, int count); | 
|  | 26 | extern int usb_wwan_chars_in_buffer(struct tty_struct *tty); | 
| Vamsi Krishna | 6f806b8 | 2012-05-07 16:29:08 -0700 | [diff] [blame] | 27 | extern void usb_wwan_throttle(struct tty_struct *tty); | 
|  | 28 | extern void usb_wwan_unthrottle(struct tty_struct *tty); | 
| Matthew Garrett | 0d45619 | 2010-04-01 12:31:07 -0400 | [diff] [blame] | 29 | #ifdef CONFIG_PM | 
|  | 30 | extern int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message); | 
|  | 31 | extern int usb_wwan_resume(struct usb_serial *serial); | 
|  | 32 | #endif | 
|  | 33 |  | 
|  | 34 | /* per port private data */ | 
|  | 35 |  | 
| Vamsi Krishna | 6ef832f | 2012-01-27 16:29:21 -0800 | [diff] [blame] | 36 | #define N_IN_URB 5 | 
|  | 37 | #define N_OUT_URB 5 | 
| Vamsi Krishna | 6f806b8 | 2012-05-07 16:29:08 -0700 | [diff] [blame] | 38 | #define IN_BUFLEN 16384 | 
| Vamsi Krishna | 6ef832f | 2012-01-27 16:29:21 -0800 | [diff] [blame] | 39 | #define OUT_BUFLEN 65536 | 
| Matthew Garrett | 0d45619 | 2010-04-01 12:31:07 -0400 | [diff] [blame] | 40 |  | 
|  | 41 | struct usb_wwan_intf_private { | 
|  | 42 | spinlock_t susp_lock; | 
|  | 43 | unsigned int suspended:1; | 
|  | 44 | int in_flight; | 
|  | 45 | int (*send_setup) (struct usb_serial_port *port); | 
|  | 46 | void *private; | 
|  | 47 | }; | 
|  | 48 |  | 
|  | 49 | struct usb_wwan_port_private { | 
|  | 50 | /* Input endpoints and buffer for this port */ | 
|  | 51 | struct urb *in_urbs[N_IN_URB]; | 
|  | 52 | u8 *in_buffer[N_IN_URB]; | 
|  | 53 | /* Output endpoints and buffer for this port */ | 
|  | 54 | struct urb *out_urbs[N_OUT_URB]; | 
|  | 55 | u8 *out_buffer[N_OUT_URB]; | 
|  | 56 | unsigned long out_busy;	/* Bit vector of URBs in use */ | 
|  | 57 | int opened; | 
| Hemant Kumar | 1ffb039 | 2012-06-14 16:00:24 -0700 | [diff] [blame] | 58 | struct usb_anchor submitted; | 
| Matthew Garrett | 0d45619 | 2010-04-01 12:31:07 -0400 | [diff] [blame] | 59 | struct usb_anchor delayed; | 
| Vamsi Krishna | 6f806b8 | 2012-05-07 16:29:08 -0700 | [diff] [blame] | 60 | struct list_head in_urb_list; | 
|  | 61 | spinlock_t in_lock; | 
|  | 62 | ssize_t n_read; | 
|  | 63 | struct work_struct in_work; | 
| Matthew Garrett | 0d45619 | 2010-04-01 12:31:07 -0400 | [diff] [blame] | 64 |  | 
|  | 65 | /* Settings for the port */ | 
|  | 66 | int rts_state;		/* Handshaking pins (outputs) */ | 
|  | 67 | int dtr_state; | 
|  | 68 | int cts_state;		/* Handshaking pins (inputs) */ | 
|  | 69 | int dsr_state; | 
|  | 70 | int dcd_state; | 
|  | 71 | int ri_state; | 
|  | 72 |  | 
|  | 73 | unsigned long tx_start_time[N_OUT_URB]; | 
|  | 74 | }; | 
|  | 75 |  | 
|  | 76 | #endif /* __LINUX_USB_USB_WWAN */ |