Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gdm_wimax.h
Go to the documentation of this file.
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_WIMAX_H__
15 #define __GDM_WIMAX_H__
16 
17 #include <linux/netdevice.h>
18 #include <linux/types.h>
19 #include "wm_ioctl.h"
20 #if defined(CONFIG_WIMAX_GDM72XX_QOS)
21 #include "gdm_qos.h"
22 #endif
23 
24 #define DRIVER_VERSION "3.2.3"
25 
26 /*#define ETH_P_IP 0x0800 */
27 /*#define ETH_P_ARP 0x0806 */
28 /*#define ETH_P_IPV6 0x86DD */
29 
30 #define H2L(x) __cpu_to_le16(x)
31 #define L2H(x) __le16_to_cpu(x)
32 #define DH2L(x) __cpu_to_le32(x)
33 #define DL2H(x) __le32_to_cpu(x)
34 
35 #define H2B(x) __cpu_to_be16(x)
36 #define B2H(x) __be16_to_cpu(x)
37 #define DH2B(x) __cpu_to_be32(x)
38 #define DB2H(x) __be32_to_cpu(x)
39 
40 struct phy_dev {
41  void *priv_dev;
42  struct net_device *netdev;
43 
44  int (*send_func)(void *priv_dev, void *data, int len,
45  void (*cb)(void *cb_data), void *cb_data);
46  int (*rcv_func)(void *priv_dev,
47  void (*cb)(void *cb_data, void *data, int len),
48  void *cb_data);
49 };
50 
51 struct nic {
52  struct net_device *netdev;
53  struct phy_dev *phy_dev;
54 
55  struct net_device_stats stats;
56 
57  struct data_s sdk_data[SIOC_DATA_MAX];
58 
59 #if defined(CONFIG_WIMAX_GDM72XX_QOS)
60  struct qos_cb_s qos;
61 #endif
62 
63 };
64 
65 
66 #if 0
67 #define dprintk(fmt, args ...) printk(KERN_DEBUG " [GDM] " fmt, ## args)
68 #else
69 #define dprintk(...)
70 #endif
71 
72 /*#define DEBUG_SDU */
73 #if defined(DEBUG_SDU)
74 #define DUMP_SDU_ALL (1<<0)
75 #define DUMP_SDU_ARP (1<<1)
76 #define DUMP_SDU_IP (1<<2)
77 #define DUMP_SDU_IP_TCP (1<<8)
78 #define DUMP_SDU_IP_UDP (1<<9)
79 #define DUMP_SDU_IP_ICMP (1<<10)
80 #define DUMP_PACKET (DUMP_SDU_ALL)
81 #endif
82 
83 /*#define DEBUG_HCI */
84 
85 /*#define LOOPBACK_TEST */
86 
87 extern int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev);
88 extern int gdm_wimax_send_tx(struct sk_buff *skb, struct net_device *dev);
89 extern void unregister_wimax_device(struct phy_dev *phy_dev);
90 
91 #endif