staging: wilc1000: remove PANDA_BOARD
[deliverable/linux.git] / drivers / staging / wilc1000 / wilc_wfi_netdevice.h
CommitLineData
c5c77ba1
JK
1/*!
2 * @file wilc_wfi_netdevice.h
3 * @brief Definitions for the network module
4 * @author mdaftedar
5 * @date 01 MAR 2012
6 * @version 1.0
7 */
8#ifndef WILC_WFI_NETDEVICE
9#define WILC_WFI_NETDEVICE
10
11/* These are the flags in the statusword */
12#define WILC_WFI_RX_INTR 0x0001
13#define WILC_WFI_TX_INTR 0x0002
14
15/* Default timeout period */
16#define WILC_WFI_TIMEOUT 5 /* In jiffies */
17#define WILC_MAX_NUM_PMKIDS 16
18#define PMKID_LEN 16
19#define PMKID_FOUND 1
20 #define NUM_STA_ASSOCIATED 8
21
22#include <linux/module.h>
23#include <linux/init.h>
24#include <linux/moduleparam.h>
25#include <linux/sched.h>
26#include <linux/kernel.h>
27#include <linux/slab.h> /* kmalloc() */
28#include <linux/errno.h> /* error codes */
29#include <linux/types.h> /* size_t */
30#include <linux/interrupt.h> /* mark_bh */
31#include <linux/time.h>
32#include <linux/in.h>
33#include <linux/netdevice.h> /* struct device, and other headers */
34#include <linux/etherdevice.h> /* eth_type_trans */
35#include <linux/ip.h> /* struct iphdr */
36#include <linux/tcp.h> /* struct tcphdr */
37#include <linux/skbuff.h>
c5c77ba1
JK
38#include <linux/ieee80211.h>
39#include <net/cfg80211.h>
c5c77ba1
JK
40#include <linux/ieee80211.h>
41#include <net/cfg80211.h>
42#include <net/ieee80211_radiotap.h>
43#include <linux/if_arp.h>
c5c77ba1
JK
44#include <linux/in6.h>
45#include <asm/checksum.h>
46#include "host_interface.h"
47#include "wilc_wlan.h"
c5c77ba1 48#include <linux/wireless.h> /* tony, 2013-06-12 */
c5c77ba1
JK
49
50#define FLOW_CONTROL_LOWER_THRESHOLD 128
51#define FLOW_CONTROL_UPPER_THRESHOLD 256
52
53/*iftype*/
c5c77ba1
JK
54enum stats_flags {
55 WILC_WFI_RX_PKT = 1 << 0,
56 WILC_WFI_TX_PKT = 1 << 1,
57};
58
59struct WILC_WFI_stats {
c5c77ba1
JK
60 unsigned long rx_packets;
61 unsigned long tx_packets;
62 unsigned long rx_bytes;
63 unsigned long tx_bytes;
64 u64 rx_time;
65 u64 tx_time;
66
67};
68
69/*
70 * This structure is private to each device. It is used to pass
71 * packets in and out, so there is place for a packet
72 */
73
74#define RX_BH_KTHREAD 0
75#define RX_BH_WORK_QUEUE 1
76#define RX_BH_THREADED_IRQ 2
77#define num_reg_frame 2
78/*
79 * If you use RX_BH_WORK_QUEUE on LPC3131: You may lose the first interrupt on
70e59d92
SC
80 * LPC3131 which is important to get the MAC start status when you are blocked
81 * inside linux_wlan_firmware_download() which blocks mac_open().
c5c77ba1 82 */
c5c77ba1 83 #define RX_BH_TYPE RX_BH_KTHREAD
c5c77ba1
JK
84
85struct wilc_wfi_key {
86 u8 *key;
87 u8 *seq;
88 int key_len;
89 int seq_len;
90 u32 cipher;
91};
36901b69 92
c5c77ba1
JK
93struct wilc_wfi_wep_key {
94 u8 *key;
95 u8 key_len;
96 u8 key_idx;
97};
98
99struct sta_info {
63d03e47 100 u8 au8Sta_AssociatedBss[MAX_NUM_STA][ETH_ALEN];
c5c77ba1
JK
101};
102
103#ifdef WILC_P2P
104/*Parameters needed for host interface for remaining on channel*/
105struct wilc_wfi_p2pListenParams {
106 struct ieee80211_channel *pstrListenChan;
107 enum nl80211_channel_type tenuChannelType;
4e4467fd 108 u32 u32ListenDuration;
57b298f5 109 u64 u64ListenCookie;
4e4467fd 110 u32 u32ListenSessionID;
c5c77ba1
JK
111};
112
113#endif /*WILC_P2P*/
114
2726887c 115struct wilc_priv {
c5c77ba1
JK
116 struct wireless_dev *wdev;
117 struct cfg80211_scan_request *pstrScanReq;
118
119 #ifdef WILC_P2P
120 struct wilc_wfi_p2pListenParams strRemainOnChanParams;
57b298f5 121 u64 u64tx_cookie;
c5c77ba1
JK
122 #endif
123
72ed4dc7 124 bool bCfgScanning;
4e4467fd 125 u32 u32RcvdChCount;
c5c77ba1 126
63d03e47 127 u8 au8AssociatedBss[ETH_ALEN];
c5c77ba1
JK
128 struct sta_info assoc_stainfo;
129 struct net_device_stats stats;
63d03e47 130 u8 monitor_flag;
c5c77ba1
JK
131 int status;
132 struct WILC_WFI_packet *ppool;
133 struct WILC_WFI_packet *rx_queue; /* List of incoming packets */
134 int rx_int_enabled;
135 int tx_packetlen;
136 u8 *tx_packetdata;
137 struct sk_buff *skb;
138 spinlock_t lock;
139 struct net_device *dev;
140 struct napi_struct napi;
218dc407 141 tstrWILC_WFIDrv *hWILCWFIDrv;
c5c77ba1
JK
142 WILC_WFIDrvHandle hWILCWFIDrv_2;
143 tstrHostIFpmkidAttr pmkid_list;
144 struct WILC_WFI_stats netstats;
63d03e47
GKH
145 u8 WILC_WFI_wep_default;
146 u8 WILC_WFI_wep_key[4][WLAN_KEY_LEN_WEP104];
147 u8 WILC_WFI_wep_key_len[4];
70e59d92
SC
148 /* The real interface that the monitor is on */
149 struct net_device *real_ndev;
c5c77ba1
JK
150 struct wilc_wfi_key *wilc_gtk[MAX_NUM_STA];
151 struct wilc_wfi_key *wilc_ptk[MAX_NUM_STA];
63d03e47 152 u8 wilc_groupkey;
c5c77ba1 153 /* semaphores */
83383ea3
AB
154 struct semaphore SemHandleUpdateStats;
155 struct semaphore hSemScanReq;
c5c77ba1 156 /* */
72ed4dc7 157 bool gbAutoRateAdjusted;
c5c77ba1 158
72ed4dc7 159 bool bInP2PlistenState;
c5c77ba1
JK
160
161};
162
163typedef struct {
d85f5326 164 u16 frame_type;
72ed4dc7 165 bool reg;
c5c77ba1
JK
166
167} struct_frame_reg;
168
c5c77ba1 169typedef struct {
51e825f7
CL
170 u8 aSrcAddress[ETH_ALEN];
171 u8 aBSSID[ETH_ALEN];
218dc407 172 tstrWILC_WFIDrv *drvHandler;
c5c77ba1
JK
173 struct net_device *wilc_netdev;
174} tstrInterfaceInfo;
175typedef struct {
176 int mac_status;
177 int wilc1000_initialized;
c5c77ba1
JK
178 #if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)
179 unsigned short dev_irq_num;
180 #endif
181 wilc_wlan_oup_t oup;
182 int close;
51e825f7 183 u8 u8NoIfcs;
c5c77ba1 184 tstrInterfaceInfo strInterfaceInfo[NUM_CONCURRENT_IFC];
51e825f7 185 u8 open_ifcs;
c5c77ba1
JK
186 struct mutex txq_cs;
187
188 /*Added by Amr - BugID_4720*/
642768ee 189 struct semaphore txq_add_to_head_cs;
c5c77ba1
JK
190 spinlock_t txq_spinlock;
191
192 struct mutex rxq_cs;
193 struct mutex hif_cs;
194
c5c77ba1
JK
195 struct semaphore rxq_event;
196 struct semaphore cfg_event;
197 struct semaphore sync_event;
c5c77ba1 198 struct semaphore txq_event;
c5c77ba1
JK
199
200#if (RX_BH_TYPE == RX_BH_WORK_QUEUE)
201 struct work_struct rx_work_queue;
202#elif (RX_BH_TYPE == RX_BH_KTHREAD)
203 struct task_struct *rx_bh_thread;
204 struct semaphore rx_sem;
205#endif
c5c77ba1
JK
206 struct semaphore rxq_thread_started;
207 struct semaphore txq_thread_started;
208
209 struct task_struct *rxq_thread;
210 struct task_struct *txq_thread;
211
212 unsigned char eth_src_address[NUM_CONCURRENT_IFC][6];
213 /* unsigned char eth_dst_address[6]; */
214
215 const struct firmware *wilc_firmware; /* Bug 4703 */
216
217 struct net_device *real_ndev;
218#ifdef WILC_SDIO
219 int already_claim;
220 struct sdio_func *wilc_sdio_func;
221#else
222 struct spi_device *wilc_spidev;
223#endif
224
225} linux_wlan_t;
226
227typedef struct {
51e825f7 228 u8 u8IfIdx;
63d03e47 229 u8 iftype;
c5c77ba1
JK
230 int monitor_flag;
231 int mac_opened;
232 #ifdef WILC_P2P
233 struct_frame_reg g_struct_frame_reg[num_reg_frame];
234 #endif
235 struct net_device *wilc_netdev;
236 struct net_device_stats netstats;
237
238} perInterface_wlan_t;
239
240struct WILC_WFI_mon_priv {
241 struct net_device *real_ndev;
242};
1d1c5b24 243
c5c77ba1
JK
244extern struct net_device *WILC_WFI_devs[];
245
246#endif
This page took 0.132796 seconds and 5 git commands to generate.