No wonder acpi_thermal didn't load: _TZ_ (thermalzone), along _PR_ (processor),
_SB_ (System Busses) and _SI_ (System Info) root nodes wasn't published as device manager nodes, only their subnodes, if any. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33307 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -78,74 +78,48 @@ acpi_enumerate_child_devices(device_node *node, const char *root)
|
|||||||
// get a reference on the parent
|
// get a reference on the parent
|
||||||
parent = gDeviceManager->get_parent_node(node);
|
parent = gDeviceManager->get_parent_node(node);
|
||||||
|
|
||||||
while (get_next_entry(ACPI_TYPE_ANY, root, result, 255, &counter) == B_OK) {
|
while (get_next_entry(ACPI_TYPE_ANY, root, result, sizeof(result), &counter) == B_OK) {
|
||||||
uint32 type = get_object_type(result);
|
uint32 type = get_object_type(result);
|
||||||
device_node *deviceNode;
|
device_node *deviceNode;
|
||||||
|
|
||||||
if (!strcmp("\\_PR_", result) || !strcmp("\\_TZ_", result)
|
|
||||||
|| !strcmp("\\_SI_", result) || !strcmp("\\_SB_", result)) {
|
|
||||||
acpi_enumerate_child_devices(node, result);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ACPI_TYPE_DEVICE: {
|
case ACPI_TYPE_POWER:
|
||||||
char hid[16] = "";
|
case ACPI_TYPE_PROCESSOR:
|
||||||
device_attr attrs[] = {
|
case ACPI_TYPE_THERMAL:
|
||||||
// info about device
|
case ACPI_TYPE_DEVICE: {
|
||||||
{ B_DEVICE_BUS, B_STRING_TYPE, { string: "acpi" }},
|
char hid[16] = "";
|
||||||
|
device_attr attrs[] = {
|
||||||
// location on ACPI bus
|
// info about device
|
||||||
{ ACPI_DEVICE_PATH_ITEM, B_STRING_TYPE, { string: result }},
|
{ B_DEVICE_BUS, B_STRING_TYPE, { string: "acpi" }},
|
||||||
|
|
||||||
// info about the device
|
// location on ACPI bus
|
||||||
{ ACPI_DEVICE_HID_ITEM, B_STRING_TYPE, { string: hid }},
|
{ ACPI_DEVICE_PATH_ITEM, B_STRING_TYPE, { string: result }},
|
||||||
{ ACPI_DEVICE_TYPE_ITEM, B_UINT32_TYPE, { ui32: type }},
|
|
||||||
|
// info about the device
|
||||||
// consumer specification
|
{ ACPI_DEVICE_HID_ITEM, B_STRING_TYPE, { string: hid }},
|
||||||
/*{ B_DRIVER_MAPPING, B_STRING_TYPE, { string:
|
{ ACPI_DEVICE_TYPE_ITEM, B_UINT32_TYPE, { ui32: type }},
|
||||||
"hid_%" ACPI_DEVICE_HID_ITEM "%" }},
|
|
||||||
{ B_DRIVER_MAPPING "/0", B_STRING_TYPE, { string:
|
// consumer specification
|
||||||
"type_%" ACPI_DEVICE_TYPE_ITEM "%" }},*/
|
/*{ B_DRIVER_MAPPING, B_STRING_TYPE, { string:
|
||||||
{ B_DEVICE_FLAGS, B_UINT32_TYPE, { ui32: /*B_FIND_CHILD_ON_DEMAND|*/B_FIND_MULTIPLE_CHILDREN }},
|
"hid_%" ACPI_DEVICE_HID_ITEM "%" }},
|
||||||
{ NULL }
|
{ B_DRIVER_MAPPING "/0", B_STRING_TYPE, { string:
|
||||||
};
|
"type_%" ACPI_DEVICE_TYPE_ITEM "%" }},*/
|
||||||
|
{ B_DEVICE_FLAGS, B_UINT32_TYPE, { ui32: /*B_FIND_CHILD_ON_DEMAND|*/B_FIND_MULTIPLE_CHILDREN }},
|
||||||
get_device_hid(result, hid, sizeof(hid));
|
{ NULL }
|
||||||
|
};
|
||||||
if (gDeviceManager->register_node(node, ACPI_DEVICE_MODULE_NAME, attrs,
|
|
||||||
NULL, &deviceNode) == B_OK)
|
if (type == ACPI_TYPE_DEVICE)
|
||||||
acpi_enumerate_child_devices(deviceNode, result);
|
get_device_hid(result, hid, sizeof(hid));
|
||||||
|
|
||||||
break;
|
if (gDeviceManager->register_node(node, ACPI_DEVICE_MODULE_NAME, attrs,
|
||||||
}
|
NULL, &deviceNode) == B_OK)
|
||||||
case ACPI_TYPE_POWER:
|
acpi_enumerate_child_devices(deviceNode, result);
|
||||||
case ACPI_TYPE_PROCESSOR:
|
|
||||||
case ACPI_TYPE_THERMAL: {
|
break;
|
||||||
device_attr attrs[] = {
|
}
|
||||||
// info about device
|
default:
|
||||||
{ B_DEVICE_BUS, B_STRING_TYPE, { string: "acpi" }},
|
acpi_enumerate_child_devices(node, result);
|
||||||
|
break;
|
||||||
// location on ACPI bus
|
|
||||||
{ ACPI_DEVICE_PATH_ITEM, B_STRING_TYPE, { string: result }},
|
|
||||||
|
|
||||||
// info about the device
|
|
||||||
{ ACPI_DEVICE_TYPE_ITEM, B_UINT32_TYPE, { ui32: type }},
|
|
||||||
|
|
||||||
// consumer specification
|
|
||||||
/*{ B_DRIVER_MAPPING, B_STRING_TYPE, { string:
|
|
||||||
"type_%" ACPI_DEVICE_TYPE_ITEM "%" }},*/
|
|
||||||
{ B_DEVICE_FLAGS, B_UINT32_TYPE, { ui32: /*B_FIND_CHILD_ON_DEMAND|*/B_FIND_MULTIPLE_CHILDREN }},
|
|
||||||
{ NULL }
|
|
||||||
};
|
|
||||||
|
|
||||||
if (gDeviceManager->register_node(node, ACPI_DEVICE_MODULE_NAME, attrs, NULL, &deviceNode) == B_OK)
|
|
||||||
acpi_enumerate_child_devices(deviceNode, result);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
acpi_enumerate_child_devices(node, result);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user