linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees
Date: Tue, 26 Jun 2007 10:58:53 -0500	[thread overview]
Message-ID: <468137BD.2040406@freescale.com> (raw)
In-Reply-To: <f7b7186d108fee941496ea15fd902474@kernel.crashing.org>

Segher Boessenkool wrote:

> It is not safe since you might happen upon a network device without
> "mac-address" property (since the device hasn't been used at boot in
> a real OF, or the firmware knows no mac address at all, etc.) and no
> "local-mac-address" either -- but it _does_ have an "address", and
> it can have an "address" with the correct semantics, not the broken
> stuff.
> 
> It's not very likely for this happens, sure :-)

Maybe we're using different definitions of "safe" here.  When I said the code was "safe", 
I meant that it if U-Boot puts the MAC address into the 'address' property only, 
of_get_mac_address() will safely detect that and use the address:

	pp = of_find_property(np, "address", NULL);
	if (pp && (pp->length == 6) && is_valid_ether_addr(pp->value))
		return pp->value;

It checks if the property exists, that it's 6 bytes long, and that it is a valid MAC 
address.  AFAIK, no version of U-Boot and no DTS file, past or present, will confuse this 
code.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

  reply	other threads:[~2007-06-26 15:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-22 19:33 [PATCH] powerpc: fix MAC address entries for 83xx, 85xx, and 86xx device trees Timur Tabi
2007-06-23 15:50 ` Segher Boessenkool
2007-06-25 12:50   ` Josh Boyer
2007-06-25 15:07   ` Timur Tabi
2007-06-25 15:46     ` Segher Boessenkool
2007-06-25 16:01       ` Timur Tabi
2007-06-26  7:40         ` Segher Boessenkool
2007-06-26 15:22           ` Timur Tabi
2007-06-26 15:42             ` Segher Boessenkool
2007-06-26 15:58               ` Timur Tabi [this message]
2007-06-25 16:19   ` Jon Loeliger

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=468137BD.2040406@freescale.com \
    --to=timur@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=segher@kernel.crashing.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).