All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wadim Egorov <w.egorov@phytec.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] net: Set the actual ethaddr in register_preset_mac_address()
Date: Wed, 10 Jun 2015 08:44:11 +0200	[thread overview]
Message-ID: <5577DCBB.7090705@phytec.de> (raw)
In-Reply-To: <20150610043237.GT6325@pengutronix.de>

Hello Sascha,


On 10.06.2015 06:32, Sascha Hauer wrote:
> Hi Wadim,
>
> On Tue, Jun 09, 2015 at 09:04:25AM +0200, Wadim Egorov wrote:
>> Set the ethaddr for the current edev.
>>
>> Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
>> ---
>>   net/eth.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/net/eth.c b/net/eth.c
>> index 89bddba..03e0a2e 100644
>> --- a/net/eth.c
>> +++ b/net/eth.c
>> @@ -49,6 +49,7 @@ static void register_preset_mac_address(struct eth_device *edev, const char *eth
>>   	ethaddr_to_string(ethaddr, ethaddr_str);
>>   
>>   	if (is_valid_ether_addr(ethaddr)) {
>> +		memcpy(edev->ethaddr, ethaddr, 6);
>>   		dev_info(&edev->dev, "got preset MAC address: %s\n", ethaddr_str);
>>   		dev_set_param(&edev->dev, "ethaddr", ethaddr_str);
>>   	}
> In which case is this necessary? Normally a dev_set_param on "ethaddr"
> should already set edev->ethaddr, there should be no need to copy this
> manually.
>
> Sascha

when booting from ethernet on the AM335x, net_new() (called in net_udp_new)
will check if ethaddr is valid. This check fails, because ethaddr is not
set at this moment and a random MAC will be used.

Wadim
>


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-06-10  6:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-09  7:04 [PATCH] net: Set the actual ethaddr in register_preset_mac_address() Wadim Egorov
2015-06-10  4:32 ` Sascha Hauer
2015-06-10  6:44   ` Wadim Egorov [this message]
2015-06-10 11:28     ` AW: " Gabor Janak (g.janak@agilion.de)
2015-06-15  6:55     ` Sascha Hauer
2015-06-15  9:08       ` Wadim Egorov

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=5577DCBB.7090705@phytec.de \
    --to=w.egorov@phytec.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.