[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>
This commit is contained in:
Joe Perches
2007-10-03 17:59:30 -07:00
committed by David S. Miller
parent 95ea36275f
commit 0795af5729
228 changed files with 1876 additions and 1953 deletions

View File

@@ -516,6 +516,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
unsigned rev_type = 0;
int eeprom_buff[CHKSUM_LEN];
int retval;
DECLARE_MAC_BUF(mac);
/* Initialize the device structure. */
if (!modular) {
@@ -840,11 +841,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
}
/* print the ethernet address. */
printk(", MAC");
for (i = 0; i < ETH_ALEN; i++)
{
printk("%c%02x", i ? ':' : ' ', dev->dev_addr[i]);
}
printk(", MAC %s", print_mac(mac, dev->dev_addr));
dev->open = net_open;
dev->stop = net_close;
@@ -1806,17 +1803,15 @@ static int set_mac_address(struct net_device *dev, void *p)
int i;
struct sockaddr *addr = p;
if (netif_running(dev))
return -EBUSY;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
if (net_debug) {
printk("%s: Setting MAC address to ", dev->name);
for (i = 0; i < dev->addr_len; i++)
printk(" %2.2x", dev->dev_addr[i]);
printk(".\n");
DECLARE_MAC_BUF(mac);
printk("%s: Setting MAC address to %s.\n",
dev->name, print_mac(mac, dev->dev_addr));
}
/* set the Ethernet address */
for (i=0; i < ETH_ALEN/2; i++)