From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: netdev@vger.kernel.org, nobuhiro.iwamatsu.yj@renesas.com,
linux-sh@vger.kernel.org
Subject: Re: [PATCH v2] sh_eth: use random MAC address if no valid one supplied
Date: Mon, 29 Apr 2013 22:39:17 +0200 [thread overview]
Message-ID: <6838772.e2fl6QhECK@avalon> (raw)
In-Reply-To: <201304292349.43251.sergei.shtylyov@cogentembedded.com>
On Monday 29 April 2013 23:49:42 Sergei Shtylyov wrote:
> On Renesas R-Car based development boards, although a MAC address is printed
> on all the Ethernet port labels, U-Boot doesn't write a valid MAC address
> to the Ether MAHR/MALR registers (there's no storage provided for the Ether
> MAC address either), so we have to resort to using a random MAC address...
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> This patch is against the 'net-next.git' repository.
>
> Changes since the original posting:
> - don't break the message string into 2 lines.
>
> drivers/net/ethernet/renesas/sh_eth.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
> ===================================================================
> --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
> +++ net-next/drivers/net/ethernet/renesas/sh_eth.c
> @@ -2735,6 +2735,11 @@ static int sh_eth_drv_probe(struct platf
>
> /* read and set MAC address */
> read_mac_address(ndev, pd->mac_addr);
> + if (!is_valid_ether_addr(ndev->dev_addr)) {
> + dev_warn(&pdev->dev,
> + "no valid MAC address supplied, using a random one.\n");
> + eth_hw_addr_random(ndev);
> + }
>
> /* ioremap the TSU registers */
> if (mdp->cd->tsu) {
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-04-29 20:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-29 19:49 [PATCH v2] sh_eth: use random MAC address if no valid one supplied Sergei Shtylyov
2013-04-29 20:39 ` Laurent Pinchart [this message]
2013-04-30 2:01 ` Simon Horman
2013-04-30 19:37 ` David Miller
2013-04-30 20:18 ` Sergei Shtylyov
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=6838772.e2fl6QhECK@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-sh@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nobuhiro.iwamatsu.yj@renesas.com \
--cc=sergei.shtylyov@cogentembedded.com \
/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).