pcie_acpi.c revision fc51f9bbbff02dbd8c3adf640b1a184ceeb58fa5
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * CDDL HEADER START
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * The contents of this file are subject to the terms of the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * Common Development and Distribution License (the "License").
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov * You may not use this file except in compliance with the License.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * See the License for the specific language governing permissions
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * and limitations under the License.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * When distributing Covered Code, include this CDDL HEADER in each
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * If applicable, add the following below this CDDL HEADER, with the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * fields enclosed by brackets "[]" replaced with your own identifying
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * information: Portions Copyright [yyyy] [name of copyright owner]
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * CDDL HEADER END
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * Use is subject to license terms.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweACPI_STATUS pcie_acpi_eval_osc(dev_info_t *dip, ACPI_HANDLE osc_hdl,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowestatic ACPI_STATUS pcie_acpi_find_osc(ACPI_HANDLE busobj,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowestatic void pcie_dump_acpi_obj(ACPI_HANDLE pcibus_obj);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowestatic ACPI_STATUS pcie_walk_obj_namespace(ACPI_HANDLE hdl, uint32_t nl,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowestatic ACPI_STATUS pcie_print_acpi_name(ACPI_HANDLE hdl, uint32_t nl,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#endif /* DEBUG */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe (pcie_x86_priv_t *)kmem_zalloc(sizeof (pcie_x86_priv_t), KM_SLEEP);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe kmem_free(bus_p->bus_plat_private, sizeof (pcie_x86_priv_t));
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowepcie_acpi_osc(dev_info_t *dip, uint32_t *osc_flags)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe pcie_x86_priv_t *osc_p = (pcie_x86_priv_t *)bus_p->bus_plat_private;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe /* Mark this so we know _OSC has been called for this device */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * (1) Find the ACPI device node for this bus node.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe PCIE_DBG("No ACPI device found (dip %p)\n", (void *)dip);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * (2) Check if _OSC method is present.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe if (pcie_acpi_find_osc(pcibus_obj, &osc_hdl) != AE_OK) {
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe /* no _OSC method present */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe PCIE_DBG("no _OSC method present for dip %p\n",
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * (3) _OSC method exists; evaluate _OSC.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe if (pcie_acpi_eval_osc(dip, osc_hdl, osc_flags) != AE_OK) {
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe PCIE_DBG("Failed to evaluate _OSC method for dip 0x%p\n",
return (DDI_FAILURE);
#ifdef DEBUG
return (DDI_SUCCESS);
static ACPI_STATUS
return (status);
caps_buffer[0] = 0;
status);
return (status);
return (AE_ERROR);
return (AE_OK);
#ifdef DEBUG
int status;
static ACPI_STATUS
void **ret)
int status;
return (status);
buf[0] = 0;
while (nl--)
return (status);
static ACPI_STATUS
int status;
return (AE_OK);