Index: sys/dev/acpica/acpi.c =================================================================== --- sys/dev/acpica/acpi.c +++ sys/dev/acpica/acpi.c @@ -68,6 +68,8 @@ #include #include +#include + #include static MALLOC_DEFINE(M_ACPIDEV, "acpidev", "ACPI devices"); @@ -923,6 +925,15 @@ case ISA_IVAR_LOGICALID: *(int *)result = acpi_isa_get_logicalid(child); break; + case PCI_IVAR_CLASS: + *(uint8_t*)result = (ad->acpi_cls_class >> 16) & 0xff; + break; + case PCI_IVAR_SUBCLASS: + *(uint8_t*)result = (ad->acpi_cls_class >> 8) & 0xff; + break; + case PCI_IVAR_PROGIF: + *(uint8_t*)result = (ad->acpi_cls_class >> 0) & 0xff; + break; default: return (ENOENT); } @@ -1965,6 +1976,8 @@ static ACPI_STATUS acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status) { + ACPI_DEVICE_INFO *devinfo; + struct acpi_device *ad; struct acpi_prw_data prw; ACPI_OBJECT_TYPE type; ACPI_HANDLE h; @@ -2058,6 +2071,17 @@ * device not to have any resources. */ acpi_parse_resources(child, handle, &acpi_res_parse_set, NULL); + + ad = device_get_ivars(child); + ad->acpi_cls_class = 0xffffff; + if (ACPI_SUCCESS(AcpiGetObjectInfo(handle, &devinfo))) { + if ((devinfo->Valid & ACPI_VALID_CLS) != 0 && + devinfo->ClassCode.Length >= ACPI_PCICLS_STRING_SIZE) { + ad->acpi_cls_class = strtoul(devinfo->ClassCode.String, + NULL, 16); + } + AcpiOsFree(devinfo); + } break; } } Index: sys/dev/acpica/acpivar.h =================================================================== --- sys/dev/acpica/acpivar.h +++ sys/dev/acpica/acpivar.h @@ -86,6 +86,8 @@ void *ad_private; int ad_flags; + int acpi_cls_class; + /* Resources */ struct resource_list ad_rl; };