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 /net/atm | |
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 'net/atm')
-rw-r--r-- | net/atm/br2684.c | 16 | ||||
-rw-r--r-- | net/atm/lec.c | 29 |
2 files changed, 17 insertions, 28 deletions
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index 81eb4f4cbe10..c742d37bfb97 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c | |||
@@ -709,17 +709,13 @@ static int br2684_seq_show(struct seq_file *seq, void *v) | |||
709 | br2684_devs); | 709 | br2684_devs); |
710 | const struct net_device *net_dev = brdev->net_dev; | 710 | const struct net_device *net_dev = brdev->net_dev; |
711 | const struct br2684_vcc *brvcc; | 711 | const struct br2684_vcc *brvcc; |
712 | DECLARE_MAC_BUF(mac); | ||
712 | 713 | ||
713 | seq_printf(seq, "dev %.16s: num=%d, mac=%02X:%02X:" | 714 | seq_printf(seq, "dev %.16s: num=%d, mac=%s (%s)\n", |
714 | "%02X:%02X:%02X:%02X (%s)\n", net_dev->name, | 715 | net_dev->name, |
715 | brdev->number, | 716 | brdev->number, |
716 | net_dev->dev_addr[0], | 717 | print_mac(mac, net_dev->dev_addr), |
717 | net_dev->dev_addr[1], | 718 | brdev->mac_was_set ? "set" : "auto"); |
718 | net_dev->dev_addr[2], | ||
719 | net_dev->dev_addr[3], | ||
720 | net_dev->dev_addr[4], | ||
721 | net_dev->dev_addr[5], | ||
722 | brdev->mac_was_set ? "set" : "auto"); | ||
723 | 719 | ||
724 | list_for_each_entry(brvcc, &brdev->brvccs, brvccs) { | 720 | list_for_each_entry(brvcc, &brdev->brvccs, brvccs) { |
725 | seq_printf(seq, " vcc %d.%d.%d: encaps=%s" | 721 | seq_printf(seq, " vcc %d.%d.%d: encaps=%s" |
diff --git a/net/atm/lec.c b/net/atm/lec.c index 813a090dcaf4..c909c76223e1 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -266,6 +266,7 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
266 | char buf[300]; | 266 | char buf[300]; |
267 | int i = 0; | 267 | int i = 0; |
268 | #endif /* DUMP_PACKETS >0 */ | 268 | #endif /* DUMP_PACKETS >0 */ |
269 | DECLARE_MAC_BUF(mac); | ||
269 | 270 | ||
270 | pr_debug("lec_start_xmit called\n"); | 271 | pr_debug("lec_start_xmit called\n"); |
271 | if (!priv->lecd) { | 272 | if (!priv->lecd) { |
@@ -373,19 +374,15 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
373 | if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) { | 374 | if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) { |
374 | pr_debug("%s:lec_start_xmit: queuing packet, ", | 375 | pr_debug("%s:lec_start_xmit: queuing packet, ", |
375 | dev->name); | 376 | dev->name); |
376 | pr_debug("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", | 377 | pr_debug("MAC address %s\n", |
377 | lec_h->h_dest[0], lec_h->h_dest[1], | 378 | print_mac(mac, lec_h->h_dest)); |
378 | lec_h->h_dest[2], lec_h->h_dest[3], | ||
379 | lec_h->h_dest[4], lec_h->h_dest[5]); | ||
380 | skb_queue_tail(&entry->tx_wait, skb); | 379 | skb_queue_tail(&entry->tx_wait, skb); |
381 | } else { | 380 | } else { |
382 | pr_debug | 381 | pr_debug |
383 | ("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ", | 382 | ("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ", |
384 | dev->name); | 383 | dev->name); |
385 | pr_debug("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", | 384 | pr_debug("MAC address %s\n", |
386 | lec_h->h_dest[0], lec_h->h_dest[1], | 385 | print_mac(mac, lec_h->h_dest)); |
387 | lec_h->h_dest[2], lec_h->h_dest[3], | ||
388 | lec_h->h_dest[4], lec_h->h_dest[5]); | ||
389 | priv->stats.tx_dropped++; | 386 | priv->stats.tx_dropped++; |
390 | dev_kfree_skb(skb); | 387 | dev_kfree_skb(skb); |
391 | } | 388 | } |
@@ -397,9 +394,8 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
397 | 394 | ||
398 | while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) { | 395 | while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) { |
399 | pr_debug("lec.c: emptying tx queue, "); | 396 | pr_debug("lec.c: emptying tx queue, "); |
400 | pr_debug("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", | 397 | pr_debug("MAC address %s\n", |
401 | lec_h->h_dest[0], lec_h->h_dest[1], lec_h->h_dest[2], | 398 | print_mac(mac, lec_h->h_dest)); |
402 | lec_h->h_dest[3], lec_h->h_dest[4], lec_h->h_dest[5]); | ||
403 | lec_send(vcc, skb2, priv); | 399 | lec_send(vcc, skb2, priv); |
404 | } | 400 | } |
405 | 401 | ||
@@ -453,6 +449,7 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) | |||
453 | struct lec_arp_table *entry; | 449 | struct lec_arp_table *entry; |
454 | int i; | 450 | int i; |
455 | char *tmp; /* FIXME */ | 451 | char *tmp; /* FIXME */ |
452 | DECLARE_MAC_BUF(mac); | ||
456 | 453 | ||
457 | atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); | 454 | atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); |
458 | mesg = (struct atmlec_msg *)skb->data; | 455 | mesg = (struct atmlec_msg *)skb->data; |
@@ -539,13 +536,9 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) | |||
539 | struct net_bridge_fdb_entry *f; | 536 | struct net_bridge_fdb_entry *f; |
540 | 537 | ||
541 | pr_debug | 538 | pr_debug |
542 | ("%s: bridge zeppelin asks about 0x%02x:%02x:%02x:%02x:%02x:%02x\n", | 539 | ("%s: bridge zeppelin asks about %s\n", |
543 | dev->name, mesg->content.proxy.mac_addr[0], | 540 | dev->name, |
544 | mesg->content.proxy.mac_addr[1], | 541 | print_mac(mac, mesg->content.proxy.mac_addr)); |
545 | mesg->content.proxy.mac_addr[2], | ||
546 | mesg->content.proxy.mac_addr[3], | ||
547 | mesg->content.proxy.mac_addr[4], | ||
548 | mesg->content.proxy.mac_addr[5]); | ||
549 | 542 | ||
550 | if (br_fdb_get_hook == NULL || dev->br_port == NULL) | 543 | if (br_fdb_get_hook == NULL || dev->br_port == NULL) |
551 | break; | 544 | break; |