cdc-acm.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. *
  3. * Includes for cdc-acm.c
  4. *
  5. * Mainly take from usbnet's cdc-ether part
  6. *
  7. */
  8. /*
  9. * CMSPAR, some architectures can't have space and mark parity.
  10. */
  11. #ifndef CMSPAR
  12. #define CMSPAR 0
  13. #endif
  14. /*
  15. * Major and minor numbers.
  16. */
  17. #define ACM_TTY_MAJOR 166
  18. #define ACM_TTY_MINORS 32
  19. /*
  20. * Requests.
  21. */
  22. #define USB_RT_ACM (USB_TYPE_CLASS | USB_RECIP_INTERFACE)
  23. /*
  24. * Output control lines.
  25. */
  26. #define ACM_CTRL_DTR 0x01
  27. #define ACM_CTRL_RTS 0x02
  28. /*
  29. * Input control lines and line errors.
  30. */
  31. #define ACM_CTRL_DCD 0x01
  32. #define ACM_CTRL_DSR 0x02
  33. #define ACM_CTRL_BRK 0x04
  34. #define ACM_CTRL_RI 0x08
  35. #define ACM_CTRL_FRAMING 0x10
  36. #define ACM_CTRL_PARITY 0x20
  37. #define ACM_CTRL_OVERRUN 0x40
  38. /*
  39. * Internal driver structures.
  40. */
  41. struct acm {
  42. struct usb_device *dev; /* the corresponding usb device */
  43. struct usb_interface *control; /* control interface */
  44. struct usb_interface *data; /* data interface */
  45. struct tty_struct *tty; /* the corresponding tty */
  46. struct urb *ctrlurb, *readurb, *writeurb; /* urbs */
  47. u8 *ctrl_buffer, *read_buffer, *write_buffer; /* buffers of urbs */
  48. dma_addr_t ctrl_dma, read_dma, write_dma; /* dma handles of buffers */
  49. struct usb_cdc_line_coding line; /* bits, stop, parity */
  50. struct work_struct work; /* work queue entry for line discipline waking up */
  51. struct tasklet_struct bh; /* rx processing */
  52. spinlock_t throttle_lock; /* synchronize throtteling and read callback */
  53. unsigned int ctrlin; /* input control lines (DCD, DSR, RI, break, overruns) */
  54. unsigned int ctrlout; /* output control lines (DTR, RTS) */
  55. unsigned int writesize; /* max packet size for the output bulk endpoint */
  56. unsigned int readsize,ctrlsize; /* buffer sizes for freeing */
  57. unsigned int used; /* someone has this acm's device open */
  58. unsigned int minor; /* acm minor number */
  59. unsigned char throttle; /* throttled by tty layer */
  60. unsigned char clocal; /* termios CLOCAL */
  61. unsigned char ready_for_write; /* write urb can be used */
  62. unsigned char resubmit_to_unthrottle; /* throtteling has disabled the read urb */
  63. unsigned int ctrl_caps; /* control capabilities from the class specific header */
  64. };
  65. #define CDC_DATA_INTERFACE_TYPE 0x0a
  66. /* constants describing various quirks and errors */
  67. #define NO_UNION_NORMAL 1