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