Devices: add vendor names for ACPI devices when available

files can be updated so:
curl --fail -L -o acpi_id_registry.html 'https://uefi.org/uefi-acpi-export'
curl --fail -L -o pnp_id_registry.html 'https://uefi.org/uefi-pnp-export'

Change-Id: Id0456f925729c635c5e2d43f80e9e016483b2611
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5753
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Jérôme Duval 2022-10-21 16:28:38 +02:00
parent 93e536ab5d
commit 74622d8051
5 changed files with 2762 additions and 16 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008-2019 Haiku Inc. All rights reserved.
* Copyright 2008-2022 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -15,10 +15,27 @@
#include <Catalog.h>
extern "C" {
#include "acpipnpids.h"
}
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "DeviceACPI"
void
acpi_get_vendor_info(const char* vendorID, const char **vendorName)
{
for (size_t i = 0; i < ACPIPNP_DEVTABLE_LEN; i++) {
if (strncmp(acpipnp_devids[i].VenId, vendorID, strlen(acpipnp_devids[i].VenId)) == 0) {
*vendorName = acpipnp_devids[i].VenName;
return;
}
}
*vendorName = NULL;
}
DeviceACPI::DeviceACPI(Device* parent)
:
Device(parent)
@ -34,10 +51,10 @@ DeviceACPI::~DeviceACPI()
void
DeviceACPI::InitFromAttributes()
{
BString outlineName;
BString nodeACPIPath;
BString rootACPIPath;
BString nodeACPIHid;
BString deviceName;
rootACPIPath = nodeACPIPath = GetAttribute("acpi/path").fValue;
nodeACPIHid = GetAttribute("acpi/hid").fValue;
@ -52,39 +69,50 @@ DeviceACPI::InitFromAttributes()
// Identify Predefined root namespaces (ACPI Spec 4.0a, p162)
if (rootACPIPath == "\\_SB_") {
outlineName = B_TRANSLATE("ACPI System Bus");
deviceName = B_TRANSLATE("ACPI System Bus");
} else if (rootACPIPath == "\\_TZ_") {
outlineName = B_TRANSLATE("ACPI Thermal Zone");
deviceName = B_TRANSLATE("ACPI Thermal Zone");
} else if (rootACPIPath == "\\_PR_.") {
// This allows to localize apostrophes, too
BString string(B_TRANSLATE("ACPI Processor Namespace '%2'"));
string.ReplaceFirst("%2", nodeACPIPath);
// each CPU node is considered a root node
outlineName << string.String();
deviceName << string.String();
} else if (rootACPIPath == "\\_SI_") {
outlineName = B_TRANSLATE("ACPI System Indicator");
deviceName = B_TRANSLATE("ACPI System Indicator");
} else if (nodeACPIPath != "") {
// This allows to localize apostrophes, too
BString string(B_TRANSLATE("ACPI node '%1'"));
string.ReplaceFirst("%1", nodeACPIPath);
outlineName << string.String();
deviceName << string.String();
} else if (nodeACPIPath == "" && nodeACPIHid != "") {
// Handle ACPI HID entries that do not return a path
nodeACPIHid.Remove(0, nodeACPIHid.FindLast("_") + 1);
BString string(B_TRANSLATE("ACPI Button '%1'"));
string.ReplaceFirst("%1", nodeACPIHid);
outlineName << string.String();
deviceName << string.String();
} else {
BString string(B_TRANSLATE("ACPI <unknown>"));
outlineName << string.String();
}
deviceName << string.String();
}
SetAttribute(B_TRANSLATE("Device name"), outlineName.String());
#if 0
// These are a source of confusion for users.
// Until we can display something useful, let's not show the lines at all.
SetAttribute(B_TRANSLATE("Manufacturer"), B_TRANSLATE("Not implemented"));
#endif
// Fetch ManufacturerName
const char* vendorName = NULL;
BString manufacturerLabel;
if (nodeACPIHid != "")
acpi_get_vendor_info(nodeACPIHid, &vendorName);
if (vendorName == NULL) {
manufacturerLabel << B_TRANSLATE("Unknown");
} else {
manufacturerLabel << vendorName;
};
SetAttribute(B_TRANSLATE("Device name"), deviceName.String());
SetAttribute(B_TRANSLATE("Manufacturer"), manufacturerLabel);
BString outlineName;
if (vendorName != NULL)
outlineName << vendorName << " ";
outlineName << deviceName;
SetText(outlineName.String());
}

View File

@ -65,6 +65,30 @@ SEARCH on $(usbidsFile) = [ FDirName $(HAIKU_TOP) src data ids ] ;
USBHeaderGen [ FGristFiles usbhdr.h ] : $(usbidsFile) : usb-header.awk ;
rule ACPIPnPHeaderGen
{
SEARCH on $(2) = $(SEARCH_SOURCE) ;
Depends $(1) : $(2) $(3) ;
MakeLocateArch $(<) ;
ACPIPnPHeaderGen1 $(1) : $(2) $(3) ;
LocalClean clean : $(<) ;
}
actions ACPIPnPHeaderGen1
{
awk -f $(2[1]) $(2[2-]) > $(1) ;
}
# files can be updated so:
# curl --fail -L -o acpi_id_registry.html 'https://uefi.org/uefi-acpi-export'
# curl --fail -L -o pnp_id_registry.html 'https://uefi.org/uefi-pnp-export'
local acpiidsFiles = acpi_id_registry.html pnp_id_registry.html ;
SEARCH on $(acpiidsFiles) = [ FDirName $(HAIKU_TOP) src data ids ] ;
ACPIPnPHeaderGen [ FGristFiles acpipnpids.h ]
: acpipnplist2h.awk : $(acpiidsFiles) ;
Application Devices :
DevicesApplication.cpp
DevicesView.cpp
@ -94,5 +118,7 @@ DoCatalogs Devices :
Device.cpp
;
Includes [ FGristFiles DeviceACPI.cpp ] : [ FGristFiles acpipnpids.h ] ;
Includes [ FGristFiles DevicePCI.cpp ] : [ FGristFiles pcihdr.h ] ;
Includes [ FGristFiles DeviceUSB.cpp ] : [ FGristFiles usbhdr.h ] ;

View File

@ -0,0 +1,41 @@
#!/bin/awk
# Copyright 2022, Haiku.
# Distributed under the terms of the MIT License.
#
# Authors:
# Jérôme Duval, jerome.duval@gmail.com
#
# run as awk -f acpipnplist2h.awk pnp_id_registry.html acpi_id_registry.html
BEGIN {
FS="</*td>"
}
NR == 1 {
printf("/*\tHaiku" "$\t*/\n\n")
printf("/*\n")
printf(" This file is generated automatically. Don't edit. \n")
printf("\n*/")
}
NF > 0 {
if ($2) {
n++
ids[n, 1] = $4;
ids[n, 2] = $2;
}
}
END {
printf("\n")
printf("typedef struct { const char* VenId; const char* VenName; } idTable;\n")
printf("idTable acpipnp_devids [] = {\n")
for (i = 1; i <= n; i++) {
printf("\t{\n")
printf("\t\t\"%s\", \"%s\"\n", ids[i,1], ids[i,2])
printf("\t},\n")
}
printf("\t};\n")
printf("// Use this value for loop control during searching:\n")
printf("#define ACPIPNP_DEVTABLE_LEN %i\n", n)
}

View File

@ -0,0 +1,122 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<table>
<thead><tr><th>Company</th><th>ACPI ID</th><th>Approved on Date</th></tr></thead> <tbody> <tr class="odd"><td>Aava Mobile Oy</td><td>AAVA</td><td>04/02/2014</td> </tr>
<tr class="even"><td>AMD</td><td>AMDI</td><td>08/06/2014</td> </tr>
<tr class="odd"><td>Applied Micro Circuits Corporation</td><td>APMC</td><td>11/14/2013</td> </tr>
<tr class="even"><td>Aptina Imaging Corporation</td><td>APTA</td><td>10/28/2013</td> </tr>
<tr class="odd"><td>ARM Ltd.</td><td>ARMH</td><td>08/13/2012</td> </tr>
<tr class="even"><td>ARM Ltd.</td><td>ARML</td><td>02/24/2015</td> </tr>
<tr class="odd"><td>ASUS</td><td>ASUS</td><td>09/13/2012</td> </tr>
<tr class="even"><td>Atmel</td><td>ATML</td><td>11/17/2011</td> </tr>
<tr class="odd"><td>AuthenTec</td><td>AUTH</td><td>06/01/2012</td> </tr>
<tr class="even"><td>Broadcom Corporation</td><td>BRCM</td><td>05/14/2015</td> </tr>
<tr class="odd"><td>Capella Microsystems Inc.</td><td>CPLM</td><td>05/09/2012</td> </tr>
<tr class="even"><td>Dell, Inc.</td><td>DLLK</td><td>04/17/2012</td> </tr>
<tr class="odd"><td>Dell, Inc.</td><td>DELL</td><td>07/26/2012</td> </tr>
<tr class="even"><td>ELAN MICROELECTRONICS CORPORATION</td><td>ELAN</td><td>11/14/2014</td> </tr>
<tr class="odd"><td>Everest Semiconductor Co., Ltd.</td><td>ESSX</td><td>11/17/2014</td> </tr>
<tr class="even"><td>FocalTech Systems Co., Ltd.</td><td>FTSC</td><td>07/23/2013</td> </tr>
<tr class="odd"><td>Freescale, Inc</td><td>FRSC</td><td>01/01/2010</td> </tr>
<tr class="even"><td>Fuzhou Rockchip Electronics Co., Ltd.</td><td>RKCP</td><td>07/20/2015</td> </tr>
<tr class="odd"><td>Google, Inc.</td><td>GOOG</td><td>12/05/2013</td> </tr>
<tr class="even"><td>Hewlett-Packard Company</td><td>HPQC</td><td>11/26/2012</td> </tr>
<tr class="odd"><td>Hewlett Packard Enterprise</td><td>HWPE</td><td>01/15/2015</td> </tr>
<tr class="even"><td>Himax Technologies, Inc.</td><td>HIMX</td><td>03/19/2014</td> </tr>
<tr class="odd"><td>HiSilicon Technologies Co., Ltd.</td><td>HISI</td><td>11/14/2014</td> </tr>
<tr class="even"><td>HP Inc. </td><td>HPIC</td><td>01/15/2015</td> </tr>
<tr class="odd"><td>HTBLuVA Mödling</td><td>HTLM</td><td>02/18/2014</td> </tr>
<tr class="even"><td>IBM</td><td>IBMX</td><td>11/15/2012</td> </tr>
<tr class="odd"><td>Impinj</td><td>IMPJ</td><td>08/14/2012</td> </tr>
<tr class="even"><td>Inphi Corporation</td><td>IPHI</td><td>07/15/2014</td> </tr>
<tr class="odd"><td>Intel Corporation</td><td>ACPI</td><td>11/18/2011</td> </tr>
<tr class="even"><td>Intel Corporation</td><td>INTC</td><td>01/01/2010</td> </tr>
<tr class="odd"><td>Intel Corporation</td><td>INTL</td><td>01/01/2010</td> </tr>
<tr class="even"><td>Invensense, Inc</td><td>INVN</td><td>02/09/2012</td> </tr>
<tr class="odd"><td>IP3 Technology Ltd.</td><td>IP3T</td><td>11/11/2013</td> </tr>
<tr class="even"><td>Kionix, Inc.</td><td>KIOX</td><td>12/23/2013</td> </tr>
<tr class="odd"><td>Lenovo Beijing Co. Ltd.</td><td>IDEA</td><td>05/22/2012</td> </tr>
<tr class="even"><td>Linaro, Ltd.</td><td>LNRO</td><td>11/26/2013</td> </tr>
<tr class="odd"><td>Microsoft Corporation</td><td>MSAY</td><td>03/01/2012</td> </tr>
<tr class="even"><td>Microsoft Corporation</td><td>MSFT</td><td>01/01/2010</td> </tr>
<tr class="odd"><td>Microsoft Corporation</td><td>MSHW</td><td>01/10/2011</td> </tr>
<tr class="even"><td>MIPI Alliance</td><td>MIPI</td><td>04/17/2015</td> </tr>
<tr class="odd"><td>Nuvoton Technology Corporation</td><td>NVTN</td><td>11/14/2014</td> </tr>
<tr class="even"><td>Nvidia</td><td>NVDA</td><td>01/01/2010</td> </tr>
<tr class="odd"><td>OmniVision Technologies, Inc.</td><td>OVTI</td><td>02/26/2014</td> </tr>
<tr class="even"><td>Pegatron Corporation</td><td>PEGA</td><td>08/27/2013</td> </tr>
<tr class="odd"><td>Qualcomm Inc</td><td>QCOM</td><td>01/01/2010</td> </tr>
<tr class="even"><td>REALTEK Semiconductor Corp. </td><td>OBDA</td><td>11/07/2013</td> </tr>
<tr class="odd"><td>Red Hat, Inc.</td><td>QEMU</td><td>07/30/2015</td> </tr>
<tr class="even"><td>Robert Bosch GmbH</td><td>BOSC</td><td>05/16/2014</td> </tr>
<tr class="odd"><td>Rozsnyó, s.r.o.</td><td>RZSN</td><td>03/24/2014</td> </tr>
<tr class="even"><td>Sharp Corporation</td><td>SHRP</td><td>01/27/2015</td> </tr>
<tr class="odd"><td>Shenzhen DSO Microelectronics Co.,Ltd.</td><td>DSUO</td><td>10/10/2013</td> </tr>
<tr class="even"><td>Shenzhen South-Top Computer Co., Ltd.</td><td>ST86</td><td>12/06/2013</td> </tr>
<tr class="odd"><td>Shenzhen three Connaught Information Technology Co., Ltd. (3nod Group)</td><td>3NOD</td><td>09/23/2013</td> </tr>
<tr class="even"><td>Sierra Wireless</td><td>SWEM</td><td>01/22/2013</td> </tr>
<tr class="odd"><td>Sony Corporation</td><td>SONY</td><td>09/12/2012</td> </tr>
<tr class="even"><td>Synaptics Inc</td><td>SYNA</td><td>11/17/2011</td> </tr>
<tr class="odd"><td>Teracue AG</td><td>TCAG</td><td>12/07/2012</td> </tr>
<tr class="even"><td>Texas Instruments</td><td>TXNW</td><td>01/01/2010</td> </tr>
<tr class="odd"><td>The Linux Foundation</td><td>LNUX</td><td>04/04/2014</td> </tr>
<tr class="even"><td>Dynabook Inc.</td><td>TOSB</td><td>07/07/2015</td> </tr>
<tr class="odd"><td>VAIO Corporation</td><td>VAIO</td><td>04/18/2014</td> </tr>
<tr class="even"><td>Validity Sensors, Inc</td><td>VFSI</td><td>06/17/2013</td> </tr>
<tr class="odd"><td>Wacom</td><td>WCOM</td><td>11/17/2011</td> </tr>
<tr class="even"><td>Winsider Seminars &amp; Solutions Inc.</td><td>WSDR</td><td>07/07/2015</td> </tr>
<tr class="odd"><td>Maxim Integrated</td><td>MXIM</td><td>10/16/2015</td> </tr>
<tr class="even"><td>Xiaomi Inc.</td><td>XMCC</td><td>12/08/2015</td> </tr>
<tr class="odd"><td>u-blox AG</td><td>UBLX</td><td>12/08/2015</td> </tr>
<tr class="even"><td>Raydium Semiconductor Corporation</td><td>RAYD</td><td>04/13/2016</td> </tr>
<tr class="odd"><td>Dialog Semiconductor PLC</td><td>DLGS</td><td>04/27/2016</td> </tr>
<tr class="even"><td>OmniPreSense</td><td>OMPS</td><td>05/25/2016</td> </tr>
<tr class="odd"><td>CoreOS, Inc</td><td>CORE</td><td>07/01/2016</td> </tr>
<tr class="even"><td>Microchip Technology Inc</td><td>MCHP</td><td>08/03/2016</td> </tr>
<tr class="odd"><td>Green Hills Software</td><td>GHSW</td><td>08/11/2016</td> </tr>
<tr class="even"><td>AAEON Technology Inc.</td><td>AANT</td><td>09/01/2016</td> </tr>
<tr class="odd"><td>VR Technology Holdings Limited </td><td>3GVR</td><td>01/19/2017</td> </tr>
<tr class="even"><td>Exar Corporation</td><td>EXAR</td><td>02/28/2017</td> </tr>
<tr class="odd"><td>Coreboot Project</td><td>BOOT</td><td>02/28/2017</td> </tr>
<tr class="even"><td>Marvell Technology Group Ltd.</td><td>MRVL</td><td>05/25/2017</td> </tr>
<tr class="odd"><td>IHSE GmbH</td><td>IHSE</td><td>06/22/2017</td> </tr>
<tr class="even"><td>Insyde Software</td><td>INSY</td><td>11/10/2017</td> </tr>
<tr class="odd"><td>Nexstgo Company Limited</td><td>NXGO</td><td>11/13/2017</td> </tr>
<tr class="even"><td>Ampere Computing</td><td>AMPC</td><td>03/29/2018</td> </tr>
<tr class="odd"><td>IDEMIA</td><td>IDEM</td><td>06/26/2018</td> </tr>
<tr class="even"><td>Vishay Intertechnology, Inc.</td><td>VSHY</td><td>07/09/2018</td> </tr>
<tr class="odd"><td>DMIST RESEARCH LTD</td><td>DMST</td><td>07/09/2018</td> </tr>
<tr class="even"><td>COMHEAR, INC.</td><td>CMHR</td><td>08/02/2018</td> </tr>
<tr class="odd"><td>Sensel, Inc.</td><td>SNSL</td><td>08/20/2018</td> </tr>
<tr class="even"><td>G2touch Co., LTD</td><td>GTCH</td><td>12/04/2018</td> </tr>
<tr class="odd"><td>Guizhou Huaxintong Semiconductor Technology Co., Ltd</td><td>HXTS</td><td>01/18/2019</td> </tr>
<tr class="even"><td>Amazon Corporation</td><td>AMZN</td><td>02/06/2019</td> </tr>
<tr class="odd"><td>ASEM S.p.A.</td><td>ASEM</td><td>04/29/2019</td> </tr>
<tr class="even"><td>Fujitsu Limited</td><td>FUJI</td><td>06/18/2019</td> </tr>
<tr class="odd"><td>Phytium Technology Co. Ltd.</td><td>PHYT</td><td>02/14/2020</td> </tr>
<tr class="even"><td>CHENGDU HAIGUANG IC DESIGN CO., LTD</td><td>HYGO</td><td>07/15/2020</td> </tr>
<tr class="odd"><td>PixArt imaging inc.</td><td>PIXA</td><td>07/15/2020</td> </tr>
<tr class="even"><td>Loongson Technology Corporation Limited</td><td>LOON</td><td>09/10/2020</td> </tr>
<tr class="odd"><td>Seiko Epson Corporation</td><td>SECC</td><td>02/16/2021</td> </tr>
<tr class="even"><td>Alibaba Co., Ltd.</td><td>BABA</td><td>02/02/2021</td> </tr>
<tr class="odd"><td>Juniper Systems, Inc.</td><td>JSYS</td><td>03/18/2021</td> </tr>
<tr class="even"><td>Framework Computer LLC</td><td>FRMW</td><td>03/22/2021</td> </tr>
<tr class="odd"><td>Pensando Systems, Inc.</td><td>PNSO</td><td>03/24/2021</td> </tr>
<tr class="even"><td>Dynabook Inc.</td><td>DNBK</td><td>06/01/2021</td> </tr>
<tr class="odd"><td>Dioo Microcircuits Co., Ltd. Jiangsu</td><td>DIOO</td><td>06/04/2021</td> </tr>
<tr class="even"><td>Purism SPC</td><td>PURI</td><td>06/10/2021</td> </tr>
<tr class="odd"><td>Lontium Semiconductor Corporation</td><td>LTSC</td><td>07/21/2021</td> </tr>
<tr class="even"><td>Wacom Technology</td><td>WACF</td><td>09/21/2021</td> </tr>
<tr class="odd"><td>Shanghai Aiwei Electronic Technology Co., Ltd.</td><td>AWDZ</td><td>12/31/2021</td> </tr>
<tr class="even"><td>Silicom Ltd. Connectivity Solutions</td><td>SILC</td><td>03/28/2022</td> </tr>
<tr class="odd"><td>NOLO Co., Ltd.</td><td>NOLO</td><td>03/28/2022</td> </tr>
<tr class="even"><td>GoUp Co.,Ltd</td><td>GOUP</td><td>06/24/2022</td> </tr>
<tr class="odd"><td>Shenzhen Jaguar Microsystems Co.,Ltd.</td><td>JMIC</td><td>09/23/2022</td> </tr>
<tr class="even"><td>Elliptic Laboratories AS</td><td>ELAS</td><td>10/20/2022</td> </tr>
</tbody>
</table>
</body>
</html>

File diff suppressed because it is too large Load Diff