aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sun3lance.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2007-10-03 20:59:30 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:42 -0400
commit0795af5729b18218767fab27c44b1384f72dc9ad (patch)
tree67c16df84aa6ec219340b8ea1b5cfb0e8150a216 /drivers/net/sun3lance.c
parent95ea36275f3c9a1d3d04c217b4b576c657c4e70e (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/sun3lance.c')
-rw-r--r--drivers/net/sun3lance.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c
index f8fbc0492706..f8d46134daca 100644
--- a/drivers/net/sun3lance.c
+++ b/drivers/net/sun3lance.c
@@ -300,6 +300,7 @@ static int __init lance_probe( struct net_device *dev)
300 static int did_version; 300 static int did_version;
301 volatile unsigned short *ioaddr_probe; 301 volatile unsigned short *ioaddr_probe;
302 unsigned short tmp1, tmp2; 302 unsigned short tmp1, tmp2;
303 DECLARE_MAC_BUF(mac);
303 304
304#ifdef CONFIG_SUN3 305#ifdef CONFIG_SUN3
305 ioaddr = (unsigned long)ioremap(LANCE_OBIO, PAGE_SIZE); 306 ioaddr = (unsigned long)ioremap(LANCE_OBIO, PAGE_SIZE);
@@ -375,8 +376,7 @@ static int __init lance_probe( struct net_device *dev)
375 MEM->init.hwaddr[4] = dev->dev_addr[5]; 376 MEM->init.hwaddr[4] = dev->dev_addr[5];
376 MEM->init.hwaddr[5] = dev->dev_addr[4]; 377 MEM->init.hwaddr[5] = dev->dev_addr[4];
377 378
378 for( i = 0; i < 6; ++i ) 379 printk("%s\n", print_mac(mac, dev->dev_addr));
379 printk( "%02x%s", dev->dev_addr[i], (i < 5) ? ":" : "\n" );
380 380
381 MEM->init.mode = 0x0000; 381 MEM->init.mode = 0x0000;
382 MEM->init.filter[0] = 0x00000000; 382 MEM->init.filter[0] = 0x00000000;
@@ -590,17 +590,12 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
590 /* Fill in a Tx ring entry */ 590 /* Fill in a Tx ring entry */
591#if 0 591#if 0
592 if (lance_debug >= 2) { 592 if (lance_debug >= 2) {
593 u_char *p; 593 printk( "%s: TX pkt %d type 0x%04x"
594 int i; 594 " from %s to %s"
595 printk( "%s: TX pkt %d type 0x%04x from ", dev->name, 595 " data at 0x%08x len %d\n",
596 lp->new_tx, ((u_short *)skb->data)[6]); 596 dev->name, lp->new_tx, ((u_short *)skb->data)[6],
597 for( p = &((u_char *)skb->data)[6], i = 0; i < 6; i++ ) 597 DEV_ADDR(&skb->data[6]), DEV_ADDR(skb->data),
598 printk("%02x%s", *p++, i != 5 ? ":" : "" ); 598 (int)skb->data, (int)skb->len );
599 printk(" to ");
600 for( p = (u_char *)skb->data, i = 0; i < 6; i++ )
601 printk("%02x%s", *p++, i != 5 ? ":" : "" );
602 printk(" data at 0x%08x len %d\n", (int)skb->data,
603 (int)skb->len );
604 } 599 }
605#endif 600#endif
606 /* We're not prepared for the int until the last flags are set/reset. 601 /* We're not prepared for the int until the last flags are set/reset.
@@ -825,13 +820,14 @@ static int lance_rx( struct net_device *dev )
825 820
826#if 0 821#if 0
827 if (lance_debug >= 3) { 822 if (lance_debug >= 3) {
828 u_char *data = PKTBUF_ADDR(head), *p; 823 u_char *data = PKTBUF_ADDR(head);
829 printk( "%s: RX pkt %d type 0x%04x from ", dev->name, entry, ((u_short *)data)[6]); 824 DECLARE_MAC_BUF(mac);
830 for( p = &data[6], i = 0; i < 6; i++ ) 825 DECLARE_MAC_BUF(mac2)
831 printk("%02x%s", *p++, i != 5 ? ":" : "" ); 826 printk("%s: RX pkt %d type 0x%04x"
832 printk(" to "); 827 " from %s to %s",
833 for( p = data, i = 0; i < 6; i++ ) 828 dev->name, lp->new_tx, ((u_short *)data)[6],
834 printk("%02x%s", *p++, i != 5 ? ":" : "" ); 829 print_mac(mac, &data[6]), print_mac(mac2, data));
830
835 printk(" data %02x %02x %02x %02x %02x %02x %02x %02x " 831 printk(" data %02x %02x %02x %02x %02x %02x %02x %02x "
836 "len %d at %08x\n", 832 "len %d at %08x\n",
837 data[15], data[16], data[17], data[18], 833 data[15], data[16], data[17], data[18],