3 * Includes for cdc-acm.c
5 * Mainly take from usbnet's cdc-ether part
10 * CMSPAR, some architectures can't have space and mark parity.
18 * Major and minor numbers.
21 #define ACM_TTY_MAJOR 166
22 #define ACM_TTY_MINORS 32
28 #define USB_RT_ACM (USB_TYPE_CLASS | USB_RECIP_INTERFACE)
30 #define ACM_REQ_COMMAND 0x00
31 #define ACM_REQ_RESPONSE 0x01
32 #define ACM_REQ_SET_FEATURE 0x02
33 #define ACM_REQ_GET_FEATURE 0x03
34 #define ACM_REQ_CLEAR_FEATURE 0x04
36 #define ACM_REQ_SET_LINE 0x20
37 #define ACM_REQ_GET_LINE 0x21
38 #define ACM_REQ_SET_CONTROL 0x22
39 #define ACM_REQ_SEND_BREAK 0x23
45 #define ACM_IRQ_NETWORK 0x00
46 #define ACM_IRQ_LINE_STATE 0x20
49 * Output control lines.
52 #define ACM_CTRL_DTR 0x01
53 #define ACM_CTRL_RTS 0x02
56 * Input control lines and line errors.
59 #define ACM_CTRL_DCD 0x01
60 #define ACM_CTRL_DSR 0x02
61 #define ACM_CTRL_BRK 0x04
62 #define ACM_CTRL_RI 0x08
64 #define ACM_CTRL_FRAMING 0x10
65 #define ACM_CTRL_PARITY 0x20
66 #define ACM_CTRL_OVERRUN 0x40
69 * Line speed and caracter encoding.
77 } __attribute__ ((packed));
80 * Internal driver structures.
84 struct usb_device *dev; /* the corresponding usb device */
85 struct usb_interface *control; /* control interface */
86 struct usb_interface *data; /* data interface */
87 struct tty_struct *tty; /* the corresponding tty */
88 struct urb *ctrlurb, *readurb, *writeurb; /* urbs */
89 u8 *ctrl_buffer, *read_buffer, *write_buffer; /* buffers of urbs */
90 dma_addr_t ctrl_dma, read_dma, write_dma; /* dma handles of buffers */
91 struct acm_line line; /* line coding (bits, stop, parity) */
92 struct work_struct work; /* work queue entry for line discipline waking up */
93 struct tasklet_struct bh; /* rx processing */
94 spinlock_t throttle_lock; /* synchronize throtteling and read callback */
95 unsigned int ctrlin; /* input control lines (DCD, DSR, RI, break, overruns) */
96 unsigned int ctrlout; /* output control lines (DTR, RTS) */
97 unsigned int writesize; /* max packet size for the output bulk endpoint */
98 unsigned int readsize,ctrlsize; /* buffer sizes for freeing */
99 unsigned int used; /* someone has this acm's device open */
100 unsigned int minor; /* acm minor number */
101 unsigned char throttle; /* throttled by tty layer */
102 unsigned char clocal; /* termios CLOCAL */
103 unsigned char ready_for_write; /* write urb can be used */
104 unsigned char resubmit_to_unthrottle; /* throtteling has disabled the read urb */
105 unsigned int ctrl_caps; /* control capabilities from the class specific header */
108 /* "Union Functional Descriptor" from CDC spec 5.2.3.X */
112 u8 bDescriptorSubType;
114 u8 bMasterInterface0;
116 /* ... and there could be other slave interfaces */
117 } __attribute__ ((packed));
119 /* class specific descriptor types */
120 #define CDC_HEADER_TYPE 0x00
121 #define CDC_CALL_MANAGEMENT_TYPE 0x01
122 #define CDC_AC_MANAGEMENT_TYPE 0x02
123 #define CDC_UNION_TYPE 0x06
124 #define CDC_COUNTRY_TYPE 0x07
126 #define CDC_DATA_INTERFACE_TYPE 0x0a