linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: andrew@lunn.ch
Subject: Re: ethernet "bus" number in DTS ?
Date: Tue, 23 Oct 2018 10:03:36 -0700	[thread overview]
Message-ID: <518e0cf1-ef7e-b251-a153-34e01a80267d@gmail.com> (raw)
In-Reply-To: <88328977dfeaf667a98d791074b721fe730d285b.camel@infinera.com>

On 10/23/18 9:49 AM, Joakim Tjernlund wrote:
> SPI (and others) has a way to define bus number in a aliases:
> 	aliases {
> 		ethernet4 = &enet4;
> 		ethernet0 = &enet0;
> 		ethernet1 = &enet1;
> 		ethernet2 = &enet2;
> 		ethernet3 = &enet3;
> 		spi0 = &spi0
> 	};
> The 0 in the spi0 alias will translate to bus num 0 so one can control the /dev nodes, like /dev/spidev0
> I am looking for the same for ethernet devices:
>  ethernet4 = &enet4;  /* should become eth4 */
>  ethernet0 = &enet0;  /* should become eth0 */
> but I cannot find something like that for eth devices.
> 
> Could such functionality be added?

It could, do we want and need to, no. You have the Ethernet alias in
/sys/class/net/*/device/uevent already that would allow you to perform
that (re)naming in user-space:

# cat /sys/class/net/eth0/device/uevent
DRIVER=bcmgenet
OF_NAME=ethernet
OF_FULLNAME=/rdb/ethernet@f0480000
OF_TYPE=network
OF_COMPATIBLE_0=brcm,genet-v5
OF_COMPATIBLE_N=1
OF_ALIAS_0=eth0			<==================
MODALIAS=of:NethernetTnetworkCbrcm,genet-v5
-- 
Florian

  reply	other threads:[~2018-10-23 17:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23 16:49 ethernet "bus" number in DTS ? Joakim Tjernlund
2018-10-23 17:03 ` Florian Fainelli [this message]
2018-10-23 18:02   ` Joakim Tjernlund
2018-10-23 18:20     ` Florian Fainelli
2018-10-23 20:02       ` Joakim Tjernlund
2018-10-23 20:07         ` Florian Fainelli
2018-10-23 22:15           ` Joakim Tjernlund
2018-10-24  6:22       ` Michal Suchánek
2018-10-26 13:00         ` Joakim Tjernlund
2018-10-26 22:57         ` Florian Fainelli
2018-10-28 18:25           ` Michal Suchánek
2018-10-23 17:08 ` Andrew Lunn

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=518e0cf1-ef7e-b251-a153-34e01a80267d@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=Joakim.Tjernlund@infinera.com \
    --cc=andrew@lunn.ch \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.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).