blob: 90c9d51fcaf0d8999d1f604ec182fe2bb3ee3c20 [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,
Greg Kroah-Hartmanaee94402013-07-24 13:26:12 -070057 int (*cb)(void *cb_data, void *data, int len,
58 int context),
Won Kang61e12102013-07-25 03:36:17 +090059 void *cb_data, int context);
60 struct gdm_endian *(*get_endian)(void *priv_dev);
61};
62
63struct nic {
64 struct net_device *netdev;
65 struct phy_dev *phy_dev;
66 struct net_device_stats stats;
67 struct pdn_table pdn_table;
68 u8 dest_mac_addr[ETH_ALEN];
69 u8 src_mac_addr[ETH_ALEN];
70 u32 nic_id;
71 u16 vlan_id;
72};
73
74int gdm_lte_event_init(void);
75void gdm_lte_event_exit(void);
76
77void start_rx_proc(struct phy_dev *phy_dev);
Greg Kroah-Hartmanaee94402013-07-24 13:26:12 -070078int register_lte_device(struct phy_dev *phy_dev, struct device *dev,
79 u8 *mac_address);
Won Kang61e12102013-07-25 03:36:17 +090080void unregister_lte_device(struct phy_dev *phy_dev);
81
82#endif /* _GDM_LTE_H_ */