aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip/de4x5.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/tulip/de4x5.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/tulip/de4x5.c')
-rw-r--r--drivers/net/tulip/de4x5.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index ee4215ca63f0..4633cc6dd412 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -1088,6 +1088,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct device *gendev)
1088 struct de4x5_private *lp = netdev_priv(dev); 1088 struct de4x5_private *lp = netdev_priv(dev);
1089 struct pci_dev *pdev = NULL; 1089 struct pci_dev *pdev = NULL;
1090 int i, status=0; 1090 int i, status=0;
1091 DECLARE_MAC_BUF(mac);
1091 1092
1092 gendev->driver_data = dev; 1093 gendev->driver_data = dev;
1093 1094
@@ -1123,12 +1124,8 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct device *gendev)
1123 dev->base_addr = iobase; 1124 dev->base_addr = iobase;
1124 printk ("%s: %s at 0x%04lx", gendev->bus_id, name, iobase); 1125 printk ("%s: %s at 0x%04lx", gendev->bus_id, name, iobase);
1125 1126
1126 printk(", h/w address ");
1127 status = get_hw_addr(dev); 1127 status = get_hw_addr(dev);
1128 for (i = 0; i < ETH_ALEN - 1; i++) { /* get the ethernet addr. */ 1128 printk(", h/w address %s\n", print_mac(mac, dev->dev_addr));
1129 printk("%2.2x:", dev->dev_addr[i]);
1130 }
1131 printk("%2.2x,\n", dev->dev_addr[i]);
1132 1129
1133 if (status != 0) { 1130 if (status != 0) {
1134 printk(" which has an Ethernet PROM CRC error.\n"); 1131 printk(" which has an Ethernet PROM CRC error.\n");
@@ -5468,19 +5465,16 @@ static void
5468de4x5_dbg_srom(struct de4x5_srom *p) 5465de4x5_dbg_srom(struct de4x5_srom *p)
5469{ 5466{
5470 int i; 5467 int i;
5468 DECLARE_MAC_BUF(mac);
5471 5469
5472 if (de4x5_debug & DEBUG_SROM) { 5470 if (de4x5_debug & DEBUG_SROM) {
5473 printk("Sub-system Vendor ID: %04x\n", *((u_short *)p->sub_vendor_id)); 5471 printk("Sub-system Vendor ID: %04x\n", *((u_short *)p->sub_vendor_id));
5474 printk("Sub-system ID: %04x\n", *((u_short *)p->sub_system_id)); 5472 printk("Sub-system ID: %04x\n", *((u_short *)p->sub_system_id));
5475 printk("ID Block CRC: %02x\n", (u_char)(p->id_block_crc)); 5473 printk("ID Block CRC: %02x\n", (u_char)(p->id_block_crc));
5476 printk("SROM version: %02x\n", (u_char)(p->version)); 5474 printk("SROM version: %02x\n", (u_char)(p->version));
5477 printk("# controllers: %02x\n", (u_char)(p->num_controllers)); 5475 printk("# controllers: %02x\n", (u_char)(p->num_controllers));
5478 5476
5479 printk("Hardware Address: "); 5477 printk("Hardware Address: %s\n", print_mac(mac, p->ieee_addr));
5480 for (i=0;i<ETH_ALEN-1;i++) {
5481 printk("%02x:", (u_char)*(p->ieee_addr+i));
5482 }
5483 printk("%02x\n", (u_char)*(p->ieee_addr+i));
5484 printk("CRC checksum: %04x\n", (u_short)(p->chksum)); 5478 printk("CRC checksum: %04x\n", (u_short)(p->chksum));
5485 for (i=0; i<64; i++) { 5479 for (i=0; i<64; i++) {
5486 printk("%3d %04x\n", i<<1, (u_short)*((u_short *)p+i)); 5480 printk("%3d %04x\n", i<<1, (u_short)*((u_short *)p+i));
@@ -5494,21 +5488,12 @@ static void
5494de4x5_dbg_rx(struct sk_buff *skb, int len) 5488de4x5_dbg_rx(struct sk_buff *skb, int len)
5495{ 5489{
5496 int i, j; 5490 int i, j;
5491 DECLARE_MAC_BUF(mac);
5492 DECLARE_MAC_BUF(mac2);
5497 5493
5498 if (de4x5_debug & DEBUG_RX) { 5494 if (de4x5_debug & DEBUG_RX) {
5499 printk("R: %02x:%02x:%02x:%02x:%02x:%02x <- %02x:%02x:%02x:%02x:%02x:%02x len/SAP:%02x%02x [%d]\n", 5495 printk("R: %s <- %s len/SAP:%02x%02x [%d]\n",
5500 (u_char)skb->data[0], 5496 print_mac(mac, skb->data), print_mac(mac2, &skb->data[6]),
5501 (u_char)skb->data[1],
5502 (u_char)skb->data[2],
5503 (u_char)skb->data[3],
5504 (u_char)skb->data[4],
5505 (u_char)skb->data[5],
5506 (u_char)skb->data[6],
5507 (u_char)skb->data[7],
5508 (u_char)skb->data[8],
5509 (u_char)skb->data[9],
5510 (u_char)skb->data[10],
5511 (u_char)skb->data[11],
5512 (u_char)skb->data[12], 5497 (u_char)skb->data[12],
5513 (u_char)skb->data[13], 5498 (u_char)skb->data[13],
5514 len); 5499 len);