lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <ec7435e0529243a99f6949ee9efbede5@AUSX13MPS303.AMER.DELL.COM>
Date:   Tue, 20 Aug 2019 22:23:15 +0000
From:   <Charles.Hyde@...lteam.com>
To:     <linux-usb@...r.kernel.org>, <linux-acpi@...r.kernel.org>
CC:     <gregkh@...uxfoundation.org>, <Mario.Limonciello@...l.com>,
        <oliver@...kum.org>, <netdev@...r.kernel.org>,
        <nic_swsd@...ltek.com>
Subject: [RFC 4/4] net: cdc_ncm: Add ACPI MAC address pass through
 functionality

This change adds support to cdc_ncm for ACPI MAC address pass through
functionality that also exists in the Realtek r8152 driver.  This is in
support of Dell's Universal Dock D6000, to give it the same feature
capability as is currently available in Windows and advertized on Dell's
product web site.

Signed-off-by: Charles Hyde <charles.hyde@...lteam.com>
Cc: Mario Limonciello <mario.limonciello@...l.com>
Cc: Oliver Neukum <oliver@...kum.org>
Cc: linux-usb@...r.kernel.org
---
 drivers/net/usb/cdc_ncm.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index f77c8672f972..1f046acca6fc 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -52,6 +52,7 @@
 #include <linux/usb/usbnet.h>
 #include <linux/usb/cdc.h>
 #include <linux/usb/cdc_ncm.h>
+#include <acpi/acpi_mac_passthru.h>
 
 #if IS_ENABLED(CONFIG_USB_NET_CDC_MBIM)
 static bool prefer_mbim = true;
@@ -930,11 +931,18 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
 	usb_set_intfdata(ctx->control, dev);
 
 	if (ctx->ether_desc) {
+		struct sockaddr sa;
+
 		temp = usbnet_get_ethernet_addr(dev, ctx->ether_desc->iMACAddress);
 		if (temp) {
 			dev_dbg(&intf->dev, "failed to get mac address\n");
 			goto error2;
 		}
+		if (get_acpi_mac_passthru(&intf->dev, &sa) == 0) {
+			memcpy(dev->net->dev_addr, sa.sa_data, ETH_ALEN);
+			if (usbnet_set_ethernet_addr(dev) < 0)
+				usbnet_get_ethernet_addr(dev, ctx->ether_desc->iMACAddress);
+		}
 		dev_info(&intf->dev, "MAC-Address: %pM\n", dev->net->dev_addr);
 	}
 
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ