]>
Commit | Line | Data |
---|---|---|
61e12104 WK |
1 | /* |
2 | * Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved. | |
3 | * | |
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. | |
7 | * | |
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. | |
12 | */ | |
13 | ||
14 | #ifndef _GDM_TTY_H_ | |
15 | #define _GDM_TTY_H_ | |
16 | ||
61e12104 WK |
17 | #include <linux/types.h> |
18 | #include <linux/tty.h> | |
19 | ||
20 | ||
21 | #define TTY_MAX_COUNT 2 | |
22 | ||
23 | #define MAX_ISSUE_NUM 3 | |
24 | ||
25 | enum TO_HOST_RESULT { | |
61e12104 WK |
26 | TO_HOST_BUFFER_REQUEST_FAIL = 1, |
27 | TO_HOST_PORT_CLOSE = 2, | |
28 | TO_HOST_INVALID_PACKET = 3, | |
29 | }; | |
30 | ||
31 | enum RECV_PACKET_PROCESS { | |
32 | RECV_PACKET_PROCESS_COMPLETE = 0, | |
33 | RECV_PACKET_PROCESS_CONTINUE = 1, | |
34 | }; | |
35 | ||
36 | struct tty_dev { | |
37 | void *priv_dev; | |
38 | int (*send_func)(void *priv_dev, void *data, int len, int tty_index, | |
39 | void (*cb)(void *cb_data), void *cb_data); | |
aee9440d GKH |
40 | int (*recv_func)(void *priv_dev, int (*cb)(void *data, int len, |
41 | int tty_index, int minor, int complete)); | |
42 | int (*send_control)(void *priv_dev, int request, int value, void *data, | |
43 | int len); | |
61e12104 WK |
44 | u8 minor[2]; |
45 | }; | |
46 | ||
47 | struct tty_str { | |
48 | struct tty_dev *tty_dev; | |
49 | int tty_drv_index; | |
50 | struct tty_port port; | |
51 | }; | |
52 | ||
53 | int register_lte_tty_driver(void); | |
54 | void unregister_lte_tty_driver(void); | |
55 | int register_lte_tty_device(struct tty_dev *tty_dev, struct device *dev); | |
56 | void unregister_lte_tty_device(struct tty_dev *tty_dev); | |
57 | ||
58 | #endif /* _GDM_USB_H_ */ | |
59 |