usb-wwan.h 2.2 KB

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