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