xref: /illumos-gate/usr/src/lib/fm/topo/modules/common/pcibus/did.h (revision 08516594b0e540dc0f415fa7ae31f54d943a0913)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _DID_H
28 #define	_DID_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/pci.h>
33 #include <fm/topo_mod.h>
34 #include <libdevinfo.h>
35 #include <libnvpair.h>
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 typedef struct did did_t;
42 
43 extern did_t *did_create(topo_mod_t *, di_node_t, int, int, int,
44     int);
45 extern did_t *did_find(topo_mod_t *, di_node_t);
46 extern did_t *did_hash_lookup(topo_mod_t *, di_node_t);
47 extern void did_hash_insert(topo_mod_t *, di_node_t, did_t *);
48 extern void did_hash_fini(topo_mod_t *);
49 extern int did_hash_init(topo_mod_t *);
50 extern void did_link_set(topo_mod_t *, tnode_t *, did_t *);
51 extern void did_setspecific(topo_mod_t *, void *);
52 
53 extern topo_mod_t *did_mod(did_t *);
54 extern di_node_t did_dinode(did_t *);
55 extern void did_BDF(did_t *, int *, int *, int *);
56 extern void did_markrc(did_t *);
57 extern const char *did_label(did_t *, int);
58 extern int did_board(did_t *);
59 extern int did_bridge(did_t *);
60 extern int did_rc(did_t *);
61 extern int did_physslot(did_t *);
62 extern int did_inherit(did_t *, did_t *);
63 extern int did_excap(did_t *);
64 extern int did_bdf(did_t *);
65 extern did_t *did_link_get(did_t *);
66 extern did_t *did_chain_get(did_t *);
67 extern void did_destroy(did_t *);
68 extern void did_hold(did_t *);
69 extern void did_did_link_set(did_t *, did_t *);
70 extern void did_did_chain_set(did_t *, did_t *);
71 extern void did_rele(did_t *);
72 extern void did_settnode(did_t *, tnode_t *);
73 extern tnode_t *did_gettnode(did_t *);
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif /* _DID_H */
80