Subject: Re: [PATCH 06/17] Document the linux,network-index property.

From: David Gibson <[email-masked]>
Date: Thu, 22 Mar 2007 11:29:11 +1100

On Wed, Mar 21, 2007 at 07:57:33PM +0100, Segher Boessenkool wrote:
> > Segher, what is the the 'other alias' mechanism you are referring
> > to that should be dropped?  Is it this proposed linux,network-index
> > property?  or something else?
> 
> Just the
> 
> 	pic0: pic@700 {
> 		...
> 	}
> 
> labeling thing -- it becomes redundant when the flat tree
> stuff would support OF-style aliases, so it can be phased
> out then.

dtc labels are *not* an alias mechanism: they're essentially a
compile-time rather than run-time concept and they can reference
properties as well as nodes (and in fact I'd like eventually to extend
them to allow labels inside property values).

> For who doesn't know the aliases thing, it looks like this:
> 
> / {
> 	aliases {
> 		pic0 = "/some/path/to/pic@700";
> 		pic1 = "/some/path/to/pic@800";
> 
> 		enet  = "/some/path/to/some/ethernet";
> 		enet0 = "/some/path/to/some/ethernet";
> 		enet1 = "/some/path/to/some/other/ethernet";
> 		enet2 = "/some/path/to/yet/another/ethernet";

Putting the aliases in a separate node is far less usable for the
things labels are useful for than putting the label directly on the
node.  Replacing labels with the OF alias mechanism is not sensible.

That said, auto-generating OF-style aliases from labels for the
benefit of run-time users might be worthwhile.  And using /aliases
would work about as well as the "linux,network-index" trick.

> etc.  Note you can have multiple aliases to the same
> node, that comes in quite handy sometimes (like "disk"
> is the default boot disk, ...)
> 
> Path name resolution looks at the aliases whenever
> a path name doesn't start with a '/' character.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson