pmaports/device/testing/linux-samsung-jxelte/0002-fix-usb-gadget-random-mac.patch

37 lines
1.1 KiB
Diff
Raw Normal View History

From 80287a9b00b966d2441336cd568a297629781251 Mon Sep 17 00:00:00 2001
From: "armel.guido" <armel.guido@gmx.com>
Date: Fri, 2 Feb 2024 15:34:04 -0300
Subject: [PATCH 2/5] fix usb gadget random mac
---
drivers/usb/gadget/function/u_ether.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index de5b83cb..e9677a1f 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -1257,18 +1257,13 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g, u8 ethaddr[ETH_ALEN],
if (get_ether_addr(dev_addr, net->dev_addr))
dev_warn(&g->dev,
"using random %s ethernet address\n", "self");
-#ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE
- memcpy(dev->host_mac, ethaddr, ETH_ALEN);
- printk(KERN_DEBUG "usb: set unique host mac\n");
-
-#else
if (get_ether_addr(host_addr, dev->host_mac))
dev_warn(&g->dev,
"using random %s ethernet address\n", "host");
if (ethaddr)
memcpy(ethaddr, dev->host_mac, ETH_ALEN);
-#endif
+
net->netdev_ops = &eth_netdev_ops;
net->ethtool_ops = &ops;
--
2.39.2