diff options
author | Joe Perches <joe@perches.com> | 2007-10-03 20:59:30 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:42 -0400 |
commit | 0795af5729b18218767fab27c44b1384f72dc9ad (patch) | |
tree | 67c16df84aa6ec219340b8ea1b5cfb0e8150a216 /drivers/net/wireless/hostap | |
parent | 95ea36275f3c9a1d3d04c217b4b576c657c4e70e (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 'drivers/net/wireless/hostap')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_80211_rx.c | 49 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_80211_tx.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ap.c | 198 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_common.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_info.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ioctl.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_main.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_proc.c | 15 |
9 files changed, 204 insertions, 147 deletions
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 | |||
534 | hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr, | 536 | hostap_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) | |||
94 | static void ap_sta_hash_del(struct ap_data *ap, struct sta_info *sta) | 94 | static 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 | ||
115 | static void ap_free_sta(struct ap_data *ap, struct sta_info *sta) | 117 | static 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) | |||
2871 | static void hostap_update_sta_ps2(local_info_t *local, struct sta_info *sta, | 2898 | static 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) | |||
530 | void hostap_dump_rx_header(const char *name, const struct hfa384x_rx_frame *rx) | 530 | void 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) | |||
562 | void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx) | 565 | void 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; |