aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee80211
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2007-10-03 20:59:30 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:42 -0400
commit0795af5729b18218767fab27c44b1384f72dc9ad (patch)
tree67c16df84aa6ec219340b8ea1b5cfb0e8150a216 /net/ieee80211
parent95ea36275f3c9a1d3d04c217b4b576c657c4e70e (diff)
[NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()
This is nicer than the MAC_FMT stuff. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ieee80211')
-rw-r--r--net/ieee80211/ieee80211_crypt_ccmp.c27
-rw-r--r--net/ieee80211/ieee80211_crypt_tkip.c31
-rw-r--r--net/ieee80211/ieee80211_rx.c59
-rw-r--r--net/ieee80211/ieee80211_wx.c5
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_assoc.c4
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_auth.c35
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_wx.c1
7 files changed, 94 insertions, 68 deletions
diff --git a/net/ieee80211/ieee80211_crypt_ccmp.c b/net/ieee80211/ieee80211_crypt_ccmp.c
index 2e6b099fc84c..0936a3e0210b 100644
--- a/net/ieee80211/ieee80211_crypt_ccmp.c
+++ b/net/ieee80211/ieee80211_crypt_ccmp.c
@@ -297,6 +297,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
297 int i, blocks, last, len; 297 int i, blocks, last, len;
298 size_t data_len = skb->len - hdr_len - CCMP_HDR_LEN - CCMP_MIC_LEN; 298 size_t data_len = skb->len - hdr_len - CCMP_HDR_LEN - CCMP_MIC_LEN;
299 u8 *mic = skb->data + skb->len - CCMP_MIC_LEN; 299 u8 *mic = skb->data + skb->len - CCMP_MIC_LEN;
300 DECLARE_MAC_BUF(mac);
300 301
301 if (skb->len < hdr_len + CCMP_HDR_LEN + CCMP_MIC_LEN) { 302 if (skb->len < hdr_len + CCMP_HDR_LEN + CCMP_MIC_LEN) {
302 key->dot11RSNAStatsCCMPFormatErrors++; 303 key->dot11RSNAStatsCCMPFormatErrors++;
@@ -309,7 +310,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
309 if (!(keyidx & (1 << 5))) { 310 if (!(keyidx & (1 << 5))) {
310 if (net_ratelimit()) { 311 if (net_ratelimit()) {
311 printk(KERN_DEBUG "CCMP: received packet without ExtIV" 312 printk(KERN_DEBUG "CCMP: received packet without ExtIV"
312 " flag from " MAC_FMT "\n", MAC_ARG(hdr->addr2)); 313 " flag from %s\n", print_mac(mac, hdr->addr2));
313 } 314 }
314 key->dot11RSNAStatsCCMPFormatErrors++; 315 key->dot11RSNAStatsCCMPFormatErrors++;
315 return -2; 316 return -2;
@@ -322,9 +323,9 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
322 } 323 }
323 if (!key->key_set) { 324 if (!key->key_set) {
324 if (net_ratelimit()) { 325 if (net_ratelimit()) {
325 printk(KERN_DEBUG "CCMP: received packet from " MAC_FMT 326 printk(KERN_DEBUG "CCMP: received packet from %s"
326 " with keyid=%d that does not have a configured" 327 " with keyid=%d that does not have a configured"
327 " key\n", MAC_ARG(hdr->addr2), keyidx); 328 " key\n", print_mac(mac, hdr->addr2), keyidx);
328 } 329 }
329 return -3; 330 return -3;
330 } 331 }
@@ -339,11 +340,13 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
339 340
340 if (ccmp_replay_check(pn, key->rx_pn)) { 341 if (ccmp_replay_check(pn, key->rx_pn)) {
341 if (net_ratelimit()) { 342 if (net_ratelimit()) {
342 IEEE80211_DEBUG_DROP("CCMP: replay detected: STA=" MAC_FMT 343 IEEE80211_DEBUG_DROP("CCMP: replay detected: STA=%s "
343 " previous PN %02x%02x%02x%02x%02x%02x " 344 "previous PN %02x%02x%02x%02x%02x%02x "
344 "received PN %02x%02x%02x%02x%02x%02x\n", 345 "received PN %02x%02x%02x%02x%02x%02x\n",
345 MAC_ARG(hdr->addr2), MAC_ARG(key->rx_pn), 346 print_mac(mac, hdr->addr2),
346 MAC_ARG(pn)); 347 key->rx_pn[0], key->rx_pn[1], key->rx_pn[2],
348 key->rx_pn[3], key->rx_pn[4], key->rx_pn[5],
349 pn[0], pn[1], pn[2], pn[3], pn[4], pn[5]);
347 } 350 }
348 key->dot11RSNAStatsCCMPReplays++; 351 key->dot11RSNAStatsCCMPReplays++;
349 return -4; 352 return -4;
@@ -371,7 +374,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
371 if (memcmp(mic, a, CCMP_MIC_LEN) != 0) { 374 if (memcmp(mic, a, CCMP_MIC_LEN) != 0) {
372 if (net_ratelimit()) { 375 if (net_ratelimit()) {
373 printk(KERN_DEBUG "CCMP: decrypt failed: STA=" 376 printk(KERN_DEBUG "CCMP: decrypt failed: STA="
374 MAC_FMT "\n", MAC_ARG(hdr->addr2)); 377 "%s\n", print_mac(mac, hdr->addr2));
375 } 378 }
376 key->dot11RSNAStatsCCMPDecryptErrors++; 379 key->dot11RSNAStatsCCMPDecryptErrors++;
377 return -5; 380 return -5;
@@ -443,12 +446,16 @@ static int ieee80211_ccmp_get_key(void *key, int len, u8 * seq, void *priv)
443static char *ieee80211_ccmp_print_stats(char *p, void *priv) 446static char *ieee80211_ccmp_print_stats(char *p, void *priv)
444{ 447{
445 struct ieee80211_ccmp_data *ccmp = priv; 448 struct ieee80211_ccmp_data *ccmp = priv;
449
446 p += sprintf(p, "key[%d] alg=CCMP key_set=%d " 450 p += sprintf(p, "key[%d] alg=CCMP key_set=%d "
447 "tx_pn=%02x%02x%02x%02x%02x%02x " 451 "tx_pn=%02x%02x%02x%02x%02x%02x "
448 "rx_pn=%02x%02x%02x%02x%02x%02x " 452 "rx_pn=%02x%02x%02x%02x%02x%02x "
449 "format_errors=%d replays=%d decrypt_errors=%d\n", 453 "format_errors=%d replays=%d decrypt_errors=%d\n",
450 ccmp->key_idx, ccmp->key_set, 454 ccmp->key_idx, ccmp->key_set,
451 MAC_ARG(ccmp->tx_pn), MAC_ARG(ccmp->rx_pn), 455 ccmp->tx_pn[0], ccmp->tx_pn[1], ccmp->tx_pn[2],
456 ccmp->tx_pn[3], ccmp->tx_pn[4], ccmp->tx_pn[5],
457 ccmp->rx_pn[0], ccmp->rx_pn[1], ccmp->rx_pn[2],
458 ccmp->rx_pn[3], ccmp->rx_pn[4], ccmp->rx_pn[5],
452 ccmp->dot11RSNAStatsCCMPFormatErrors, 459 ccmp->dot11RSNAStatsCCMPFormatErrors,
453 ccmp->dot11RSNAStatsCCMPReplays, 460 ccmp->dot11RSNAStatsCCMPReplays,
454 ccmp->dot11RSNAStatsCCMPDecryptErrors); 461 ccmp->dot11RSNAStatsCCMPDecryptErrors);
diff --git a/net/ieee80211/ieee80211_crypt_tkip.c b/net/ieee80211/ieee80211_crypt_tkip.c
index 5a48d8e0aec1..6cc54eeca3ed 100644
--- a/net/ieee80211/ieee80211_crypt_tkip.c
+++ b/net/ieee80211/ieee80211_crypt_tkip.c
@@ -359,14 +359,15 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
359 u8 rc4key[16], *pos, *icv; 359 u8 rc4key[16], *pos, *icv;
360 u32 crc; 360 u32 crc;
361 struct scatterlist sg; 361 struct scatterlist sg;
362 DECLARE_MAC_BUF(mac);
362 363
363 if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) { 364 if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) {
364 if (net_ratelimit()) { 365 if (net_ratelimit()) {
365 struct ieee80211_hdr_4addr *hdr = 366 struct ieee80211_hdr_4addr *hdr =
366 (struct ieee80211_hdr_4addr *)skb->data; 367 (struct ieee80211_hdr_4addr *)skb->data;
367 printk(KERN_DEBUG ": TKIP countermeasures: dropped " 368 printk(KERN_DEBUG ": TKIP countermeasures: dropped "
368 "TX packet to " MAC_FMT "\n", 369 "TX packet to %s\n",
369 MAC_ARG(hdr->addr1)); 370 print_mac(mac, hdr->addr1));
370 } 371 }
371 return -1; 372 return -1;
372 } 373 }
@@ -421,14 +422,15 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
421 u32 crc; 422 u32 crc;
422 struct scatterlist sg; 423 struct scatterlist sg;
423 int plen; 424 int plen;
425 DECLARE_MAC_BUF(mac);
424 426
425 hdr = (struct ieee80211_hdr_4addr *)skb->data; 427 hdr = (struct ieee80211_hdr_4addr *)skb->data;
426 428
427 if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) { 429 if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) {
428 if (net_ratelimit()) { 430 if (net_ratelimit()) {
429 printk(KERN_DEBUG ": TKIP countermeasures: dropped " 431 printk(KERN_DEBUG ": TKIP countermeasures: dropped "
430 "received packet from " MAC_FMT "\n", 432 "received packet from %s\n",
431 MAC_ARG(hdr->addr2)); 433 print_mac(mac, hdr->addr2));
432 } 434 }
433 return -1; 435 return -1;
434 } 436 }
@@ -441,7 +443,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
441 if (!(keyidx & (1 << 5))) { 443 if (!(keyidx & (1 << 5))) {
442 if (net_ratelimit()) { 444 if (net_ratelimit()) {
443 printk(KERN_DEBUG "TKIP: received packet without ExtIV" 445 printk(KERN_DEBUG "TKIP: received packet without ExtIV"
444 " flag from " MAC_FMT "\n", MAC_ARG(hdr->addr2)); 446 " flag from %s\n", print_mac(mac, hdr->addr2));
445 } 447 }
446 return -2; 448 return -2;
447 } 449 }
@@ -453,9 +455,9 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
453 } 455 }
454 if (!tkey->key_set) { 456 if (!tkey->key_set) {
455 if (net_ratelimit()) { 457 if (net_ratelimit()) {
456 printk(KERN_DEBUG "TKIP: received packet from " MAC_FMT 458 printk(KERN_DEBUG "TKIP: received packet from %s"
457 " with keyid=%d that does not have a configured" 459 " with keyid=%d that does not have a configured"
458 " key\n", MAC_ARG(hdr->addr2), keyidx); 460 " key\n", print_mac(mac, hdr->addr2), keyidx);
459 } 461 }
460 return -3; 462 return -3;
461 } 463 }
@@ -465,9 +467,9 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
465 467
466 if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) { 468 if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) {
467 if (net_ratelimit()) { 469 if (net_ratelimit()) {
468 IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=" MAC_FMT 470 IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%s"
469 " previous TSC %08x%04x received TSC " 471 " previous TSC %08x%04x received TSC "
470 "%08x%04x\n", MAC_ARG(hdr->addr2), 472 "%08x%04x\n", print_mac(mac, hdr->addr2),
471 tkey->rx_iv32, tkey->rx_iv16, iv32, iv16); 473 tkey->rx_iv32, tkey->rx_iv16, iv32, iv16);
472 } 474 }
473 tkey->dot11RSNAStatsTKIPReplays++; 475 tkey->dot11RSNAStatsTKIPReplays++;
@@ -489,8 +491,8 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
489 if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) { 491 if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) {
490 if (net_ratelimit()) { 492 if (net_ratelimit()) {
491 printk(KERN_DEBUG ": TKIP: failed to decrypt " 493 printk(KERN_DEBUG ": TKIP: failed to decrypt "
492 "received packet from " MAC_FMT "\n", 494 "received packet from %s\n",
493 MAC_ARG(hdr->addr2)); 495 print_mac(mac, hdr->addr2));
494 } 496 }
495 return -7; 497 return -7;
496 } 498 }
@@ -508,7 +510,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
508 } 510 }
509 if (net_ratelimit()) { 511 if (net_ratelimit()) {
510 IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA=" 512 IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA="
511 MAC_FMT "\n", MAC_ARG(hdr->addr2)); 513 "%s\n", print_mac(mac, hdr->addr2));
512 } 514 }
513 tkey->dot11RSNAStatsTKIPICVErrors++; 515 tkey->dot11RSNAStatsTKIPICVErrors++;
514 return -5; 516 return -5;
@@ -639,6 +641,7 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
639{ 641{
640 struct ieee80211_tkip_data *tkey = priv; 642 struct ieee80211_tkip_data *tkey = priv;
641 u8 mic[8]; 643 u8 mic[8];
644 DECLARE_MAC_BUF(mac);
642 645
643 if (!tkey->key_set) 646 if (!tkey->key_set)
644 return -1; 647 return -1;
@@ -651,8 +654,8 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
651 struct ieee80211_hdr_4addr *hdr; 654 struct ieee80211_hdr_4addr *hdr;
652 hdr = (struct ieee80211_hdr_4addr *)skb->data; 655 hdr = (struct ieee80211_hdr_4addr *)skb->data;
653 printk(KERN_DEBUG "%s: Michael MIC verification failed for " 656 printk(KERN_DEBUG "%s: Michael MIC verification failed for "
654 "MSDU from " MAC_FMT " keyidx=%d\n", 657 "MSDU from %s keyidx=%d\n",
655 skb->dev ? skb->dev->name : "N/A", MAC_ARG(hdr->addr2), 658 skb->dev ? skb->dev->name : "N/A", print_mac(mac, hdr->addr2),
656 keyidx); 659 keyidx);
657 if (skb->dev) 660 if (skb->dev)
658 ieee80211_michael_mic_failure(skb->dev, hdr, keyidx); 661 ieee80211_michael_mic_failure(skb->dev, hdr, keyidx);
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index 6284c99b456e..21c0fadde03b 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -271,6 +271,7 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb,
271{ 271{
272 struct ieee80211_hdr_3addr *hdr; 272 struct ieee80211_hdr_3addr *hdr;
273 int res, hdrlen; 273 int res, hdrlen;
274 DECLARE_MAC_BUF(mac);
274 275
275 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) 276 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL)
276 return 0; 277 return 0;
@@ -282,8 +283,8 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb,
282 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); 283 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv);
283 atomic_dec(&crypt->refcnt); 284 atomic_dec(&crypt->refcnt);
284 if (res < 0) { 285 if (res < 0) {
285 IEEE80211_DEBUG_DROP("decryption failed (SA=" MAC_FMT 286 IEEE80211_DEBUG_DROP("decryption failed (SA=%s"
286 ") res=%d\n", MAC_ARG(hdr->addr2), res); 287 ") res=%d\n", print_mac(mac, hdr->addr2), res);
287 if (res == -2) 288 if (res == -2)
288 IEEE80211_DEBUG_DROP("Decryption failed ICV " 289 IEEE80211_DEBUG_DROP("Decryption failed ICV "
289 "mismatch (key %d)\n", 290 "mismatch (key %d)\n",
@@ -303,6 +304,7 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee,
303{ 304{
304 struct ieee80211_hdr_3addr *hdr; 305 struct ieee80211_hdr_3addr *hdr;
305 int res, hdrlen; 306 int res, hdrlen;
307 DECLARE_MAC_BUF(mac);
306 308
307 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL) 309 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL)
308 return 0; 310 return 0;
@@ -315,8 +317,8 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee,
315 atomic_dec(&crypt->refcnt); 317 atomic_dec(&crypt->refcnt);
316 if (res < 0) { 318 if (res < 0) {
317 printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed" 319 printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed"
318 " (SA=" MAC_FMT " keyidx=%d)\n", 320 " (SA=%s keyidx=%d)\n",
319 ieee->dev->name, MAC_ARG(hdr->addr2), keyidx); 321 ieee->dev->name, print_mac(mac, hdr->addr2), keyidx);
320 return -1; 322 return -1;
321 } 323 }
322 324
@@ -350,6 +352,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
350 struct ieee80211_crypt_data *crypt = NULL; 352 struct ieee80211_crypt_data *crypt = NULL;
351 int keyidx = 0; 353 int keyidx = 0;
352 int can_be_decrypted = 0; 354 int can_be_decrypted = 0;
355 DECLARE_MAC_BUF(mac);
353 356
354 hdr = (struct ieee80211_hdr_4addr *)skb->data; 357 hdr = (struct ieee80211_hdr_4addr *)skb->data;
355 stats = &ieee->stats; 358 stats = &ieee->stats;
@@ -459,8 +462,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
459 * frames silently instead of filling system log with 462 * frames silently instead of filling system log with
460 * these reports. */ 463 * these reports. */
461 IEEE80211_DEBUG_DROP("Decryption failed (not set)" 464 IEEE80211_DEBUG_DROP("Decryption failed (not set)"
462 " (SA=" MAC_FMT ")\n", 465 " (SA=%s)\n",
463 MAC_ARG(hdr->addr2)); 466 print_mac(mac, hdr->addr2));
464 ieee->ieee_stats.rx_discards_undecryptable++; 467 ieee->ieee_stats.rx_discards_undecryptable++;
465 goto rx_dropped; 468 goto rx_dropped;
466 } 469 }
@@ -471,8 +474,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
471 fc & IEEE80211_FCTL_PROTECTED && ieee->host_decrypt && 474 fc & IEEE80211_FCTL_PROTECTED && ieee->host_decrypt &&
472 (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) { 475 (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) {
473 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " 476 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth "
474 "from " MAC_FMT "\n", dev->name, 477 "from %s\n", dev->name,
475 MAC_ARG(hdr->addr2)); 478 print_mac(mac, hdr->addr2));
476 /* TODO: could inform hostapd about this so that it 479 /* TODO: could inform hostapd about this so that it
477 * could send auth failure report */ 480 * could send auth failure report */
478 goto rx_dropped; 481 goto rx_dropped;
@@ -650,8 +653,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
650 * configured */ 653 * configured */
651 } else { 654 } else {
652 IEEE80211_DEBUG_DROP("encryption configured, but RX " 655 IEEE80211_DEBUG_DROP("encryption configured, but RX "
653 "frame not encrypted (SA=" MAC_FMT 656 "frame not encrypted (SA=%s"
654 ")\n", MAC_ARG(hdr->addr2)); 657 ")\n", print_mac(mac, hdr->addr2));
655 goto rx_dropped; 658 goto rx_dropped;
656 } 659 }
657 } 660 }
@@ -659,9 +662,9 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
659 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep && 662 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep &&
660 !ieee80211_is_eapol_frame(ieee, skb)) { 663 !ieee80211_is_eapol_frame(ieee, skb)) {
661 IEEE80211_DEBUG_DROP("dropped unencrypted RX data " 664 IEEE80211_DEBUG_DROP("dropped unencrypted RX data "
662 "frame from " MAC_FMT 665 "frame from %s"
663 " (drop_unencrypted=1)\n", 666 " (drop_unencrypted=1)\n",
664 MAC_ARG(hdr->addr2)); 667 print_mac(mac, hdr->addr2));
665 goto rx_dropped; 668 goto rx_dropped;
666 } 669 }
667 670
@@ -1411,6 +1414,8 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1411 struct ieee80211_network *network, 1414 struct ieee80211_network *network,
1412 struct ieee80211_rx_stats *stats) 1415 struct ieee80211_rx_stats *stats)
1413{ 1416{
1417 DECLARE_MAC_BUF(mac);
1418
1414 network->qos_data.active = 0; 1419 network->qos_data.active = 0;
1415 network->qos_data.supported = 0; 1420 network->qos_data.supported = 0;
1416 network->qos_data.param_count = 0; 1421 network->qos_data.param_count = 0;
@@ -1457,11 +1462,11 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1457 } 1462 }
1458 1463
1459 if (network->mode == 0) { 1464 if (network->mode == 0) {
1460 IEEE80211_DEBUG_SCAN("Filtered out '%s (" MAC_FMT ")' " 1465 IEEE80211_DEBUG_SCAN("Filtered out '%s (%s)' "
1461 "network.\n", 1466 "network.\n",
1462 escape_essid(network->ssid, 1467 escape_essid(network->ssid,
1463 network->ssid_len), 1468 network->ssid_len),
1464 MAC_ARG(network->bssid)); 1469 print_mac(mac, network->bssid));
1465 return 1; 1470 return 1;
1466 } 1471 }
1467 1472
@@ -1490,6 +1495,7 @@ static void update_network(struct ieee80211_network *dst,
1490{ 1495{
1491 int qos_active; 1496 int qos_active;
1492 u8 old_param; 1497 u8 old_param;
1498 DECLARE_MAC_BUF(mac);
1493 1499
1494 ieee80211_network_reset(dst); 1500 ieee80211_network_reset(dst);
1495 dst->ibss_dfs = src->ibss_dfs; 1501 dst->ibss_dfs = src->ibss_dfs;
@@ -1503,8 +1509,8 @@ static void update_network(struct ieee80211_network *dst,
1503 memcpy(&dst->stats, &src->stats, 1509 memcpy(&dst->stats, &src->stats,
1504 sizeof(struct ieee80211_rx_stats)); 1510 sizeof(struct ieee80211_rx_stats));
1505 else 1511 else
1506 IEEE80211_DEBUG_SCAN("Network " MAC_FMT " info received " 1512 IEEE80211_DEBUG_SCAN("Network %s info received "
1507 "off channel (%d vs. %d)\n", MAC_ARG(src->bssid), 1513 "off channel (%d vs. %d)\n", print_mac(mac, src->bssid),
1508 dst->channel, src->stats.received_channel); 1514 dst->channel, src->stats.received_channel);
1509 1515
1510 dst->capability = src->capability; 1516 dst->capability = src->capability;
@@ -1576,12 +1582,13 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1576 struct ieee80211_info_element *info_element = beacon->info_element; 1582 struct ieee80211_info_element *info_element = beacon->info_element;
1577#endif 1583#endif
1578 unsigned long flags; 1584 unsigned long flags;
1585 DECLARE_MAC_BUF(mac);
1579 1586
1580 IEEE80211_DEBUG_SCAN("'%s' (" MAC_FMT 1587 IEEE80211_DEBUG_SCAN("'%s' (%s"
1581 "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", 1588 "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
1582 escape_essid(info_element->data, 1589 escape_essid(info_element->data,
1583 info_element->len), 1590 info_element->len),
1584 MAC_ARG(beacon->header.addr3), 1591 print_mac(mac, beacon->header.addr3),
1585 (beacon->capability & (1 << 0xf)) ? '1' : '0', 1592 (beacon->capability & (1 << 0xf)) ? '1' : '0',
1586 (beacon->capability & (1 << 0xe)) ? '1' : '0', 1593 (beacon->capability & (1 << 0xe)) ? '1' : '0',
1587 (beacon->capability & (1 << 0xd)) ? '1' : '0', 1594 (beacon->capability & (1 << 0xd)) ? '1' : '0',
@@ -1600,10 +1607,10 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1600 (beacon->capability & (1 << 0x0)) ? '1' : '0'); 1607 (beacon->capability & (1 << 0x0)) ? '1' : '0');
1601 1608
1602 if (ieee80211_network_init(ieee, beacon, &network, stats)) { 1609 if (ieee80211_network_init(ieee, beacon, &network, stats)) {
1603 IEEE80211_DEBUG_SCAN("Dropped '%s' (" MAC_FMT ") via %s.\n", 1610 IEEE80211_DEBUG_SCAN("Dropped '%s' (%s) via %s.\n",
1604 escape_essid(info_element->data, 1611 escape_essid(info_element->data,
1605 info_element->len), 1612 info_element->len),
1606 MAC_ARG(beacon->header.addr3), 1613 print_mac(mac, beacon->header.addr3),
1607 is_beacon(beacon->header.frame_ctl) ? 1614 is_beacon(beacon->header.frame_ctl) ?
1608 "BEACON" : "PROBE RESPONSE"); 1615 "BEACON" : "PROBE RESPONSE");
1609 return; 1616 return;
@@ -1637,11 +1644,11 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1637 /* If there are no more slots, expire the oldest */ 1644 /* If there are no more slots, expire the oldest */
1638 list_del(&oldest->list); 1645 list_del(&oldest->list);
1639 target = oldest; 1646 target = oldest;
1640 IEEE80211_DEBUG_SCAN("Expired '%s' (" MAC_FMT ") from " 1647 IEEE80211_DEBUG_SCAN("Expired '%s' (%s) from "
1641 "network list.\n", 1648 "network list.\n",
1642 escape_essid(target->ssid, 1649 escape_essid(target->ssid,
1643 target->ssid_len), 1650 target->ssid_len),
1644 MAC_ARG(target->bssid)); 1651 print_mac(mac, target->bssid));
1645 ieee80211_network_reset(target); 1652 ieee80211_network_reset(target);
1646 } else { 1653 } else {
1647 /* Otherwise just pull from the free list */ 1654 /* Otherwise just pull from the free list */
@@ -1651,10 +1658,10 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1651 } 1658 }
1652 1659
1653#ifdef CONFIG_IEEE80211_DEBUG 1660#ifdef CONFIG_IEEE80211_DEBUG
1654 IEEE80211_DEBUG_SCAN("Adding '%s' (" MAC_FMT ") via %s.\n", 1661 IEEE80211_DEBUG_SCAN("Adding '%s' (%s) via %s.\n",
1655 escape_essid(network.ssid, 1662 escape_essid(network.ssid,
1656 network.ssid_len), 1663 network.ssid_len),
1657 MAC_ARG(network.bssid), 1664 print_mac(mac, network.bssid),
1658 is_beacon(beacon->header.frame_ctl) ? 1665 is_beacon(beacon->header.frame_ctl) ?
1659 "BEACON" : "PROBE RESPONSE"); 1666 "BEACON" : "PROBE RESPONSE");
1660#endif 1667#endif
@@ -1662,10 +1669,10 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1662 network.ibss_dfs = NULL; 1669 network.ibss_dfs = NULL;
1663 list_add_tail(&target->list, &ieee->network_list); 1670 list_add_tail(&target->list, &ieee->network_list);
1664 } else { 1671 } else {
1665 IEEE80211_DEBUG_SCAN("Updating '%s' (" MAC_FMT ") via %s.\n", 1672 IEEE80211_DEBUG_SCAN("Updating '%s' (%s) via %s.\n",
1666 escape_essid(target->ssid, 1673 escape_essid(target->ssid,
1667 target->ssid_len), 1674 target->ssid_len),
1668 MAC_ARG(target->bssid), 1675 print_mac(mac, target->bssid),
1669 is_beacon(beacon->header.frame_ctl) ? 1676 is_beacon(beacon->header.frame_ctl) ?
1670 "BEACON" : "PROBE RESPONSE"); 1677 "BEACON" : "PROBE RESPONSE");
1671 update_network(target, &network); 1678 update_network(target, &network);
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c
index 465b73d50532..9b58dd67acb6 100644
--- a/net/ieee80211/ieee80211_wx.c
+++ b/net/ieee80211/ieee80211_wx.c
@@ -257,6 +257,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
257 char *ev = extra; 257 char *ev = extra;
258 char *stop = ev + wrqu->data.length; 258 char *stop = ev + wrqu->data.length;
259 int i = 0; 259 int i = 0;
260 DECLARE_MAC_BUF(mac);
260 261
261 IEEE80211_DEBUG_WX("Getting scan\n"); 262 IEEE80211_DEBUG_WX("Getting scan\n");
262 263
@@ -274,10 +275,10 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
274 ev = ieee80211_translate_scan(ieee, ev, stop, network); 275 ev = ieee80211_translate_scan(ieee, ev, stop, network);
275 else 276 else
276 IEEE80211_DEBUG_SCAN("Not showing network '%s (" 277 IEEE80211_DEBUG_SCAN("Not showing network '%s ("
277 MAC_FMT ")' due to age (%dms).\n", 278 "%s)' due to age (%dms).\n",
278 escape_essid(network->ssid, 279 escape_essid(network->ssid,
279 network->ssid_len), 280 network->ssid_len),
280 MAC_ARG(network->bssid), 281 print_mac(mac, network->bssid),
281 jiffies_to_msecs(jiffies - 282 jiffies_to_msecs(jiffies -
282 network-> 283 network->
283 last_scanned)); 284 last_scanned));
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c
index e475f2e1be13..4c0feb2dacd8 100644
--- a/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -372,6 +372,7 @@ ieee80211softmac_handle_assoc_response(struct net_device * dev,
372 u16 status = le16_to_cpup(&resp->status); 372 u16 status = le16_to_cpup(&resp->status);
373 struct ieee80211softmac_network *network = NULL; 373 struct ieee80211softmac_network *network = NULL;
374 unsigned long flags; 374 unsigned long flags;
375 DECLARE_MAC_BUF(mac2);
375 376
376 if (unlikely(!mac->running)) 377 if (unlikely(!mac->running))
377 return -ENODEV; 378 return -ENODEV;
@@ -388,7 +389,8 @@ ieee80211softmac_handle_assoc_response(struct net_device * dev,
388 389
389 /* someone sending us things without us knowing him? Ignore. */ 390 /* someone sending us things without us knowing him? Ignore. */
390 if (!network) { 391 if (!network) {
391 dprintk(KERN_INFO PFX "Received unrequested assocation response from " MAC_FMT "\n", MAC_ARG(resp->header.addr3)); 392 dprintk(KERN_INFO PFX "Received unrequested assocation response from %s\n",
393 print_mac(mac2, resp->header.addr3));
392 spin_unlock_irqrestore(&mac->lock, flags); 394 spin_unlock_irqrestore(&mac->lock, flags);
393 return 0; 395 return 0;
394 } 396 }
diff --git a/net/ieee80211/softmac/ieee80211softmac_auth.c b/net/ieee80211/softmac/ieee80211softmac_auth.c
index 826c32d24461..855fa0fe641b 100644
--- a/net/ieee80211/softmac/ieee80211softmac_auth.c
+++ b/net/ieee80211/softmac/ieee80211softmac_auth.c
@@ -35,6 +35,7 @@ ieee80211softmac_auth_req(struct ieee80211softmac_device *mac,
35{ 35{
36 struct ieee80211softmac_auth_queue_item *auth; 36 struct ieee80211softmac_auth_queue_item *auth;
37 unsigned long flags; 37 unsigned long flags;
38 DECLARE_MAC_BUF(mac2);
38 39
39 if (net->authenticating || net->authenticated) 40 if (net->authenticating || net->authenticated)
40 return 0; 41 return 0;
@@ -43,7 +44,7 @@ ieee80211softmac_auth_req(struct ieee80211softmac_device *mac,
43 /* Add the network if it's not already added */ 44 /* Add the network if it's not already added */
44 ieee80211softmac_add_network(mac, net); 45 ieee80211softmac_add_network(mac, net);
45 46
46 dprintk(KERN_NOTICE PFX "Queueing Authentication Request to "MAC_FMT"\n", MAC_ARG(net->bssid)); 47 dprintk(KERN_NOTICE PFX "Queueing Authentication Request to %s\n", print_mac(mac2, net->bssid));
47 /* Queue the auth request */ 48 /* Queue the auth request */
48 auth = (struct ieee80211softmac_auth_queue_item *) 49 auth = (struct ieee80211softmac_auth_queue_item *)
49 kmalloc(sizeof(struct ieee80211softmac_auth_queue_item), GFP_KERNEL); 50 kmalloc(sizeof(struct ieee80211softmac_auth_queue_item), GFP_KERNEL);
@@ -76,6 +77,7 @@ ieee80211softmac_auth_queue(struct work_struct *work)
76 struct ieee80211softmac_auth_queue_item *auth; 77 struct ieee80211softmac_auth_queue_item *auth;
77 struct ieee80211softmac_network *net; 78 struct ieee80211softmac_network *net;
78 unsigned long flags; 79 unsigned long flags;
80 DECLARE_MAC_BUF(mac2);
79 81
80 auth = container_of(work, struct ieee80211softmac_auth_queue_item, 82 auth = container_of(work, struct ieee80211softmac_auth_queue_item,
81 work.work); 83 work.work);
@@ -99,13 +101,14 @@ ieee80211softmac_auth_queue(struct work_struct *work)
99 auth->retry--; 101 auth->retry--;
100 spin_unlock_irqrestore(&mac->lock, flags); 102 spin_unlock_irqrestore(&mac->lock, flags);
101 if (ieee80211softmac_send_mgt_frame(mac, auth->net, IEEE80211_STYPE_AUTH, auth->state)) 103 if (ieee80211softmac_send_mgt_frame(mac, auth->net, IEEE80211_STYPE_AUTH, auth->state))
102 dprintk(KERN_NOTICE PFX "Sending Authentication Request to "MAC_FMT" failed (this shouldn't happen, wait for the timeout).\n", MAC_ARG(net->bssid)); 104 dprintk(KERN_NOTICE PFX "Sending Authentication Request to %s failed (this shouldn't happen, wait for the timeout).\n",
105 print_mac(mac2, net->bssid));
103 else 106 else
104 dprintk(KERN_NOTICE PFX "Sent Authentication Request to "MAC_FMT".\n", MAC_ARG(net->bssid)); 107 dprintk(KERN_NOTICE PFX "Sent Authentication Request to %s.\n", print_mac(mac2, net->bssid));
105 return; 108 return;
106 } 109 }
107 110
108 printkl(KERN_WARNING PFX "Authentication timed out with "MAC_FMT"\n", MAC_ARG(net->bssid)); 111 printkl(KERN_WARNING PFX "Authentication timed out with %s\n", print_mac(mac2, net->bssid));
109 /* Remove this item from the queue */ 112 /* Remove this item from the queue */
110 spin_lock_irqsave(&mac->lock, flags); 113 spin_lock_irqsave(&mac->lock, flags);
111 net->authenticating = 0; 114 net->authenticating = 0;
@@ -142,6 +145,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
142 struct ieee80211softmac_network *net = NULL; 145 struct ieee80211softmac_network *net = NULL;
143 unsigned long flags; 146 unsigned long flags;
144 u8 * data; 147 u8 * data;
148 DECLARE_MAC_BUF(mac2);
145 149
146 if (unlikely(!mac->running)) 150 if (unlikely(!mac->running))
147 return -ENODEV; 151 return -ENODEV;
@@ -161,7 +165,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
161 /* Make sure that we've got an auth queue item for this request */ 165 /* Make sure that we've got an auth queue item for this request */
162 if(aq == NULL) 166 if(aq == NULL)
163 { 167 {
164 dprintkl(KERN_DEBUG PFX "Authentication response received from "MAC_FMT" but no queue item exists.\n", MAC_ARG(auth->header.addr2)); 168 dprintkl(KERN_DEBUG PFX "Authentication response received from %s but no queue item exists.\n", print_mac(mac2, auth->header.addr2));
165 /* Error #? */ 169 /* Error #? */
166 return -1; 170 return -1;
167 } 171 }
@@ -169,7 +173,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
169 /* Check for out of order authentication */ 173 /* Check for out of order authentication */
170 if(!net->authenticating) 174 if(!net->authenticating)
171 { 175 {
172 dprintkl(KERN_DEBUG PFX "Authentication response received from "MAC_FMT" but did not request authentication.\n",MAC_ARG(auth->header.addr2)); 176 dprintkl(KERN_DEBUG PFX "Authentication response received from %s but did not request authentication.\n",print_mac(mac2, auth->header.addr2));
173 return -1; 177 return -1;
174 } 178 }
175 179
@@ -187,7 +191,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
187 spin_unlock_irqrestore(&mac->lock, flags); 191 spin_unlock_irqrestore(&mac->lock, flags);
188 192
189 /* Send event */ 193 /* Send event */
190 printkl(KERN_NOTICE PFX "Open Authentication completed with "MAC_FMT"\n", MAC_ARG(net->bssid)); 194 printkl(KERN_NOTICE PFX "Open Authentication completed with %s\n", print_mac(mac2, net->bssid));
191 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, net); 195 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, net);
192 break; 196 break;
193 default: 197 default:
@@ -197,8 +201,8 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
197 net->authenticating = 0; 201 net->authenticating = 0;
198 spin_unlock_irqrestore(&mac->lock, flags); 202 spin_unlock_irqrestore(&mac->lock, flags);
199 203
200 printkl(KERN_NOTICE PFX "Open Authentication with "MAC_FMT" failed, error code: %i\n", 204 printkl(KERN_NOTICE PFX "Open Authentication with %s failed, error code: %i\n",
201 MAC_ARG(net->bssid), le16_to_cpup(&auth->status)); 205 print_mac(mac2, net->bssid), le16_to_cpup(&auth->status));
202 /* Count the error? */ 206 /* Count the error? */
203 break; 207 break;
204 } 208 }
@@ -253,13 +257,13 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
253 net->authenticating = 0; 257 net->authenticating = 0;
254 net->authenticated = 1; 258 net->authenticated = 1;
255 spin_unlock_irqrestore(&mac->lock, flags); 259 spin_unlock_irqrestore(&mac->lock, flags);
256 printkl(KERN_NOTICE PFX "Shared Key Authentication completed with "MAC_FMT"\n", 260 printkl(KERN_NOTICE PFX "Shared Key Authentication completed with %s\n",
257 MAC_ARG(net->bssid)); 261 print_mac(mac2, net->bssid));
258 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, net); 262 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, net);
259 break; 263 break;
260 default: 264 default:
261 printkl(KERN_NOTICE PFX "Shared Key Authentication with "MAC_FMT" failed, error code: %i\n", 265 printkl(KERN_NOTICE PFX "Shared Key Authentication with %s failed, error code: %i\n",
262 MAC_ARG(net->bssid), le16_to_cpup(&auth->status)); 266 print_mac(mac2, net->bssid), le16_to_cpup(&auth->status));
263 /* Lock and reset flags */ 267 /* Lock and reset flags */
264 spin_lock_irqsave(&mac->lock, flags); 268 spin_lock_irqsave(&mac->lock, flags);
265 net->authenticating = 0; 269 net->authenticating = 0;
@@ -375,6 +379,7 @@ ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *de
375 379
376 struct ieee80211softmac_network *net = NULL; 380 struct ieee80211softmac_network *net = NULL;
377 struct ieee80211softmac_device *mac = ieee80211_priv(dev); 381 struct ieee80211softmac_device *mac = ieee80211_priv(dev);
382 DECLARE_MAC_BUF(mac2);
378 383
379 if (unlikely(!mac->running)) 384 if (unlikely(!mac->running))
380 return -ENODEV; 385 return -ENODEV;
@@ -387,8 +392,8 @@ ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *de
387 net = ieee80211softmac_get_network_by_bssid(mac, deauth->header.addr2); 392 net = ieee80211softmac_get_network_by_bssid(mac, deauth->header.addr2);
388 393
389 if (net == NULL) { 394 if (net == NULL) {
390 dprintkl(KERN_DEBUG PFX "Received deauthentication packet from "MAC_FMT", but that network is unknown.\n", 395 dprintkl(KERN_DEBUG PFX "Received deauthentication packet from %s, but that network is unknown.\n",
391 MAC_ARG(deauth->header.addr2)); 396 print_mac(mac2, deauth->header.addr2));
392 return 0; 397 return 0;
393 } 398 }
394 399
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index 5742dc803b79..8e8ad08a411c 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -72,6 +72,7 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
72 struct ieee80211softmac_device *sm = ieee80211_priv(net_dev); 72 struct ieee80211softmac_device *sm = ieee80211_priv(net_dev);
73 struct ieee80211softmac_auth_queue_item *authptr; 73 struct ieee80211softmac_auth_queue_item *authptr;
74 int length = 0; 74 int length = 0;
75 DECLARE_MAC_BUF(mac);
75 76
76check_assoc_again: 77check_assoc_again:
77 mutex_lock(&sm->associnfo.mutex); 78 mutex_lock(&sm->associnfo.mutex);