1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54 #ifndef _LINUX_P80211NETDEV_H
55 #define _LINUX_P80211NETDEV_H
56
57 #include <linux/interrupt.h>
58 #include <linux/wireless.h>
59 #include <linux/netdevice.h>
60
61 #define WLAN_RELEASE "0.3.0-staging"
62
63 #define WLAN_DEVICE_CLOSED 0
64 #define WLAN_DEVICE_OPEN 1
65
66 #define WLAN_MACMODE_NONE 0
67 #define WLAN_MACMODE_IBSS_STA 1
68 #define WLAN_MACMODE_ESS_STA 2
69 #define WLAN_MACMODE_ESS_AP 3
70
71
72 #define WLAN_MSD_HWPRESENT_PENDING 1
73 #define WLAN_MSD_HWFAIL 2
74 #define WLAN_MSD_HWPRESENT 3
75 #define WLAN_MSD_FWLOAD_PENDING 4
76 #define WLAN_MSD_FWLOAD 5
77 #define WLAN_MSD_RUNNING_PENDING 6
78 #define WLAN_MSD_RUNNING 7
79
80 #ifndef ETH_P_ECONET
81 #define ETH_P_ECONET 0x0018
82 #endif
83
84 #define ETH_P_80211_RAW (ETH_P_ECONET + 1)
85
86 #ifndef ARPHRD_IEEE80211
87 #define ARPHRD_IEEE80211 801
88 #endif
89
90 #ifndef ARPHRD_IEEE80211_PRISM
91 #define ARPHRD_IEEE80211_PRISM 802
92 #endif
93
94
95 #define P80211_NSDCAP_HARDWAREWEP 0x01
96 #define P80211_NSDCAP_SHORT_PREAMBLE 0x10
97 #define P80211_NSDCAP_HWFRAGMENT 0x80
98 #define P80211_NSDCAP_AUTOJOIN 0x100
99 #define P80211_NSDCAP_NOSCAN 0x200
100
101
102 struct p80211_frmrx {
103 u32 mgmt;
104 u32 assocreq;
105 u32 assocresp;
106 u32 reassocreq;
107 u32 reassocresp;
108 u32 probereq;
109 u32 proberesp;
110 u32 beacon;
111 u32 atim;
112 u32 disassoc;
113 u32 authen;
114 u32 deauthen;
115 u32 mgmt_unknown;
116 u32 ctl;
117 u32 pspoll;
118 u32 rts;
119 u32 cts;
120 u32 ack;
121 u32 cfend;
122 u32 cfendcfack;
123 u32 ctl_unknown;
124 u32 data;
125 u32 dataonly;
126 u32 data_cfack;
127 u32 data_cfpoll;
128 u32 data__cfack_cfpoll;
129 u32 null;
130 u32 cfack;
131 u32 cfpoll;
132 u32 cfack_cfpoll;
133 u32 data_unknown;
134 u32 decrypt;
135 u32 decrypt_err;
136 };
137
138
139 struct iw_statistics *p80211wext_get_wireless_stats(struct net_device *dev);
140
141 extern struct iw_handler_def p80211wext_handler_def;
142
143
144 #define NUM_WEPKEYS 4
145 #define MAX_KEYLEN 32
146
147 #define HOSTWEP_DEFAULTKEY_MASK GENMASK(1, 0)
148 #define HOSTWEP_SHAREDKEY BIT(3)
149 #define HOSTWEP_DECRYPT BIT(4)
150 #define HOSTWEP_ENCRYPT BIT(5)
151 #define HOSTWEP_PRIVACYINVOKED BIT(6)
152 #define HOSTWEP_EXCLUDEUNENCRYPTED BIT(7)
153
154 extern int wlan_watchdog;
155 extern int wlan_wext_write;
156
157
158 struct wlandevice {
159 void *priv;
160
161
162 char name[WLAN_DEVNAMELEN_MAX];
163 char *nsdname;
164
165 u32 state;
166 u32 msdstate;
167 u32 hwremoved;
168
169
170 unsigned int irq;
171 unsigned int iobase;
172 unsigned int membase;
173 u32 nsdcaps;
174
175
176 unsigned int ethconv;
177
178
179 int (*open)(struct wlandevice *wlandev);
180 int (*close)(struct wlandevice *wlandev);
181 void (*reset)(struct wlandevice *wlandev);
182 int (*txframe)(struct wlandevice *wlandev, struct sk_buff *skb,
183 union p80211_hdr *p80211_hdr,
184 struct p80211_metawep *p80211_wep);
185 int (*mlmerequest)(struct wlandevice *wlandev, struct p80211msg *msg);
186 int (*set_multicast_list)(struct wlandevice *wlandev,
187 struct net_device *dev);
188 void (*tx_timeout)(struct wlandevice *wlandev);
189
190
191 u8 bssid[WLAN_BSSID_LEN];
192 struct p80211pstr32 ssid;
193 u32 macmode;
194 int linkstatus;
195
196
197 u8 wep_keys[NUM_WEPKEYS][MAX_KEYLEN];
198 u8 wep_keylens[NUM_WEPKEYS];
199 int hostwep;
200
201
202 unsigned long request_pending;
203
204
205
206
207 struct net_device *netdev;
208
209
210 struct tasklet_struct rx_bh;
211
212 struct sk_buff_head nsd_rxq;
213
214
215 struct p80211_frmrx rx;
216
217 struct iw_statistics wstats;
218
219
220 u8 spy_number;
221 char spy_address[IW_MAX_SPY][ETH_ALEN];
222 struct iw_quality spy_stat[IW_MAX_SPY];
223 };
224
225
226 int wep_change_key(struct wlandevice *wlandev, int keynum, u8 *key, int keylen);
227 int wep_decrypt(struct wlandevice *wlandev, u8 *buf, u32 len, int key_override,
228 u8 *iv, u8 *icv);
229 int wep_encrypt(struct wlandevice *wlandev, u8 *buf, u8 *dst, u32 len,
230 int keynum, u8 *iv, u8 *icv);
231
232 int wlan_setup(struct wlandevice *wlandev, struct device *physdev);
233 void wlan_unsetup(struct wlandevice *wlandev);
234 int register_wlandev(struct wlandevice *wlandev);
235 int unregister_wlandev(struct wlandevice *wlandev);
236 void p80211netdev_rx(struct wlandevice *wlandev, struct sk_buff *skb);
237 void p80211netdev_hwremoved(struct wlandevice *wlandev);
238 #endif