[NET]: Undo code bloat in hot paths due to print_mac().

If print_mac() is used inside of a pr_debug() the compiler
can't see that the call is redundant so still performs it
even of pr_debug() ends up being a nop.

So don't use print_mac() in such cases in hot code paths,
use MAC_FMT et al. instead.

As noted by Joe Perches, pr_debug() could be modified to
handle this better, but that is a change to an interface
used by the entire kernel and thus needs to be validated
carefully. This here is thus the less risky fix for
2.6.25

Signed-off-by: David S. Miller <davem@davemloft.net>

+225 -134
+5 -6
drivers/net/starfire.c
··· 1472 1472 #ifndef final_version /* Remove after testing. */ 1473 1473 /* You will want this info for the initial debug. */ 1474 1474 if (debug > 5) { 1475 - DECLARE_MAC_BUF(mac); 1476 - DECLARE_MAC_BUF(mac2); 1477 - 1478 - printk(KERN_DEBUG " Rx data %s %s" 1475 + printk(KERN_DEBUG " Rx data " MAC_FMT " " MAC_FMT 1479 1476 " %2.2x%2.2x.\n", 1480 - print_mac(mac, &skb->data[0]), 1481 - print_mac(mac2, &skb->data[6]), 1477 + skb->data[0], skb->data[1], skb->data[2], 1478 + skb->data[3], skb->data[4], skb->data[5], 1479 + skb->data[6], skb->data[7], skb->data[8], 1480 + skb->data[9], skb->data[10], skb->data[11], 1482 1481 skb->data[12], skb->data[13]); 1483 1482 } 1484 1483 #endif
+10 -5
drivers/net/tokenring/olympic.c
··· 1438 1438 1439 1439 if (olympic_priv->olympic_network_monitor) { 1440 1440 struct trh_hdr *mac_hdr; 1441 - DECLARE_MAC_BUF(mac); 1442 1441 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name); 1443 1442 mac_hdr = tr_hdr(mac_frame); 1444 - printk(KERN_WARNING "%s: MAC Frame Dest. Addr: %s\n", 1445 - dev->name, print_mac(mac, mac_hdr->daddr)); 1446 - printk(KERN_WARNING "%s: MAC Frame Srce. Addr: %s\n", 1447 - dev->name, print_mac(mac, mac_hdr->saddr)); 1443 + printk(KERN_WARNING "%s: MAC Frame Dest. Addr: " 1444 + MAC_FMT " \n", dev->name, 1445 + mac_hdr->daddr[0], mac_hdr->daddr[1], 1446 + mac_hdr->daddr[2], mac_hdr->daddr[3], 1447 + mac_hdr->daddr[4], mac_hdr->daddr[5]); 1448 + printk(KERN_WARNING "%s: MAC Frame Srce. Addr: " 1449 + MAC_FMT " \n", dev->name, 1450 + mac_hdr->saddr[0], mac_hdr->saddr[1], 1451 + mac_hdr->saddr[2], mac_hdr->saddr[3], 1452 + mac_hdr->saddr[4], mac_hdr->saddr[5]); 1448 1453 } 1449 1454 netif_rx(mac_frame); 1450 1455 dev->last_rx = jiffies;
+3 -2
drivers/net/virtio_net.c
··· 234 234 struct scatterlist sg[1+MAX_SKB_FRAGS]; 235 235 struct virtio_net_hdr *hdr; 236 236 const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest; 237 - DECLARE_MAC_BUF(mac); 238 237 239 238 sg_init_table(sg, 1+MAX_SKB_FRAGS); 240 239 241 - pr_debug("%s: xmit %p %s\n", dev->name, skb, print_mac(mac, dest)); 240 + pr_debug("%s: xmit %p " MAC_FMT "\n", dev->name, skb, 241 + dest[0], dest[1], dest[2], 242 + dest[3], dest[4], dest[5]); 242 243 243 244 /* Encode metadata header at front. */ 244 245 hdr = skb_vnet_hdr(skb);
+24 -15
drivers/net/wireless/hostap/hostap_80211_rx.c
··· 635 635 { 636 636 struct ieee80211_hdr_4addr *hdr; 637 637 int res, hdrlen; 638 - DECLARE_MAC_BUF(mac); 639 638 640 639 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) 641 640 return 0; ··· 646 647 strcmp(crypt->ops->name, "TKIP") == 0) { 647 648 if (net_ratelimit()) { 648 649 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " 649 - "received packet from %s\n", 650 - local->dev->name, print_mac(mac, hdr->addr2)); 650 + "received packet from " MAC_FMT "\n", 651 + local->dev->name, 652 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 653 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); 651 654 } 652 655 return -1; 653 656 } ··· 658 657 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); 659 658 atomic_dec(&crypt->refcnt); 660 659 if (res < 0) { 661 - printk(KERN_DEBUG "%s: decryption failed (SA=%s" 660 + printk(KERN_DEBUG "%s: decryption failed (SA=" MAC_FMT 662 661 ") res=%d\n", 663 - local->dev->name, print_mac(mac, hdr->addr2), res); 662 + local->dev->name, 663 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 664 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], 665 + res); 664 666 local->comm_tallies.rx_discards_wep_undecryptable++; 665 667 return -1; 666 668 } ··· 725 721 struct ieee80211_crypt_data *crypt = NULL; 726 722 void *sta = NULL; 727 723 int keyidx = 0; 728 - DECLARE_MAC_BUF(mac); 729 724 730 725 iface = netdev_priv(dev); 731 726 local = iface->local; ··· 801 798 * frames silently instead of filling system log with 802 799 * these reports. */ 803 800 printk(KERN_DEBUG "%s: WEP decryption failed (not set)" 804 - " (SA=%s)\n", 805 - local->dev->name, print_mac(mac, hdr->addr2)); 801 + " (SA=" MAC_FMT ")\n", 802 + local->dev->name, 803 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 804 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); 806 805 #endif 807 806 local->comm_tallies.rx_discards_wep_undecryptable++; 808 807 goto rx_dropped; ··· 818 813 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) 819 814 { 820 815 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " 821 - "from %s\n", dev->name, 822 - print_mac(mac, hdr->addr2)); 816 + "from " MAC_FMT "\n", dev->name, 817 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 818 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); 823 819 /* TODO: could inform hostapd about this so that it 824 820 * could send auth failure report */ 825 821 goto rx_dropped; ··· 988 982 "unencrypted EAPOL frame\n", local->dev->name); 989 983 } else { 990 984 printk(KERN_DEBUG "%s: encryption configured, but RX " 991 - "frame not encrypted (SA=%s)\n", 992 - local->dev->name, print_mac(mac, hdr->addr2)); 985 + "frame not encrypted (SA=" MAC_FMT ")\n", 986 + local->dev->name, 987 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 988 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); 993 989 goto rx_dropped; 994 990 } 995 991 } ··· 1000 992 !hostap_is_eapol_frame(local, skb)) { 1001 993 if (net_ratelimit()) { 1002 994 printk(KERN_DEBUG "%s: dropped unencrypted RX data " 1003 - "frame from %s" 1004 - " (drop_unencrypted=1)\n", 1005 - dev->name, print_mac(mac, hdr->addr2)); 995 + "frame from " MAC_FMT " (drop_unencrypted=1)\n", 996 + dev->name, 997 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 998 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); 1006 999 } 1007 1000 goto rx_dropped; 1008 1001 }
+4 -3
drivers/net/wireless/hostap/hostap_80211_tx.c
··· 314 314 struct ieee80211_hdr_4addr *hdr; 315 315 u16 fc; 316 316 int prefix_len, postfix_len, hdr_len, res; 317 - DECLARE_MAC_BUF(mac); 318 317 319 318 iface = netdev_priv(skb->dev); 320 319 local = iface->local; ··· 328 329 hdr = (struct ieee80211_hdr_4addr *) skb->data; 329 330 if (net_ratelimit()) { 330 331 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " 331 - "TX packet to %s\n", 332 - local->dev->name, print_mac(mac, hdr->addr1)); 332 + "TX packet to " MAC_FMT "\n", 333 + local->dev->name, 334 + hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], 335 + hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]); 333 336 } 334 337 kfree_skb(skb); 335 338 return NULL;
+127 -76
drivers/net/wireless/hostap/hostap_ap.c
··· 632 632 __le16 *pos; 633 633 struct sta_info *sta = NULL; 634 634 char *txt = NULL; 635 - DECLARE_MAC_BUF(mac); 636 635 637 636 if (ap->local->hostapd) { 638 637 dev_kfree_skb(skb); ··· 683 684 if (sta) 684 685 atomic_dec(&sta->users); 685 686 if (txt) { 686 - PDEBUG(DEBUG_AP, "%s: %s auth_cb - alg=%d " 687 + PDEBUG(DEBUG_AP, "%s: " MAC_FMT " auth_cb - alg=%d " 687 688 "trans#=%d status=%d - %s\n", 688 - dev->name, print_mac(mac, hdr->addr1), auth_alg, 689 - auth_transaction, status, txt); 689 + dev->name, 690 + hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], 691 + hdr->addr1[3], hdr->addr1[4], hdr->addr1[5], 692 + auth_alg, auth_transaction, status, txt); 690 693 } 691 694 dev_kfree_skb(skb); 692 695 } ··· 704 703 __le16 *pos; 705 704 struct sta_info *sta = NULL; 706 705 char *txt = NULL; 707 - DECLARE_MAC_BUF(mac); 708 706 709 707 if (ap->local->hostapd) { 710 708 dev_kfree_skb(skb); ··· 754 754 if (sta) 755 755 atomic_dec(&sta->users); 756 756 if (txt) { 757 - PDEBUG(DEBUG_AP, "%s: %s assoc_cb - %s\n", 758 - dev->name, print_mac(mac, hdr->addr1), txt); 757 + PDEBUG(DEBUG_AP, "%s: " MAC_FMT " assoc_cb - %s\n", 758 + dev->name, 759 + hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], 760 + hdr->addr1[3], hdr->addr1[4], hdr->addr1[5], 761 + txt); 759 762 } 760 763 dev_kfree_skb(skb); 761 764 } ··· 770 767 struct ap_data *ap = data; 771 768 struct ieee80211_hdr_4addr *hdr; 772 769 struct sta_info *sta; 773 - DECLARE_MAC_BUF(mac); 774 770 775 771 if (skb->len < 24) 776 772 goto fail; ··· 781 779 sta->flags &= ~WLAN_STA_PENDING_POLL; 782 780 spin_unlock(&ap->sta_table_lock); 783 781 } else { 784 - PDEBUG(DEBUG_AP, "%s: STA %s" 782 + PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT 785 783 " did not ACK activity poll frame\n", 786 - ap->local->dev->name, print_mac(mac, hdr->addr1)); 784 + ap->local->dev->name, 785 + hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], 786 + hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]); 787 787 } 788 788 789 789 fail: ··· 1310 1306 struct sta_info *sta = NULL; 1311 1307 struct ieee80211_crypt_data *crypt; 1312 1308 char *txt = ""; 1313 - DECLARE_MAC_BUF(mac); 1314 1309 1315 1310 len = skb->len - IEEE80211_MGMT_HDR_LEN; 1316 1311 ··· 1318 1315 1319 1316 if (len < 6) { 1320 1317 PDEBUG(DEBUG_AP, "%s: handle_authen - too short payload " 1321 - "(len=%d) from %s\n", dev->name, len, 1322 - print_mac(mac, hdr->addr2)); 1318 + "(len=%d) from " MAC_FMT "\n", dev->name, len, 1319 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 1320 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); 1323 1321 return; 1324 1322 } 1325 1323 ··· 1385 1381 if (time_after(jiffies, sta->u.ap.last_beacon + 1386 1382 (10 * sta->listen_interval * HZ) / 1024)) { 1387 1383 PDEBUG(DEBUG_AP, "%s: no beacons received for a while," 1388 - " assuming AP %s is now STA\n", 1389 - dev->name, print_mac(mac, sta->addr)); 1384 + " assuming AP " MAC_FMT " is now STA\n", 1385 + dev->name, 1386 + sta->addr[0], sta->addr[1], sta->addr[2], 1387 + sta->addr[3], sta->addr[4], sta->addr[5]); 1390 1388 sta->ap = 0; 1391 1389 sta->flags = 0; 1392 1390 sta->u.sta.challenge = NULL; ··· 1503 1497 } 1504 1498 1505 1499 if (resp) { 1506 - PDEBUG(DEBUG_AP, "%s: %s auth (alg=%d " 1500 + PDEBUG(DEBUG_AP, "%s: " MAC_FMT " auth (alg=%d " 1507 1501 "trans#=%d stat=%d len=%d fc=%04x) ==> %d (%s)\n", 1508 - dev->name, print_mac(mac, hdr->addr2), auth_alg, 1509 - auth_transaction, status_code, len, fc, resp, txt); 1502 + dev->name, 1503 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 1504 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], 1505 + auth_alg, auth_transaction, status_code, len, 1506 + fc, resp, txt); 1510 1507 } 1511 1508 } 1512 1509 ··· 1528 1519 int send_deauth = 0; 1529 1520 char *txt = ""; 1530 1521 u8 prev_ap[ETH_ALEN]; 1531 - DECLARE_MAC_BUF(mac); 1532 1522 1533 1523 left = len = skb->len - IEEE80211_MGMT_HDR_LEN; 1534 1524 1535 1525 if (len < (reassoc ? 10 : 4)) { 1536 1526 PDEBUG(DEBUG_AP, "%s: handle_assoc - too short payload " 1537 - "(len=%d, reassoc=%d) from %s\n", 1538 - dev->name, len, reassoc, print_mac(mac, hdr->addr2)); 1527 + "(len=%d, reassoc=%d) from " MAC_FMT "\n", 1528 + dev->name, len, reassoc, 1529 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 1530 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); 1539 1531 return; 1540 1532 } 1541 1533 ··· 1613 1603 } 1614 1604 1615 1605 if (left > 0) { 1616 - PDEBUG(DEBUG_AP, "%s: assoc from %s" 1606 + PDEBUG(DEBUG_AP, "%s: assoc from " MAC_FMT 1617 1607 " with extra data (%d bytes) [", 1618 - dev->name, print_mac(mac, hdr->addr2), left); 1608 + dev->name, 1609 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 1610 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], 1611 + left); 1619 1612 while (left > 0) { 1620 1613 PDEBUG2(DEBUG_AP, "<%02x>", *u); 1621 1614 u++; left--; ··· 1717 1704 } 1718 1705 1719 1706 #if 0 1720 - PDEBUG(DEBUG_AP, "%s: %s %sassoc (len=%d " 1721 - "prev_ap=%s) => %d(%d) (%s)\n", 1722 - dev->name, print_mac(mac, hdr->addr2), reassoc ? "re" : "", len, 1723 - print_mac(mac, prev_ap), resp, send_deauth, txt); 1707 + PDEBUG(DEBUG_AP, "%s: " MAC_FMT" %sassoc (len=%d " 1708 + "prev_ap=" MAC_FMT") => %d(%d) (%s)\n", 1709 + dev->name, 1710 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 1711 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], 1712 + reassoc ? "re" : "", len, 1713 + prev_ap[0], prev_ap[1], prev_ap[2], 1714 + prev_ap[3], prev_ap[4], prev_ap[5], 1715 + resp, send_deauth, txt); 1724 1716 #endif 1725 1717 } 1726 1718 ··· 1753 1735 pos = (__le16 *) body; 1754 1736 reason_code = le16_to_cpu(*pos); 1755 1737 1756 - PDEBUG(DEBUG_AP, "%s: deauthentication: %s len=%d, " 1757 - "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len, 1758 - reason_code); 1738 + PDEBUG(DEBUG_AP, "%s: deauthentication: " MAC_FMT " len=%d, " 1739 + "reason_code=%d\n", dev->name, 1740 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 1741 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], 1742 + len, reason_code); 1759 1743 1760 1744 spin_lock_bh(&local->ap->sta_table_lock); 1761 1745 sta = ap_get_sta(local->ap, hdr->addr2); ··· 1768 1748 } 1769 1749 spin_unlock_bh(&local->ap->sta_table_lock); 1770 1750 if (sta == NULL) { 1771 - printk("%s: deauthentication from %s, " 1751 + printk("%s: deauthentication from " MAC_FMT ", " 1772 1752 "reason_code=%d, but STA not authenticated\n", dev->name, 1773 - print_mac(mac, hdr->addr2), reason_code); 1753 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 1754 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], 1755 + reason_code); 1774 1756 } 1775 1757 } 1776 1758 ··· 1788 1766 u16 reason_code; 1789 1767 __le16 *pos; 1790 1768 struct sta_info *sta = NULL; 1791 - DECLARE_MAC_BUF(mac); 1792 1769 1793 1770 len = skb->len - IEEE80211_MGMT_HDR_LEN; 1794 1771 ··· 1799 1778 pos = (__le16 *) body; 1800 1779 reason_code = le16_to_cpu(*pos); 1801 1780 1802 - PDEBUG(DEBUG_AP, "%s: disassociation: %s len=%d, " 1803 - "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len, 1804 - reason_code); 1781 + PDEBUG(DEBUG_AP, "%s: disassociation: " MAC_FMT " len=%d, " 1782 + "reason_code=%d\n", dev->name, 1783 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 1784 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], 1785 + len, reason_code); 1805 1786 1806 1787 spin_lock_bh(&local->ap->sta_table_lock); 1807 1788 sta = ap_get_sta(local->ap, hdr->addr2); ··· 1814 1791 } 1815 1792 spin_unlock_bh(&local->ap->sta_table_lock); 1816 1793 if (sta == NULL) { 1817 - printk("%s: disassociation from %s, " 1794 + printk("%s: disassociation from " MAC_FMT ", " 1818 1795 "reason_code=%d, but STA not authenticated\n", 1819 - dev->name, print_mac(mac, hdr->addr2), reason_code); 1796 + dev->name, 1797 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 1798 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], 1799 + reason_code); 1820 1800 } 1821 1801 } 1822 1802 ··· 1908 1882 struct sta_info *sta; 1909 1883 u16 aid; 1910 1884 struct sk_buff *skb; 1911 - DECLARE_MAC_BUF(mac); 1912 1885 1913 - PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=%s" 1914 - ", TA=%s PWRMGT=%d\n", 1915 - print_mac(mac, hdr->addr1), print_mac(mac, hdr->addr2), 1886 + PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=" MAC_FMT 1887 + ", TA=" MAC_FMT " PWRMGT=%d\n", 1888 + hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], 1889 + hdr->addr1[3], hdr->addr1[4], hdr->addr1[5], 1890 + hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 1891 + hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], 1916 1892 !!(le16_to_cpu(hdr->frame_ctl) & IEEE80211_FCTL_PM)); 1917 1893 1918 1894 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 1919 - PDEBUG(DEBUG_AP, "handle_pspoll - addr1(BSSID)=%s" 1920 - " not own MAC\n", print_mac(mac, hdr->addr1)); 1895 + PDEBUG(DEBUG_AP, "handle_pspoll - addr1(BSSID)=" MAC_FMT 1896 + " not own MAC\n", 1897 + hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], 1898 + hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]); 1921 1899 return; 1922 1900 } 1923 1901 ··· 1999 1969 wds_oper_queue); 2000 1970 local_info_t *local = ap->local; 2001 1971 struct wds_oper_data *entry, *prev; 2002 - DECLARE_MAC_BUF(mac); 2003 1972 2004 1973 spin_lock_bh(&local->lock); 2005 1974 entry = local->ap->wds_oper_entries; ··· 2007 1978 2008 1979 while (entry) { 2009 1980 PDEBUG(DEBUG_AP, "%s: %s automatic WDS connection " 2010 - "to AP %s\n", 1981 + "to AP " MAC_FMT "\n", 2011 1982 local->dev->name, 2012 1983 entry->type == WDS_ADD ? "adding" : "removing", 2013 - print_mac(mac, entry->addr)); 1984 + entry->addr[0], entry->addr[1], entry->addr[2], 1985 + entry->addr[3], entry->addr[4], entry->addr[5]); 2014 1986 if (entry->type == WDS_ADD) 2015 1987 prism2_wds_add(local, entry->addr, 0); 2016 1988 else if (entry->type == WDS_DEL) ··· 2188 2158 #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 2189 2159 u16 fc, type, stype; 2190 2160 struct ieee80211_hdr_4addr *hdr; 2191 - DECLARE_MAC_BUF(mac); 2192 2161 2193 2162 /* FIX: should give skb->len to handler functions and check that the 2194 2163 * buffer is long enough */ ··· 2216 2187 2217 2188 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 2218 2189 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(BSSID)=" 2219 - "%s not own MAC\n", 2220 - print_mac(mac, hdr->addr1)); 2190 + MAC_FMT " not own MAC\n", 2191 + hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], 2192 + hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]); 2221 2193 goto done; 2222 2194 } 2223 2195 ··· 2254 2224 } 2255 2225 2256 2226 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 2257 - PDEBUG(DEBUG_AP, "handle_ap_item - addr1(DA)=%s" 2258 - " not own MAC\n", print_mac(mac, hdr->addr1)); 2227 + PDEBUG(DEBUG_AP, "handle_ap_item - addr1(DA)=" MAC_FMT 2228 + " not own MAC\n", 2229 + hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], 2230 + hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]); 2259 2231 goto done; 2260 2232 } 2261 2233 2262 2234 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) { 2263 - PDEBUG(DEBUG_AP, "handle_ap_item - addr3(BSSID)=%s" 2264 - " not own MAC\n", print_mac(mac, hdr->addr3)); 2235 + PDEBUG(DEBUG_AP, "handle_ap_item - addr3(BSSID)=" MAC_FMT 2236 + " not own MAC\n", 2237 + hdr->addr3[0], hdr->addr3[1], hdr->addr3[2], 2238 + hdr->addr3[3], hdr->addr3[4], hdr->addr3[5]); 2265 2239 goto done; 2266 2240 } 2267 2241 ··· 2346 2312 struct sk_buff *skb; 2347 2313 struct ieee80211_hdr_4addr *hdr; 2348 2314 struct hostap_80211_rx_status rx_stats; 2349 - DECLARE_MAC_BUF(mac); 2350 2315 2351 2316 if (skb_queue_empty(&sta->tx_buf)) 2352 2317 return; ··· 2367 2334 hdr->duration_id = cpu_to_le16(sta->aid | BIT(15) | BIT(14)); 2368 2335 2369 2336 PDEBUG(DEBUG_PS2, "%s: Scheduling buffered packet delivery for STA " 2370 - "%s\n", local->dev->name, print_mac(mac, sta->addr)); 2337 + MAC_FMT "\n", local->dev->name, 2338 + sta->addr[0], sta->addr[1], sta->addr[2], 2339 + sta->addr[3], sta->addr[4], sta->addr[5]); 2371 2340 2372 2341 skb->dev = local->dev; 2373 2342 ··· 2696 2661 int ret = sta->tx_rate; 2697 2662 struct hostap_interface *iface; 2698 2663 local_info_t *local; 2699 - DECLARE_MAC_BUF(mac); 2700 2664 2701 2665 iface = netdev_priv(dev); 2702 2666 local = iface->local; ··· 2723 2689 case 3: sta->tx_rate = 110; break; 2724 2690 default: sta->tx_rate = 0; break; 2725 2691 } 2726 - PDEBUG(DEBUG_AP, "%s: STA %s" 2692 + PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT 2727 2693 " TX rate raised to %d\n", 2728 - dev->name, print_mac(mac, sta->addr), sta->tx_rate); 2694 + dev->name, 2695 + sta->addr[0], sta->addr[1], sta->addr[2], 2696 + sta->addr[3], sta->addr[4], sta->addr[5], 2697 + sta->tx_rate); 2729 2698 } 2730 2699 sta->tx_since_last_failure = 0; 2731 2700 } ··· 2746 2709 int set_tim, ret; 2747 2710 struct ieee80211_hdr_4addr *hdr; 2748 2711 struct hostap_skb_tx_data *meta; 2749 - DECLARE_MAC_BUF(mac); 2750 2712 2751 2713 meta = (struct hostap_skb_tx_data *) skb->cb; 2752 2714 ret = AP_TX_CONTINUE; ··· 2781 2745 * print out any errors here. */ 2782 2746 if (net_ratelimit()) { 2783 2747 printk(KERN_DEBUG "AP: drop packet to non-associated " 2784 - "STA %s\n", 2785 - print_mac(mac, hdr->addr1)); 2748 + "STA " MAC_FMT "\n", 2749 + hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], 2750 + hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]); 2786 2751 } 2787 2752 #endif 2788 2753 local->ap->tx_drop_nonassoc++; ··· 2821 2784 } 2822 2785 2823 2786 if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) { 2824 - PDEBUG(DEBUG_PS, "%s: No more space in STA (%s" 2787 + PDEBUG(DEBUG_PS, "%s: No more space in STA (" MAC_FMT 2825 2788 ")'s PS mode buffer\n", 2826 - local->dev->name, print_mac(mac, sta->addr)); 2789 + local->dev->name, 2790 + sta->addr[0], sta->addr[1], sta->addr[2], 2791 + sta->addr[3], sta->addr[4], sta->addr[5]); 2827 2792 /* Make sure that TIM is set for the station (it might not be 2828 2793 * after AP wlan hw reset). */ 2829 2794 /* FIX: should fix hw reset to restore bits based on STA ··· 2889 2850 struct sta_info *sta; 2890 2851 struct ieee80211_hdr_4addr *hdr; 2891 2852 struct hostap_skb_tx_data *meta; 2892 - DECLARE_MAC_BUF(mac); 2893 2853 2894 2854 hdr = (struct ieee80211_hdr_4addr *) skb->data; 2895 2855 meta = (struct hostap_skb_tx_data *) skb->cb; ··· 2897 2859 sta = ap_get_sta(local->ap, hdr->addr1); 2898 2860 if (!sta) { 2899 2861 spin_unlock(&local->ap->sta_table_lock); 2900 - PDEBUG(DEBUG_AP, "%s: Could not find STA %s" 2862 + PDEBUG(DEBUG_AP, "%s: Could not find STA " MAC_FMT 2901 2863 " for this TX error (@%lu)\n", 2902 - local->dev->name, print_mac(mac, hdr->addr1), jiffies); 2864 + local->dev->name, 2865 + hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], 2866 + hdr->addr1[3], hdr->addr1[4], hdr->addr1[5], 2867 + jiffies); 2903 2868 return; 2904 2869 } 2905 2870 ··· 2929 2888 case 3: sta->tx_rate = 110; break; 2930 2889 default: sta->tx_rate = 0; break; 2931 2890 } 2932 - PDEBUG(DEBUG_AP, "%s: STA %s" 2891 + PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT 2933 2892 " TX rate lowered to %d\n", 2934 - local->dev->name, print_mac(mac, sta->addr), 2893 + local->dev->name, 2894 + sta->addr[0], sta->addr[1], sta->addr[2], 2895 + sta->addr[3], sta->addr[4], sta->addr[5], 2935 2896 sta->tx_rate); 2936 2897 } 2937 2898 sta->tx_consecutive_exc = 0; ··· 2999 2956 struct sta_info *sta; 3000 2957 u16 fc, type, stype; 3001 2958 struct ieee80211_hdr_4addr *hdr; 3002 - DECLARE_MAC_BUF(mac); 3003 2959 3004 2960 if (local->ap == NULL) 3005 2961 return AP_RX_CONTINUE; ··· 3030 2988 } else { 3031 2989 printk(KERN_DEBUG "%s: dropped received packet" 3032 2990 " from non-associated STA " 3033 - "%s" 2991 + MAC_FMT 3034 2992 " (type=0x%02x, subtype=0x%02x)\n", 3035 - dev->name, print_mac(mac, hdr->addr2), 2993 + dev->name, 2994 + hdr->addr2[0], hdr->addr2[1], 2995 + hdr->addr2[2], hdr->addr2[3], 2996 + hdr->addr2[4], hdr->addr2[5], 3036 2997 type >> 2, stype >> 4); 3037 2998 hostap_rx(dev, skb, rx_stats); 3038 2999 #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ ··· 3070 3025 * being associated. */ 3071 3026 printk(KERN_DEBUG "%s: rejected received nullfunc " 3072 3027 "frame without ToDS from not associated STA " 3073 - "%s\n", 3074 - dev->name, print_mac(mac, hdr->addr2)); 3028 + MAC_FMT "\n", 3029 + dev->name, 3030 + hdr->addr2[0], hdr->addr2[1], 3031 + hdr->addr2[2], hdr->addr2[3], 3032 + hdr->addr2[4], hdr->addr2[5]); 3075 3033 hostap_rx(dev, skb, rx_stats); 3076 3034 #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 3077 3035 } ··· 3091 3043 * If BSSID is own, report the dropping of this frame. */ 3092 3044 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) { 3093 3045 printk(KERN_DEBUG "%s: dropped received packet from " 3094 - "%s with no ToDS flag " 3046 + MAC_FMT " with no ToDS flag " 3095 3047 "(type=0x%02x, subtype=0x%02x)\n", dev->name, 3096 - print_mac(mac, hdr->addr2), type >> 2, stype >> 4); 3048 + hdr->addr2[0], hdr->addr2[1], 3049 + hdr->addr2[2], hdr->addr2[3], 3050 + hdr->addr2[4], hdr->addr2[5], 3051 + type >> 2, stype >> 4); 3097 3052 hostap_dump_rx_80211(dev->name, skb, rx_stats); 3098 3053 } 3099 3054 ret = AP_RX_DROP;
+4 -3
drivers/net/wireless/ipw2200.c
··· 10192 10192 u8 id, hdr_len, unicast; 10193 10193 u16 remaining_bytes; 10194 10194 int fc; 10195 - DECLARE_MAC_BUF(mac); 10196 10195 10197 10196 hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 10198 10197 switch (priv->ieee->iw_mode) { ··· 10202 10203 id = ipw_add_station(priv, hdr->addr1); 10203 10204 if (id == IPW_INVALID_STATION) { 10204 10205 IPW_WARNING("Attempt to send data to " 10205 - "invalid cell: %s\n", 10206 - print_mac(mac, hdr->addr1)); 10206 + "invalid cell: " MAC_FMT "\n", 10207 + hdr->addr1[0], hdr->addr1[1], 10208 + hdr->addr1[2], hdr->addr1[3], 10209 + hdr->addr1[4], hdr->addr1[5]); 10207 10210 goto drop; 10208 10211 } 10209 10212 }
+19 -10
net/atm/lec.c
··· 266 266 char buf[300]; 267 267 int i = 0; 268 268 #endif /* DUMP_PACKETS >0 */ 269 - DECLARE_MAC_BUF(mac); 270 269 271 270 pr_debug("lec_start_xmit called\n"); 272 271 if (!priv->lecd) { ··· 373 374 if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) { 374 375 pr_debug("%s:lec_start_xmit: queuing packet, ", 375 376 dev->name); 376 - pr_debug("MAC address %s\n", 377 - print_mac(mac, lec_h->h_dest)); 377 + pr_debug("MAC address " MAC_FMT "\n", 378 + lec_h->h_dest[0], lec_h->h_dest[1], 379 + lec_h->h_dest[2], lec_h->h_dest[3], 380 + lec_h->h_dest[4], lec_h->h_dest[5]); 378 381 skb_queue_tail(&entry->tx_wait, skb); 379 382 } else { 380 383 pr_debug 381 384 ("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ", 382 385 dev->name); 383 - pr_debug("MAC address %s\n", 384 - print_mac(mac, lec_h->h_dest)); 386 + pr_debug("MAC address " MAC_FMT "\n", 387 + lec_h->h_dest[0], lec_h->h_dest[1], 388 + lec_h->h_dest[2], lec_h->h_dest[3], 389 + lec_h->h_dest[4], lec_h->h_dest[5]); 385 390 priv->stats.tx_dropped++; 386 391 dev_kfree_skb(skb); 387 392 } ··· 397 394 398 395 while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) { 399 396 pr_debug("lec.c: emptying tx queue, "); 400 - pr_debug("MAC address %s\n", 401 - print_mac(mac, lec_h->h_dest)); 397 + pr_debug("MAC address " MAC_FMT "\n", 398 + lec_h->h_dest[0], lec_h->h_dest[1], 399 + lec_h->h_dest[2], lec_h->h_dest[3], 400 + lec_h->h_dest[4], lec_h->h_dest[5]); 402 401 lec_send(vcc, skb2, priv); 403 402 } 404 403 ··· 454 449 struct lec_arp_table *entry; 455 450 int i; 456 451 char *tmp; /* FIXME */ 457 - DECLARE_MAC_BUF(mac); 458 452 459 453 atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); 460 454 mesg = (struct atmlec_msg *)skb->data; ··· 540 536 struct net_bridge_fdb_entry *f; 541 537 542 538 pr_debug 543 - ("%s: bridge zeppelin asks about %s\n", 539 + ("%s: bridge zeppelin asks about " MAC_FMT "\n", 544 540 dev->name, 545 - print_mac(mac, mesg->content.proxy.mac_addr)); 541 + mesg->content.proxy.mac_addr[0], 542 + mesg->content.proxy.mac_addr[1], 543 + mesg->content.proxy.mac_addr[2], 544 + mesg->content.proxy.mac_addr[3], 545 + mesg->content.proxy.mac_addr[4], 546 + mesg->content.proxy.mac_addr[5]); 546 547 547 548 if (br_fdb_get_hook == NULL || dev->br_port == NULL) 548 549 break;
+29 -14
net/ieee80211/ieee80211_rx.c
··· 271 271 { 272 272 struct ieee80211_hdr_3addr *hdr; 273 273 int res, hdrlen; 274 - DECLARE_MAC_BUF(mac); 275 274 276 275 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) 277 276 return 0; ··· 282 283 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); 283 284 atomic_dec(&crypt->refcnt); 284 285 if (res < 0) { 285 - IEEE80211_DEBUG_DROP("decryption failed (SA=%s" 286 - ") res=%d\n", print_mac(mac, hdr->addr2), res); 286 + IEEE80211_DEBUG_DROP("decryption failed (SA=" MAC_FMT 287 + ") res=%d\n", 288 + hdr->addr2[0], hdr->addr2[1], 289 + hdr->addr2[2], hdr->addr2[3], 290 + hdr->addr2[4], hdr->addr2[5], 291 + res); 287 292 if (res == -2) 288 293 IEEE80211_DEBUG_DROP("Decryption failed ICV " 289 294 "mismatch (key %d)\n", ··· 307 304 { 308 305 struct ieee80211_hdr_3addr *hdr; 309 306 int res, hdrlen; 310 - DECLARE_MAC_BUF(mac); 311 307 312 308 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL) 313 309 return 0; ··· 319 317 atomic_dec(&crypt->refcnt); 320 318 if (res < 0) { 321 319 printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed" 322 - " (SA=%s keyidx=%d)\n", 323 - ieee->dev->name, print_mac(mac, hdr->addr2), keyidx); 320 + " (SA=" MAC_FMT " keyidx=%d)\n", 321 + ieee->dev->name, 322 + hdr->addr2[0], hdr->addr2[1], 323 + hdr->addr2[2], hdr->addr2[3], 324 + hdr->addr2[4], hdr->addr2[5], 325 + keyidx); 324 326 return -1; 325 327 } 326 328 ··· 468 462 * frames silently instead of filling system log with 469 463 * these reports. */ 470 464 IEEE80211_DEBUG_DROP("Decryption failed (not set)" 471 - " (SA=%s)\n", 472 - print_mac(mac, hdr->addr2)); 465 + " (SA=" MAC_FMT ")\n", 466 + hdr->addr2[0], hdr->addr2[1], 467 + hdr->addr2[2], hdr->addr2[3], 468 + hdr->addr2[4], hdr->addr2[5]); 473 469 ieee->ieee_stats.rx_discards_undecryptable++; 474 470 goto rx_dropped; 475 471 } ··· 482 474 fc & IEEE80211_FCTL_PROTECTED && ieee->host_decrypt && 483 475 (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) { 484 476 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " 485 - "from %s\n", dev->name, 486 - print_mac(mac, hdr->addr2)); 477 + "from " MAC_FMT "\n", dev->name, 478 + hdr->addr2[0], hdr->addr2[1], 479 + hdr->addr2[2], hdr->addr2[3], 480 + hdr->addr2[4], hdr->addr2[5]); 487 481 /* TODO: could inform hostapd about this so that it 488 482 * could send auth failure report */ 489 483 goto rx_dropped; ··· 663 653 * configured */ 664 654 } else { 665 655 IEEE80211_DEBUG_DROP("encryption configured, but RX " 666 - "frame not encrypted (SA=%s" 667 - ")\n", print_mac(mac, hdr->addr2)); 656 + "frame not encrypted (SA=" 657 + MAC_FMT ")\n", 658 + hdr->addr2[0], hdr->addr2[1], 659 + hdr->addr2[2], hdr->addr2[3], 660 + hdr->addr2[4], hdr->addr2[5]); 668 661 goto rx_dropped; 669 662 } 670 663 } ··· 675 662 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep && 676 663 !ieee80211_is_eapol_frame(ieee, skb)) { 677 664 IEEE80211_DEBUG_DROP("dropped unencrypted RX data " 678 - "frame from %s" 665 + "frame from " MAC_FMT 679 666 " (drop_unencrypted=1)\n", 680 - print_mac(mac, hdr->addr2)); 667 + hdr->addr2[0], hdr->addr2[1], 668 + hdr->addr2[2], hdr->addr2[3], 669 + hdr->addr2[4], hdr->addr2[5]); 681 670 goto rx_dropped; 682 671 } 683 672