blob: 1614e917c0048c46f2f167343144fa55f80b40a9 [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_LTE_H_
15#define _GDM_LTE_H_
16
17#include <linux/netdevice.h>
18#include <linux/version.h>
19#include <linux/types.h>
20
21#include "gdm_endian.h"
22
23#define MAX_NIC_TYPE 4
24#define MAX_RX_SUBMIT_COUNT 3
25#define DRIVER_VERSION "3.7.17.0"
26
27enum TX_ERROR_CODE {
28 TX_NO_ERROR = 0,
29 TX_NO_DEV,
30 TX_NO_SPC,
31 TX_NO_BUFFER,
32};
33
34enum CALLBACK_CONTEXT {
35 KERNEL_THREAD = 0,
36 USB_COMPLETE,
37};
38
39struct pdn_table {
40 u8 activate;
41 u32 dft_eps_id;
42 u32 nic_type;
43} __packed;
44
45struct nic;
46
47struct phy_dev {
48 void *priv_dev;
49 struct net_device *dev[MAX_NIC_TYPE];
50 int (*send_hci_func)(void *priv_dev, void *data, int len,
51 void (*cb)(void *cb_data), void *cb_data);
52 int (*send_sdu_func)(void *priv_dev, void *data, int len,
53 unsigned int dftEpsId, unsigned int epsId,
54 void (*cb)(void *cb_data), void *cb_data,
55 int dev_idx, int nic_type);
56 int (*rcv_func)(void *priv_dev,
57 int (*cb)(void *cb_data, void *data, int len, int context),
58 void *cb_data, int context);
59 struct gdm_endian *(*get_endian)(void *priv_dev);
60};
61
62struct nic {
63 struct net_device *netdev;
64 struct phy_dev *phy_dev;
65 struct net_device_stats stats;
66 struct pdn_table pdn_table;
67 u8 dest_mac_addr[ETH_ALEN];
68 u8 src_mac_addr[ETH_ALEN];
69 u32 nic_id;
70 u16 vlan_id;
71};
72
73int gdm_lte_event_init(void);
74void gdm_lte_event_exit(void);
75
76void start_rx_proc(struct phy_dev *phy_dev);
77int register_lte_device(struct phy_dev *phy_dev, struct device *dev, u8 *mac_address);
78void unregister_lte_device(struct phy_dev *phy_dev);
79
80#endif /* _GDM_LTE_H_ */