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 struct acm_line line; /* line coding (bits, stop, parity) */
90 struct work_struct work; /* work queue entry for line discipline waking up */
91 struct tasklet_struct bh; /* rx processing */
92 unsigned int ctrlin; /* input control lines (DCD, DSR, RI, break, overruns) */
93 unsigned int ctrlout; /* output control lines (DTR, RTS) */
94 unsigned int writesize; /* max packet size for the output bulk endpoint */
95 unsigned int used; /* someone has this acm's device open */
96 unsigned int minor; /* acm minor number */
97 unsigned char throttle; /* throttled by tty layer */
98 unsigned char clocal; /* termios CLOCAL */
99 unsigned char ready_for_write; /* write urb can be used */
102 /* "Union Functional Descriptor" from CDC spec 5.2.3.X */
106 u8 bDescriptorSubType;
108 u8 bMasterInterface0;
110 /* ... and there could be other slave interfaces */
111 } __attribute__ ((packed));
113 #define CDC_UNION_TYPE 0x06
114 #define CDC_DATA_INTERFACE_TYPE 0x0a