diff options
-rw-r--r-- | drivers/net/ethernet/davicom/dm9000.c | 11 | ||||
-rw-r--r-- | drivers/net/ethernet/micrel/ks8695net.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/netx-eth.c | 12 |
3 files changed, 20 insertions, 10 deletions
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index 9e061307975f..1471e16ba719 100644 --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c | |||
@@ -1432,6 +1432,7 @@ dm9000_probe(struct platform_device *pdev) | |||
1432 | int reset_gpios; | 1432 | int reset_gpios; |
1433 | enum of_gpio_flags flags; | 1433 | enum of_gpio_flags flags; |
1434 | struct regulator *power; | 1434 | struct regulator *power; |
1435 | bool inv_mac_addr = false; | ||
1435 | 1436 | ||
1436 | power = devm_regulator_get(dev, "vcc"); | 1437 | power = devm_regulator_get(dev, "vcc"); |
1437 | if (IS_ERR(power)) { | 1438 | if (IS_ERR(power)) { |
@@ -1686,9 +1687,7 @@ dm9000_probe(struct platform_device *pdev) | |||
1686 | } | 1687 | } |
1687 | 1688 | ||
1688 | if (!is_valid_ether_addr(ndev->dev_addr)) { | 1689 | if (!is_valid_ether_addr(ndev->dev_addr)) { |
1689 | dev_warn(db->dev, "%s: Invalid ethernet MAC address. Please " | 1690 | inv_mac_addr = true; |
1690 | "set using ifconfig\n", ndev->name); | ||
1691 | |||
1692 | eth_hw_addr_random(ndev); | 1691 | eth_hw_addr_random(ndev); |
1693 | mac_src = "random"; | 1692 | mac_src = "random"; |
1694 | } | 1693 | } |
@@ -1697,11 +1696,15 @@ dm9000_probe(struct platform_device *pdev) | |||
1697 | platform_set_drvdata(pdev, ndev); | 1696 | platform_set_drvdata(pdev, ndev); |
1698 | ret = register_netdev(ndev); | 1697 | ret = register_netdev(ndev); |
1699 | 1698 | ||
1700 | if (ret == 0) | 1699 | if (ret == 0) { |
1700 | if (inv_mac_addr) | ||
1701 | dev_warn(db->dev, "%s: Invalid ethernet MAC address. Please set using ip\n", | ||
1702 | ndev->name); | ||
1701 | printk(KERN_INFO "%s: dm9000%c at %p,%p IRQ %d MAC: %pM (%s)\n", | 1703 | printk(KERN_INFO "%s: dm9000%c at %p,%p IRQ %d MAC: %pM (%s)\n", |
1702 | ndev->name, dm9000_type_to_char(db->type), | 1704 | ndev->name, dm9000_type_to_char(db->type), |
1703 | db->io_addr, db->io_data, ndev->irq, | 1705 | db->io_addr, db->io_data, ndev->irq, |
1704 | ndev->dev_addr, mac_src); | 1706 | ndev->dev_addr, mac_src); |
1707 | } | ||
1705 | return 0; | 1708 | return 0; |
1706 | 1709 | ||
1707 | out: | 1710 | out: |
diff --git a/drivers/net/ethernet/micrel/ks8695net.c b/drivers/net/ethernet/micrel/ks8695net.c index a8522d8af95d..20cb85bc0c5f 100644 --- a/drivers/net/ethernet/micrel/ks8695net.c +++ b/drivers/net/ethernet/micrel/ks8695net.c | |||
@@ -1354,6 +1354,7 @@ ks8695_probe(struct platform_device *pdev) | |||
1354 | struct resource *rxirq_res, *txirq_res, *linkirq_res; | 1354 | struct resource *rxirq_res, *txirq_res, *linkirq_res; |
1355 | int ret = 0; | 1355 | int ret = 0; |
1356 | int buff_n; | 1356 | int buff_n; |
1357 | bool inv_mac_addr = false; | ||
1357 | u32 machigh, maclow; | 1358 | u32 machigh, maclow; |
1358 | 1359 | ||
1359 | /* Initialise a net_device */ | 1360 | /* Initialise a net_device */ |
@@ -1456,8 +1457,7 @@ ks8695_probe(struct platform_device *pdev) | |||
1456 | ndev->dev_addr[5] = maclow & 0xFF; | 1457 | ndev->dev_addr[5] = maclow & 0xFF; |
1457 | 1458 | ||
1458 | if (!is_valid_ether_addr(ndev->dev_addr)) | 1459 | if (!is_valid_ether_addr(ndev->dev_addr)) |
1459 | dev_warn(ksp->dev, "%s: Invalid ethernet MAC address. Please " | 1460 | inv_mac_addr = true; |
1460 | "set using ifconfig\n", ndev->name); | ||
1461 | 1461 | ||
1462 | /* In order to be efficient memory-wise, we allocate both | 1462 | /* In order to be efficient memory-wise, we allocate both |
1463 | * rings in one go. | 1463 | * rings in one go. |
@@ -1520,6 +1520,9 @@ ks8695_probe(struct platform_device *pdev) | |||
1520 | ret = register_netdev(ndev); | 1520 | ret = register_netdev(ndev); |
1521 | 1521 | ||
1522 | if (ret == 0) { | 1522 | if (ret == 0) { |
1523 | if (inv_mac_addr) | ||
1524 | dev_warn(ksp->dev, "%s: Invalid ethernet MAC address. Please set using ip\n", | ||
1525 | ndev->name); | ||
1523 | dev_info(ksp->dev, "ks8695 ethernet (%s) MAC: %pM\n", | 1526 | dev_info(ksp->dev, "ks8695 ethernet (%s) MAC: %pM\n", |
1524 | ks8695_port_type(ksp), ndev->dev_addr); | 1527 | ks8695_port_type(ksp), ndev->dev_addr); |
1525 | } else { | 1528 | } else { |
diff --git a/drivers/net/ethernet/netx-eth.c b/drivers/net/ethernet/netx-eth.c index 9fbc30264237..adbc47f2d132 100644 --- a/drivers/net/ethernet/netx-eth.c +++ b/drivers/net/ethernet/netx-eth.c | |||
@@ -313,7 +313,8 @@ static int netx_eth_enable(struct net_device *ndev) | |||
313 | { | 313 | { |
314 | struct netx_eth_priv *priv = netdev_priv(ndev); | 314 | struct netx_eth_priv *priv = netdev_priv(ndev); |
315 | unsigned int mac4321, mac65; | 315 | unsigned int mac4321, mac65; |
316 | int running, i; | 316 | int running, i, ret; |
317 | bool inv_mac_addr = false; | ||
317 | 318 | ||
318 | ndev->netdev_ops = &netx_eth_netdev_ops; | 319 | ndev->netdev_ops = &netx_eth_netdev_ops; |
319 | ndev->watchdog_timeo = msecs_to_jiffies(5000); | 320 | ndev->watchdog_timeo = msecs_to_jiffies(5000); |
@@ -358,15 +359,18 @@ static int netx_eth_enable(struct net_device *ndev) | |||
358 | xc_start(priv->xc); | 359 | xc_start(priv->xc); |
359 | 360 | ||
360 | if (!is_valid_ether_addr(ndev->dev_addr)) | 361 | if (!is_valid_ether_addr(ndev->dev_addr)) |
361 | printk("%s: Invalid ethernet MAC address. Please " | 362 | inv_mac_addr = true; |
362 | "set using ifconfig\n", ndev->name); | ||
363 | 363 | ||
364 | for (i=2; i<=18; i++) | 364 | for (i=2; i<=18; i++) |
365 | pfifo_push(EMPTY_PTR_FIFO(priv->id), | 365 | pfifo_push(EMPTY_PTR_FIFO(priv->id), |
366 | FIFO_PTR_FRAMENO(i) | FIFO_PTR_SEGMENT(priv->id)); | 366 | FIFO_PTR_FRAMENO(i) | FIFO_PTR_SEGMENT(priv->id)); |
367 | 367 | ||
368 | return register_netdev(ndev); | 368 | ret = register_netdev(ndev); |
369 | if (inv_mac_addr) | ||
370 | printk("%s: Invalid ethernet MAC address. Please set using ip\n", | ||
371 | ndev->name); | ||
369 | 372 | ||
373 | return ret; | ||
370 | } | 374 | } |
371 | 375 | ||
372 | static int netx_eth_drv_probe(struct platform_device *pdev) | 376 | static int netx_eth_drv_probe(struct platform_device *pdev) |