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>
26 #define USB_RT_ACM (USB_TYPE_CLASS | USB_RECIP_INTERFACE)
28 #define START_FLAG 0xA512485A
29 #define MUX_HEADER_SIZE 14
30 #define MUX_TX_MAX_SIZE (1024*10)
31 #define MUX_RX_MAX_SIZE (1024*30)
32 #define AT_PKT_TYPE 0xF011
33 #define DM_PKT_TYPE 0xF010
35 #define RETRY_TIMER 30 /* msec */
37 struct mux_pkt_header
{
38 unsigned int start_flag
;
40 unsigned int payload_size
;
41 unsigned short packet_type
;
42 unsigned char data
[0];
49 void (*callback
)(void *cb_data
);
54 struct list_head free_list
;
55 struct list_head rx_submit_list
;
56 struct list_head to_host_list
;
62 int (*callback
)(void *data
,
65 struct tty_dev
*tty_dev
,
70 struct list_head to_host_list
;
71 struct list_head rx_submit_list
;
72 struct list_head rx_free_list
;
73 spinlock_t to_host_lock
;
74 spinlock_t submit_list_lock
;
75 spinlock_t free_list_lock
;
79 struct usb_device
*usbdev
;
80 struct usb_interface
*control_intf
;
81 struct usb_interface
*data_intf
;
83 struct delayed_work work_rx
;
84 struct usb_interface
*intf
;
86 int (*rx_cb
)(void *data
,
89 struct tty_dev
*tty_dev
,
91 spinlock_t write_lock
;
92 struct tty_dev
*tty_dev
;
95 #endif /* _GDM_MUX_H_ */