1*10923SEvan.Yan@Sun.COM /* 2*10923SEvan.Yan@Sun.COM * CDDL HEADER START 3*10923SEvan.Yan@Sun.COM * 4*10923SEvan.Yan@Sun.COM * The contents of this file are subject to the terms of the 5*10923SEvan.Yan@Sun.COM * Common Development and Distribution License (the "License"). 6*10923SEvan.Yan@Sun.COM * You may not use this file except in compliance with the License. 7*10923SEvan.Yan@Sun.COM * 8*10923SEvan.Yan@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*10923SEvan.Yan@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*10923SEvan.Yan@Sun.COM * See the License for the specific language governing permissions 11*10923SEvan.Yan@Sun.COM * and limitations under the License. 12*10923SEvan.Yan@Sun.COM * 13*10923SEvan.Yan@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*10923SEvan.Yan@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*10923SEvan.Yan@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*10923SEvan.Yan@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*10923SEvan.Yan@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*10923SEvan.Yan@Sun.COM * 19*10923SEvan.Yan@Sun.COM * CDDL HEADER END 20*10923SEvan.Yan@Sun.COM */ 21*10923SEvan.Yan@Sun.COM 22*10923SEvan.Yan@Sun.COM /* 23*10923SEvan.Yan@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24*10923SEvan.Yan@Sun.COM * Use is subject to license terms. 25*10923SEvan.Yan@Sun.COM */ 26*10923SEvan.Yan@Sun.COM 27*10923SEvan.Yan@Sun.COM #ifndef _PCIEHPC_ACPI_H 28*10923SEvan.Yan@Sun.COM #define _PCIEHPC_ACPI_H 29*10923SEvan.Yan@Sun.COM 30*10923SEvan.Yan@Sun.COM #ifdef __cplusplus 31*10923SEvan.Yan@Sun.COM extern "C" { 32*10923SEvan.Yan@Sun.COM #endif 33*10923SEvan.Yan@Sun.COM 34*10923SEvan.Yan@Sun.COM #include <sys/acpi/acpi.h> 35*10923SEvan.Yan@Sun.COM #include <sys/acpica.h> 36*10923SEvan.Yan@Sun.COM #include <sys/hotplug/pci/pcie_hp.h> 37*10923SEvan.Yan@Sun.COM #include <sys/hotplug/pci/pciehpc.h> 38*10923SEvan.Yan@Sun.COM 39*10923SEvan.Yan@Sun.COM /* soft state data structure for ACPI hot plug mode */ 40*10923SEvan.Yan@Sun.COM typedef struct pciehpc_acpi { 41*10923SEvan.Yan@Sun.COM /* handle for the ACPI device for the bus node with HPC */ 42*10923SEvan.Yan@Sun.COM ACPI_HANDLE bus_obj; 43*10923SEvan.Yan@Sun.COM 44*10923SEvan.Yan@Sun.COM /* handle for the ACPI device for the slot (dev#0,func#0) */ 45*10923SEvan.Yan@Sun.COM ACPI_HANDLE slot_dev_obj; 46*10923SEvan.Yan@Sun.COM 47*10923SEvan.Yan@Sun.COM /* ACPI control methods present on the bus node */ 48*10923SEvan.Yan@Sun.COM uint16_t bus_methods; 49*10923SEvan.Yan@Sun.COM 50*10923SEvan.Yan@Sun.COM /* ACPI control methods on the slot device functions */ 51*10923SEvan.Yan@Sun.COM uint16_t slot_methods; 52*10923SEvan.Yan@Sun.COM } pciehpc_acpi_t; 53*10923SEvan.Yan@Sun.COM 54*10923SEvan.Yan@Sun.COM /* bit definitions in acpi_bus_methods */ 55*10923SEvan.Yan@Sun.COM #define PCIEHPC_ACPI_OSC_PRESENT 0x0001 56*10923SEvan.Yan@Sun.COM #define PCIEHPC_ACPI_OSHP_PRESENT 0x0002 57*10923SEvan.Yan@Sun.COM #define PCIEHPC_ACPI_SUN_PRESENT 0x0004 58*10923SEvan.Yan@Sun.COM #define PCIEHPC_ACPI_STA_PRESENT 0x0008 59*10923SEvan.Yan@Sun.COM #define PCIEHPC_ACPI_EJ0_PRESENT 0x0010 60*10923SEvan.Yan@Sun.COM #define PCIEHPC_ACPI_HPP_PRESENT 0x0020 61*10923SEvan.Yan@Sun.COM #define PCIEHPC_ACPI_HPX_PRESENT 0x0040 62*10923SEvan.Yan@Sun.COM #define PCIEHPC_ACPI_PS0_PRESENT 0x0080 63*10923SEvan.Yan@Sun.COM #define PCIEHPC_ACPI_DSM_PRESENT 0x0080 64*10923SEvan.Yan@Sun.COM #define PCIEHPC_ACPI_STR_PRESENT 0x0100 65*10923SEvan.Yan@Sun.COM 66*10923SEvan.Yan@Sun.COM /* Device status bit as returned by _STA method (see 6.3.7 of ACPI 3.0) */ 67*10923SEvan.Yan@Sun.COM #define DEV_STS_PRESENT 0x1 /* device is present */ 68*10923SEvan.Yan@Sun.COM #define DEV_STS_ENABLED 0x2 /* device is enabled */ 69*10923SEvan.Yan@Sun.COM #define DEV_STS_SHOWN_UI 0x4 /* device should be shown in UI */ 70*10923SEvan.Yan@Sun.COM #define DEV_STS_FUNC_OK 0x8 /* device functioning normally */ 71*10923SEvan.Yan@Sun.COM #define STATUS_NORMAL \ 72*10923SEvan.Yan@Sun.COM (DEV_STS_PRESENT | DEV_STS_ENABLED | DEV_STS_SHOWN_UI | DEV_STS_FUNC_OK) 73*10923SEvan.Yan@Sun.COM 74*10923SEvan.Yan@Sun.COM #ifdef __cplusplus 75*10923SEvan.Yan@Sun.COM } 76*10923SEvan.Yan@Sun.COM #endif 77*10923SEvan.Yan@Sun.COM 78*10923SEvan.Yan@Sun.COM #endif /* _PCIEHPC_ACPI_H */ 79