[U-Boot] [PATCH 06/14] net: core: Using an ethernet address from ROM is not bad

Olliver Schinagl oliver at schinagl.nl
Mon Nov 28 12:08:53 CET 2016



On November 28, 2016 12:06:37 PM CET, Michal Simek <michal.simek at xilinx.com> wrote:
>On 28.11.2016 11:48, Olliver Schinagl wrote:
>> On 28-11-16 08:59, Michal Simek wrote:
>>> On 25.11.2016 16:30, Olliver Schinagl wrote:
>>>> Currently we print a warning if the MAC address is read from
>>>> ROM/Hardware. This should not be concidered a bad or erronous
>thing. A
>>>> MAC address should come either from the hardware (ROM) or may be
>>>> set/overriden in the environment. Neither is a warning or error
>case.
>>>>
>>>> Worthy of a warning is the case where both are set, so the user is
>>>> atleast aware something special is happening.
>>>>
>>>> Signed-off-by: Olliver Schinagl <oliver at schinagl.nl>
>>>> ---
>>>>   net/eth-uclass.c | 2 --
>>>>   1 file changed, 2 deletions(-)
>>>>
>>>> diff --git a/net/eth-uclass.c b/net/eth-uclass.c
>>>> index 9703bea..aca3f6d 100644
>>>> --- a/net/eth-uclass.c
>>>> +++ b/net/eth-uclass.c
>>>> @@ -510,8 +510,6 @@ static int eth_post_probe(struct udevice *dev)
>>>>           memcpy(pdata->enetaddr, env_enetaddr, ARP_HLEN);
>>>>       } else if (is_valid_ethaddr(pdata->enetaddr)) {
>>>>           eth_setenv_enetaddr_by_index("eth", dev->seq,
>>>> pdata->enetaddr);
>>>> -        printf("\nWarning: %s using MAC address from ROM\n",
>>>> -               dev->name);
>>>>       } else if (is_zero_ethaddr(pdata->enetaddr)) {
>>>>   #ifdef CONFIG_NET_RANDOM_ETHADDR
>>>>           net_random_ethaddr(pdata->enetaddr);
>>>>
>>> User should be aware if mac is read from ROM or something else.
>>> Is there a way how to read it without this message to be generated?
>> I think what we need is a 'source' field here to be printed at the
>end.
>> I do agree the user will want to know WHERE the address came from
>(and
>> what it is). I do think the warning is misplaced here however.
>There's
>> nothing to be warned against.
>> 
>> I'll look into adding the feature that prints the source at the end
>(as
>> detailed as we can).
>
>Maybe enough here to remove that Warning from print message.
Well a later patch in this series does print it per interface.

Hence why my suggestion to add the source/from.

Olliver

>
>Thanks,
>Michal

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


More information about the U-Boot mailing list