1*10750SShesha.Sreenivasamurthy@Sun.COM /* 2*10750SShesha.Sreenivasamurthy@Sun.COM * CDDL HEADER START 3*10750SShesha.Sreenivasamurthy@Sun.COM * 4*10750SShesha.Sreenivasamurthy@Sun.COM * The contents of this file are subject to the terms of the 5*10750SShesha.Sreenivasamurthy@Sun.COM * Common Development and Distribution License (the "License"). 6*10750SShesha.Sreenivasamurthy@Sun.COM * You may not use this file except in compliance with the License. 7*10750SShesha.Sreenivasamurthy@Sun.COM * 8*10750SShesha.Sreenivasamurthy@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*10750SShesha.Sreenivasamurthy@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*10750SShesha.Sreenivasamurthy@Sun.COM * See the License for the specific language governing permissions 11*10750SShesha.Sreenivasamurthy@Sun.COM * and limitations under the License. 12*10750SShesha.Sreenivasamurthy@Sun.COM * 13*10750SShesha.Sreenivasamurthy@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*10750SShesha.Sreenivasamurthy@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*10750SShesha.Sreenivasamurthy@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*10750SShesha.Sreenivasamurthy@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*10750SShesha.Sreenivasamurthy@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*10750SShesha.Sreenivasamurthy@Sun.COM * 19*10750SShesha.Sreenivasamurthy@Sun.COM * CDDL HEADER END 20*10750SShesha.Sreenivasamurthy@Sun.COM */ 21*10750SShesha.Sreenivasamurthy@Sun.COM /* 22*10750SShesha.Sreenivasamurthy@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23*10750SShesha.Sreenivasamurthy@Sun.COM * Use is subject to license terms. 24*10750SShesha.Sreenivasamurthy@Sun.COM */ 25*10750SShesha.Sreenivasamurthy@Sun.COM 26*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/types.h> 27*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/ddi.h> 28*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/kmem.h> 29*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/sysmacros.h> 30*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/sunddi.h> 31*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/sunpm.h> 32*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/epm.h> 33*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/sunndi.h> 34*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/ddi_impldefs.h> 35*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/ddi_implfuncs.h> 36*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/pcie.h> 37*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/pcie_impl.h> 38*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/pcie_pwr.h> 39*10750SShesha.Sreenivasamurthy@Sun.COM #include <sys/pcie_acpi.h> /* pcie_x86_priv_t */ 40*10750SShesha.Sreenivasamurthy@Sun.COM 41*10750SShesha.Sreenivasamurthy@Sun.COM void pcie_init_plat(dev_info_t * dip)42*10750SShesha.Sreenivasamurthy@Sun.COMpcie_init_plat(dev_info_t *dip) 43*10750SShesha.Sreenivasamurthy@Sun.COM { 44*10750SShesha.Sreenivasamurthy@Sun.COM pcie_bus_t *bus_p = PCIE_DIP2BUS(dip); 45*10750SShesha.Sreenivasamurthy@Sun.COM bus_p->bus_plat_private = 46*10750SShesha.Sreenivasamurthy@Sun.COM (pcie_x86_priv_t *)kmem_zalloc(sizeof (pcie_x86_priv_t), KM_SLEEP); 47*10750SShesha.Sreenivasamurthy@Sun.COM } 48*10750SShesha.Sreenivasamurthy@Sun.COM 49*10750SShesha.Sreenivasamurthy@Sun.COM void pcie_fini_plat(dev_info_t * dip)50*10750SShesha.Sreenivasamurthy@Sun.COMpcie_fini_plat(dev_info_t *dip) 51*10750SShesha.Sreenivasamurthy@Sun.COM { 52*10750SShesha.Sreenivasamurthy@Sun.COM pcie_bus_t *bus_p = PCIE_DIP2BUS(dip); 53*10750SShesha.Sreenivasamurthy@Sun.COM 54*10750SShesha.Sreenivasamurthy@Sun.COM kmem_free(bus_p->bus_plat_private, sizeof (pcie_x86_priv_t)); 55*10750SShesha.Sreenivasamurthy@Sun.COM } 56*10750SShesha.Sreenivasamurthy@Sun.COM 57*10750SShesha.Sreenivasamurthy@Sun.COM /* ARGSUSED */ 58*10750SShesha.Sreenivasamurthy@Sun.COM int pcie_plat_pwr_setup(dev_info_t * dip)59*10750SShesha.Sreenivasamurthy@Sun.COMpcie_plat_pwr_setup(dev_info_t *dip) 60*10750SShesha.Sreenivasamurthy@Sun.COM { 61*10750SShesha.Sreenivasamurthy@Sun.COM return (DDI_SUCCESS); 62*10750SShesha.Sreenivasamurthy@Sun.COM } 63*10750SShesha.Sreenivasamurthy@Sun.COM 64*10750SShesha.Sreenivasamurthy@Sun.COM /* 65*10750SShesha.Sreenivasamurthy@Sun.COM * Undo whatever is done in pcie_plat_pwr_common_setup 66*10750SShesha.Sreenivasamurthy@Sun.COM */ 67*10750SShesha.Sreenivasamurthy@Sun.COM /* ARGSUSED */ 68*10750SShesha.Sreenivasamurthy@Sun.COM void pcie_plat_pwr_teardown(dev_info_t * dip)69*10750SShesha.Sreenivasamurthy@Sun.COMpcie_plat_pwr_teardown(dev_info_t *dip) 70*10750SShesha.Sreenivasamurthy@Sun.COM { 71*10750SShesha.Sreenivasamurthy@Sun.COM } 72