linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jonas.jensen@gmail.com (Jonas Jensen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 5/6] net: MOXA ART: generate random address
Date: Mon, 25 Nov 2013 16:27:07 +0100	[thread overview]
Message-ID: <1385393228-22416-5-git-send-email-jonas.jensen@gmail.com> (raw)
In-Reply-To: <1385393228-22416-1-git-send-email-jonas.jensen@gmail.com>

The address register is zero:ed on boot, fill it with a randomly generated
address on probe.

Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---

Notes:
    Applies to next-20131125

 drivers/net/ethernet/moxa/moxart_ether.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
index d1c4a83..ef7a347 100644
--- a/drivers/net/ethernet/moxa/moxart_ether.c
+++ b/drivers/net/ethernet/moxa/moxart_ether.c
@@ -734,6 +734,12 @@ static int moxart_mac_probe(struct platform_device *pdev)
 		goto init_fail;
 	}
 
+	if (!is_valid_ether_addr(ndev->dev_addr)) {
+		eth_hw_addr_random(ndev);
+		netdev_info(ndev, "generated random MAC address %pM\n",
+			    ndev->dev_addr);
+	}
+
 	netdev_dbg(ndev, "%s: IRQ=%d address=%pM\n",
 		   __func__, ndev->irq, ndev->dev_addr);
 
-- 
1.8.2.1

  parent reply	other threads:[~2013-11-25 15:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-25 15:27 [PATCH v2 1/6] net: MOXA ART: clear TX descriptor length bits between sends Jonas Jensen
2013-11-25 15:27 ` [PATCH v2 2/6] net: MOXA ART: connect to PHY Jonas Jensen
2013-11-26  7:49   ` Florian Fainelli
2013-11-25 15:27 ` [PATCH v2 3/6] net: MOXA ART: add ethtool support Jonas Jensen
2013-11-25 15:36   ` Ben Hutchings
2013-11-25 15:27 ` [PATCH v2 4/6] net: MOXA ART: add IFF_LIVE_ADDR_CHANGE flag Jonas Jensen
2013-11-25 15:27 ` Jonas Jensen [this message]
2013-11-25 15:27 ` [PATCH v2 6/6] net: MOXA ART: use eth_mac_addr() Jonas Jensen
2013-11-28 23:36 ` [PATCH v2 1/6] net: MOXA ART: clear TX descriptor length bits between sends David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1385393228-22416-5-git-send-email-jonas.jensen@gmail.com \
    --to=jonas.jensen@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).