aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/802/tr.c28
-rw-r--r--net/appletalk/aarp.c9
-rw-r--r--net/atm/br2684.c16
-rw-r--r--net/atm/lec.c29
-rw-r--r--net/core/netpoll.c12
-rw-r--r--net/core/pktgen.c17
-rw-r--r--net/ethernet/eth.c8
-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
-rw-r--r--net/irda/irlan/irlan_client.c6
-rw-r--r--net/llc/llc_proc.c12
-rw-r--r--net/mac80211/debugfs_key.c3
-rw-r--r--net/mac80211/debugfs_netdev.c3
-rw-r--r--net/mac80211/debugfs_sta.c6
-rw-r--r--net/mac80211/event.c5
-rw-r--r--net/mac80211/ieee80211.c5
-rw-r--r--net/mac80211/ieee80211_ioctl.c5
-rw-r--r--net/mac80211/ieee80211_sta.c180
-rw-r--r--net/mac80211/key.c10
-rw-r--r--net/mac80211/rc80211_simple.c5
-rw-r--r--net/mac80211/rx.c103
-rw-r--r--net/mac80211/sta_info.c13
-rw-r--r--net/mac80211/tkip.c10
-rw-r--r--net/mac80211/tx.c32
-rw-r--r--net/mac80211/wpa.c19
-rw-r--r--net/tipc/eth_media.c4
31 files changed, 381 insertions, 321 deletions
diff --git a/net/802/tr.c b/net/802/tr.c
index 55c76d77d32..aa3c2e936ab 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -283,8 +283,10 @@ void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,struct net_device *
283 if(entry) 283 if(entry)
284 { 284 {
285#if TR_SR_DEBUG 285#if TR_SR_DEBUG
286printk("source routing for %02X:%02X:%02X:%02X:%02X:%02X\n",trh->daddr[0], 286{
287 trh->daddr[1],trh->daddr[2],trh->daddr[3],trh->daddr[4],trh->daddr[5]); 287DECLARE_MAC_BUF(mac);
288printk("source routing for %s\n",print_mac(mac, trh->daddr));
289}
288#endif 290#endif
289 if(!entry->local_ring && (ntohs(entry->rcf) & TR_RCF_LEN_MASK) >> 8) 291 if(!entry->local_ring && (ntohs(entry->rcf) & TR_RCF_LEN_MASK) >> 8)
290 { 292 {
@@ -366,10 +368,9 @@ static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev)
366 if(entry==NULL) 368 if(entry==NULL)
367 { 369 {
368#if TR_SR_DEBUG 370#if TR_SR_DEBUG
369printk("adding rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n", 371 DECLARE_MAC_BUF(mac);
370 trh->saddr[0],trh->saddr[1],trh->saddr[2], 372 printk("adding rif_entry: addr:%s rcf:%04X\n",
371 trh->saddr[3],trh->saddr[4],trh->saddr[5], 373 print_mac(mac, trh->saddr), ntohs(trh->rcf));
372 ntohs(trh->rcf));
373#endif 374#endif
374 /* 375 /*
375 * Allocate our new entry. A failure to allocate loses 376 * Allocate our new entry. A failure to allocate loses
@@ -414,10 +415,11 @@ printk("adding rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n",
414 !(trh->rcf & htons(TR_RCF_BROADCAST_MASK))) 415 !(trh->rcf & htons(TR_RCF_BROADCAST_MASK)))
415 { 416 {
416#if TR_SR_DEBUG 417#if TR_SR_DEBUG
417printk("updating rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n", 418{
418 trh->saddr[0],trh->saddr[1],trh->saddr[2], 419DECLARE_MAC_BUF(mac);
419 trh->saddr[3],trh->saddr[4],trh->saddr[5], 420printk("updating rif_entry: addr:%s rcf:%04X\n",
420 ntohs(trh->rcf)); 421 print_mac(mac, trh->saddr), ntohs(trh->rcf));
422}
421#endif 423#endif
422 entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK); 424 entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK);
423 memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short)); 425 memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short));
@@ -528,6 +530,7 @@ static int rif_seq_show(struct seq_file *seq, void *v)
528{ 530{
529 int j, rcf_len, segment, brdgnmb; 531 int j, rcf_len, segment, brdgnmb;
530 struct rif_cache *entry = v; 532 struct rif_cache *entry = v;
533 DECLARE_MAC_BUF(mac);
531 534
532 if (v == SEQ_START_TOKEN) 535 if (v == SEQ_START_TOKEN)
533 seq_puts(seq, 536 seq_puts(seq,
@@ -537,10 +540,9 @@ static int rif_seq_show(struct seq_file *seq, void *v)
537 long ttl = (long) (entry->last_used + sysctl_tr_rif_timeout) 540 long ttl = (long) (entry->last_used + sysctl_tr_rif_timeout)
538 - (long) jiffies; 541 - (long) jiffies;
539 542
540 seq_printf(seq, "%s %02X:%02X:%02X:%02X:%02X:%02X %7li ", 543 seq_printf(seq, "%s %s %7li ",
541 dev?dev->name:"?", 544 dev?dev->name:"?",
542 entry->addr[0],entry->addr[1],entry->addr[2], 545 print_mac(mac, entry->addr),
543 entry->addr[3],entry->addr[4],entry->addr[5],
544 ttl/HZ); 546 ttl/HZ);
545 547
546 if (entry->local_ring) 548 if (entry->local_ring)
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index e9a51a69870..92cd74973c9 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -997,6 +997,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v)
997 struct aarp_iter_state *iter = seq->private; 997 struct aarp_iter_state *iter = seq->private;
998 struct aarp_entry *entry = v; 998 struct aarp_entry *entry = v;
999 unsigned long now = jiffies; 999 unsigned long now = jiffies;
1000 DECLARE_MAC_BUF(mac);
1000 1001
1001 if (v == SEQ_START_TOKEN) 1002 if (v == SEQ_START_TOKEN)
1002 seq_puts(seq, 1003 seq_puts(seq,
@@ -1007,13 +1008,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v)
1007 ntohs(entry->target_addr.s_net), 1008 ntohs(entry->target_addr.s_net),
1008 (unsigned int) entry->target_addr.s_node, 1009 (unsigned int) entry->target_addr.s_node,
1009 entry->dev ? entry->dev->name : "????"); 1010 entry->dev ? entry->dev->name : "????");
1010 seq_printf(seq, "%02X:%02X:%02X:%02X:%02X:%02X", 1011 seq_printf(seq, "%s", print_mac(mac, entry->hwaddr));
1011 entry->hwaddr[0] & 0xFF,
1012 entry->hwaddr[1] & 0xFF,
1013 entry->hwaddr[2] & 0xFF,
1014 entry->hwaddr[3] & 0xFF,
1015 entry->hwaddr[4] & 0xFF,
1016 entry->hwaddr[5] & 0xFF);
1017 seq_printf(seq, " %8s", 1012 seq_printf(seq, " %8s",
1018 dt2str((long)entry->expires_at - (long)now)); 1013 dt2str((long)entry->expires_at - (long)now));
1019 if (iter->table == unresolved) 1014 if (iter->table == unresolved)
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index 81eb4f4cbe1..c742d37bfb9 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -709,17 +709,13 @@ static int br2684_seq_show(struct seq_file *seq, void *v)
709 br2684_devs); 709 br2684_devs);
710 const struct net_device *net_dev = brdev->net_dev; 710 const struct net_device *net_dev = brdev->net_dev;
711 const struct br2684_vcc *brvcc; 711 const struct br2684_vcc *brvcc;
712 DECLARE_MAC_BUF(mac);
712 713
713 seq_printf(seq, "dev %.16s: num=%d, mac=%02X:%02X:" 714 seq_printf(seq, "dev %.16s: num=%d, mac=%s (%s)\n",
714 "%02X:%02X:%02X:%02X (%s)\n", net_dev->name, 715 net_dev->name,
715 brdev->number, 716 brdev->number,
716 net_dev->dev_addr[0], 717 print_mac(mac, net_dev->dev_addr),
717 net_dev->dev_addr[1], 718 brdev->mac_was_set ? "set" : "auto");
718 net_dev->dev_addr[2],
719 net_dev->dev_addr[3],
720 net_dev->dev_addr[4],
721 net_dev->dev_addr[5],
722 brdev->mac_was_set ? "set" : "auto");
723 719
724 list_for_each_entry(brvcc, &brdev->brvccs, brvccs) { 720 list_for_each_entry(brvcc, &brdev->brvccs, brvccs) {
725 seq_printf(seq, " vcc %d.%d.%d: encaps=%s" 721 seq_printf(seq, " vcc %d.%d.%d: encaps=%s"
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 813a090dcaf..c909c76223e 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -266,6 +266,7 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
266 char buf[300]; 266 char buf[300];
267 int i = 0; 267 int i = 0;
268#endif /* DUMP_PACKETS >0 */ 268#endif /* DUMP_PACKETS >0 */
269 DECLARE_MAC_BUF(mac);
269 270
270 pr_debug("lec_start_xmit called\n"); 271 pr_debug("lec_start_xmit called\n");
271 if (!priv->lecd) { 272 if (!priv->lecd) {
@@ -373,19 +374,15 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
373 if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) { 374 if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) {
374 pr_debug("%s:lec_start_xmit: queuing packet, ", 375 pr_debug("%s:lec_start_xmit: queuing packet, ",
375 dev->name); 376 dev->name);
376 pr_debug("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", 377 pr_debug("MAC address %s\n",
377 lec_h->h_dest[0], lec_h->h_dest[1], 378 print_mac(mac, lec_h->h_dest));
378 lec_h->h_dest[2], lec_h->h_dest[3],
379 lec_h->h_dest[4], lec_h->h_dest[5]);
380 skb_queue_tail(&entry->tx_wait, skb); 379 skb_queue_tail(&entry->tx_wait, skb);
381 } else { 380 } else {
382 pr_debug 381 pr_debug
383 ("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ", 382 ("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ",
384 dev->name); 383 dev->name);
385 pr_debug("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", 384 pr_debug("MAC address %s\n",
386 lec_h->h_dest[0], lec_h->h_dest[1], 385 print_mac(mac, lec_h->h_dest));
387 lec_h->h_dest[2], lec_h->h_dest[3],
388 lec_h->h_dest[4], lec_h->h_dest[5]);
389 priv->stats.tx_dropped++; 386 priv->stats.tx_dropped++;
390 dev_kfree_skb(skb); 387 dev_kfree_skb(skb);
391 } 388 }
@@ -397,9 +394,8 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
397 394
398 while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) { 395 while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) {
399 pr_debug("lec.c: emptying tx queue, "); 396 pr_debug("lec.c: emptying tx queue, ");
400 pr_debug("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", 397 pr_debug("MAC address %s\n",
401 lec_h->h_dest[0], lec_h->h_dest[1], lec_h->h_dest[2], 398 print_mac(mac, lec_h->h_dest));
402 lec_h->h_dest[3], lec_h->h_dest[4], lec_h->h_dest[5]);
403 lec_send(vcc, skb2, priv); 399 lec_send(vcc, skb2, priv);
404 } 400 }
405 401
@@ -453,6 +449,7 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
453 struct lec_arp_table *entry; 449 struct lec_arp_table *entry;
454 int i; 450 int i;
455 char *tmp; /* FIXME */ 451 char *tmp; /* FIXME */
452 DECLARE_MAC_BUF(mac);
456 453
457 atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); 454 atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
458 mesg = (struct atmlec_msg *)skb->data; 455 mesg = (struct atmlec_msg *)skb->data;
@@ -539,13 +536,9 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
539 struct net_bridge_fdb_entry *f; 536 struct net_bridge_fdb_entry *f;
540 537
541 pr_debug 538 pr_debug
542 ("%s: bridge zeppelin asks about 0x%02x:%02x:%02x:%02x:%02x:%02x\n", 539 ("%s: bridge zeppelin asks about %s\n",
543 dev->name, mesg->content.proxy.mac_addr[0], 540 dev->name,
544 mesg->content.proxy.mac_addr[1], 541 print_mac(mac, mesg->content.proxy.mac_addr));
545 mesg->content.proxy.mac_addr[2],
546 mesg->content.proxy.mac_addr[3],
547 mesg->content.proxy.mac_addr[4],
548 mesg->content.proxy.mac_addr[5]);
549 542
550 if (br_fdb_get_hook == NULL || dev->br_port == NULL) 543 if (br_fdb_get_hook == NULL || dev->br_port == NULL)
551 break; 544 break;
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index bb7523a5b40..e13602d8154 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -534,6 +534,7 @@ out:
534 534
535void netpoll_print_options(struct netpoll *np) 535void netpoll_print_options(struct netpoll *np)
536{ 536{
537 DECLARE_MAC_BUF(mac);
537 printk(KERN_INFO "%s: local port %d\n", 538 printk(KERN_INFO "%s: local port %d\n",
538 np->name, np->local_port); 539 np->name, np->local_port);
539 printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n", 540 printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n",
@@ -544,15 +545,8 @@ void netpoll_print_options(struct netpoll *np)
544 np->name, np->remote_port); 545 np->name, np->remote_port);
545 printk(KERN_INFO "%s: remote IP %d.%d.%d.%d\n", 546 printk(KERN_INFO "%s: remote IP %d.%d.%d.%d\n",
546 np->name, HIPQUAD(np->remote_ip)); 547 np->name, HIPQUAD(np->remote_ip));
547 printk(KERN_INFO "%s: remote ethernet address " 548 printk(KERN_INFO "%s: remote ethernet address %s\n",
548 "%02x:%02x:%02x:%02x:%02x:%02x\n", 549 np->name, print_mac(mac, np->remote_mac));
549 np->name,
550 np->remote_mac[0],
551 np->remote_mac[1],
552 np->remote_mac[2],
553 np->remote_mac[3],
554 np->remote_mac[4],
555 np->remote_mac[5]);
556} 550}
557 551
558int netpoll_parse_options(struct netpoll *np, char *opt) 552int netpoll_parse_options(struct netpoll *np, char *opt)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 94e42be16da..f07bd590f8f 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -599,11 +599,11 @@ static const struct file_operations pktgen_fops = {
599 599
600static int pktgen_if_show(struct seq_file *seq, void *v) 600static int pktgen_if_show(struct seq_file *seq, void *v)
601{ 601{
602 int i;
603 struct pktgen_dev *pkt_dev = seq->private; 602 struct pktgen_dev *pkt_dev = seq->private;
604 __u64 sa; 603 __u64 sa;
605 __u64 stopped; 604 __u64 stopped;
606 __u64 now = getCurUs(); 605 __u64 now = getCurUs();
606 DECLARE_MAC_BUF(mac);
607 607
608 seq_printf(seq, 608 seq_printf(seq,
609 "Params: count %llu min_pkt_size: %u max_pkt_size: %u\n", 609 "Params: count %llu min_pkt_size: %u max_pkt_size: %u\n",
@@ -648,19 +648,12 @@ static int pktgen_if_show(struct seq_file *seq, void *v)
648 648
649 seq_puts(seq, " src_mac: "); 649 seq_puts(seq, " src_mac: ");
650 650
651 if (is_zero_ether_addr(pkt_dev->src_mac)) 651 seq_printf(seq, "%s ",
652 for (i = 0; i < 6; i++) 652 print_mac(mac, is_zero_ether_addr(pkt_dev->src_mac) ?
653 seq_printf(seq, "%02X%s", pkt_dev->odev->dev_addr[i], 653 pkt_dev->odev->dev_addr : pkt_dev->src_mac));
654 i == 5 ? " " : ":");
655 else
656 for (i = 0; i < 6; i++)
657 seq_printf(seq, "%02X%s", pkt_dev->src_mac[i],
658 i == 5 ? " " : ":");
659 654
660 seq_printf(seq, "dst_mac: "); 655 seq_printf(seq, "dst_mac: ");
661 for (i = 0; i < 6; i++) 656 seq_printf(seq, "%s\n", print_mac(mac, pkt_dev->dst_mac));
662 seq_printf(seq, "%02X%s", pkt_dev->dst_mac[i],
663 i == 5 ? "\n" : ":");
664 657
665 seq_printf(seq, 658 seq_printf(seq,
666 " udp_src_min: %d udp_src_max: %d udp_dst_min: %d udp_dst_max: %d\n", 659 " udp_src_min: %d udp_src_max: %d udp_dst_min: %d udp_dst_max: %d\n",
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 57c592ed010..2aaf6faf74a 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -337,3 +337,11 @@ struct net_device *alloc_etherdev_mq(int sizeof_priv, unsigned int queue_count)
337 return alloc_netdev_mq(sizeof_priv, "eth%d", ether_setup, queue_count); 337 return alloc_netdev_mq(sizeof_priv, "eth%d", ether_setup, queue_count);
338} 338}
339EXPORT_SYMBOL(alloc_etherdev_mq); 339EXPORT_SYMBOL(alloc_etherdev_mq);
340
341char *print_mac(char *buf, const u8 *addr)
342{
343 sprintf(buf, MAC_FMT,
344 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
345 return buf;
346}
347EXPORT_SYMBOL(print_mac);
diff --git a/net/ieee80211/ieee80211_crypt_ccmp.c b/net/ieee80211/ieee80211_crypt_ccmp.c
index 2e6b099fc84..0936a3e0210 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 5a48d8e0aec..6cc54eeca3e 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 6284c99b456..21c0fadde03 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 465b73d5053..9b58dd67acb 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 e475f2e1be1..4c0feb2dacd 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 826c32d2446..855fa0fe641 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 5742dc803b7..8e8ad08a411 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);
diff --git a/net/irda/irlan/irlan_client.c b/net/irda/irlan/irlan_client.c
index a4c1c954582..87039c2fb6a 100644
--- a/net/irda/irlan/irlan_client.c
+++ b/net/irda/irlan/irlan_client.c
@@ -436,6 +436,7 @@ static void irlan_check_response_param(struct irlan_cb *self, char *param,
436 __u16 tmp_cpu; /* Temporary value in host order */ 436 __u16 tmp_cpu; /* Temporary value in host order */
437 __u8 *bytes; 437 __u8 *bytes;
438 int i; 438 int i;
439 DECLARE_MAC_BUF(mac);
439 440
440 IRDA_DEBUG(4, "%s(), parm=%s\n", __FUNCTION__ , param); 441 IRDA_DEBUG(4, "%s(), parm=%s\n", __FUNCTION__ , param);
441 442
@@ -520,9 +521,8 @@ static void irlan_check_response_param(struct irlan_cb *self, char *param,
520 /* FILTER_ENTRY, have we got an ethernet address? */ 521 /* FILTER_ENTRY, have we got an ethernet address? */
521 if (strcmp(param, "FILTER_ENTRY") == 0) { 522 if (strcmp(param, "FILTER_ENTRY") == 0) {
522 bytes = value; 523 bytes = value;
523 IRDA_DEBUG(4, "Ethernet address = %02x:%02x:%02x:%02x:%02x:%02x\n", 524 IRDA_DEBUG(4, "Ethernet address = %s\n",
524 bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], 525 print_mac(mac, bytes));
525 bytes[5]);
526 for (i = 0; i < 6; i++) 526 for (i = 0; i < 6; i++)
527 self->dev->dev_addr[i] = bytes[i]; 527 self->dev->dev_addr[i] = bytes[i];
528 } 528 }
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c
index 4865d82896b..cb34bc0518e 100644
--- a/net/llc/llc_proc.c
+++ b/net/llc/llc_proc.c
@@ -25,10 +25,10 @@
25#include <net/llc_c_st.h> 25#include <net/llc_c_st.h>
26#include <net/llc_conn.h> 26#include <net/llc_conn.h>
27 27
28static void llc_ui_format_mac(struct seq_file *seq, unsigned char *mac) 28static void llc_ui_format_mac(struct seq_file *seq, u8 *addr)
29{ 29{
30 seq_printf(seq, "%02X:%02X:%02X:%02X:%02X:%02X", 30 DECLARE_MAC_BUF(mac);
31 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 31 seq_printf(seq, "%s", print_mac(mac, addr));
32} 32}
33 33
34static struct sock *llc_get_sk_idx(loff_t pos) 34static struct sock *llc_get_sk_idx(loff_t pos)
@@ -128,8 +128,10 @@ static int llc_seq_socket_show(struct seq_file *seq, void *v)
128 128
129 if (llc->dev) 129 if (llc->dev)
130 llc_ui_format_mac(seq, llc->dev->dev_addr); 130 llc_ui_format_mac(seq, llc->dev->dev_addr);
131 else 131 else {
132 seq_printf(seq, "00:00:00:00:00:00"); 132 u8 addr[6] = {0,0,0,0,0,0};
133 llc_ui_format_mac(seq, addr);
134 }
133 seq_printf(seq, "@%02X ", llc->sap->laddr.lsap); 135 seq_printf(seq, "@%02X ", llc->sap->laddr.lsap);
134 llc_ui_format_mac(seq, llc->daddr.mac); 136 llc_ui_format_mac(seq, llc->daddr.mac);
135 seq_printf(seq, "@%02X %8d %8d %2d %3d %4d\n", llc->daddr.lsap, 137 seq_printf(seq, "@%02X %8d %8d %2d %3d %4d\n", llc->daddr.lsap,
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c
index 8e4a1bcd16e..c881524c872 100644
--- a/net/mac80211/debugfs_key.c
+++ b/net/mac80211/debugfs_key.c
@@ -262,11 +262,12 @@ void ieee80211_debugfs_key_sta_link(struct ieee80211_key *key,
262 struct sta_info *sta) 262 struct sta_info *sta)
263{ 263{
264 char buf[50]; 264 char buf[50];
265 DECLARE_MAC_BUF(mac);
265 266
266 if (!key->debugfs.dir) 267 if (!key->debugfs.dir)
267 return; 268 return;
268 269
269 sprintf(buf, "../../stations/" MAC_FMT, MAC_ARG(sta->addr)); 270 sprintf(buf, "../../stations/%s", print_mac(mac, sta->addr));
270 key->debugfs.stalink = 271 key->debugfs.stalink =
271 debugfs_create_symlink("station", key->debugfs.dir, buf); 272 debugfs_create_symlink("station", key->debugfs.dir, buf);
272} 273}
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index 8ceda33efc1..9efb84c47bb 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -66,7 +66,8 @@ static ssize_t ieee80211_if_fmt_##name( \
66 const struct ieee80211_sub_if_data *sdata, char *buf, \ 66 const struct ieee80211_sub_if_data *sdata, char *buf, \
67 int buflen) \ 67 int buflen) \
68{ \ 68{ \
69 return scnprintf(buf, buflen, MAC_FMT "\n", MAC_ARG(sdata->field));\ 69 DECLARE_MAC_BUF(mac); \
70 return scnprintf(buf, buflen, "%s\n", print_mac(mac, sdata->field));\
70} 71}
71 72
72#define __IEEE80211_IF_FILE(name) \ 73#define __IEEE80211_IF_FILE(name) \
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 2daaa802bbd..f7c717c906d 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -203,15 +203,15 @@ STA_OPS(wme_tx_queue);
203 203
204void ieee80211_sta_debugfs_add(struct sta_info *sta) 204void ieee80211_sta_debugfs_add(struct sta_info *sta)
205{ 205{
206 char buf[3*6];
207 struct dentry *stations_dir = sta->local->debugfs.stations; 206 struct dentry *stations_dir = sta->local->debugfs.stations;
207 DECLARE_MAC_BUF(mac);
208 208
209 if (!stations_dir) 209 if (!stations_dir)
210 return; 210 return;
211 211
212 sprintf(buf, MAC_FMT, MAC_ARG(sta->addr)); 212 print_mac(mac, sta->addr);
213 213
214 sta->debugfs.dir = debugfs_create_dir(buf, stations_dir); 214 sta->debugfs.dir = debugfs_create_dir(mac, stations_dir);
215 if (!sta->debugfs.dir) 215 if (!sta->debugfs.dir)
216 return; 216 return;
217 217
diff --git a/net/mac80211/event.c b/net/mac80211/event.c
index 68a526cb762..2280f40b456 100644
--- a/net/mac80211/event.c
+++ b/net/mac80211/event.c
@@ -22,13 +22,14 @@ void mac80211_ev_michael_mic_failure(struct net_device *dev, int keyidx,
22{ 22{
23 union iwreq_data wrqu; 23 union iwreq_data wrqu;
24 char *buf = kmalloc(128, GFP_ATOMIC); 24 char *buf = kmalloc(128, GFP_ATOMIC);
25 DECLARE_MAC_BUF(mac);
25 26
26 if (buf) { 27 if (buf) {
27 /* TODO: needed parameters: count, key type, TSC */ 28 /* TODO: needed parameters: count, key type, TSC */
28 sprintf(buf, "MLME-MICHAELMICFAILURE.indication(" 29 sprintf(buf, "MLME-MICHAELMICFAILURE.indication("
29 "keyid=%d %scast addr=" MAC_FMT ")", 30 "keyid=%d %scast addr=%s)",
30 keyidx, hdr->addr1[0] & 0x01 ? "broad" : "uni", 31 keyidx, hdr->addr1[0] & 0x01 ? "broad" : "uni",
31 MAC_ARG(hdr->addr2)); 32 print_mac(mac, hdr->addr2));
32 memset(&wrqu, 0, sizeof(wrqu)); 33 memset(&wrqu, 0, sizeof(wrqu));
33 wrqu.data.length = strlen(buf); 34 wrqu.data.length = strlen(buf);
34 wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf); 35 wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf);
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 0c1f7b2e157..4229d150e78 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -602,6 +602,7 @@ int ieee80211_if_update_wds(struct net_device *dev, u8 *remote_addr)
602 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 602 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
603 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 603 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
604 struct sta_info *sta; 604 struct sta_info *sta;
605 DECLARE_MAC_BUF(mac);
605 606
606 if (compare_ether_addr(remote_addr, sdata->u.wds.remote_addr) == 0) 607 if (compare_ether_addr(remote_addr, sdata->u.wds.remote_addr) == 0)
607 return 0; 608 return 0;
@@ -619,8 +620,8 @@ int ieee80211_if_update_wds(struct net_device *dev, u8 *remote_addr)
619 sta_info_put(sta); 620 sta_info_put(sta);
620 } else { 621 } else {
621 printk(KERN_DEBUG "%s: could not find STA entry for WDS link " 622 printk(KERN_DEBUG "%s: could not find STA entry for WDS link "
622 "peer " MAC_FMT "\n", 623 "peer %s\n",
623 dev->name, MAC_ARG(sdata->u.wds.remote_addr)); 624 dev->name, print_mac(mac, sdata->u.wds.remote_addr));
624 } 625 }
625 626
626 /* Update WDS link data */ 627 /* Update WDS link data */
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index 51dca21f77c..6ccdde82bde 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -98,9 +98,10 @@ static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr,
98 sta = sta_info_get(local, sta_addr); 98 sta = sta_info_get(local, sta_addr);
99 if (!sta) { 99 if (!sta) {
100#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 100#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
101 DECLARE_MAC_BUF(mac);
101 printk(KERN_DEBUG "%s: set_encrypt - unknown addr " 102 printk(KERN_DEBUG "%s: set_encrypt - unknown addr "
102 MAC_FMT "\n", 103 "%s\n",
103 dev->name, MAC_ARG(sta_addr)); 104 dev->name, print_mac(mac, sta_addr));
104#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 105#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
105 106
106 return -ENOENT; 107 return -ENOENT;
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 8fdbd38e02c..f47cbd294ce 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -319,14 +319,15 @@ static void ieee80211_handle_erp_ie(struct net_device *dev, u8 erp_value)
319 int use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0; 319 int use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0;
320 int preamble_mode = (erp_value & WLAN_ERP_BARKER_PREAMBLE) != 0; 320 int preamble_mode = (erp_value & WLAN_ERP_BARKER_PREAMBLE) != 0;
321 u8 changes = 0; 321 u8 changes = 0;
322 DECLARE_MAC_BUF(mac);
322 323
323 if (use_protection != !!(sdata->flags & IEEE80211_SDATA_USE_PROTECTION)) { 324 if (use_protection != !!(sdata->flags & IEEE80211_SDATA_USE_PROTECTION)) {
324 if (net_ratelimit()) { 325 if (net_ratelimit()) {
325 printk(KERN_DEBUG "%s: CTS protection %s (BSSID=" 326 printk(KERN_DEBUG "%s: CTS protection %s (BSSID="
326 MAC_FMT ")\n", 327 "%s)\n",
327 dev->name, 328 dev->name,
328 use_protection ? "enabled" : "disabled", 329 use_protection ? "enabled" : "disabled",
329 MAC_ARG(ifsta->bssid)); 330 print_mac(mac, ifsta->bssid));
330 } 331 }
331 if (use_protection) 332 if (use_protection)
332 sdata->flags |= IEEE80211_SDATA_USE_PROTECTION; 333 sdata->flags |= IEEE80211_SDATA_USE_PROTECTION;
@@ -338,11 +339,11 @@ static void ieee80211_handle_erp_ie(struct net_device *dev, u8 erp_value)
338 if (preamble_mode != !(sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE)) { 339 if (preamble_mode != !(sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE)) {
339 if (net_ratelimit()) { 340 if (net_ratelimit()) {
340 printk(KERN_DEBUG "%s: switched to %s barker preamble" 341 printk(KERN_DEBUG "%s: switched to %s barker preamble"
341 " (BSSID=" MAC_FMT ")\n", 342 " (BSSID=%s)\n",
342 dev->name, 343 dev->name,
343 (preamble_mode == WLAN_ERP_PREAMBLE_SHORT) ? 344 (preamble_mode == WLAN_ERP_PREAMBLE_SHORT) ?
344 "short" : "long", 345 "short" : "long",
345 MAC_ARG(ifsta->bssid)); 346 print_mac(mac, ifsta->bssid));
346 } 347 }
347 if (preamble_mode) 348 if (preamble_mode)
348 sdata->flags &= ~IEEE80211_SDATA_SHORT_PREAMBLE; 349 sdata->flags &= ~IEEE80211_SDATA_SHORT_PREAMBLE;
@@ -524,18 +525,20 @@ static void ieee80211_send_auth(struct net_device *dev,
524static void ieee80211_authenticate(struct net_device *dev, 525static void ieee80211_authenticate(struct net_device *dev,
525 struct ieee80211_if_sta *ifsta) 526 struct ieee80211_if_sta *ifsta)
526{ 527{
528 DECLARE_MAC_BUF(mac);
529
527 ifsta->auth_tries++; 530 ifsta->auth_tries++;
528 if (ifsta->auth_tries > IEEE80211_AUTH_MAX_TRIES) { 531 if (ifsta->auth_tries > IEEE80211_AUTH_MAX_TRIES) {
529 printk(KERN_DEBUG "%s: authentication with AP " MAC_FMT 532 printk(KERN_DEBUG "%s: authentication with AP %s"
530 " timed out\n", 533 " timed out\n",
531 dev->name, MAC_ARG(ifsta->bssid)); 534 dev->name, print_mac(mac, ifsta->bssid));
532 ifsta->state = IEEE80211_DISABLED; 535 ifsta->state = IEEE80211_DISABLED;
533 return; 536 return;
534 } 537 }
535 538
536 ifsta->state = IEEE80211_AUTHENTICATE; 539 ifsta->state = IEEE80211_AUTHENTICATE;
537 printk(KERN_DEBUG "%s: authenticate with AP " MAC_FMT "\n", 540 printk(KERN_DEBUG "%s: authenticate with AP %s\n",
538 dev->name, MAC_ARG(ifsta->bssid)); 541 dev->name, print_mac(mac, ifsta->bssid));
539 542
540 ieee80211_send_auth(dev, ifsta, 1, NULL, 0, 0); 543 ieee80211_send_auth(dev, ifsta, 1, NULL, 0, 0);
541 544
@@ -744,18 +747,20 @@ static int ieee80211_privacy_mismatch(struct net_device *dev,
744static void ieee80211_associate(struct net_device *dev, 747static void ieee80211_associate(struct net_device *dev,
745 struct ieee80211_if_sta *ifsta) 748 struct ieee80211_if_sta *ifsta)
746{ 749{
750 DECLARE_MAC_BUF(mac);
751
747 ifsta->assoc_tries++; 752 ifsta->assoc_tries++;
748 if (ifsta->assoc_tries > IEEE80211_ASSOC_MAX_TRIES) { 753 if (ifsta->assoc_tries > IEEE80211_ASSOC_MAX_TRIES) {
749 printk(KERN_DEBUG "%s: association with AP " MAC_FMT 754 printk(KERN_DEBUG "%s: association with AP %s"
750 " timed out\n", 755 " timed out\n",
751 dev->name, MAC_ARG(ifsta->bssid)); 756 dev->name, print_mac(mac, ifsta->bssid));
752 ifsta->state = IEEE80211_DISABLED; 757 ifsta->state = IEEE80211_DISABLED;
753 return; 758 return;
754 } 759 }
755 760
756 ifsta->state = IEEE80211_ASSOCIATE; 761 ifsta->state = IEEE80211_ASSOCIATE;
757 printk(KERN_DEBUG "%s: associate with AP " MAC_FMT "\n", 762 printk(KERN_DEBUG "%s: associate with AP %s\n",
758 dev->name, MAC_ARG(ifsta->bssid)); 763 dev->name, print_mac(mac, ifsta->bssid));
759 if (ieee80211_privacy_mismatch(dev, ifsta)) { 764 if (ieee80211_privacy_mismatch(dev, ifsta)) {
760 printk(KERN_DEBUG "%s: mismatch in privacy configuration and " 765 printk(KERN_DEBUG "%s: mismatch in privacy configuration and "
761 "mixed-cell disabled - abort association\n", dev->name); 766 "mixed-cell disabled - abort association\n", dev->name);
@@ -775,6 +780,7 @@ static void ieee80211_associated(struct net_device *dev,
775 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 780 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
776 struct sta_info *sta; 781 struct sta_info *sta;
777 int disassoc; 782 int disassoc;
783 DECLARE_MAC_BUF(mac);
778 784
779 /* TODO: start monitoring current AP signal quality and number of 785 /* TODO: start monitoring current AP signal quality and number of
780 * missed beacons. Scan other channels every now and then and search 786 * missed beacons. Scan other channels every now and then and search
@@ -785,8 +791,8 @@ static void ieee80211_associated(struct net_device *dev,
785 791
786 sta = sta_info_get(local, ifsta->bssid); 792 sta = sta_info_get(local, ifsta->bssid);
787 if (!sta) { 793 if (!sta) {
788 printk(KERN_DEBUG "%s: No STA entry for own AP " MAC_FMT "\n", 794 printk(KERN_DEBUG "%s: No STA entry for own AP %s\n",
789 dev->name, MAC_ARG(ifsta->bssid)); 795 dev->name, print_mac(mac, ifsta->bssid));
790 disassoc = 1; 796 disassoc = 1;
791 } else { 797 } else {
792 disassoc = 0; 798 disassoc = 0;
@@ -794,9 +800,9 @@ static void ieee80211_associated(struct net_device *dev,
794 sta->last_rx + IEEE80211_MONITORING_INTERVAL)) { 800 sta->last_rx + IEEE80211_MONITORING_INTERVAL)) {
795 if (ifsta->flags & IEEE80211_STA_PROBEREQ_POLL) { 801 if (ifsta->flags & IEEE80211_STA_PROBEREQ_POLL) {
796 printk(KERN_DEBUG "%s: No ProbeResp from " 802 printk(KERN_DEBUG "%s: No ProbeResp from "
797 "current AP " MAC_FMT " - assume out of " 803 "current AP %s - assume out of "
798 "range\n", 804 "range\n",
799 dev->name, MAC_ARG(ifsta->bssid)); 805 dev->name, print_mac(mac, ifsta->bssid));
800 disassoc = 1; 806 disassoc = 1;
801 sta_info_free(sta); 807 sta_info_free(sta);
802 } else 808 } else
@@ -944,37 +950,38 @@ static void ieee80211_rx_mgmt_auth(struct net_device *dev,
944{ 950{
945 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 951 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
946 u16 auth_alg, auth_transaction, status_code; 952 u16 auth_alg, auth_transaction, status_code;
953 DECLARE_MAC_BUF(mac);
947 954
948 if (ifsta->state != IEEE80211_AUTHENTICATE && 955 if (ifsta->state != IEEE80211_AUTHENTICATE &&
949 sdata->type != IEEE80211_IF_TYPE_IBSS) { 956 sdata->type != IEEE80211_IF_TYPE_IBSS) {
950 printk(KERN_DEBUG "%s: authentication frame received from " 957 printk(KERN_DEBUG "%s: authentication frame received from "
951 MAC_FMT ", but not in authenticate state - ignored\n", 958 "%s, but not in authenticate state - ignored\n",
952 dev->name, MAC_ARG(mgmt->sa)); 959 dev->name, print_mac(mac, mgmt->sa));
953 return; 960 return;
954 } 961 }
955 962
956 if (len < 24 + 6) { 963 if (len < 24 + 6) {
957 printk(KERN_DEBUG "%s: too short (%zd) authentication frame " 964 printk(KERN_DEBUG "%s: too short (%zd) authentication frame "
958 "received from " MAC_FMT " - ignored\n", 965 "received from %s - ignored\n",
959 dev->name, len, MAC_ARG(mgmt->sa)); 966 dev->name, len, print_mac(mac, mgmt->sa));
960 return; 967 return;
961 } 968 }
962 969
963 if (sdata->type != IEEE80211_IF_TYPE_IBSS && 970 if (sdata->type != IEEE80211_IF_TYPE_IBSS &&
964 memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) { 971 memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) {
965 printk(KERN_DEBUG "%s: authentication frame received from " 972 printk(KERN_DEBUG "%s: authentication frame received from "
966 "unknown AP (SA=" MAC_FMT " BSSID=" MAC_FMT ") - " 973 "unknown AP (SA=%s BSSID=%s) - "
967 "ignored\n", dev->name, MAC_ARG(mgmt->sa), 974 "ignored\n", dev->name, print_mac(mac, mgmt->sa),
968 MAC_ARG(mgmt->bssid)); 975 print_mac(mac, mgmt->bssid));
969 return; 976 return;
970 } 977 }
971 978
972 if (sdata->type != IEEE80211_IF_TYPE_IBSS && 979 if (sdata->type != IEEE80211_IF_TYPE_IBSS &&
973 memcmp(ifsta->bssid, mgmt->bssid, ETH_ALEN) != 0) { 980 memcmp(ifsta->bssid, mgmt->bssid, ETH_ALEN) != 0) {
974 printk(KERN_DEBUG "%s: authentication frame received from " 981 printk(KERN_DEBUG "%s: authentication frame received from "
975 "unknown BSSID (SA=" MAC_FMT " BSSID=" MAC_FMT ") - " 982 "unknown BSSID (SA=%s BSSID=%s) - "
976 "ignored\n", dev->name, MAC_ARG(mgmt->sa), 983 "ignored\n", dev->name, print_mac(mac, mgmt->sa),
977 MAC_ARG(mgmt->bssid)); 984 print_mac(mac, mgmt->bssid));
978 return; 985 return;
979 } 986 }
980 987
@@ -982,9 +989,9 @@ static void ieee80211_rx_mgmt_auth(struct net_device *dev,
982 auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction); 989 auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction);
983 status_code = le16_to_cpu(mgmt->u.auth.status_code); 990 status_code = le16_to_cpu(mgmt->u.auth.status_code);
984 991
985 printk(KERN_DEBUG "%s: RX authentication from " MAC_FMT " (alg=%d " 992 printk(KERN_DEBUG "%s: RX authentication from %s (alg=%d "
986 "transaction=%d status=%d)\n", 993 "transaction=%d status=%d)\n",
987 dev->name, MAC_ARG(mgmt->sa), auth_alg, 994 dev->name, print_mac(mac, mgmt->sa), auth_alg,
988 auth_transaction, status_code); 995 auth_transaction, status_code);
989 996
990 if (sdata->type == IEEE80211_IF_TYPE_IBSS) { 997 if (sdata->type == IEEE80211_IF_TYPE_IBSS) {
@@ -1071,27 +1078,28 @@ static void ieee80211_rx_mgmt_deauth(struct net_device *dev,
1071 size_t len) 1078 size_t len)
1072{ 1079{
1073 u16 reason_code; 1080 u16 reason_code;
1081 DECLARE_MAC_BUF(mac);
1074 1082
1075 if (len < 24 + 2) { 1083 if (len < 24 + 2) {
1076 printk(KERN_DEBUG "%s: too short (%zd) deauthentication frame " 1084 printk(KERN_DEBUG "%s: too short (%zd) deauthentication frame "
1077 "received from " MAC_FMT " - ignored\n", 1085 "received from %s - ignored\n",
1078 dev->name, len, MAC_ARG(mgmt->sa)); 1086 dev->name, len, print_mac(mac, mgmt->sa));
1079 return; 1087 return;
1080 } 1088 }
1081 1089
1082 if (memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) { 1090 if (memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) {
1083 printk(KERN_DEBUG "%s: deauthentication frame received from " 1091 printk(KERN_DEBUG "%s: deauthentication frame received from "
1084 "unknown AP (SA=" MAC_FMT " BSSID=" MAC_FMT ") - " 1092 "unknown AP (SA=%s BSSID=%s) - "
1085 "ignored\n", dev->name, MAC_ARG(mgmt->sa), 1093 "ignored\n", dev->name, print_mac(mac, mgmt->sa),
1086 MAC_ARG(mgmt->bssid)); 1094 print_mac(mac, mgmt->bssid));
1087 return; 1095 return;
1088 } 1096 }
1089 1097
1090 reason_code = le16_to_cpu(mgmt->u.deauth.reason_code); 1098 reason_code = le16_to_cpu(mgmt->u.deauth.reason_code);
1091 1099
1092 printk(KERN_DEBUG "%s: RX deauthentication from " MAC_FMT 1100 printk(KERN_DEBUG "%s: RX deauthentication from %s"
1093 " (reason=%d)\n", 1101 " (reason=%d)\n",
1094 dev->name, MAC_ARG(mgmt->sa), reason_code); 1102 dev->name, print_mac(mac, mgmt->sa), reason_code);
1095 1103
1096 if (ifsta->flags & IEEE80211_STA_AUTHENTICATED) { 1104 if (ifsta->flags & IEEE80211_STA_AUTHENTICATED) {
1097 printk(KERN_DEBUG "%s: deauthenticated\n", dev->name); 1105 printk(KERN_DEBUG "%s: deauthenticated\n", dev->name);
@@ -1116,27 +1124,28 @@ static void ieee80211_rx_mgmt_disassoc(struct net_device *dev,
1116 size_t len) 1124 size_t len)
1117{ 1125{
1118 u16 reason_code; 1126 u16 reason_code;
1127 DECLARE_MAC_BUF(mac);
1119 1128
1120 if (len < 24 + 2) { 1129 if (len < 24 + 2) {
1121 printk(KERN_DEBUG "%s: too short (%zd) disassociation frame " 1130 printk(KERN_DEBUG "%s: too short (%zd) disassociation frame "
1122 "received from " MAC_FMT " - ignored\n", 1131 "received from %s - ignored\n",
1123 dev->name, len, MAC_ARG(mgmt->sa)); 1132 dev->name, len, print_mac(mac, mgmt->sa));
1124 return; 1133 return;
1125 } 1134 }
1126 1135
1127 if (memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) { 1136 if (memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) {
1128 printk(KERN_DEBUG "%s: disassociation frame received from " 1137 printk(KERN_DEBUG "%s: disassociation frame received from "
1129 "unknown AP (SA=" MAC_FMT " BSSID=" MAC_FMT ") - " 1138 "unknown AP (SA=%s BSSID=%s) - "
1130 "ignored\n", dev->name, MAC_ARG(mgmt->sa), 1139 "ignored\n", dev->name, print_mac(mac, mgmt->sa),
1131 MAC_ARG(mgmt->bssid)); 1140 print_mac(mac, mgmt->bssid));
1132 return; 1141 return;
1133 } 1142 }
1134 1143
1135 reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code); 1144 reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code);
1136 1145
1137 printk(KERN_DEBUG "%s: RX disassociation from " MAC_FMT 1146 printk(KERN_DEBUG "%s: RX disassociation from %s"
1138 " (reason=%d)\n", 1147 " (reason=%d)\n",
1139 dev->name, MAC_ARG(mgmt->sa), reason_code); 1148 dev->name, print_mac(mac, mgmt->sa), reason_code);
1140 1149
1141 if (ifsta->flags & IEEE80211_STA_ASSOCIATED) 1150 if (ifsta->flags & IEEE80211_STA_ASSOCIATED)
1142 printk(KERN_DEBUG "%s: disassociated\n", dev->name); 1151 printk(KERN_DEBUG "%s: disassociated\n", dev->name);
@@ -1165,29 +1174,30 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
1165 struct ieee802_11_elems elems; 1174 struct ieee802_11_elems elems;
1166 u8 *pos; 1175 u8 *pos;
1167 int i, j; 1176 int i, j;
1177 DECLARE_MAC_BUF(mac);
1168 1178
1169 /* AssocResp and ReassocResp have identical structure, so process both 1179 /* AssocResp and ReassocResp have identical structure, so process both
1170 * of them in this function. */ 1180 * of them in this function. */
1171 1181
1172 if (ifsta->state != IEEE80211_ASSOCIATE) { 1182 if (ifsta->state != IEEE80211_ASSOCIATE) {
1173 printk(KERN_DEBUG "%s: association frame received from " 1183 printk(KERN_DEBUG "%s: association frame received from "
1174 MAC_FMT ", but not in associate state - ignored\n", 1184 "%s, but not in associate state - ignored\n",
1175 dev->name, MAC_ARG(mgmt->sa)); 1185 dev->name, print_mac(mac, mgmt->sa));
1176 return; 1186 return;
1177 } 1187 }
1178 1188
1179 if (len < 24 + 6) { 1189 if (len < 24 + 6) {
1180 printk(KERN_DEBUG "%s: too short (%zd) association frame " 1190 printk(KERN_DEBUG "%s: too short (%zd) association frame "
1181 "received from " MAC_FMT " - ignored\n", 1191 "received from %s - ignored\n",
1182 dev->name, len, MAC_ARG(mgmt->sa)); 1192 dev->name, len, print_mac(mac, mgmt->sa));
1183 return; 1193 return;
1184 } 1194 }
1185 1195
1186 if (memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) { 1196 if (memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) {
1187 printk(KERN_DEBUG "%s: association frame received from " 1197 printk(KERN_DEBUG "%s: association frame received from "
1188 "unknown AP (SA=" MAC_FMT " BSSID=" MAC_FMT ") - " 1198 "unknown AP (SA=%s BSSID=%s) - "
1189 "ignored\n", dev->name, MAC_ARG(mgmt->sa), 1199 "ignored\n", dev->name, print_mac(mac, mgmt->sa),
1190 MAC_ARG(mgmt->bssid)); 1200 print_mac(mac, mgmt->bssid));
1191 return; 1201 return;
1192 } 1202 }
1193 1203
@@ -1199,9 +1209,9 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
1199 "set\n", dev->name, aid); 1209 "set\n", dev->name, aid);
1200 aid &= ~(BIT(15) | BIT(14)); 1210 aid &= ~(BIT(15) | BIT(14));
1201 1211
1202 printk(KERN_DEBUG "%s: RX %sssocResp from " MAC_FMT " (capab=0x%x " 1212 printk(KERN_DEBUG "%s: RX %sssocResp from %s (capab=0x%x "
1203 "status=%d aid=%d)\n", 1213 "status=%d aid=%d)\n",
1204 dev->name, reassoc ? "Rea" : "A", MAC_ARG(mgmt->sa), 1214 dev->name, reassoc ? "Rea" : "A", print_mac(mac, mgmt->sa),
1205 capab_info, status_code, aid); 1215 capab_info, status_code, aid);
1206 1216
1207 if (status_code != WLAN_STATUS_SUCCESS) { 1217 if (status_code != WLAN_STATUS_SUCCESS) {
@@ -1435,14 +1445,16 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
1435 struct sta_info *sta; 1445 struct sta_info *sta;
1436 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1446 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1437 u64 timestamp; 1447 u64 timestamp;
1448 DECLARE_MAC_BUF(mac);
1449 DECLARE_MAC_BUF(mac2);
1438 1450
1439 if (!beacon && memcmp(mgmt->da, dev->dev_addr, ETH_ALEN)) 1451 if (!beacon && memcmp(mgmt->da, dev->dev_addr, ETH_ALEN))
1440 return; /* ignore ProbeResp to foreign address */ 1452 return; /* ignore ProbeResp to foreign address */
1441 1453
1442#if 0 1454#if 0
1443 printk(KERN_DEBUG "%s: RX %s from " MAC_FMT " to " MAC_FMT "\n", 1455 printk(KERN_DEBUG "%s: RX %s from %s to %s\n",
1444 dev->name, beacon ? "Beacon" : "Probe Response", 1456 dev->name, beacon ? "Beacon" : "Probe Response",
1445 MAC_ARG(mgmt->sa), MAC_ARG(mgmt->da)); 1457 print_mac(mac, mgmt->sa), print_mac(mac2, mgmt->da));
1446#endif 1458#endif
1447 1459
1448 baselen = (u8 *) mgmt->u.beacon.variable - (u8 *) mgmt; 1460 baselen = (u8 *) mgmt->u.beacon.variable - (u8 *) mgmt;
@@ -1461,10 +1473,10 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
1461 else 1473 else
1462 tsf = -1LLU; 1474 tsf = -1LLU;
1463 if (time_after(jiffies, last_tsf_debug + 5 * HZ)) { 1475 if (time_after(jiffies, last_tsf_debug + 5 * HZ)) {
1464 printk(KERN_DEBUG "RX beacon SA=" MAC_FMT " BSSID=" 1476 printk(KERN_DEBUG "RX beacon SA=%s BSSID="
1465 MAC_FMT " TSF=0x%llx BCN=0x%llx diff=%lld " 1477 "%s TSF=0x%llx BCN=0x%llx diff=%lld "
1466 "@%lu\n", 1478 "@%lu\n",
1467 MAC_ARG(mgmt->sa), MAC_ARG(mgmt->bssid), 1479 print_mac(mac, mgmt->sa), print_mac(mac2, mgmt->bssid),
1468 (unsigned long long)tsf, 1480 (unsigned long long)tsf,
1469 (unsigned long long)timestamp, 1481 (unsigned long long)timestamp,
1470 (unsigned long long)(tsf - timestamp), 1482 (unsigned long long)(tsf - timestamp),
@@ -1518,9 +1530,9 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
1518 } 1530 }
1519 if (sta->supp_rates != prev_rates) { 1531 if (sta->supp_rates != prev_rates) {
1520 printk(KERN_DEBUG "%s: updated supp_rates set for " 1532 printk(KERN_DEBUG "%s: updated supp_rates set for "
1521 MAC_FMT " based on beacon info (0x%x & 0x%x -> " 1533 "%s based on beacon info (0x%x & 0x%x -> "
1522 "0x%x)\n", 1534 "0x%x)\n",
1523 dev->name, MAC_ARG(sta->addr), prev_rates, 1535 dev->name, print_mac(mac, sta->addr), prev_rates,
1524 supp_rates, sta->supp_rates); 1536 supp_rates, sta->supp_rates);
1525 } 1537 }
1526 sta_info_put(sta); 1538 sta_info_put(sta);
@@ -1722,6 +1734,11 @@ static void ieee80211_rx_mgmt_probe_req(struct net_device *dev,
1722 struct sk_buff *skb; 1734 struct sk_buff *skb;
1723 struct ieee80211_mgmt *resp; 1735 struct ieee80211_mgmt *resp;
1724 u8 *pos, *end; 1736 u8 *pos, *end;
1737 DECLARE_MAC_BUF(mac);
1738#ifdef CONFIG_MAC80211_IBSS_DEBUG
1739 DECLARE_MAC_BUF(mac2);
1740 DECLARE_MAC_BUF(mac3);
1741#endif
1725 1742
1726 if (sdata->type != IEEE80211_IF_TYPE_IBSS || 1743 if (sdata->type != IEEE80211_IF_TYPE_IBSS ||
1727 ifsta->state != IEEE80211_IBSS_JOINED || 1744 ifsta->state != IEEE80211_IBSS_JOINED ||
@@ -1734,10 +1751,10 @@ static void ieee80211_rx_mgmt_probe_req(struct net_device *dev,
1734 tx_last_beacon = 1; 1751 tx_last_beacon = 1;
1735 1752
1736#ifdef CONFIG_MAC80211_IBSS_DEBUG 1753#ifdef CONFIG_MAC80211_IBSS_DEBUG
1737 printk(KERN_DEBUG "%s: RX ProbeReq SA=" MAC_FMT " DA=" MAC_FMT " BSSID=" 1754 printk(KERN_DEBUG "%s: RX ProbeReq SA=%s DA=%s BSSID="
1738 MAC_FMT " (tx_last_beacon=%d)\n", 1755 "%s (tx_last_beacon=%d)\n",
1739 dev->name, MAC_ARG(mgmt->sa), MAC_ARG(mgmt->da), 1756 dev->name, print_mac(mac, mgmt->sa), print_mac(mac2, mgmt->da),
1740 MAC_ARG(mgmt->bssid), tx_last_beacon); 1757 print_mac(mac3, mgmt->bssid), tx_last_beacon);
1741#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 1758#endif /* CONFIG_MAC80211_IBSS_DEBUG */
1742 1759
1743 if (!tx_last_beacon) 1760 if (!tx_last_beacon)
@@ -1753,8 +1770,8 @@ static void ieee80211_rx_mgmt_probe_req(struct net_device *dev,
1753 pos + 2 + pos[1] > end) { 1770 pos + 2 + pos[1] > end) {
1754 if (net_ratelimit()) { 1771 if (net_ratelimit()) {
1755 printk(KERN_DEBUG "%s: Invalid SSID IE in ProbeReq " 1772 printk(KERN_DEBUG "%s: Invalid SSID IE in ProbeReq "
1756 "from " MAC_FMT "\n", 1773 "from %s\n",
1757 dev->name, MAC_ARG(mgmt->sa)); 1774 dev->name, print_mac(mac, mgmt->sa));
1758 } 1775 }
1759 return; 1776 return;
1760 } 1777 }
@@ -1773,8 +1790,8 @@ static void ieee80211_rx_mgmt_probe_req(struct net_device *dev,
1773 resp = (struct ieee80211_mgmt *) skb->data; 1790 resp = (struct ieee80211_mgmt *) skb->data;
1774 memcpy(resp->da, mgmt->sa, ETH_ALEN); 1791 memcpy(resp->da, mgmt->sa, ETH_ALEN);
1775#ifdef CONFIG_MAC80211_IBSS_DEBUG 1792#ifdef CONFIG_MAC80211_IBSS_DEBUG
1776 printk(KERN_DEBUG "%s: Sending ProbeResp to " MAC_FMT "\n", 1793 printk(KERN_DEBUG "%s: Sending ProbeResp to %s\n",
1777 dev->name, MAC_ARG(resp->da)); 1794 dev->name, print_mac(mac, resp->da));
1778#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 1795#endif /* CONFIG_MAC80211_IBSS_DEBUG */
1779 ieee80211_sta_tx(dev, skb, 0); 1796 ieee80211_sta_tx(dev, skb, 0);
1780} 1797}
@@ -1925,13 +1942,14 @@ static void ieee80211_sta_expire(struct net_device *dev)
1925 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 1942 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
1926 struct sta_info *sta, *tmp; 1943 struct sta_info *sta, *tmp;
1927 LIST_HEAD(tmp_list); 1944 LIST_HEAD(tmp_list);
1945 DECLARE_MAC_BUF(mac);
1928 1946
1929 write_lock_bh(&local->sta_lock); 1947 write_lock_bh(&local->sta_lock);
1930 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) 1948 list_for_each_entry_safe(sta, tmp, &local->sta_list, list)
1931 if (time_after(jiffies, sta->last_rx + 1949 if (time_after(jiffies, sta->last_rx +
1932 IEEE80211_IBSS_INACTIVITY_LIMIT)) { 1950 IEEE80211_IBSS_INACTIVITY_LIMIT)) {
1933 printk(KERN_DEBUG "%s: expiring inactive STA " MAC_FMT 1951 printk(KERN_DEBUG "%s: expiring inactive STA %s\n",
1934 "\n", dev->name, MAC_ARG(sta->addr)); 1952 dev->name, print_mac(mac, sta->addr));
1935 __sta_info_get(sta); 1953 __sta_info_get(sta);
1936 sta_info_remove(sta); 1954 sta_info_remove(sta);
1937 list_add(&sta->list, &tmp_list); 1955 list_add(&sta->list, &tmp_list);
@@ -2362,6 +2380,7 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
2362 struct ieee80211_hw_mode *mode; 2380 struct ieee80211_hw_mode *mode;
2363 u8 bssid[ETH_ALEN], *pos; 2381 u8 bssid[ETH_ALEN], *pos;
2364 int i; 2382 int i;
2383 DECLARE_MAC_BUF(mac);
2365 2384
2366#if 0 2385#if 0
2367 /* Easier testing, use fixed BSSID. */ 2386 /* Easier testing, use fixed BSSID. */
@@ -2377,8 +2396,8 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
2377 bssid[0] |= 0x02; 2396 bssid[0] |= 0x02;
2378#endif 2397#endif
2379 2398
2380 printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID " MAC_FMT "\n", 2399 printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID %s\n",
2381 dev->name, MAC_ARG(bssid)); 2400 dev->name, print_mac(mac, bssid));
2382 2401
2383 bss = ieee80211_rx_bss_add(dev, bssid); 2402 bss = ieee80211_rx_bss_add(dev, bssid);
2384 if (!bss) 2403 if (!bss)
@@ -2418,6 +2437,8 @@ static int ieee80211_sta_find_ibss(struct net_device *dev,
2418 int found = 0; 2437 int found = 0;
2419 u8 bssid[ETH_ALEN]; 2438 u8 bssid[ETH_ALEN];
2420 int active_ibss; 2439 int active_ibss;
2440 DECLARE_MAC_BUF(mac);
2441 DECLARE_MAC_BUF(mac2);
2421 2442
2422 if (ifsta->ssid_len == 0) 2443 if (ifsta->ssid_len == 0)
2423 return -EINVAL; 2444 return -EINVAL;
@@ -2434,8 +2455,8 @@ static int ieee80211_sta_find_ibss(struct net_device *dev,
2434 || !(bss->capability & WLAN_CAPABILITY_IBSS)) 2455 || !(bss->capability & WLAN_CAPABILITY_IBSS))
2435 continue; 2456 continue;
2436#ifdef CONFIG_MAC80211_IBSS_DEBUG 2457#ifdef CONFIG_MAC80211_IBSS_DEBUG
2437 printk(KERN_DEBUG " bssid=" MAC_FMT " found\n", 2458 printk(KERN_DEBUG " bssid=%s found\n",
2438 MAC_ARG(bss->bssid)); 2459 print_mac(mac, bss->bssid));
2439#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 2460#endif /* CONFIG_MAC80211_IBSS_DEBUG */
2440 memcpy(bssid, bss->bssid, ETH_ALEN); 2461 memcpy(bssid, bss->bssid, ETH_ALEN);
2441 found = 1; 2462 found = 1;
@@ -2445,14 +2466,14 @@ static int ieee80211_sta_find_ibss(struct net_device *dev,
2445 spin_unlock_bh(&local->sta_bss_lock); 2466 spin_unlock_bh(&local->sta_bss_lock);
2446 2467
2447#ifdef CONFIG_MAC80211_IBSS_DEBUG 2468#ifdef CONFIG_MAC80211_IBSS_DEBUG
2448 printk(KERN_DEBUG " sta_find_ibss: selected " MAC_FMT " current " 2469 printk(KERN_DEBUG " sta_find_ibss: selected %s current "
2449 MAC_FMT "\n", MAC_ARG(bssid), MAC_ARG(ifsta->bssid)); 2470 "%s\n", print_mac(mac, bssid), print_mac(mac2, ifsta->bssid));
2450#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 2471#endif /* CONFIG_MAC80211_IBSS_DEBUG */
2451 if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0 && 2472 if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0 &&
2452 (bss = ieee80211_rx_bss_get(dev, bssid))) { 2473 (bss = ieee80211_rx_bss_get(dev, bssid))) {
2453 printk(KERN_DEBUG "%s: Selected IBSS BSSID " MAC_FMT 2474 printk(KERN_DEBUG "%s: Selected IBSS BSSID %s"
2454 " based on configured SSID\n", 2475 " based on configured SSID\n",
2455 dev->name, MAC_ARG(bssid)); 2476 dev->name, print_mac(mac, bssid));
2456 return ieee80211_sta_join_ibss(dev, ifsta, bss); 2477 return ieee80211_sta_join_ibss(dev, ifsta, bss);
2457 } 2478 }
2458#ifdef CONFIG_MAC80211_IBSS_DEBUG 2479#ifdef CONFIG_MAC80211_IBSS_DEBUG
@@ -3070,19 +3091,20 @@ struct sta_info * ieee80211_ibss_add_sta(struct net_device *dev,
3070 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 3091 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
3071 struct sta_info *sta; 3092 struct sta_info *sta;
3072 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 3093 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
3094 DECLARE_MAC_BUF(mac);
3073 3095
3074 /* TODO: Could consider removing the least recently used entry and 3096 /* TODO: Could consider removing the least recently used entry and
3075 * allow new one to be added. */ 3097 * allow new one to be added. */
3076 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) { 3098 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) {
3077 if (net_ratelimit()) { 3099 if (net_ratelimit()) {
3078 printk(KERN_DEBUG "%s: No room for a new IBSS STA " 3100 printk(KERN_DEBUG "%s: No room for a new IBSS STA "
3079 "entry " MAC_FMT "\n", dev->name, MAC_ARG(addr)); 3101 "entry %s\n", dev->name, print_mac(mac, addr));
3080 } 3102 }
3081 return NULL; 3103 return NULL;
3082 } 3104 }
3083 3105
3084 printk(KERN_DEBUG "%s: Adding new IBSS station " MAC_FMT " (dev=%s)\n", 3106 printk(KERN_DEBUG "%s: Adding new IBSS station %s (dev=%s)\n",
3085 local->mdev->name, MAC_ARG(addr), dev->name); 3107 local->mdev->name, print_mac(mac, addr), dev->name);
3086 3108
3087 sta = sta_info_add(local, dev, addr, GFP_ATOMIC); 3109 sta = sta_info_add(local, dev, addr, GFP_ATOMIC);
3088 if (!sta) 3110 if (!sta)
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index dd6fc4aa3ff..c10e53afbb4 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -63,6 +63,7 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
63{ 63{
64 const u8 *addr; 64 const u8 *addr;
65 int ret; 65 int ret;
66 DECLARE_MAC_BUF(mac);
66 67
67 if (!key->local->ops->set_key) 68 if (!key->local->ops->set_key)
68 return; 69 return;
@@ -78,15 +79,16 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
78 79
79 if (ret && ret != -ENOSPC && ret != -EOPNOTSUPP) 80 if (ret && ret != -ENOSPC && ret != -EOPNOTSUPP)
80 printk(KERN_ERR "mac80211-%s: failed to set key " 81 printk(KERN_ERR "mac80211-%s: failed to set key "
81 "(%d, " MAC_FMT ") to hardware (%d)\n", 82 "(%d, %s) to hardware (%d)\n",
82 wiphy_name(key->local->hw.wiphy), 83 wiphy_name(key->local->hw.wiphy),
83 key->conf.keyidx, MAC_ARG(addr), ret); 84 key->conf.keyidx, print_mac(mac, addr), ret);
84} 85}
85 86
86static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key) 87static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
87{ 88{
88 const u8 *addr; 89 const u8 *addr;
89 int ret; 90 int ret;
91 DECLARE_MAC_BUF(mac);
90 92
91 if (!key->local->ops->set_key) 93 if (!key->local->ops->set_key)
92 return; 94 return;
@@ -102,9 +104,9 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
102 104
103 if (ret) 105 if (ret)
104 printk(KERN_ERR "mac80211-%s: failed to remove key " 106 printk(KERN_ERR "mac80211-%s: failed to remove key "
105 "(%d, " MAC_FMT ") from hardware (%d)\n", 107 "(%d, %s) from hardware (%d)\n",
106 wiphy_name(key->local->hw.wiphy), 108 wiphy_name(key->local->hw.wiphy),
107 key->conf.keyidx, MAC_ARG(addr), ret); 109 key->conf.keyidx, print_mac(mac, addr), ret);
108 110
109 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; 111 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
110} 112}
diff --git a/net/mac80211/rc80211_simple.c b/net/mac80211/rc80211_simple.c
index ef91ce428ac..314b8de8886 100644
--- a/net/mac80211/rc80211_simple.c
+++ b/net/mac80211/rc80211_simple.c
@@ -201,9 +201,10 @@ static void rate_control_simple_tx_status(void *priv, struct net_device *dev,
201 srctrl->avg_rate_update = jiffies; 201 srctrl->avg_rate_update = jiffies;
202 if (srctrl->tx_avg_rate_num > 0) { 202 if (srctrl->tx_avg_rate_num > 0) {
203#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 203#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
204 printk(KERN_DEBUG "%s: STA " MAC_FMT " Average rate: " 204 DECLARE_MAC_BUF(mac);
205 printk(KERN_DEBUG "%s: STA %s Average rate: "
205 "%d (%d/%d)\n", 206 "%d (%d/%d)\n",
206 dev->name, MAC_ARG(sta->addr), 207 dev->name, print_mac(mac, sta->addr),
207 srctrl->tx_avg_rate_sum / 208 srctrl->tx_avg_rate_sum /
208 srctrl->tx_avg_rate_num, 209 srctrl->tx_avg_rate_num,
209 srctrl->tx_avg_rate_sum, 210 srctrl->tx_avg_rate_sum,
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index c985c7a537d..e9dcc6229c3 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -403,6 +403,8 @@ ieee80211_rx_h_load_key(struct ieee80211_txrx_data *rx)
403static void ap_sta_ps_start(struct net_device *dev, struct sta_info *sta) 403static void ap_sta_ps_start(struct net_device *dev, struct sta_info *sta)
404{ 404{
405 struct ieee80211_sub_if_data *sdata; 405 struct ieee80211_sub_if_data *sdata;
406 DECLARE_MAC_BUF(mac);
407
406 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev); 408 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
407 409
408 if (sdata->bss) 410 if (sdata->bss)
@@ -410,8 +412,8 @@ static void ap_sta_ps_start(struct net_device *dev, struct sta_info *sta)
410 sta->flags |= WLAN_STA_PS; 412 sta->flags |= WLAN_STA_PS;
411 sta->pspoll = 0; 413 sta->pspoll = 0;
412#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 414#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
413 printk(KERN_DEBUG "%s: STA " MAC_FMT " aid %d enters power " 415 printk(KERN_DEBUG "%s: STA %s aid %d enters power save mode\n",
414 "save mode\n", dev->name, MAC_ARG(sta->addr), sta->aid); 416 dev->name, print_mac(mac, sta->addr), sta->aid);
415#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 417#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
416} 418}
417 419
@@ -422,6 +424,7 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
422 int sent = 0; 424 int sent = 0;
423 struct ieee80211_sub_if_data *sdata; 425 struct ieee80211_sub_if_data *sdata;
424 struct ieee80211_tx_packet_data *pkt_data; 426 struct ieee80211_tx_packet_data *pkt_data;
427 DECLARE_MAC_BUF(mac);
425 428
426 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev); 429 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
427 if (sdata->bss) 430 if (sdata->bss)
@@ -435,8 +438,8 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
435 bss_tim_clear(local, sdata->bss, sta->aid); 438 bss_tim_clear(local, sdata->bss, sta->aid);
436 } 439 }
437#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 440#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
438 printk(KERN_DEBUG "%s: STA " MAC_FMT " aid %d exits power " 441 printk(KERN_DEBUG "%s: STA %s aid %d exits power save mode\n",
439 "save mode\n", dev->name, MAC_ARG(sta->addr), sta->aid); 442 dev->name, print_mac(mac, sta->addr), sta->aid);
440#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 443#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
441 /* Send all buffered frames to the station */ 444 /* Send all buffered frames to the station */
442 while ((skb = skb_dequeue(&sta->tx_filtered)) != NULL) { 445 while ((skb = skb_dequeue(&sta->tx_filtered)) != NULL) {
@@ -450,9 +453,9 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
450 local->total_ps_buffered--; 453 local->total_ps_buffered--;
451 sent++; 454 sent++;
452#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 455#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
453 printk(KERN_DEBUG "%s: STA " MAC_FMT " aid %d send PS frame " 456 printk(KERN_DEBUG "%s: STA %s aid %d send PS frame "
454 "since STA not sleeping anymore\n", dev->name, 457 "since STA not sleeping anymore\n", dev->name,
455 MAC_ARG(sta->addr), sta->aid); 458 print_mac(mac, sta->addr), sta->aid);
456#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 459#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
457 pkt_data->flags |= IEEE80211_TXPD_REQUEUE; 460 pkt_data->flags |= IEEE80211_TXPD_REQUEUE;
458 dev_queue_xmit(skb); 461 dev_queue_xmit(skb);
@@ -590,13 +593,15 @@ ieee80211_reassemble_add(struct ieee80211_sub_if_data *sdata,
590#ifdef CONFIG_MAC80211_DEBUG 593#ifdef CONFIG_MAC80211_DEBUG
591 struct ieee80211_hdr *hdr = 594 struct ieee80211_hdr *hdr =
592 (struct ieee80211_hdr *) entry->skb_list.next->data; 595 (struct ieee80211_hdr *) entry->skb_list.next->data;
596 DECLARE_MAC_BUF(mac);
597 DECLARE_MAC_BUF(mac2);
593 printk(KERN_DEBUG "%s: RX reassembly removed oldest " 598 printk(KERN_DEBUG "%s: RX reassembly removed oldest "
594 "fragment entry (idx=%d age=%lu seq=%d last_frag=%d " 599 "fragment entry (idx=%d age=%lu seq=%d last_frag=%d "
595 "addr1=" MAC_FMT " addr2=" MAC_FMT "\n", 600 "addr1=%s addr2=%s\n",
596 sdata->dev->name, idx, 601 sdata->dev->name, idx,
597 jiffies - entry->first_frag_time, entry->seq, 602 jiffies - entry->first_frag_time, entry->seq,
598 entry->last_frag, MAC_ARG(hdr->addr1), 603 entry->last_frag, print_mac(mac, hdr->addr1),
599 MAC_ARG(hdr->addr2)); 604 print_mac(mac2, hdr->addr2));
600#endif /* CONFIG_MAC80211_DEBUG */ 605#endif /* CONFIG_MAC80211_DEBUG */
601 __skb_queue_purge(&entry->skb_list); 606 __skb_queue_purge(&entry->skb_list);
602 } 607 }
@@ -662,6 +667,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
662 unsigned int frag, seq; 667 unsigned int frag, seq;
663 struct ieee80211_fragment_entry *entry; 668 struct ieee80211_fragment_entry *entry;
664 struct sk_buff *skb; 669 struct sk_buff *skb;
670 DECLARE_MAC_BUF(mac);
665 671
666 hdr = (struct ieee80211_hdr *) rx->skb->data; 672 hdr = (struct ieee80211_hdr *) rx->skb->data;
667 sc = le16_to_cpu(hdr->seq_ctrl); 673 sc = le16_to_cpu(hdr->seq_ctrl);
@@ -720,10 +726,10 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
720 if (memcmp(pn, rpn, CCMP_PN_LEN) != 0) { 726 if (memcmp(pn, rpn, CCMP_PN_LEN) != 0) {
721 if (net_ratelimit()) 727 if (net_ratelimit())
722 printk(KERN_DEBUG "%s: defrag: CCMP PN not " 728 printk(KERN_DEBUG "%s: defrag: CCMP PN not "
723 "sequential A2=" MAC_FMT 729 "sequential A2=%s"
724 " PN=%02x%02x%02x%02x%02x%02x " 730 " PN=%02x%02x%02x%02x%02x%02x "
725 "(expected %02x%02x%02x%02x%02x%02x)\n", 731 "(expected %02x%02x%02x%02x%02x%02x)\n",
726 rx->dev->name, MAC_ARG(hdr->addr2), 732 rx->dev->name, print_mac(mac, hdr->addr2),
727 rpn[0], rpn[1], rpn[2], rpn[3], rpn[4], 733 rpn[0], rpn[1], rpn[2], rpn[3], rpn[4],
728 rpn[5], pn[0], pn[1], pn[2], pn[3], 734 rpn[5], pn[0], pn[1], pn[2], pn[3],
729 pn[4], pn[5]); 735 pn[4], pn[5]);
@@ -774,6 +780,7 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
774{ 780{
775 struct sk_buff *skb; 781 struct sk_buff *skb;
776 int no_pending_pkts; 782 int no_pending_pkts;
783 DECLARE_MAC_BUF(mac);
777 784
778 if (likely(!rx->sta || 785 if (likely(!rx->sta ||
779 (rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_CTL || 786 (rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_CTL ||
@@ -799,9 +806,8 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
799 rx->sta->pspoll = 1; 806 rx->sta->pspoll = 1;
800 807
801#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 808#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
802 printk(KERN_DEBUG "STA " MAC_FMT " aid %d: PS Poll (entries " 809 printk(KERN_DEBUG "STA %s aid %d: PS Poll (entries after %d)\n",
803 "after %d)\n", 810 print_mac(mac, rx->sta->addr), rx->sta->aid,
804 MAC_ARG(rx->sta->addr), rx->sta->aid,
805 skb_queue_len(&rx->sta->ps_tx_buf)); 811 skb_queue_len(&rx->sta->ps_tx_buf));
806#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 812#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
807 813
@@ -824,9 +830,9 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
824 } 830 }
825#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 831#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
826 } else if (!rx->u.rx.sent_ps_buffered) { 832 } else if (!rx->u.rx.sent_ps_buffered) {
827 printk(KERN_DEBUG "%s: STA " MAC_FMT " sent PS Poll even " 833 printk(KERN_DEBUG "%s: STA %s sent PS Poll even "
828 "though there is no buffered frames for it\n", 834 "though there is no buffered frames for it\n",
829 rx->dev->name, MAC_ARG(rx->sta->addr)); 835 rx->dev->name, print_mac(mac, rx->sta->addr));
830#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 836#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
831 837
832 } 838 }
@@ -881,9 +887,10 @@ ieee80211_rx_h_802_1x_pae(struct ieee80211_txrx_data *rx)
881#ifdef CONFIG_MAC80211_DEBUG 887#ifdef CONFIG_MAC80211_DEBUG
882 struct ieee80211_hdr *hdr = 888 struct ieee80211_hdr *hdr =
883 (struct ieee80211_hdr *) rx->skb->data; 889 (struct ieee80211_hdr *) rx->skb->data;
884 printk(KERN_DEBUG "%s: dropped frame from " MAC_FMT 890 DECLARE_MAC_BUF(mac);
891 printk(KERN_DEBUG "%s: dropped frame from %s"
885 " (unauthorized port)\n", rx->dev->name, 892 " (unauthorized port)\n", rx->dev->name,
886 MAC_ARG(hdr->addr2)); 893 print_mac(mac, hdr->addr2));
887#endif /* CONFIG_MAC80211_DEBUG */ 894#endif /* CONFIG_MAC80211_DEBUG */
888 return TXRX_DROP; 895 return TXRX_DROP;
889 } 896 }
@@ -928,6 +935,10 @@ ieee80211_rx_h_data(struct ieee80211_txrx_data *rx)
928 u8 src[ETH_ALEN]; 935 u8 src[ETH_ALEN];
929 struct sk_buff *skb = rx->skb, *skb2; 936 struct sk_buff *skb = rx->skb, *skb2;
930 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 937 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
938 DECLARE_MAC_BUF(mac);
939 DECLARE_MAC_BUF(mac2);
940 DECLARE_MAC_BUF(mac3);
941 DECLARE_MAC_BUF(mac4);
931 942
932 fc = rx->fc; 943 fc = rx->fc;
933 if (unlikely((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA)) 944 if (unlikely((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA))
@@ -958,13 +969,11 @@ ieee80211_rx_h_data(struct ieee80211_txrx_data *rx)
958 sdata->type != IEEE80211_IF_TYPE_VLAN)) { 969 sdata->type != IEEE80211_IF_TYPE_VLAN)) {
959 if (net_ratelimit()) 970 if (net_ratelimit())
960 printk(KERN_DEBUG "%s: dropped ToDS frame " 971 printk(KERN_DEBUG "%s: dropped ToDS frame "
961 "(BSSID=" MAC_FMT 972 "(BSSID=%s SA=%s DA=%s)\n",
962 " SA=" MAC_FMT
963 " DA=" MAC_FMT ")\n",
964 dev->name, 973 dev->name,
965 MAC_ARG(hdr->addr1), 974 print_mac(mac, hdr->addr1),
966 MAC_ARG(hdr->addr2), 975 print_mac(mac2, hdr->addr2),
967 MAC_ARG(hdr->addr3)); 976 print_mac(mac3, hdr->addr3));
968 return TXRX_DROP; 977 return TXRX_DROP;
969 } 978 }
970 break; 979 break;
@@ -976,14 +985,12 @@ ieee80211_rx_h_data(struct ieee80211_txrx_data *rx)
976 if (unlikely(sdata->type != IEEE80211_IF_TYPE_WDS)) { 985 if (unlikely(sdata->type != IEEE80211_IF_TYPE_WDS)) {
977 if (net_ratelimit()) 986 if (net_ratelimit())
978 printk(KERN_DEBUG "%s: dropped FromDS&ToDS " 987 printk(KERN_DEBUG "%s: dropped FromDS&ToDS "
979 "frame (RA=" MAC_FMT 988 "frame (RA=%s TA=%s DA=%s SA=%s)\n",
980 " TA=" MAC_FMT " DA=" MAC_FMT
981 " SA=" MAC_FMT ")\n",
982 rx->dev->name, 989 rx->dev->name,
983 MAC_ARG(hdr->addr1), 990 print_mac(mac, hdr->addr1),
984 MAC_ARG(hdr->addr2), 991 print_mac(mac2, hdr->addr2),
985 MAC_ARG(hdr->addr3), 992 print_mac(mac3, hdr->addr3),
986 MAC_ARG(hdr->addr4)); 993 print_mac(mac4, hdr->addr4));
987 return TXRX_DROP; 994 return TXRX_DROP;
988 } 995 }
989 break; 996 break;
@@ -1004,12 +1011,12 @@ ieee80211_rx_h_data(struct ieee80211_txrx_data *rx)
1004 1011
1005 if (sdata->type != IEEE80211_IF_TYPE_IBSS) { 1012 if (sdata->type != IEEE80211_IF_TYPE_IBSS) {
1006 if (net_ratelimit()) { 1013 if (net_ratelimit()) {
1007 printk(KERN_DEBUG "%s: dropped IBSS frame (DA=" 1014 printk(KERN_DEBUG "%s: dropped IBSS frame "
1008 MAC_FMT " SA=" MAC_FMT " BSSID=" MAC_FMT 1015 "(DA=%s SA=%s BSSID=%s)\n",
1009 ")\n", 1016 dev->name,
1010 dev->name, MAC_ARG(hdr->addr1), 1017 print_mac(mac, hdr->addr1),
1011 MAC_ARG(hdr->addr2), 1018 print_mac(mac2, hdr->addr2),
1012 MAC_ARG(hdr->addr3)); 1019 print_mac(mac3, hdr->addr3));
1013 } 1020 }
1014 return TXRX_DROP; 1021 return TXRX_DROP;
1015 } 1022 }
@@ -1172,6 +1179,8 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1172 struct ieee80211_txrx_data *rx) 1179 struct ieee80211_txrx_data *rx)
1173{ 1180{
1174 int keyidx, hdrlen; 1181 int keyidx, hdrlen;
1182 DECLARE_MAC_BUF(mac);
1183 DECLARE_MAC_BUF(mac2);
1175 1184
1176 hdrlen = ieee80211_get_hdrlen_from_skb(rx->skb); 1185 hdrlen = ieee80211_get_hdrlen_from_skb(rx->skb);
1177 if (rx->skb->len >= hdrlen + 4) 1186 if (rx->skb->len >= hdrlen + 4)
@@ -1181,9 +1190,9 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1181 1190
1182 if (net_ratelimit()) 1191 if (net_ratelimit())
1183 printk(KERN_DEBUG "%s: TKIP hwaccel reported Michael MIC " 1192 printk(KERN_DEBUG "%s: TKIP hwaccel reported Michael MIC "
1184 "failure from " MAC_FMT " to " MAC_FMT " keyidx=%d\n", 1193 "failure from %s to %s keyidx=%d\n",
1185 dev->name, MAC_ARG(hdr->addr2), MAC_ARG(hdr->addr1), 1194 dev->name, print_mac(mac, hdr->addr2),
1186 keyidx); 1195 print_mac(mac2, hdr->addr1), keyidx);
1187 1196
1188 if (!sta) { 1197 if (!sta) {
1189 /* 1198 /*
@@ -1192,8 +1201,8 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1192 */ 1201 */
1193 if (net_ratelimit()) 1202 if (net_ratelimit())
1194 printk(KERN_DEBUG "%s: ignored spurious Michael MIC " 1203 printk(KERN_DEBUG "%s: ignored spurious Michael MIC "
1195 "error for unknown address " MAC_FMT "\n", 1204 "error for unknown address %s\n",
1196 dev->name, MAC_ARG(hdr->addr2)); 1205 dev->name, print_mac(mac, hdr->addr2));
1197 goto ignore; 1206 goto ignore;
1198 } 1207 }
1199 1208
@@ -1201,7 +1210,7 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1201 if (net_ratelimit()) 1210 if (net_ratelimit())
1202 printk(KERN_DEBUG "%s: ignored spurious Michael MIC " 1211 printk(KERN_DEBUG "%s: ignored spurious Michael MIC "
1203 "error for a frame with no PROTECTED flag (src " 1212 "error for a frame with no PROTECTED flag (src "
1204 MAC_FMT ")\n", dev->name, MAC_ARG(hdr->addr2)); 1213 "%s)\n", dev->name, print_mac(mac, hdr->addr2));
1205 goto ignore; 1214 goto ignore;
1206 } 1215 }
1207 1216
@@ -1215,8 +1224,8 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1215 if (net_ratelimit()) 1224 if (net_ratelimit())
1216 printk(KERN_DEBUG "%s: ignored Michael MIC error for " 1225 printk(KERN_DEBUG "%s: ignored Michael MIC error for "
1217 "a frame with non-zero keyidx (%d)" 1226 "a frame with non-zero keyidx (%d)"
1218 " (src " MAC_FMT ")\n", dev->name, keyidx, 1227 " (src %s)\n", dev->name, keyidx,
1219 MAC_ARG(hdr->addr2)); 1228 print_mac(mac, hdr->addr2));
1220 goto ignore; 1229 goto ignore;
1221 } 1230 }
1222 1231
@@ -1226,8 +1235,8 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1226 if (net_ratelimit()) 1235 if (net_ratelimit())
1227 printk(KERN_DEBUG "%s: ignored spurious Michael MIC " 1236 printk(KERN_DEBUG "%s: ignored spurious Michael MIC "
1228 "error for a frame that cannot be encrypted " 1237 "error for a frame that cannot be encrypted "
1229 "(fc=0x%04x) (src " MAC_FMT ")\n", 1238 "(fc=0x%04x) (src %s)\n",
1230 dev->name, rx->fc, MAC_ARG(hdr->addr2)); 1239 dev->name, rx->fc, print_mac(mac, hdr->addr2));
1231 goto ignore; 1240 goto ignore;
1232 } 1241 }
1233 1242
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index c17172abb21..44d98340495 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -132,6 +132,7 @@ struct sta_info * sta_info_add(struct ieee80211_local *local,
132 struct net_device *dev, u8 *addr, gfp_t gfp) 132 struct net_device *dev, u8 *addr, gfp_t gfp)
133{ 133{
134 struct sta_info *sta; 134 struct sta_info *sta;
135 DECLARE_MAC_BUF(mac);
135 136
136 sta = kzalloc(sizeof(*sta), gfp); 137 sta = kzalloc(sizeof(*sta), gfp);
137 if (!sta) 138 if (!sta)
@@ -164,8 +165,8 @@ struct sta_info * sta_info_add(struct ieee80211_local *local,
164 write_unlock_bh(&local->sta_lock); 165 write_unlock_bh(&local->sta_lock);
165 166
166#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 167#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
167 printk(KERN_DEBUG "%s: Added STA " MAC_FMT "\n", 168 printk(KERN_DEBUG "%s: Added STA %s\n",
168 local->mdev->name, MAC_ARG(addr)); 169 local->mdev->name, print_mac(mac, addr));
169#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 170#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
170 171
171#ifdef CONFIG_MAC80211_DEBUGFS 172#ifdef CONFIG_MAC80211_DEBUGFS
@@ -207,6 +208,7 @@ void sta_info_free(struct sta_info *sta)
207{ 208{
208 struct sk_buff *skb; 209 struct sk_buff *skb;
209 struct ieee80211_local *local = sta->local; 210 struct ieee80211_local *local = sta->local;
211 DECLARE_MAC_BUF(mac);
210 212
211 might_sleep(); 213 might_sleep();
212 214
@@ -223,8 +225,8 @@ void sta_info_free(struct sta_info *sta)
223 } 225 }
224 226
225#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 227#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
226 printk(KERN_DEBUG "%s: Removed STA " MAC_FMT "\n", 228 printk(KERN_DEBUG "%s: Removed STA %s\n",
227 local->mdev->name, MAC_ARG(sta->addr)); 229 local->mdev->name, print_mac(mac, sta->addr));
228#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 230#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
229 231
230 ieee80211_key_free(sta->key); 232 ieee80211_key_free(sta->key);
@@ -263,6 +265,7 @@ static void sta_info_cleanup_expire_buffered(struct ieee80211_local *local,
263{ 265{
264 unsigned long flags; 266 unsigned long flags;
265 struct sk_buff *skb; 267 struct sk_buff *skb;
268 DECLARE_MAC_BUF(mac);
266 269
267 if (skb_queue_empty(&sta->ps_tx_buf)) 270 if (skb_queue_empty(&sta->ps_tx_buf))
268 return; 271 return;
@@ -281,7 +284,7 @@ static void sta_info_cleanup_expire_buffered(struct ieee80211_local *local,
281 if (skb) { 284 if (skb) {
282 local->total_ps_buffered--; 285 local->total_ps_buffered--;
283 printk(KERN_DEBUG "Buffered frame expired (STA " 286 printk(KERN_DEBUG "Buffered frame expired (STA "
284 MAC_FMT ")\n", MAC_ARG(sta->addr)); 287 "%s)\n", print_mac(mac, sta->addr));
285 dev_kfree_skb(skb); 288 dev_kfree_skb(skb);
286 } else 289 } else
287 break; 290 break;
diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c
index b9c1d540518..5b11f14abfb 100644
--- a/net/mac80211/tkip.c
+++ b/net/mac80211/tkip.c
@@ -275,9 +275,10 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
275 (iv32 == key->u.tkip.iv32_rx[queue] && 275 (iv32 == key->u.tkip.iv32_rx[queue] &&
276 iv16 <= key->u.tkip.iv16_rx[queue]))) { 276 iv16 <= key->u.tkip.iv16_rx[queue]))) {
277#ifdef CONFIG_TKIP_DEBUG 277#ifdef CONFIG_TKIP_DEBUG
278 DECLARE_MAC_BUF(mac);
278 printk(KERN_DEBUG "TKIP replay detected for RX frame from " 279 printk(KERN_DEBUG "TKIP replay detected for RX frame from "
279 MAC_FMT " (RX IV (%04x,%02x) <= prev. IV (%04x,%02x)\n", 280 "%s (RX IV (%04x,%02x) <= prev. IV (%04x,%02x)\n",
280 MAC_ARG(ta), 281 print_mac(mac, ta),
281 iv32, iv16, key->u.tkip.iv32_rx[queue], 282 iv32, iv16, key->u.tkip.iv32_rx[queue],
282 key->u.tkip.iv16_rx[queue]); 283 key->u.tkip.iv16_rx[queue]);
283#endif /* CONFIG_TKIP_DEBUG */ 284#endif /* CONFIG_TKIP_DEBUG */
@@ -299,8 +300,9 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
299#ifdef CONFIG_TKIP_DEBUG 300#ifdef CONFIG_TKIP_DEBUG
300 { 301 {
301 int i; 302 int i;
302 printk(KERN_DEBUG "TKIP decrypt: Phase1 TA=" MAC_FMT 303 DECLARE_MAC_BUF(mac);
303 " TK=", MAC_ARG(ta)); 304 printk(KERN_DEBUG "TKIP decrypt: Phase1 TA=%s"
305 " TK=", print_mac(mac, ta));
304 for (i = 0; i < 16; i++) 306 for (i = 0; i < 16; i++)
305 printk("%02x ", 307 printk("%02x ",
306 key->conf.key[ 308 key->conf.key[
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index ca262a99e56..04b4fa9c69e 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -54,6 +54,7 @@ static void ieee80211_dump_frame(const char *ifname, const char *title,
54 const struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 54 const struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
55 u16 fc; 55 u16 fc;
56 int hdrlen; 56 int hdrlen;
57 DECLARE_MAC_BUF(mac);
57 58
58 printk(KERN_DEBUG "%s: %s (len=%d)", ifname, title, skb->len); 59 printk(KERN_DEBUG "%s: %s (len=%d)", ifname, title, skb->len);
59 if (skb->len < 4) { 60 if (skb->len < 4) {
@@ -69,13 +70,13 @@ static void ieee80211_dump_frame(const char *ifname, const char *title,
69 printk(" FC=0x%04x DUR=0x%04x", 70 printk(" FC=0x%04x DUR=0x%04x",
70 fc, le16_to_cpu(hdr->duration_id)); 71 fc, le16_to_cpu(hdr->duration_id));
71 if (hdrlen >= 10) 72 if (hdrlen >= 10)
72 printk(" A1=" MAC_FMT, MAC_ARG(hdr->addr1)); 73 printk(" A1=%s", print_mac(mac, hdr->addr1));
73 if (hdrlen >= 16) 74 if (hdrlen >= 16)
74 printk(" A2=" MAC_FMT, MAC_ARG(hdr->addr2)); 75 printk(" A2=%s", print_mac(mac, hdr->addr2));
75 if (hdrlen >= 24) 76 if (hdrlen >= 24)
76 printk(" A3=" MAC_FMT, MAC_ARG(hdr->addr3)); 77 printk(" A3=%s", print_mac(mac, hdr->addr3));
77 if (hdrlen >= 30) 78 if (hdrlen >= 30)
78 printk(" A4=" MAC_FMT, MAC_ARG(hdr->addr4)); 79 printk(" A4=%s", print_mac(mac, hdr->addr4));
79 printk("\n"); 80 printk("\n");
80} 81}
81#else /* CONFIG_MAC80211_LOWTX_FRAME_DUMP */ 82#else /* CONFIG_MAC80211_LOWTX_FRAME_DUMP */
@@ -236,9 +237,10 @@ ieee80211_tx_h_check_assoc(struct ieee80211_txrx_data *tx)
236 tx->sdata->type != IEEE80211_IF_TYPE_IBSS && 237 tx->sdata->type != IEEE80211_IF_TYPE_IBSS &&
237 (tx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA)) { 238 (tx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA)) {
238#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 239#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
240 DECLARE_MAC_BUF(mac);
239 printk(KERN_DEBUG "%s: dropped data frame to not " 241 printk(KERN_DEBUG "%s: dropped data frame to not "
240 "associated station " MAC_FMT "\n", 242 "associated station %s\n",
241 tx->dev->name, MAC_ARG(hdr->addr1)); 243 tx->dev->name, print_mac(mac, hdr->addr1));
242#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 244#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
243 I802_DEBUG_INC(tx->local->tx_handlers_drop_not_assoc); 245 I802_DEBUG_INC(tx->local->tx_handlers_drop_not_assoc);
244 return TXRX_DROP; 246 return TXRX_DROP;
@@ -259,9 +261,10 @@ ieee80211_tx_h_check_assoc(struct ieee80211_txrx_data *tx)
259 if (unlikely(!tx->u.tx.mgmt_interface && tx->sdata->ieee802_1x && 261 if (unlikely(!tx->u.tx.mgmt_interface && tx->sdata->ieee802_1x &&
260 !(sta_flags & WLAN_STA_AUTHORIZED))) { 262 !(sta_flags & WLAN_STA_AUTHORIZED))) {
261#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 263#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
262 printk(KERN_DEBUG "%s: dropped frame to " MAC_FMT 264 DECLARE_MAC_BUF(mac);
265 printk(KERN_DEBUG "%s: dropped frame to %s"
263 " (unauthorized port)\n", tx->dev->name, 266 " (unauthorized port)\n", tx->dev->name,
264 MAC_ARG(hdr->addr1)); 267 print_mac(mac, hdr->addr1));
265#endif 268#endif
266 I802_DEBUG_INC(tx->local->tx_handlers_drop_unauth_port); 269 I802_DEBUG_INC(tx->local->tx_handlers_drop_unauth_port);
267 return TXRX_DROP; 270 return TXRX_DROP;
@@ -357,6 +360,7 @@ static inline ieee80211_txrx_result
357ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx) 360ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
358{ 361{
359 struct sta_info *sta = tx->sta; 362 struct sta_info *sta = tx->sta;
363 DECLARE_MAC_BUF(mac);
360 364
361 if (unlikely(!sta || 365 if (unlikely(!sta ||
362 ((tx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT && 366 ((tx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT &&
@@ -366,9 +370,9 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
366 if (unlikely((sta->flags & WLAN_STA_PS) && !sta->pspoll)) { 370 if (unlikely((sta->flags & WLAN_STA_PS) && !sta->pspoll)) {
367 struct ieee80211_tx_packet_data *pkt_data; 371 struct ieee80211_tx_packet_data *pkt_data;
368#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 372#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
369 printk(KERN_DEBUG "STA " MAC_FMT " aid %d: PS buffer (entries " 373 printk(KERN_DEBUG "STA %s aid %d: PS buffer (entries "
370 "before %d)\n", 374 "before %d)\n",
371 MAC_ARG(sta->addr), sta->aid, 375 print_mac(mac, sta->addr), sta->aid,
372 skb_queue_len(&sta->ps_tx_buf)); 376 skb_queue_len(&sta->ps_tx_buf));
373#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 377#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
374 sta->flags |= WLAN_STA_TIM; 378 sta->flags |= WLAN_STA_TIM;
@@ -377,9 +381,9 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
377 if (skb_queue_len(&sta->ps_tx_buf) >= STA_MAX_TX_BUFFER) { 381 if (skb_queue_len(&sta->ps_tx_buf) >= STA_MAX_TX_BUFFER) {
378 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf); 382 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf);
379 if (net_ratelimit()) { 383 if (net_ratelimit()) {
380 printk(KERN_DEBUG "%s: STA " MAC_FMT " TX " 384 printk(KERN_DEBUG "%s: STA %s TX "
381 "buffer full - dropping oldest frame\n", 385 "buffer full - dropping oldest frame\n",
382 tx->dev->name, MAC_ARG(sta->addr)); 386 tx->dev->name, print_mac(mac, sta->addr));
383 } 387 }
384 dev_kfree_skb(old); 388 dev_kfree_skb(old);
385 } else 389 } else
@@ -399,9 +403,9 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
399 } 403 }
400#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 404#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
401 else if (unlikely(sta->flags & WLAN_STA_PS)) { 405 else if (unlikely(sta->flags & WLAN_STA_PS)) {
402 printk(KERN_DEBUG "%s: STA " MAC_FMT " in PS mode, but pspoll " 406 printk(KERN_DEBUG "%s: STA %s in PS mode, but pspoll "
403 "set -> send frame\n", tx->dev->name, 407 "set -> send frame\n", tx->dev->name,
404 MAC_ARG(sta->addr)); 408 print_mac(mac, sta->addr));
405 } 409 }
406#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 410#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
407 sta->pspoll = 0; 411 sta->pspoll = 0;
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
index 6e12638054a..360d11e9de1 100644
--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -132,6 +132,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx)
132 u8 mic[MICHAEL_MIC_LEN]; 132 u8 mic[MICHAEL_MIC_LEN];
133 struct sk_buff *skb = rx->skb; 133 struct sk_buff *skb = rx->skb;
134 int authenticator = 1, wpa_test = 0; 134 int authenticator = 1, wpa_test = 0;
135 DECLARE_MAC_BUF(mac);
135 136
136 fc = rx->fc; 137 fc = rx->fc;
137 138
@@ -164,7 +165,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx)
164 return TXRX_DROP; 165 return TXRX_DROP;
165 166
166 printk(KERN_DEBUG "%s: invalid Michael MIC in data frame from " 167 printk(KERN_DEBUG "%s: invalid Michael MIC in data frame from "
167 MAC_FMT "\n", rx->dev->name, MAC_ARG(sa)); 168 "%s\n", rx->dev->name, print_mac(mac, sa));
168 169
169 mac80211_ev_michael_mic_failure(rx->dev, rx->key->conf.keyidx, 170 mac80211_ev_michael_mic_failure(rx->dev, rx->key->conf.keyidx,
170 (void *) skb->data); 171 (void *) skb->data);
@@ -287,6 +288,7 @@ ieee80211_rx_h_tkip_decrypt(struct ieee80211_txrx_data *rx)
287 int hdrlen, res, hwaccel = 0, wpa_test = 0; 288 int hdrlen, res, hwaccel = 0, wpa_test = 0;
288 struct ieee80211_key *key = rx->key; 289 struct ieee80211_key *key = rx->key;
289 struct sk_buff *skb = rx->skb; 290 struct sk_buff *skb = rx->skb;
291 DECLARE_MAC_BUF(mac);
290 292
291 fc = le16_to_cpu(hdr->frame_control); 293 fc = le16_to_cpu(hdr->frame_control);
292 hdrlen = ieee80211_get_hdrlen(fc); 294 hdrlen = ieee80211_get_hdrlen(fc);
@@ -319,8 +321,8 @@ ieee80211_rx_h_tkip_decrypt(struct ieee80211_txrx_data *rx)
319 hwaccel, rx->u.rx.queue); 321 hwaccel, rx->u.rx.queue);
320 if (res != TKIP_DECRYPT_OK || wpa_test) { 322 if (res != TKIP_DECRYPT_OK || wpa_test) {
321 printk(KERN_DEBUG "%s: TKIP decrypt failed for RX frame from " 323 printk(KERN_DEBUG "%s: TKIP decrypt failed for RX frame from "
322 MAC_FMT " (res=%d)\n", 324 "%s (res=%d)\n",
323 rx->dev->name, MAC_ARG(rx->sta->addr), res); 325 rx->dev->name, print_mac(mac, rx->sta->addr), res);
324 return TXRX_DROP; 326 return TXRX_DROP;
325 } 327 }
326 328
@@ -542,6 +544,7 @@ ieee80211_rx_h_ccmp_decrypt(struct ieee80211_txrx_data *rx)
542 struct sk_buff *skb = rx->skb; 544 struct sk_buff *skb = rx->skb;
543 u8 pn[CCMP_PN_LEN]; 545 u8 pn[CCMP_PN_LEN];
544 int data_len; 546 int data_len;
547 DECLARE_MAC_BUF(mac);
545 548
546 fc = le16_to_cpu(hdr->frame_control); 549 fc = le16_to_cpu(hdr->frame_control);
547 hdrlen = ieee80211_get_hdrlen(fc); 550 hdrlen = ieee80211_get_hdrlen(fc);
@@ -564,10 +567,11 @@ ieee80211_rx_h_ccmp_decrypt(struct ieee80211_txrx_data *rx)
564 if (memcmp(pn, key->u.ccmp.rx_pn[rx->u.rx.queue], CCMP_PN_LEN) <= 0) { 567 if (memcmp(pn, key->u.ccmp.rx_pn[rx->u.rx.queue], CCMP_PN_LEN) <= 0) {
565#ifdef CONFIG_MAC80211_DEBUG 568#ifdef CONFIG_MAC80211_DEBUG
566 u8 *ppn = key->u.ccmp.rx_pn[rx->u.rx.queue]; 569 u8 *ppn = key->u.ccmp.rx_pn[rx->u.rx.queue];
570
567 printk(KERN_DEBUG "%s: CCMP replay detected for RX frame from " 571 printk(KERN_DEBUG "%s: CCMP replay detected for RX frame from "
568 MAC_FMT " (RX PN %02x%02x%02x%02x%02x%02x <= prev. PN " 572 "%s (RX PN %02x%02x%02x%02x%02x%02x <= prev. PN "
569 "%02x%02x%02x%02x%02x%02x)\n", rx->dev->name, 573 "%02x%02x%02x%02x%02x%02x)\n", rx->dev->name,
570 MAC_ARG(rx->sta->addr), 574 print_mac(mac, rx->sta->addr),
571 pn[0], pn[1], pn[2], pn[3], pn[4], pn[5], 575 pn[0], pn[1], pn[2], pn[3], pn[4], pn[5],
572 ppn[0], ppn[1], ppn[2], ppn[3], ppn[4], ppn[5]); 576 ppn[0], ppn[1], ppn[2], ppn[3], ppn[4], ppn[5]);
573#endif /* CONFIG_MAC80211_DEBUG */ 577#endif /* CONFIG_MAC80211_DEBUG */
@@ -591,8 +595,8 @@ ieee80211_rx_h_ccmp_decrypt(struct ieee80211_txrx_data *rx)
591 skb->data + skb->len - CCMP_MIC_LEN, 595 skb->data + skb->len - CCMP_MIC_LEN,
592 skb->data + hdrlen + CCMP_HDR_LEN)) { 596 skb->data + hdrlen + CCMP_HDR_LEN)) {
593 printk(KERN_DEBUG "%s: CCMP decrypt failed for RX " 597 printk(KERN_DEBUG "%s: CCMP decrypt failed for RX "
594 "frame from " MAC_FMT "\n", rx->dev->name, 598 "frame from %s\n", rx->dev->name,
595 MAC_ARG(rx->sta->addr)); 599 print_mac(mac, rx->sta->addr));
596 return TXRX_DROP; 600 return TXRX_DROP;
597 } 601 }
598 } 602 }
@@ -606,4 +610,3 @@ ieee80211_rx_h_ccmp_decrypt(struct ieee80211_txrx_data *rx)
606 610
607 return TXRX_CONTINUE; 611 return TXRX_CONTINUE;
608} 612}
609
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index d6fc0575816..1a99e294714 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -243,12 +243,12 @@ static int recv_notification(struct notifier_block *nb, unsigned long evt,
243static char *eth_addr2str(struct tipc_media_addr *a, char *str_buf, int str_size) 243static char *eth_addr2str(struct tipc_media_addr *a, char *str_buf, int str_size)
244{ 244{
245 unchar *addr = (unchar *)&a->dev_addr; 245 unchar *addr = (unchar *)&a->dev_addr;
246 DECLARE_MAC_BUF(mac);
246 247
247 if (str_size < 18) 248 if (str_size < 18)
248 *str_buf = '\0'; 249 *str_buf = '\0';
249 else 250 else
250 sprintf(str_buf, "%02x:%02x:%02x:%02x:%02x:%02x", 251 sprintf(str_buf, "%s", print_mac(mac, addr));
251 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
252 return str_buf; 252 return str_buf;
253} 253}
254 254