b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * CDDL HEADER START
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * The contents of this file are subject to the terms of the
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * Common Development and Distribution License (the "License").
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * You may not use this file except in compliance with the License.
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * or http://www.opensolaris.org/os/licensing.
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * See the License for the specific language governing permissions
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * and limitations under the License.
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * When distributing Covered Code, include this CDDL HEADER in each
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * If applicable, add the following below this CDDL HEADER, with the
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * fields enclosed by brackets "[]" replaced with your own identifying
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * information: Portions Copyright [yyyy] [name of copyright owner]
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * CDDL HEADER END
a31148363f598def767ac48c5d82e1572e44b935Gerry Liu * Copyright (c) 2009-2010, Intel Corporation.
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * All rights reserved.
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoranstatic ACPI_STATUS acpidev_scope_probe(acpidev_walk_info_t *infop);
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoranstatic acpidev_filter_result_t acpidev_scope_filter(acpidev_walk_info_t *infop,
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoranstatic ACPI_STATUS acpidev_scope_init(acpidev_walk_info_t *infop);
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * Default class driver for ACPI scope objects.
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * This class driver is used to handle predefined ACPI SCOPE objects
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * under the ACPI root object, such as _PR_, _SB_ and _TZ_ etc.
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * The default policy for ACPI SCOPE objects is SKIP.
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran 0, /* adc_refcnt */
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoranacpidev_class_list_t *acpidev_class_list_scope = NULL;
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran * All SCOPE objects share a global pseudo unit address space across the system.
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran/* Filter rule table for ACPI SCOPE objects. */
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoranstatic acpidev_filter_rule_t acpidev_scope_filters[] = {
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran { /* For safety, _SB_ is hardcoded as DEVICE by acpica */
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran { /* Handle _PR_ object. */
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran { /* Ignore all other scope objects. */
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoranacpidev_scope_probe(acpidev_walk_info_t *infop)
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran if (infop->awi_info->Type != ACPI_TYPE_LOCAL_SCOPE) {
a31148363f598def767ac48c5d82e1572e44b935Gerry Liu ACPIDEV_DEBUG(CE_WARN, "!acpidev: unknown operation type %u "
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran "in acpidev_scope_probe().", infop->awi_op_type);
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran if (ACPI_FAILURE(rc) && rc != AE_NOT_EXIST && rc != AE_ALREADY_EXISTS) {
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran "!acpidev: failed to process scope object %s.",
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoranacpidev_scope_filter(acpidev_walk_info_t *infop, char *devname, int maxlen)
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran if (infop->awi_op_type == ACPIDEV_OP_BOOT_PROBE ||
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran infop->awi_op_type == ACPIDEV_OP_BOOT_REPROBE ||
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran infop->awi_op_type == ACPIDEV_OP_HOTPLUG_PROBE) {
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran res = acpidev_filter_device(infop, infop->awi_hdl,
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran ACPIDEV_ARRAY_PARAM(acpidev_scope_filters),
a31148363f598def767ac48c5d82e1572e44b935Gerry Liu ACPIDEV_DEBUG(CE_WARN, "!acpidev: unknown operation type %u "
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran "in acpidev_scope_filter().", infop->awi_op_type);
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoranacpidev_scope_init(acpidev_walk_info_t *infop)
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran if (ACPI_FAILURE(acpidev_set_compatible(infop,
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran (void) snprintf(unitaddr, sizeof (unitaddr), "%u",
b72d5b75fd6f5bb08d29f65652d60058fc3a2608Michael Corcoran atomic_inc_32_nv(&acpidev_scope_unitaddr) - 1);