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/tokenring/ibmtr.c | |
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/tokenring/ibmtr.c')
-rw-r--r-- | drivers/net/tokenring/ibmtr.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c index 65e21eb7e685..e494c63bfbd9 100644 --- a/drivers/net/tokenring/ibmtr.c +++ b/drivers/net/tokenring/ibmtr.c | |||
@@ -389,6 +389,7 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) | |||
389 | unsigned long timeout; | 389 | unsigned long timeout; |
390 | static int version_printed; | 390 | static int version_printed; |
391 | #endif | 391 | #endif |
392 | DECLARE_MAC_BUF(mac); | ||
392 | 393 | ||
393 | /* Query the adapter PIO base port which will return | 394 | /* Query the adapter PIO base port which will return |
394 | * indication of where MMIO was placed. We also have a | 395 | * indication of where MMIO was placed. We also have a |
@@ -702,9 +703,8 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) | |||
702 | channel_def[cardpresent - 1], adapter_def(ti->adapter_type)); | 703 | channel_def[cardpresent - 1], adapter_def(ti->adapter_type)); |
703 | DPRINTK("using irq %d, PIOaddr %hx, %dK shared RAM.\n", | 704 | DPRINTK("using irq %d, PIOaddr %hx, %dK shared RAM.\n", |
704 | irq, PIOaddr, ti->mapped_ram_size / 2); | 705 | irq, PIOaddr, ti->mapped_ram_size / 2); |
705 | DPRINTK("Hardware address : %02X:%02X:%02X:%02X:%02X:%02X\n", | 706 | DPRINTK("Hardware address : %s\n", |
706 | dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], | 707 | print_mac(mac, dev->dev_addr)); |
707 | dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); | ||
708 | if (ti->page_mask) | 708 | if (ti->page_mask) |
709 | DPRINTK("Shared RAM paging enabled. " | 709 | DPRINTK("Shared RAM paging enabled. " |
710 | "Page size: %uK Shared Ram size %dK\n", | 710 | "Page size: %uK Shared Ram size %dK\n", |
@@ -1739,18 +1739,20 @@ static void tr_rx(struct net_device *dev) | |||
1739 | if (!IPv4_p) { | 1739 | if (!IPv4_p) { |
1740 | 1740 | ||
1741 | void __iomem *trhhdr = rbuf + offsetof(struct rec_buf, data); | 1741 | void __iomem *trhhdr = rbuf + offsetof(struct rec_buf, data); |
1742 | 1742 | u8 saddr[6]; | |
1743 | u8 daddr[6]; | ||
1744 | DECLARE_MAC_BUF(mac); | ||
1745 | DECLARE_MAC_BUF(mac2); | ||
1746 | int i; | ||
1747 | for (i = 0 ; i < 6 ; i++) | ||
1748 | saddr[i] = readb(trhhdr + SADDR_OFST + i); | ||
1749 | for (i = 0 ; i < 6 ; i++) | ||
1750 | daddr[i] = readb(trhhdr + DADDR_OFST + i); | ||
1743 | DPRINTK("Probably non-IP frame received.\n"); | 1751 | DPRINTK("Probably non-IP frame received.\n"); |
1744 | DPRINTK("ssap: %02X dsap: %02X " | 1752 | DPRINTK("ssap: %02X dsap: %02X " |
1745 | "saddr: %02X:%02X:%02X:%02X:%02X:%02X " | 1753 | "saddr: %s daddr: %$s\n", |
1746 | "daddr: %02X:%02X:%02X:%02X:%02X:%02X\n", | ||
1747 | readb(llc + SSAP_OFST), readb(llc + DSAP_OFST), | 1754 | readb(llc + SSAP_OFST), readb(llc + DSAP_OFST), |
1748 | readb(trhhdr+SADDR_OFST), readb(trhhdr+ SADDR_OFST+1), | 1755 | print_mac(mac, saddr), print_mac(mac2, daddr)); |
1749 | readb(trhhdr+SADDR_OFST+2), readb(trhhdr+SADDR_OFST+3), | ||
1750 | readb(trhhdr+SADDR_OFST+4), readb(trhhdr+SADDR_OFST+5), | ||
1751 | readb(trhhdr+DADDR_OFST), readb(trhhdr+DADDR_OFST + 1), | ||
1752 | readb(trhhdr+DADDR_OFST+2), readb(trhhdr+DADDR_OFST+3), | ||
1753 | readb(trhhdr+DADDR_OFST+4), readb(trhhdr+DADDR_OFST+5)); | ||
1754 | } | 1756 | } |
1755 | #endif | 1757 | #endif |
1756 | 1758 | ||