From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: ethernet "bus" number in DTS ? Date: Tue, 23 Oct 2018 10:03:36 -0700 Message-ID: <518e0cf1-ef7e-b251-a153-34e01a80267d@gmail.com> References: <88328977dfeaf667a98d791074b721fe730d285b.camel@infinera.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: andrew@lunn.ch To: Joakim Tjernlund , "linuxppc-dev@lists.ozlabs.org" , "netdev@vger.kernel.org" Return-path: Received: from mail-wm1-f65.google.com ([209.85.128.65]:52633 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728065AbeJXB2C (ORCPT ); Tue, 23 Oct 2018 21:28:02 -0400 Received: by mail-wm1-f65.google.com with SMTP id 189-v6so2566356wmw.2 for ; Tue, 23 Oct 2018 10:03:48 -0700 (PDT) In-Reply-To: <88328977dfeaf667a98d791074b721fe730d285b.camel@infinera.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 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