From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933285AbcETO1t (ORCPT ); Fri, 20 May 2016 10:27:49 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:37775 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932099AbcETO1q (ORCPT ); Fri, 20 May 2016 10:27:46 -0400 Date: Fri, 20 May 2016 16:27:42 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Mario_Limonciello@Dell.com Cc: kernel@kempniu.pl, mjg59@srcf.ucam.org, dvhart@infradead.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: Re: [PATCH v3 2/2] dell-laptop: Expose auxiliary MAC address if available Message-ID: <20160520142742.GA29844@pali> References: <1462811099-16897-1-git-send-email-mario_limonciello@dell.com> <1462811099-16897-2-git-send-email-mario_limonciello@dell.com> <20160511133251.GA3440@eudyptula.hq.kempniu.pl> <201605111841.54411@pali> <3afbad44903b4da88b1362e938850da8@ausx13mpc120.AMER.DELL.COM> <20160512084033.GW29844@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 12 May 2016 19:08:30 Mario_Limonciello@Dell.com wrote: > > > We do mirror the information in ACPI under the system bus: > > > > > > Scope (_SB) > > > { > > > Name (AMAC, Buffer (0x17) > > > { > > > "_AUXMAC_#847BEB5992D2#" > > > }) > > > } > > > > > > I don't know how to properly access this from the kernel side. I noticed > > that most drivers that reference ACPI nodes refer to devices, not something > > hanging off the system bus. > > > If you could advise the right way to go about that, I would appreciate it. > > > > So there are two ways how to read that MAC address. One is via SMM and > > one via ACPI. > > Yes, this isn't a general statement for read only static information, but in this case it is true. > > > You can also read ACPI buffer (name is probably \_SB.AMAC) with ACPI > > functions in kernel. Ask ACPI people, for correct API. I'm sure this is possible > > also without creating new ACPI driver... > > Thanks will do. I think that acpi_get_handle() and acpi_evaluate_object() methods are those which you want to use. > > > If I can access that, maybe it's better to do this directly as a patch to the > > Ethernet driver in question (r8152). > > > That's actually how it's handled on the OS side for Windows too from what I > > understand. > > > We have some FW bit set in them to indicate they're Dell Realtek products > > (don't have this detail yet). > > > When they see that bit they look for that ACPI buffer and use it to set the > > MAC address the OS sees. > > > > Maybe it should be better to chose same way as Windows drivers? Better > > ask on netdev mailing list and ping maintainers of that ethernet driver what > > they think about it. > > > > For me it sounds like a better solution (patching that ethernet driver) as > > exporting some non-standard sysfs node from kernel with MAC address and > > then using another tool which send that MAC address back to kernel. > > > > Great, thank you for your feedback. I'll wander down that rabbit hole. Ok, CC me next discussion. -- Pali Rohár pali.rohar@gmail.com