usb-wwan.h 1.9 KB

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