1
2
3
4
5
6
7
8
9
10
11
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
27
28
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
40struct 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
51struct 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
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
84
85
86
87extern int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev);
88extern int gdm_wimax_send_tx(struct sk_buff *skb, struct net_device *dev);
89extern void unregister_wimax_device(struct phy_dev *phy_dev);
90
91#endif
92