aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2x00/libipw_rx.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2009-08-20 14:48:03 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-28 14:40:28 -0400
commitb0a4e7d8a291de63f35b04464de9ab4a83d38a7c (patch)
treec95a79b15483070bf1ca92ddf7b7e9ba4d4af026 /drivers/net/wireless/ipw2x00/libipw_rx.c
parent01a0ac417ce9b4f1216a266f2fd454cffefc5aee (diff)
libipw: switch from ieee80211_* to libipw_* naming policy
This eliminates the dual definition of ieee80211_channel (and possibly others), further clarifying who defines what and paving the way for inclusion of cfg80211.h. Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ipw2x00/libipw_rx.c')
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_rx.c403
1 files changed, 202 insertions, 201 deletions
diff --git a/drivers/net/wireless/ipw2x00/libipw_rx.c b/drivers/net/wireless/ipw2x00/libipw_rx.c
index dae4b8e4d8e9..282b1f7ff1e9 100644
--- a/drivers/net/wireless/ipw2x00/libipw_rx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_rx.c
@@ -34,18 +34,18 @@
34 34
35#include <net/lib80211.h> 35#include <net/lib80211.h>
36 36
37#include "ieee80211.h" 37#include "libipw.h"
38 38
39static void ieee80211_monitor_rx(struct ieee80211_device *ieee, 39static void libipw_monitor_rx(struct libipw_device *ieee,
40 struct sk_buff *skb, 40 struct sk_buff *skb,
41 struct ieee80211_rx_stats *rx_stats) 41 struct libipw_rx_stats *rx_stats)
42{ 42{
43 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 43 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
44 u16 fc = le16_to_cpu(hdr->frame_control); 44 u16 fc = le16_to_cpu(hdr->frame_control);
45 45
46 skb->dev = ieee->dev; 46 skb->dev = ieee->dev;
47 skb_reset_mac_header(skb); 47 skb_reset_mac_header(skb);
48 skb_pull(skb, ieee80211_get_hdrlen(fc)); 48 skb_pull(skb, libipw_get_hdrlen(fc));
49 skb->pkt_type = PACKET_OTHERHOST; 49 skb->pkt_type = PACKET_OTHERHOST;
50 skb->protocol = htons(ETH_P_80211_RAW); 50 skb->protocol = htons(ETH_P_80211_RAW);
51 memset(skb->cb, 0, sizeof(skb->cb)); 51 memset(skb->cb, 0, sizeof(skb->cb));
@@ -53,22 +53,22 @@ static void ieee80211_monitor_rx(struct ieee80211_device *ieee,
53} 53}
54 54
55/* Called only as a tasklet (software IRQ) */ 55/* Called only as a tasklet (software IRQ) */
56static struct ieee80211_frag_entry *ieee80211_frag_cache_find(struct 56static struct libipw_frag_entry *libipw_frag_cache_find(struct
57 ieee80211_device 57 libipw_device
58 *ieee, 58 *ieee,
59 unsigned int seq, 59 unsigned int seq,
60 unsigned int frag, 60 unsigned int frag,
61 u8 * src, 61 u8 * src,
62 u8 * dst) 62 u8 * dst)
63{ 63{
64 struct ieee80211_frag_entry *entry; 64 struct libipw_frag_entry *entry;
65 int i; 65 int i;
66 66
67 for (i = 0; i < IEEE80211_FRAG_CACHE_LEN; i++) { 67 for (i = 0; i < LIBIPW_FRAG_CACHE_LEN; i++) {
68 entry = &ieee->frag_cache[i]; 68 entry = &ieee->frag_cache[i];
69 if (entry->skb != NULL && 69 if (entry->skb != NULL &&
70 time_after(jiffies, entry->first_frag_time + 2 * HZ)) { 70 time_after(jiffies, entry->first_frag_time + 2 * HZ)) {
71 IEEE80211_DEBUG_FRAG("expiring fragment cache entry " 71 LIBIPW_DEBUG_FRAG("expiring fragment cache entry "
72 "seq=%u last_frag=%u\n", 72 "seq=%u last_frag=%u\n",
73 entry->seq, entry->last_frag); 73 entry->seq, entry->last_frag);
74 dev_kfree_skb_any(entry->skb); 74 dev_kfree_skb_any(entry->skb);
@@ -86,13 +86,13 @@ static struct ieee80211_frag_entry *ieee80211_frag_cache_find(struct
86} 86}
87 87
88/* Called only as a tasklet (software IRQ) */ 88/* Called only as a tasklet (software IRQ) */
89static struct sk_buff *ieee80211_frag_cache_get(struct ieee80211_device *ieee, 89static struct sk_buff *libipw_frag_cache_get(struct libipw_device *ieee,
90 struct ieee80211_hdr_4addr *hdr) 90 struct libipw_hdr_4addr *hdr)
91{ 91{
92 struct sk_buff *skb = NULL; 92 struct sk_buff *skb = NULL;
93 u16 sc; 93 u16 sc;
94 unsigned int frag, seq; 94 unsigned int frag, seq;
95 struct ieee80211_frag_entry *entry; 95 struct libipw_frag_entry *entry;
96 96
97 sc = le16_to_cpu(hdr->seq_ctl); 97 sc = le16_to_cpu(hdr->seq_ctl);
98 frag = WLAN_GET_SEQ_FRAG(sc); 98 frag = WLAN_GET_SEQ_FRAG(sc);
@@ -101,7 +101,7 @@ static struct sk_buff *ieee80211_frag_cache_get(struct ieee80211_device *ieee,
101 if (frag == 0) { 101 if (frag == 0) {
102 /* Reserve enough space to fit maximum frame length */ 102 /* Reserve enough space to fit maximum frame length */
103 skb = dev_alloc_skb(ieee->dev->mtu + 103 skb = dev_alloc_skb(ieee->dev->mtu +
104 sizeof(struct ieee80211_hdr_4addr) + 104 sizeof(struct libipw_hdr_4addr) +
105 8 /* LLC */ + 105 8 /* LLC */ +
106 2 /* alignment */ + 106 2 /* alignment */ +
107 8 /* WEP */ + ETH_ALEN /* WDS */ ); 107 8 /* WEP */ + ETH_ALEN /* WDS */ );
@@ -110,7 +110,7 @@ static struct sk_buff *ieee80211_frag_cache_get(struct ieee80211_device *ieee,
110 110
111 entry = &ieee->frag_cache[ieee->frag_next_idx]; 111 entry = &ieee->frag_cache[ieee->frag_next_idx];
112 ieee->frag_next_idx++; 112 ieee->frag_next_idx++;
113 if (ieee->frag_next_idx >= IEEE80211_FRAG_CACHE_LEN) 113 if (ieee->frag_next_idx >= LIBIPW_FRAG_CACHE_LEN)
114 ieee->frag_next_idx = 0; 114 ieee->frag_next_idx = 0;
115 115
116 if (entry->skb != NULL) 116 if (entry->skb != NULL)
@@ -125,7 +125,7 @@ static struct sk_buff *ieee80211_frag_cache_get(struct ieee80211_device *ieee,
125 } else { 125 } else {
126 /* received a fragment of a frame for which the head fragment 126 /* received a fragment of a frame for which the head fragment
127 * should have already been received */ 127 * should have already been received */
128 entry = ieee80211_frag_cache_find(ieee, seq, frag, hdr->addr2, 128 entry = libipw_frag_cache_find(ieee, seq, frag, hdr->addr2,
129 hdr->addr1); 129 hdr->addr1);
130 if (entry != NULL) { 130 if (entry != NULL) {
131 entry->last_frag = frag; 131 entry->last_frag = frag;
@@ -137,21 +137,21 @@ static struct sk_buff *ieee80211_frag_cache_get(struct ieee80211_device *ieee,
137} 137}
138 138
139/* Called only as a tasklet (software IRQ) */ 139/* Called only as a tasklet (software IRQ) */
140static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee, 140static int libipw_frag_cache_invalidate(struct libipw_device *ieee,
141 struct ieee80211_hdr_4addr *hdr) 141 struct libipw_hdr_4addr *hdr)
142{ 142{
143 u16 sc; 143 u16 sc;
144 unsigned int seq; 144 unsigned int seq;
145 struct ieee80211_frag_entry *entry; 145 struct libipw_frag_entry *entry;
146 146
147 sc = le16_to_cpu(hdr->seq_ctl); 147 sc = le16_to_cpu(hdr->seq_ctl);
148 seq = WLAN_GET_SEQ_SEQ(sc); 148 seq = WLAN_GET_SEQ_SEQ(sc);
149 149
150 entry = ieee80211_frag_cache_find(ieee, seq, -1, hdr->addr2, 150 entry = libipw_frag_cache_find(ieee, seq, -1, hdr->addr2,
151 hdr->addr1); 151 hdr->addr1);
152 152
153 if (entry == NULL) { 153 if (entry == NULL) {
154 IEEE80211_DEBUG_FRAG("could not invalidate fragment cache " 154 LIBIPW_DEBUG_FRAG("could not invalidate fragment cache "
155 "entry (seq=%u)\n", seq); 155 "entry (seq=%u)\n", seq);
156 return -1; 156 return -1;
157 } 157 }
@@ -161,14 +161,14 @@ static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee,
161} 161}
162 162
163#ifdef NOT_YET 163#ifdef NOT_YET
164/* ieee80211_rx_frame_mgtmt 164/* libipw_rx_frame_mgtmt
165 * 165 *
166 * Responsible for handling management control frames 166 * Responsible for handling management control frames
167 * 167 *
168 * Called by ieee80211_rx */ 168 * Called by libipw_rx */
169static int 169static int
170ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb, 170libipw_rx_frame_mgmt(struct libipw_device *ieee, struct sk_buff *skb,
171 struct ieee80211_rx_stats *rx_stats, u16 type, 171 struct libipw_rx_stats *rx_stats, u16 type,
172 u16 stype) 172 u16 stype)
173{ 173{
174 if (ieee->iw_mode == IW_MODE_MASTER) { 174 if (ieee->iw_mode == IW_MODE_MASTER) {
@@ -176,7 +176,7 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb,
176 ieee->dev->name); 176 ieee->dev->name);
177 return 0; 177 return 0;
178/* 178/*
179 hostap_update_sta_ps(ieee, (struct hostap_ieee80211_hdr_4addr *) 179 hostap_update_sta_ps(ieee, (struct hostap_libipw_hdr_4addr *)
180 skb->data);*/ 180 skb->data);*/
181 } 181 }
182 182
@@ -219,26 +219,27 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb,
219 219
220/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */ 220/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */
221/* Ethernet-II snap header (RFC1042 for most EtherTypes) */ 221/* Ethernet-II snap header (RFC1042 for most EtherTypes) */
222static unsigned char rfc1042_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; 222static unsigned char libipw_rfc1042_header[] =
223 { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
223 224
224/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */ 225/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
225static unsigned char bridge_tunnel_header[] = 226static unsigned char libipw_bridge_tunnel_header[] =
226 { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; 227 { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
227/* No encapsulation header if EtherType < 0x600 (=length) */ 228/* No encapsulation header if EtherType < 0x600 (=length) */
228 229
229/* Called by ieee80211_rx_frame_decrypt */ 230/* Called by libipw_rx_frame_decrypt */
230static int ieee80211_is_eapol_frame(struct ieee80211_device *ieee, 231static int libipw_is_eapol_frame(struct libipw_device *ieee,
231 struct sk_buff *skb) 232 struct sk_buff *skb)
232{ 233{
233 struct net_device *dev = ieee->dev; 234 struct net_device *dev = ieee->dev;
234 u16 fc, ethertype; 235 u16 fc, ethertype;
235 struct ieee80211_hdr_3addr *hdr; 236 struct libipw_hdr_3addr *hdr;
236 u8 *pos; 237 u8 *pos;
237 238
238 if (skb->len < 24) 239 if (skb->len < 24)
239 return 0; 240 return 0;
240 241
241 hdr = (struct ieee80211_hdr_3addr *)skb->data; 242 hdr = (struct libipw_hdr_3addr *)skb->data;
242 fc = le16_to_cpu(hdr->frame_ctl); 243 fc = le16_to_cpu(hdr->frame_ctl);
243 244
244 /* check that the frame is unicast frame to us */ 245 /* check that the frame is unicast frame to us */
@@ -266,28 +267,28 @@ static int ieee80211_is_eapol_frame(struct ieee80211_device *ieee,
266 return 0; 267 return 0;
267} 268}
268 269
269/* Called only as a tasklet (software IRQ), by ieee80211_rx */ 270/* Called only as a tasklet (software IRQ), by libipw_rx */
270static int 271static int
271ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb, 272libipw_rx_frame_decrypt(struct libipw_device *ieee, struct sk_buff *skb,
272 struct lib80211_crypt_data *crypt) 273 struct lib80211_crypt_data *crypt)
273{ 274{
274 struct ieee80211_hdr_3addr *hdr; 275 struct libipw_hdr_3addr *hdr;
275 int res, hdrlen; 276 int res, hdrlen;
276 277
277 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) 278 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL)
278 return 0; 279 return 0;
279 280
280 hdr = (struct ieee80211_hdr_3addr *)skb->data; 281 hdr = (struct libipw_hdr_3addr *)skb->data;
281 hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 282 hdrlen = libipw_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
282 283
283 atomic_inc(&crypt->refcnt); 284 atomic_inc(&crypt->refcnt);
284 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); 285 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv);
285 atomic_dec(&crypt->refcnt); 286 atomic_dec(&crypt->refcnt);
286 if (res < 0) { 287 if (res < 0) {
287 IEEE80211_DEBUG_DROP("decryption failed (SA=%pM) res=%d\n", 288 LIBIPW_DEBUG_DROP("decryption failed (SA=%pM) res=%d\n",
288 hdr->addr2, res); 289 hdr->addr2, res);
289 if (res == -2) 290 if (res == -2)
290 IEEE80211_DEBUG_DROP("Decryption failed ICV " 291 LIBIPW_DEBUG_DROP("Decryption failed ICV "
291 "mismatch (key %d)\n", 292 "mismatch (key %d)\n",
292 skb->data[hdrlen + 3] >> 6); 293 skb->data[hdrlen + 3] >> 6);
293 ieee->ieee_stats.rx_discards_undecryptable++; 294 ieee->ieee_stats.rx_discards_undecryptable++;
@@ -297,20 +298,20 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb,
297 return res; 298 return res;
298} 299}
299 300
300/* Called only as a tasklet (software IRQ), by ieee80211_rx */ 301/* Called only as a tasklet (software IRQ), by libipw_rx */
301static int 302static int
302ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee, 303libipw_rx_frame_decrypt_msdu(struct libipw_device *ieee,
303 struct sk_buff *skb, int keyidx, 304 struct sk_buff *skb, int keyidx,
304 struct lib80211_crypt_data *crypt) 305 struct lib80211_crypt_data *crypt)
305{ 306{
306 struct ieee80211_hdr_3addr *hdr; 307 struct libipw_hdr_3addr *hdr;
307 int res, hdrlen; 308 int res, hdrlen;
308 309
309 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL) 310 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL)
310 return 0; 311 return 0;
311 312
312 hdr = (struct ieee80211_hdr_3addr *)skb->data; 313 hdr = (struct libipw_hdr_3addr *)skb->data;
313 hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 314 hdrlen = libipw_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
314 315
315 atomic_inc(&crypt->refcnt); 316 atomic_inc(&crypt->refcnt);
316 res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv); 317 res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv);
@@ -328,11 +329,11 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee,
328/* All received frames are sent to this function. @skb contains the frame in 329/* All received frames are sent to this function. @skb contains the frame in
329 * IEEE 802.11 format, i.e., in the format it was sent over air. 330 * IEEE 802.11 format, i.e., in the format it was sent over air.
330 * This function is called only as a tasklet (software IRQ). */ 331 * This function is called only as a tasklet (software IRQ). */
331int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, 332int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
332 struct ieee80211_rx_stats *rx_stats) 333 struct libipw_rx_stats *rx_stats)
333{ 334{
334 struct net_device *dev = ieee->dev; 335 struct net_device *dev = ieee->dev;
335 struct ieee80211_hdr_4addr *hdr; 336 struct libipw_hdr_4addr *hdr;
336 size_t hdrlen; 337 size_t hdrlen;
337 u16 fc, type, stype, sc; 338 u16 fc, type, stype, sc;
338 unsigned int frag; 339 unsigned int frag;
@@ -352,7 +353,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
352 int keyidx = 0; 353 int keyidx = 0;
353 int can_be_decrypted = 0; 354 int can_be_decrypted = 0;
354 355
355 hdr = (struct ieee80211_hdr_4addr *)skb->data; 356 hdr = (struct libipw_hdr_4addr *)skb->data;
356 if (skb->len < 10) { 357 if (skb->len < 10) {
357 printk(KERN_INFO "%s: SKB length < 10\n", dev->name); 358 printk(KERN_INFO "%s: SKB length < 10\n", dev->name);
358 goto rx_dropped; 359 goto rx_dropped;
@@ -363,7 +364,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
363 stype = WLAN_FC_GET_STYPE(fc); 364 stype = WLAN_FC_GET_STYPE(fc);
364 sc = le16_to_cpu(hdr->seq_ctl); 365 sc = le16_to_cpu(hdr->seq_ctl);
365 frag = WLAN_GET_SEQ_FRAG(sc); 366 frag = WLAN_GET_SEQ_FRAG(sc);
366 hdrlen = ieee80211_get_hdrlen(fc); 367 hdrlen = libipw_get_hdrlen(fc);
367 368
368 if (skb->len < hdrlen) { 369 if (skb->len < hdrlen) {
369 printk(KERN_INFO "%s: invalid SKB length %d\n", 370 printk(KERN_INFO "%s: invalid SKB length %d\n",
@@ -380,19 +381,19 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
380 struct iw_quality wstats; 381 struct iw_quality wstats;
381 382
382 wstats.updated = 0; 383 wstats.updated = 0;
383 if (rx_stats->mask & IEEE80211_STATMASK_RSSI) { 384 if (rx_stats->mask & LIBIPW_STATMASK_RSSI) {
384 wstats.level = rx_stats->signal; 385 wstats.level = rx_stats->signal;
385 wstats.updated |= IW_QUAL_LEVEL_UPDATED; 386 wstats.updated |= IW_QUAL_LEVEL_UPDATED;
386 } else 387 } else
387 wstats.updated |= IW_QUAL_LEVEL_INVALID; 388 wstats.updated |= IW_QUAL_LEVEL_INVALID;
388 389
389 if (rx_stats->mask & IEEE80211_STATMASK_NOISE) { 390 if (rx_stats->mask & LIBIPW_STATMASK_NOISE) {
390 wstats.noise = rx_stats->noise; 391 wstats.noise = rx_stats->noise;
391 wstats.updated |= IW_QUAL_NOISE_UPDATED; 392 wstats.updated |= IW_QUAL_NOISE_UPDATED;
392 } else 393 } else
393 wstats.updated |= IW_QUAL_NOISE_INVALID; 394 wstats.updated |= IW_QUAL_NOISE_INVALID;
394 395
395 if (rx_stats->mask & IEEE80211_STATMASK_SIGNAL) { 396 if (rx_stats->mask & LIBIPW_STATMASK_SIGNAL) {
396 wstats.qual = rx_stats->signal; 397 wstats.qual = rx_stats->signal;
397 wstats.updated |= IW_QUAL_QUAL_UPDATED; 398 wstats.updated |= IW_QUAL_QUAL_UPDATED;
398 } else 399 } else
@@ -411,7 +412,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
411 if (ieee->iw_mode == IW_MODE_MONITOR) { 412 if (ieee->iw_mode == IW_MODE_MONITOR) {
412 dev->stats.rx_packets++; 413 dev->stats.rx_packets++;
413 dev->stats.rx_bytes += skb->len; 414 dev->stats.rx_bytes += skb->len;
414 ieee80211_monitor_rx(ieee, skb, rx_stats); 415 libipw_monitor_rx(ieee, skb, rx_stats);
415 return 1; 416 return 1;
416 } 417 }
417 418
@@ -457,7 +458,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
457 * frames from other than current BSS, so just drop the 458 * frames from other than current BSS, so just drop the
458 * frames silently instead of filling system log with 459 * frames silently instead of filling system log with
459 * these reports. */ 460 * these reports. */
460 IEEE80211_DEBUG_DROP("Decryption failed (not set)" 461 LIBIPW_DEBUG_DROP("Decryption failed (not set)"
461 " (SA=%pM)\n", hdr->addr2); 462 " (SA=%pM)\n", hdr->addr2);
462 ieee->ieee_stats.rx_discards_undecryptable++; 463 ieee->ieee_stats.rx_discards_undecryptable++;
463 goto rx_dropped; 464 goto rx_dropped;
@@ -475,7 +476,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
475 goto rx_dropped; 476 goto rx_dropped;
476 } 477 }
477 478
478 if (ieee80211_rx_frame_mgmt(ieee, skb, rx_stats, type, stype)) 479 if (libipw_rx_frame_mgmt(ieee, skb, rx_stats, type, stype))
479 goto rx_dropped; 480 goto rx_dropped;
480 else 481 else
481 goto rx_exit; 482 goto rx_exit;
@@ -488,7 +489,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
488 ieee->prev_seq_ctl = sc; 489 ieee->prev_seq_ctl = sc;
489 490
490 /* Data frame - extract src/dst addresses */ 491 /* Data frame - extract src/dst addresses */
491 if (skb->len < IEEE80211_3ADDR_LEN) 492 if (skb->len < LIBIPW_3ADDR_LEN)
492 goto rx_dropped; 493 goto rx_dropped;
493 494
494 switch (fc & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) { 495 switch (fc & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) {
@@ -501,7 +502,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
501 memcpy(src, hdr->addr2, ETH_ALEN); 502 memcpy(src, hdr->addr2, ETH_ALEN);
502 break; 503 break;
503 case IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS: 504 case IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS:
504 if (skb->len < IEEE80211_4ADDR_LEN) 505 if (skb->len < LIBIPW_4ADDR_LEN)
505 goto rx_dropped; 506 goto rx_dropped;
506 memcpy(dst, hdr->addr3, ETH_ALEN); 507 memcpy(dst, hdr->addr3, ETH_ALEN);
507 memcpy(src, hdr->addr4, ETH_ALEN); 508 memcpy(src, hdr->addr4, ETH_ALEN);
@@ -560,7 +561,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
560 stype != IEEE80211_STYPE_DATA_CFPOLL && 561 stype != IEEE80211_STYPE_DATA_CFPOLL &&
561 stype != IEEE80211_STYPE_DATA_CFACKPOLL) { 562 stype != IEEE80211_STYPE_DATA_CFACKPOLL) {
562 if (stype != IEEE80211_STYPE_NULLFUNC) 563 if (stype != IEEE80211_STYPE_NULLFUNC)
563 IEEE80211_DEBUG_DROP("RX: dropped data frame " 564 LIBIPW_DEBUG_DROP("RX: dropped data frame "
564 "with no data (type=0x%02x, " 565 "with no data (type=0x%02x, "
565 "subtype=0x%02x, len=%d)\n", 566 "subtype=0x%02x, len=%d)\n",
566 type, stype, skb->len); 567 type, stype, skb->len);
@@ -570,21 +571,21 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
570 /* skb: hdr + (possibly fragmented, possibly encrypted) payload */ 571 /* skb: hdr + (possibly fragmented, possibly encrypted) payload */
571 572
572 if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted && 573 if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted &&
573 (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) 574 (keyidx = libipw_rx_frame_decrypt(ieee, skb, crypt)) < 0)
574 goto rx_dropped; 575 goto rx_dropped;
575 576
576 hdr = (struct ieee80211_hdr_4addr *)skb->data; 577 hdr = (struct libipw_hdr_4addr *)skb->data;
577 578
578 /* skb: hdr + (possibly fragmented) plaintext payload */ 579 /* skb: hdr + (possibly fragmented) plaintext payload */
579 // PR: FIXME: hostap has additional conditions in the "if" below: 580 // PR: FIXME: hostap has additional conditions in the "if" below:
580 // ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) && 581 // ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) &&
581 if ((frag != 0) || (fc & IEEE80211_FCTL_MOREFRAGS)) { 582 if ((frag != 0) || (fc & IEEE80211_FCTL_MOREFRAGS)) {
582 int flen; 583 int flen;
583 struct sk_buff *frag_skb = ieee80211_frag_cache_get(ieee, hdr); 584 struct sk_buff *frag_skb = libipw_frag_cache_get(ieee, hdr);
584 IEEE80211_DEBUG_FRAG("Rx Fragment received (%u)\n", frag); 585 LIBIPW_DEBUG_FRAG("Rx Fragment received (%u)\n", frag);
585 586
586 if (!frag_skb) { 587 if (!frag_skb) {
587 IEEE80211_DEBUG(IEEE80211_DL_RX | IEEE80211_DL_FRAG, 588 LIBIPW_DEBUG(LIBIPW_DL_RX | LIBIPW_DL_FRAG,
588 "Rx cannot get skb from fragment " 589 "Rx cannot get skb from fragment "
589 "cache (morefrag=%d seq=%u frag=%u)\n", 590 "cache (morefrag=%d seq=%u frag=%u)\n",
590 (fc & IEEE80211_FCTL_MOREFRAGS) != 0, 591 (fc & IEEE80211_FCTL_MOREFRAGS) != 0,
@@ -600,7 +601,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
600 printk(KERN_WARNING "%s: host decrypted and " 601 printk(KERN_WARNING "%s: host decrypted and "
601 "reassembled frame did not fit skb\n", 602 "reassembled frame did not fit skb\n",
602 dev->name); 603 dev->name);
603 ieee80211_frag_cache_invalidate(ieee, hdr); 604 libipw_frag_cache_invalidate(ieee, hdr);
604 goto rx_dropped; 605 goto rx_dropped;
605 } 606 }
606 607
@@ -627,24 +628,24 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
627 /* this was the last fragment and the frame will be 628 /* this was the last fragment and the frame will be
628 * delivered, so remove skb from fragment cache */ 629 * delivered, so remove skb from fragment cache */
629 skb = frag_skb; 630 skb = frag_skb;
630 hdr = (struct ieee80211_hdr_4addr *)skb->data; 631 hdr = (struct libipw_hdr_4addr *)skb->data;
631 ieee80211_frag_cache_invalidate(ieee, hdr); 632 libipw_frag_cache_invalidate(ieee, hdr);
632 } 633 }
633 634
634 /* skb: hdr + (possible reassembled) full MSDU payload; possibly still 635 /* skb: hdr + (possible reassembled) full MSDU payload; possibly still
635 * encrypted/authenticated */ 636 * encrypted/authenticated */
636 if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted && 637 if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted &&
637 ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) 638 libipw_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt))
638 goto rx_dropped; 639 goto rx_dropped;
639 640
640 hdr = (struct ieee80211_hdr_4addr *)skb->data; 641 hdr = (struct libipw_hdr_4addr *)skb->data;
641 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep) { 642 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep) {
642 if ( /*ieee->ieee802_1x && */ 643 if ( /*ieee->ieee802_1x && */
643 ieee80211_is_eapol_frame(ieee, skb)) { 644 libipw_is_eapol_frame(ieee, skb)) {
644 /* pass unencrypted EAPOL frames even if encryption is 645 /* pass unencrypted EAPOL frames even if encryption is
645 * configured */ 646 * configured */
646 } else { 647 } else {
647 IEEE80211_DEBUG_DROP("encryption configured, but RX " 648 LIBIPW_DEBUG_DROP("encryption configured, but RX "
648 "frame not encrypted (SA=%pM)\n", 649 "frame not encrypted (SA=%pM)\n",
649 hdr->addr2); 650 hdr->addr2);
650 goto rx_dropped; 651 goto rx_dropped;
@@ -652,8 +653,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
652 } 653 }
653 654
654 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep && 655 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep &&
655 !ieee80211_is_eapol_frame(ieee, skb)) { 656 !libipw_is_eapol_frame(ieee, skb)) {
656 IEEE80211_DEBUG_DROP("dropped unencrypted RX data " 657 LIBIPW_DEBUG_DROP("dropped unencrypted RX data "
657 "frame from %pM (drop_unencrypted=1)\n", 658 "frame from %pM (drop_unencrypted=1)\n",
658 hdr->addr2); 659 hdr->addr2);
659 goto rx_dropped; 660 goto rx_dropped;
@@ -736,9 +737,9 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
736 737
737 /* convert hdr + possible LLC headers into Ethernet header */ 738 /* convert hdr + possible LLC headers into Ethernet header */
738 if (skb->len - hdrlen >= 8 && 739 if (skb->len - hdrlen >= 8 &&
739 ((memcmp(payload, rfc1042_header, SNAP_SIZE) == 0 && 740 ((memcmp(payload, libipw_rfc1042_header, SNAP_SIZE) == 0 &&
740 ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) || 741 ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) ||
741 memcmp(payload, bridge_tunnel_header, SNAP_SIZE) == 0)) { 742 memcmp(payload, libipw_bridge_tunnel_header, SNAP_SIZE) == 0)) {
742 /* remove RFC1042 or Bridge-Tunnel encapsulation and 743 /* remove RFC1042 or Bridge-Tunnel encapsulation and
743 * replace EtherType */ 744 * replace EtherType */
744 skb_pull(skb, hdrlen + SNAP_SIZE); 745 skb_pull(skb, hdrlen + SNAP_SIZE);
@@ -807,7 +808,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
807 /* netif_rx always succeeds, but it might drop 808 /* netif_rx always succeeds, but it might drop
808 * the packet. If it drops the packet, we log that 809 * the packet. If it drops the packet, we log that
809 * in our stats. */ 810 * in our stats. */
810 IEEE80211_DEBUG_DROP 811 LIBIPW_DEBUG_DROP
811 ("RX: netif_rx dropped the packet\n"); 812 ("RX: netif_rx dropped the packet\n");
812 dev->stats.rx_dropped++; 813 dev->stats.rx_dropped++;
813 } 814 }
@@ -829,18 +830,18 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
829 return 0; 830 return 0;
830} 831}
831 832
832/* Filter out unrelated packets, call ieee80211_rx[_mgt] 833/* Filter out unrelated packets, call libipw_rx[_mgt]
833 * This function takes over the skb, it should not be used again after calling 834 * This function takes over the skb, it should not be used again after calling
834 * this function. */ 835 * this function. */
835void ieee80211_rx_any(struct ieee80211_device *ieee, 836void libipw_rx_any(struct libipw_device *ieee,
836 struct sk_buff *skb, struct ieee80211_rx_stats *stats) 837 struct sk_buff *skb, struct libipw_rx_stats *stats)
837{ 838{
838 struct ieee80211_hdr_4addr *hdr; 839 struct libipw_hdr_4addr *hdr;
839 int is_packet_for_us; 840 int is_packet_for_us;
840 u16 fc; 841 u16 fc;
841 842
842 if (ieee->iw_mode == IW_MODE_MONITOR) { 843 if (ieee->iw_mode == IW_MODE_MONITOR) {
843 if (!ieee80211_rx(ieee, skb, stats)) 844 if (!libipw_rx(ieee, skb, stats))
844 dev_kfree_skb_irq(skb); 845 dev_kfree_skb_irq(skb);
845 return; 846 return;
846 } 847 }
@@ -848,7 +849,7 @@ void ieee80211_rx_any(struct ieee80211_device *ieee,
848 if (skb->len < sizeof(struct ieee80211_hdr)) 849 if (skb->len < sizeof(struct ieee80211_hdr))
849 goto drop_free; 850 goto drop_free;
850 851
851 hdr = (struct ieee80211_hdr_4addr *)skb->data; 852 hdr = (struct libipw_hdr_4addr *)skb->data;
852 fc = le16_to_cpu(hdr->frame_ctl); 853 fc = le16_to_cpu(hdr->frame_ctl);
853 854
854 if ((fc & IEEE80211_FCTL_VERS) != 0) 855 if ((fc & IEEE80211_FCTL_VERS) != 0)
@@ -856,9 +857,9 @@ void ieee80211_rx_any(struct ieee80211_device *ieee,
856 857
857 switch (fc & IEEE80211_FCTL_FTYPE) { 858 switch (fc & IEEE80211_FCTL_FTYPE) {
858 case IEEE80211_FTYPE_MGMT: 859 case IEEE80211_FTYPE_MGMT:
859 if (skb->len < sizeof(struct ieee80211_hdr_3addr)) 860 if (skb->len < sizeof(struct libipw_hdr_3addr))
860 goto drop_free; 861 goto drop_free;
861 ieee80211_rx_mgt(ieee, hdr, stats); 862 libipw_rx_mgt(ieee, hdr, stats);
862 dev_kfree_skb_irq(skb); 863 dev_kfree_skb_irq(skb);
863 return; 864 return;
864 case IEEE80211_FTYPE_DATA: 865 case IEEE80211_FTYPE_DATA:
@@ -910,7 +911,7 @@ void ieee80211_rx_any(struct ieee80211_device *ieee,
910 } 911 }
911 912
912 if (is_packet_for_us) 913 if (is_packet_for_us)
913 if (!ieee80211_rx(ieee, skb, stats)) 914 if (!libipw_rx(ieee, skb, stats))
914 dev_kfree_skb_irq(skb); 915 dev_kfree_skb_irq(skb);
915 return; 916 return;
916 917
@@ -928,7 +929,7 @@ static u8 qos_oui[QOS_OUI_LEN] = { 0x00, 0x50, 0xF2 };
928* Make ther structure we read from the beacon packet has 929* Make ther structure we read from the beacon packet has
929* the right values 930* the right values
930*/ 931*/
931static int ieee80211_verify_qos_info(struct ieee80211_qos_information_element 932static int libipw_verify_qos_info(struct libipw_qos_information_element
932 *info_element, int sub_type) 933 *info_element, int sub_type)
933{ 934{
934 935
@@ -947,12 +948,12 @@ static int ieee80211_verify_qos_info(struct ieee80211_qos_information_element
947/* 948/*
948 * Parse a QoS parameter element 949 * Parse a QoS parameter element
949 */ 950 */
950static int ieee80211_read_qos_param_element(struct ieee80211_qos_parameter_info 951static int libipw_read_qos_param_element(struct libipw_qos_parameter_info
951 *element_param, struct ieee80211_info_element 952 *element_param, struct libipw_info_element
952 *info_element) 953 *info_element)
953{ 954{
954 int ret = 0; 955 int ret = 0;
955 u16 size = sizeof(struct ieee80211_qos_parameter_info) - 2; 956 u16 size = sizeof(struct libipw_qos_parameter_info) - 2;
956 957
957 if ((info_element == NULL) || (element_param == NULL)) 958 if ((info_element == NULL) || (element_param == NULL))
958 return -1; 959 return -1;
@@ -965,7 +966,7 @@ static int ieee80211_read_qos_param_element(struct ieee80211_qos_parameter_info
965 } else 966 } else
966 ret = -1; 967 ret = -1;
967 if (ret == 0) 968 if (ret == 0)
968 ret = ieee80211_verify_qos_info(&element_param->info_element, 969 ret = libipw_verify_qos_info(&element_param->info_element,
969 QOS_OUI_PARAM_SUB_TYPE); 970 QOS_OUI_PARAM_SUB_TYPE);
970 return ret; 971 return ret;
971} 972}
@@ -973,13 +974,13 @@ static int ieee80211_read_qos_param_element(struct ieee80211_qos_parameter_info
973/* 974/*
974 * Parse a QoS information element 975 * Parse a QoS information element
975 */ 976 */
976static int ieee80211_read_qos_info_element(struct 977static int libipw_read_qos_info_element(struct
977 ieee80211_qos_information_element 978 libipw_qos_information_element
978 *element_info, struct ieee80211_info_element 979 *element_info, struct libipw_info_element
979 *info_element) 980 *info_element)
980{ 981{
981 int ret = 0; 982 int ret = 0;
982 u16 size = sizeof(struct ieee80211_qos_information_element) - 2; 983 u16 size = sizeof(struct libipw_qos_information_element) - 2;
983 984
984 if (element_info == NULL) 985 if (element_info == NULL)
985 return -1; 986 return -1;
@@ -995,7 +996,7 @@ static int ieee80211_read_qos_info_element(struct
995 ret = -1; 996 ret = -1;
996 997
997 if (ret == 0) 998 if (ret == 0)
998 ret = ieee80211_verify_qos_info(element_info, 999 ret = libipw_verify_qos_info(element_info,
999 QOS_OUI_INFO_SUB_TYPE); 1000 QOS_OUI_INFO_SUB_TYPE);
1000 return ret; 1001 return ret;
1001} 1002}
@@ -1003,15 +1004,15 @@ static int ieee80211_read_qos_info_element(struct
1003/* 1004/*
1004 * Write QoS parameters from the ac parameters. 1005 * Write QoS parameters from the ac parameters.
1005 */ 1006 */
1006static int ieee80211_qos_convert_ac_to_parameters(struct 1007static int libipw_qos_convert_ac_to_parameters(struct
1007 ieee80211_qos_parameter_info 1008 libipw_qos_parameter_info
1008 *param_elm, struct 1009 *param_elm, struct
1009 ieee80211_qos_parameters 1010 libipw_qos_parameters
1010 *qos_param) 1011 *qos_param)
1011{ 1012{
1012 int rc = 0; 1013 int rc = 0;
1013 int i; 1014 int i;
1014 struct ieee80211_qos_ac_parameter *ac_params; 1015 struct libipw_qos_ac_parameter *ac_params;
1015 u32 txop; 1016 u32 txop;
1016 u8 cw_min; 1017 u8 cw_min;
1017 u8 cw_max; 1018 u8 cw_max;
@@ -1042,27 +1043,27 @@ static int ieee80211_qos_convert_ac_to_parameters(struct
1042 * parameters element. check the information element length to decide 1043 * parameters element. check the information element length to decide
1043 * which type to read 1044 * which type to read
1044 */ 1045 */
1045static int ieee80211_parse_qos_info_param_IE(struct ieee80211_info_element 1046static int libipw_parse_qos_info_param_IE(struct libipw_info_element
1046 *info_element, 1047 *info_element,
1047 struct ieee80211_network *network) 1048 struct libipw_network *network)
1048{ 1049{
1049 int rc = 0; 1050 int rc = 0;
1050 struct ieee80211_qos_parameters *qos_param = NULL; 1051 struct libipw_qos_parameters *qos_param = NULL;
1051 struct ieee80211_qos_information_element qos_info_element; 1052 struct libipw_qos_information_element qos_info_element;
1052 1053
1053 rc = ieee80211_read_qos_info_element(&qos_info_element, info_element); 1054 rc = libipw_read_qos_info_element(&qos_info_element, info_element);
1054 1055
1055 if (rc == 0) { 1056 if (rc == 0) {
1056 network->qos_data.param_count = qos_info_element.ac_info & 0x0F; 1057 network->qos_data.param_count = qos_info_element.ac_info & 0x0F;
1057 network->flags |= NETWORK_HAS_QOS_INFORMATION; 1058 network->flags |= NETWORK_HAS_QOS_INFORMATION;
1058 } else { 1059 } else {
1059 struct ieee80211_qos_parameter_info param_element; 1060 struct libipw_qos_parameter_info param_element;
1060 1061
1061 rc = ieee80211_read_qos_param_element(&param_element, 1062 rc = libipw_read_qos_param_element(&param_element,
1062 info_element); 1063 info_element);
1063 if (rc == 0) { 1064 if (rc == 0) {
1064 qos_param = &(network->qos_data.parameters); 1065 qos_param = &(network->qos_data.parameters);
1065 ieee80211_qos_convert_ac_to_parameters(&param_element, 1066 libipw_qos_convert_ac_to_parameters(&param_element,
1066 qos_param); 1067 qos_param);
1067 network->flags |= NETWORK_HAS_QOS_PARAMETERS; 1068 network->flags |= NETWORK_HAS_QOS_PARAMETERS;
1068 network->qos_data.param_count = 1069 network->qos_data.param_count =
@@ -1071,7 +1072,7 @@ static int ieee80211_parse_qos_info_param_IE(struct ieee80211_info_element
1071 } 1072 }
1072 1073
1073 if (rc == 0) { 1074 if (rc == 0) {
1074 IEEE80211_DEBUG_QOS("QoS is supported\n"); 1075 LIBIPW_DEBUG_QOS("QoS is supported\n");
1075 network->qos_data.supported = 1; 1076 network->qos_data.supported = 1;
1076 } 1077 }
1077 return rc; 1078 return rc;
@@ -1116,9 +1117,9 @@ static const char *get_info_element_string(u16 id)
1116} 1117}
1117#endif 1118#endif
1118 1119
1119static int ieee80211_parse_info_param(struct ieee80211_info_element 1120static int libipw_parse_info_param(struct libipw_info_element
1120 *info_element, u16 length, 1121 *info_element, u16 length,
1121 struct ieee80211_network *network) 1122 struct libipw_network *network)
1122{ 1123{
1123 DECLARE_SSID_BUF(ssid); 1124 DECLARE_SSID_BUF(ssid);
1124 u8 i; 1125 u8 i;
@@ -1129,7 +1130,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1129 1130
1130 while (length >= sizeof(*info_element)) { 1131 while (length >= sizeof(*info_element)) {
1131 if (sizeof(*info_element) + info_element->len > length) { 1132 if (sizeof(*info_element) + info_element->len > length) {
1132 IEEE80211_DEBUG_MGMT("Info elem: parse failed: " 1133 LIBIPW_DEBUG_MGMT("Info elem: parse failed: "
1133 "info_element->len + 2 > left : " 1134 "info_element->len + 2 > left : "
1134 "info_element->len+2=%zd left=%d, id=%d.\n", 1135 "info_element->len+2=%zd left=%d, id=%d.\n",
1135 info_element->len + 1136 info_element->len +
@@ -1151,7 +1152,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1151 memset(network->ssid + network->ssid_len, 0, 1152 memset(network->ssid + network->ssid_len, 0,
1152 IW_ESSID_MAX_SIZE - network->ssid_len); 1153 IW_ESSID_MAX_SIZE - network->ssid_len);
1153 1154
1154 IEEE80211_DEBUG_MGMT("WLAN_EID_SSID: '%s' len=%d.\n", 1155 LIBIPW_DEBUG_MGMT("WLAN_EID_SSID: '%s' len=%d.\n",
1155 print_ssid(ssid, network->ssid, 1156 print_ssid(ssid, network->ssid,
1156 network->ssid_len), 1157 network->ssid_len),
1157 network->ssid_len); 1158 network->ssid_len);
@@ -1170,17 +1171,17 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1170 (p - rates_str), "%02X ", 1171 (p - rates_str), "%02X ",
1171 network->rates[i]); 1172 network->rates[i]);
1172#endif 1173#endif
1173 if (ieee80211_is_ofdm_rate 1174 if (libipw_is_ofdm_rate
1174 (info_element->data[i])) { 1175 (info_element->data[i])) {
1175 network->flags |= NETWORK_HAS_OFDM; 1176 network->flags |= NETWORK_HAS_OFDM;
1176 if (info_element->data[i] & 1177 if (info_element->data[i] &
1177 IEEE80211_BASIC_RATE_MASK) 1178 LIBIPW_BASIC_RATE_MASK)
1178 network->flags &= 1179 network->flags &=
1179 ~NETWORK_HAS_CCK; 1180 ~NETWORK_HAS_CCK;
1180 } 1181 }
1181 } 1182 }
1182 1183
1183 IEEE80211_DEBUG_MGMT("WLAN_EID_SUPP_RATES: '%s' (%d)\n", 1184 LIBIPW_DEBUG_MGMT("WLAN_EID_SUPP_RATES: '%s' (%d)\n",
1184 rates_str, network->rates_len); 1185 rates_str, network->rates_len);
1185 break; 1186 break;
1186 1187
@@ -1197,61 +1198,61 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1197 (p - rates_str), "%02X ", 1198 (p - rates_str), "%02X ",
1198 network->rates[i]); 1199 network->rates[i]);
1199#endif 1200#endif
1200 if (ieee80211_is_ofdm_rate 1201 if (libipw_is_ofdm_rate
1201 (info_element->data[i])) { 1202 (info_element->data[i])) {
1202 network->flags |= NETWORK_HAS_OFDM; 1203 network->flags |= NETWORK_HAS_OFDM;
1203 if (info_element->data[i] & 1204 if (info_element->data[i] &
1204 IEEE80211_BASIC_RATE_MASK) 1205 LIBIPW_BASIC_RATE_MASK)
1205 network->flags &= 1206 network->flags &=
1206 ~NETWORK_HAS_CCK; 1207 ~NETWORK_HAS_CCK;
1207 } 1208 }
1208 } 1209 }
1209 1210
1210 IEEE80211_DEBUG_MGMT("WLAN_EID_EXT_SUPP_RATES: '%s' (%d)\n", 1211 LIBIPW_DEBUG_MGMT("WLAN_EID_EXT_SUPP_RATES: '%s' (%d)\n",
1211 rates_str, network->rates_ex_len); 1212 rates_str, network->rates_ex_len);
1212 break; 1213 break;
1213 1214
1214 case WLAN_EID_DS_PARAMS: 1215 case WLAN_EID_DS_PARAMS:
1215 IEEE80211_DEBUG_MGMT("WLAN_EID_DS_PARAMS: %d\n", 1216 LIBIPW_DEBUG_MGMT("WLAN_EID_DS_PARAMS: %d\n",
1216 info_element->data[0]); 1217 info_element->data[0]);
1217 network->channel = info_element->data[0]; 1218 network->channel = info_element->data[0];
1218 break; 1219 break;
1219 1220
1220 case WLAN_EID_FH_PARAMS: 1221 case WLAN_EID_FH_PARAMS:
1221 IEEE80211_DEBUG_MGMT("WLAN_EID_FH_PARAMS: ignored\n"); 1222 LIBIPW_DEBUG_MGMT("WLAN_EID_FH_PARAMS: ignored\n");
1222 break; 1223 break;
1223 1224
1224 case WLAN_EID_CF_PARAMS: 1225 case WLAN_EID_CF_PARAMS:
1225 IEEE80211_DEBUG_MGMT("WLAN_EID_CF_PARAMS: ignored\n"); 1226 LIBIPW_DEBUG_MGMT("WLAN_EID_CF_PARAMS: ignored\n");
1226 break; 1227 break;
1227 1228
1228 case WLAN_EID_TIM: 1229 case WLAN_EID_TIM:
1229 network->tim.tim_count = info_element->data[0]; 1230 network->tim.tim_count = info_element->data[0];
1230 network->tim.tim_period = info_element->data[1]; 1231 network->tim.tim_period = info_element->data[1];
1231 IEEE80211_DEBUG_MGMT("WLAN_EID_TIM: partially ignored\n"); 1232 LIBIPW_DEBUG_MGMT("WLAN_EID_TIM: partially ignored\n");
1232 break; 1233 break;
1233 1234
1234 case WLAN_EID_ERP_INFO: 1235 case WLAN_EID_ERP_INFO:
1235 network->erp_value = info_element->data[0]; 1236 network->erp_value = info_element->data[0];
1236 network->flags |= NETWORK_HAS_ERP_VALUE; 1237 network->flags |= NETWORK_HAS_ERP_VALUE;
1237 IEEE80211_DEBUG_MGMT("MFIE_TYPE_ERP_SET: %d\n", 1238 LIBIPW_DEBUG_MGMT("MFIE_TYPE_ERP_SET: %d\n",
1238 network->erp_value); 1239 network->erp_value);
1239 break; 1240 break;
1240 1241
1241 case WLAN_EID_IBSS_PARAMS: 1242 case WLAN_EID_IBSS_PARAMS:
1242 network->atim_window = info_element->data[0]; 1243 network->atim_window = info_element->data[0];
1243 IEEE80211_DEBUG_MGMT("WLAN_EID_IBSS_PARAMS: %d\n", 1244 LIBIPW_DEBUG_MGMT("WLAN_EID_IBSS_PARAMS: %d\n",
1244 network->atim_window); 1245 network->atim_window);
1245 break; 1246 break;
1246 1247
1247 case WLAN_EID_CHALLENGE: 1248 case WLAN_EID_CHALLENGE:
1248 IEEE80211_DEBUG_MGMT("WLAN_EID_CHALLENGE: ignored\n"); 1249 LIBIPW_DEBUG_MGMT("WLAN_EID_CHALLENGE: ignored\n");
1249 break; 1250 break;
1250 1251
1251 case WLAN_EID_GENERIC: 1252 case WLAN_EID_GENERIC:
1252 IEEE80211_DEBUG_MGMT("WLAN_EID_GENERIC: %d bytes\n", 1253 LIBIPW_DEBUG_MGMT("WLAN_EID_GENERIC: %d bytes\n",
1253 info_element->len); 1254 info_element->len);
1254 if (!ieee80211_parse_qos_info_param_IE(info_element, 1255 if (!libipw_parse_qos_info_param_IE(info_element,
1255 network)) 1256 network))
1256 break; 1257 break;
1257 1258
@@ -1268,7 +1269,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1268 break; 1269 break;
1269 1270
1270 case WLAN_EID_RSN: 1271 case WLAN_EID_RSN:
1271 IEEE80211_DEBUG_MGMT("WLAN_EID_RSN: %d bytes\n", 1272 LIBIPW_DEBUG_MGMT("WLAN_EID_RSN: %d bytes\n",
1272 info_element->len); 1273 info_element->len);
1273 network->rsn_ie_len = min(info_element->len + 2, 1274 network->rsn_ie_len = min(info_element->len + 2,
1274 MAX_WPA_IE_LEN); 1275 MAX_WPA_IE_LEN);
@@ -1318,7 +1319,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1318 break; 1319 break;
1319 1320
1320 default: 1321 default:
1321 IEEE80211_DEBUG_MGMT 1322 LIBIPW_DEBUG_MGMT
1322 ("Unsupported info element: %s (%d)\n", 1323 ("Unsupported info element: %s (%d)\n",
1323 get_info_element_string(info_element->id), 1324 get_info_element_string(info_element->id),
1324 info_element->id); 1325 info_element->id);
@@ -1327,20 +1328,20 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1327 1328
1328 length -= sizeof(*info_element) + info_element->len; 1329 length -= sizeof(*info_element) + info_element->len;
1329 info_element = 1330 info_element =
1330 (struct ieee80211_info_element *)&info_element-> 1331 (struct libipw_info_element *)&info_element->
1331 data[info_element->len]; 1332 data[info_element->len];
1332 } 1333 }
1333 1334
1334 return 0; 1335 return 0;
1335} 1336}
1336 1337
1337static int ieee80211_handle_assoc_resp(struct ieee80211_device *ieee, struct ieee80211_assoc_response 1338static int libipw_handle_assoc_resp(struct libipw_device *ieee, struct libipw_assoc_response
1338 *frame, struct ieee80211_rx_stats *stats) 1339 *frame, struct libipw_rx_stats *stats)
1339{ 1340{
1340 struct ieee80211_network network_resp = { 1341 struct libipw_network network_resp = {
1341 .ibss_dfs = NULL, 1342 .ibss_dfs = NULL,
1342 }; 1343 };
1343 struct ieee80211_network *network = &network_resp; 1344 struct libipw_network *network = &network_resp;
1344 struct net_device *dev = ieee->dev; 1345 struct net_device *dev = ieee->dev;
1345 1346
1346 network->flags = 0; 1347 network->flags = 0;
@@ -1361,7 +1362,7 @@ static int ieee80211_handle_assoc_resp(struct ieee80211_device *ieee, struct iee
1361 network->erp_value = 1362 network->erp_value =
1362 (network->capability & WLAN_CAPABILITY_IBSS) ? 0x3 : 0x0; 1363 (network->capability & WLAN_CAPABILITY_IBSS) ? 0x3 : 0x0;
1363 1364
1364 if (stats->freq == IEEE80211_52GHZ_BAND) { 1365 if (stats->freq == LIBIPW_52GHZ_BAND) {
1365 /* for A band (No DS info) */ 1366 /* for A band (No DS info) */
1366 network->channel = stats->received_channel; 1367 network->channel = stats->received_channel;
1367 } else 1368 } else
@@ -1370,12 +1371,12 @@ static int ieee80211_handle_assoc_resp(struct ieee80211_device *ieee, struct iee
1370 network->wpa_ie_len = 0; 1371 network->wpa_ie_len = 0;
1371 network->rsn_ie_len = 0; 1372 network->rsn_ie_len = 0;
1372 1373
1373 if (ieee80211_parse_info_param 1374 if (libipw_parse_info_param
1374 (frame->info_element, stats->len - sizeof(*frame), network)) 1375 (frame->info_element, stats->len - sizeof(*frame), network))
1375 return 1; 1376 return 1;
1376 1377
1377 network->mode = 0; 1378 network->mode = 0;
1378 if (stats->freq == IEEE80211_52GHZ_BAND) 1379 if (stats->freq == LIBIPW_52GHZ_BAND)
1379 network->mode = IEEE_A; 1380 network->mode = IEEE_A;
1380 else { 1381 else {
1381 if (network->flags & NETWORK_HAS_OFDM) 1382 if (network->flags & NETWORK_HAS_OFDM)
@@ -1394,10 +1395,10 @@ static int ieee80211_handle_assoc_resp(struct ieee80211_device *ieee, struct iee
1394 1395
1395/***************************************************/ 1396/***************************************************/
1396 1397
1397static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee80211_probe_response 1398static int libipw_network_init(struct libipw_device *ieee, struct libipw_probe_response
1398 *beacon, 1399 *beacon,
1399 struct ieee80211_network *network, 1400 struct libipw_network *network,
1400 struct ieee80211_rx_stats *stats) 1401 struct libipw_rx_stats *stats)
1401{ 1402{
1402 DECLARE_SSID_BUF(ssid); 1403 DECLARE_SSID_BUF(ssid);
1403 1404
@@ -1423,7 +1424,7 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1423 network->erp_value = (network->capability & WLAN_CAPABILITY_IBSS) ? 1424 network->erp_value = (network->capability & WLAN_CAPABILITY_IBSS) ?
1424 0x3 : 0x0; 1425 0x3 : 0x0;
1425 1426
1426 if (stats->freq == IEEE80211_52GHZ_BAND) { 1427 if (stats->freq == LIBIPW_52GHZ_BAND) {
1427 /* for A band (No DS info) */ 1428 /* for A band (No DS info) */
1428 network->channel = stats->received_channel; 1429 network->channel = stats->received_channel;
1429 } else 1430 } else
@@ -1432,12 +1433,12 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1432 network->wpa_ie_len = 0; 1433 network->wpa_ie_len = 0;
1433 network->rsn_ie_len = 0; 1434 network->rsn_ie_len = 0;
1434 1435
1435 if (ieee80211_parse_info_param 1436 if (libipw_parse_info_param
1436 (beacon->info_element, stats->len - sizeof(*beacon), network)) 1437 (beacon->info_element, stats->len - sizeof(*beacon), network))
1437 return 1; 1438 return 1;
1438 1439
1439 network->mode = 0; 1440 network->mode = 0;
1440 if (stats->freq == IEEE80211_52GHZ_BAND) 1441 if (stats->freq == LIBIPW_52GHZ_BAND)
1441 network->mode = IEEE_A; 1442 network->mode = IEEE_A;
1442 else { 1443 else {
1443 if (network->flags & NETWORK_HAS_OFDM) 1444 if (network->flags & NETWORK_HAS_OFDM)
@@ -1447,7 +1448,7 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1447 } 1448 }
1448 1449
1449 if (network->mode == 0) { 1450 if (network->mode == 0) {
1450 IEEE80211_DEBUG_SCAN("Filtered out '%s (%pM)' " 1451 LIBIPW_DEBUG_SCAN("Filtered out '%s (%pM)' "
1451 "network.\n", 1452 "network.\n",
1452 print_ssid(ssid, network->ssid, 1453 print_ssid(ssid, network->ssid,
1453 network->ssid_len), 1454 network->ssid_len),
@@ -1460,8 +1461,8 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1460 return 0; 1461 return 0;
1461} 1462}
1462 1463
1463static inline int is_same_network(struct ieee80211_network *src, 1464static inline int is_same_network(struct libipw_network *src,
1464 struct ieee80211_network *dst) 1465 struct libipw_network *dst)
1465{ 1466{
1466 /* A network is only a duplicate if the channel, BSSID, and ESSID 1467 /* A network is only a duplicate if the channel, BSSID, and ESSID
1467 * all match. We treat all <hidden> with the same BSSID and channel 1468 * all match. We treat all <hidden> with the same BSSID and channel
@@ -1472,13 +1473,13 @@ static inline int is_same_network(struct ieee80211_network *src,
1472 !memcmp(src->ssid, dst->ssid, src->ssid_len)); 1473 !memcmp(src->ssid, dst->ssid, src->ssid_len));
1473} 1474}
1474 1475
1475static void update_network(struct ieee80211_network *dst, 1476static void update_network(struct libipw_network *dst,
1476 struct ieee80211_network *src) 1477 struct libipw_network *src)
1477{ 1478{
1478 int qos_active; 1479 int qos_active;
1479 u8 old_param; 1480 u8 old_param;
1480 1481
1481 ieee80211_network_reset(dst); 1482 libipw_network_reset(dst);
1482 dst->ibss_dfs = src->ibss_dfs; 1483 dst->ibss_dfs = src->ibss_dfs;
1483 1484
1484 /* We only update the statistics if they were created by receiving 1485 /* We only update the statistics if they were created by receiving
@@ -1488,9 +1489,9 @@ static void update_network(struct ieee80211_network *dst,
1488 * down the signal level of an AP. */ 1489 * down the signal level of an AP. */
1489 if (dst->channel == src->stats.received_channel) 1490 if (dst->channel == src->stats.received_channel)
1490 memcpy(&dst->stats, &src->stats, 1491 memcpy(&dst->stats, &src->stats,
1491 sizeof(struct ieee80211_rx_stats)); 1492 sizeof(struct libipw_rx_stats));
1492 else 1493 else
1493 IEEE80211_DEBUG_SCAN("Network %pM info received " 1494 LIBIPW_DEBUG_SCAN("Network %pM info received "
1494 "off channel (%d vs. %d)\n", src->bssid, 1495 "off channel (%d vs. %d)\n", src->bssid,
1495 dst->channel, src->stats.received_channel); 1496 dst->channel, src->stats.received_channel);
1496 1497
@@ -1521,7 +1522,7 @@ static void update_network(struct ieee80211_network *dst,
1521 old_param = dst->qos_data.old_param_count; 1522 old_param = dst->qos_data.old_param_count;
1522 if (dst->flags & NETWORK_HAS_QOS_MASK) 1523 if (dst->flags & NETWORK_HAS_QOS_MASK)
1523 memcpy(&dst->qos_data, &src->qos_data, 1524 memcpy(&dst->qos_data, &src->qos_data,
1524 sizeof(struct ieee80211_qos_data)); 1525 sizeof(struct libipw_qos_data));
1525 else { 1526 else {
1526 dst->qos_data.supported = src->qos_data.supported; 1527 dst->qos_data.supported = src->qos_data.supported;
1527 dst->qos_data.param_count = src->qos_data.param_count; 1528 dst->qos_data.param_count = src->qos_data.param_count;
@@ -1529,11 +1530,11 @@ static void update_network(struct ieee80211_network *dst,
1529 1530
1530 if (dst->qos_data.supported == 1) { 1531 if (dst->qos_data.supported == 1) {
1531 if (dst->ssid_len) 1532 if (dst->ssid_len)
1532 IEEE80211_DEBUG_QOS 1533 LIBIPW_DEBUG_QOS
1533 ("QoS the network %s is QoS supported\n", 1534 ("QoS the network %s is QoS supported\n",
1534 dst->ssid); 1535 dst->ssid);
1535 else 1536 else
1536 IEEE80211_DEBUG_QOS 1537 LIBIPW_DEBUG_QOS
1537 ("QoS the network is QoS supported\n"); 1538 ("QoS the network is QoS supported\n");
1538 } 1539 }
1539 dst->qos_data.active = qos_active; 1540 dst->qos_data.active = qos_active;
@@ -1547,25 +1548,25 @@ static inline int is_beacon(__le16 fc)
1547 return (WLAN_FC_GET_STYPE(le16_to_cpu(fc)) == IEEE80211_STYPE_BEACON); 1548 return (WLAN_FC_GET_STYPE(le16_to_cpu(fc)) == IEEE80211_STYPE_BEACON);
1548} 1549}
1549 1550
1550static void ieee80211_process_probe_response(struct ieee80211_device 1551static void libipw_process_probe_response(struct libipw_device
1551 *ieee, struct 1552 *ieee, struct
1552 ieee80211_probe_response 1553 libipw_probe_response
1553 *beacon, struct ieee80211_rx_stats 1554 *beacon, struct libipw_rx_stats
1554 *stats) 1555 *stats)
1555{ 1556{
1556 struct net_device *dev = ieee->dev; 1557 struct net_device *dev = ieee->dev;
1557 struct ieee80211_network network = { 1558 struct libipw_network network = {
1558 .ibss_dfs = NULL, 1559 .ibss_dfs = NULL,
1559 }; 1560 };
1560 struct ieee80211_network *target; 1561 struct libipw_network *target;
1561 struct ieee80211_network *oldest = NULL; 1562 struct libipw_network *oldest = NULL;
1562#ifdef CONFIG_LIBIPW_DEBUG 1563#ifdef CONFIG_LIBIPW_DEBUG
1563 struct ieee80211_info_element *info_element = beacon->info_element; 1564 struct libipw_info_element *info_element = beacon->info_element;
1564#endif 1565#endif
1565 unsigned long flags; 1566 unsigned long flags;
1566 DECLARE_SSID_BUF(ssid); 1567 DECLARE_SSID_BUF(ssid);
1567 1568
1568 IEEE80211_DEBUG_SCAN("'%s' (%pM" 1569 LIBIPW_DEBUG_SCAN("'%s' (%pM"
1569 "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", 1570 "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
1570 print_ssid(ssid, info_element->data, info_element->len), 1571 print_ssid(ssid, info_element->data, info_element->len),
1571 beacon->header.addr3, 1572 beacon->header.addr3,
@@ -1586,8 +1587,8 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1586 (beacon->capability & cpu_to_le16(1 << 0x1)) ? '1' : '0', 1587 (beacon->capability & cpu_to_le16(1 << 0x1)) ? '1' : '0',
1587 (beacon->capability & cpu_to_le16(1 << 0x0)) ? '1' : '0'); 1588 (beacon->capability & cpu_to_le16(1 << 0x0)) ? '1' : '0');
1588 1589
1589 if (ieee80211_network_init(ieee, beacon, &network, stats)) { 1590 if (libipw_network_init(ieee, beacon, &network, stats)) {
1590 IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n", 1591 LIBIPW_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n",
1591 print_ssid(ssid, info_element->data, 1592 print_ssid(ssid, info_element->data,
1592 info_element->len), 1593 info_element->len),
1593 beacon->header.addr3, 1594 beacon->header.addr3,
@@ -1624,21 +1625,21 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1624 /* If there are no more slots, expire the oldest */ 1625 /* If there are no more slots, expire the oldest */
1625 list_del(&oldest->list); 1626 list_del(&oldest->list);
1626 target = oldest; 1627 target = oldest;
1627 IEEE80211_DEBUG_SCAN("Expired '%s' (%pM) from " 1628 LIBIPW_DEBUG_SCAN("Expired '%s' (%pM) from "
1628 "network list.\n", 1629 "network list.\n",
1629 print_ssid(ssid, target->ssid, 1630 print_ssid(ssid, target->ssid,
1630 target->ssid_len), 1631 target->ssid_len),
1631 target->bssid); 1632 target->bssid);
1632 ieee80211_network_reset(target); 1633 libipw_network_reset(target);
1633 } else { 1634 } else {
1634 /* Otherwise just pull from the free list */ 1635 /* Otherwise just pull from the free list */
1635 target = list_entry(ieee->network_free_list.next, 1636 target = list_entry(ieee->network_free_list.next,
1636 struct ieee80211_network, list); 1637 struct libipw_network, list);
1637 list_del(ieee->network_free_list.next); 1638 list_del(ieee->network_free_list.next);
1638 } 1639 }
1639 1640
1640#ifdef CONFIG_LIBIPW_DEBUG 1641#ifdef CONFIG_LIBIPW_DEBUG
1641 IEEE80211_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n", 1642 LIBIPW_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n",
1642 print_ssid(ssid, network.ssid, 1643 print_ssid(ssid, network.ssid,
1643 network.ssid_len), 1644 network.ssid_len),
1644 network.bssid, 1645 network.bssid,
@@ -1649,7 +1650,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1649 network.ibss_dfs = NULL; 1650 network.ibss_dfs = NULL;
1650 list_add_tail(&target->list, &ieee->network_list); 1651 list_add_tail(&target->list, &ieee->network_list);
1651 } else { 1652 } else {
1652 IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n", 1653 LIBIPW_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n",
1653 print_ssid(ssid, target->ssid, 1654 print_ssid(ssid, target->ssid,
1654 target->ssid_len), 1655 target->ssid_len),
1655 target->bssid, 1656 target->bssid,
@@ -1670,121 +1671,121 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1670 } 1671 }
1671} 1672}
1672 1673
1673void ieee80211_rx_mgt(struct ieee80211_device *ieee, 1674void libipw_rx_mgt(struct libipw_device *ieee,
1674 struct ieee80211_hdr_4addr *header, 1675 struct libipw_hdr_4addr *header,
1675 struct ieee80211_rx_stats *stats) 1676 struct libipw_rx_stats *stats)
1676{ 1677{
1677 switch (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl))) { 1678 switch (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl))) {
1678 case IEEE80211_STYPE_ASSOC_RESP: 1679 case IEEE80211_STYPE_ASSOC_RESP:
1679 IEEE80211_DEBUG_MGMT("received ASSOCIATION RESPONSE (%d)\n", 1680 LIBIPW_DEBUG_MGMT("received ASSOCIATION RESPONSE (%d)\n",
1680 WLAN_FC_GET_STYPE(le16_to_cpu 1681 WLAN_FC_GET_STYPE(le16_to_cpu
1681 (header->frame_ctl))); 1682 (header->frame_ctl)));
1682 ieee80211_handle_assoc_resp(ieee, 1683 libipw_handle_assoc_resp(ieee,
1683 (struct ieee80211_assoc_response *) 1684 (struct libipw_assoc_response *)
1684 header, stats); 1685 header, stats);
1685 break; 1686 break;
1686 1687
1687 case IEEE80211_STYPE_REASSOC_RESP: 1688 case IEEE80211_STYPE_REASSOC_RESP:
1688 IEEE80211_DEBUG_MGMT("received REASSOCIATION RESPONSE (%d)\n", 1689 LIBIPW_DEBUG_MGMT("received REASSOCIATION RESPONSE (%d)\n",
1689 WLAN_FC_GET_STYPE(le16_to_cpu 1690 WLAN_FC_GET_STYPE(le16_to_cpu
1690 (header->frame_ctl))); 1691 (header->frame_ctl)));
1691 break; 1692 break;
1692 1693
1693 case IEEE80211_STYPE_PROBE_REQ: 1694 case IEEE80211_STYPE_PROBE_REQ:
1694 IEEE80211_DEBUG_MGMT("received auth (%d)\n", 1695 LIBIPW_DEBUG_MGMT("received auth (%d)\n",
1695 WLAN_FC_GET_STYPE(le16_to_cpu 1696 WLAN_FC_GET_STYPE(le16_to_cpu
1696 (header->frame_ctl))); 1697 (header->frame_ctl)));
1697 1698
1698 if (ieee->handle_probe_request != NULL) 1699 if (ieee->handle_probe_request != NULL)
1699 ieee->handle_probe_request(ieee->dev, 1700 ieee->handle_probe_request(ieee->dev,
1700 (struct 1701 (struct
1701 ieee80211_probe_request *) 1702 libipw_probe_request *)
1702 header, stats); 1703 header, stats);
1703 break; 1704 break;
1704 1705
1705 case IEEE80211_STYPE_PROBE_RESP: 1706 case IEEE80211_STYPE_PROBE_RESP:
1706 IEEE80211_DEBUG_MGMT("received PROBE RESPONSE (%d)\n", 1707 LIBIPW_DEBUG_MGMT("received PROBE RESPONSE (%d)\n",
1707 WLAN_FC_GET_STYPE(le16_to_cpu 1708 WLAN_FC_GET_STYPE(le16_to_cpu
1708 (header->frame_ctl))); 1709 (header->frame_ctl)));
1709 IEEE80211_DEBUG_SCAN("Probe response\n"); 1710 LIBIPW_DEBUG_SCAN("Probe response\n");
1710 ieee80211_process_probe_response(ieee, 1711 libipw_process_probe_response(ieee,
1711 (struct 1712 (struct
1712 ieee80211_probe_response *) 1713 libipw_probe_response *)
1713 header, stats); 1714 header, stats);
1714 break; 1715 break;
1715 1716
1716 case IEEE80211_STYPE_BEACON: 1717 case IEEE80211_STYPE_BEACON:
1717 IEEE80211_DEBUG_MGMT("received BEACON (%d)\n", 1718 LIBIPW_DEBUG_MGMT("received BEACON (%d)\n",
1718 WLAN_FC_GET_STYPE(le16_to_cpu 1719 WLAN_FC_GET_STYPE(le16_to_cpu
1719 (header->frame_ctl))); 1720 (header->frame_ctl)));
1720 IEEE80211_DEBUG_SCAN("Beacon\n"); 1721 LIBIPW_DEBUG_SCAN("Beacon\n");
1721 ieee80211_process_probe_response(ieee, 1722 libipw_process_probe_response(ieee,
1722 (struct 1723 (struct
1723 ieee80211_probe_response *) 1724 libipw_probe_response *)
1724 header, stats); 1725 header, stats);
1725 break; 1726 break;
1726 case IEEE80211_STYPE_AUTH: 1727 case IEEE80211_STYPE_AUTH:
1727 1728
1728 IEEE80211_DEBUG_MGMT("received auth (%d)\n", 1729 LIBIPW_DEBUG_MGMT("received auth (%d)\n",
1729 WLAN_FC_GET_STYPE(le16_to_cpu 1730 WLAN_FC_GET_STYPE(le16_to_cpu
1730 (header->frame_ctl))); 1731 (header->frame_ctl)));
1731 1732
1732 if (ieee->handle_auth != NULL) 1733 if (ieee->handle_auth != NULL)
1733 ieee->handle_auth(ieee->dev, 1734 ieee->handle_auth(ieee->dev,
1734 (struct ieee80211_auth *)header); 1735 (struct libipw_auth *)header);
1735 break; 1736 break;
1736 1737
1737 case IEEE80211_STYPE_DISASSOC: 1738 case IEEE80211_STYPE_DISASSOC:
1738 if (ieee->handle_disassoc != NULL) 1739 if (ieee->handle_disassoc != NULL)
1739 ieee->handle_disassoc(ieee->dev, 1740 ieee->handle_disassoc(ieee->dev,
1740 (struct ieee80211_disassoc *) 1741 (struct libipw_disassoc *)
1741 header); 1742 header);
1742 break; 1743 break;
1743 1744
1744 case IEEE80211_STYPE_ACTION: 1745 case IEEE80211_STYPE_ACTION:
1745 IEEE80211_DEBUG_MGMT("ACTION\n"); 1746 LIBIPW_DEBUG_MGMT("ACTION\n");
1746 if (ieee->handle_action) 1747 if (ieee->handle_action)
1747 ieee->handle_action(ieee->dev, 1748 ieee->handle_action(ieee->dev,
1748 (struct ieee80211_action *) 1749 (struct libipw_action *)
1749 header, stats); 1750 header, stats);
1750 break; 1751 break;
1751 1752
1752 case IEEE80211_STYPE_REASSOC_REQ: 1753 case IEEE80211_STYPE_REASSOC_REQ:
1753 IEEE80211_DEBUG_MGMT("received reassoc (%d)\n", 1754 LIBIPW_DEBUG_MGMT("received reassoc (%d)\n",
1754 WLAN_FC_GET_STYPE(le16_to_cpu 1755 WLAN_FC_GET_STYPE(le16_to_cpu
1755 (header->frame_ctl))); 1756 (header->frame_ctl)));
1756 1757
1757 IEEE80211_DEBUG_MGMT("%s: IEEE80211_REASSOC_REQ received\n", 1758 LIBIPW_DEBUG_MGMT("%s: LIBIPW_REASSOC_REQ received\n",
1758 ieee->dev->name); 1759 ieee->dev->name);
1759 if (ieee->handle_reassoc_request != NULL) 1760 if (ieee->handle_reassoc_request != NULL)
1760 ieee->handle_reassoc_request(ieee->dev, 1761 ieee->handle_reassoc_request(ieee->dev,
1761 (struct ieee80211_reassoc_request *) 1762 (struct libipw_reassoc_request *)
1762 header); 1763 header);
1763 break; 1764 break;
1764 1765
1765 case IEEE80211_STYPE_ASSOC_REQ: 1766 case IEEE80211_STYPE_ASSOC_REQ:
1766 IEEE80211_DEBUG_MGMT("received assoc (%d)\n", 1767 LIBIPW_DEBUG_MGMT("received assoc (%d)\n",
1767 WLAN_FC_GET_STYPE(le16_to_cpu 1768 WLAN_FC_GET_STYPE(le16_to_cpu
1768 (header->frame_ctl))); 1769 (header->frame_ctl)));
1769 1770
1770 IEEE80211_DEBUG_MGMT("%s: IEEE80211_ASSOC_REQ received\n", 1771 LIBIPW_DEBUG_MGMT("%s: LIBIPW_ASSOC_REQ received\n",
1771 ieee->dev->name); 1772 ieee->dev->name);
1772 if (ieee->handle_assoc_request != NULL) 1773 if (ieee->handle_assoc_request != NULL)
1773 ieee->handle_assoc_request(ieee->dev); 1774 ieee->handle_assoc_request(ieee->dev);
1774 break; 1775 break;
1775 1776
1776 case IEEE80211_STYPE_DEAUTH: 1777 case IEEE80211_STYPE_DEAUTH:
1777 IEEE80211_DEBUG_MGMT("DEAUTH\n"); 1778 LIBIPW_DEBUG_MGMT("DEAUTH\n");
1778 if (ieee->handle_deauth != NULL) 1779 if (ieee->handle_deauth != NULL)
1779 ieee->handle_deauth(ieee->dev, 1780 ieee->handle_deauth(ieee->dev,
1780 (struct ieee80211_deauth *) 1781 (struct libipw_deauth *)
1781 header); 1782 header);
1782 break; 1783 break;
1783 default: 1784 default:
1784 IEEE80211_DEBUG_MGMT("received UNKNOWN (%d)\n", 1785 LIBIPW_DEBUG_MGMT("received UNKNOWN (%d)\n",
1785 WLAN_FC_GET_STYPE(le16_to_cpu 1786 WLAN_FC_GET_STYPE(le16_to_cpu
1786 (header->frame_ctl))); 1787 (header->frame_ctl)));
1787 IEEE80211_DEBUG_MGMT("%s: Unknown management packet: %d\n", 1788 LIBIPW_DEBUG_MGMT("%s: Unknown management packet: %d\n",
1788 ieee->dev->name, 1789 ieee->dev->name,
1789 WLAN_FC_GET_STYPE(le16_to_cpu 1790 WLAN_FC_GET_STYPE(le16_to_cpu
1790 (header->frame_ctl))); 1791 (header->frame_ctl)));
@@ -1792,6 +1793,6 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee,
1792 } 1793 }
1793} 1794}
1794 1795
1795EXPORT_SYMBOL_GPL(ieee80211_rx_any); 1796EXPORT_SYMBOL_GPL(libipw_rx_any);
1796EXPORT_SYMBOL(ieee80211_rx_mgt); 1797EXPORT_SYMBOL(libipw_rx_mgt);
1797EXPORT_SYMBOL(ieee80211_rx); 1798EXPORT_SYMBOL(libipw_rx);