[U-Boot] [PATCH v2 08/13] usb: gadget: ether: Provide a way to read MAC address

Vignesh R vigneshr at ti.com
Tue Jun 13 12:10:04 UTC 2017


Provide a way to read MAC address for usb_ether device from board
function. Board files can override board_set_usbnet_devaddr() to
populate MAC address to be used by usb_ether as device address.

Signed-off-by: Vignesh R <vigneshr at ti.com>
---
 drivers/usb/gadget/ether.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 4137d76c42af..8854e8eb004a 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -2619,6 +2619,10 @@ int usb_eth_initialize(bd_t *bi)
 	return 0;
 }
 #else
+void __weak board_set_usbnet_devaddr(void)
+{
+}
+
 static int usb_eth_start(struct udevice *dev)
 {
 	struct ether_priv *priv = dev_get_priv(dev);
@@ -2683,6 +2687,8 @@ static int usb_eth_probe(struct udevice *dev)
 
 	priv->netdev = dev;
 	l_priv = priv;
+	/* Get MAC address for USB ETH interface */
+	board_set_usbnet_devaddr();
 
 	get_ether_addr(CONFIG_USBNET_DEVADDR, pdata->enetaddr);
 	eth_setenv_enetaddr("usbnet_devaddr", pdata->enetaddr);
-- 
2.13.0



More information about the U-Boot mailing list