]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/staging/gdm724x/gdm_tty.h
staging: gdm7240: adding LTE USB driver
[mirror_ubuntu-artful-kernel.git] / drivers / staging / gdm724x / gdm_tty.h
CommitLineData
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
17#include <linux/version.h>
18#include <linux/types.h>
19#include <linux/tty.h>
20
21
22#define TTY_MAX_COUNT 2
23
24#define MAX_ISSUE_NUM 3
25
26enum TO_HOST_RESULT {
27 TO_HOST_SUCCESS = 0,
28 TO_HOST_BUFFER_REQUEST_FAIL = 1,
29 TO_HOST_PORT_CLOSE = 2,
30 TO_HOST_INVALID_PACKET = 3,
31};
32
33enum RECV_PACKET_PROCESS {
34 RECV_PACKET_PROCESS_COMPLETE = 0,
35 RECV_PACKET_PROCESS_CONTINUE = 1,
36};
37
38struct tty_dev {
39 void *priv_dev;
40 int (*send_func)(void *priv_dev, void *data, int len, int tty_index,
41 void (*cb)(void *cb_data), void *cb_data);
42 int (*recv_func)(void *priv_dev, int (*cb)(void *data, int len, int tty_index, int minor, int complete));
43 int (*send_control)(void *priv_dev, int request, int value, void *data, int len);
44 u8 minor[2];
45};
46
47struct tty_str {
48 struct tty_dev *tty_dev;
49 int tty_drv_index;
50 struct tty_port port;
51};
52
53int register_lte_tty_driver(void);
54void unregister_lte_tty_driver(void);
55int register_lte_tty_device(struct tty_dev *tty_dev, struct device *dev);
56void unregister_lte_tty_device(struct tty_dev *tty_dev);
57
58#endif /* _GDM_USB_H_ */
59