15 #include <linux/kernel.h>
17 #include <linux/tty.h>
18 #include <linux/slab.h>
19 #include <linux/module.h>
24 #define MAX_SETUP_DATA_SIZE 32
26 static void debug_data(
struct device *
dev,
const char *
function,
int len,
29 dev_dbg(dev,
"result = %d\n", result);
31 dev_dbg(dev,
"%s - length = %d, data = %*ph\n",
function,
35 static int zte_ev_usb_serial_open(
struct tty_struct *tty,
55 0x0001, 0x0000,
NULL, len,
56 HZ * USB_CTRL_GET_TIMEOUT);
57 dev_dbg(dev,
"result = %d\n", result);
67 0x0000, 0x0000, buf, len,
68 HZ * USB_CTRL_GET_TIMEOUT);
69 debug_data(dev, __func__, len, buf, result);
86 0x0000, 0x0000, buf, len,
87 HZ * USB_CTRL_GET_TIMEOUT);
88 debug_data(dev, __func__, len, buf, result);
97 0x0003, 0x0000,
NULL, len,
98 HZ * USB_CTRL_GET_TIMEOUT);
99 dev_dbg(dev,
"result = %d\n", result);
109 0x0000, 0x0000, buf, len,
110 HZ * USB_CTRL_GET_TIMEOUT);
111 debug_data(dev, __func__, len, buf, result);
128 0x0000, 0x0000, buf, len,
129 HZ * USB_CTRL_GET_TIMEOUT);
130 debug_data(dev, __func__, len, buf, result);
163 struct usb_device *udev = port->
serial->dev;
180 0x0002, 0x0000,
NULL, len,
181 HZ * USB_CTRL_GET_TIMEOUT);
182 dev_dbg(dev,
"result = %d\n", result);
188 0x0003, 0x0000,
NULL, len,
189 HZ * USB_CTRL_GET_TIMEOUT);
190 dev_dbg(dev,
"result = %d\n", result);
200 0x0000, 0x0000, buf, len,
201 HZ * USB_CTRL_GET_TIMEOUT);
202 debug_data(dev, __func__, len, buf, result);
219 0x0000, 0x0000, buf, len,
220 HZ * USB_CTRL_GET_TIMEOUT);
221 debug_data(dev, __func__, len, buf, result);
230 0x0003, 0x0000,
NULL, len,
231 HZ * USB_CTRL_GET_TIMEOUT);
232 dev_dbg(dev,
"result = %d\n", result);
242 0x0000, 0x0000, buf, len,
243 HZ * USB_CTRL_GET_TIMEOUT);
244 debug_data(dev, __func__, len, buf, result);
261 0x0000, 0x0000, buf, len,
262 HZ * USB_CTRL_GET_TIMEOUT);
263 debug_data(dev, __func__, len, buf, result);
272 0x0003, 0x0000,
NULL, len,
273 HZ * USB_CTRL_GET_TIMEOUT);
274 dev_dbg(dev,
"result = %d\n", result);
282 { USB_DEVICE(0x19d2, 0xffff) },
283 { USB_DEVICE(0x19d2, 0xfffe) },
284 { USB_DEVICE(0x19d2, 0xfffd) },
285 { USB_DEVICE(0x05C6, 0x3197) },
286 { USB_DEVICE(0x05C6, 0x6000) },
298 .open = zte_ev_usb_serial_open,
299 .close = zte_ev_usb_serial_close,