aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/adm8211.c5
-rw-r--r--drivers/net/wireless/airo.c32
-rw-r--r--drivers/net/wireless/arlan-main.c23
-rw-r--r--drivers/net/wireless/atmel.c7
-rw-r--r--drivers/net/wireless/b43/main.c5
-rw-r--r--drivers/net/wireless/b43legacy/main.c3
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx.h6
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_rx.c49
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_tx.c13
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.c198
-rw-r--r--drivers/net/wireless/hostap/hostap_common.h3
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c11
-rw-r--r--drivers/net/wireless/hostap/hostap_info.c17
-rw-r--r--drivers/net/wireless/hostap/hostap_ioctl.c15
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c30
-rw-r--r--drivers/net/wireless/hostap/hostap_proc.c15
-rw-r--r--drivers/net/wireless/ipw2100.c48
-rw-r--r--drivers/net/wireless/ipw2200.c207
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c34
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.c17
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c73
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c65
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c59
-rw-r--r--drivers/net/wireless/libertas/assoc.c19
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c5
-rw-r--r--drivers/net/wireless/libertas/debugfs.c5
-rw-r--r--drivers/net/wireless/libertas/join.c16
-rw-r--r--drivers/net/wireless/libertas/main.c12
-rw-r--r--drivers/net/wireless/libertas/scan.c14
-rw-r--r--drivers/net/wireless/libertas/wext.c5
-rw-r--r--drivers/net/wireless/netwave_cs.c14
-rw-r--r--drivers/net/wireless/orinoco.c7
-rw-r--r--drivers/net/wireless/prism54/isl_ioctl.c50
-rw-r--r--drivers/net/wireless/ray_cs.c13
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c5
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c4
-rw-r--r--drivers/net/wireless/rtl8187_dev.c5
-rw-r--r--drivers/net/wireless/wavelan.c53
-rw-r--r--drivers/net/wireless/wavelan_cs.c54
-rw-r--r--drivers/net/wireless/wl3501_cs.c22
-rw-r--r--drivers/net/wireless/zd1211rw/zd_chip.c3
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c8
46 files changed, 685 insertions, 581 deletions
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index eec01fc15282..ac2ea237019d 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1787,6 +1787,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
1787 int err; 1787 int err;
1788 u32 reg; 1788 u32 reg;
1789 u8 perm_addr[ETH_ALEN]; 1789 u8 perm_addr[ETH_ALEN];
1790 DECLARE_MAC_BUF(mac);
1790 1791
1791#ifndef MODULE 1792#ifndef MODULE
1792 static unsigned int cardidx; 1793 static unsigned int cardidx;
@@ -1938,8 +1939,8 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
1938 goto err_free_desc; 1939 goto err_free_desc;
1939 } 1940 }
1940 1941
1941 printk(KERN_INFO "%s: hwaddr " MAC_FMT ", Rev 0x%02x\n", 1942 printk(KERN_INFO "%s: hwaddr %s, Rev 0x%02x\n",
1942 wiphy_name(dev->wiphy), MAC_ARG(dev->wiphy->perm_addr), 1943 wiphy_name(dev->wiphy), print_mac(mac, dev->wiphy->perm_addr),
1943 priv->revid); 1944 priv->revid);
1944 1945
1945 return 0; 1946 return 0;
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 7d717c4d9845..95d3cd1c49a7 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -2821,6 +2821,7 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
2821 struct net_device *dev; 2821 struct net_device *dev;
2822 struct airo_info *ai; 2822 struct airo_info *ai;
2823 int i, rc; 2823 int i, rc;
2824 DECLARE_MAC_BUF(mac);
2824 2825
2825 /* Create the network device object. */ 2826 /* Create the network device object. */
2826 dev = alloc_netdev(sizeof(*ai), "", ether_setup); 2827 dev = alloc_netdev(sizeof(*ai), "", ether_setup);
@@ -2923,9 +2924,8 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
2923 goto err_out_reg; 2924 goto err_out_reg;
2924 2925
2925 set_bit(FLAG_REGISTERED,&ai->flags); 2926 set_bit(FLAG_REGISTERED,&ai->flags);
2926 airo_print_info(dev->name, "MAC enabled %x:%x:%x:%x:%x:%x", 2927 airo_print_info(dev->name, "MAC enabled %s",
2927 dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], 2928 print_mac(mac, dev->dev_addr));
2928 dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5] );
2929 2929
2930 /* Allocate the transmit buffers */ 2930 /* Allocate the transmit buffers */
2931 if (probe && !test_bit(FLAG_MPI,&ai->flags)) 2931 if (probe && !test_bit(FLAG_MPI,&ai->flags))
@@ -2982,6 +2982,7 @@ int reset_airo_card( struct net_device *dev )
2982{ 2982{
2983 int i; 2983 int i;
2984 struct airo_info *ai = dev->priv; 2984 struct airo_info *ai = dev->priv;
2985 DECLARE_MAC_BUF(mac);
2985 2986
2986 if (reset_card (dev, 1)) 2987 if (reset_card (dev, 1))
2987 return -1; 2988 return -1;
@@ -2990,9 +2991,8 @@ int reset_airo_card( struct net_device *dev )
2990 airo_print_err(dev->name, "MAC could not be enabled"); 2991 airo_print_err(dev->name, "MAC could not be enabled");
2991 return -1; 2992 return -1;
2992 } 2993 }
2993 airo_print_info(dev->name, "MAC enabled %x:%x:%x:%x:%x:%x", 2994 airo_print_info(dev->name, "MAC enabled %s",
2994 dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], 2995 print_mac(mac, dev->dev_addr));
2995 dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
2996 /* Allocate the transmit buffers if needed */ 2996 /* Allocate the transmit buffers if needed */
2997 if (!test_bit(FLAG_MPI,&ai->flags)) 2997 if (!test_bit(FLAG_MPI,&ai->flags))
2998 for( i = 0; i < MAX_FIDS; i++ ) 2998 for( i = 0; i < MAX_FIDS; i++ )
@@ -5426,6 +5426,7 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {
5426 int i; 5426 int i;
5427 char *ptr; 5427 char *ptr;
5428 APListRid APList_rid; 5428 APListRid APList_rid;
5429 DECLARE_MAC_BUF(mac);
5429 5430
5430 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 5431 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
5431 return -ENOMEM; 5432 return -ENOMEM;
@@ -5449,13 +5450,8 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {
5449// We end when we find a zero MAC 5450// We end when we find a zero MAC
5450 if ( !*(int*)APList_rid.ap[i] && 5451 if ( !*(int*)APList_rid.ap[i] &&
5451 !*(int*)&APList_rid.ap[i][2]) break; 5452 !*(int*)&APList_rid.ap[i][2]) break;
5452 ptr += sprintf(ptr, "%02x:%02x:%02x:%02x:%02x:%02x\n", 5453 ptr += sprintf(ptr, "%s\n",
5453 (int)APList_rid.ap[i][0], 5454 print_mac(mac, APList_rid.ap[i]));
5454 (int)APList_rid.ap[i][1],
5455 (int)APList_rid.ap[i][2],
5456 (int)APList_rid.ap[i][3],
5457 (int)APList_rid.ap[i][4],
5458 (int)APList_rid.ap[i][5]);
5459 } 5455 }
5460 if (i==0) ptr += sprintf(ptr, "Not using specific APs\n"); 5456 if (i==0) ptr += sprintf(ptr, "Not using specific APs\n");
5461 5457
@@ -5474,6 +5470,7 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
5474 int rc; 5470 int rc;
5475 /* If doLoseSync is not 1, we won't do a Lose Sync */ 5471 /* If doLoseSync is not 1, we won't do a Lose Sync */
5476 int doLoseSync = -1; 5472 int doLoseSync = -1;
5473 DECLARE_MAC_BUF(mac);
5477 5474
5478 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 5475 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
5479 return -ENOMEM; 5476 return -ENOMEM;
@@ -5510,13 +5507,8 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
5510 we have to add a spin lock... */ 5507 we have to add a spin lock... */
5511 rc = readBSSListRid(ai, doLoseSync, &BSSList_rid); 5508 rc = readBSSListRid(ai, doLoseSync, &BSSList_rid);
5512 while(rc == 0 && BSSList_rid.index != 0xffff) { 5509 while(rc == 0 && BSSList_rid.index != 0xffff) {
5513 ptr += sprintf(ptr, "%02x:%02x:%02x:%02x:%02x:%02x %*s rssi = %d", 5510 ptr += sprintf(ptr, "%s %*s rssi = %d",
5514 (int)BSSList_rid.bssid[0], 5511 print_mac(mac, BSSList_rid.bssid),
5515 (int)BSSList_rid.bssid[1],
5516 (int)BSSList_rid.bssid[2],
5517 (int)BSSList_rid.bssid[3],
5518 (int)BSSList_rid.bssid[4],
5519 (int)BSSList_rid.bssid[5],
5520 (int)BSSList_rid.ssidLen, 5512 (int)BSSList_rid.ssidLen,
5521 BSSList_rid.ssid, 5513 BSSList_rid.ssid,
5522 (int)BSSList_rid.dBm); 5514 (int)BSSList_rid.dBm);
diff --git a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c
index 3eaaab0ba0cc..dbdfc9e39d20 100644
--- a/drivers/net/wireless/arlan-main.c
+++ b/drivers/net/wireless/arlan-main.c
@@ -1469,10 +1469,10 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
1469 while (dmi) 1469 while (dmi)
1470 { if (dmi->dmi_addrlen == 6) 1470 { if (dmi->dmi_addrlen == 6)
1471 { 1471 {
1472 DECLARE_MAC_BUF(mac);
1472 if (arlan_debug & ARLAN_DEBUG_HEADER_DUMP) 1473 if (arlan_debug & ARLAN_DEBUG_HEADER_DUMP)
1473 printk(KERN_ERR "%s mcl %2x:%2x:%2x:%2x:%2x:%2x \n", dev->name, 1474 printk(KERN_ERR "%s mcl %s\n",
1474 dmi->dmi_addr[0], dmi->dmi_addr[1], dmi->dmi_addr[2], 1475 dev->name, print_mac(mac, dmi->dmi_addr));
1475 dmi->dmi_addr[3], dmi->dmi_addr[4], dmi->dmi_addr[5]);
1476 for (i = 0; i < 6; i++) 1476 for (i = 0; i < 6; i++)
1477 if (dmi->dmi_addr[i] != hw_dst_addr[i]) 1477 if (dmi->dmi_addr[i] != hw_dst_addr[i])
1478 break; 1478 break;
@@ -1512,17 +1512,18 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
1512 { 1512 {
1513 char immedDestAddress[6]; 1513 char immedDestAddress[6];
1514 char immedSrcAddress[6]; 1514 char immedSrcAddress[6];
1515 DECLARE_MAC_BUF(mac);
1516 DECLARE_MAC_BUF(mac2);
1517 DECLARE_MAC_BUF(mac3);
1518 DECLARE_MAC_BUF(mac4);
1515 memcpy_fromio(immedDestAddress, arlan->immedDestAddress, 6); 1519 memcpy_fromio(immedDestAddress, arlan->immedDestAddress, 6);
1516 memcpy_fromio(immedSrcAddress, arlan->immedSrcAddress, 6); 1520 memcpy_fromio(immedSrcAddress, arlan->immedSrcAddress, 6);
1517 1521
1518 printk(KERN_WARNING "%s t %2x:%2x:%2x:%2x:%2x:%2x f %2x:%2x:%2x:%2x:%2x:%2x imd %2x:%2x:%2x:%2x:%2x:%2x ims %2x:%2x:%2x:%2x:%2x:%2x\n", dev->name, 1522 printk(KERN_WARNING "%s t %s f %s imd %s ims %s\n",
1519 (unsigned char) skbtmp[0], (unsigned char) skbtmp[1], (unsigned char) skbtmp[2], (unsigned char) skbtmp[3], 1523 dev->name, print_mac(mac, skbtmp),
1520 (unsigned char) skbtmp[4], (unsigned char) skbtmp[5], (unsigned char) skbtmp[6], (unsigned char) skbtmp[7], 1524 print_mac(mac2, &skbtmp[6]),
1521 (unsigned char) skbtmp[8], (unsigned char) skbtmp[9], (unsigned char) skbtmp[10], (unsigned char) skbtmp[11], 1525 print_mac(mac3, immedDestAddress),
1522 immedDestAddress[0], immedDestAddress[1], immedDestAddress[2], 1526 print_mac(mac4, immedSrcAddress));
1523 immedDestAddress[3], immedDestAddress[4], immedDestAddress[5],
1524 immedSrcAddress[0], immedSrcAddress[1], immedSrcAddress[2],
1525 immedSrcAddress[3], immedSrcAddress[4], immedSrcAddress[5]);
1526 } 1527 }
1527 skb->protocol = eth_type_trans(skb, dev); 1528 skb->protocol = eth_type_trans(skb, dev);
1528 IFDEBUG(ARLAN_DEBUG_HEADER_DUMP) 1529 IFDEBUG(ARLAN_DEBUG_HEADER_DUMP)
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index 47dbdf95ea6f..059ce3f07dba 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -1484,6 +1484,7 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
1484 struct net_device *dev; 1484 struct net_device *dev;
1485 struct atmel_private *priv; 1485 struct atmel_private *priv;
1486 int rc; 1486 int rc;
1487 DECLARE_MAC_BUF(mac);
1487 1488
1488 /* Create the network device object. */ 1489 /* Create the network device object. */
1489 dev = alloc_etherdev(sizeof(*priv)); 1490 dev = alloc_etherdev(sizeof(*priv));
@@ -1598,10 +1599,8 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
1598 if (!ent) 1599 if (!ent)
1599 printk(KERN_WARNING "atmel: unable to create /proc entry.\n"); 1600 printk(KERN_WARNING "atmel: unable to create /proc entry.\n");
1600 1601
1601 printk(KERN_INFO "%s: Atmel at76c50x. Version %d.%d. MAC %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", 1602 printk(KERN_INFO "%s: Atmel at76c50x. Version %d.%d. MAC %s\n",
1602 dev->name, DRIVER_MAJOR, DRIVER_MINOR, 1603 dev->name, DRIVER_MAJOR, DRIVER_MINOR, print_mac(mac, dev->dev_addr));
1603 dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
1604 dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5] );
1605 1604
1606 return dev; 1605 return dev;
1607 1606
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 184ebe3ed738..fd4ef27fcf25 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2883,6 +2883,7 @@ static int b43_dev_set_key(struct ieee80211_hw *hw,
2883 u8 algorithm; 2883 u8 algorithm;
2884 u8 index; 2884 u8 index;
2885 int err = -EINVAL; 2885 int err = -EINVAL;
2886 DECLARE_MAC_BUF(mac);
2886 2887
2887 if (modparam_nohwcrypt) 2888 if (modparam_nohwcrypt)
2888 return -ENOSPC; /* User disabled HW-crypto */ 2889 return -ENOSPC; /* User disabled HW-crypto */
@@ -2969,9 +2970,9 @@ out_unlock:
2969out: 2970out:
2970 if (!err) { 2971 if (!err) {
2971 b43dbg(wl, "%s hardware based encryption for keyidx: %d, " 2972 b43dbg(wl, "%s hardware based encryption for keyidx: %d, "
2972 "mac: " MAC_FMT "\n", 2973 "mac: %s\n",
2973 cmd == SET_KEY ? "Using" : "Disabling", key->keyidx, 2974 cmd == SET_KEY ? "Using" : "Disabling", key->keyidx,
2974 MAC_ARG(addr)); 2975 print_mac(mac, addr));
2975 } 2976 }
2976 return err; 2977 return err;
2977} 2978}
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index ac4831adb574..61b94218094b 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2679,6 +2679,7 @@ static int b43legacy_dev_set_key(struct ieee80211_hw *hw,
2679 struct b43legacy_wldev *dev = wl->current_dev; 2679 struct b43legacy_wldev *dev = wl->current_dev;
2680 unsigned long flags; 2680 unsigned long flags;
2681 int err = -EOPNOTSUPP; 2681 int err = -EOPNOTSUPP;
2682 DECLARE_MAC_BUF(mac);
2682 2683
2683 if (!dev) 2684 if (!dev)
2684 return -ENODEV; 2685 return -ENODEV;
@@ -2691,7 +2692,7 @@ static int b43legacy_dev_set_key(struct ieee80211_hw *hw,
2691 spin_unlock_irqrestore(&wl->irq_lock, flags); 2692 spin_unlock_irqrestore(&wl->irq_lock, flags);
2692 mutex_unlock(&wl->mutex); 2693 mutex_unlock(&wl->mutex);
2693 b43legacydbg(wl, "Using software based encryption for " 2694 b43legacydbg(wl, "Using software based encryption for "
2694 "mac: " MAC_FMT "\n", MAC_ARG(addr)); 2695 "mac: %s\n", print_mac(mac, addr));
2695 return err; 2696 return err;
2696} 2697}
2697 2698
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx.h b/drivers/net/wireless/bcm43xx/bcm43xx.h
index 10e07e865426..5fdbf24d2443 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx.h
@@ -994,10 +994,4 @@ int bcm43xx_pci_write_config32(struct bcm43xx_private *bcm, int offset, u32 valu
994 __value; \ 994 __value; \
995 }) 995 })
996 996
997/** Helpers to print MAC addresses. */
998#define BCM43xx_MACFMT "%02x:%02x:%02x:%02x:%02x:%02x"
999#define BCM43xx_MACARG(x) ((u8*)(x))[0], ((u8*)(x))[1], \
1000 ((u8*)(x))[2], ((u8*)(x))[3], \
1001 ((u8*)(x))[4], ((u8*)(x))[5]
1002
1003#endif /* BCM43xx_H_ */ 997#endif /* BCM43xx_H_ */
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
index cbedc9ee740a..ef084df3d48e 100644
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -19,6 +19,7 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
19{ 19{
20 struct ieee80211_hdr_4addr *hdr; 20 struct ieee80211_hdr_4addr *hdr;
21 u16 fc; 21 u16 fc;
22 DECLARE_MAC_BUF(mac);
22 23
23 hdr = (struct ieee80211_hdr_4addr *) skb->data; 24 hdr = (struct ieee80211_hdr_4addr *) skb->data;
24 25
@@ -44,10 +45,11 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
44 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id), 45 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id),
45 le16_to_cpu(hdr->seq_ctl)); 46 le16_to_cpu(hdr->seq_ctl));
46 47
47 printk(KERN_DEBUG " A1=" MACSTR " A2=" MACSTR " A3=" MACSTR, 48 printk(KERN_DEBUG " A1=%s", print_mac(mac, hdr->addr1));
48 MAC2STR(hdr->addr1), MAC2STR(hdr->addr2), MAC2STR(hdr->addr3)); 49 printk(" A2=%s", print_mac(mac, hdr->addr2));
50 printk(" A3=%s", print_mac(mac, hdr->addr3));
49 if (skb->len >= 30) 51 if (skb->len >= 30)
50 printk(" A4=" MACSTR, MAC2STR(hdr->addr4)); 52 printk(" A4=%s", print_mac(mac, hdr->addr4));
51 printk("\n"); 53 printk("\n");
52} 54}
53 55
@@ -534,6 +536,7 @@ static int
534hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr, 536hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr,
535 u16 fc, struct net_device **wds) 537 u16 fc, struct net_device **wds)
536{ 538{
539 DECLARE_MAC_BUF(mac);
537 /* FIX: is this really supposed to accept WDS frames only in Master 540 /* FIX: is this really supposed to accept WDS frames only in Master
538 * mode? What about Repeater or Managed with WDS frames? */ 541 * mode? What about Repeater or Managed with WDS frames? */
539 if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) != 542 if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) !=
@@ -549,10 +552,10 @@ hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr,
549 hdr->addr1[4] != 0xff || hdr->addr1[5] != 0xff)) { 552 hdr->addr1[4] != 0xff || hdr->addr1[5] != 0xff)) {
550 /* RA (or BSSID) is not ours - drop */ 553 /* RA (or BSSID) is not ours - drop */
551 PDEBUG(DEBUG_EXTRA, "%s: received WDS frame with " 554 PDEBUG(DEBUG_EXTRA, "%s: received WDS frame with "
552 "not own or broadcast %s=" MACSTR "\n", 555 "not own or broadcast %s=%s\n",
553 local->dev->name, 556 local->dev->name,
554 fc & IEEE80211_FCTL_FROMDS ? "RA" : "BSSID", 557 fc & IEEE80211_FCTL_FROMDS ? "RA" : "BSSID",
555 MAC2STR(hdr->addr1)); 558 print_mac(mac, hdr->addr1));
556 return -1; 559 return -1;
557 } 560 }
558 561
@@ -565,8 +568,8 @@ hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr,
565 /* require that WDS link has been registered with TA or the 568 /* require that WDS link has been registered with TA or the
566 * frame is from current AP when using 'AP client mode' */ 569 * frame is from current AP when using 'AP client mode' */
567 PDEBUG(DEBUG_EXTRA, "%s: received WDS[4 addr] frame " 570 PDEBUG(DEBUG_EXTRA, "%s: received WDS[4 addr] frame "
568 "from unknown TA=" MACSTR "\n", 571 "from unknown TA=%s\n",
569 local->dev->name, MAC2STR(hdr->addr2)); 572 local->dev->name, print_mac(mac, hdr->addr2));
570 if (local->ap && local->ap->autom_ap_wds) 573 if (local->ap && local->ap->autom_ap_wds)
571 hostap_wds_link_oper(local, hdr->addr2, WDS_ADD); 574 hostap_wds_link_oper(local, hdr->addr2, WDS_ADD);
572 return -1; 575 return -1;
@@ -632,6 +635,7 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
632{ 635{
633 struct ieee80211_hdr_4addr *hdr; 636 struct ieee80211_hdr_4addr *hdr;
634 int res, hdrlen; 637 int res, hdrlen;
638 DECLARE_MAC_BUF(mac);
635 639
636 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) 640 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL)
637 return 0; 641 return 0;
@@ -643,8 +647,8 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
643 strcmp(crypt->ops->name, "TKIP") == 0) { 647 strcmp(crypt->ops->name, "TKIP") == 0) {
644 if (net_ratelimit()) { 648 if (net_ratelimit()) {
645 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " 649 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
646 "received packet from " MACSTR "\n", 650 "received packet from %s\n",
647 local->dev->name, MAC2STR(hdr->addr2)); 651 local->dev->name, print_mac(mac, hdr->addr2));
648 } 652 }
649 return -1; 653 return -1;
650 } 654 }
@@ -653,9 +657,9 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
653 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); 657 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv);
654 atomic_dec(&crypt->refcnt); 658 atomic_dec(&crypt->refcnt);
655 if (res < 0) { 659 if (res < 0) {
656 printk(KERN_DEBUG "%s: decryption failed (SA=" MACSTR 660 printk(KERN_DEBUG "%s: decryption failed (SA=%s"
657 ") res=%d\n", 661 ") res=%d\n",
658 local->dev->name, MAC2STR(hdr->addr2), res); 662 local->dev->name, print_mac(mac, hdr->addr2), res);
659 local->comm_tallies.rx_discards_wep_undecryptable++; 663 local->comm_tallies.rx_discards_wep_undecryptable++;
660 return -1; 664 return -1;
661 } 665 }
@@ -671,6 +675,7 @@ hostap_rx_frame_decrypt_msdu(local_info_t *local, struct sk_buff *skb,
671{ 675{
672 struct ieee80211_hdr_4addr *hdr; 676 struct ieee80211_hdr_4addr *hdr;
673 int res, hdrlen; 677 int res, hdrlen;
678 DECLARE_MAC_BUF(mac);
674 679
675 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL) 680 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL)
676 return 0; 681 return 0;
@@ -683,8 +688,8 @@ hostap_rx_frame_decrypt_msdu(local_info_t *local, struct sk_buff *skb,
683 atomic_dec(&crypt->refcnt); 688 atomic_dec(&crypt->refcnt);
684 if (res < 0) { 689 if (res < 0) {
685 printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed" 690 printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed"
686 " (SA=" MACSTR " keyidx=%d)\n", 691 " (SA=%s keyidx=%d)\n",
687 local->dev->name, MAC2STR(hdr->addr2), keyidx); 692 local->dev->name, print_mac(mac, hdr->addr2), keyidx);
688 return -1; 693 return -1;
689 } 694 }
690 695
@@ -716,6 +721,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
716 struct ieee80211_crypt_data *crypt = NULL; 721 struct ieee80211_crypt_data *crypt = NULL;
717 void *sta = NULL; 722 void *sta = NULL;
718 int keyidx = 0; 723 int keyidx = 0;
724 DECLARE_MAC_BUF(mac);
719 725
720 iface = netdev_priv(dev); 726 iface = netdev_priv(dev);
721 local = iface->local; 727 local = iface->local;
@@ -792,8 +798,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
792 * frames silently instead of filling system log with 798 * frames silently instead of filling system log with
793 * these reports. */ 799 * these reports. */
794 printk(KERN_DEBUG "%s: WEP decryption failed (not set)" 800 printk(KERN_DEBUG "%s: WEP decryption failed (not set)"
795 " (SA=" MACSTR ")\n", 801 " (SA=%s)\n",
796 local->dev->name, MAC2STR(hdr->addr2)); 802 local->dev->name, print_mac(mac, hdr->addr2));
797#endif 803#endif
798 local->comm_tallies.rx_discards_wep_undecryptable++; 804 local->comm_tallies.rx_discards_wep_undecryptable++;
799 goto rx_dropped; 805 goto rx_dropped;
@@ -807,8 +813,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
807 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) 813 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0)
808 { 814 {
809 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " 815 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth "
810 "from " MACSTR "\n", dev->name, 816 "from %s\n", dev->name,
811 MAC2STR(hdr->addr2)); 817 print_mac(mac, hdr->addr2));
812 /* TODO: could inform hostapd about this so that it 818 /* TODO: could inform hostapd about this so that it
813 * could send auth failure report */ 819 * could send auth failure report */
814 goto rx_dropped; 820 goto rx_dropped;
@@ -976,8 +982,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
976 "unencrypted EAPOL frame\n", local->dev->name); 982 "unencrypted EAPOL frame\n", local->dev->name);
977 } else { 983 } else {
978 printk(KERN_DEBUG "%s: encryption configured, but RX " 984 printk(KERN_DEBUG "%s: encryption configured, but RX "
979 "frame not encrypted (SA=" MACSTR ")\n", 985 "frame not encrypted (SA=%s)\n",
980 local->dev->name, MAC2STR(hdr->addr2)); 986 local->dev->name, print_mac(mac, hdr->addr2));
981 goto rx_dropped; 987 goto rx_dropped;
982 } 988 }
983 } 989 }
@@ -986,8 +992,9 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
986 !hostap_is_eapol_frame(local, skb)) { 992 !hostap_is_eapol_frame(local, skb)) {
987 if (net_ratelimit()) { 993 if (net_ratelimit()) {
988 printk(KERN_DEBUG "%s: dropped unencrypted RX data " 994 printk(KERN_DEBUG "%s: dropped unencrypted RX data "
989 "frame from " MACSTR " (drop_unencrypted=1)\n", 995 "frame from %s"
990 dev->name, MAC2STR(hdr->addr2)); 996 " (drop_unencrypted=1)\n",
997 dev->name, print_mac(mac, hdr->addr2));
991 } 998 }
992 goto rx_dropped; 999 goto rx_dropped;
993 } 1000 }
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
index 3df3c60263d4..e7afc3ec3e6d 100644
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c
@@ -17,6 +17,7 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)
17{ 17{
18 struct ieee80211_hdr_4addr *hdr; 18 struct ieee80211_hdr_4addr *hdr;
19 u16 fc; 19 u16 fc;
20 DECLARE_MAC_BUF(mac);
20 21
21 hdr = (struct ieee80211_hdr_4addr *) skb->data; 22 hdr = (struct ieee80211_hdr_4addr *) skb->data;
22 23
@@ -40,10 +41,11 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)
40 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id), 41 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id),
41 le16_to_cpu(hdr->seq_ctl)); 42 le16_to_cpu(hdr->seq_ctl));
42 43
43 printk(KERN_DEBUG " A1=" MACSTR " A2=" MACSTR " A3=" MACSTR, 44 printk(KERN_DEBUG " A1=%s", print_mac(mac, hdr->addr1));
44 MAC2STR(hdr->addr1), MAC2STR(hdr->addr2), MAC2STR(hdr->addr3)); 45 printk(" A2=%s", print_mac(mac, hdr->addr2));
46 printk(" A3=%s", print_mac(mac, hdr->addr3));
45 if (skb->len >= 30) 47 if (skb->len >= 30)
46 printk(" A4=" MACSTR, MAC2STR(hdr->addr4)); 48 printk(" A4=%s", print_mac(mac, hdr->addr4));
47 printk("\n"); 49 printk("\n");
48} 50}
49 51
@@ -312,6 +314,7 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
312 struct ieee80211_hdr_4addr *hdr; 314 struct ieee80211_hdr_4addr *hdr;
313 u16 fc; 315 u16 fc;
314 int prefix_len, postfix_len, hdr_len, res; 316 int prefix_len, postfix_len, hdr_len, res;
317 DECLARE_MAC_BUF(mac);
315 318
316 iface = netdev_priv(skb->dev); 319 iface = netdev_priv(skb->dev);
317 local = iface->local; 320 local = iface->local;
@@ -326,8 +329,8 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
326 hdr = (struct ieee80211_hdr_4addr *) skb->data; 329 hdr = (struct ieee80211_hdr_4addr *) skb->data;
327 if (net_ratelimit()) { 330 if (net_ratelimit()) {
328 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " 331 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
329 "TX packet to " MACSTR "\n", 332 "TX packet to %s\n",
330 local->dev->name, MAC2STR(hdr->addr1)); 333 local->dev->name, print_mac(mac, hdr->addr1));
331 } 334 }
332 kfree_skb(skb); 335 kfree_skb(skb);
333 return NULL; 336 return NULL;
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index 90900525379c..6bbdb76b32df 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -94,6 +94,7 @@ static void ap_sta_hash_add(struct ap_data *ap, struct sta_info *sta)
94static void ap_sta_hash_del(struct ap_data *ap, struct sta_info *sta) 94static void ap_sta_hash_del(struct ap_data *ap, struct sta_info *sta)
95{ 95{
96 struct sta_info *s; 96 struct sta_info *s;
97 DECLARE_MAC_BUF(mac);
97 98
98 s = ap->sta_hash[STA_HASH(sta->addr)]; 99 s = ap->sta_hash[STA_HASH(sta->addr)];
99 if (s == NULL) return; 100 if (s == NULL) return;
@@ -108,18 +109,20 @@ static void ap_sta_hash_del(struct ap_data *ap, struct sta_info *sta)
108 if (s->hnext != NULL) 109 if (s->hnext != NULL)
109 s->hnext = s->hnext->hnext; 110 s->hnext = s->hnext->hnext;
110 else 111 else
111 printk("AP: could not remove STA " MACSTR " from hash table\n", 112 printk("AP: could not remove STA %s"
112 MAC2STR(sta->addr)); 113 " from hash table\n",
114 print_mac(mac, sta->addr));
113} 115}
114 116
115static void ap_free_sta(struct ap_data *ap, struct sta_info *sta) 117static void ap_free_sta(struct ap_data *ap, struct sta_info *sta)
116{ 118{
119 DECLARE_MAC_BUF(mac);
117 if (sta->ap && sta->local) 120 if (sta->ap && sta->local)
118 hostap_event_expired_sta(sta->local->dev, sta); 121 hostap_event_expired_sta(sta->local->dev, sta);
119 122
120 if (ap->proc != NULL) { 123 if (ap->proc != NULL) {
121 char name[20]; 124 char name[20];
122 sprintf(name, MACSTR, MAC2STR(sta->addr)); 125 sprintf(name, "%s", print_mac(mac, sta->addr));
123 remove_proc_entry(name, ap->proc); 126 remove_proc_entry(name, ap->proc);
124 } 127 }
125 128
@@ -182,6 +185,7 @@ static void ap_handle_timer(unsigned long data)
182 struct ap_data *ap; 185 struct ap_data *ap;
183 unsigned long next_time = 0; 186 unsigned long next_time = 0;
184 int was_assoc; 187 int was_assoc;
188 DECLARE_MAC_BUF(mac);
185 189
186 if (sta == NULL || sta->local == NULL || sta->local->ap == NULL) { 190 if (sta == NULL || sta->local == NULL || sta->local->ap == NULL) {
187 PDEBUG(DEBUG_AP, "ap_handle_timer() called with NULL data\n"); 191 PDEBUG(DEBUG_AP, "ap_handle_timer() called with NULL data\n");
@@ -238,8 +242,8 @@ static void ap_handle_timer(unsigned long data)
238 if (sta->ap) { 242 if (sta->ap) {
239 if (ap->autom_ap_wds) { 243 if (ap->autom_ap_wds) {
240 PDEBUG(DEBUG_AP, "%s: removing automatic WDS " 244 PDEBUG(DEBUG_AP, "%s: removing automatic WDS "
241 "connection to AP " MACSTR "\n", 245 "connection to AP %s\n",
242 local->dev->name, MAC2STR(sta->addr)); 246 local->dev->name, print_mac(mac, sta->addr));
243 hostap_wds_link_oper(local, sta->addr, WDS_DEL); 247 hostap_wds_link_oper(local, sta->addr, WDS_DEL);
244 } 248 }
245 } else if (sta->timeout_next == STA_NULLFUNC) { 249 } else if (sta->timeout_next == STA_NULLFUNC) {
@@ -255,11 +259,11 @@ static void ap_handle_timer(unsigned long data)
255 } else { 259 } else {
256 int deauth = sta->timeout_next == STA_DEAUTH; 260 int deauth = sta->timeout_next == STA_DEAUTH;
257 u16 resp; 261 u16 resp;
258 PDEBUG(DEBUG_AP, "%s: sending %s info to STA " MACSTR 262 PDEBUG(DEBUG_AP, "%s: sending %s info to STA %s"
259 "(last=%lu, jiffies=%lu)\n", 263 "(last=%lu, jiffies=%lu)\n",
260 local->dev->name, 264 local->dev->name,
261 deauth ? "deauthentication" : "disassociation", 265 deauth ? "deauthentication" : "disassociation",
262 MAC2STR(sta->addr), sta->last_rx, jiffies); 266 print_mac(mac, sta->addr), sta->last_rx, jiffies);
263 267
264 resp = cpu_to_le16(deauth ? WLAN_REASON_PREV_AUTH_NOT_VALID : 268 resp = cpu_to_le16(deauth ? WLAN_REASON_PREV_AUTH_NOT_VALID :
265 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY); 269 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY);
@@ -271,9 +275,10 @@ static void ap_handle_timer(unsigned long data)
271 275
272 if (sta->timeout_next == STA_DEAUTH) { 276 if (sta->timeout_next == STA_DEAUTH) {
273 if (sta->flags & WLAN_STA_PERM) { 277 if (sta->flags & WLAN_STA_PERM) {
274 PDEBUG(DEBUG_AP, "%s: STA " MACSTR " would have been " 278 PDEBUG(DEBUG_AP, "%s: STA %s"
275 "removed, but it has 'perm' flag\n", 279 " would have been removed, "
276 local->dev->name, MAC2STR(sta->addr)); 280 "but it has 'perm' flag\n",
281 local->dev->name, print_mac(mac, sta->addr));
277 } else 282 } else
278 ap_free_sta(ap, sta); 283 ap_free_sta(ap, sta);
279 return; 284 return;
@@ -327,6 +332,7 @@ static int ap_control_proc_read(char *page, char **start, off_t off,
327 struct ap_data *ap = (struct ap_data *) data; 332 struct ap_data *ap = (struct ap_data *) data;
328 char *policy_txt; 333 char *policy_txt;
329 struct mac_entry *entry; 334 struct mac_entry *entry;
335 DECLARE_MAC_BUF(mac);
330 336
331 if (off != 0) { 337 if (off != 0) {
332 *eof = 1; 338 *eof = 1;
@@ -357,7 +363,7 @@ static int ap_control_proc_read(char *page, char **start, off_t off,
357 break; 363 break;
358 } 364 }
359 365
360 p += sprintf(p, MACSTR "\n", MAC2STR(entry->addr)); 366 p += sprintf(p, "%s\n", print_mac(mac, entry->addr));
361 } 367 }
362 spin_unlock_bh(&ap->mac_restrictions.lock); 368 spin_unlock_bh(&ap->mac_restrictions.lock);
363 369
@@ -514,6 +520,7 @@ static int prism2_ap_proc_read(char *page, char **start, off_t off,
514 struct ap_data *ap = (struct ap_data *) data; 520 struct ap_data *ap = (struct ap_data *) data;
515 struct sta_info *sta; 521 struct sta_info *sta;
516 int i; 522 int i;
523 DECLARE_MAC_BUF(mac);
517 524
518 if (off > PROC_LIMIT) { 525 if (off > PROC_LIMIT) {
519 *eof = 1; 526 *eof = 1;
@@ -526,7 +533,8 @@ static int prism2_ap_proc_read(char *page, char **start, off_t off,
526 if (!sta->ap) 533 if (!sta->ap)
527 continue; 534 continue;
528 535
529 p += sprintf(p, MACSTR " %d %d %d %d '", MAC2STR(sta->addr), 536 p += sprintf(p, "%s %d %d %d %d '",
537 print_mac(mac, sta->addr),
530 sta->u.ap.channel, sta->last_rx_signal, 538 sta->u.ap.channel, sta->last_rx_signal,
531 sta->last_rx_silence, sta->last_rx_rate); 539 sta->last_rx_silence, sta->last_rx_rate);
532 for (i = 0; i < sta->u.ap.ssid_len; i++) 540 for (i = 0; i < sta->u.ap.ssid_len; i++)
@@ -623,6 +631,7 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data)
623 u16 fc, *pos, auth_alg, auth_transaction, status; 631 u16 fc, *pos, auth_alg, auth_transaction, status;
624 struct sta_info *sta = NULL; 632 struct sta_info *sta = NULL;
625 char *txt = NULL; 633 char *txt = NULL;
634 DECLARE_MAC_BUF(mac);
626 635
627 if (ap->local->hostapd) { 636 if (ap->local->hostapd) {
628 dev_kfree_skb(skb); 637 dev_kfree_skb(skb);
@@ -674,9 +683,9 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data)
674 if (sta) 683 if (sta)
675 atomic_dec(&sta->users); 684 atomic_dec(&sta->users);
676 if (txt) { 685 if (txt) {
677 PDEBUG(DEBUG_AP, "%s: " MACSTR " auth_cb - alg=%d trans#=%d " 686 PDEBUG(DEBUG_AP, "%s: %s auth_cb - alg=%d "
678 "status=%d - %s\n", 687 "trans#=%d status=%d - %s\n",
679 dev->name, MAC2STR(hdr->addr1), auth_alg, 688 dev->name, print_mac(mac, hdr->addr1), auth_alg,
680 auth_transaction, status, txt); 689 auth_transaction, status, txt);
681 } 690 }
682 dev_kfree_skb(skb); 691 dev_kfree_skb(skb);
@@ -692,6 +701,7 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
692 u16 fc, *pos, status; 701 u16 fc, *pos, status;
693 struct sta_info *sta = NULL; 702 struct sta_info *sta = NULL;
694 char *txt = NULL; 703 char *txt = NULL;
704 DECLARE_MAC_BUF(mac);
695 705
696 if (ap->local->hostapd) { 706 if (ap->local->hostapd) {
697 dev_kfree_skb(skb); 707 dev_kfree_skb(skb);
@@ -742,8 +752,8 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
742 if (sta) 752 if (sta)
743 atomic_dec(&sta->users); 753 atomic_dec(&sta->users);
744 if (txt) { 754 if (txt) {
745 PDEBUG(DEBUG_AP, "%s: " MACSTR " assoc_cb - %s\n", 755 PDEBUG(DEBUG_AP, "%s: %s assoc_cb - %s\n",
746 dev->name, MAC2STR(hdr->addr1), txt); 756 dev->name, print_mac(mac, hdr->addr1), txt);
747 } 757 }
748 dev_kfree_skb(skb); 758 dev_kfree_skb(skb);
749} 759}
@@ -755,6 +765,7 @@ static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data)
755 struct ap_data *ap = data; 765 struct ap_data *ap = data;
756 struct ieee80211_hdr_4addr *hdr; 766 struct ieee80211_hdr_4addr *hdr;
757 struct sta_info *sta; 767 struct sta_info *sta;
768 DECLARE_MAC_BUF(mac);
758 769
759 if (skb->len < 24) 770 if (skb->len < 24)
760 goto fail; 771 goto fail;
@@ -766,9 +777,9 @@ static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data)
766 sta->flags &= ~WLAN_STA_PENDING_POLL; 777 sta->flags &= ~WLAN_STA_PENDING_POLL;
767 spin_unlock(&ap->sta_table_lock); 778 spin_unlock(&ap->sta_table_lock);
768 } else { 779 } else {
769 PDEBUG(DEBUG_AP, "%s: STA " MACSTR " did not ACK activity " 780 PDEBUG(DEBUG_AP, "%s: STA %s"
770 "poll frame\n", ap->local->dev->name, 781 " did not ACK activity poll frame\n",
771 MAC2STR(hdr->addr1)); 782 ap->local->dev->name, print_mac(mac, hdr->addr1));
772 } 783 }
773 784
774 fail: 785 fail:
@@ -985,6 +996,7 @@ static int prism2_sta_proc_read(char *page, char **start, off_t off,
985 char *p = page; 996 char *p = page;
986 struct sta_info *sta = (struct sta_info *) data; 997 struct sta_info *sta = (struct sta_info *) data;
987 int i; 998 int i;
999 DECLARE_MAC_BUF(mac);
988 1000
989 /* FIX: possible race condition.. the STA data could have just expired, 1001 /* FIX: possible race condition.. the STA data could have just expired,
990 * but proc entry was still here so that the read could have started; 1002 * but proc entry was still here so that the read could have started;
@@ -995,11 +1007,11 @@ static int prism2_sta_proc_read(char *page, char **start, off_t off,
995 return 0; 1007 return 0;
996 } 1008 }
997 1009
998 p += sprintf(p, "%s=" MACSTR "\nusers=%d\naid=%d\n" 1010 p += sprintf(p, "%s=%s\nusers=%d\naid=%d\n"
999 "flags=0x%04x%s%s%s%s%s%s%s\n" 1011 "flags=0x%04x%s%s%s%s%s%s%s\n"
1000 "capability=0x%02x\nlisten_interval=%d\nsupported_rates=", 1012 "capability=0x%02x\nlisten_interval=%d\nsupported_rates=",
1001 sta->ap ? "AP" : "STA", 1013 sta->ap ? "AP" : "STA",
1002 MAC2STR(sta->addr), atomic_read(&sta->users), sta->aid, 1014 print_mac(mac, sta->addr), atomic_read(&sta->users), sta->aid,
1003 sta->flags, 1015 sta->flags,
1004 sta->flags & WLAN_STA_AUTH ? " AUTH" : "", 1016 sta->flags & WLAN_STA_AUTH ? " AUTH" : "",
1005 sta->flags & WLAN_STA_ASSOC ? " ASSOC" : "", 1017 sta->flags & WLAN_STA_ASSOC ? " ASSOC" : "",
@@ -1060,6 +1072,7 @@ static void handle_add_proc_queue(struct work_struct *work)
1060 struct sta_info *sta; 1072 struct sta_info *sta;
1061 char name[20]; 1073 char name[20];
1062 struct add_sta_proc_data *entry, *prev; 1074 struct add_sta_proc_data *entry, *prev;
1075 DECLARE_MAC_BUF(mac);
1063 1076
1064 entry = ap->add_sta_proc_entries; 1077 entry = ap->add_sta_proc_entries;
1065 ap->add_sta_proc_entries = NULL; 1078 ap->add_sta_proc_entries = NULL;
@@ -1072,7 +1085,7 @@ static void handle_add_proc_queue(struct work_struct *work)
1072 spin_unlock_bh(&ap->sta_table_lock); 1085 spin_unlock_bh(&ap->sta_table_lock);
1073 1086
1074 if (sta) { 1087 if (sta) {
1075 sprintf(name, MACSTR, MAC2STR(sta->addr)); 1088 sprintf(name, "%s", print_mac(mac, sta->addr));
1076 sta->proc = create_proc_read_entry( 1089 sta->proc = create_proc_read_entry(
1077 name, 0, ap->proc, 1090 name, 0, ap->proc,
1078 prism2_sta_proc_read, sta); 1091 prism2_sta_proc_read, sta);
@@ -1290,6 +1303,7 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1290 struct sta_info *sta = NULL; 1303 struct sta_info *sta = NULL;
1291 struct ieee80211_crypt_data *crypt; 1304 struct ieee80211_crypt_data *crypt;
1292 char *txt = ""; 1305 char *txt = "";
1306 DECLARE_MAC_BUF(mac);
1293 1307
1294 len = skb->len - IEEE80211_MGMT_HDR_LEN; 1308 len = skb->len - IEEE80211_MGMT_HDR_LEN;
1295 1309
@@ -1298,8 +1312,8 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1298 1312
1299 if (len < 6) { 1313 if (len < 6) {
1300 PDEBUG(DEBUG_AP, "%s: handle_authen - too short payload " 1314 PDEBUG(DEBUG_AP, "%s: handle_authen - too short payload "
1301 "(len=%d) from " MACSTR "\n", dev->name, len, 1315 "(len=%d) from %s\n", dev->name, len,
1302 MAC2STR(hdr->addr2)); 1316 print_mac(mac, hdr->addr2));
1303 return; 1317 return;
1304 } 1318 }
1305 1319
@@ -1364,8 +1378,8 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1364 if (time_after(jiffies, sta->u.ap.last_beacon + 1378 if (time_after(jiffies, sta->u.ap.last_beacon +
1365 (10 * sta->listen_interval * HZ) / 1024)) { 1379 (10 * sta->listen_interval * HZ) / 1024)) {
1366 PDEBUG(DEBUG_AP, "%s: no beacons received for a while," 1380 PDEBUG(DEBUG_AP, "%s: no beacons received for a while,"
1367 " assuming AP " MACSTR " is now STA\n", 1381 " assuming AP %s is now STA\n",
1368 dev->name, MAC2STR(sta->addr)); 1382 dev->name, print_mac(mac, sta->addr));
1369 sta->ap = 0; 1383 sta->ap = 0;
1370 sta->flags = 0; 1384 sta->flags = 0;
1371 sta->u.sta.challenge = NULL; 1385 sta->u.sta.challenge = NULL;
@@ -1480,9 +1494,9 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1480 } 1494 }
1481 1495
1482 if (resp) { 1496 if (resp) {
1483 PDEBUG(DEBUG_AP, "%s: " MACSTR " auth (alg=%d trans#=%d " 1497 PDEBUG(DEBUG_AP, "%s: %s auth (alg=%d "
1484 "stat=%d len=%d fc=%04x) ==> %d (%s)\n", 1498 "trans#=%d stat=%d len=%d fc=%04x) ==> %d (%s)\n",
1485 dev->name, MAC2STR(hdr->addr2), auth_alg, 1499 dev->name, print_mac(mac, hdr->addr2), auth_alg,
1486 auth_transaction, status_code, len, fc, resp, txt); 1500 auth_transaction, status_code, len, fc, resp, txt);
1487 } 1501 }
1488} 1502}
@@ -1502,13 +1516,14 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
1502 int send_deauth = 0; 1516 int send_deauth = 0;
1503 char *txt = ""; 1517 char *txt = "";
1504 u8 prev_ap[ETH_ALEN]; 1518 u8 prev_ap[ETH_ALEN];
1519 DECLARE_MAC_BUF(mac);
1505 1520
1506 left = len = skb->len - IEEE80211_MGMT_HDR_LEN; 1521 left = len = skb->len - IEEE80211_MGMT_HDR_LEN;
1507 1522
1508 if (len < (reassoc ? 10 : 4)) { 1523 if (len < (reassoc ? 10 : 4)) {
1509 PDEBUG(DEBUG_AP, "%s: handle_assoc - too short payload " 1524 PDEBUG(DEBUG_AP, "%s: handle_assoc - too short payload "
1510 "(len=%d, reassoc=%d) from " MACSTR "\n", 1525 "(len=%d, reassoc=%d) from %s\n",
1511 dev->name, len, reassoc, MAC2STR(hdr->addr2)); 1526 dev->name, len, reassoc, print_mac(mac, hdr->addr2));
1512 return; 1527 return;
1513 } 1528 }
1514 1529
@@ -1585,9 +1600,9 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
1585 } 1600 }
1586 1601
1587 if (left > 0) { 1602 if (left > 0) {
1588 PDEBUG(DEBUG_AP, "%s: assoc from " MACSTR " with extra" 1603 PDEBUG(DEBUG_AP, "%s: assoc from %s"
1589 " data (%d bytes) [", 1604 " with extra data (%d bytes) [",
1590 dev->name, MAC2STR(hdr->addr2), left); 1605 dev->name, print_mac(mac, hdr->addr2), left);
1591 while (left > 0) { 1606 while (left > 0) {
1592 PDEBUG2(DEBUG_AP, "<%02x>", *u); 1607 PDEBUG2(DEBUG_AP, "<%02x>", *u);
1593 u++; left--; 1608 u++; left--;
@@ -1687,10 +1702,10 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
1687 } 1702 }
1688 1703
1689#if 0 1704#if 0
1690 PDEBUG(DEBUG_AP, "%s: " MACSTR " %sassoc (len=%d prev_ap=" MACSTR 1705 PDEBUG(DEBUG_AP, "%s: %s %sassoc (len=%d "
1691 ") => %d(%d) (%s)\n", 1706 "prev_ap=%s) => %d(%d) (%s)\n",
1692 dev->name, MAC2STR(hdr->addr2), reassoc ? "re" : "", len, 1707 dev->name, print_mac(mac, hdr->addr2), reassoc ? "re" : "", len,
1693 MAC2STR(prev_ap), resp, send_deauth, txt); 1708 print_mac(mac, prev_ap), resp, send_deauth, txt);
1694#endif 1709#endif
1695} 1710}
1696 1711
@@ -1705,6 +1720,7 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb,
1705 int len; 1720 int len;
1706 u16 reason_code, *pos; 1721 u16 reason_code, *pos;
1707 struct sta_info *sta = NULL; 1722 struct sta_info *sta = NULL;
1723 DECLARE_MAC_BUF(mac);
1708 1724
1709 len = skb->len - IEEE80211_MGMT_HDR_LEN; 1725 len = skb->len - IEEE80211_MGMT_HDR_LEN;
1710 1726
@@ -1716,8 +1732,8 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb,
1716 pos = (u16 *) body; 1732 pos = (u16 *) body;
1717 reason_code = __le16_to_cpu(*pos); 1733 reason_code = __le16_to_cpu(*pos);
1718 1734
1719 PDEBUG(DEBUG_AP, "%s: deauthentication: " MACSTR " len=%d, " 1735 PDEBUG(DEBUG_AP, "%s: deauthentication: %s len=%d, "
1720 "reason_code=%d\n", dev->name, MAC2STR(hdr->addr2), len, 1736 "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len,
1721 reason_code); 1737 reason_code);
1722 1738
1723 spin_lock_bh(&local->ap->sta_table_lock); 1739 spin_lock_bh(&local->ap->sta_table_lock);
@@ -1729,9 +1745,9 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb,
1729 } 1745 }
1730 spin_unlock_bh(&local->ap->sta_table_lock); 1746 spin_unlock_bh(&local->ap->sta_table_lock);
1731 if (sta == NULL) { 1747 if (sta == NULL) {
1732 printk("%s: deauthentication from " MACSTR ", " 1748 printk("%s: deauthentication from %s, "
1733 "reason_code=%d, but STA not authenticated\n", dev->name, 1749 "reason_code=%d, but STA not authenticated\n", dev->name,
1734 MAC2STR(hdr->addr2), reason_code); 1750 print_mac(mac, hdr->addr2), reason_code);
1735 } 1751 }
1736} 1752}
1737 1753
@@ -1746,6 +1762,7 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
1746 int len; 1762 int len;
1747 u16 reason_code, *pos; 1763 u16 reason_code, *pos;
1748 struct sta_info *sta = NULL; 1764 struct sta_info *sta = NULL;
1765 DECLARE_MAC_BUF(mac);
1749 1766
1750 len = skb->len - IEEE80211_MGMT_HDR_LEN; 1767 len = skb->len - IEEE80211_MGMT_HDR_LEN;
1751 1768
@@ -1757,8 +1774,8 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
1757 pos = (u16 *) body; 1774 pos = (u16 *) body;
1758 reason_code = __le16_to_cpu(*pos); 1775 reason_code = __le16_to_cpu(*pos);
1759 1776
1760 PDEBUG(DEBUG_AP, "%s: disassociation: " MACSTR " len=%d, " 1777 PDEBUG(DEBUG_AP, "%s: disassociation: %s len=%d, "
1761 "reason_code=%d\n", dev->name, MAC2STR(hdr->addr2), len, 1778 "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len,
1762 reason_code); 1779 reason_code);
1763 1780
1764 spin_lock_bh(&local->ap->sta_table_lock); 1781 spin_lock_bh(&local->ap->sta_table_lock);
@@ -1770,9 +1787,9 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
1770 } 1787 }
1771 spin_unlock_bh(&local->ap->sta_table_lock); 1788 spin_unlock_bh(&local->ap->sta_table_lock);
1772 if (sta == NULL) { 1789 if (sta == NULL) {
1773 printk("%s: disassociation from " MACSTR ", " 1790 printk("%s: disassociation from %s, "
1774 "reason_code=%d, but STA not authenticated\n", 1791 "reason_code=%d, but STA not authenticated\n",
1775 dev->name, MAC2STR(hdr->addr2), reason_code); 1792 dev->name, print_mac(mac, hdr->addr2), reason_code);
1776 } 1793 }
1777} 1794}
1778 1795
@@ -1862,15 +1879,16 @@ static void handle_pspoll(local_info_t *local,
1862 struct sta_info *sta; 1879 struct sta_info *sta;
1863 u16 aid; 1880 u16 aid;
1864 struct sk_buff *skb; 1881 struct sk_buff *skb;
1882 DECLARE_MAC_BUF(mac);
1865 1883
1866 PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=" MACSTR ", TA=" MACSTR 1884 PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=%s"
1867 " PWRMGT=%d\n", 1885 ", TA=%s PWRMGT=%d\n",
1868 MAC2STR(hdr->addr1), MAC2STR(hdr->addr2), 1886 print_mac(mac, hdr->addr1), print_mac(mac, hdr->addr2),
1869 !!(le16_to_cpu(hdr->frame_ctl) & IEEE80211_FCTL_PM)); 1887 !!(le16_to_cpu(hdr->frame_ctl) & IEEE80211_FCTL_PM));
1870 1888
1871 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 1889 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
1872 PDEBUG(DEBUG_AP, "handle_pspoll - addr1(BSSID)=" MACSTR 1890 PDEBUG(DEBUG_AP, "handle_pspoll - addr1(BSSID)=%s"
1873 " not own MAC\n", MAC2STR(hdr->addr1)); 1891 " not own MAC\n", print_mac(mac, hdr->addr1));
1874 return; 1892 return;
1875 } 1893 }
1876 1894
@@ -1948,6 +1966,7 @@ static void handle_wds_oper_queue(struct work_struct *work)
1948 wds_oper_queue); 1966 wds_oper_queue);
1949 local_info_t *local = ap->local; 1967 local_info_t *local = ap->local;
1950 struct wds_oper_data *entry, *prev; 1968 struct wds_oper_data *entry, *prev;
1969 DECLARE_MAC_BUF(mac);
1951 1970
1952 spin_lock_bh(&local->lock); 1971 spin_lock_bh(&local->lock);
1953 entry = local->ap->wds_oper_entries; 1972 entry = local->ap->wds_oper_entries;
@@ -1956,10 +1975,10 @@ static void handle_wds_oper_queue(struct work_struct *work)
1956 1975
1957 while (entry) { 1976 while (entry) {
1958 PDEBUG(DEBUG_AP, "%s: %s automatic WDS connection " 1977 PDEBUG(DEBUG_AP, "%s: %s automatic WDS connection "
1959 "to AP " MACSTR "\n", 1978 "to AP %s\n",
1960 local->dev->name, 1979 local->dev->name,
1961 entry->type == WDS_ADD ? "adding" : "removing", 1980 entry->type == WDS_ADD ? "adding" : "removing",
1962 MAC2STR(entry->addr)); 1981 print_mac(mac, entry->addr));
1963 if (entry->type == WDS_ADD) 1982 if (entry->type == WDS_ADD)
1964 prism2_wds_add(local, entry->addr, 0); 1983 prism2_wds_add(local, entry->addr, 0);
1965 else if (entry->type == WDS_DEL) 1984 else if (entry->type == WDS_DEL)
@@ -2135,6 +2154,7 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb,
2135#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 2154#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
2136 u16 fc, type, stype; 2155 u16 fc, type, stype;
2137 struct ieee80211_hdr_4addr *hdr; 2156 struct ieee80211_hdr_4addr *hdr;
2157 DECLARE_MAC_BUF(mac);
2138 2158
2139 /* FIX: should give skb->len to handler functions and check that the 2159 /* FIX: should give skb->len to handler functions and check that the
2140 * buffer is long enough */ 2160 * buffer is long enough */
@@ -2163,8 +2183,8 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb,
2163 2183
2164 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 2184 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
2165 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(BSSID)=" 2185 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(BSSID)="
2166 MACSTR " not own MAC\n", 2186 "%s not own MAC\n",
2167 MAC2STR(hdr->addr1)); 2187 print_mac(mac, hdr->addr1));
2168 goto done; 2188 goto done;
2169 } 2189 }
2170 2190
@@ -2200,14 +2220,14 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb,
2200 } 2220 }
2201 2221
2202 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 2222 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
2203 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(DA)=" MACSTR 2223 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(DA)=%s"
2204 " not own MAC\n", MAC2STR(hdr->addr1)); 2224 " not own MAC\n", print_mac(mac, hdr->addr1));
2205 goto done; 2225 goto done;
2206 } 2226 }
2207 2227
2208 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) { 2228 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) {
2209 PDEBUG(DEBUG_AP, "handle_ap_item - addr3(BSSID)=" MACSTR 2229 PDEBUG(DEBUG_AP, "handle_ap_item - addr3(BSSID)=%s"
2210 " not own MAC\n", MAC2STR(hdr->addr3)); 2230 " not own MAC\n", print_mac(mac, hdr->addr3));
2211 goto done; 2231 goto done;
2212 } 2232 }
2213 2233
@@ -2288,6 +2308,7 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
2288 struct sk_buff *skb; 2308 struct sk_buff *skb;
2289 struct ieee80211_hdr_4addr *hdr; 2309 struct ieee80211_hdr_4addr *hdr;
2290 struct hostap_80211_rx_status rx_stats; 2310 struct hostap_80211_rx_status rx_stats;
2311 DECLARE_MAC_BUF(mac);
2291 2312
2292 if (skb_queue_empty(&sta->tx_buf)) 2313 if (skb_queue_empty(&sta->tx_buf))
2293 return; 2314 return;
@@ -2308,8 +2329,8 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
2308 memcpy(hdr->addr2, sta->addr, ETH_ALEN); 2329 memcpy(hdr->addr2, sta->addr, ETH_ALEN);
2309 hdr->duration_id = cpu_to_le16(sta->aid | BIT(15) | BIT(14)); 2330 hdr->duration_id = cpu_to_le16(sta->aid | BIT(15) | BIT(14));
2310 2331
2311 PDEBUG(DEBUG_PS2, "%s: Scheduling buffered packet delivery for " 2332 PDEBUG(DEBUG_PS2, "%s: Scheduling buffered packet delivery for STA "
2312 "STA " MACSTR "\n", local->dev->name, MAC2STR(sta->addr)); 2333 "%s\n", local->dev->name, print_mac(mac, sta->addr));
2313 2334
2314 skb->dev = local->dev; 2335 skb->dev = local->dev;
2315 2336
@@ -2636,6 +2657,7 @@ static int ap_update_sta_tx_rate(struct sta_info *sta, struct net_device *dev)
2636 int ret = sta->tx_rate; 2657 int ret = sta->tx_rate;
2637 struct hostap_interface *iface; 2658 struct hostap_interface *iface;
2638 local_info_t *local; 2659 local_info_t *local;
2660 DECLARE_MAC_BUF(mac);
2639 2661
2640 iface = netdev_priv(dev); 2662 iface = netdev_priv(dev);
2641 local = iface->local; 2663 local = iface->local;
@@ -2663,9 +2685,9 @@ static int ap_update_sta_tx_rate(struct sta_info *sta, struct net_device *dev)
2663 case 3: sta->tx_rate = 110; break; 2685 case 3: sta->tx_rate = 110; break;
2664 default: sta->tx_rate = 0; break; 2686 default: sta->tx_rate = 0; break;
2665 } 2687 }
2666 PDEBUG(DEBUG_AP, "%s: STA " MACSTR " TX rate raised to" 2688 PDEBUG(DEBUG_AP, "%s: STA %s"
2667 " %d\n", dev->name, MAC2STR(sta->addr), 2689 " TX rate raised to %d\n",
2668 sta->tx_rate); 2690 dev->name, print_mac(mac, sta->addr), sta->tx_rate);
2669 } 2691 }
2670 sta->tx_since_last_failure = 0; 2692 sta->tx_since_last_failure = 0;
2671 } 2693 }
@@ -2683,6 +2705,7 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2683 int set_tim, ret; 2705 int set_tim, ret;
2684 struct ieee80211_hdr_4addr *hdr; 2706 struct ieee80211_hdr_4addr *hdr;
2685 struct hostap_skb_tx_data *meta; 2707 struct hostap_skb_tx_data *meta;
2708 DECLARE_MAC_BUF(mac);
2686 2709
2687 meta = (struct hostap_skb_tx_data *) skb->cb; 2710 meta = (struct hostap_skb_tx_data *) skb->cb;
2688 ret = AP_TX_CONTINUE; 2711 ret = AP_TX_CONTINUE;
@@ -2718,7 +2741,8 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2718 * print out any errors here. */ 2741 * print out any errors here. */
2719 if (net_ratelimit()) { 2742 if (net_ratelimit()) {
2720 printk(KERN_DEBUG "AP: drop packet to non-associated " 2743 printk(KERN_DEBUG "AP: drop packet to non-associated "
2721 "STA " MACSTR "\n", MAC2STR(hdr->addr1)); 2744 "STA %s\n",
2745 print_mac(mac, hdr->addr1));
2722 } 2746 }
2723#endif 2747#endif
2724 local->ap->tx_drop_nonassoc++; 2748 local->ap->tx_drop_nonassoc++;
@@ -2756,8 +2780,9 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2756 } 2780 }
2757 2781
2758 if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) { 2782 if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) {
2759 PDEBUG(DEBUG_PS, "%s: No more space in STA (" MACSTR ")'s PS " 2783 PDEBUG(DEBUG_PS, "%s: No more space in STA (%s"
2760 "mode buffer\n", local->dev->name, MAC2STR(sta->addr)); 2784 ")'s PS mode buffer\n",
2785 local->dev->name, print_mac(mac, sta->addr));
2761 /* Make sure that TIM is set for the station (it might not be 2786 /* Make sure that TIM is set for the station (it might not be
2762 * after AP wlan hw reset). */ 2787 * after AP wlan hw reset). */
2763 /* FIX: should fix hw reset to restore bits based on STA 2788 /* FIX: should fix hw reset to restore bits based on STA
@@ -2821,6 +2846,7 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2821 struct sta_info *sta; 2846 struct sta_info *sta;
2822 struct ieee80211_hdr_4addr *hdr; 2847 struct ieee80211_hdr_4addr *hdr;
2823 struct hostap_skb_tx_data *meta; 2848 struct hostap_skb_tx_data *meta;
2849 DECLARE_MAC_BUF(mac);
2824 2850
2825 hdr = (struct ieee80211_hdr_4addr *) skb->data; 2851 hdr = (struct ieee80211_hdr_4addr *) skb->data;
2826 meta = (struct hostap_skb_tx_data *) skb->cb; 2852 meta = (struct hostap_skb_tx_data *) skb->cb;
@@ -2829,9 +2855,9 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2829 sta = ap_get_sta(local->ap, hdr->addr1); 2855 sta = ap_get_sta(local->ap, hdr->addr1);
2830 if (!sta) { 2856 if (!sta) {
2831 spin_unlock(&local->ap->sta_table_lock); 2857 spin_unlock(&local->ap->sta_table_lock);
2832 PDEBUG(DEBUG_AP, "%s: Could not find STA " MACSTR " for this " 2858 PDEBUG(DEBUG_AP, "%s: Could not find STA %s"
2833 "TX error (@%lu)\n", 2859 " for this TX error (@%lu)\n",
2834 local->dev->name, MAC2STR(hdr->addr1), jiffies); 2860 local->dev->name, print_mac(mac, hdr->addr1), jiffies);
2835 return; 2861 return;
2836 } 2862 }
2837 2863
@@ -2858,8 +2884,9 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2858 case 3: sta->tx_rate = 110; break; 2884 case 3: sta->tx_rate = 110; break;
2859 default: sta->tx_rate = 0; break; 2885 default: sta->tx_rate = 0; break;
2860 } 2886 }
2861 PDEBUG(DEBUG_AP, "%s: STA " MACSTR " TX rate lowered " 2887 PDEBUG(DEBUG_AP, "%s: STA %s"
2862 "to %d\n", local->dev->name, MAC2STR(sta->addr), 2888 " TX rate lowered to %d\n",
2889 local->dev->name, print_mac(mac, sta->addr),
2863 sta->tx_rate); 2890 sta->tx_rate);
2864 } 2891 }
2865 sta->tx_consecutive_exc = 0; 2892 sta->tx_consecutive_exc = 0;
@@ -2871,16 +2898,17 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2871static void hostap_update_sta_ps2(local_info_t *local, struct sta_info *sta, 2898static void hostap_update_sta_ps2(local_info_t *local, struct sta_info *sta,
2872 int pwrmgt, int type, int stype) 2899 int pwrmgt, int type, int stype)
2873{ 2900{
2901 DECLARE_MAC_BUF(mac);
2874 if (pwrmgt && !(sta->flags & WLAN_STA_PS)) { 2902 if (pwrmgt && !(sta->flags & WLAN_STA_PS)) {
2875 sta->flags |= WLAN_STA_PS; 2903 sta->flags |= WLAN_STA_PS;
2876 PDEBUG(DEBUG_PS2, "STA " MACSTR " changed to use PS " 2904 PDEBUG(DEBUG_PS2, "STA %s changed to use PS "
2877 "mode (type=0x%02X, stype=0x%02X)\n", 2905 "mode (type=0x%02X, stype=0x%02X)\n",
2878 MAC2STR(sta->addr), type >> 2, stype >> 4); 2906 print_mac(mac, sta->addr), type >> 2, stype >> 4);
2879 } else if (!pwrmgt && (sta->flags & WLAN_STA_PS)) { 2907 } else if (!pwrmgt && (sta->flags & WLAN_STA_PS)) {
2880 sta->flags &= ~WLAN_STA_PS; 2908 sta->flags &= ~WLAN_STA_PS;
2881 PDEBUG(DEBUG_PS2, "STA " MACSTR " changed to not use " 2909 PDEBUG(DEBUG_PS2, "STA %s changed to not use "
2882 "PS mode (type=0x%02X, stype=0x%02X)\n", 2910 "PS mode (type=0x%02X, stype=0x%02X)\n",
2883 MAC2STR(sta->addr), type >> 2, stype >> 4); 2911 print_mac(mac, sta->addr), type >> 2, stype >> 4);
2884 if (type != IEEE80211_FTYPE_CTL || 2912 if (type != IEEE80211_FTYPE_CTL ||
2885 stype != IEEE80211_STYPE_PSPOLL) 2913 stype != IEEE80211_STYPE_PSPOLL)
2886 schedule_packet_send(local, sta); 2914 schedule_packet_send(local, sta);
@@ -2924,6 +2952,7 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
2924 struct sta_info *sta; 2952 struct sta_info *sta;
2925 u16 fc, type, stype; 2953 u16 fc, type, stype;
2926 struct ieee80211_hdr_4addr *hdr; 2954 struct ieee80211_hdr_4addr *hdr;
2955 DECLARE_MAC_BUF(mac);
2927 2956
2928 if (local->ap == NULL) 2957 if (local->ap == NULL)
2929 return AP_RX_CONTINUE; 2958 return AP_RX_CONTINUE;
@@ -2954,9 +2983,10 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
2954#ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT 2983#ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT
2955 } else { 2984 } else {
2956 printk(KERN_DEBUG "%s: dropped received packet" 2985 printk(KERN_DEBUG "%s: dropped received packet"
2957 " from non-associated STA " MACSTR 2986 " from non-associated STA "
2987 "%s"
2958 " (type=0x%02x, subtype=0x%02x)\n", 2988 " (type=0x%02x, subtype=0x%02x)\n",
2959 dev->name, MAC2STR(hdr->addr2), 2989 dev->name, print_mac(mac, hdr->addr2),
2960 type >> 2, stype >> 4); 2990 type >> 2, stype >> 4);
2961 hostap_rx(dev, skb, rx_stats); 2991 hostap_rx(dev, skb, rx_stats);
2962#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 2992#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
@@ -2991,8 +3021,8 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
2991 * being associated. */ 3021 * being associated. */
2992 printk(KERN_DEBUG "%s: rejected received nullfunc " 3022 printk(KERN_DEBUG "%s: rejected received nullfunc "
2993 "frame without ToDS from not associated STA " 3023 "frame without ToDS from not associated STA "
2994 MACSTR "\n", 3024 "%s\n",
2995 dev->name, MAC2STR(hdr->addr2)); 3025 dev->name, print_mac(mac, hdr->addr2));
2996 hostap_rx(dev, skb, rx_stats); 3026 hostap_rx(dev, skb, rx_stats);
2997#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 3027#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
2998 } 3028 }
@@ -3009,9 +3039,9 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
3009 * If BSSID is own, report the dropping of this frame. */ 3039 * If BSSID is own, report the dropping of this frame. */
3010 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) { 3040 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) {
3011 printk(KERN_DEBUG "%s: dropped received packet from " 3041 printk(KERN_DEBUG "%s: dropped received packet from "
3012 MACSTR " with no ToDS flag (type=0x%02x, " 3042 "%s with no ToDS flag "
3013 "subtype=0x%02x)\n", dev->name, 3043 "(type=0x%02x, subtype=0x%02x)\n", dev->name,
3014 MAC2STR(hdr->addr2), type >> 2, stype >> 4); 3044 print_mac(mac, hdr->addr2), type >> 2, stype >> 4);
3015 hostap_dump_rx_80211(dev->name, skb, rx_stats); 3045 hostap_dump_rx_80211(dev->name, skb, rx_stats);
3016 } 3046 }
3017 ret = AP_RX_DROP; 3047 ret = AP_RX_DROP;
diff --git a/drivers/net/wireless/hostap/hostap_common.h b/drivers/net/wireless/hostap/hostap_common.h
index b31e6a05f23c..ceb7f1e5e9e0 100644
--- a/drivers/net/wireless/hostap/hostap_common.h
+++ b/drivers/net/wireless/hostap/hostap_common.h
@@ -6,9 +6,6 @@
6 6
7#define BIT(x) (1 << (x)) 7#define BIT(x) (1 << (x))
8 8
9#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
10#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
11
12 9
13/* IEEE 802.11 defines */ 10/* IEEE 802.11 defines */
14 11
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index adedb9716542..7fa7ab0a4b23 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -2335,6 +2335,10 @@ static void prism2_txexc(local_info_t *local)
2335 int show_dump, res; 2335 int show_dump, res;
2336 char *payload = NULL; 2336 char *payload = NULL;
2337 struct hfa384x_tx_frame txdesc; 2337 struct hfa384x_tx_frame txdesc;
2338 DECLARE_MAC_BUF(mac);
2339 DECLARE_MAC_BUF(mac2);
2340 DECLARE_MAC_BUF(mac3);
2341 DECLARE_MAC_BUF(mac4);
2338 2342
2339 show_dump = local->frame_dump & PRISM2_DUMP_TXEXC_HDR; 2343 show_dump = local->frame_dump & PRISM2_DUMP_TXEXC_HDR;
2340 local->stats.tx_errors++; 2344 local->stats.tx_errors++;
@@ -2400,10 +2404,9 @@ static void prism2_txexc(local_info_t *local)
2400 WLAN_FC_GET_STYPE(fc) >> 4, 2404 WLAN_FC_GET_STYPE(fc) >> 4,
2401 fc & IEEE80211_FCTL_TODS ? " ToDS" : "", 2405 fc & IEEE80211_FCTL_TODS ? " ToDS" : "",
2402 fc & IEEE80211_FCTL_FROMDS ? " FromDS" : ""); 2406 fc & IEEE80211_FCTL_FROMDS ? " FromDS" : "");
2403 PDEBUG(DEBUG_EXTRA, " A1=" MACSTR " A2=" MACSTR " A3=" 2407 PDEBUG(DEBUG_EXTRA, " A1=%s A2=%s A3=%s A4=%s\n",
2404 MACSTR " A4=" MACSTR "\n", 2408 print_mac(mac, txdesc.addr1), print_mac(mac2, txdesc.addr2),
2405 MAC2STR(txdesc.addr1), MAC2STR(txdesc.addr2), 2409 print_mac(mac3, txdesc.addr3), print_mac(mac4, txdesc.addr4));
2406 MAC2STR(txdesc.addr3), MAC2STR(txdesc.addr4));
2407} 2410}
2408 2411
2409 2412
diff --git a/drivers/net/wireless/hostap/hostap_info.c b/drivers/net/wireless/hostap/hostap_info.c
index b6a02a02da74..636f4b2382ea 100644
--- a/drivers/net/wireless/hostap/hostap_info.c
+++ b/drivers/net/wireless/hostap/hostap_info.c
@@ -166,6 +166,7 @@ static void prism2_host_roaming(local_info_t *local)
166 struct hfa384x_hostscan_result *selected, *entry; 166 struct hfa384x_hostscan_result *selected, *entry;
167 int i; 167 int i;
168 unsigned long flags; 168 unsigned long flags;
169 DECLARE_MAC_BUF(mac);
169 170
170 if (local->last_join_time && 171 if (local->last_join_time &&
171 time_before(jiffies, local->last_join_time + 10 * HZ)) { 172 time_before(jiffies, local->last_join_time + 10 * HZ)) {
@@ -198,8 +199,9 @@ static void prism2_host_roaming(local_info_t *local)
198 local->preferred_ap[2] || local->preferred_ap[3] || 199 local->preferred_ap[2] || local->preferred_ap[3] ||
199 local->preferred_ap[4] || local->preferred_ap[5]) { 200 local->preferred_ap[4] || local->preferred_ap[5]) {
200 /* Try to find preferred AP */ 201 /* Try to find preferred AP */
201 PDEBUG(DEBUG_EXTRA, "%s: Preferred AP BSSID " MACSTR "\n", 202 PDEBUG(DEBUG_EXTRA, "%s: Preferred AP BSSID "
202 dev->name, MAC2STR(local->preferred_ap)); 203 "%s\n",
204 dev->name, print_mac(mac, local->preferred_ap));
203 for (i = 0; i < local->last_scan_results_count; i++) { 205 for (i = 0; i < local->last_scan_results_count; i++) {
204 entry = &local->last_scan_results[i]; 206 entry = &local->last_scan_results[i];
205 if (memcmp(local->preferred_ap, entry->bssid, 6) == 0) 207 if (memcmp(local->preferred_ap, entry->bssid, 6) == 0)
@@ -216,8 +218,9 @@ static void prism2_host_roaming(local_info_t *local)
216 req.channel = selected->chid; 218 req.channel = selected->chid;
217 spin_unlock_irqrestore(&local->lock, flags); 219 spin_unlock_irqrestore(&local->lock, flags);
218 220
219 PDEBUG(DEBUG_EXTRA, "%s: JoinRequest: BSSID=" MACSTR " channel=%d\n", 221 PDEBUG(DEBUG_EXTRA, "%s: JoinRequest: BSSID=%s"
220 dev->name, MAC2STR(req.bssid), le16_to_cpu(req.channel)); 222 " channel=%d\n",
223 dev->name, print_mac(mac, req.bssid), le16_to_cpu(req.channel));
221 if (local->func->set_rid(dev, HFA384X_RID_JOINREQUEST, &req, 224 if (local->func->set_rid(dev, HFA384X_RID_JOINREQUEST, &req,
222 sizeof(req))) { 225 sizeof(req))) {
223 printk(KERN_DEBUG "%s: JoinRequest failed\n", dev->name); 226 printk(KERN_DEBUG "%s: JoinRequest failed\n", dev->name);
@@ -409,6 +412,7 @@ static void handle_info_queue_linkstatus(local_info_t *local)
409 int val = local->prev_link_status; 412 int val = local->prev_link_status;
410 int connected; 413 int connected;
411 union iwreq_data wrqu; 414 union iwreq_data wrqu;
415 DECLARE_MAC_BUF(mac);
412 416
413 connected = 417 connected =
414 val == HFA384X_LINKSTATUS_CONNECTED || 418 val == HFA384X_LINKSTATUS_CONNECTED ||
@@ -420,9 +424,10 @@ static void handle_info_queue_linkstatus(local_info_t *local)
420 printk(KERN_DEBUG "%s: could not read CURRENTBSSID after " 424 printk(KERN_DEBUG "%s: could not read CURRENTBSSID after "
421 "LinkStatus event\n", local->dev->name); 425 "LinkStatus event\n", local->dev->name);
422 } else { 426 } else {
423 PDEBUG(DEBUG_EXTRA, "%s: LinkStatus: BSSID=" MACSTR "\n", 427 PDEBUG(DEBUG_EXTRA, "%s: LinkStatus: BSSID="
428 "%s\n",
424 local->dev->name, 429 local->dev->name,
425 MAC2STR((unsigned char *) local->bssid)); 430 print_mac(mac, (unsigned char *) local->bssid));
426 if (local->wds_type & HOSTAP_WDS_AP_CLIENT) 431 if (local->wds_type & HOSTAP_WDS_AP_CLIENT)
427 hostap_add_sta(local->ap, local->bssid); 432 hostap_add_sta(local->ap, local->bssid);
428 } 433 }
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index 730b3541e325..7036ecff5ec1 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -664,6 +664,7 @@ static int hostap_join_ap(struct net_device *dev)
664 unsigned long flags; 664 unsigned long flags;
665 int i; 665 int i;
666 struct hfa384x_hostscan_result *entry; 666 struct hfa384x_hostscan_result *entry;
667 DECLARE_MAC_BUF(mac);
667 668
668 iface = netdev_priv(dev); 669 iface = netdev_priv(dev);
669 local = iface->local; 670 local = iface->local;
@@ -685,14 +686,14 @@ static int hostap_join_ap(struct net_device *dev)
685 686
686 if (local->func->set_rid(dev, HFA384X_RID_JOINREQUEST, &req, 687 if (local->func->set_rid(dev, HFA384X_RID_JOINREQUEST, &req,
687 sizeof(req))) { 688 sizeof(req))) {
688 printk(KERN_DEBUG "%s: JoinRequest " MACSTR 689 printk(KERN_DEBUG "%s: JoinRequest %s"
689 " failed\n", 690 " failed\n",
690 dev->name, MAC2STR(local->preferred_ap)); 691 dev->name, print_mac(mac, local->preferred_ap));
691 return -1; 692 return -1;
692 } 693 }
693 694
694 printk(KERN_DEBUG "%s: Trying to join BSSID " MACSTR "\n", 695 printk(KERN_DEBUG "%s: Trying to join BSSID %s\n",
695 dev->name, MAC2STR(local->preferred_ap)); 696 dev->name, print_mac(mac, local->preferred_ap));
696 697
697 return 0; 698 return 0;
698} 699}
@@ -3697,8 +3698,10 @@ static int prism2_ioctl_set_assoc_ap_addr(local_info_t *local,
3697 struct prism2_hostapd_param *param, 3698 struct prism2_hostapd_param *param,
3698 int param_len) 3699 int param_len)
3699{ 3700{
3700 printk(KERN_DEBUG "%ssta: associated as client with AP " MACSTR "\n", 3701 DECLARE_MAC_BUF(mac);
3701 local->dev->name, MAC2STR(param->sta_addr)); 3702 printk(KERN_DEBUG "%ssta: associated as client with AP "
3703 "%s\n",
3704 local->dev->name, print_mac(mac, param->sta_addr));
3702 memcpy(local->assoc_ap_addr, param->sta_addr, ETH_ALEN); 3705 memcpy(local->assoc_ap_addr, param->sta_addr, ETH_ALEN);
3703 return 0; 3706 return 0;
3704} 3707}
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 9a470e80ca24..4cb09d81b404 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -530,6 +530,10 @@ int hostap_set_auth_algs(local_info_t *local)
530void hostap_dump_rx_header(const char *name, const struct hfa384x_rx_frame *rx) 530void hostap_dump_rx_header(const char *name, const struct hfa384x_rx_frame *rx)
531{ 531{
532 u16 status, fc; 532 u16 status, fc;
533 DECLARE_MAC_BUF(mac);
534 DECLARE_MAC_BUF(mac2);
535 DECLARE_MAC_BUF(mac3);
536 DECLARE_MAC_BUF(mac4);
533 537
534 status = __le16_to_cpu(rx->status); 538 status = __le16_to_cpu(rx->status);
535 539
@@ -548,13 +552,12 @@ void hostap_dump_rx_header(const char *name, const struct hfa384x_rx_frame *rx)
548 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "", 552 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "",
549 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : ""); 553 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : "");
550 554
551 printk(KERN_DEBUG " A1=" MACSTR " A2=" MACSTR " A3=" MACSTR " A4=" 555 printk(KERN_DEBUG " A1=%s A2=%s A3=%s A4=%s\n",
552 MACSTR "\n", 556 print_mac(mac, rx->addr1), print_mac(mac2, rx->addr2),
553 MAC2STR(rx->addr1), MAC2STR(rx->addr2), MAC2STR(rx->addr3), 557 print_mac(mac3, rx->addr3), print_mac(mac4, rx->addr4));
554 MAC2STR(rx->addr4));
555 558
556 printk(KERN_DEBUG " dst=" MACSTR " src=" MACSTR " len=%d\n", 559 printk(KERN_DEBUG " dst=%s src=%s len=%d\n",
557 MAC2STR(rx->dst_addr), MAC2STR(rx->src_addr), 560 print_mac(mac, rx->dst_addr), print_mac(mac2, rx->src_addr),
558 __be16_to_cpu(rx->len)); 561 __be16_to_cpu(rx->len));
559} 562}
560 563
@@ -562,6 +565,10 @@ void hostap_dump_rx_header(const char *name, const struct hfa384x_rx_frame *rx)
562void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx) 565void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx)
563{ 566{
564 u16 fc; 567 u16 fc;
568 DECLARE_MAC_BUF(mac);
569 DECLARE_MAC_BUF(mac2);
570 DECLARE_MAC_BUF(mac3);
571 DECLARE_MAC_BUF(mac4);
565 572
566 printk(KERN_DEBUG "%s: TX status=0x%04x retry_count=%d tx_rate=%d " 573 printk(KERN_DEBUG "%s: TX status=0x%04x retry_count=%d tx_rate=%d "
567 "tx_control=0x%04x; jiffies=%ld\n", 574 "tx_control=0x%04x; jiffies=%ld\n",
@@ -577,13 +584,12 @@ void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx)
577 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "", 584 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "",
578 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : ""); 585 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : "");
579 586
580 printk(KERN_DEBUG " A1=" MACSTR " A2=" MACSTR " A3=" MACSTR " A4=" 587 printk(KERN_DEBUG " A1=%s A2=%s A3=%s A4=%s\n",
581 MACSTR "\n", 588 print_mac(mac, tx->addr1), print_mac(mac2, tx->addr2),
582 MAC2STR(tx->addr1), MAC2STR(tx->addr2), MAC2STR(tx->addr3), 589 print_mac(mac3, tx->addr3), print_mac(mac4, tx->addr4));
583 MAC2STR(tx->addr4));
584 590
585 printk(KERN_DEBUG " dst=" MACSTR " src=" MACSTR " len=%d\n", 591 printk(KERN_DEBUG " dst=%s src=%s len=%d\n",
586 MAC2STR(tx->dst_addr), MAC2STR(tx->src_addr), 592 print_mac(mac, tx->dst_addr), print_mac(mac2, tx->src_addr),
587 __be16_to_cpu(tx->len)); 593 __be16_to_cpu(tx->len));
588} 594}
589 595
diff --git a/drivers/net/wireless/hostap/hostap_proc.c b/drivers/net/wireless/hostap/hostap_proc.c
index d1d8ce022e63..b03536008ad9 100644
--- a/drivers/net/wireless/hostap/hostap_proc.c
+++ b/drivers/net/wireless/hostap/hostap_proc.c
@@ -106,6 +106,7 @@ static int prism2_wds_proc_read(char *page, char **start, off_t off,
106 local_info_t *local = (local_info_t *) data; 106 local_info_t *local = (local_info_t *) data;
107 struct list_head *ptr; 107 struct list_head *ptr;
108 struct hostap_interface *iface; 108 struct hostap_interface *iface;
109 DECLARE_MAC_BUF(mac);
109 110
110 if (off > PROC_LIMIT) { 111 if (off > PROC_LIMIT) {
111 *eof = 1; 112 *eof = 1;
@@ -117,9 +118,9 @@ static int prism2_wds_proc_read(char *page, char **start, off_t off,
117 iface = list_entry(ptr, struct hostap_interface, list); 118 iface = list_entry(ptr, struct hostap_interface, list);
118 if (iface->type != HOSTAP_INTERFACE_WDS) 119 if (iface->type != HOSTAP_INTERFACE_WDS)
119 continue; 120 continue;
120 p += sprintf(p, "%s\t" MACSTR "\n", 121 p += sprintf(p, "%s\t%s\n",
121 iface->dev->name, 122 iface->dev->name,
122 MAC2STR(iface->u.wds.remote_addr)); 123 print_mac(mac, iface->u.wds.remote_addr));
123 if ((p - page) > PROC_LIMIT) { 124 if ((p - page) > PROC_LIMIT) {
124 printk(KERN_DEBUG "%s: wds proc did not fit\n", 125 printk(KERN_DEBUG "%s: wds proc did not fit\n",
125 local->dev->name); 126 local->dev->name);
@@ -147,6 +148,7 @@ static int prism2_bss_list_proc_read(char *page, char **start, off_t off,
147 struct list_head *ptr; 148 struct list_head *ptr;
148 struct hostap_bss_info *bss; 149 struct hostap_bss_info *bss;
149 int i; 150 int i;
151 DECLARE_MAC_BUF(mac);
150 152
151 if (off > PROC_LIMIT) { 153 if (off > PROC_LIMIT) {
152 *eof = 1; 154 *eof = 1;
@@ -158,8 +160,8 @@ static int prism2_bss_list_proc_read(char *page, char **start, off_t off,
158 spin_lock_bh(&local->lock); 160 spin_lock_bh(&local->lock);
159 list_for_each(ptr, &local->bss_list) { 161 list_for_each(ptr, &local->bss_list) {
160 bss = list_entry(ptr, struct hostap_bss_info, list); 162 bss = list_entry(ptr, struct hostap_bss_info, list);
161 p += sprintf(p, MACSTR "\t%lu\t%u\t0x%x\t", 163 p += sprintf(p, "%s\t%lu\t%u\t0x%x\t",
162 MAC2STR(bss->bssid), bss->last_update, 164 print_mac(mac, bss->bssid), bss->last_update,
163 bss->count, bss->capab_info); 165 bss->count, bss->capab_info);
164 for (i = 0; i < bss->ssid_len; i++) { 166 for (i = 0; i < bss->ssid_len; i++) {
165 p += sprintf(p, "%c", 167 p += sprintf(p, "%c",
@@ -312,6 +314,7 @@ static int prism2_scan_results_proc_read(char *page, char **start, off_t off,
312 int entry, i, len, total = 0; 314 int entry, i, len, total = 0;
313 struct hfa384x_hostscan_result *scanres; 315 struct hfa384x_hostscan_result *scanres;
314 u8 *pos; 316 u8 *pos;
317 DECLARE_MAC_BUF(mac);
315 318
316 p += sprintf(p, "CHID ANL SL BcnInt Capab Rate BSSID ATIM SupRates " 319 p += sprintf(p, "CHID ANL SL BcnInt Capab Rate BSSID ATIM SupRates "
317 "SSID\n"); 320 "SSID\n");
@@ -329,14 +332,14 @@ static int prism2_scan_results_proc_read(char *page, char **start, off_t off,
329 if ((p - page) > (PAGE_SIZE - 200)) 332 if ((p - page) > (PAGE_SIZE - 200))
330 break; 333 break;
331 334
332 p += sprintf(p, "%d %d %d %d 0x%02x %d " MACSTR " %d ", 335 p += sprintf(p, "%d %d %d %d 0x%02x %d %s %d ",
333 le16_to_cpu(scanres->chid), 336 le16_to_cpu(scanres->chid),
334 (s16) le16_to_cpu(scanres->anl), 337 (s16) le16_to_cpu(scanres->anl),
335 (s16) le16_to_cpu(scanres->sl), 338 (s16) le16_to_cpu(scanres->sl),
336 le16_to_cpu(scanres->beacon_interval), 339 le16_to_cpu(scanres->beacon_interval),
337 le16_to_cpu(scanres->capability), 340 le16_to_cpu(scanres->capability),
338 le16_to_cpu(scanres->rate), 341 le16_to_cpu(scanres->rate),
339 MAC2STR(scanres->bssid), 342 print_mac(mac, scanres->bssid),
340 le16_to_cpu(scanres->atim)); 343 le16_to_cpu(scanres->atim));
341 344
342 pos = scanres->sup_rates; 345 pos = scanres->sup_rates;
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index b3c07b93afce..2d46a16c0945 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -1922,6 +1922,7 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
1922 u32 chan; 1922 u32 chan;
1923 char *txratename; 1923 char *txratename;
1924 u8 bssid[ETH_ALEN]; 1924 u8 bssid[ETH_ALEN];
1925 DECLARE_MAC_BUF(mac);
1925 1926
1926 /* 1927 /*
1927 * TBD: BSSID is usually 00:00:00:00:00:00 here and not 1928 * TBD: BSSID is usually 00:00:00:00:00:00 here and not
@@ -1983,9 +1984,9 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
1983 } 1984 }
1984 1985
1985 IPW_DEBUG_INFO("%s: Associated with '%s' at %s, channel %d (BSSID=" 1986 IPW_DEBUG_INFO("%s: Associated with '%s' at %s, channel %d (BSSID="
1986 MAC_FMT ")\n", 1987 "%s)\n",
1987 priv->net_dev->name, escape_essid(essid, essid_len), 1988 priv->net_dev->name, escape_essid(essid, essid_len),
1988 txratename, chan, MAC_ARG(bssid)); 1989 txratename, chan, print_mac(mac, bssid));
1989 1990
1990 /* now we copy read ssid into dev */ 1991 /* now we copy read ssid into dev */
1991 if (!(priv->config & CFG_STATIC_ESSID)) { 1992 if (!(priv->config & CFG_STATIC_ESSID)) {
@@ -2053,10 +2054,12 @@ static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
2053 2054
2054static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status) 2055static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status)
2055{ 2056{
2057 DECLARE_MAC_BUF(mac);
2058
2056 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC, 2059 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC,
2057 "disassociated: '%s' " MAC_FMT " \n", 2060 "disassociated: '%s' %s \n",
2058 escape_essid(priv->essid, priv->essid_len), 2061 escape_essid(priv->essid, priv->essid_len),
2059 MAC_ARG(priv->bssid)); 2062 print_mac(mac, priv->bssid));
2060 2063
2061 priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING); 2064 priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING);
2062 2065
@@ -4049,6 +4052,7 @@ static ssize_t show_bssinfo(struct device *d, struct device_attribute *attr,
4049 char *out = buf; 4052 char *out = buf;
4050 int length; 4053 int length;
4051 int ret; 4054 int ret;
4055 DECLARE_MAC_BUF(mac);
4052 4056
4053 if (priv->status & STATUS_RF_KILL_MASK) 4057 if (priv->status & STATUS_RF_KILL_MASK)
4054 return 0; 4058 return 0;
@@ -4076,9 +4080,7 @@ static ssize_t show_bssinfo(struct device *d, struct device_attribute *attr,
4076 __LINE__); 4080 __LINE__);
4077 4081
4078 out += sprintf(out, "ESSID: %s\n", essid); 4082 out += sprintf(out, "ESSID: %s\n", essid);
4079 out += sprintf(out, "BSSID: %02x:%02x:%02x:%02x:%02x:%02x\n", 4083 out += sprintf(out, "BSSID: %s\n", print_mac(mac, bssid));
4080 bssid[0], bssid[1], bssid[2],
4081 bssid[3], bssid[4], bssid[5]);
4082 out += sprintf(out, "Channel: %d\n", chan); 4084 out += sprintf(out, "Channel: %d\n", chan);
4083 4085
4084 return out - buf; 4086 return out - buf;
@@ -4652,19 +4654,20 @@ static void ipw2100_rx_free(struct ipw2100_priv *priv)
4652static int ipw2100_read_mac_address(struct ipw2100_priv *priv) 4654static int ipw2100_read_mac_address(struct ipw2100_priv *priv)
4653{ 4655{
4654 u32 length = ETH_ALEN; 4656 u32 length = ETH_ALEN;
4655 u8 mac[ETH_ALEN]; 4657 u8 addr[ETH_ALEN];
4658 DECLARE_MAC_BUF(mac);
4656 4659
4657 int err; 4660 int err;
4658 4661
4659 err = ipw2100_get_ordinal(priv, IPW_ORD_STAT_ADAPTER_MAC, mac, &length); 4662 err = ipw2100_get_ordinal(priv, IPW_ORD_STAT_ADAPTER_MAC, addr, &length);
4660 if (err) { 4663 if (err) {
4661 IPW_DEBUG_INFO("MAC address read failed\n"); 4664 IPW_DEBUG_INFO("MAC address read failed\n");
4662 return -EIO; 4665 return -EIO;
4663 } 4666 }
4664 IPW_DEBUG_INFO("card MAC is %02X:%02X:%02X:%02X:%02X:%02X\n",
4665 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
4666 4667
4667 memcpy(priv->net_dev->dev_addr, mac, ETH_ALEN); 4668 memcpy(priv->net_dev->dev_addr, addr, ETH_ALEN);
4669 IPW_DEBUG_INFO("card MAC is %s\n",
4670 print_mac(mac, priv->net_dev->dev_addr));
4668 4671
4669 return 0; 4672 return 0;
4670} 4673}
@@ -5043,10 +5046,10 @@ static int ipw2100_set_mandatory_bssid(struct ipw2100_priv *priv, u8 * bssid,
5043 int err; 5046 int err;
5044 5047
5045#ifdef CONFIG_IPW2100_DEBUG 5048#ifdef CONFIG_IPW2100_DEBUG
5049 DECLARE_MAC_BUF(mac);
5046 if (bssid != NULL) 5050 if (bssid != NULL)
5047 IPW_DEBUG_HC("MANDATORY_BSSID: %02X:%02X:%02X:%02X:%02X:%02X\n", 5051 IPW_DEBUG_HC("MANDATORY_BSSID: %s\n",
5048 bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], 5052 print_mac(mac, bssid));
5049 bssid[5]);
5050 else 5053 else
5051 IPW_DEBUG_HC("MANDATORY_BSSID: <clear>\n"); 5054 IPW_DEBUG_HC("MANDATORY_BSSID: <clear>\n");
5052#endif 5055#endif
@@ -6892,6 +6895,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
6892 static const unsigned char off[] = { 6895 static const unsigned char off[] = {
6893 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 6896 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
6894 }; 6897 };
6898 DECLARE_MAC_BUF(mac);
6895 6899
6896 // sanity checks 6900 // sanity checks
6897 if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) 6901 if (wrqu->ap_addr.sa_family != ARPHRD_ETHER)
@@ -6917,13 +6921,8 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
6917 6921
6918 err = ipw2100_set_mandatory_bssid(priv, wrqu->ap_addr.sa_data, 0); 6922 err = ipw2100_set_mandatory_bssid(priv, wrqu->ap_addr.sa_data, 0);
6919 6923
6920 IPW_DEBUG_WX("SET BSSID -> %02X:%02X:%02X:%02X:%02X:%02X\n", 6924 IPW_DEBUG_WX("SET BSSID -> %s\n",
6921 wrqu->ap_addr.sa_data[0] & 0xff, 6925 print_mac(mac, wrqu->ap_addr.sa_data));
6922 wrqu->ap_addr.sa_data[1] & 0xff,
6923 wrqu->ap_addr.sa_data[2] & 0xff,
6924 wrqu->ap_addr.sa_data[3] & 0xff,
6925 wrqu->ap_addr.sa_data[4] & 0xff,
6926 wrqu->ap_addr.sa_data[5] & 0xff);
6927 6926
6928 done: 6927 done:
6929 mutex_unlock(&priv->action_mutex); 6928 mutex_unlock(&priv->action_mutex);
@@ -6939,6 +6938,7 @@ static int ipw2100_wx_get_wap(struct net_device *dev,
6939 */ 6938 */
6940 6939
6941 struct ipw2100_priv *priv = ieee80211_priv(dev); 6940 struct ipw2100_priv *priv = ieee80211_priv(dev);
6941 DECLARE_MAC_BUF(mac);
6942 6942
6943 /* If we are associated, trying to associate, or have a statically 6943 /* If we are associated, trying to associate, or have a statically
6944 * configured BSSID then return that; otherwise return ANY */ 6944 * configured BSSID then return that; otherwise return ANY */
@@ -6948,8 +6948,8 @@ static int ipw2100_wx_get_wap(struct net_device *dev,
6948 } else 6948 } else
6949 memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); 6949 memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
6950 6950
6951 IPW_DEBUG_WX("Getting WAP BSSID: " MAC_FMT "\n", 6951 IPW_DEBUG_WX("Getting WAP BSSID: %s\n",
6952 MAC_ARG(wrqu->ap_addr.sa_data)); 6952 print_mac(mac, wrqu->ap_addr.sa_data));
6953 return 0; 6953 return 0;
6954} 6954}
6955 6955
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index afad8bb7e334..2119a79dcc86 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -2247,8 +2247,8 @@ static int ipw_send_adapter_address(struct ipw_priv *priv, u8 * mac)
2247 return -1; 2247 return -1;
2248 } 2248 }
2249 2249
2250 IPW_DEBUG_INFO("%s: Setting MAC to " MAC_FMT "\n", 2250 IPW_DEBUG_INFO("%s: Setting MAC to %s\n",
2251 priv->net_dev->name, MAC_ARG(mac)); 2251 priv->net_dev->name, print_mac(mac, mac));
2252 2252
2253 return ipw_send_cmd_pdu(priv, IPW_CMD_ADAPTER_ADDRESS, ETH_ALEN, mac); 2253 return ipw_send_cmd_pdu(priv, IPW_CMD_ADAPTER_ADDRESS, ETH_ALEN, mac);
2254} 2254}
@@ -3796,6 +3796,7 @@ static u8 ipw_add_station(struct ipw_priv *priv, u8 * bssid)
3796{ 3796{
3797 struct ipw_station_entry entry; 3797 struct ipw_station_entry entry;
3798 int i; 3798 int i;
3799 DECLARE_MAC_BUF(mac);
3799 3800
3800 for (i = 0; i < priv->num_stations; i++) { 3801 for (i = 0; i < priv->num_stations; i++) {
3801 if (!memcmp(priv->stations[i], bssid, ETH_ALEN)) { 3802 if (!memcmp(priv->stations[i], bssid, ETH_ALEN)) {
@@ -3812,7 +3813,7 @@ static u8 ipw_add_station(struct ipw_priv *priv, u8 * bssid)
3812 if (i == MAX_STATIONS) 3813 if (i == MAX_STATIONS)
3813 return IPW_INVALID_STATION; 3814 return IPW_INVALID_STATION;
3814 3815
3815 IPW_DEBUG_SCAN("Adding AdHoc station: " MAC_FMT "\n", MAC_ARG(bssid)); 3816 IPW_DEBUG_SCAN("Adding AdHoc station: %s\n", print_mac(mac, bssid));
3816 3817
3817 entry.reserved = 0; 3818 entry.reserved = 0;
3818 entry.support_mode = 0; 3819 entry.support_mode = 0;
@@ -3839,6 +3840,7 @@ static u8 ipw_find_station(struct ipw_priv *priv, u8 * bssid)
3839static void ipw_send_disassociate(struct ipw_priv *priv, int quiet) 3840static void ipw_send_disassociate(struct ipw_priv *priv, int quiet)
3840{ 3841{
3841 int err; 3842 int err;
3843 DECLARE_MAC_BUF(mac);
3842 3844
3843 if (priv->status & STATUS_ASSOCIATING) { 3845 if (priv->status & STATUS_ASSOCIATING) {
3844 IPW_DEBUG_ASSOC("Disassociating while associating.\n"); 3846 IPW_DEBUG_ASSOC("Disassociating while associating.\n");
@@ -3851,9 +3853,9 @@ static void ipw_send_disassociate(struct ipw_priv *priv, int quiet)
3851 return; 3853 return;
3852 } 3854 }
3853 3855
3854 IPW_DEBUG_ASSOC("Disassocation attempt from " MAC_FMT " " 3856 IPW_DEBUG_ASSOC("Disassocation attempt from %s "
3855 "on channel %d.\n", 3857 "on channel %d.\n",
3856 MAC_ARG(priv->assoc_request.bssid), 3858 print_mac(mac, priv->assoc_request.bssid),
3857 priv->assoc_request.channel); 3859 priv->assoc_request.channel);
3858 3860
3859 priv->status &= ~(STATUS_ASSOCIATING | STATUS_ASSOCIATED); 3861 priv->status &= ~(STATUS_ASSOCIATING | STATUS_ASSOCIATED);
@@ -4348,6 +4350,7 @@ static void ipw_handle_missed_beacon(struct ipw_priv *priv,
4348static void ipw_rx_notification(struct ipw_priv *priv, 4350static void ipw_rx_notification(struct ipw_priv *priv,
4349 struct ipw_rx_notification *notif) 4351 struct ipw_rx_notification *notif)
4350{ 4352{
4353 DECLARE_MAC_BUF(mac);
4351 notif->size = le16_to_cpu(notif->size); 4354 notif->size = le16_to_cpu(notif->size);
4352 4355
4353 IPW_DEBUG_NOTIF("type = %i (%d bytes)\n", notif->subtype, notif->size); 4356 IPW_DEBUG_NOTIF("type = %i (%d bytes)\n", notif->subtype, notif->size);
@@ -4360,11 +4363,11 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4360 case CMAS_ASSOCIATED:{ 4363 case CMAS_ASSOCIATED:{
4361 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4364 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4362 IPW_DL_ASSOC, 4365 IPW_DL_ASSOC,
4363 "associated: '%s' " MAC_FMT 4366 "associated: '%s' %s"
4364 " \n", 4367 " \n",
4365 escape_essid(priv->essid, 4368 escape_essid(priv->essid,
4366 priv->essid_len), 4369 priv->essid_len),
4367 MAC_ARG(priv->bssid)); 4370 print_mac(mac, priv->bssid));
4368 4371
4369 switch (priv->ieee->iw_mode) { 4372 switch (priv->ieee->iw_mode) {
4370 case IW_MODE_INFRA: 4373 case IW_MODE_INFRA:
@@ -4444,13 +4447,13 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4444 IPW_DL_STATE | 4447 IPW_DL_STATE |
4445 IPW_DL_ASSOC, 4448 IPW_DL_ASSOC,
4446 "deauthenticated: '%s' " 4449 "deauthenticated: '%s' "
4447 MAC_FMT 4450 "%s"
4448 ": (0x%04X) - %s \n", 4451 ": (0x%04X) - %s \n",
4449 escape_essid(priv-> 4452 escape_essid(priv->
4450 essid, 4453 essid,
4451 priv-> 4454 priv->
4452 essid_len), 4455 essid_len),
4453 MAC_ARG(priv->bssid), 4456 print_mac(mac, priv->bssid),
4454 ntohs(auth->status), 4457 ntohs(auth->status),
4455 ipw_get_status_code 4458 ipw_get_status_code
4456 (ntohs 4459 (ntohs
@@ -4467,11 +4470,11 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4467 4470
4468 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4471 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4469 IPW_DL_ASSOC, 4472 IPW_DL_ASSOC,
4470 "authenticated: '%s' " MAC_FMT 4473 "authenticated: '%s' %s"
4471 "\n", 4474 "\n",
4472 escape_essid(priv->essid, 4475 escape_essid(priv->essid,
4473 priv->essid_len), 4476 priv->essid_len),
4474 MAC_ARG(priv->bssid)); 4477 print_mac(mac, priv->bssid));
4475 break; 4478 break;
4476 } 4479 }
4477 4480
@@ -4496,11 +4499,11 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4496 4499
4497 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4500 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4498 IPW_DL_ASSOC, 4501 IPW_DL_ASSOC,
4499 "disassociated: '%s' " MAC_FMT 4502 "disassociated: '%s' %s"
4500 " \n", 4503 " \n",
4501 escape_essid(priv->essid, 4504 escape_essid(priv->essid,
4502 priv->essid_len), 4505 priv->essid_len),
4503 MAC_ARG(priv->bssid)); 4506 print_mac(mac, priv->bssid));
4504 4507
4505 priv->status &= 4508 priv->status &=
4506 ~(STATUS_DISASSOCIATING | 4509 ~(STATUS_DISASSOCIATING |
@@ -4535,10 +4538,10 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4535 switch (auth->state) { 4538 switch (auth->state) {
4536 case CMAS_AUTHENTICATED: 4539 case CMAS_AUTHENTICATED:
4537 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE, 4540 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE,
4538 "authenticated: '%s' " MAC_FMT " \n", 4541 "authenticated: '%s' %s \n",
4539 escape_essid(priv->essid, 4542 escape_essid(priv->essid,
4540 priv->essid_len), 4543 priv->essid_len),
4541 MAC_ARG(priv->bssid)); 4544 print_mac(mac, priv->bssid));
4542 priv->status |= STATUS_AUTH; 4545 priv->status |= STATUS_AUTH;
4543 break; 4546 break;
4544 4547
@@ -4554,10 +4557,10 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4554 } 4557 }
4555 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4558 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4556 IPW_DL_ASSOC, 4559 IPW_DL_ASSOC,
4557 "deauthenticated: '%s' " MAC_FMT "\n", 4560 "deauthenticated: '%s' %s\n",
4558 escape_essid(priv->essid, 4561 escape_essid(priv->essid,
4559 priv->essid_len), 4562 priv->essid_len),
4560 MAC_ARG(priv->bssid)); 4563 print_mac(mac, priv->bssid));
4561 4564
4562 priv->status &= ~(STATUS_ASSOCIATING | 4565 priv->status &= ~(STATUS_ASSOCIATING |
4563 STATUS_AUTH | 4566 STATUS_AUTH |
@@ -5383,25 +5386,27 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5383 int roaming) 5386 int roaming)
5384{ 5387{
5385 struct ipw_supported_rates rates; 5388 struct ipw_supported_rates rates;
5389 DECLARE_MAC_BUF(mac);
5390 DECLARE_MAC_BUF(mac2);
5386 5391
5387 /* Verify that this network's capability is compatible with the 5392 /* Verify that this network's capability is compatible with the
5388 * current mode (AdHoc or Infrastructure) */ 5393 * current mode (AdHoc or Infrastructure) */
5389 if ((priv->ieee->iw_mode == IW_MODE_ADHOC && 5394 if ((priv->ieee->iw_mode == IW_MODE_ADHOC &&
5390 !(network->capability & WLAN_CAPABILITY_IBSS))) { 5395 !(network->capability & WLAN_CAPABILITY_IBSS))) {
5391 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded due to " 5396 IPW_DEBUG_MERGE("Network '%s (%s)' excluded due to "
5392 "capability mismatch.\n", 5397 "capability mismatch.\n",
5393 escape_essid(network->ssid, network->ssid_len), 5398 escape_essid(network->ssid, network->ssid_len),
5394 MAC_ARG(network->bssid)); 5399 print_mac(mac, network->bssid));
5395 return 0; 5400 return 0;
5396 } 5401 }
5397 5402
5398 /* If we do not have an ESSID for this AP, we can not associate with 5403 /* If we do not have an ESSID for this AP, we can not associate with
5399 * it */ 5404 * it */
5400 if (network->flags & NETWORK_EMPTY_ESSID) { 5405 if (network->flags & NETWORK_EMPTY_ESSID) {
5401 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5406 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5402 "because of hidden ESSID.\n", 5407 "because of hidden ESSID.\n",
5403 escape_essid(network->ssid, network->ssid_len), 5408 escape_essid(network->ssid, network->ssid_len),
5404 MAC_ARG(network->bssid)); 5409 print_mac(mac, network->bssid));
5405 return 0; 5410 return 0;
5406 } 5411 }
5407 5412
@@ -5411,11 +5416,11 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5411 if ((network->ssid_len != match->network->ssid_len) || 5416 if ((network->ssid_len != match->network->ssid_len) ||
5412 memcmp(network->ssid, match->network->ssid, 5417 memcmp(network->ssid, match->network->ssid,
5413 network->ssid_len)) { 5418 network->ssid_len)) {
5414 IPW_DEBUG_MERGE("Netowrk '%s (" MAC_FMT ")' excluded " 5419 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5415 "because of non-network ESSID.\n", 5420 "because of non-network ESSID.\n",
5416 escape_essid(network->ssid, 5421 escape_essid(network->ssid,
5417 network->ssid_len), 5422 network->ssid_len),
5418 MAC_ARG(network->bssid)); 5423 print_mac(mac, network->bssid));
5419 return 0; 5424 return 0;
5420 } 5425 }
5421 } else { 5426 } else {
@@ -5430,9 +5435,9 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5430 strncpy(escaped, 5435 strncpy(escaped,
5431 escape_essid(network->ssid, network->ssid_len), 5436 escape_essid(network->ssid, network->ssid_len),
5432 sizeof(escaped)); 5437 sizeof(escaped));
5433 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5438 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5434 "because of ESSID mismatch: '%s'.\n", 5439 "because of ESSID mismatch: '%s'.\n",
5435 escaped, MAC_ARG(network->bssid), 5440 escaped, print_mac(mac, network->bssid),
5436 escape_essid(priv->essid, 5441 escape_essid(priv->essid,
5437 priv->essid_len)); 5442 priv->essid_len));
5438 return 0; 5443 return 0;
@@ -5459,10 +5464,10 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5459 /* Now go through and see if the requested network is valid... */ 5464 /* Now go through and see if the requested network is valid... */
5460 if (priv->ieee->scan_age != 0 && 5465 if (priv->ieee->scan_age != 0 &&
5461 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { 5466 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
5462 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5467 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5463 "because of age: %ums.\n", 5468 "because of age: %ums.\n",
5464 escape_essid(network->ssid, network->ssid_len), 5469 escape_essid(network->ssid, network->ssid_len),
5465 MAC_ARG(network->bssid), 5470 print_mac(mac, network->bssid),
5466 jiffies_to_msecs(jiffies - 5471 jiffies_to_msecs(jiffies -
5467 network->last_scanned)); 5472 network->last_scanned));
5468 return 0; 5473 return 0;
@@ -5470,10 +5475,10 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5470 5475
5471 if ((priv->config & CFG_STATIC_CHANNEL) && 5476 if ((priv->config & CFG_STATIC_CHANNEL) &&
5472 (network->channel != priv->channel)) { 5477 (network->channel != priv->channel)) {
5473 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5478 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5474 "because of channel mismatch: %d != %d.\n", 5479 "because of channel mismatch: %d != %d.\n",
5475 escape_essid(network->ssid, network->ssid_len), 5480 escape_essid(network->ssid, network->ssid_len),
5476 MAC_ARG(network->bssid), 5481 print_mac(mac, network->bssid),
5477 network->channel, priv->channel); 5482 network->channel, priv->channel);
5478 return 0; 5483 return 0;
5479 } 5484 }
@@ -5481,10 +5486,10 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5481 /* Verify privacy compatability */ 5486 /* Verify privacy compatability */
5482 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) != 5487 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) !=
5483 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { 5488 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
5484 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5489 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5485 "because of privacy mismatch: %s != %s.\n", 5490 "because of privacy mismatch: %s != %s.\n",
5486 escape_essid(network->ssid, network->ssid_len), 5491 escape_essid(network->ssid, network->ssid_len),
5487 MAC_ARG(network->bssid), 5492 print_mac(mac, network->bssid),
5488 priv-> 5493 priv->
5489 capability & CAP_PRIVACY_ON ? "on" : "off", 5494 capability & CAP_PRIVACY_ON ? "on" : "off",
5490 network-> 5495 network->
@@ -5494,40 +5499,41 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5494 } 5499 }
5495 5500
5496 if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) { 5501 if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) {
5497 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5502 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5498 "because of the same BSSID match: " MAC_FMT 5503 "because of the same BSSID match: %s"
5499 ".\n", escape_essid(network->ssid, 5504 ".\n", escape_essid(network->ssid,
5500 network->ssid_len), 5505 network->ssid_len),
5501 MAC_ARG(network->bssid), MAC_ARG(priv->bssid)); 5506 print_mac(mac, network->bssid),
5507 print_mac(mac2, priv->bssid));
5502 return 0; 5508 return 0;
5503 } 5509 }
5504 5510
5505 /* Filter out any incompatible freq / mode combinations */ 5511 /* Filter out any incompatible freq / mode combinations */
5506 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) { 5512 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) {
5507 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5513 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5508 "because of invalid frequency/mode " 5514 "because of invalid frequency/mode "
5509 "combination.\n", 5515 "combination.\n",
5510 escape_essid(network->ssid, network->ssid_len), 5516 escape_essid(network->ssid, network->ssid_len),
5511 MAC_ARG(network->bssid)); 5517 print_mac(mac, network->bssid));
5512 return 0; 5518 return 0;
5513 } 5519 }
5514 5520
5515 /* Ensure that the rates supported by the driver are compatible with 5521 /* Ensure that the rates supported by the driver are compatible with
5516 * this AP, including verification of basic rates (mandatory) */ 5522 * this AP, including verification of basic rates (mandatory) */
5517 if (!ipw_compatible_rates(priv, network, &rates)) { 5523 if (!ipw_compatible_rates(priv, network, &rates)) {
5518 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5524 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5519 "because configured rate mask excludes " 5525 "because configured rate mask excludes "
5520 "AP mandatory rate.\n", 5526 "AP mandatory rate.\n",
5521 escape_essid(network->ssid, network->ssid_len), 5527 escape_essid(network->ssid, network->ssid_len),
5522 MAC_ARG(network->bssid)); 5528 print_mac(mac, network->bssid));
5523 return 0; 5529 return 0;
5524 } 5530 }
5525 5531
5526 if (rates.num_rates == 0) { 5532 if (rates.num_rates == 0) {
5527 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5533 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5528 "because of no compatible rates.\n", 5534 "because of no compatible rates.\n",
5529 escape_essid(network->ssid, network->ssid_len), 5535 escape_essid(network->ssid, network->ssid_len),
5530 MAC_ARG(network->bssid)); 5536 print_mac(mac, network->bssid));
5531 return 0; 5537 return 0;
5532 } 5538 }
5533 5539
@@ -5538,9 +5544,9 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5538 /* Set up 'new' AP to this network */ 5544 /* Set up 'new' AP to this network */
5539 ipw_copy_rates(&match->rates, &rates); 5545 ipw_copy_rates(&match->rates, &rates);
5540 match->network = network; 5546 match->network = network;
5541 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' is a viable match.\n", 5547 IPW_DEBUG_MERGE("Network '%s (%s)' is a viable match.\n",
5542 escape_essid(network->ssid, network->ssid_len), 5548 escape_essid(network->ssid, network->ssid_len),
5543 MAC_ARG(network->bssid)); 5549 print_mac(mac, network->bssid));
5544 5550
5545 return 1; 5551 return 1;
5546} 5552}
@@ -5594,6 +5600,7 @@ static int ipw_best_network(struct ipw_priv *priv,
5594 struct ieee80211_network *network, int roaming) 5600 struct ieee80211_network *network, int roaming)
5595{ 5601{
5596 struct ipw_supported_rates rates; 5602 struct ipw_supported_rates rates;
5603 DECLARE_MAC_BUF(mac);
5597 5604
5598 /* Verify that this network's capability is compatible with the 5605 /* Verify that this network's capability is compatible with the
5599 * current mode (AdHoc or Infrastructure) */ 5606 * current mode (AdHoc or Infrastructure) */
@@ -5601,20 +5608,20 @@ static int ipw_best_network(struct ipw_priv *priv,
5601 !(network->capability & WLAN_CAPABILITY_ESS)) || 5608 !(network->capability & WLAN_CAPABILITY_ESS)) ||
5602 (priv->ieee->iw_mode == IW_MODE_ADHOC && 5609 (priv->ieee->iw_mode == IW_MODE_ADHOC &&
5603 !(network->capability & WLAN_CAPABILITY_IBSS))) { 5610 !(network->capability & WLAN_CAPABILITY_IBSS))) {
5604 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded due to " 5611 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded due to "
5605 "capability mismatch.\n", 5612 "capability mismatch.\n",
5606 escape_essid(network->ssid, network->ssid_len), 5613 escape_essid(network->ssid, network->ssid_len),
5607 MAC_ARG(network->bssid)); 5614 print_mac(mac, network->bssid));
5608 return 0; 5615 return 0;
5609 } 5616 }
5610 5617
5611 /* If we do not have an ESSID for this AP, we can not associate with 5618 /* If we do not have an ESSID for this AP, we can not associate with
5612 * it */ 5619 * it */
5613 if (network->flags & NETWORK_EMPTY_ESSID) { 5620 if (network->flags & NETWORK_EMPTY_ESSID) {
5614 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5621 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5615 "because of hidden ESSID.\n", 5622 "because of hidden ESSID.\n",
5616 escape_essid(network->ssid, network->ssid_len), 5623 escape_essid(network->ssid, network->ssid_len),
5617 MAC_ARG(network->bssid)); 5624 print_mac(mac, network->bssid));
5618 return 0; 5625 return 0;
5619 } 5626 }
5620 5627
@@ -5624,11 +5631,11 @@ static int ipw_best_network(struct ipw_priv *priv,
5624 if ((network->ssid_len != match->network->ssid_len) || 5631 if ((network->ssid_len != match->network->ssid_len) ||
5625 memcmp(network->ssid, match->network->ssid, 5632 memcmp(network->ssid, match->network->ssid,
5626 network->ssid_len)) { 5633 network->ssid_len)) {
5627 IPW_DEBUG_ASSOC("Netowrk '%s (" MAC_FMT ")' excluded " 5634 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5628 "because of non-network ESSID.\n", 5635 "because of non-network ESSID.\n",
5629 escape_essid(network->ssid, 5636 escape_essid(network->ssid,
5630 network->ssid_len), 5637 network->ssid_len),
5631 MAC_ARG(network->bssid)); 5638 print_mac(mac, network->bssid));
5632 return 0; 5639 return 0;
5633 } 5640 }
5634 } else { 5641 } else {
@@ -5642,9 +5649,9 @@ static int ipw_best_network(struct ipw_priv *priv,
5642 strncpy(escaped, 5649 strncpy(escaped,
5643 escape_essid(network->ssid, network->ssid_len), 5650 escape_essid(network->ssid, network->ssid_len),
5644 sizeof(escaped)); 5651 sizeof(escaped));
5645 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5652 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5646 "because of ESSID mismatch: '%s'.\n", 5653 "because of ESSID mismatch: '%s'.\n",
5647 escaped, MAC_ARG(network->bssid), 5654 escaped, print_mac(mac, network->bssid),
5648 escape_essid(priv->essid, 5655 escape_essid(priv->essid,
5649 priv->essid_len)); 5656 priv->essid_len));
5650 return 0; 5657 return 0;
@@ -5658,12 +5665,12 @@ static int ipw_best_network(struct ipw_priv *priv,
5658 strncpy(escaped, 5665 strncpy(escaped,
5659 escape_essid(network->ssid, network->ssid_len), 5666 escape_essid(network->ssid, network->ssid_len),
5660 sizeof(escaped)); 5667 sizeof(escaped));
5661 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded because " 5668 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded because "
5662 "'%s (" MAC_FMT ")' has a stronger signal.\n", 5669 "'%s (%s)' has a stronger signal.\n",
5663 escaped, MAC_ARG(network->bssid), 5670 escaped, print_mac(mac, network->bssid),
5664 escape_essid(match->network->ssid, 5671 escape_essid(match->network->ssid,
5665 match->network->ssid_len), 5672 match->network->ssid_len),
5666 MAC_ARG(match->network->bssid)); 5673 print_mac(mac, match->network->bssid));
5667 return 0; 5674 return 0;
5668 } 5675 }
5669 5676
@@ -5671,11 +5678,11 @@ static int ipw_best_network(struct ipw_priv *priv,
5671 * last 3 seconds, do not try and associate again... */ 5678 * last 3 seconds, do not try and associate again... */
5672 if (network->last_associate && 5679 if (network->last_associate &&
5673 time_after(network->last_associate + (HZ * 3UL), jiffies)) { 5680 time_after(network->last_associate + (HZ * 3UL), jiffies)) {
5674 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5681 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5675 "because of storming (%ums since last " 5682 "because of storming (%ums since last "
5676 "assoc attempt).\n", 5683 "assoc attempt).\n",
5677 escape_essid(network->ssid, network->ssid_len), 5684 escape_essid(network->ssid, network->ssid_len),
5678 MAC_ARG(network->bssid), 5685 print_mac(mac, network->bssid),
5679 jiffies_to_msecs(jiffies - 5686 jiffies_to_msecs(jiffies -
5680 network->last_associate)); 5687 network->last_associate));
5681 return 0; 5688 return 0;
@@ -5684,10 +5691,10 @@ static int ipw_best_network(struct ipw_priv *priv,
5684 /* Now go through and see if the requested network is valid... */ 5691 /* Now go through and see if the requested network is valid... */
5685 if (priv->ieee->scan_age != 0 && 5692 if (priv->ieee->scan_age != 0 &&
5686 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { 5693 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
5687 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5694 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5688 "because of age: %ums.\n", 5695 "because of age: %ums.\n",
5689 escape_essid(network->ssid, network->ssid_len), 5696 escape_essid(network->ssid, network->ssid_len),
5690 MAC_ARG(network->bssid), 5697 print_mac(mac, network->bssid),
5691 jiffies_to_msecs(jiffies - 5698 jiffies_to_msecs(jiffies -
5692 network->last_scanned)); 5699 network->last_scanned));
5693 return 0; 5700 return 0;
@@ -5695,10 +5702,10 @@ static int ipw_best_network(struct ipw_priv *priv,
5695 5702
5696 if ((priv->config & CFG_STATIC_CHANNEL) && 5703 if ((priv->config & CFG_STATIC_CHANNEL) &&
5697 (network->channel != priv->channel)) { 5704 (network->channel != priv->channel)) {
5698 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5705 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5699 "because of channel mismatch: %d != %d.\n", 5706 "because of channel mismatch: %d != %d.\n",
5700 escape_essid(network->ssid, network->ssid_len), 5707 escape_essid(network->ssid, network->ssid_len),
5701 MAC_ARG(network->bssid), 5708 print_mac(mac, network->bssid),
5702 network->channel, priv->channel); 5709 network->channel, priv->channel);
5703 return 0; 5710 return 0;
5704 } 5711 }
@@ -5706,10 +5713,10 @@ static int ipw_best_network(struct ipw_priv *priv,
5706 /* Verify privacy compatability */ 5713 /* Verify privacy compatability */
5707 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) != 5714 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) !=
5708 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { 5715 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
5709 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5716 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5710 "because of privacy mismatch: %s != %s.\n", 5717 "because of privacy mismatch: %s != %s.\n",
5711 escape_essid(network->ssid, network->ssid_len), 5718 escape_essid(network->ssid, network->ssid_len),
5712 MAC_ARG(network->bssid), 5719 print_mac(mac, network->bssid),
5713 priv->capability & CAP_PRIVACY_ON ? "on" : 5720 priv->capability & CAP_PRIVACY_ON ? "on" :
5714 "off", 5721 "off",
5715 network->capability & 5722 network->capability &
@@ -5719,48 +5726,48 @@ static int ipw_best_network(struct ipw_priv *priv,
5719 5726
5720 if ((priv->config & CFG_STATIC_BSSID) && 5727 if ((priv->config & CFG_STATIC_BSSID) &&
5721 memcmp(network->bssid, priv->bssid, ETH_ALEN)) { 5728 memcmp(network->bssid, priv->bssid, ETH_ALEN)) {
5722 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5729 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5723 "because of BSSID mismatch: " MAC_FMT ".\n", 5730 "because of BSSID mismatch: %s.\n",
5724 escape_essid(network->ssid, network->ssid_len), 5731 escape_essid(network->ssid, network->ssid_len),
5725 MAC_ARG(network->bssid), MAC_ARG(priv->bssid)); 5732 print_mac(mac, network->bssid), print_mac(mac, priv->bssid));
5726 return 0; 5733 return 0;
5727 } 5734 }
5728 5735
5729 /* Filter out any incompatible freq / mode combinations */ 5736 /* Filter out any incompatible freq / mode combinations */
5730 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) { 5737 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) {
5731 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5738 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5732 "because of invalid frequency/mode " 5739 "because of invalid frequency/mode "
5733 "combination.\n", 5740 "combination.\n",
5734 escape_essid(network->ssid, network->ssid_len), 5741 escape_essid(network->ssid, network->ssid_len),
5735 MAC_ARG(network->bssid)); 5742 print_mac(mac, network->bssid));
5736 return 0; 5743 return 0;
5737 } 5744 }
5738 5745
5739 /* Filter out invalid channel in current GEO */ 5746 /* Filter out invalid channel in current GEO */
5740 if (!ieee80211_is_valid_channel(priv->ieee, network->channel)) { 5747 if (!ieee80211_is_valid_channel(priv->ieee, network->channel)) {
5741 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5748 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5742 "because of invalid channel in current GEO\n", 5749 "because of invalid channel in current GEO\n",
5743 escape_essid(network->ssid, network->ssid_len), 5750 escape_essid(network->ssid, network->ssid_len),
5744 MAC_ARG(network->bssid)); 5751 print_mac(mac, network->bssid));
5745 return 0; 5752 return 0;
5746 } 5753 }
5747 5754
5748 /* Ensure that the rates supported by the driver are compatible with 5755 /* Ensure that the rates supported by the driver are compatible with
5749 * this AP, including verification of basic rates (mandatory) */ 5756 * this AP, including verification of basic rates (mandatory) */
5750 if (!ipw_compatible_rates(priv, network, &rates)) { 5757 if (!ipw_compatible_rates(priv, network, &rates)) {
5751 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5758 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5752 "because configured rate mask excludes " 5759 "because configured rate mask excludes "
5753 "AP mandatory rate.\n", 5760 "AP mandatory rate.\n",
5754 escape_essid(network->ssid, network->ssid_len), 5761 escape_essid(network->ssid, network->ssid_len),
5755 MAC_ARG(network->bssid)); 5762 print_mac(mac, network->bssid));
5756 return 0; 5763 return 0;
5757 } 5764 }
5758 5765
5759 if (rates.num_rates == 0) { 5766 if (rates.num_rates == 0) {
5760 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5767 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5761 "because of no compatible rates.\n", 5768 "because of no compatible rates.\n",
5762 escape_essid(network->ssid, network->ssid_len), 5769 escape_essid(network->ssid, network->ssid_len),
5763 MAC_ARG(network->bssid)); 5770 print_mac(mac, network->bssid));
5764 return 0; 5771 return 0;
5765 } 5772 }
5766 5773
@@ -5772,9 +5779,9 @@ static int ipw_best_network(struct ipw_priv *priv,
5772 ipw_copy_rates(&match->rates, &rates); 5779 ipw_copy_rates(&match->rates, &rates);
5773 match->network = network; 5780 match->network = network;
5774 5781
5775 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' is a viable match.\n", 5782 IPW_DEBUG_ASSOC("Network '%s (%s)' is a viable match.\n",
5776 escape_essid(network->ssid, network->ssid_len), 5783 escape_essid(network->ssid, network->ssid_len),
5777 MAC_ARG(network->bssid)); 5784 print_mac(mac, network->bssid));
5778 5785
5779 return 1; 5786 return 1;
5780} 5787}
@@ -6016,6 +6023,7 @@ static void ipw_bg_adhoc_check(struct work_struct *work)
6016 6023
6017static void ipw_debug_config(struct ipw_priv *priv) 6024static void ipw_debug_config(struct ipw_priv *priv)
6018{ 6025{
6026 DECLARE_MAC_BUF(mac);
6019 IPW_DEBUG_INFO("Scan completed, no valid APs matched " 6027 IPW_DEBUG_INFO("Scan completed, no valid APs matched "
6020 "[CFG 0x%08X]\n", priv->config); 6028 "[CFG 0x%08X]\n", priv->config);
6021 if (priv->config & CFG_STATIC_CHANNEL) 6029 if (priv->config & CFG_STATIC_CHANNEL)
@@ -6028,8 +6036,8 @@ static void ipw_debug_config(struct ipw_priv *priv)
6028 else 6036 else
6029 IPW_DEBUG_INFO("ESSID unlocked.\n"); 6037 IPW_DEBUG_INFO("ESSID unlocked.\n");
6030 if (priv->config & CFG_STATIC_BSSID) 6038 if (priv->config & CFG_STATIC_BSSID)
6031 IPW_DEBUG_INFO("BSSID locked to " MAC_FMT "\n", 6039 IPW_DEBUG_INFO("BSSID locked to %s\n",
6032 MAC_ARG(priv->bssid)); 6040 print_mac(mac, priv->bssid));
6033 else 6041 else
6034 IPW_DEBUG_INFO("BSSID unlocked.\n"); 6042 IPW_DEBUG_INFO("BSSID unlocked.\n");
6035 if (priv->capability & CAP_PRIVACY_ON) 6043 if (priv->capability & CAP_PRIVACY_ON)
@@ -7221,6 +7229,7 @@ static int ipw_associate_network(struct ipw_priv *priv,
7221 struct ipw_supported_rates *rates, int roaming) 7229 struct ipw_supported_rates *rates, int roaming)
7222{ 7230{
7223 int err; 7231 int err;
7232 DECLARE_MAC_BUF(mac);
7224 7233
7225 if (priv->config & CFG_FIXED_RATE) 7234 if (priv->config & CFG_FIXED_RATE)
7226 ipw_set_fixed_rate(priv, network->mode); 7235 ipw_set_fixed_rate(priv, network->mode);
@@ -7388,9 +7397,9 @@ static int ipw_associate_network(struct ipw_priv *priv,
7388 return err; 7397 return err;
7389 } 7398 }
7390 7399
7391 IPW_DEBUG(IPW_DL_STATE, "associating: '%s' " MAC_FMT " \n", 7400 IPW_DEBUG(IPW_DL_STATE, "associating: '%s' %s \n",
7392 escape_essid(priv->essid, priv->essid_len), 7401 escape_essid(priv->essid, priv->essid_len),
7393 MAC_ARG(priv->bssid)); 7402 print_mac(mac, priv->bssid));
7394 7403
7395 return 0; 7404 return 0;
7396} 7405}
@@ -8202,6 +8211,9 @@ static void ipw_rx(struct ipw_priv *priv)
8202 struct ieee80211_hdr_4addr *header; 8211 struct ieee80211_hdr_4addr *header;
8203 u32 r, w, i; 8212 u32 r, w, i;
8204 u8 network_packet; 8213 u8 network_packet;
8214 DECLARE_MAC_BUF(mac);
8215 DECLARE_MAC_BUF(mac2);
8216 DECLARE_MAC_BUF(mac3);
8205 8217
8206 r = ipw_read32(priv, IPW_RX_READ_INDEX); 8218 r = ipw_read32(priv, IPW_RX_READ_INDEX);
8207 w = ipw_read32(priv, IPW_RX_WRITE_INDEX); 8219 w = ipw_read32(priv, IPW_RX_WRITE_INDEX);
@@ -8328,14 +8340,17 @@ static void ipw_rx(struct ipw_priv *priv)
8328 header))) 8340 header)))
8329 { 8341 {
8330 IPW_DEBUG_DROP("Dropping: " 8342 IPW_DEBUG_DROP("Dropping: "
8331 MAC_FMT ", " 8343 "%s, "
8332 MAC_FMT ", " 8344 "%s, "
8333 MAC_FMT "\n", 8345 "%s\n",
8334 MAC_ARG(header-> 8346 print_mac(mac,
8347 header->
8335 addr1), 8348 addr1),
8336 MAC_ARG(header-> 8349 print_mac(mac2,
8350 header->
8337 addr2), 8351 addr2),
8338 MAC_ARG(header-> 8352 print_mac(mac3,
8353 header->
8339 addr3)); 8354 addr3));
8340 break; 8355 break;
8341 } 8356 }
@@ -8867,6 +8882,7 @@ static int ipw_wx_set_wap(struct net_device *dev,
8867 union iwreq_data *wrqu, char *extra) 8882 union iwreq_data *wrqu, char *extra)
8868{ 8883{
8869 struct ipw_priv *priv = ieee80211_priv(dev); 8884 struct ipw_priv *priv = ieee80211_priv(dev);
8885 DECLARE_MAC_BUF(mac);
8870 8886
8871 static const unsigned char any[] = { 8887 static const unsigned char any[] = {
8872 0xff, 0xff, 0xff, 0xff, 0xff, 0xff 8888 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
@@ -8897,8 +8913,8 @@ static int ipw_wx_set_wap(struct net_device *dev,
8897 return 0; 8913 return 0;
8898 } 8914 }
8899 8915
8900 IPW_DEBUG_WX("Setting mandatory BSSID to " MAC_FMT "\n", 8916 IPW_DEBUG_WX("Setting mandatory BSSID to %s\n",
8901 MAC_ARG(wrqu->ap_addr.sa_data)); 8917 print_mac(mac, wrqu->ap_addr.sa_data));
8902 8918
8903 memcpy(priv->bssid, wrqu->ap_addr.sa_data, ETH_ALEN); 8919 memcpy(priv->bssid, wrqu->ap_addr.sa_data, ETH_ALEN);
8904 8920
@@ -8916,6 +8932,8 @@ static int ipw_wx_get_wap(struct net_device *dev,
8916 union iwreq_data *wrqu, char *extra) 8932 union iwreq_data *wrqu, char *extra)
8917{ 8933{
8918 struct ipw_priv *priv = ieee80211_priv(dev); 8934 struct ipw_priv *priv = ieee80211_priv(dev);
8935 DECLARE_MAC_BUF(mac);
8936
8919 /* If we are associated, trying to associate, or have a statically 8937 /* If we are associated, trying to associate, or have a statically
8920 * configured BSSID then return that; otherwise return ANY */ 8938 * configured BSSID then return that; otherwise return ANY */
8921 mutex_lock(&priv->mutex); 8939 mutex_lock(&priv->mutex);
@@ -8926,8 +8944,8 @@ static int ipw_wx_get_wap(struct net_device *dev,
8926 } else 8944 } else
8927 memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); 8945 memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
8928 8946
8929 IPW_DEBUG_WX("Getting WAP BSSID: " MAC_FMT "\n", 8947 IPW_DEBUG_WX("Getting WAP BSSID: %s\n",
8930 MAC_ARG(wrqu->ap_addr.sa_data)); 8948 print_mac(mac, wrqu->ap_addr.sa_data));
8931 mutex_unlock(&priv->mutex); 8949 mutex_unlock(&priv->mutex);
8932 return 0; 8950 return 0;
8933} 8951}
@@ -10133,6 +10151,7 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
10133 u8 id, hdr_len, unicast; 10151 u8 id, hdr_len, unicast;
10134 u16 remaining_bytes; 10152 u16 remaining_bytes;
10135 int fc; 10153 int fc;
10154 DECLARE_MAC_BUF(mac);
10136 10155
10137 hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 10156 hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
10138 switch (priv->ieee->iw_mode) { 10157 switch (priv->ieee->iw_mode) {
@@ -10143,8 +10162,8 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
10143 id = ipw_add_station(priv, hdr->addr1); 10162 id = ipw_add_station(priv, hdr->addr1);
10144 if (id == IPW_INVALID_STATION) { 10163 if (id == IPW_INVALID_STATION) {
10145 IPW_WARNING("Attempt to send data to " 10164 IPW_WARNING("Attempt to send data to "
10146 "invalid cell: " MAC_FMT "\n", 10165 "invalid cell: %s\n",
10147 MAC_ARG(hdr->addr1)); 10166 print_mac(mac, hdr->addr1));
10148 goto drop; 10167 goto drop;
10149 } 10168 }
10150 } 10169 }
@@ -10460,13 +10479,15 @@ static int ipw_net_set_mac_address(struct net_device *dev, void *p)
10460{ 10479{
10461 struct ipw_priv *priv = ieee80211_priv(dev); 10480 struct ipw_priv *priv = ieee80211_priv(dev);
10462 struct sockaddr *addr = p; 10481 struct sockaddr *addr = p;
10482 DECLARE_MAC_BUF(mac);
10483
10463 if (!is_valid_ether_addr(addr->sa_data)) 10484 if (!is_valid_ether_addr(addr->sa_data))
10464 return -EADDRNOTAVAIL; 10485 return -EADDRNOTAVAIL;
10465 mutex_lock(&priv->mutex); 10486 mutex_lock(&priv->mutex);
10466 priv->config |= CFG_CUSTOM_MAC; 10487 priv->config |= CFG_CUSTOM_MAC;
10467 memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN); 10488 memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN);
10468 printk(KERN_INFO "%s: Setting MAC to " MAC_FMT "\n", 10489 printk(KERN_INFO "%s: Setting MAC to %s\n",
10469 priv->net_dev->name, MAC_ARG(priv->mac_addr)); 10490 priv->net_dev->name, print_mac(mac, priv->mac_addr));
10470 queue_work(priv->workqueue, &priv->adapter_restart); 10491 queue_work(priv->workqueue, &priv->adapter_restart);
10471 mutex_unlock(&priv->mutex); 10492 mutex_unlock(&priv->mutex);
10472 return 0; 10493 return 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index a4f4c8798a83..b0d28ae0b324 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -646,6 +646,7 @@ static struct ieee80211_rate *rs_get_rate(void *priv_rate,
646 struct sta_info *sta; 646 struct sta_info *sta;
647 u16 fc, rate_mask; 647 u16 fc, rate_mask;
648 struct iwl_priv *priv = (struct iwl_priv *)priv_rate; 648 struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
649 DECLARE_MAC_BUF(mac);
649 650
650 IWL_DEBUG_RATE("enter\n"); 651 IWL_DEBUG_RATE("enter\n");
651 652
@@ -681,8 +682,8 @@ static struct ieee80211_rate *rs_get_rate(void *priv_rate,
681 u8 sta_id = iwl_hw_find_station(priv, hdr->addr1); 682 u8 sta_id = iwl_hw_find_station(priv, hdr->addr1);
682 683
683 if (sta_id == IWL_INVALID_STATION) { 684 if (sta_id == IWL_INVALID_STATION) {
684 IWL_DEBUG_RATE("LQ: ADD station " MAC_FMT "\n", 685 IWL_DEBUG_RATE("LQ: ADD station %s\n",
685 MAC_ARG(hdr->addr1)); 686 print_mac(mac, hdr->addr1));
686 sta_id = iwl_add_station(priv, 687 sta_id = iwl_add_station(priv,
687 hdr->addr1, 0, CMD_ASYNC); 688 hdr->addr1, 0, CMD_ASYNC);
688 } 689 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 26f03a0b878d..55f7d89aad8d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -457,13 +457,16 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
457 } 457 }
458 458
459 case IEEE80211_STYPE_PROBE_REQ:{ 459 case IEEE80211_STYPE_PROBE_REQ:{
460 DECLARE_MAC_BUF(mac1);
461 DECLARE_MAC_BUF(mac2);
462 DECLARE_MAC_BUF(mac3);
460 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) 463 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
461 IWL_DEBUG_DROP 464 IWL_DEBUG_DROP
462 ("Dropping (non network): " MAC_FMT 465 ("Dropping (non network): %s"
463 ", " MAC_FMT ", " MAC_FMT "\n", 466 ", %s, %s\n",
464 MAC_ARG(header->addr1), 467 print_mac(mac1, header->addr1),
465 MAC_ARG(header->addr2), 468 print_mac(mac2, header->addr2),
466 MAC_ARG(header->addr3)); 469 print_mac(mac3, header->addr3));
467 return; 470 return;
468 } 471 }
469 } 472 }
@@ -474,18 +477,22 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
474 case IEEE80211_FTYPE_CTL: 477 case IEEE80211_FTYPE_CTL:
475 break; 478 break;
476 479
477 case IEEE80211_FTYPE_DATA: 480 case IEEE80211_FTYPE_DATA: {
481 DECLARE_MAC_BUF(mac1);
482 DECLARE_MAC_BUF(mac2);
483 DECLARE_MAC_BUF(mac3);
484
478 if (unlikely(is_duplicate_packet(priv, header))) 485 if (unlikely(is_duplicate_packet(priv, header)))
479 IWL_DEBUG_DROP("Dropping (dup): " MAC_FMT ", " 486 IWL_DEBUG_DROP("Dropping (dup): %s, %s, %s\n",
480 MAC_FMT ", " MAC_FMT "\n", 487 print_mac(mac1, header->addr1),
481 MAC_ARG(header->addr1), 488 print_mac(mac2, header->addr2),
482 MAC_ARG(header->addr2), 489 print_mac(mac3, header->addr3));
483 MAC_ARG(header->addr3));
484 else 490 else
485 iwl3945_handle_data_packet(priv, 1, rxb, &stats, 491 iwl3945_handle_data_packet(priv, 1, rxb, &stats,
486 phy_flags); 492 phy_flags);
487 break; 493 break;
488 } 494 }
495 }
489} 496}
490 497
491int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *ptr, 498int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *ptr,
@@ -563,6 +570,7 @@ u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *addr)
563 int i; 570 int i;
564 int ret = IWL_INVALID_STATION; 571 int ret = IWL_INVALID_STATION;
565 unsigned long flags; 572 unsigned long flags;
573 DECLARE_MAC_BUF(mac);
566 574
567 spin_lock_irqsave(&priv->sta_lock, flags); 575 spin_lock_irqsave(&priv->sta_lock, flags);
568 for (i = IWL_STA_ID; i < priv->hw_setting.max_stations; i++) 576 for (i = IWL_STA_ID; i < priv->hw_setting.max_stations; i++)
@@ -573,8 +581,8 @@ u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *addr)
573 goto out; 581 goto out;
574 } 582 }
575 583
576 IWL_DEBUG_INFO("can not find STA " MAC_FMT " (total %d)\n", 584 IWL_DEBUG_INFO("can not find STA %s (total %d)\n",
577 MAC_ARG(addr), priv->num_stations); 585 print_mac(mac, addr), priv->num_stations);
578 out: 586 out:
579 spin_unlock_irqrestore(&priv->sta_lock, flags); 587 spin_unlock_irqrestore(&priv->sta_lock, flags);
580 return ret; 588 return ret;
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index f3638607d641..7b74481f5282 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -1737,10 +1737,11 @@ static struct ieee80211_rate *rs_get_rate(void *priv_rate,
1737 1737
1738 if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && !lq->ibss_sta_added) { 1738 if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && !lq->ibss_sta_added) {
1739 u8 sta_id = iwl_hw_find_station(priv, hdr->addr1); 1739 u8 sta_id = iwl_hw_find_station(priv, hdr->addr1);
1740 DECLARE_MAC_BUF(mac);
1740 1741
1741 if (sta_id == IWL_INVALID_STATION) { 1742 if (sta_id == IWL_INVALID_STATION) {
1742 IWL_DEBUG_RATE("LQ: ADD station " MAC_FMT "\n", 1743 IWL_DEBUG_RATE("LQ: ADD station %s\n",
1743 MAC_ARG(hdr->addr1)); 1744 print_mac(mac, hdr->addr1));
1744 sta_id = iwl_add_station(priv, 1745 sta_id = iwl_add_station(priv,
1745 hdr->addr1, 0, CMD_ASYNC); 1746 hdr->addr1, 0, CMD_ASYNC);
1746 } 1747 }
@@ -1811,14 +1812,16 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
1811 crl->ibss_sta_added = 0; 1812 crl->ibss_sta_added = 0;
1812 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { 1813 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
1813 u8 sta_id = iwl_hw_find_station(priv, sta->addr); 1814 u8 sta_id = iwl_hw_find_station(priv, sta->addr);
1815 DECLARE_MAC_BUF(mac);
1816
1814 /* for IBSS the call are from tasklet */ 1817 /* for IBSS the call are from tasklet */
1815 IWL_DEBUG_HT("LQ: ADD station " MAC_FMT " \n", 1818 IWL_DEBUG_HT("LQ: ADD station %s\n",
1816 MAC_ARG(sta->addr)); 1819 print_mac(mac, sta->addr));
1817 1820
1818 if (sta_id == IWL_INVALID_STATION) { 1821 if (sta_id == IWL_INVALID_STATION) {
1819 IWL_DEBUG_RATE("LQ: ADD station " MAC_FMT "\n", 1822 IWL_DEBUG_RATE("LQ: ADD station %s\n",
1820 MAC_ARG(sta->addr)); 1823 print_mac(mac, sta->addr));
1821 sta_id = iwl_add_station(priv, 1824 sta_id = iwl_add_station(priv,
1822 sta->addr, 0, CMD_ASYNC); 1825 sta->addr, 0, CMD_ASYNC);
1823 } 1826 }
1824 if ((sta_id != IWL_INVALID_STATION)) { 1827 if ((sta_id != IWL_INVALID_STATION)) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index ba35b3ac7c7e..e624f2a41e0e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -164,6 +164,7 @@ u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *addr)
164 int start = 0; 164 int start = 0;
165 int ret = IWL_INVALID_STATION; 165 int ret = IWL_INVALID_STATION;
166 unsigned long flags; 166 unsigned long flags;
167 DECLARE_MAC_BUF(mac);
167 168
168 if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) || 169 if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) ||
169 (priv->iw_mode == IEEE80211_IF_TYPE_AP)) 170 (priv->iw_mode == IEEE80211_IF_TYPE_AP))
@@ -181,8 +182,8 @@ u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *addr)
181 goto out; 182 goto out;
182 } 183 }
183 184
184 IWL_DEBUG_ASSOC("can not find STA " MAC_FMT " total %d\n", 185 IWL_DEBUG_ASSOC("can not find STA %s total %d\n",
185 MAC_ARG(addr), priv->num_stations); 186 print_mac(mac, addr), priv->num_stations);
186 187
187 out: 188 out:
188 spin_unlock_irqrestore(&priv->sta_lock, flags); 189 spin_unlock_irqrestore(&priv->sta_lock, flags);
@@ -3909,12 +3910,15 @@ static void iwl4965_rx_reply_rx(struct iwl_priv *priv,
3909 case IEEE80211_STYPE_PROBE_REQ: 3910 case IEEE80211_STYPE_PROBE_REQ:
3910 if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && 3911 if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
3911 !iwl_is_associated(priv)) { 3912 !iwl_is_associated(priv)) {
3913 DECLARE_MAC_BUF(mac1);
3914 DECLARE_MAC_BUF(mac2);
3915 DECLARE_MAC_BUF(mac3);
3916
3912 IWL_DEBUG_DROP("Dropping (non network): " 3917 IWL_DEBUG_DROP("Dropping (non network): "
3913 MAC_FMT ", " MAC_FMT ", " 3918 "%s, %s, %s\n",
3914 MAC_FMT "\n", 3919 print_mac(mac1, header->addr1),
3915 MAC_ARG(header->addr1), 3920 print_mac(mac2, header->addr2),
3916 MAC_ARG(header->addr2), 3921 print_mac(mac3, header->addr3));
3917 MAC_ARG(header->addr3));
3918 return; 3922 return;
3919 } 3923 }
3920 } 3924 }
@@ -3936,28 +3940,31 @@ static void iwl4965_rx_reply_rx(struct iwl_priv *priv,
3936 3940
3937 break; 3941 break;
3938 3942
3939 case IEEE80211_FTYPE_DATA: 3943 case IEEE80211_FTYPE_DATA: {
3944 DECLARE_MAC_BUF(mac1);
3945 DECLARE_MAC_BUF(mac2);
3946 DECLARE_MAC_BUF(mac3);
3947
3940 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) 3948 if (priv->iw_mode == IEEE80211_IF_TYPE_AP)
3941 iwl4965_update_ps_mode(priv, fc & IEEE80211_FCTL_PM, 3949 iwl4965_update_ps_mode(priv, fc & IEEE80211_FCTL_PM,
3942 header->addr2); 3950 header->addr2);
3943 3951
3944 if (unlikely(!network_packet)) 3952 if (unlikely(!network_packet))
3945 IWL_DEBUG_DROP("Dropping (non network): " 3953 IWL_DEBUG_DROP("Dropping (non network): "
3946 MAC_FMT ", " MAC_FMT ", " 3954 "%s, %s, %s\n",
3947 MAC_FMT "\n", 3955 print_mac(mac1, header->addr1),
3948 MAC_ARG(header->addr1), 3956 print_mac(mac2, header->addr2),
3949 MAC_ARG(header->addr2), 3957 print_mac(mac3, header->addr3));
3950 MAC_ARG(header->addr3));
3951 else if (unlikely(is_duplicate_packet(priv, header))) 3958 else if (unlikely(is_duplicate_packet(priv, header)))
3952 IWL_DEBUG_DROP("Dropping (dup): " MAC_FMT ", " 3959 IWL_DEBUG_DROP("Dropping (dup): %s, %s, %s\n",
3953 MAC_FMT ", " MAC_FMT "\n", 3960 print_mac(mac1, header->addr1),
3954 MAC_ARG(header->addr1), 3961 print_mac(mac2, header->addr2),
3955 MAC_ARG(header->addr2), 3962 print_mac(mac3, header->addr3));
3956 MAC_ARG(header->addr3));
3957 else 3963 else
3958 iwl4965_handle_data_packet(priv, 1, include_phy, rxb, 3964 iwl4965_handle_data_packet(priv, 1, include_phy, rxb,
3959 &stats); 3965 &stats);
3960 break; 3966 break;
3967 }
3961 default: 3968 default:
3962 break; 3969 break;
3963 3970
@@ -4106,10 +4113,12 @@ static void iwl4965_rx_reply_compressed_ba(struct iwl_priv *priv,
4106 4113
4107 /* TODO: Need to get this copy more sefely - now good for debug */ 4114 /* TODO: Need to get this copy more sefely - now good for debug */
4108/* 4115/*
4109 IWL_DEBUG_TX_REPLY("REPLY_COMPRESSED_BA [%d]Received from " MAC_FMT ", 4116 {
4110 sta_id = %d\n", 4117 DECLARE_MAC_BUF(mac);
4118 IWL_DEBUG_TX_REPLY("REPLY_COMPRESSED_BA [%d]Received from %s, "
4119 "sta_id = %d\n",
4111 agg->wait_for_ba, 4120 agg->wait_for_ba,
4112 MAC_ARG((u8*) &ba_resp->sta_addr_lo32), 4121 print_mac(mac, (u8*) &ba_resp->sta_addr_lo32),
4113 ba_resp->sta_id); 4122 ba_resp->sta_id);
4114 IWL_DEBUG_TX_REPLY("TID = %d, SeqCtl = %d, bitmap = 0x%X%X, scd_flow = " 4123 IWL_DEBUG_TX_REPLY("TID = %d, SeqCtl = %d, bitmap = 0x%X%X, scd_flow = "
4115 "%d, scd_ssn = %d\n", 4124 "%d, scd_ssn = %d\n",
@@ -4123,6 +4132,7 @@ static void iwl4965_rx_reply_compressed_ba(struct iwl_priv *priv,
4123 agg->start_idx, 4132 agg->start_idx,
4124 agg->bitmap1, 4133 agg->bitmap1,
4125 agg->bitmap0); 4134 agg->bitmap0);
4135 }
4126*/ 4136*/
4127 iwl4965_tx_status_reply_compressed_ba(priv, agg, ba_resp); 4137 iwl4965_tx_status_reply_compressed_ba(priv, agg, ba_resp);
4128 /* releases all the TFDs until the SSN */ 4138 /* releases all the TFDs until the SSN */
@@ -4539,14 +4549,15 @@ int iwl_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, u16 tid,
4539 int ssn = -1; 4549 int ssn = -1;
4540 unsigned long flags; 4550 unsigned long flags;
4541 struct iwl_tid_data *tid_data; 4551 struct iwl_tid_data *tid_data;
4552 DECLARE_MAC_BUF(mac);
4542 4553
4543 if (likely(tid < ARRAY_SIZE(default_tid_to_tx_fifo))) 4554 if (likely(tid < ARRAY_SIZE(default_tid_to_tx_fifo)))
4544 tx_fifo = default_tid_to_tx_fifo[tid]; 4555 tx_fifo = default_tid_to_tx_fifo[tid];
4545 else 4556 else
4546 return -EINVAL; 4557 return -EINVAL;
4547 4558
4548 IWL_WARNING("iwl-AGG iwl_mac_ht_tx_agg_start on da=" MAC_FMT 4559 IWL_WARNING("iwl-AGG iwl_mac_ht_tx_agg_start on da=%s"
4549 " tid=%d\n", MAC_ARG(da), tid); 4560 " tid=%d\n", print_mac(mac, da), tid);
4550 4561
4551 sta_id = iwl_hw_find_station(priv, da); 4562 sta_id = iwl_hw_find_station(priv, da);
4552 if (sta_id == IWL_INVALID_STATION) 4563 if (sta_id == IWL_INVALID_STATION)
@@ -4577,6 +4588,8 @@ int iwl_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da, u16 tid,
4577 int tx_fifo_id, txq_id, sta_id, ssn = -1; 4588 int tx_fifo_id, txq_id, sta_id, ssn = -1;
4578 struct iwl_tid_data *tid_data; 4589 struct iwl_tid_data *tid_data;
4579 int rc; 4590 int rc;
4591 DECLARE_MAC_BUF(mac);
4592
4580 if (!da) { 4593 if (!da) {
4581 IWL_ERROR("%s: da = NULL\n", __func__); 4594 IWL_ERROR("%s: da = NULL\n", __func__);
4582 return -EINVAL; 4595 return -EINVAL;
@@ -4602,8 +4615,8 @@ int iwl_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da, u16 tid,
4602 return rc; 4615 return rc;
4603 4616
4604 iwl4965_ba_status(priv, tid, BA_STATUS_INITIATOR_DELBA); 4617 iwl4965_ba_status(priv, tid, BA_STATUS_INITIATOR_DELBA);
4605 IWL_DEBUG_INFO("iwl_mac_ht_tx_agg_stop on da=" MAC_FMT " tid=%d\n", 4618 IWL_DEBUG_INFO("iwl_mac_ht_tx_agg_stop on da=%s tid=%d\n",
4606 MAC_ARG(da), tid); 4619 print_mac(mac, da), tid);
4607 4620
4608 return 0; 4621 return 0;
4609} 4622}
@@ -4613,9 +4626,10 @@ int iwl_mac_ht_rx_agg_start(struct ieee80211_hw *hw, u8 *da,
4613{ 4626{
4614 struct iwl_priv *priv = hw->priv; 4627 struct iwl_priv *priv = hw->priv;
4615 int sta_id; 4628 int sta_id;
4629 DECLARE_MAC_BUF(mac);
4616 4630
4617 IWL_WARNING("iwl-AGG iwl_mac_ht_rx_agg_start on da=" MAC_FMT 4631 IWL_WARNING("iwl-AGG iwl_mac_ht_rx_agg_start on da=%s"
4618 " tid=%d\n", MAC_ARG(da), tid); 4632 " tid=%d\n", print_mac(mac, da), tid);
4619 sta_id = iwl_hw_find_station(priv, da); 4633 sta_id = iwl_hw_find_station(priv, da);
4620 iwl4965_sta_modify_add_ba_tid(priv, sta_id, tid, start_seq_num); 4634 iwl4965_sta_modify_add_ba_tid(priv, sta_id, tid, start_seq_num);
4621 return 0; 4635 return 0;
@@ -4626,9 +4640,10 @@ int iwl_mac_ht_rx_agg_stop(struct ieee80211_hw *hw, u8 *da,
4626{ 4640{
4627 struct iwl_priv *priv = hw->priv; 4641 struct iwl_priv *priv = hw->priv;
4628 int sta_id; 4642 int sta_id;
4643 DECLARE_MAC_BUF(mac);
4629 4644
4630 IWL_WARNING("iwl-AGG iwl_mac_ht_rx_agg_stop on da=" MAC_FMT " tid=%d\n", 4645 IWL_WARNING("iwl-AGG iwl_mac_ht_rx_agg_stop on da=%s tid=%d\n",
4631 MAC_ARG(da), tid); 4646 print_mac(mac, da), tid);
4632 sta_id = iwl_hw_find_station(priv, da); 4647 sta_id = iwl_hw_find_station(priv, da);
4633 iwl4965_sta_modify_del_ba_tid(priv, sta_id, tid); 4648 iwl4965_sta_modify_del_ba_tid(priv, sta_id, tid);
4634 return 0; 4649 return 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 474b6402040c..cc405f4a8647 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -460,6 +460,7 @@ u8 iwl_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags)
460 int index = IWL_INVALID_STATION; 460 int index = IWL_INVALID_STATION;
461 struct iwl_station_entry *station; 461 struct iwl_station_entry *station;
462 unsigned long flags_spin; 462 unsigned long flags_spin;
463 DECLARE_MAC_BUF(mac);
463 464
464 spin_lock_irqsave(&priv->sta_lock, flags_spin); 465 spin_lock_irqsave(&priv->sta_lock, flags_spin);
465 if (is_ap) 466 if (is_ap)
@@ -492,7 +493,7 @@ u8 iwl_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags)
492 return index; 493 return index;
493 } 494 }
494 495
495 IWL_DEBUG_ASSOC("Add STA ID %d: " MAC_FMT "\n", index, MAC_ARG(addr)); 496 IWL_DEBUG_ASSOC("Add STA ID %d: %s\n", index, print_mac(mac, addr));
496 station = &priv->stations[index]; 497 station = &priv->stations[index];
497 station->used = 1; 498 station->used = 1;
498 priv->num_stations++; 499 priv->num_stations++;
@@ -1064,6 +1065,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
1064 /* cast away the const for active_rxon in this function */ 1065 /* cast away the const for active_rxon in this function */
1065 struct iwl_rxon_cmd *active_rxon = (void *)&priv->active_rxon; 1066 struct iwl_rxon_cmd *active_rxon = (void *)&priv->active_rxon;
1066 int rc = 0; 1067 int rc = 0;
1068 DECLARE_MAC_BUF(mac);
1067 1069
1068 if (!iwl_is_alive(priv)) 1070 if (!iwl_is_alive(priv))
1069 return -1; 1071 return -1;
@@ -1134,11 +1136,11 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
1134 IWL_DEBUG_INFO("Sending RXON\n" 1136 IWL_DEBUG_INFO("Sending RXON\n"
1135 "* with%s RXON_FILTER_ASSOC_MSK\n" 1137 "* with%s RXON_FILTER_ASSOC_MSK\n"
1136 "* channel = %d\n" 1138 "* channel = %d\n"
1137 "* bssid = " MAC_FMT "\n", 1139 "* bssid = %s\n",
1138 ((priv->staging_rxon.filter_flags & 1140 ((priv->staging_rxon.filter_flags &
1139 RXON_FILTER_ASSOC_MSK) ? "" : "out"), 1141 RXON_FILTER_ASSOC_MSK) ? "" : "out"),
1140 le16_to_cpu(priv->staging_rxon.channel), 1142 le16_to_cpu(priv->staging_rxon.channel),
1141 MAC_ARG(priv->staging_rxon.bssid_addr)); 1143 print_mac(mac, priv->staging_rxon.bssid_addr));
1142 1144
1143 /* Apply the new configuration */ 1145 /* Apply the new configuration */
1144 rc = iwl_send_cmd_pdu(priv, REPLY_RXON, 1146 rc = iwl_send_cmd_pdu(priv, REPLY_RXON,
@@ -2693,7 +2695,9 @@ static int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
2693 2695
2694 /* If this frame is part of a IBSS network, then we use the 2696 /* If this frame is part of a IBSS network, then we use the
2695 * target specific station id */ 2697 * target specific station id */
2696 case IEEE80211_IF_TYPE_IBSS: 2698 case IEEE80211_IF_TYPE_IBSS: {
2699 DECLARE_MAC_BUF(mac);
2700
2697 sta_id = iwl_hw_find_station(priv, hdr->addr1); 2701 sta_id = iwl_hw_find_station(priv, hdr->addr1);
2698 if (sta_id != IWL_INVALID_STATION) 2702 if (sta_id != IWL_INVALID_STATION)
2699 return sta_id; 2703 return sta_id;
@@ -2703,12 +2707,12 @@ static int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
2703 if (sta_id != IWL_INVALID_STATION) 2707 if (sta_id != IWL_INVALID_STATION)
2704 return sta_id; 2708 return sta_id;
2705 2709
2706 IWL_DEBUG_DROP("Station " MAC_FMT " not in station map. " 2710 IWL_DEBUG_DROP("Station %s not in station map. "
2707 "Defaulting to broadcast...\n", 2711 "Defaulting to broadcast...\n",
2708 MAC_ARG(hdr->addr1)); 2712 print_mac(mac, hdr->addr1));
2709 iwl_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); 2713 iwl_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
2710 return priv->hw_setting.bcast_sta_id; 2714 return priv->hw_setting.bcast_sta_id;
2711 2715 }
2712 default: 2716 default:
2713 IWL_WARNING("Unkown mode of operation: %d", priv->iw_mode); 2717 IWL_WARNING("Unkown mode of operation: %d", priv->iw_mode);
2714 return priv->hw_setting.bcast_sta_id; 2718 return priv->hw_setting.bcast_sta_id;
@@ -2781,8 +2785,10 @@ static int iwl_tx_skb(struct iwl_priv *priv,
2781 hdr_len = ieee80211_get_hdrlen(fc); 2785 hdr_len = ieee80211_get_hdrlen(fc);
2782 sta_id = iwl_get_sta_id(priv, hdr); 2786 sta_id = iwl_get_sta_id(priv, hdr);
2783 if (sta_id == IWL_INVALID_STATION) { 2787 if (sta_id == IWL_INVALID_STATION) {
2784 IWL_DEBUG_DROP("Dropping - INVALID STATION: " MAC_FMT "\n", 2788 DECLARE_MAC_BUF(mac);
2785 MAC_ARG(hdr->addr1)); 2789
2790 IWL_DEBUG_DROP("Dropping - INVALID STATION: %s\n",
2791 print_mac(mac, hdr->addr1));
2786 goto drop; 2792 goto drop;
2787 } 2793 }
2788 2794
@@ -4385,6 +4391,8 @@ int iwl_tx_queue_update_write_ptr(struct iwl_priv *priv,
4385#ifdef CONFIG_IWLWIFI_DEBUG 4391#ifdef CONFIG_IWLWIFI_DEBUG
4386static void iwl_print_rx_config_cmd(struct iwl_rxon_cmd *rxon) 4392static void iwl_print_rx_config_cmd(struct iwl_rxon_cmd *rxon)
4387{ 4393{
4394 DECLARE_MAC_BUF(mac);
4395
4388 IWL_DEBUG_RADIO("RX CONFIG:\n"); 4396 IWL_DEBUG_RADIO("RX CONFIG:\n");
4389 iwl_print_hex_dump(IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon)); 4397 iwl_print_hex_dump(IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon));
4390 IWL_DEBUG_RADIO("u16 channel: 0x%x\n", le16_to_cpu(rxon->channel)); 4398 IWL_DEBUG_RADIO("u16 channel: 0x%x\n", le16_to_cpu(rxon->channel));
@@ -4395,10 +4403,10 @@ static void iwl_print_rx_config_cmd(struct iwl_rxon_cmd *rxon)
4395 IWL_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x\n", 4403 IWL_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x\n",
4396 rxon->ofdm_basic_rates); 4404 rxon->ofdm_basic_rates);
4397 IWL_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates); 4405 IWL_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates);
4398 IWL_DEBUG_RADIO("u8[6] node_addr: " MAC_FMT "\n", 4406 IWL_DEBUG_RADIO("u8[6] node_addr: %s\n",
4399 MAC_ARG(rxon->node_addr)); 4407 print_mac(mac, rxon->node_addr));
4400 IWL_DEBUG_RADIO("u8[6] bssid_addr: " MAC_FMT "\n", 4408 IWL_DEBUG_RADIO("u8[6] bssid_addr: %s\n",
4401 MAC_ARG(rxon->bssid_addr)); 4409 print_mac(mac, rxon->bssid_addr));
4402 IWL_DEBUG_RADIO("u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id)); 4410 IWL_DEBUG_RADIO("u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id));
4403} 4411}
4404#endif 4412#endif
@@ -6322,6 +6330,7 @@ static void iwl_down(struct iwl_priv *priv)
6322 6330
6323static int __iwl_up(struct iwl_priv *priv) 6331static int __iwl_up(struct iwl_priv *priv)
6324{ 6332{
6333 DECLARE_MAC_BUF(mac);
6325 int rc, i; 6334 int rc, i;
6326 6335
6327 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) { 6336 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) {
@@ -6381,8 +6390,8 @@ static int __iwl_up(struct iwl_priv *priv)
6381 6390
6382 /* MAC Address location in EEPROM same for 3945/4965 */ 6391 /* MAC Address location in EEPROM same for 3945/4965 */
6383 get_eeprom_mac(priv, priv->mac_addr); 6392 get_eeprom_mac(priv, priv->mac_addr);
6384 IWL_DEBUG_INFO("MAC address: " MAC_FMT "\n", 6393 IWL_DEBUG_INFO("MAC address: %s\n",
6385 MAC_ARG(priv->mac_addr)); 6394 print_mac(mac, priv->mac_addr));
6386 6395
6387 SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr); 6396 SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);
6388 6397
@@ -6728,6 +6737,7 @@ static void iwl_bg_post_associate(struct work_struct *data)
6728 6737
6729 int rc = 0; 6738 int rc = 0;
6730 struct ieee80211_conf *conf = NULL; 6739 struct ieee80211_conf *conf = NULL;
6740 DECLARE_MAC_BUF(mac);
6731 6741
6732 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { 6742 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
6733 IWL_ERROR("%s Should not be called in AP mode\n", __FUNCTION__); 6743 IWL_ERROR("%s Should not be called in AP mode\n", __FUNCTION__);
@@ -6735,8 +6745,9 @@ static void iwl_bg_post_associate(struct work_struct *data)
6735 } 6745 }
6736 6746
6737 6747
6738 IWL_DEBUG_ASSOC("Associated as %d to: " MAC_FMT "\n", 6748 IWL_DEBUG_ASSOC("Associated as %d to: %s\n",
6739 priv->assoc_id, MAC_ARG(priv->active_rxon.bssid_addr)); 6749 priv->assoc_id,
6750 print_mac(mac, priv->active_rxon.bssid_addr));
6740 6751
6741 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 6752 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
6742 return; 6753 return;
@@ -6916,11 +6927,12 @@ static int iwl_mac_add_interface(struct ieee80211_hw *hw,
6916{ 6927{
6917 struct iwl_priv *priv = hw->priv; 6928 struct iwl_priv *priv = hw->priv;
6918 unsigned long flags; 6929 unsigned long flags;
6930 DECLARE_MAC_BUF(mac);
6919 6931
6920 IWL_DEBUG_MAC80211("enter: id %d, type %d\n", conf->if_id, conf->type); 6932 IWL_DEBUG_MAC80211("enter: id %d, type %d\n", conf->if_id, conf->type);
6921 if (conf->mac_addr) 6933 if (conf->mac_addr)
6922 IWL_DEBUG_MAC80211("enter: MAC " MAC_FMT "\n", 6934 IWL_DEBUG_MAC80211("enter: MAC %s\n",
6923 MAC_ARG(conf->mac_addr)); 6935 print_mac(mac, conf->mac_addr));
6924 6936
6925 if (priv->interface_id) { 6937 if (priv->interface_id) {
6926 IWL_DEBUG_MAC80211("leave - interface_id != 0\n"); 6938 IWL_DEBUG_MAC80211("leave - interface_id != 0\n");
@@ -7094,6 +7106,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
7094 struct ieee80211_if_conf *conf) 7106 struct ieee80211_if_conf *conf)
7095{ 7107{
7096 struct iwl_priv *priv = hw->priv; 7108 struct iwl_priv *priv = hw->priv;
7109 DECLARE_MAC_BUF(mac);
7097 unsigned long flags; 7110 unsigned long flags;
7098 int rc; 7111 int rc;
7099 7112
@@ -7111,8 +7124,8 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
7111 7124
7112 IWL_DEBUG_MAC80211("enter: interface id %d\n", if_id); 7125 IWL_DEBUG_MAC80211("enter: interface id %d\n", if_id);
7113 if (conf->bssid) 7126 if (conf->bssid)
7114 IWL_DEBUG_MAC80211("bssid: " MAC_FMT "\n", 7127 IWL_DEBUG_MAC80211("bssid: %s\n",
7115 MAC_ARG(conf->bssid)); 7128 print_mac(mac, conf->bssid));
7116 7129
7117 if (unlikely(test_bit(STATUS_SCANNING, &priv->status)) && 7130 if (unlikely(test_bit(STATUS_SCANNING, &priv->status)) &&
7118 !(priv->hw->flags & IEEE80211_HW_NO_PROBE_FILTERING)) { 7131 !(priv->hw->flags & IEEE80211_HW_NO_PROBE_FILTERING)) {
@@ -7131,8 +7144,8 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
7131 if (!conf->bssid) { 7144 if (!conf->bssid) {
7132 conf->bssid = priv->mac_addr; 7145 conf->bssid = priv->mac_addr;
7133 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN); 7146 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN);
7134 IWL_DEBUG_MAC80211("bssid was set to: " MAC_FMT "\n", 7147 IWL_DEBUG_MAC80211("bssid was set to: %s\n",
7135 MAC_ARG(conf->bssid)); 7148 print_mac(mac, conf->bssid));
7136 } 7149 }
7137 if (priv->ibss_beacon) 7150 if (priv->ibss_beacon)
7138 dev_kfree_skb(priv->ibss_beacon); 7151 dev_kfree_skb(priv->ibss_beacon);
@@ -7282,8 +7295,10 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, set_key_cmd cmd,
7282 7295
7283 sta_id = iwl_hw_find_station(priv, addr); 7296 sta_id = iwl_hw_find_station(priv, addr);
7284 if (sta_id == IWL_INVALID_STATION) { 7297 if (sta_id == IWL_INVALID_STATION) {
7285 IWL_DEBUG_MAC80211("leave - " MAC_FMT " not in station map.\n", 7298 DECLARE_MAC_BUF(mac);
7286 MAC_ARG(addr)); 7299
7300 IWL_DEBUG_MAC80211("leave - %s not in station map.\n",
7301 print_mac(mac, addr));
7287 return -EINVAL; 7302 return -EINVAL;
7288 } 7303 }
7289 7304
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index b79dabc8c01c..6cea3118b7c1 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -459,6 +459,7 @@ u8 iwl_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags)
459 int index = IWL_INVALID_STATION; 459 int index = IWL_INVALID_STATION;
460 struct iwl_station_entry *station; 460 struct iwl_station_entry *station;
461 unsigned long flags_spin; 461 unsigned long flags_spin;
462 DECLARE_MAC_BUF(mac);
462 463
463 spin_lock_irqsave(&priv->sta_lock, flags_spin); 464 spin_lock_irqsave(&priv->sta_lock, flags_spin);
464 if (is_ap) 465 if (is_ap)
@@ -493,7 +494,7 @@ u8 iwl_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags)
493 } 494 }
494 495
495 496
496 IWL_DEBUG_ASSOC("Add STA ID %d: " MAC_FMT "\n", index, MAC_ARG(addr)); 497 IWL_DEBUG_ASSOC("Add STA ID %d: %s\n", index, print_mac(mac, addr));
497 station = &priv->stations[index]; 498 station = &priv->stations[index];
498 station->used = 1; 499 station->used = 1;
499 priv->num_stations++; 500 priv->num_stations++;
@@ -1083,6 +1084,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
1083{ 1084{
1084 /* cast away the const for active_rxon in this function */ 1085 /* cast away the const for active_rxon in this function */
1085 struct iwl_rxon_cmd *active_rxon = (void *)&priv->active_rxon; 1086 struct iwl_rxon_cmd *active_rxon = (void *)&priv->active_rxon;
1087 DECLARE_MAC_BUF(mac);
1086 int rc = 0; 1088 int rc = 0;
1087 1089
1088 if (!iwl_is_alive(priv)) 1090 if (!iwl_is_alive(priv))
@@ -1160,11 +1162,11 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
1160 IWL_DEBUG_INFO("Sending RXON\n" 1162 IWL_DEBUG_INFO("Sending RXON\n"
1161 "* with%s RXON_FILTER_ASSOC_MSK\n" 1163 "* with%s RXON_FILTER_ASSOC_MSK\n"
1162 "* channel = %d\n" 1164 "* channel = %d\n"
1163 "* bssid = " MAC_FMT "\n", 1165 "* bssid = %s\n",
1164 ((priv->staging_rxon.filter_flags & 1166 ((priv->staging_rxon.filter_flags &
1165 RXON_FILTER_ASSOC_MSK) ? "" : "out"), 1167 RXON_FILTER_ASSOC_MSK) ? "" : "out"),
1166 le16_to_cpu(priv->staging_rxon.channel), 1168 le16_to_cpu(priv->staging_rxon.channel),
1167 MAC_ARG(priv->staging_rxon.bssid_addr)); 1169 print_mac(mac, priv->staging_rxon.bssid_addr));
1168 1170
1169 /* Apply the new configuration */ 1171 /* Apply the new configuration */
1170 rc = iwl_send_cmd_pdu(priv, REPLY_RXON, 1172 rc = iwl_send_cmd_pdu(priv, REPLY_RXON,
@@ -2748,6 +2750,7 @@ static int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
2748{ 2750{
2749 int sta_id; 2751 int sta_id;
2750 u16 fc = le16_to_cpu(hdr->frame_control); 2752 u16 fc = le16_to_cpu(hdr->frame_control);
2753 DECLARE_MAC_BUF(mac);
2751 2754
2752 /* If this frame is broadcast or not data then use the broadcast 2755 /* If this frame is broadcast or not data then use the broadcast
2753 * station id */ 2756 * station id */
@@ -2781,9 +2784,9 @@ static int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
2781 if (sta_id != IWL_INVALID_STATION) 2784 if (sta_id != IWL_INVALID_STATION)
2782 return sta_id; 2785 return sta_id;
2783 2786
2784 IWL_DEBUG_DROP("Station " MAC_FMT " not in station map. " 2787 IWL_DEBUG_DROP("Station %s not in station map. "
2785 "Defaulting to broadcast...\n", 2788 "Defaulting to broadcast...\n",
2786 MAC_ARG(hdr->addr1)); 2789 print_mac(mac, hdr->addr1));
2787 iwl_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); 2790 iwl_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
2788 return priv->hw_setting.bcast_sta_id; 2791 return priv->hw_setting.bcast_sta_id;
2789 2792
@@ -2859,8 +2862,10 @@ static int iwl_tx_skb(struct iwl_priv *priv,
2859 hdr_len = ieee80211_get_hdrlen(fc); 2862 hdr_len = ieee80211_get_hdrlen(fc);
2860 sta_id = iwl_get_sta_id(priv, hdr); 2863 sta_id = iwl_get_sta_id(priv, hdr);
2861 if (sta_id == IWL_INVALID_STATION) { 2864 if (sta_id == IWL_INVALID_STATION) {
2862 IWL_DEBUG_DROP("Dropping - INVALID STATION: " MAC_FMT "\n", 2865 DECLARE_MAC_BUF(mac);
2863 MAC_ARG(hdr->addr1)); 2866
2867 IWL_DEBUG_DROP("Dropping - INVALID STATION: %s\n",
2868 print_mac(mac, hdr->addr1));
2864 goto drop; 2869 goto drop;
2865 } 2870 }
2866 2871
@@ -4703,6 +4708,8 @@ int iwl_tx_queue_update_write_ptr(struct iwl_priv *priv,
4703#ifdef CONFIG_IWLWIFI_DEBUG 4708#ifdef CONFIG_IWLWIFI_DEBUG
4704static void iwl_print_rx_config_cmd(struct iwl_rxon_cmd *rxon) 4709static void iwl_print_rx_config_cmd(struct iwl_rxon_cmd *rxon)
4705{ 4710{
4711 DECLARE_MAC_BUF(mac);
4712
4706 IWL_DEBUG_RADIO("RX CONFIG:\n"); 4713 IWL_DEBUG_RADIO("RX CONFIG:\n");
4707 iwl_print_hex_dump(IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon)); 4714 iwl_print_hex_dump(IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon));
4708 IWL_DEBUG_RADIO("u16 channel: 0x%x\n", le16_to_cpu(rxon->channel)); 4715 IWL_DEBUG_RADIO("u16 channel: 0x%x\n", le16_to_cpu(rxon->channel));
@@ -4713,10 +4720,10 @@ static void iwl_print_rx_config_cmd(struct iwl_rxon_cmd *rxon)
4713 IWL_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x\n", 4720 IWL_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x\n",
4714 rxon->ofdm_basic_rates); 4721 rxon->ofdm_basic_rates);
4715 IWL_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates); 4722 IWL_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates);
4716 IWL_DEBUG_RADIO("u8[6] node_addr: " MAC_FMT "\n", 4723 IWL_DEBUG_RADIO("u8[6] node_addr: %s\n",
4717 MAC_ARG(rxon->node_addr)); 4724 print_mac(mac, rxon->node_addr));
4718 IWL_DEBUG_RADIO("u8[6] bssid_addr: " MAC_FMT "\n", 4725 IWL_DEBUG_RADIO("u8[6] bssid_addr: %s\n",
4719 MAC_ARG(rxon->bssid_addr)); 4726 print_mac(mac, rxon->bssid_addr));
4720 IWL_DEBUG_RADIO("u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id)); 4727 IWL_DEBUG_RADIO("u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id));
4721} 4728}
4722#endif 4729#endif
@@ -6670,6 +6677,7 @@ static void iwl_down(struct iwl_priv *priv)
6670 6677
6671static int __iwl_up(struct iwl_priv *priv) 6678static int __iwl_up(struct iwl_priv *priv)
6672{ 6679{
6680 DECLARE_MAC_BUF(mac);
6673 int rc, i; 6681 int rc, i;
6674 u32 hw_rf_kill = 0; 6682 u32 hw_rf_kill = 0;
6675 6683
@@ -6742,8 +6750,8 @@ static int __iwl_up(struct iwl_priv *priv)
6742 6750
6743 /* MAC Address location in EEPROM same for 3945/4965 */ 6751 /* MAC Address location in EEPROM same for 3945/4965 */
6744 get_eeprom_mac(priv, priv->mac_addr); 6752 get_eeprom_mac(priv, priv->mac_addr);
6745 IWL_DEBUG_INFO("MAC address: " MAC_FMT "\n", 6753 IWL_DEBUG_INFO("MAC address: %s\n",
6746 MAC_ARG(priv->mac_addr)); 6754 print_mac(mac, priv->mac_addr));
6747 6755
6748 SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr); 6756 SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);
6749 6757
@@ -7096,14 +7104,16 @@ static void iwl_bg_post_associate(struct work_struct *data)
7096 7104
7097 int rc = 0; 7105 int rc = 0;
7098 struct ieee80211_conf *conf = NULL; 7106 struct ieee80211_conf *conf = NULL;
7107 DECLARE_MAC_BUF(mac);
7099 7108
7100 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { 7109 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
7101 IWL_ERROR("%s Should not be called in AP mode\n", __FUNCTION__); 7110 IWL_ERROR("%s Should not be called in AP mode\n", __FUNCTION__);
7102 return; 7111 return;
7103 } 7112 }
7104 7113
7105 IWL_DEBUG_ASSOC("Associated as %d to: " MAC_FMT "\n", 7114 IWL_DEBUG_ASSOC("Associated as %d to: %s\n",
7106 priv->assoc_id, MAC_ARG(priv->active_rxon.bssid_addr)); 7115 priv->assoc_id,
7116 print_mac(mac, priv->active_rxon.bssid_addr));
7107 7117
7108 7118
7109 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 7119 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
@@ -7299,11 +7309,12 @@ static int iwl_mac_add_interface(struct ieee80211_hw *hw,
7299{ 7309{
7300 struct iwl_priv *priv = hw->priv; 7310 struct iwl_priv *priv = hw->priv;
7301 unsigned long flags; 7311 unsigned long flags;
7312 DECLARE_MAC_BUF(mac);
7302 7313
7303 IWL_DEBUG_MAC80211("enter: id %d, type %d\n", conf->if_id, conf->type); 7314 IWL_DEBUG_MAC80211("enter: id %d, type %d\n", conf->if_id, conf->type);
7304 if (conf->mac_addr) 7315 if (conf->mac_addr)
7305 IWL_DEBUG_MAC80211("enter: MAC " MAC_FMT "\n", 7316 IWL_DEBUG_MAC80211("enter: MAC %s\n",
7306 MAC_ARG(conf->mac_addr)); 7317 print_mac(mac, conf->mac_addr));
7307 7318
7308 if (priv->interface_id) { 7319 if (priv->interface_id) {
7309 IWL_DEBUG_MAC80211("leave - interface_id != 0\n"); 7320 IWL_DEBUG_MAC80211("leave - interface_id != 0\n");
@@ -7494,6 +7505,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
7494 struct ieee80211_if_conf *conf) 7505 struct ieee80211_if_conf *conf)
7495{ 7506{
7496 struct iwl_priv *priv = hw->priv; 7507 struct iwl_priv *priv = hw->priv;
7508 DECLARE_MAC_BUF(mac);
7497 unsigned long flags; 7509 unsigned long flags;
7498 int rc; 7510 int rc;
7499 7511
@@ -7511,8 +7523,8 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
7511 7523
7512 IWL_DEBUG_MAC80211("enter: interface id %d\n", if_id); 7524 IWL_DEBUG_MAC80211("enter: interface id %d\n", if_id);
7513 if (conf->bssid) 7525 if (conf->bssid)
7514 IWL_DEBUG_MAC80211("bssid: " MAC_FMT "\n", 7526 IWL_DEBUG_MAC80211("bssid: %s\n",
7515 MAC_ARG(conf->bssid)); 7527 print_mac(mac, conf->bssid));
7516 7528
7517 if (unlikely(test_bit(STATUS_SCANNING, &priv->status)) && 7529 if (unlikely(test_bit(STATUS_SCANNING, &priv->status)) &&
7518 !(priv->hw->flags & IEEE80211_HW_NO_PROBE_FILTERING)) { 7530 !(priv->hw->flags & IEEE80211_HW_NO_PROBE_FILTERING)) {
@@ -7531,8 +7543,8 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
7531 if (!conf->bssid) { 7543 if (!conf->bssid) {
7532 conf->bssid = priv->mac_addr; 7544 conf->bssid = priv->mac_addr;
7533 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN); 7545 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN);
7534 IWL_DEBUG_MAC80211("bssid was set to: " MAC_FMT "\n", 7546 IWL_DEBUG_MAC80211("bssid was set to: %s\n",
7535 MAC_ARG(conf->bssid)); 7547 print_mac(mac, conf->bssid));
7536 } 7548 }
7537 if (priv->ibss_beacon) 7549 if (priv->ibss_beacon)
7538 dev_kfree_skb(priv->ibss_beacon); 7550 dev_kfree_skb(priv->ibss_beacon);
@@ -7666,6 +7678,7 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, set_key_cmd cmd,
7666 struct ieee80211_key_conf *key) 7678 struct ieee80211_key_conf *key)
7667{ 7679{
7668 struct iwl_priv *priv = hw->priv; 7680 struct iwl_priv *priv = hw->priv;
7681 DECLARE_MAC_BUF(mac);
7669 int rc = 0; 7682 int rc = 0;
7670 u8 sta_id; 7683 u8 sta_id;
7671 7684
@@ -7682,8 +7695,8 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, set_key_cmd cmd,
7682 7695
7683 sta_id = iwl_hw_find_station(priv, addr); 7696 sta_id = iwl_hw_find_station(priv, addr);
7684 if (sta_id == IWL_INVALID_STATION) { 7697 if (sta_id == IWL_INVALID_STATION) {
7685 IWL_DEBUG_MAC80211("leave - " MAC_FMT " not in station map.\n", 7698 IWL_DEBUG_MAC80211("leave - %s not in station map.\n",
7686 MAC_ARG(addr)); 7699 print_mac(mac, addr));
7687 return -EINVAL; 7700 return -EINVAL;
7688 } 7701 }
7689 7702
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index 3131afcf4590..2c6ddb1f0072 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -16,6 +16,7 @@ static const u8 bssid_off[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
16 16
17static void print_assoc_req(const char * extra, struct assoc_request * assoc_req) 17static void print_assoc_req(const char * extra, struct assoc_request * assoc_req)
18{ 18{
19 DECLARE_MAC_BUF(mac);
19 lbs_deb_assoc( 20 lbs_deb_assoc(
20 "#### Association Request: %s\n" 21 "#### Association Request: %s\n"
21 " flags: 0x%08lX\n" 22 " flags: 0x%08lX\n"
@@ -23,13 +24,13 @@ static void print_assoc_req(const char * extra, struct assoc_request * assoc_req
23 " channel: %d\n" 24 " channel: %d\n"
24 " band: %d\n" 25 " band: %d\n"
25 " mode: %d\n" 26 " mode: %d\n"
26 " BSSID: " MAC_FMT "\n" 27 " BSSID: %s\n"
27 " Encryption:%s%s%s\n" 28 " Encryption:%s%s%s\n"
28 " auth: %d\n", 29 " auth: %d\n",
29 extra, assoc_req->flags, 30 extra, assoc_req->flags,
30 escape_essid(assoc_req->ssid, assoc_req->ssid_len), 31 escape_essid(assoc_req->ssid, assoc_req->ssid_len),
31 assoc_req->channel, assoc_req->band, assoc_req->mode, 32 assoc_req->channel, assoc_req->band, assoc_req->mode,
32 MAC_ARG(assoc_req->bssid), 33 print_mac(mac, assoc_req->bssid),
33 assoc_req->secinfo.WPAenabled ? " WPA" : "", 34 assoc_req->secinfo.WPAenabled ? " WPA" : "",
34 assoc_req->secinfo.WPA2enabled ? " WPA2" : "", 35 assoc_req->secinfo.WPA2enabled ? " WPA2" : "",
35 assoc_req->secinfo.wep_enabled ? " WEP" : "", 36 assoc_req->secinfo.wep_enabled ? " WEP" : "",
@@ -104,16 +105,17 @@ static int assoc_helper_bssid(wlan_private *priv,
104 wlan_adapter *adapter = priv->adapter; 105 wlan_adapter *adapter = priv->adapter;
105 int ret = 0; 106 int ret = 0;
106 struct bss_descriptor * bss; 107 struct bss_descriptor * bss;
108 DECLARE_MAC_BUF(mac);
107 109
108 lbs_deb_enter_args(LBS_DEB_ASSOC, "BSSID " MAC_FMT, 110 lbs_deb_enter_args(LBS_DEB_ASSOC, "BSSID %s",
109 MAC_ARG(assoc_req->bssid)); 111 print_mac(mac, assoc_req->bssid));
110 112
111 /* Search for index position in list for requested MAC */ 113 /* Search for index position in list for requested MAC */
112 bss = libertas_find_bssid_in_list(adapter, assoc_req->bssid, 114 bss = libertas_find_bssid_in_list(adapter, assoc_req->bssid,
113 assoc_req->mode); 115 assoc_req->mode);
114 if (bss == NULL) { 116 if (bss == NULL) {
115 lbs_deb_assoc("ASSOC: WAP: BSSID " MAC_FMT " not found, " 117 lbs_deb_assoc("ASSOC: WAP: BSSID %s not found, "
116 "cannot associate.\n", MAC_ARG(assoc_req->bssid)); 118 "cannot associate.\n", print_mac(mac, assoc_req->bssid));
117 goto out; 119 goto out;
118 } 120 }
119 121
@@ -481,6 +483,7 @@ void libertas_association_worker(struct work_struct *work)
481 struct assoc_request * assoc_req = NULL; 483 struct assoc_request * assoc_req = NULL;
482 int ret = 0; 484 int ret = 0;
483 int find_any_ssid = 0; 485 int find_any_ssid = 0;
486 DECLARE_MAC_BUF(mac);
484 487
485 lbs_deb_enter(LBS_DEB_ASSOC); 488 lbs_deb_enter(LBS_DEB_ASSOC);
486 489
@@ -629,10 +632,10 @@ void libertas_association_worker(struct work_struct *work)
629 632
630 if (success) { 633 if (success) {
631 lbs_deb_assoc("ASSOC: association attempt successful. " 634 lbs_deb_assoc("ASSOC: association attempt successful. "
632 "Associated to '%s' (" MAC_FMT ")\n", 635 "Associated to '%s' (%s)\n",
633 escape_essid(adapter->curbssparams.ssid, 636 escape_essid(adapter->curbssparams.ssid,
634 adapter->curbssparams.ssid_len), 637 adapter->curbssparams.ssid_len),
635 MAC_ARG(adapter->curbssparams.bssid)); 638 print_mac(mac, adapter->curbssparams.bssid));
636 libertas_prepare_and_send_command(priv, 639 libertas_prepare_and_send_command(priv,
637 CMD_802_11_RSSI, 640 CMD_802_11_RSSI,
638 0, CMD_OPTION_WAITFORRSP, 0, NULL); 641 0, CMD_OPTION_WAITFORRSP, 0, NULL);
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index d64ad87db459..fe70e30b1f3c 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -159,6 +159,7 @@ static int wlan_ret_get_hw_spec(wlan_private * priv,
159 struct cmd_ds_get_hw_spec *hwspec = &resp->params.hwspec; 159 struct cmd_ds_get_hw_spec *hwspec = &resp->params.hwspec;
160 wlan_adapter *adapter = priv->adapter; 160 wlan_adapter *adapter = priv->adapter;
161 int ret = 0; 161 int ret = 0;
162 DECLARE_MAC_BUF(mac);
162 163
163 lbs_deb_enter(LBS_DEB_CMD); 164 lbs_deb_enter(LBS_DEB_CMD);
164 165
@@ -169,8 +170,8 @@ static int wlan_ret_get_hw_spec(wlan_private * priv,
169 lbs_deb_cmd("GET_HW_SPEC: firmware release %u.%u.%up%u\n", 170 lbs_deb_cmd("GET_HW_SPEC: firmware release %u.%u.%up%u\n",
170 adapter->fwreleasenumber[2], adapter->fwreleasenumber[1], 171 adapter->fwreleasenumber[2], adapter->fwreleasenumber[1],
171 adapter->fwreleasenumber[0], adapter->fwreleasenumber[3]); 172 adapter->fwreleasenumber[0], adapter->fwreleasenumber[3]);
172 lbs_deb_cmd("GET_HW_SPEC: MAC addr " MAC_FMT "\n", 173 lbs_deb_cmd("GET_HW_SPEC: MAC addr %s\n",
173 MAC_ARG(hwspec->permanentaddr)); 174 print_mac(mac, hwspec->permanentaddr));
174 lbs_deb_cmd("GET_HW_SPEC: hardware interface 0x%x, hardware spec 0x%04x\n", 175 lbs_deb_cmd("GET_HW_SPEC: hardware interface 0x%x, hardware spec 0x%04x\n",
175 hwspec->hwifversion, hwspec->version); 176 hwspec->hwifversion, hwspec->version);
176 177
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 816f42e4f5b4..cb00b080409e 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -63,6 +63,7 @@ static ssize_t libertas_getscantable(struct file *file, char __user *userbuf,
63 int numscansdone = 0, res; 63 int numscansdone = 0, res;
64 unsigned long addr = get_zeroed_page(GFP_KERNEL); 64 unsigned long addr = get_zeroed_page(GFP_KERNEL);
65 char *buf = (char *)addr; 65 char *buf = (char *)addr;
66 DECLARE_MAC_BUF(mac);
66 struct bss_descriptor * iter_bss; 67 struct bss_descriptor * iter_bss;
67 68
68 pos += snprintf(buf+pos, len-pos, 69 pos += snprintf(buf+pos, len-pos,
@@ -75,9 +76,9 @@ static ssize_t libertas_getscantable(struct file *file, char __user *userbuf,
75 u16 spectrum_mgmt = (iter_bss->capability & WLAN_CAPABILITY_SPECTRUM_MGMT); 76 u16 spectrum_mgmt = (iter_bss->capability & WLAN_CAPABILITY_SPECTRUM_MGMT);
76 77
77 pos += snprintf(buf+pos, len-pos, 78 pos += snprintf(buf+pos, len-pos,
78 "%02u| %03d | %04ld | " MAC_FMT " |", 79 "%02u| %03d | %04ld | %s |",
79 numscansdone, iter_bss->channel, iter_bss->rssi, 80 numscansdone, iter_bss->channel, iter_bss->rssi,
80 MAC_ARG(iter_bss->bssid)); 81 print_mac(mac, iter_bss->bssid));
81 pos += snprintf(buf+pos, len-pos, " %04x-", iter_bss->capability); 82 pos += snprintf(buf+pos, len-pos, " %04x-", iter_bss->capability);
82 pos += snprintf(buf+pos, len-pos, "%c%c%c |", 83 pos += snprintf(buf+pos, len-pos, "%c%c%c |",
83 ibss ? 'A' : 'I', privacy ? 'P' : ' ', 84 ibss ? 'A' : 'I', privacy ? 'P' : ' ',
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c
index 0ad1362b14e2..8dcff00574f3 100644
--- a/drivers/net/wireless/libertas/join.c
+++ b/drivers/net/wireless/libertas/join.c
@@ -293,6 +293,7 @@ int libertas_cmd_80211_authenticate(wlan_private * priv,
293 struct cmd_ds_802_11_authenticate *pauthenticate = &cmd->params.auth; 293 struct cmd_ds_802_11_authenticate *pauthenticate = &cmd->params.auth;
294 int ret = -1; 294 int ret = -1;
295 u8 *bssid = pdata_buf; 295 u8 *bssid = pdata_buf;
296 DECLARE_MAC_BUF(mac);
296 297
297 lbs_deb_enter(LBS_DEB_JOIN); 298 lbs_deb_enter(LBS_DEB_JOIN);
298 299
@@ -319,8 +320,8 @@ int libertas_cmd_80211_authenticate(wlan_private * priv,
319 320
320 memcpy(pauthenticate->macaddr, bssid, ETH_ALEN); 321 memcpy(pauthenticate->macaddr, bssid, ETH_ALEN);
321 322
322 lbs_deb_join("AUTH_CMD: BSSID is : " MAC_FMT " auth=0x%X\n", 323 lbs_deb_join("AUTH_CMD: BSSID is : %s auth=0x%X\n",
323 MAC_ARG(bssid), pauthenticate->authtype); 324 print_mac(mac, bssid), pauthenticate->authtype);
324 ret = 0; 325 ret = 0;
325 326
326out: 327out:
@@ -598,6 +599,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
598 int cmdappendsize = 0; 599 int cmdappendsize = 0;
599 int ret = 0; 600 int ret = 0;
600 u16 ratesize = 0; 601 u16 ratesize = 0;
602 DECLARE_MAC_BUF(mac);
601 603
602 lbs_deb_enter(LBS_DEB_JOIN); 604 lbs_deb_enter(LBS_DEB_JOIN);
603 605
@@ -621,8 +623,9 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
621 623
622 /* information on BSSID descriptor passed to FW */ 624 /* information on BSSID descriptor passed to FW */
623 lbs_deb_join( 625 lbs_deb_join(
624 "ADHOC_J_CMD: BSSID = " MAC_FMT ", SSID = '%s'\n", 626 "ADHOC_J_CMD: BSSID = %s, SSID = '%s'\n",
625 MAC_ARG(join_cmd->bss.bssid), join_cmd->bss.ssid); 627 print_mac(mac, join_cmd->bss.bssid),
628 join_cmd->bss.ssid);
626 629
627 /* failtimeout */ 630 /* failtimeout */
628 join_cmd->failtimeout = cpu_to_le16(MRVDRV_ASSOCIATION_TIME_OUT); 631 join_cmd->failtimeout = cpu_to_le16(MRVDRV_ASSOCIATION_TIME_OUT);
@@ -829,6 +832,7 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
829 struct cmd_ds_802_11_ad_hoc_result *padhocresult; 832 struct cmd_ds_802_11_ad_hoc_result *padhocresult;
830 union iwreq_data wrqu; 833 union iwreq_data wrqu;
831 struct bss_descriptor *bss; 834 struct bss_descriptor *bss;
835 DECLARE_MAC_BUF(mac);
832 836
833 lbs_deb_enter(LBS_DEB_JOIN); 837 lbs_deb_enter(LBS_DEB_JOIN);
834 838
@@ -894,8 +898,8 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
894 898
895 lbs_deb_join("ADHOC_RESP: - Joined/Started Ad Hoc\n"); 899 lbs_deb_join("ADHOC_RESP: - Joined/Started Ad Hoc\n");
896 lbs_deb_join("ADHOC_RESP: channel = %d\n", adapter->curbssparams.channel); 900 lbs_deb_join("ADHOC_RESP: channel = %d\n", adapter->curbssparams.channel);
897 lbs_deb_join("ADHOC_RESP: BSSID = " MAC_FMT "\n", 901 lbs_deb_join("ADHOC_RESP: BSSID = %s\n",
898 MAC_ARG(padhocresult->bssid)); 902 print_mac(mac, padhocresult->bssid));
899 903
900done: 904done:
901 lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); 905 lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index a54171af7b97..5ead08312e1e 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -677,6 +677,7 @@ static void libertas_set_multicast_list(struct net_device *dev)
677 wlan_private *priv = dev->priv; 677 wlan_private *priv = dev->priv;
678 wlan_adapter *adapter = priv->adapter; 678 wlan_adapter *adapter = priv->adapter;
679 int oldpacketfilter; 679 int oldpacketfilter;
680 DECLARE_MAC_BUF(mac);
680 681
681 lbs_deb_enter(LBS_DEB_NET); 682 lbs_deb_enter(LBS_DEB_NET);
682 683
@@ -723,14 +724,9 @@ static void libertas_set_multicast_list(struct net_device *dev)
723 dev->mc_count); 724 dev->mc_count);
724 725
725 for (i = 0; i < dev->mc_count; i++) { 726 for (i = 0; i < dev->mc_count; i++) {
726 lbs_deb_net("Multicast address %d:" 727 lbs_deb_net("Multicast address %d:%s\n",
727 MAC_FMT "\n", i, 728 i, print_mac(mac,
728 adapter->multicastlist[i][0], 729 adapter->multicastlist[i]));
729 adapter->multicastlist[i][1],
730 adapter->multicastlist[i][2],
731 adapter->multicastlist[i][3],
732 adapter->multicastlist[i][4],
733 adapter->multicastlist[i][5]);
734 } 730 }
735 /* send multicast addresses to firmware */ 731 /* send multicast addresses to firmware */
736 libertas_prepare_and_send_command(priv, 732 libertas_prepare_and_send_command(priv,
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index e2e9ebcd8340..8f073ad1957f 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -777,6 +777,7 @@ int wlan_scan_networks(wlan_private * priv,
777#ifdef CONFIG_LIBERTAS_DEBUG 777#ifdef CONFIG_LIBERTAS_DEBUG
778 struct bss_descriptor * iter_bss; 778 struct bss_descriptor * iter_bss;
779 int i = 0; 779 int i = 0;
780 DECLARE_MAC_BUF(mac);
780#endif 781#endif
781 782
782 lbs_deb_enter(LBS_DEB_SCAN); 783 lbs_deb_enter(LBS_DEB_SCAN);
@@ -831,8 +832,8 @@ int wlan_scan_networks(wlan_private * priv,
831 /* Dump the scan table */ 832 /* Dump the scan table */
832 mutex_lock(&adapter->lock); 833 mutex_lock(&adapter->lock);
833 list_for_each_entry (iter_bss, &adapter->network_list, list) { 834 list_for_each_entry (iter_bss, &adapter->network_list, list) {
834 lbs_deb_scan("Scan:(%02d) " MAC_FMT ", RSSI[%03d], SSID[%s]\n", 835 lbs_deb_scan("Scan:(%02d) %s, RSSI[%03d], SSID[%s]\n",
835 i++, MAC_ARG(iter_bss->bssid), (s32) iter_bss->rssi, 836 i++, print_mac(mac, iter_bss->bssid), (s32) iter_bss->rssi,
836 escape_essid(iter_bss->ssid, iter_bss->ssid_len)); 837 escape_essid(iter_bss->ssid, iter_bss->ssid_len));
837 } 838 }
838 mutex_unlock(&adapter->lock); 839 mutex_unlock(&adapter->lock);
@@ -876,6 +877,7 @@ static int libertas_process_bss(struct bss_descriptor * bss,
876 struct ieeetypes_dsparamset *pDS; 877 struct ieeetypes_dsparamset *pDS;
877 struct ieeetypes_cfparamset *pCF; 878 struct ieeetypes_cfparamset *pCF;
878 struct ieeetypes_ibssparamset *pibss; 879 struct ieeetypes_ibssparamset *pibss;
880 DECLARE_MAC_BUF(mac);
879 struct ieeetypes_countryinfoset *pcountryinfo; 881 struct ieeetypes_countryinfoset *pcountryinfo;
880 u8 *pos, *end, *p; 882 u8 *pos, *end, *p;
881 u8 n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0; 883 u8 n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0;
@@ -906,7 +908,7 @@ static int libertas_process_bss(struct bss_descriptor * bss,
906 *bytesleft -= beaconsize; 908 *bytesleft -= beaconsize;
907 909
908 memcpy(bss->bssid, pos, ETH_ALEN); 910 memcpy(bss->bssid, pos, ETH_ALEN);
909 lbs_deb_scan("process_bss: AP BSSID " MAC_FMT "\n", MAC_ARG(bss->bssid)); 911 lbs_deb_scan("process_bss: AP BSSID %s\n", print_mac(mac, bss->bssid));
910 pos += ETH_ALEN; 912 pos += ETH_ALEN;
911 913
912 if ((end - pos) < 12) { 914 if ((end - pos) < 12) {
@@ -1724,6 +1726,7 @@ int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp)
1724 struct bss_descriptor new; 1726 struct bss_descriptor new;
1725 struct bss_descriptor * found = NULL; 1727 struct bss_descriptor * found = NULL;
1726 struct bss_descriptor * oldest = NULL; 1728 struct bss_descriptor * oldest = NULL;
1729 DECLARE_MAC_BUF(mac);
1727 1730
1728 /* Process the data fields and IEs returned for this BSS */ 1731 /* Process the data fields and IEs returned for this BSS */
1729 memset(&new, 0, sizeof (struct bss_descriptor)); 1732 memset(&new, 0, sizeof (struct bss_descriptor));
@@ -1762,9 +1765,8 @@ int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp)
1762 continue; 1765 continue;
1763 } 1766 }
1764 1767
1765 lbs_deb_scan("SCAN_RESP: BSSID = " MAC_FMT "\n", 1768 lbs_deb_scan("SCAN_RESP: BSSID = %s\n",
1766 new.bssid[0], new.bssid[1], new.bssid[2], 1769 print_mac(mac, new.bssid));
1767 new.bssid[3], new.bssid[4], new.bssid[5]);
1768 1770
1769 /* Copy the locally created newbssentry to the scan table */ 1771 /* Copy the locally created newbssentry to the scan table */
1770 memcpy(found, &new, offsetof(struct bss_descriptor, list)); 1772 memcpy(found, &new, offsetof(struct bss_descriptor, list));
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index f8036efd7294..0b2103e0af57 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -1160,7 +1160,7 @@ static int wlan_get_encode(struct net_device *dev,
1160 1160
1161 dwrq->flags |= IW_ENCODE_NOKEY; 1161 dwrq->flags |= IW_ENCODE_NOKEY;
1162 1162
1163 lbs_deb_wext("key: " MAC_FMT ", keylen %d\n", 1163 lbs_deb_wext("key: %02x:%02x:%02x:%02x:%02x:%02x, keylen %d\n",
1164 extra[0], extra[1], extra[2], 1164 extra[0], extra[1], extra[2],
1165 extra[3], extra[4], extra[5], dwrq->length); 1165 extra[3], extra[4], extra[5], dwrq->length);
1166 1166
@@ -1980,13 +1980,14 @@ static int wlan_set_wap(struct net_device *dev, struct iw_request_info *info,
1980 wlan_adapter *adapter = priv->adapter; 1980 wlan_adapter *adapter = priv->adapter;
1981 struct assoc_request * assoc_req; 1981 struct assoc_request * assoc_req;
1982 int ret = 0; 1982 int ret = 0;
1983 DECLARE_MAC_BUF(mac);
1983 1984
1984 lbs_deb_enter(LBS_DEB_WEXT); 1985 lbs_deb_enter(LBS_DEB_WEXT);
1985 1986
1986 if (awrq->sa_family != ARPHRD_ETHER) 1987 if (awrq->sa_family != ARPHRD_ETHER)
1987 return -EINVAL; 1988 return -EINVAL;
1988 1989
1989 lbs_deb_wext("ASSOC: WAP: sa_data " MAC_FMT "\n", MAC_ARG(awrq->sa_data)); 1990 lbs_deb_wext("ASSOC: WAP: sa_data %s\n", print_mac(mac, awrq->sa_data));
1990 1991
1991 mutex_lock(&adapter->lock); 1992 mutex_lock(&adapter->lock);
1992 1993
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
index d8a59afa7178..c2d71afd57e5 100644
--- a/drivers/net/wireless/netwave_cs.c
+++ b/drivers/net/wireless/netwave_cs.c
@@ -737,6 +737,7 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
737 win_req_t req; 737 win_req_t req;
738 memreq_t mem; 738 memreq_t mem;
739 u_char __iomem *ramBase = NULL; 739 u_char __iomem *ramBase = NULL;
740 DECLARE_MAC_BUF(mac);
740 741
741 DEBUG(0, "netwave_pcmcia_config(0x%p)\n", link); 742 DEBUG(0, "netwave_pcmcia_config(0x%p)\n", link);
742 743
@@ -805,12 +806,13 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
805 for (i = 0; i < 6; i++) 806 for (i = 0; i < 6; i++)
806 dev->dev_addr[i] = readb(ramBase + NETWAVE_EREG_PA + i); 807 dev->dev_addr[i] = readb(ramBase + NETWAVE_EREG_PA + i);
807 808
808 printk(KERN_INFO "%s: Netwave: port %#3lx, irq %d, mem %lx id " 809 printk(KERN_INFO "%s: Netwave: port %#3lx, irq %d, mem %lx"
809 "%c%c, hw_addr ", dev->name, dev->base_addr, dev->irq, 810 "id %c%c, hw_addr %s\n",
810 (u_long) ramBase, (int) readb(ramBase+NETWAVE_EREG_NI), 811 dev->name, dev->base_addr, dev->irq,
811 (int) readb(ramBase+NETWAVE_EREG_NI+1)); 812 (u_long) ramBase,
812 for (i = 0; i < 6; i++) 813 (int) readb(ramBase+NETWAVE_EREG_NI),
813 printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); 814 (int) readb(ramBase+NETWAVE_EREG_NI+1),
815 print_mac(mac, dev->dev_addr));
814 816
815 /* get revision words */ 817 /* get revision words */
816 printk(KERN_DEBUG "Netwave_reset: revision %04x %04x\n", 818 printk(KERN_DEBUG "Netwave_reset: revision %04x %04x\n",
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 062286dc8e15..ca6c2da7bc5d 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -2232,6 +2232,7 @@ static int orinoco_init(struct net_device *dev)
2232 struct hermes_idstring nickbuf; 2232 struct hermes_idstring nickbuf;
2233 u16 reclen; 2233 u16 reclen;
2234 int len; 2234 int len;
2235 DECLARE_MAC_BUF(mac);
2235 2236
2236 /* No need to lock, the hw_unavailable flag is already set in 2237 /* No need to lock, the hw_unavailable flag is already set in
2237 * alloc_orinocodev() */ 2238 * alloc_orinocodev() */
@@ -2274,10 +2275,8 @@ static int orinoco_init(struct net_device *dev)
2274 goto out; 2275 goto out;
2275 } 2276 }
2276 2277
2277 printk(KERN_DEBUG "%s: MAC address %02X:%02X:%02X:%02X:%02X:%02X\n", 2278 printk(KERN_DEBUG "%s: MAC address %s\n",
2278 dev->name, dev->dev_addr[0], dev->dev_addr[1], 2279 dev->name, print_mac(mac, dev->dev_addr));
2279 dev->dev_addr[2], dev->dev_addr[3], dev->dev_addr[4],
2280 dev->dev_addr[5]);
2281 2280
2282 /* Get the station name */ 2281 /* Get the station name */
2283 err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CNFOWNNAME, 2282 err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CNFOWNNAME,
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c
index 77ea13bf0c02..6d80ca421cf0 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.c
+++ b/drivers/net/wireless/prism54/isl_ioctl.c
@@ -2029,12 +2029,12 @@ static void
2029format_event(islpci_private *priv, char *dest, const char *str, 2029format_event(islpci_private *priv, char *dest, const char *str,
2030 const struct obj_mlme *mlme, u16 *length, int error) 2030 const struct obj_mlme *mlme, u16 *length, int error)
2031{ 2031{
2032 const u8 *a = mlme->address; 2032 DECLARE_MAC_BUF(mac);
2033 int n = snprintf(dest, IW_CUSTOM_MAX, 2033 int n = snprintf(dest, IW_CUSTOM_MAX,
2034 "%s %s %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X %s (%2.2X)", 2034 "%s %s %s %s (%2.2X)",
2035 str, 2035 str,
2036 ((priv->iw_mode == IW_MODE_MASTER) ? "from" : "to"), 2036 ((priv->iw_mode == IW_MODE_MASTER) ? "from" : "to"),
2037 a[0], a[1], a[2], a[3], a[4], a[5], 2037 print_mac(mac, mlme->address),
2038 (error ? (mlme->code ? " : REJECTED " : " : ACCEPTED ") 2038 (error ? (mlme->code ? " : REJECTED " : " : ACCEPTED ")
2039 : ""), mlme->code); 2039 : ""), mlme->code);
2040 BUG_ON(n > IW_CUSTOM_MAX); 2040 BUG_ON(n > IW_CUSTOM_MAX);
@@ -2105,15 +2105,13 @@ struct ieee80211_beacon_phdr {
2105#define WLAN_EID_GENERIC 0xdd 2105#define WLAN_EID_GENERIC 0xdd
2106static u8 wpa_oid[4] = { 0x00, 0x50, 0xf2, 1 }; 2106static u8 wpa_oid[4] = { 0x00, 0x50, 0xf2, 1 };
2107 2107
2108#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
2109#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
2110
2111static void 2108static void
2112prism54_wpa_bss_ie_add(islpci_private *priv, u8 *bssid, 2109prism54_wpa_bss_ie_add(islpci_private *priv, u8 *bssid,
2113 u8 *wpa_ie, size_t wpa_ie_len) 2110 u8 *wpa_ie, size_t wpa_ie_len)
2114{ 2111{
2115 struct list_head *ptr; 2112 struct list_head *ptr;
2116 struct islpci_bss_wpa_ie *bss = NULL; 2113 struct islpci_bss_wpa_ie *bss = NULL;
2114 DECLARE_MAC_BUF(mac);
2117 2115
2118 if (wpa_ie_len > MAX_WPA_IE_LEN) 2116 if (wpa_ie_len > MAX_WPA_IE_LEN)
2119 wpa_ie_len = MAX_WPA_IE_LEN; 2117 wpa_ie_len = MAX_WPA_IE_LEN;
@@ -2154,8 +2152,8 @@ prism54_wpa_bss_ie_add(islpci_private *priv, u8 *bssid,
2154 bss->wpa_ie_len = wpa_ie_len; 2152 bss->wpa_ie_len = wpa_ie_len;
2155 bss->last_update = jiffies; 2153 bss->last_update = jiffies;
2156 } else { 2154 } else {
2157 printk(KERN_DEBUG "Failed to add BSS WPA entry for " MACSTR 2155 printk(KERN_DEBUG "Failed to add BSS WPA entry for "
2158 "\n", MAC2STR(bssid)); 2156 "%s\n", print_mac(mac, bssid));
2159 } 2157 }
2160 2158
2161 /* expire old entries from WPA list */ 2159 /* expire old entries from WPA list */
@@ -2221,6 +2219,7 @@ prism54_process_bss_data(islpci_private *priv, u32 oid, u8 *addr,
2221{ 2219{
2222 struct ieee80211_beacon_phdr *hdr; 2220 struct ieee80211_beacon_phdr *hdr;
2223 u8 *pos, *end; 2221 u8 *pos, *end;
2222 DECLARE_MAC_BUF(mac);
2224 2223
2225 if (!priv->wpa) 2224 if (!priv->wpa)
2226 return; 2225 return;
@@ -2231,7 +2230,7 @@ prism54_process_bss_data(islpci_private *priv, u32 oid, u8 *addr,
2231 while (pos < end) { 2230 while (pos < end) {
2232 if (pos + 2 + pos[1] > end) { 2231 if (pos + 2 + pos[1] > end) {
2233 printk(KERN_DEBUG "Parsing Beacon/ProbeResp failed " 2232 printk(KERN_DEBUG "Parsing Beacon/ProbeResp failed "
2234 "for " MACSTR "\n", MAC2STR(addr)); 2233 "for %s\n", print_mac(mac, addr));
2235 return; 2234 return;
2236 } 2235 }
2237 if (pos[0] == WLAN_EID_GENERIC && pos[1] >= 4 && 2236 if (pos[0] == WLAN_EID_GENERIC && pos[1] >= 4 &&
@@ -2270,6 +2269,7 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2270 size_t len = 0; /* u16, better? */ 2269 size_t len = 0; /* u16, better? */
2271 u8 *payload = NULL, *pos = NULL; 2270 u8 *payload = NULL, *pos = NULL;
2272 int ret; 2271 int ret;
2272 DECLARE_MAC_BUF(mac);
2273 2273
2274 /* I think all trapable objects are listed here. 2274 /* I think all trapable objects are listed here.
2275 * Some oids have a EX version. The difference is that they are emitted 2275 * Some oids have a EX version. The difference is that they are emitted
@@ -2358,14 +2358,8 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2358 break; 2358 break;
2359 2359
2360 memcpy(&confirm->address, mlmeex->address, ETH_ALEN); 2360 memcpy(&confirm->address, mlmeex->address, ETH_ALEN);
2361 printk(KERN_DEBUG "Authenticate from: address:\t%02x:%02x:%02x:%02x:%02x:%02x\n", 2361 printk(KERN_DEBUG "Authenticate from: address:\t%s\n",
2362 mlmeex->address[0], 2362 print_mac(mac, mlmeex->address));
2363 mlmeex->address[1],
2364 mlmeex->address[2],
2365 mlmeex->address[3],
2366 mlmeex->address[4],
2367 mlmeex->address[5]
2368 );
2369 confirm->id = -1; /* or mlmeex->id ? */ 2363 confirm->id = -1; /* or mlmeex->id ? */
2370 confirm->state = 0; /* not used */ 2364 confirm->state = 0; /* not used */
2371 confirm->code = 0; 2365 confirm->code = 0;
@@ -2410,15 +2404,8 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2410 wpa_ie_len = prism54_wpa_bss_ie_get(priv, mlmeex->address, wpa_ie); 2404 wpa_ie_len = prism54_wpa_bss_ie_get(priv, mlmeex->address, wpa_ie);
2411 2405
2412 if (!wpa_ie_len) { 2406 if (!wpa_ie_len) {
2413 printk(KERN_DEBUG "No WPA IE found from " 2407 printk(KERN_DEBUG "No WPA IE found from address:\t%s\n",
2414 "address:\t%02x:%02x:%02x:%02x:%02x:%02x\n", 2408 print_mac(mac, mlmeex->address));
2415 mlmeex->address[0],
2416 mlmeex->address[1],
2417 mlmeex->address[2],
2418 mlmeex->address[3],
2419 mlmeex->address[4],
2420 mlmeex->address[5]
2421 );
2422 kfree(confirm); 2409 kfree(confirm);
2423 break; 2410 break;
2424 } 2411 }
@@ -2454,15 +2441,8 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2454 wpa_ie_len = prism54_wpa_bss_ie_get(priv, mlmeex->address, wpa_ie); 2441 wpa_ie_len = prism54_wpa_bss_ie_get(priv, mlmeex->address, wpa_ie);
2455 2442
2456 if (!wpa_ie_len) { 2443 if (!wpa_ie_len) {
2457 printk(KERN_DEBUG "No WPA IE found from " 2444 printk(KERN_DEBUG "No WPA IE found from address:\t%s\n",
2458 "address:\t%02x:%02x:%02x:%02x:%02x:%02x\n", 2445 print_mac(mac, mlmeex->address));
2459 mlmeex->address[0],
2460 mlmeex->address[1],
2461 mlmeex->address[2],
2462 mlmeex->address[3],
2463 mlmeex->address[4],
2464 mlmeex->address[5]
2465 );
2466 kfree(confirm); 2446 kfree(confirm);
2467 break; 2447 break;
2468 } 2448 }
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 429bca8d0b5f..f87fe10059ae 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -412,6 +412,7 @@ static int ray_config(struct pcmcia_device *link)
412 memreq_t mem; 412 memreq_t mem;
413 struct net_device *dev = (struct net_device *)link->priv; 413 struct net_device *dev = (struct net_device *)link->priv;
414 ray_dev_t *local = netdev_priv(dev); 414 ray_dev_t *local = netdev_priv(dev);
415 DECLARE_MAC_BUF(mac);
415 416
416 DEBUG(1, "ray_config(0x%p)\n", link); 417 DEBUG(1, "ray_config(0x%p)\n", link);
417 418
@@ -482,10 +483,8 @@ static int ray_config(struct pcmcia_device *link)
482 strcpy(local->node.dev_name, dev->name); 483 strcpy(local->node.dev_name, dev->name);
483 link->dev_node = &local->node; 484 link->dev_node = &local->node;
484 485
485 printk(KERN_INFO "%s: RayLink, irq %d, hw_addr ", 486 printk(KERN_INFO "%s: RayLink, irq %d, hw_addr %s\n",
486 dev->name, dev->irq); 487 dev->name, dev->irq, print_mac(mac, dev->dev_addr));
487 for (i = 0; i < 6; i++)
488 printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n"));
489 488
490 return 0; 489 return 0;
491 490
@@ -2610,6 +2609,7 @@ static int ray_cs_proc_read(char *buf, char **start, off_t offset, int len)
2610 UCHAR *p; 2609 UCHAR *p;
2611 struct freq_hop_element *pfh; 2610 struct freq_hop_element *pfh;
2612 UCHAR c[33]; 2611 UCHAR c[33];
2612 DECLARE_MAC_BUF(mac);
2613 2613
2614 link = this_device; 2614 link = this_device;
2615 if (!link) 2615 if (!link)
@@ -2639,9 +2639,8 @@ static int ray_cs_proc_read(char *buf, char **start, off_t offset, int len)
2639 nettype[local->sparm.b5.a_network_type], c); 2639 nettype[local->sparm.b5.a_network_type], c);
2640 2640
2641 p = local->bss_id; 2641 p = local->bss_id;
2642 len += sprintf(buf + len, 2642 len += sprintf(buf + len, "BSSID = %s\n",
2643 "BSSID = %02x:%02x:%02x:%02x:%02x:%02x\n", 2643 print_mac(mac, p));
2644 p[0],p[1],p[2],p[3],p[4],p[5]);
2645 2644
2646 len += sprintf(buf + len, "Country code = %d\n", 2645 len += sprintf(buf + len, "Country code = %d\n",
2647 local->sparm.b5.a_curr_country_code); 2646 local->sparm.b5.a_curr_country_code);
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 38e2188937c5..398c20105c81 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1362,8 +1362,10 @@ static int rt2400pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
1362 */ 1362 */
1363 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); 1363 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
1364 if (!is_valid_ether_addr(mac)) { 1364 if (!is_valid_ether_addr(mac)) {
1365 DECLARE_MAC_BUF(macbuf);
1366
1365 random_ether_addr(mac); 1367 random_ether_addr(mac);
1366 EEPROM(rt2x00dev, "MAC: " MAC_FMT "\n", MAC_ARG(mac)); 1368 EEPROM(rt2x00dev, "MAC: %s\n", print_mac(macbuf, mac));
1367 } 1369 }
1368 1370
1369 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); 1371 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index f6115c626fa7..e8d63aaab7bc 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1509,8 +1509,11 @@ static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
1509 */ 1509 */
1510 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); 1510 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
1511 if (!is_valid_ether_addr(mac)) { 1511 if (!is_valid_ether_addr(mac)) {
1512 DECLARE_MAC_BUF(macbuf);
1513
1512 random_ether_addr(mac); 1514 random_ether_addr(mac);
1513 EEPROM(rt2x00dev, "MAC: " MAC_FMT "\n", MAC_ARG(mac)); 1515 EEPROM(rt2x00dev, "MAC: %s\n",
1516 print_mac(macbuf, mac));
1514 } 1517 }
1515 1518
1516 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); 1519 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 847bd7f58eed..614600c5510d 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1233,8 +1233,10 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
1233 */ 1233 */
1234 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); 1234 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
1235 if (!is_valid_ether_addr(mac)) { 1235 if (!is_valid_ether_addr(mac)) {
1236 DECLARE_MAC_BUF(macbuf);
1237
1236 random_ether_addr(mac); 1238 random_ether_addr(mac);
1237 EEPROM(rt2x00dev, "MAC: " MAC_FMT "\n", MAC_ARG(mac)); 1239 EEPROM(rt2x00dev, "MAC: %s\n", print_mac(macbuf, mac));
1238 } 1240 }
1239 1241
1240 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); 1242 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 730bed5a1984..09c8c96e2f83 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2019,8 +2019,10 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
2019 */ 2019 */
2020 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); 2020 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
2021 if (!is_valid_ether_addr(mac)) { 2021 if (!is_valid_ether_addr(mac)) {
2022 DECLARE_MAC_BUF(macbuf);
2023
2022 random_ether_addr(mac); 2024 random_ether_addr(mac);
2023 EEPROM(rt2x00dev, "MAC: " MAC_FMT "\n", MAC_ARG(mac)); 2025 EEPROM(rt2x00dev, "MAC: %s\n", print_mac(macbuf, mac));
2024 } 2026 }
2025 2027
2026 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); 2028 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index b047c7c0f9ee..3397881bd63d 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1475,8 +1475,10 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
1475 */ 1475 */
1476 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); 1476 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
1477 if (!is_valid_ether_addr(mac)) { 1477 if (!is_valid_ether_addr(mac)) {
1478 DECLARE_MAC_BUF(macbuf);
1479
1478 random_ether_addr(mac); 1480 random_ether_addr(mac);
1479 EEPROM(rt2x00dev, "MAC: " MAC_FMT "\n", MAC_ARG(mac)); 1481 EEPROM(rt2x00dev, "MAC: %s\n", print_mac(macbuf, mac));
1480 } 1482 }
1481 1483
1482 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); 1484 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index 7dbf11e30db3..bf9f0cc5a645 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -574,6 +574,7 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
574 struct ieee80211_channel *channel; 574 struct ieee80211_channel *channel;
575 u16 txpwr, reg; 575 u16 txpwr, reg;
576 int err, i; 576 int err, i;
577 DECLARE_MAC_BUF(mac);
577 578
578 dev = ieee80211_alloc_hw(sizeof(*priv), &rtl8187_ops); 579 dev = ieee80211_alloc_hw(sizeof(*priv), &rtl8187_ops);
579 if (!dev) { 580 if (!dev) {
@@ -681,8 +682,8 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
681 goto err_free_dev; 682 goto err_free_dev;
682 } 683 }
683 684
684 printk(KERN_INFO "%s: hwaddr " MAC_FMT ", rtl8187 V%d + %s\n", 685 printk(KERN_INFO "%s: hwaddr %s, rtl8187 V%d + %s\n",
685 wiphy_name(dev->wiphy), MAC_ARG(dev->wiphy->perm_addr), 686 wiphy_name(dev->wiphy), print_mac(mac, dev->wiphy->perm_addr),
686 priv->asic_rev, priv->rf_init == rtl8225_rf_init ? 687 priv->asic_rev, priv->rf_init == rtl8225_rf_init ?
687 "rtl8225" : "rtl8225z2"); 688 "rtl8225" : "rtl8225z2");
688 689
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c
index 33ed9fe95f3d..a1f8a1687842 100644
--- a/drivers/net/wireless/wavelan.c
+++ b/drivers/net/wireless/wavelan.c
@@ -880,6 +880,8 @@ static void wv_82586_reconfig(struct net_device * dev)
880 */ 880 */
881static void wv_psa_show(psa_t * p) 881static void wv_psa_show(psa_t * p)
882{ 882{
883 DECLARE_MAC_BUF(mac);
884
883 printk(KERN_DEBUG "##### WaveLAN PSA contents: #####\n"); 885 printk(KERN_DEBUG "##### WaveLAN PSA contents: #####\n");
884 printk(KERN_DEBUG "psa_io_base_addr_1: 0x%02X %02X %02X %02X\n", 886 printk(KERN_DEBUG "psa_io_base_addr_1: 0x%02X %02X %02X %02X\n",
885 p->psa_io_base_addr_1, 887 p->psa_io_base_addr_1,
@@ -891,22 +893,13 @@ static void wv_psa_show(psa_t * p)
891 printk(KERN_DEBUG "psa_holi_params: 0x%02x, ", p->psa_holi_params); 893 printk(KERN_DEBUG "psa_holi_params: 0x%02x, ", p->psa_holi_params);
892 printk("psa_int_req_no: %d\n", p->psa_int_req_no); 894 printk("psa_int_req_no: %d\n", p->psa_int_req_no);
893#ifdef DEBUG_SHOW_UNUSED 895#ifdef DEBUG_SHOW_UNUSED
894 printk(KERN_DEBUG 896 printk(KERN_DEBUG "psa_unused0[]: %s\n",
895 "psa_unused0[]: %02X:%02X:%02X:%02X:%02X:%02X:%02X\n", 897 print_mac(mac, p->psa_unused0));
896 p->psa_unused0[0], p->psa_unused0[1], p->psa_unused0[2],
897 p->psa_unused0[3], p->psa_unused0[4], p->psa_unused0[5],
898 p->psa_unused0[6]);
899#endif /* DEBUG_SHOW_UNUSED */ 898#endif /* DEBUG_SHOW_UNUSED */
900 printk(KERN_DEBUG 899 printk(KERN_DEBUG "psa_univ_mac_addr[]: %s\n",
901 "psa_univ_mac_addr[]: %02x:%02x:%02x:%02x:%02x:%02x\n", 900 print_mac(mac, p->psa_univ_mac_addr));
902 p->psa_univ_mac_addr[0], p->psa_univ_mac_addr[1], 901 printk(KERN_DEBUG "psa_local_mac_addr[]: %s\n",
903 p->psa_univ_mac_addr[2], p->psa_univ_mac_addr[3], 902 print_mac(mac, p->psa_local_mac_addr));
904 p->psa_univ_mac_addr[4], p->psa_univ_mac_addr[5]);
905 printk(KERN_DEBUG
906 "psa_local_mac_addr[]: %02x:%02x:%02x:%02x:%02x:%02x\n",
907 p->psa_local_mac_addr[0], p->psa_local_mac_addr[1],
908 p->psa_local_mac_addr[2], p->psa_local_mac_addr[3],
909 p->psa_local_mac_addr[4], p->psa_local_mac_addr[5]);
910 printk(KERN_DEBUG "psa_univ_local_sel: %d, ", 903 printk(KERN_DEBUG "psa_univ_local_sel: %d, ",
911 p->psa_univ_local_sel); 904 p->psa_univ_local_sel);
912 printk("psa_comp_number: %d, ", p->psa_comp_number); 905 printk("psa_comp_number: %d, ", p->psa_comp_number);
@@ -1248,14 +1241,14 @@ static inline void wv_packet_info(u8 * p, /* Packet to dump */
1248{ /* Name of the function */ 1241{ /* Name of the function */
1249 int i; 1242 int i;
1250 int maxi; 1243 int maxi;
1244 DECLARE_MAC_BUF(mac);
1251 1245
1252 printk(KERN_DEBUG 1246 printk(KERN_DEBUG
1253 "%s: %s(): dest %02X:%02X:%02X:%02X:%02X:%02X, length %d\n", 1247 "%s: %s(): dest %s, length %d\n",
1254 msg1, msg2, p[0], p[1], p[2], p[3], p[4], p[5], length); 1248 msg1, msg2, print_mac(mac, p), length);
1255 printk(KERN_DEBUG 1249 printk(KERN_DEBUG
1256 "%s: %s(): src %02X:%02X:%02X:%02X:%02X:%02X, type 0x%02X%02X\n", 1250 "%s: %s(): src %s, type 0x%02X%02X\n",
1257 msg1, msg2, p[6], p[7], p[8], p[9], p[10], p[11], p[12], 1251 msg1, msg2, print_mac(mac, &p[6]), p[12], p[13]);
1258 p[13]);
1259 1252
1260#ifdef DEBUG_PACKET_DUMP 1253#ifdef DEBUG_PACKET_DUMP
1261 1254
@@ -1286,7 +1279,9 @@ static void wv_init_info(struct net_device * dev)
1286 short ioaddr = dev->base_addr; 1279 short ioaddr = dev->base_addr;
1287 net_local *lp = (net_local *) dev->priv; 1280 net_local *lp = (net_local *) dev->priv;
1288 psa_t psa; 1281 psa_t psa;
1289 int i; 1282#ifdef DEBUG_BASIC_SHOW
1283 DECLARE_MAC_BUF(mac);
1284#endif
1290 1285
1291 /* Read the parameter storage area */ 1286 /* Read the parameter storage area */
1292 psa_read(ioaddr, lp->hacr, 0, (unsigned char *) &psa, sizeof(psa)); 1287 psa_read(ioaddr, lp->hacr, 0, (unsigned char *) &psa, sizeof(psa));
@@ -1303,10 +1298,8 @@ static void wv_init_info(struct net_device * dev)
1303 1298
1304#ifdef DEBUG_BASIC_SHOW 1299#ifdef DEBUG_BASIC_SHOW
1305 /* Now, let's go for the basic stuff. */ 1300 /* Now, let's go for the basic stuff. */
1306 printk(KERN_NOTICE "%s: WaveLAN at %#x,", dev->name, ioaddr); 1301 printk(KERN_NOTICE "%s: WaveLAN at %#x, %s, IRQ %d",
1307 for (i = 0; i < WAVELAN_ADDR_SIZE; i++) 1302 dev->name, ioaddr, print_mac(mac, dev->dev_addr), dev->irq);
1308 printk("%s%02X", (i == 0) ? " " : ":", dev->dev_addr[i]);
1309 printk(", IRQ %d", dev->irq);
1310 1303
1311 /* Print current network ID. */ 1304 /* Print current network ID. */
1312 if (psa.psa_nwid_select) 1305 if (psa.psa_nwid_select)
@@ -3596,15 +3589,15 @@ static void wv_82586_config(struct net_device * dev)
3596 WAVELAN_ADDR_SIZE >> 1); 3589 WAVELAN_ADDR_SIZE >> 1);
3597 3590
3598#ifdef DEBUG_CONFIG_INFO 3591#ifdef DEBUG_CONFIG_INFO
3592 {
3593 DECLARE_MAC_BUF(mac);
3599 printk(KERN_DEBUG 3594 printk(KERN_DEBUG
3600 "%s: wv_82586_config(): set %d multicast addresses:\n", 3595 "%s: wv_82586_config(): set %d multicast addresses:\n",
3601 dev->name, lp->mc_count); 3596 dev->name, lp->mc_count);
3602 for (dmi = dev->mc_list; dmi; dmi = dmi->next) 3597 for (dmi = dev->mc_list; dmi; dmi = dmi->next)
3603 printk(KERN_DEBUG 3598 printk(KERN_DEBUG " %s\n",
3604 " %02x:%02x:%02x:%02x:%02x:%02x\n", 3599 print_mac(mac, dmi->dmi_addr));
3605 dmi->dmi_addr[0], dmi->dmi_addr[1], 3600 }
3606 dmi->dmi_addr[2], dmi->dmi_addr[3],
3607 dmi->dmi_addr[4], dmi->dmi_addr[5]);
3608#endif 3601#endif
3609 } 3602 }
3610 3603
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index 9b7f44957869..577c647824fe 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -1042,6 +1042,7 @@ wv_82593_reconfig(struct net_device * dev)
1042static void 1042static void
1043wv_psa_show(psa_t * p) 1043wv_psa_show(psa_t * p)
1044{ 1044{
1045 DECLARE_MAC_BUF(mac);
1045 printk(KERN_DEBUG "##### wavelan psa contents: #####\n"); 1046 printk(KERN_DEBUG "##### wavelan psa contents: #####\n");
1046 printk(KERN_DEBUG "psa_io_base_addr_1: 0x%02X %02X %02X %02X\n", 1047 printk(KERN_DEBUG "psa_io_base_addr_1: 0x%02X %02X %02X %02X\n",
1047 p->psa_io_base_addr_1, 1048 p->psa_io_base_addr_1,
@@ -1055,29 +1056,13 @@ wv_psa_show(psa_t * p)
1055 printk(KERN_DEBUG "psa_holi_params: 0x%02x, ", p->psa_holi_params); 1056 printk(KERN_DEBUG "psa_holi_params: 0x%02x, ", p->psa_holi_params);
1056 printk("psa_int_req_no: %d\n", p->psa_int_req_no); 1057 printk("psa_int_req_no: %d\n", p->psa_int_req_no);
1057#ifdef DEBUG_SHOW_UNUSED 1058#ifdef DEBUG_SHOW_UNUSED
1058 printk(KERN_DEBUG "psa_unused0[]: %02X:%02X:%02X:%02X:%02X:%02X:%02X\n", 1059 printk(KERN_DEBUG "psa_unused0[]: %s\n",
1059 p->psa_unused0[0], 1060 print_mac(mac, p->psa_unused0));
1060 p->psa_unused0[1],
1061 p->psa_unused0[2],
1062 p->psa_unused0[3],
1063 p->psa_unused0[4],
1064 p->psa_unused0[5],
1065 p->psa_unused0[6]);
1066#endif /* DEBUG_SHOW_UNUSED */ 1061#endif /* DEBUG_SHOW_UNUSED */
1067 printk(KERN_DEBUG "psa_univ_mac_addr[]: %02x:%02x:%02x:%02x:%02x:%02x\n", 1062 printk(KERN_DEBUG "psa_univ_mac_addr[]: %s\n",
1068 p->psa_univ_mac_addr[0], 1063 print_mac(mac, p->psa_univ_mac_addr));
1069 p->psa_univ_mac_addr[1], 1064 printk(KERN_DEBUG "psa_local_mac_addr[]: %s\n",
1070 p->psa_univ_mac_addr[2], 1065 print_mac(mac, p->psa_local_mac_addr));
1071 p->psa_univ_mac_addr[3],
1072 p->psa_univ_mac_addr[4],
1073 p->psa_univ_mac_addr[5]);
1074 printk(KERN_DEBUG "psa_local_mac_addr[]: %02x:%02x:%02x:%02x:%02x:%02x\n",
1075 p->psa_local_mac_addr[0],
1076 p->psa_local_mac_addr[1],
1077 p->psa_local_mac_addr[2],
1078 p->psa_local_mac_addr[3],
1079 p->psa_local_mac_addr[4],
1080 p->psa_local_mac_addr[5]);
1081 printk(KERN_DEBUG "psa_univ_local_sel: %d, ", p->psa_univ_local_sel); 1066 printk(KERN_DEBUG "psa_univ_local_sel: %d, ", p->psa_univ_local_sel);
1082 printk("psa_comp_number: %d, ", p->psa_comp_number); 1067 printk("psa_comp_number: %d, ", p->psa_comp_number);
1083 printk("psa_thr_pre_set: 0x%02x\n", p->psa_thr_pre_set); 1068 printk("psa_thr_pre_set: 0x%02x\n", p->psa_thr_pre_set);
@@ -1277,11 +1262,12 @@ wv_packet_info(u_char * p, /* Packet to dump */
1277{ 1262{
1278 int i; 1263 int i;
1279 int maxi; 1264 int maxi;
1265 DECLARE_MAC_BUF(mac);
1280 1266
1281 printk(KERN_DEBUG "%s: %s(): dest %02X:%02X:%02X:%02X:%02X:%02X, length %d\n", 1267 printk(KERN_DEBUG "%s: %s(): dest %s, length %d\n",
1282 msg1, msg2, p[0], p[1], p[2], p[3], p[4], p[5], length); 1268 msg1, msg2, print_mac(mac, p), length);
1283 printk(KERN_DEBUG "%s: %s(): src %02X:%02X:%02X:%02X:%02X:%02X, type 0x%02X%02X\n", 1269 printk(KERN_DEBUG "%s: %s(): src %s, type 0x%02X%02X\n",
1284 msg1, msg2, p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13]); 1270 msg1, msg2, print_mac(mac, &p[6]), p[12], p[13]);
1285 1271
1286#ifdef DEBUG_PACKET_DUMP 1272#ifdef DEBUG_PACKET_DUMP
1287 1273
@@ -1312,7 +1298,7 @@ wv_init_info(struct net_device * dev)
1312{ 1298{
1313 kio_addr_t base = dev->base_addr; 1299 kio_addr_t base = dev->base_addr;
1314 psa_t psa; 1300 psa_t psa;
1315 int i; 1301 DECLARE_MAC_BUF(mac);
1316 1302
1317 /* Read the parameter storage area */ 1303 /* Read the parameter storage area */
1318 psa_read(dev, 0, (unsigned char *) &psa, sizeof(psa)); 1304 psa_read(dev, 0, (unsigned char *) &psa, sizeof(psa));
@@ -1329,10 +1315,10 @@ wv_init_info(struct net_device * dev)
1329 1315
1330#ifdef DEBUG_BASIC_SHOW 1316#ifdef DEBUG_BASIC_SHOW
1331 /* Now, let's go for the basic stuff */ 1317 /* Now, let's go for the basic stuff */
1332 printk(KERN_NOTICE "%s: WaveLAN: port %#lx, irq %d, hw_addr", 1318 printk(KERN_NOTICE "%s: WaveLAN: port %#lx, irq %d, "
1333 dev->name, base, dev->irq); 1319 "hw_addr %s",
1334 for(i = 0; i < WAVELAN_ADDR_SIZE; i++) 1320 dev->name, base, dev->irq,
1335 printk("%s%02X", (i == 0) ? " " : ":", dev->dev_addr[i]); 1321 print_mac(mac, dev->dev_addr));
1336 1322
1337 /* Print current network id */ 1323 /* Print current network id */
1338 if(psa.psa_nwid_select) 1324 if(psa.psa_nwid_select)
@@ -3691,12 +3677,12 @@ wv_82593_config(struct net_device * dev)
3691 int addrs_len = WAVELAN_ADDR_SIZE * lp->mc_count; 3677 int addrs_len = WAVELAN_ADDR_SIZE * lp->mc_count;
3692 3678
3693#ifdef DEBUG_CONFIG_INFO 3679#ifdef DEBUG_CONFIG_INFO
3680 DECLARE_MAC_BUF(mac);
3694 printk(KERN_DEBUG "%s: wv_hw_config(): set %d multicast addresses:\n", 3681 printk(KERN_DEBUG "%s: wv_hw_config(): set %d multicast addresses:\n",
3695 dev->name, lp->mc_count); 3682 dev->name, lp->mc_count);
3696 for(dmi=dev->mc_list; dmi; dmi=dmi->next) 3683 for(dmi=dev->mc_list; dmi; dmi=dmi->next)
3697 printk(KERN_DEBUG " %02x:%02x:%02x:%02x:%02x:%02x\n", 3684 printk(KERN_DEBUG " %s\n",
3698 dmi->dmi_addr[0], dmi->dmi_addr[1], dmi->dmi_addr[2], 3685 print_mac(mac, dmi->dmi_addr));
3699 dmi->dmi_addr[3], dmi->dmi_addr[4], dmi->dmi_addr[5] );
3700#endif 3686#endif
3701 3687
3702 /* Initialize adapter's ethernet multicast addresses */ 3688 /* Initialize adapter's ethernet multicast addresses */
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 2690f291e3f7..42a36b3f3ff7 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -860,11 +860,10 @@ static int wl3501_esbq_confirm(struct wl3501_card *this)
860static void wl3501_online(struct net_device *dev) 860static void wl3501_online(struct net_device *dev)
861{ 861{
862 struct wl3501_card *this = netdev_priv(dev); 862 struct wl3501_card *this = netdev_priv(dev);
863 DECLARE_MAC_BUF(mac);
863 864
864 printk(KERN_INFO "%s: Wireless LAN online. BSSID: " 865 printk(KERN_INFO "%s: Wireless LAN online. BSSID: %s\n",
865 "%02X %02X %02X %02X %02X %02X\n", dev->name, 866 dev->name, print_mac(mac, this->bssid));
866 this->bssid[0], this->bssid[1], this->bssid[2],
867 this->bssid[3], this->bssid[4], this->bssid[5]);
868 netif_wake_queue(dev); 867 netif_wake_queue(dev);
869} 868}
870 869
@@ -1966,6 +1965,7 @@ static int wl3501_config(struct pcmcia_device *link)
1966 struct net_device *dev = link->priv; 1965 struct net_device *dev = link->priv;
1967 int i = 0, j, last_fn, last_ret; 1966 int i = 0, j, last_fn, last_ret;
1968 struct wl3501_card *this; 1967 struct wl3501_card *this;
1968 DECLARE_MAC_BUF(mac);
1969 1969
1970 /* Try allocating IO ports. This tries a few fixed addresses. If you 1970 /* Try allocating IO ports. This tries a few fixed addresses. If you
1971 * want, you can also read the card's config table to pick addresses -- 1971 * want, you can also read the card's config table to pick addresses --
@@ -2019,14 +2019,14 @@ static int wl3501_config(struct pcmcia_device *link)
2019 } 2019 }
2020 strcpy(this->node.dev_name, dev->name); 2020 strcpy(this->node.dev_name, dev->name);
2021 2021
2022 /* print probe information */ 2022 for (i = 0; i < 6; i++)
2023 printk(KERN_INFO "%s: wl3501 @ 0x%3.3x, IRQ %d, MAC addr in flash ROM:",
2024 dev->name, this->base_addr, (int)dev->irq);
2025 for (i = 0; i < 6; i++) {
2026 dev->dev_addr[i] = ((char *)&this->mac_addr)[i]; 2023 dev->dev_addr[i] = ((char *)&this->mac_addr)[i];
2027 printk("%c%02x", i ? ':' : ' ', dev->dev_addr[i]); 2024
2028 } 2025 /* print probe information */
2029 printk("\n"); 2026 printk(KERN_INFO "%s: wl3501 @ 0x%3.3x, IRQ %d, "
2027 "MAC addr in flash ROM:%s\n",
2028 dev->name, this->base_addr, (int)dev->irq,
2029 print_mac(mac, dev->dev_addr));
2030 /* 2030 /*
2031 * Initialize card parameters - added by jss 2031 * Initialize card parameters - added by jss
2032 */ 2032 */
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c
index 495904218b1b..750c0f99e86f 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.c
+++ b/drivers/net/wireless/zd1211rw/zd_chip.c
@@ -377,6 +377,7 @@ int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr)
377 [0] = { .addr = CR_MAC_ADDR_P1 }, 377 [0] = { .addr = CR_MAC_ADDR_P1 },
378 [1] = { .addr = CR_MAC_ADDR_P2 }, 378 [1] = { .addr = CR_MAC_ADDR_P2 },
379 }; 379 };
380 DECLARE_MAC_BUF(mac);
380 381
381 reqs[0].value = (mac_addr[3] << 24) 382 reqs[0].value = (mac_addr[3] << 24)
382 | (mac_addr[2] << 16) 383 | (mac_addr[2] << 16)
@@ -386,7 +387,7 @@ int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr)
386 | mac_addr[4]; 387 | mac_addr[4];
387 388
388 dev_dbg_f(zd_chip_dev(chip), 389 dev_dbg_f(zd_chip_dev(chip),
389 "mac addr " MAC_FMT "\n", MAC_ARG(mac_addr)); 390 "mac addr %s\n", print_mac(mac, mac_addr));
390 391
391 mutex_lock(&chip->mutex); 392 mutex_lock(&chip->mutex);
392 r = zd_iowrite32a_locked(chip, reqs, ARRAY_SIZE(reqs)); 393 r = zd_iowrite32a_locked(chip, reqs, ARRAY_SIZE(reqs));
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 451308d7095d..06b342b39792 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -289,12 +289,13 @@ int zd_mac_set_mac_address(struct net_device *netdev, void *p)
289 struct sockaddr *addr = p; 289 struct sockaddr *addr = p;
290 struct zd_mac *mac = zd_netdev_mac(netdev); 290 struct zd_mac *mac = zd_netdev_mac(netdev);
291 struct zd_chip *chip = &mac->chip; 291 struct zd_chip *chip = &mac->chip;
292 DECLARE_MAC_BUF(mac2);
292 293
293 if (!is_valid_ether_addr(addr->sa_data)) 294 if (!is_valid_ether_addr(addr->sa_data))
294 return -EADDRNOTAVAIL; 295 return -EADDRNOTAVAIL;
295 296
296 dev_dbg_f(zd_mac_dev(mac), 297 dev_dbg_f(zd_mac_dev(mac),
297 "Setting MAC to " MAC_FMT "\n", MAC_ARG(addr->sa_data)); 298 "Setting MAC to %s\n", print_mac(mac2, addr->sa_data));
298 299
299 if (netdev->flags & IFF_UP) { 300 if (netdev->flags & IFF_UP) {
300 r = zd_write_mac_addr(chip, addr->sa_data); 301 r = zd_write_mac_addr(chip, addr->sa_data);
@@ -329,6 +330,7 @@ void zd_mac_set_multicast_list(struct net_device *dev)
329 struct zd_mc_hash hash; 330 struct zd_mc_hash hash;
330 struct dev_mc_list *mc; 331 struct dev_mc_list *mc;
331 unsigned long flags; 332 unsigned long flags;
333 DECLARE_MAC_BUF(mac2);
332 334
333 if (dev->flags & (IFF_PROMISC|IFF_ALLMULTI) || 335 if (dev->flags & (IFF_PROMISC|IFF_ALLMULTI) ||
334 ieee->iw_mode == IW_MODE_MONITOR) { 336 ieee->iw_mode == IW_MODE_MONITOR) {
@@ -336,8 +338,8 @@ void zd_mac_set_multicast_list(struct net_device *dev)
336 } else { 338 } else {
337 zd_mc_clear(&hash); 339 zd_mc_clear(&hash);
338 for (mc = dev->mc_list; mc; mc = mc->next) { 340 for (mc = dev->mc_list; mc; mc = mc->next) {
339 dev_dbg_f(zd_mac_dev(mac), "mc addr " MAC_FMT "\n", 341 dev_dbg_f(zd_mac_dev(mac), "mc addr %s\n",
340 MAC_ARG(mc->dmi_addr)); 342 print_mac(mac2, mc->dmi_addr));
341 zd_mc_add_addr(&hash, mc->dmi_addr); 343 zd_mc_add_addr(&hash, mc->dmi_addr);
342 } 344 }
343 } 345 }