xref: /onnv-gate/usr/src/lib/fm/topo/modules/common/pcibus/pcibus.h (revision 5060:222c7d448cfc)
13062Scindi /*
23062Scindi  * CDDL HEADER START
33062Scindi  *
43062Scindi  * The contents of this file are subject to the terms of the
53062Scindi  * Common Development and Distribution License (the "License").
63062Scindi  * You may not use this file except in compliance with the License.
73062Scindi  *
83062Scindi  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
93062Scindi  * or http://www.opensolaris.org/os/licensing.
103062Scindi  * See the License for the specific language governing permissions
113062Scindi  * and limitations under the License.
123062Scindi  *
133062Scindi  * When distributing Covered Code, include this CDDL HEADER in each
143062Scindi  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
153062Scindi  * If applicable, add the following below this CDDL HEADER, with the
163062Scindi  * fields enclosed by brackets "[]" replaced with your own identifying
173062Scindi  * information: Portions Copyright [yyyy] [name of copyright owner]
183062Scindi  *
193062Scindi  * CDDL HEADER END
203062Scindi  */
213062Scindi 
223062Scindi /*
23*5060Syc148097  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
243062Scindi  * Use is subject to license terms.
253062Scindi  */
263062Scindi 
273062Scindi #ifndef _PCIBUS_H
283062Scindi #define	_PCIBUS_H
293062Scindi 
303062Scindi #pragma ident	"%Z%%M%	%I%	%E% SMI"
313062Scindi 
323062Scindi #include <sys/pci.h>
333062Scindi #include <fm/topo_mod.h>
343062Scindi #include <libdevinfo.h>
353062Scindi 
363062Scindi #ifdef __cplusplus
373062Scindi extern "C" {
383062Scindi #endif
393062Scindi 
403062Scindi #define	PCI_ENUMR_VERS	1
413062Scindi 
423062Scindi #define	PCI_ENUM "pcibus"
433062Scindi 
443062Scindi #define	PCI_BUS		"pcibus"
453062Scindi #define	PCI_DEVICE	"pcidev"
463062Scindi #define	PCI_FUNCTION	"pcifn"
473062Scindi #define	PCIEX_ROOT	"pciexrc"
483062Scindi #define	PCIEX_SWUP	"pciexswu"
493062Scindi #define	PCIEX_SWDWN	"pciexswd"
503062Scindi #define	PCIEX_BUS	"pciexbus"
513062Scindi #define	PCIEX_DEVICE	"pciexdev"
523062Scindi #define	PCIEX_FUNCTION	"pciexfn"
533062Scindi 
543062Scindi #define	PCIEXTYPE "pciex"
553062Scindi #define	PCITYPE "pci"
563062Scindi 
573062Scindi #define	MAX_HB_BUSES	255
583062Scindi #define	MAX_PCIBUS_DEVS	32
593062Scindi #define	MAX_PCIDEV_FNS	8
603062Scindi 
61*5060Syc148097 /* vendor/device ids for Neptune */
62*5060Syc148097 #define	SUN_VENDOR_ID		0x108e
63*5060Syc148097 #define	NEPTUNE_DEVICE_ID	0xabcd
64*5060Syc148097 
653062Scindi #define	GETCLASS(x) (((x) & 0xff0000) >> 16)
663062Scindi #define	GETSUBCLASS(x) (((x) & 0xff00) >> 8)
673062Scindi 
683062Scindi extern tnode_t *pcibus_declare(topo_mod_t *, tnode_t *, di_node_t,
693062Scindi     topo_instance_t);
703062Scindi extern tnode_t *pcidev_declare(topo_mod_t *, tnode_t *, di_node_t,
713062Scindi     topo_instance_t);
723062Scindi extern tnode_t *pcifn_declare(topo_mod_t *, tnode_t *, di_node_t,
733062Scindi     topo_instance_t);
743062Scindi extern tnode_t *pciexbus_declare(topo_mod_t *, tnode_t *, di_node_t,
753062Scindi     topo_instance_t);
763062Scindi extern tnode_t *pciexdev_declare(topo_mod_t *, tnode_t *, di_node_t,
773062Scindi     topo_instance_t);
783062Scindi extern tnode_t *pciexfn_declare(topo_mod_t *, tnode_t *, di_node_t,
793062Scindi     topo_instance_t);
803062Scindi extern int pci_children_instantiate(topo_mod_t *, tnode_t *, di_node_t,
813062Scindi     int, int, int, int, int);
823062Scindi 
833062Scindi extern int platform_pci_label(topo_mod_t *, tnode_t *, nvlist_t *, nvlist_t **);
843062Scindi 
853062Scindi #ifdef __cplusplus
863062Scindi }
873062Scindi #endif
883062Scindi 
893062Scindi #endif /* _PCIBUS_H */
90