blob: 88414e5a70cc7a71385381c398bd1cc541cbdcdc [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>
Won Kang61e12102013-07-25 03:36:17 +090018#include <linux/types.h>
19
20#include "gdm_endian.h"
21
22#define MAX_NIC_TYPE 4
23#define MAX_RX_SUBMIT_COUNT 3
24#define DRIVER_VERSION "3.7.17.0"
25
26enum TX_ERROR_CODE {
27 TX_NO_ERROR = 0,
28 TX_NO_DEV,
29 TX_NO_SPC,
30 TX_NO_BUFFER,
31};
32
33enum CALLBACK_CONTEXT {
34 KERNEL_THREAD = 0,
35 USB_COMPLETE,
36};
37
38struct pdn_table {
39 u8 activate;
40 u32 dft_eps_id;
41 u32 nic_type;
42} __packed;
43
44struct nic;
45
46struct phy_dev {
47 void *priv_dev;
48 struct net_device *dev[MAX_NIC_TYPE];
49 int (*send_hci_func)(void *priv_dev, void *data, int len,
50 void (*cb)(void *cb_data), void *cb_data);
51 int (*send_sdu_func)(void *priv_dev, void *data, int len,
52 unsigned int dftEpsId, unsigned int epsId,
53 void (*cb)(void *cb_data), void *cb_data,
54 int dev_idx, int nic_type);
55 int (*rcv_func)(void *priv_dev,
Greg Kroah-Hartmanaee94402013-07-24 13:26:12 -070056 int (*cb)(void *cb_data, void *data, int len,
57 int context),
Won Kang61e12102013-07-25 03:36:17 +090058 void *cb_data, int context);
Uma Sharmaa8f85322014-03-15 19:08:51 +053059 struct gdm_endian * (*get_endian)(void *priv_dev);
Won Kang61e12102013-07-25 03:36:17 +090060};
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);
Greg Kroah-Hartmanaee94402013-07-24 13:26:12 -070077int register_lte_device(struct phy_dev *phy_dev, struct device *dev,
78 u8 *mac_address);
Won Kang61e12102013-07-25 03:36:17 +090079void unregister_lte_device(struct phy_dev *phy_dev);
80
81#endif /* _GDM_LTE_H_ */