usb-wwan.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Definitions for USB serial mobile broadband cards
  3. */
  4. #ifndef __LINUX_USB_USB_WWAN
  5. #define __LINUX_USB_USB_WWAN
  6. extern void usb_wwan_dtr_rts(struct usb_serial_port *port, int on);
  7. extern int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port);
  8. extern void usb_wwan_close(struct usb_serial_port *port);
  9. extern int usb_wwan_startup(struct usb_serial *serial);
  10. extern void usb_wwan_disconnect(struct usb_serial *serial);
  11. extern void usb_wwan_release(struct usb_serial *serial);
  12. extern int usb_wwan_write_room(struct tty_struct *tty);
  13. extern void usb_wwan_set_termios(struct tty_struct *tty,
  14. struct usb_serial_port *port,
  15. struct ktermios *old);
  16. extern int usb_wwan_tiocmget(struct tty_struct *tty);
  17. extern int usb_wwan_tiocmset(struct tty_struct *tty,
  18. unsigned int set, unsigned int clear);
  19. extern int usb_wwan_ioctl(struct tty_struct *tty,
  20. unsigned int cmd, unsigned long arg);
  21. extern int usb_wwan_send_setup(struct usb_serial_port *port);
  22. extern int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
  23. const unsigned char *buf, int count);
  24. extern int usb_wwan_chars_in_buffer(struct tty_struct *tty);
  25. extern void usb_wwan_throttle(struct tty_struct *tty);
  26. extern void usb_wwan_unthrottle(struct tty_struct *tty);
  27. #ifdef CONFIG_PM
  28. extern int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message);
  29. extern int usb_wwan_resume(struct usb_serial *serial);
  30. #endif
  31. /* per port private data */
  32. #define N_IN_URB 5
  33. #define N_OUT_URB 5
  34. #define IN_BUFLEN 16384
  35. #define OUT_BUFLEN 65536
  36. struct usb_wwan_intf_private {
  37. spinlock_t susp_lock;
  38. unsigned int suspended:1;
  39. int in_flight;
  40. int (*send_setup) (struct usb_serial_port *port);
  41. void *private;
  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 */
  51. int opened;
  52. struct usb_anchor submitted;
  53. struct usb_anchor delayed;
  54. struct list_head in_urb_list;
  55. spinlock_t in_lock;
  56. ssize_t n_read;
  57. struct work_struct in_work;
  58. /* Settings for the port */
  59. int rts_state; /* Handshaking pins (outputs) */
  60. int dtr_state;
  61. int cts_state; /* Handshaking pins (inputs) */
  62. int dsr_state;
  63. int dcd_state;
  64. int ri_state;
  65. unsigned long tx_start_time[N_OUT_URB];
  66. };
  67. #endif /* __LINUX_USB_USB_WWAN */