aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igbvf
diff options
context:
space:
mode:
authorDanny Kukawka <danny.kukawka@bisect.de>2012-02-09 04:48:54 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-13 00:46:41 -0500
commit1a0d6ae5795c376bae6d012fb25e8341e4c6d5f2 (patch)
tree476d4b0b06ed78ec57f73f8dde182afc083b2b43 /drivers/net/ethernet/intel/igbvf
parentc8585bd89e2e3c87eab6ca711e09b3af20fd469b (diff)
rename dev_hw_addr_random and remove redundant second
Renamed dev_hw_addr_random to eth_hw_addr_random() to reflect that this function only assign a random ethernet address (MAC). Removed the second parameter (u8 *hwaddr), it's redundant since the also given net_device already contains net_device->dev_addr. Set it directly. Adapt igbvf and ixgbevf to the changed function. Small fix for ixgbevf_probe(): if ixgbevf_sw_init() fails (which means the device got no dev_addr) handle the error and jump to err_sw_init as already done by igbvf in similar case. Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/igbvf')
-rw-r--r--drivers/net/ethernet/intel/igbvf/netdev.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 446297ff0104..92956e80fd1b 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -2712,18 +2712,19 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
2712 dev_info(&pdev->dev, 2712 dev_info(&pdev->dev,
2713 "PF still in reset state, assigning new address." 2713 "PF still in reset state, assigning new address."
2714 " Is the PF interface up?\n"); 2714 " Is the PF interface up?\n");
2715 dev_hw_addr_random(adapter->netdev, hw->mac.addr); 2715 eth_hw_addr_random(netdev);
2716 memcpy(adapter->hw.mac.addr, netdev->dev_addr,
2717 netdev->addr_len);
2716 } else { 2718 } else {
2717 err = hw->mac.ops.read_mac_addr(hw); 2719 err = hw->mac.ops.read_mac_addr(hw);
2718 if (err) { 2720 if (err) {
2719 dev_err(&pdev->dev, "Error reading MAC address\n"); 2721 dev_err(&pdev->dev, "Error reading MAC address\n");
2720 goto err_hw_init; 2722 goto err_hw_init;
2721 } 2723 }
2724 memcpy(netdev->dev_addr, adapter->hw.mac.addr,
2725 netdev->addr_len);
2722 } 2726 }
2723 2727
2724 memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
2725 memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
2726
2727 if (!is_valid_ether_addr(netdev->perm_addr)) { 2728 if (!is_valid_ether_addr(netdev->perm_addr)) {
2728 dev_err(&pdev->dev, "Invalid MAC Address: %pM\n", 2729 dev_err(&pdev->dev, "Invalid MAC Address: %pM\n",
2729 netdev->dev_addr); 2730 netdev->dev_addr);
@@ -2731,6 +2732,8 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
2731 goto err_hw_init; 2732 goto err_hw_init;
2732 } 2733 }
2733 2734
2735 memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
2736
2734 setup_timer(&adapter->watchdog_timer, &igbvf_watchdog, 2737 setup_timer(&adapter->watchdog_timer, &igbvf_watchdog,
2735 (unsigned long) adapter); 2738 (unsigned long) adapter);
2736 2739