diff options
author | Joe Perches <joe@perches.com> | 2007-10-03 20:59:30 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:42 -0400 |
commit | 0795af5729b18218767fab27c44b1384f72dc9ad (patch) | |
tree | 67c16df84aa6ec219340b8ea1b5cfb0e8150a216 /drivers/net/netxen | |
parent | 95ea36275f3c9a1d3d04c217b4b576c657c4e70e (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/netxen')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 13 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_niu.c | 14 |
2 files changed, 9 insertions, 18 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 1b165a8c74f3..b9cde65e7f31 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -285,6 +285,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
285 | int valid_mac = 0; | 285 | int valid_mac = 0; |
286 | u32 val; | 286 | u32 val; |
287 | int pci_func_id = PCI_FUNC(pdev->devfn); | 287 | int pci_func_id = PCI_FUNC(pdev->devfn); |
288 | DECLARE_MAC_BUF(mac); | ||
288 | 289 | ||
289 | printk(KERN_INFO "%s \n", netxen_nic_driver_string); | 290 | printk(KERN_INFO "%s \n", netxen_nic_driver_string); |
290 | 291 | ||
@@ -573,15 +574,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
573 | memcpy(netdev->perm_addr, netdev->dev_addr, | 574 | memcpy(netdev->perm_addr, netdev->dev_addr, |
574 | netdev->addr_len); | 575 | netdev->addr_len); |
575 | if (!is_valid_ether_addr(netdev->perm_addr)) { | 576 | if (!is_valid_ether_addr(netdev->perm_addr)) { |
576 | printk(KERN_ERR "%s: Bad MAC address " | 577 | printk(KERN_ERR "%s: Bad MAC address %s.\n", |
577 | "%02x:%02x:%02x:%02x:%02x:%02x.\n", | 578 | netxen_nic_driver_name, |
578 | netxen_nic_driver_name, | 579 | print_mac(mac, netdev->dev_addr)); |
579 | netdev->dev_addr[0], | ||
580 | netdev->dev_addr[1], | ||
581 | netdev->dev_addr[2], | ||
582 | netdev->dev_addr[3], | ||
583 | netdev->dev_addr[4], | ||
584 | netdev->dev_addr[5]); | ||
585 | } else { | 580 | } else { |
586 | if (adapter->macaddr_set) | 581 | if (adapter->macaddr_set) |
587 | adapter->macaddr_set(adapter, | 582 | adapter->macaddr_set(adapter, |
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c index 05e0577a0e10..5b9e1b300fab 100644 --- a/drivers/net/netxen/netxen_nic_niu.c +++ b/drivers/net/netxen/netxen_nic_niu.c | |||
@@ -603,6 +603,7 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter, | |||
603 | int phy = physical_port[adapter->portnum]; | 603 | int phy = physical_port[adapter->portnum]; |
604 | unsigned char mac_addr[6]; | 604 | unsigned char mac_addr[6]; |
605 | int i; | 605 | int i; |
606 | DECLARE_MAC_BUF(mac); | ||
606 | 607 | ||
607 | for (i = 0; i < 10; i++) { | 608 | for (i = 0; i < 10; i++) { |
608 | temp[0] = temp[1] = 0; | 609 | temp[0] = temp[1] = 0; |
@@ -627,15 +628,10 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter, | |||
627 | if (i == 10) { | 628 | if (i == 10) { |
628 | printk(KERN_ERR "%s: cannot set Mac addr for %s\n", | 629 | printk(KERN_ERR "%s: cannot set Mac addr for %s\n", |
629 | netxen_nic_driver_name, adapter->netdev->name); | 630 | netxen_nic_driver_name, adapter->netdev->name); |
630 | printk(KERN_ERR "MAC address set: " | 631 | printk(KERN_ERR "MAC address set: %s.\n", |
631 | "%02x:%02x:%02x:%02x:%02x:%02x.\n", | 632 | print_mac(mac, addr)); |
632 | addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); | 633 | printk(KERN_ERR "MAC address get: %s.\n", |
633 | 634 | print_mac(mac, mac_addr)); | |
634 | printk(KERN_ERR "MAC address get: " | ||
635 | "%02x:%02x:%02x:%02x:%02x:%02x.\n", | ||
636 | mac_addr[0], | ||
637 | mac_addr[1], | ||
638 | mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); | ||
639 | } | 635 | } |
640 | return 0; | 636 | return 0; |
641 | } | 637 | } |