[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:
committed by
David S. Miller
parent
95ea36275f
commit
0795af5729
@@ -4991,6 +4991,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
|
||||
u32 powerstate, txreg;
|
||||
u32 phystate_orig = 0, phystate;
|
||||
int phyinitialized = 0;
|
||||
DECLARE_MAC_BUF(mac);
|
||||
|
||||
dev = alloc_etherdev(sizeof(struct fe_priv));
|
||||
err = -ENOMEM;
|
||||
@@ -5205,10 +5206,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
|
||||
* Bad mac address. At least one bios sets the mac address
|
||||
* to 01:23:45:67:89:ab
|
||||
*/
|
||||
printk(KERN_ERR "%s: Invalid Mac address detected: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
pci_name(pci_dev),
|
||||
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
|
||||
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
|
||||
printk(KERN_ERR "%s: Invalid Mac address detected: %s\n",
|
||||
pci_name(pci_dev), print_mac(mac, dev->dev_addr));
|
||||
printk(KERN_ERR "Please complain to your hardware vendor. Switching to a random MAC.\n");
|
||||
dev->dev_addr[0] = 0x00;
|
||||
dev->dev_addr[1] = 0x00;
|
||||
@@ -5216,9 +5215,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
|
||||
get_random_bytes(&dev->dev_addr[3], 3);
|
||||
}
|
||||
|
||||
dprintk(KERN_DEBUG "%s: MAC Address %02x:%02x:%02x:%02x:%02x:%02x\n", pci_name(pci_dev),
|
||||
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
|
||||
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
|
||||
dprintk(KERN_DEBUG "%s: MAC Address %s\n",
|
||||
pci_name(pci_dev), print_mac(mac, dev->dev_addr));
|
||||
|
||||
/* set mac address */
|
||||
nv_copy_mac_to_hw(dev);
|
||||
|
||||
Reference in New Issue
Block a user