[U-Boot] Add Ethernet hardware MAC address framework to usbnet -- issues??

Simon Glass sjg at chromium.org
Tue Aug 30 17:46:26 CEST 2011


Hi Kumar,

On Tue, Aug 30, 2011 at 7:19 AM, Kumar Gala <galak at kernel.crashing.org> wrote:
> With the following commit I now see:
>
> commit 7616e7850804c7c69e0a22c179dfcba9e8f3f587
> Author: Simon Glass <sjg at chromium.org>
> Date:   Mon Jun 13 16:13:10 2011 -0700
>
>   Add Ethernet hardware MAC address framework to usbnet
>
>   Built-in Ethernet adapters support setting the mac address by means of a
>   ethaddr environment variable for each interface (ethaddr, eth1addr, eth2addr).
>
>   This adds similar support to the USB network side, using the names
>   usbethaddr, usbeth1addr, etc. They are kept separate since we don't want
>   a USB device taking the MAC address of a built-in device or vice versa.
>
>   Signed-off-by: Simon Glass <sjg at chromium.org>
>   Tested-by: Eric Bénard <eric at eukrea.com>
>
> messages like:
>
> Warning: failed to set MAC address
>
> However, I don't see how this ever works properly as we do:
>
>                       if (eth_write_hwaddr(dev, NULL, eth_number))
>
> this ends up calling:
>
> eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr)
>
> but base_name was passed in as NULL.
>
> So we lookup env strings like:
>
> <NULL>1addr
> <NULL>2addr
> <NULL>3addr
>
> etc., seems wrong.

Yes you are right. I dropped the handling of NULL from
eth_getenv_enetaddr_by_index() in patch version 5 (due to review
request) but did not add "eth" back into the eth.c call. This then
carried on through the following patches. I will send a patch to fix
this.

Regards,
Simon

>
> - k
>
>


More information about the U-Boot mailing list