blob: 297438b4ddcbc39a0694e5dd63c09d2a86be2ccf [file] [log] [blame]
Won Kang61e12102013-07-25 03:36:17 +09001/*
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
Won Kang61e12102013-07-25 03:36:17 +090017#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
25enum TO_HOST_RESULT {
Won Kang61e12102013-07-25 03:36:17 +090026 TO_HOST_BUFFER_REQUEST_FAIL = 1,
27 TO_HOST_PORT_CLOSE = 2,
28 TO_HOST_INVALID_PACKET = 3,
29};
30
31enum RECV_PACKET_PROCESS {
32 RECV_PACKET_PROCESS_COMPLETE = 0,
33 RECV_PACKET_PROCESS_CONTINUE = 1,
34};
35
Won Kang7ee4c1b2013-08-16 13:13:43 +090036struct gdm {
Won Kang61e12102013-07-25 03:36:17 +090037 struct tty_dev *tty_dev;
Won Kang61e12102013-07-25 03:36:17 +090038 struct tty_port port;
Won Kang7ee4c1b2013-08-16 13:13:43 +090039 unsigned int index;
40 unsigned int minor;
Won Kang61e12102013-07-25 03:36:17 +090041};
42
Won Kangbf0373f2013-08-16 13:13:44 +090043struct tty_dev {
44 void *priv_dev;
45 int (*send_func)(void *priv_dev,
46 void *data,
47 int len,
48 int tty_index,
49 void (*cb)(void *cb_data),
50 void *cb_data);
51 int (*recv_func)(void *priv_dev,
52 int (*cb)(void *data,
53 int len,
54 int tty_index,
55 struct tty_dev *tty_dev,
56 int complete));
57 int (*send_control)(void *priv_dev,
58 int request,
59 int value,
60 void *data,
61 int len);
62 struct gdm *gdm[2];
63};
64
Won Kang61e12102013-07-25 03:36:17 +090065int register_lte_tty_driver(void);
66void unregister_lte_tty_driver(void);
67int register_lte_tty_device(struct tty_dev *tty_dev, struct device *dev);
68void unregister_lte_tty_device(struct tty_dev *tty_dev);
69
70#endif /* _GDM_USB_H_ */
71