| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
#define ACM_TTY_MAJOR 166 |
| 15 |
#define ACM_TTY_MINORS 256 |
| 16 |
|
| 17 |
#define ACM_MINOR_INVALID ACM_TTY_MINORS |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#define USB_RT_ACM (USB_TYPE_CLASS | USB_RECIP_INTERFACE) |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
#define ACM_NW 16 |
| 38 |
#define ACM_NR 16 |
| 39 |
|
| 40 |
struct acm_wb { |
| 41 |
u8 *buf; |
| 42 |
dma_addr_t dmah; |
| 43 |
unsigned int len; |
| 44 |
struct urb *urb; |
| 45 |
struct acm *instance; |
| 46 |
bool use; |
| 47 |
}; |
| 48 |
|
| 49 |
struct acm_rb { |
| 50 |
int size; |
| 51 |
unsigned char *base; |
| 52 |
dma_addr_t dma; |
| 53 |
int index; |
| 54 |
struct acm *instance; |
| 55 |
}; |
| 56 |
|
| 57 |
struct acm { |
| 58 |
struct usb_device *dev; |
| 59 |
struct usb_interface *control; |
| 60 |
struct usb_interface *data; |
| 61 |
unsigned in, out; |
| 62 |
struct tty_port port; |
| 63 |
struct urb *ctrlurb; |
| 64 |
u8 *ctrl_buffer; |
| 65 |
dma_addr_t ctrl_dma; |
| 66 |
u8 *country_codes; |
| 67 |
unsigned int country_code_size; |
| 68 |
unsigned int country_rel_date; |
| 69 |
struct acm_wb wb[ACM_NW]; |
| 70 |
unsigned long read_urbs_free; |
| 71 |
struct urb *read_urbs[ACM_NR]; |
| 72 |
struct acm_rb read_buffers[ACM_NR]; |
| 73 |
int rx_buflimit; |
| 74 |
spinlock_t read_lock; |
| 75 |
u8 *notification_buffer; |
| 76 |
unsigned int nb_index; |
| 77 |
unsigned int nb_size; |
| 78 |
int transmitting; |
| 79 |
spinlock_t write_lock; |
| 80 |
struct mutex mutex; |
| 81 |
bool disconnected; |
| 82 |
unsigned long flags; |
| 83 |
# define EVENT_TTY_WAKEUP 0 |
| 84 |
# define EVENT_RX_STALL 1 |
| 85 |
# define ACM_THROTTLED 2 |
| 86 |
# define ACM_ERROR_DELAY 3 |
| 87 |
unsigned long urbs_in_error_delay; |
| 88 |
struct usb_cdc_line_coding line; |
| 89 |
struct delayed_work dwork; |
| 90 |
unsigned int ctrlin; |
| 91 |
unsigned int ctrlout; |
| 92 |
struct async_icount iocount; |
| 93 |
struct async_icount oldcount; |
| 94 |
wait_queue_head_t wioctl; |
| 95 |
unsigned int writesize; |
| 96 |
unsigned int readsize,ctrlsize; |
| 97 |
unsigned int minor; |
| 98 |
unsigned char clocal; |
| 99 |
unsigned int ctrl_caps; |
| 100 |
unsigned int susp_count; |
| 101 |
unsigned int combined_interfaces:1; |
| 102 |
u8 bInterval; |
| 103 |
struct usb_anchor delayed; |
| 104 |
unsigned long quirks; |
| 105 |
}; |
| 106 |
|
| 107 |
|
| 108 |
#define NO_UNION_NORMAL BIT(0) |
| 109 |
#define SINGLE_RX_URB BIT(1) |
| 110 |
#define NO_CAP_LINE BIT(2) |
| 111 |
#define IGNORE_DEVICE BIT(3) |
| 112 |
#define QUIRK_CONTROL_LINE_STATE BIT(4) |
| 113 |
#define CLEAR_HALT_CONDITIONS BIT(5) |
| 114 |
#define SEND_ZERO_PACKET BIT(6) |
| 115 |
#define DISABLE_ECHO BIT(7) |
| 116 |
#define MISSING_CAP_BRK BIT(8) |
| 117 |
#define NO_UNION_12 BIT(9) |