From 11932efcf39b8a228b7b885c737723455f1ba23e Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 8 Sep 2021 14:29:36 +0100 Subject: [ecm] Use ACPI-provided system-specific MAC address if present MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the "system MAC address" provided within the DSDT/SSDT if such an address is available and has not already been assigned to a network device. Tested-by: Andreas Hammarskjöld Signed-off-by: Michael Brown --- src/drivers/net/ecm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/drivers/net/ecm.c b/src/drivers/net/ecm.c index 9160498..2f784d5 100644 --- a/src/drivers/net/ecm.c +++ b/src/drivers/net/ecm.c @@ -30,6 +30,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include #include #include +#include #include #include "ecm.h" @@ -93,6 +94,14 @@ int ecm_fetch_mac ( struct usb_function *func, int len; int rc; + /* Use system-specific MAC address, if present and not already used */ + if ( ( ( rc = acpi_mac ( hw_addr ) ) == 0 ) && + ! find_netdev_by_ll_addr ( ðernet_protocol, hw_addr ) ) { + DBGC ( usb, "USB %s using system-specific MAC %s\n", + func->name, eth_ntoa ( hw_addr ) ); + return 0; + } + /* Fetch MAC address string */ len = usb_get_string_descriptor ( usb, desc->mac, 0, buf, sizeof ( buf ) ); -- cgit v1.1