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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 10 Jan 2022 12:26:09 +0100
From:   Arend van Spriel <arend.vanspriel@...adcom.com>
To:     Hector Martin <marcan@...can.st>,
        Kalle Valo <kvalo@...eaurora.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <lenb@...nel.org>,
        Arend van Spriel <aspriel@...il.com>,
        Franky Lin <franky.lin@...adcom.com>,
        Hante Meuleman <hante.meuleman@...adcom.com>,
        Chi-hsien Lin <chi-hsien.lin@...ineon.com>,
        Wright Feng <wright.feng@...ineon.com>,
        Dmitry Osipenko <digetx@...il.com>
Cc:     Sven Peter <sven@...npeter.dev>,
        Alyssa Rosenzweig <alyssa@...enzweig.io>,
        Mark Kettenis <kettenis@...nbsd.org>,
        Rafał Miłecki <zajec5@...il.com>,
        Pieter-Paul Giesberts <pieter-paul.giesberts@...adcom.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Hans de Goede <hdegoede@...hat.com>,
        "John W. Linville" <linville@...driver.com>,
        "brian m. carlson" <sandals@...stytoothpaste.net>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-acpi@...r.kernel.org, brcm80211-dev-list.pdl@...adcom.com,
        SHA-cyfmac-dev-list@...ineon.com
Subject: Re: [PATCH v2 16/35] brcmfmac: acpi: Add support for fetching Apple
 ACPI properties

On 1/10/2022 12:07 PM, Hector Martin wrote:
> On 2022/01/10 18:11, Arend van Spriel wrote:
>> On 1/4/2022 8:26 AM, Hector Martin wrote:
>>> On DT platforms, the module-instance and antenna-sku-info properties
>>> are passed in the DT. On ACPI platforms, module-instance is passed via
>>> the analogous Apple device property mechanism, while the antenna SKU
>>> info is instead obtained via an ACPI method that grabs it from
>>> non-volatile storage.
>>>
>>> Add support for this, to allow proper firmware selection on Apple
>>> platforms.
>>>
>>> Signed-off-by: Hector Martin <marcan@...can.st>
>>> ---
>>>    .../broadcom/brcm80211/brcmfmac/Makefile      |  2 +
>>>    .../broadcom/brcm80211/brcmfmac/acpi.c        | 47 +++++++++++++++++++
>>>    .../broadcom/brcm80211/brcmfmac/common.c      |  1 +
>>>    .../broadcom/brcm80211/brcmfmac/common.h      |  9 ++++
>>>    4 files changed, 59 insertions(+)
>>>    create mode 100644 drivers/net/wireless/broadcom/brcm80211/brcmfmac/acpi.c
>>
>> [...]
>>
>>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/acpi.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/acpi.c
>>> new file mode 100644
>>> index 000000000000..2b1a4448b291
>>> --- /dev/null
>>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/acpi.c
>>> @@ -0,0 +1,47 @@
>>> +// SPDX-License-Identifier: ISC
>>> +/*
>>> + * Copyright The Asahi Linux Contributors
>>> + */
>>> +
>>> +#include <linux/acpi.h>
>>> +#include "debug.h"
>>> +#include "core.h"
>>> +#include "common.h"
>>> +
>>> +void brcmf_acpi_probe(struct device *dev, enum brcmf_bus_type bus_type,
>>> +		      struct brcmf_mp_device *settings)
>>> +{
>>> +	acpi_status status;
>>> +	const union acpi_object *o;
>>> +	struct acpi_buffer buf = {ACPI_ALLOCATE_BUFFER, NULL};
>>> +	struct acpi_device *adev = ACPI_COMPANION(dev);
>>> +
>>> +	if (!adev)
>>> +		return;
>>> +
>>> +	if (!ACPI_FAILURE(acpi_dev_get_property(adev, "module-instance",
>>> +						ACPI_TYPE_STRING, &o))) {
>>> +		brcmf_dbg(INFO, "ACPI module-instance=%s\n", o->string.pointer);
>>> +		settings->board_type = devm_kasprintf(dev, GFP_KERNEL,
>>> +						      "apple,%s",
>>> +						      o->string.pointer);
>>> +	} else {
>>> +		brcmf_dbg(INFO, "No ACPI module-instance\n");
>>
>> Do you need to obtain the antenna-sku when there is no module-instance?
> 
> In principle I don't think any machines would have antenna-sku and no
> module-instance, though the firmware selection will still work without
> it (it'll just end up using the DMI machine name instead).

Right. That was my assumption as well. I would bail out here and skip 
obtaining the antenna-sku.

>>
>>> +	}
>>> +
>>> +	status = acpi_evaluate_object(adev->handle, "RWCV", NULL, &buf);
>>
>> Can you clarify what the above does? What does the "RWCV" mean?
> 
> No idea what it *means* :-)
> 
> What it is, though, is the ACPI method name to get the antenna-sku.

Wow. So much for meaning-full naming ;-)

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4219 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ