Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 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/version.h> |
| 19 | #include <linux/types.h> |
| 20 | #include "wm_ioctl.h" |
| 21 | #if defined(CONFIG_WIMAX_GDM72XX_QOS) |
| 22 | #include "gdm_qos.h" |
| 23 | #endif |
| 24 | |
| 25 | #define DRIVER_VERSION "3.2.3" |
| 26 | |
| 27 | /*#define ETH_P_IP 0x0800 */ |
| 28 | /*#define ETH_P_ARP 0x0806 */ |
| 29 | /*#define ETH_P_IPV6 0x86DD */ |
| 30 | |
| 31 | #define H2L(x) __cpu_to_le16(x) |
| 32 | #define L2H(x) __le16_to_cpu(x) |
| 33 | #define DH2L(x) __cpu_to_le32(x) |
| 34 | #define DL2H(x) __le32_to_cpu(x) |
| 35 | |
| 36 | #define H2B(x) __cpu_to_be16(x) |
| 37 | #define B2H(x) __be16_to_cpu(x) |
| 38 | #define DH2B(x) __cpu_to_be32(x) |
| 39 | #define DB2H(x) __be32_to_cpu(x) |
| 40 | |
| 41 | struct phy_dev { |
| 42 | void *priv_dev; |
| 43 | struct net_device *netdev; |
| 44 | |
| 45 | int (*send_func)(void *priv_dev, void *data, int len, |
| 46 | void (*cb)(void *cb_data), void *cb_data); |
| 47 | int (*rcv_func)(void *priv_dev, |
| 48 | void (*cb)(void *cb_data, void *data, int len), |
| 49 | void *cb_data); |
| 50 | }; |
| 51 | |
| 52 | struct nic { |
| 53 | struct net_device *netdev; |
| 54 | struct phy_dev *phy_dev; |
| 55 | |
| 56 | struct net_device_stats stats; |
| 57 | |
| 58 | struct data_s sdk_data[SIOC_DATA_MAX]; |
| 59 | |
| 60 | #if defined(CONFIG_WIMAX_GDM72XX_QOS) |
| 61 | struct qos_cb_s qos; |
| 62 | #endif |
| 63 | |
| 64 | }; |
| 65 | |
| 66 | |
| 67 | #if 0 |
| 68 | #define dprintk(fmt, args ...) printk(KERN_DEBUG " [GDM] " fmt, ## args) |
| 69 | #else |
| 70 | #define dprintk(...) |
| 71 | #endif |
| 72 | |
| 73 | /*#define DEBUG_SDU */ |
| 74 | #if defined(DEBUG_SDU) |
| 75 | #define DUMP_SDU_ALL (1<<0) |
| 76 | #define DUMP_SDU_ARP (1<<1) |
| 77 | #define DUMP_SDU_IP (1<<2) |
| 78 | #define DUMP_SDU_IP_TCP (1<<8) |
| 79 | #define DUMP_SDU_IP_UDP (1<<9) |
| 80 | #define DUMP_SDU_IP_ICMP (1<<10) |
| 81 | #define DUMP_PACKET (DUMP_SDU_ALL) |
| 82 | #endif |
| 83 | |
| 84 | /*#define DEBUG_HCI */ |
| 85 | |
| 86 | /*#define LOOPBACK_TEST */ |
| 87 | |
Paul Stewart | 54bc1ff | 2012-05-17 11:15:10 -0700 | [diff] [blame] | 88 | extern int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev); |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 89 | extern int gdm_wimax_send_tx(struct sk_buff *skb, struct net_device *dev); |
| 90 | extern void unregister_wimax_device(struct phy_dev *phy_dev); |
| 91 | |
| 92 | #endif |