usb-wwan.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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, struct file *file);
  17. extern int usb_wwan_tiocmset(struct tty_struct *tty, struct file *file,
  18. unsigned int set, unsigned int clear);
  19. extern int usb_wwan_send_setup(struct usb_serial_port *port);
  20. extern int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
  21. const unsigned char *buf, int count);
  22. extern int usb_wwan_chars_in_buffer(struct tty_struct *tty);
  23. #ifdef CONFIG_PM
  24. extern int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message);
  25. extern int usb_wwan_resume(struct usb_serial *serial);
  26. #endif
  27. /* per port private data */
  28. #define N_IN_URB 4
  29. #define N_OUT_URB 4
  30. #define IN_BUFLEN 4096
  31. #define OUT_BUFLEN 4096
  32. struct usb_wwan_intf_private {
  33. spinlock_t susp_lock;
  34. unsigned int suspended:1;
  35. int in_flight;
  36. int (*send_setup) (struct usb_serial_port *port);
  37. void *private;
  38. };
  39. struct usb_wwan_port_private {
  40. /* Input endpoints and buffer for this port */
  41. struct urb *in_urbs[N_IN_URB];
  42. u8 *in_buffer[N_IN_URB];
  43. /* Output endpoints and buffer for this port */
  44. struct urb *out_urbs[N_OUT_URB];
  45. u8 *out_buffer[N_OUT_URB];
  46. unsigned long out_busy; /* Bit vector of URBs in use */
  47. int opened;
  48. struct usb_anchor delayed;
  49. /* Settings for the port */
  50. int rts_state; /* Handshaking pins (outputs) */
  51. int dtr_state;
  52. int cts_state; /* Handshaking pins (inputs) */
  53. int dsr_state;
  54. int dcd_state;
  55. int ri_state;
  56. unsigned long tx_start_time[N_OUT_URB];
  57. };
  58. #endif /* __LINUX_USB_USB_WWAN */