2 * Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved.
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
17 #include <linux/types.h>
18 #include <linux/usb.h>
19 #include <linux/list.h>
24 #define USB_RT_ACM (USB_TYPE_CLASS | USB_RECIP_INTERFACE)
26 #define START_FLAG 0xA512485A
27 #define MUX_HEADER_SIZE 14
28 #define MUX_TX_MAX_SIZE (1024*10)
29 #define MUX_RX_MAX_SIZE (1024*30)
30 #define AT_PKT_TYPE 0xF011
31 #define DM_PKT_TYPE 0xF010
33 #define RETRY_TIMER 30 /* msec */
35 struct mux_pkt_header {
36 unsigned int start_flag;
38 unsigned int payload_size;
39 unsigned short packet_type;
40 unsigned char data[0];
47 void (*callback)(void *cb_data);
52 struct list_head free_list;
53 struct list_head rx_submit_list;
54 struct list_head to_host_list;
60 int (*callback)(void *data, int len, int tty_index, int minor, int complete);
64 struct list_head to_host_list;
65 struct list_head rx_submit_list;
66 struct list_head rx_free_list;
67 spinlock_t to_host_lock;
68 spinlock_t submit_list_lock;
69 spinlock_t free_list_lock;
73 struct usb_device *usbdev;
74 struct usb_interface *control_intf;
75 struct usb_interface *data_intf;
77 struct delayed_work work_rx;
78 struct usb_interface *intf;
80 int (*rx_cb)(void *data, int len, int tty_index, int minor, int complete);
81 spinlock_t write_lock;
85 #endif /* _GDM_MUX_H_ */