aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/arm
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/arm
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/arm')
-rw-r--r--drivers/net/arm/am79c961a.c8
-rw-r--r--drivers/net/arm/at91_ether.c18
-rw-r--r--drivers/net/arm/ether1.c8
-rw-r--r--drivers/net/arm/ether3.c8
-rw-r--r--drivers/net/arm/etherh.c8
5 files changed, 22 insertions, 28 deletions
diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index 77964556776..ba6bd03a015 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -741,12 +741,10 @@ static int __init am79c961_probe(struct platform_device *pdev)
741 741
742 ret = register_netdev(dev); 742 ret = register_netdev(dev);
743 if (ret == 0) { 743 if (ret == 0) {
744 printk(KERN_INFO "%s: ether address ", dev->name); 744 DECLARE_MAC_BUF(mac);
745
746 /* Retrive and print the ethernet address. */
747 for (i = 0; i < 6; i++)
748 printk (i == 5 ? "%02x\n" : "%02x:", dev->dev_addr[i]);
749 745
746 printk(KERN_INFO "%s: ether address %s\n",
747 dev->name, print_mac(mac, dev->dev_addr));
750 return 0; 748 return 0;
751 } 749 }
752 750
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
index 619810a01e5..25b114a4e2b 100644
--- a/drivers/net/arm/at91_ether.c
+++ b/drivers/net/arm/at91_ether.c
@@ -485,6 +485,7 @@ static void update_mac_address(struct net_device *dev)
485static int set_mac_address(struct net_device *dev, void* addr) 485static int set_mac_address(struct net_device *dev, void* addr)
486{ 486{
487 struct sockaddr *address = addr; 487 struct sockaddr *address = addr;
488 DECLARE_MAC_BUF(mac);
488 489
489 if (!is_valid_ether_addr(address->sa_data)) 490 if (!is_valid_ether_addr(address->sa_data))
490 return -EADDRNOTAVAIL; 491 return -EADDRNOTAVAIL;
@@ -492,9 +493,8 @@ static int set_mac_address(struct net_device *dev, void* addr)
492 memcpy(dev->dev_addr, address->sa_data, dev->addr_len); 493 memcpy(dev->dev_addr, address->sa_data, dev->addr_len);
493 update_mac_address(dev); 494 update_mac_address(dev);
494 495
495 printk("%s: Setting MAC address to %02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, 496 printk("%s: Setting MAC address to %s\n", dev->name,
496 dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], 497 print_mac(mac, dev->dev_addr));
497 dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
498 498
499 return 0; 499 return 0;
500} 500}
@@ -979,6 +979,7 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add
979 struct at91_private *lp; 979 struct at91_private *lp;
980 unsigned int val; 980 unsigned int val;
981 int res; 981 int res;
982 DECLARE_MAC_BUF(mac);
982 983
983 dev = alloc_etherdev(sizeof(struct at91_private)); 984 dev = alloc_etherdev(sizeof(struct at91_private));
984 if (!dev) 985 if (!dev)
@@ -1081,12 +1082,11 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add
1081 } 1082 }
1082 1083
1083 /* Display ethernet banner */ 1084 /* Display ethernet banner */
1084 printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%02x:%02x:%02x:%02x:%02x:%02x)\n", 1085 printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n",
1085 dev->name, (uint) dev->base_addr, dev->irq, 1086 dev->name, (uint) dev->base_addr, dev->irq,
1086 at91_emac_read(AT91_EMAC_CFG) & AT91_EMAC_SPD ? "100-" : "10-", 1087 at91_emac_read(AT91_EMAC_CFG) & AT91_EMAC_SPD ? "100-" : "10-",
1087 at91_emac_read(AT91_EMAC_CFG) & AT91_EMAC_FD ? "FullDuplex" : "HalfDuplex", 1088 at91_emac_read(AT91_EMAC_CFG) & AT91_EMAC_FD ? "FullDuplex" : "HalfDuplex",
1088 dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], 1089 print_mac(mac, dev->dev_addr));
1089 dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
1090 if ((phy_type == MII_DM9161_ID) || (lp->phy_type == MII_DM9161A_ID)) 1090 if ((phy_type == MII_DM9161_ID) || (lp->phy_type == MII_DM9161A_ID))
1091 printk(KERN_INFO "%s: Davicom 9161 PHY %s\n", dev->name, (lp->phy_media == PORT_FIBRE) ? "(Fiber)" : "(Copper)"); 1091 printk(KERN_INFO "%s: Davicom 9161 PHY %s\n", dev->name, (lp->phy_media == PORT_FIBRE) ? "(Fiber)" : "(Copper)");
1092 else if (phy_type == MII_LXT971A_ID) 1092 else if (phy_type == MII_LXT971A_ID)
diff --git a/drivers/net/arm/ether1.c b/drivers/net/arm/ether1.c
index 6ec8a587c1d..3bb9e293e2e 100644
--- a/drivers/net/arm/ether1.c
+++ b/drivers/net/arm/ether1.c
@@ -996,6 +996,7 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
996{ 996{
997 struct net_device *dev; 997 struct net_device *dev;
998 int i, ret = 0; 998 int i, ret = 0;
999 DECLARE_MAC_BUF(mac);
999 1000
1000 ether1_banner(); 1001 ether1_banner();
1001 1002
@@ -1043,12 +1044,9 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
1043 if (ret) 1044 if (ret)
1044 goto free; 1045 goto free;
1045 1046
1046 printk(KERN_INFO "%s: ether1 in slot %d, ", 1047 printk(KERN_INFO "%s: ether1 in slot %d, %s\n",
1047 dev->name, ec->slot_no); 1048 dev->name, ec->slot_no, print_mac(mac, dev->dev_addr));
1048 1049
1049 for (i = 0; i < 6; i++)
1050 printk ("%2.2x%c", dev->dev_addr[i], i == 5 ? '\n' : ':');
1051
1052 ecard_set_drvdata(ec, dev); 1050 ecard_set_drvdata(ec, dev);
1053 return 0; 1051 return 0;
1054 1052
diff --git a/drivers/net/arm/ether3.c b/drivers/net/arm/ether3.c
index 4a914748c0e..67e96ae8503 100644
--- a/drivers/net/arm/ether3.c
+++ b/drivers/net/arm/ether3.c
@@ -775,7 +775,8 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
775{ 775{
776 const struct ether3_data *data = id->data; 776 const struct ether3_data *data = id->data;
777 struct net_device *dev; 777 struct net_device *dev;
778 int i, bus_type, ret; 778 int bus_type, ret;
779 DECLARE_MAC_BUF(mac);
779 780
780 ether3_banner(); 781 ether3_banner();
781 782
@@ -858,9 +859,8 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
858 if (ret) 859 if (ret)
859 goto free; 860 goto free;
860 861
861 printk("%s: %s in slot %d, ", dev->name, data->name, ec->slot_no); 862 printk("%s: %s in slot %d, %s\n",
862 for (i = 0; i < 6; i++) 863 dev->name, data->name, ec->slot_no, print_mac(mac, dev->dev_addr));
863 printk("%2.2x%c", dev->dev_addr[i], i == 5 ? '\n' : ':');
864 864
865 ecard_set_drvdata(ec, dev); 865 ecard_set_drvdata(ec, dev);
866 return 0; 866 return 0;
diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c
index 5d093b3ddcd..00081d2b9cd 100644
--- a/drivers/net/arm/etherh.c
+++ b/drivers/net/arm/etherh.c
@@ -648,6 +648,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
648 struct net_device *dev; 648 struct net_device *dev;
649 struct etherh_priv *eh; 649 struct etherh_priv *eh;
650 int i, ret; 650 int i, ret;
651 DECLARE_MAC_BUF(mac);
651 652
652 etherh_banner(); 653 etherh_banner();
653 654
@@ -745,11 +746,8 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
745 if (ret) 746 if (ret)
746 goto free; 747 goto free;
747 748
748 printk(KERN_INFO "%s: %s in slot %d, ", 749 printk(KERN_INFO "%s: %s in slot %d, %s\n",
749 dev->name, data->name, ec->slot_no); 750 dev->name, data->name, ec->slot_no, print_mac(mac, dev->dev_addr));
750
751 for (i = 0; i < 6; i++)
752 printk("%2.2x%c", dev->dev_addr[i], i == 5 ? '\n' : ':');
753 751
754 ecard_set_drvdata(ec, dev); 752 ecard_set_drvdata(ec, dev);
755 753