diff mbox

[U-Boot,PATCHv6,10/28] net: core: Inform the user of the device MAC address

Message ID 20170515080244.21345-11-oliver@schinagl.nl
State Changes Requested
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Olliver Schinagl May 15, 2017, 8:02 a.m. UTC
In certain conditions we currently print the MAC address. For example a
warning when a random mac address is in use or a missmatch between HW
and ENV.

If all things went well however (but even if there is a miss-match) we
do not inform the user what the final MAC address of the device is.

Lets print the final MAC address of the device with which it has been
setup.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
---
 net/eth-uclass.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Joe Hershberger May 30, 2017, 9:08 p.m. UTC | #1
On Mon, May 15, 2017 at 3:02 AM, Olliver Schinagl <oliver@schinagl.nl> wrote:
> In certain conditions we currently print the MAC address. For example a
> warning when a random mac address is in use or a missmatch between HW
> and ENV.
>
> If all things went well however (but even if there is a miss-match) we
> do not inform the user what the final MAC address of the device is.
>
> Lets print the final MAC address of the device with which it has been
> setup.
>
> Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
diff mbox

Patch

diff --git a/net/eth-uclass.c b/net/eth-uclass.c
index c3cc3152a2..781376955a 100644
--- a/net/eth-uclass.c
+++ b/net/eth-uclass.c
@@ -413,11 +413,12 @@  int eth_initialize(void)
 		}
 
 		bootstage_mark(BOOTSTAGE_ID_NET_ETH_INIT);
+		putc('\n');
 		do {
-			if (num_devices)
-				printf(", ");
+			struct eth_pdata *pdata = dev->platdata;
 
-			printf("eth%d: %s", dev->seq, dev->name);
+			printf("eth%d:  %s [%pM]\n", dev->seq, dev->name,
+						     pdata->enetaddr);
 
 			if (ethprime && dev == prime_dev)
 				printf(" [PRIME]");
@@ -525,6 +526,8 @@  static int eth_post_probe(struct udevice *dev)
 #endif
 	}
 
+	printf("%s ", dev->name);
+
 	return 0;
 }