[PATCH 1/3] net: give a different name to rtl8169 interfaces

Etienne Dublé etienne.duble at imag.fr
Tue Jun 25 08:38:53 CEST 2024


Hi Quentin,

Thanks for reviewing my patches.

Le 24/06/2024 à 15:08, Quentin Schulz a écrit :
> [...]
>
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
>> index 93e83661ce..b30d51731f 100644
>> --- a/drivers/net/rtl8169.c
>> +++ b/drivers/net/rtl8169.c
>> @@ -1091,6 +1091,16 @@ static int rtl8169_eth_probe(struct udevice *dev)
>>       return 0;
>>   }
>>   +static int rtl8169_eth_bind(struct udevice *dev)
>> +{
>> +    static int card_number;
>> +    char name[16];
>> +
>> +    sprintf(name, "RTL8169#%u", card_number++);
>> +
>> +    return device_set_name(dev, name);
>> +}
>> +
>
> I don't think we can guarantee bind order so this may not be stable 
> over time.
>
> I'm wondering if there isn't a way to use the "ethernet" (ethernet0, 
> ethernet1) alias in DT instead?

Actually the ethernet interfaces are not declared in the device tree, 
only PCI buses are (at least on this Nanopi board).
The ethernet interfaces are only detected when running "pci enum".

Another option may be to name them "rtl8169@<hexa>", with "<hexa>" 
reflecting the PCI region address (so it is unique and stable). What do 
you think?

Cheers,
Etienne


-- 
Etienne Dublé
CNRS / LIG - Bâtiment IMAG
700 avenue Centrale - 38401 St Martin d'Hères
Bureau 426 - Tel 0457421431



More information about the U-Boot mailing list