Merge tag 'stable/for-linus-3.16-rc5-tag' of git://git.kernel.org/pub/scm/linux/kerne...
[cascardo/linux.git] / drivers / staging / gdm72xx / gdm_wimax.h
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 H2L(x)          __cpu_to_le16(x)
27 #define L2H(x)          __le16_to_cpu(x)
28 #define DH2L(x)         __cpu_to_le32(x)
29 #define DL2H(x)         __le32_to_cpu(x)
30
31 #define H2B(x)          __cpu_to_be16(x)
32 #define B2H(x)          __be16_to_cpu(x)
33 #define DH2B(x)         __cpu_to_be32(x)
34 #define DB2H(x)         __be32_to_cpu(x)
35
36 struct phy_dev {
37         void                    *priv_dev;
38         struct net_device       *netdev;
39         int (*send_func)(void *priv_dev, void *data, int len,
40                          void (*cb)(void *cb_data), void *cb_data);
41         int (*rcv_func)(void *priv_dev,
42                         void (*cb)(void *cb_data, void *data, int len),
43                         void *cb_data);
44 };
45
46 struct nic {
47         struct net_device       *netdev;
48         struct phy_dev          *phy_dev;
49         struct net_device_stats stats;
50         struct data_s           sdk_data[SIOC_DATA_MAX];
51 #if defined(CONFIG_WIMAX_GDM72XX_QOS)
52         struct qos_cb_s         qos;
53 #endif
54 };
55
56 int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev);
57 int gdm_wimax_send_tx(struct sk_buff *skb, struct net_device *dev);
58 void unregister_wimax_device(struct phy_dev *phy_dev);
59
60 #endif