0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #define ACM_TTY_MAJOR 166
0015 #define ACM_TTY_MINORS 256
0016
0017 #define ACM_MINOR_INVALID ACM_TTY_MINORS
0018
0019
0020
0021
0022
0023 #define USB_RT_ACM (USB_TYPE_CLASS | USB_RECIP_INTERFACE)
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #define ACM_NW 16
0038 #define ACM_NR 16
0039
0040 struct acm_wb {
0041 u8 *buf;
0042 dma_addr_t dmah;
0043 unsigned int len;
0044 struct urb *urb;
0045 struct acm *instance;
0046 bool use;
0047 };
0048
0049 struct acm_rb {
0050 int size;
0051 unsigned char *base;
0052 dma_addr_t dma;
0053 int index;
0054 struct acm *instance;
0055 };
0056
0057 struct acm {
0058 struct usb_device *dev;
0059 struct usb_interface *control;
0060 struct usb_interface *data;
0061 unsigned in, out;
0062 struct tty_port port;
0063 struct urb *ctrlurb;
0064 u8 *ctrl_buffer;
0065 dma_addr_t ctrl_dma;
0066 u8 *country_codes;
0067 unsigned int country_code_size;
0068 unsigned int country_rel_date;
0069 struct acm_wb wb[ACM_NW];
0070 unsigned long read_urbs_free;
0071 struct urb *read_urbs[ACM_NR];
0072 struct acm_rb read_buffers[ACM_NR];
0073 int rx_buflimit;
0074 spinlock_t read_lock;
0075 u8 *notification_buffer;
0076 unsigned int nb_index;
0077 unsigned int nb_size;
0078 int transmitting;
0079 spinlock_t write_lock;
0080 struct mutex mutex;
0081 bool disconnected;
0082 unsigned long flags;
0083 # define EVENT_TTY_WAKEUP 0
0084 # define EVENT_RX_STALL 1
0085 # define ACM_THROTTLED 2
0086 # define ACM_ERROR_DELAY 3
0087 unsigned long urbs_in_error_delay;
0088 struct usb_cdc_line_coding line;
0089 struct delayed_work dwork;
0090 unsigned int ctrlin;
0091 unsigned int ctrlout;
0092 struct async_icount iocount;
0093 struct async_icount oldcount;
0094 wait_queue_head_t wioctl;
0095 unsigned int writesize;
0096 unsigned int readsize,ctrlsize;
0097 unsigned int minor;
0098 unsigned char clocal;
0099 unsigned int ctrl_caps;
0100 unsigned int susp_count;
0101 unsigned int combined_interfaces:1;
0102 u8 bInterval;
0103 struct usb_anchor delayed;
0104 unsigned long quirks;
0105 };
0106
0107
0108 #define NO_UNION_NORMAL BIT(0)
0109 #define SINGLE_RX_URB BIT(1)
0110 #define NO_CAP_LINE BIT(2)
0111 #define IGNORE_DEVICE BIT(3)
0112 #define QUIRK_CONTROL_LINE_STATE BIT(4)
0113 #define CLEAR_HALT_CONDITIONS BIT(5)
0114 #define SEND_ZERO_PACKET BIT(6)
0115 #define DISABLE_ECHO BIT(7)