xref: /illumos-gate/usr/src/lib/fm/topo/modules/common/pcibus/did.h (revision 8b80e8cb6855118d46f605e91b5ed4ce83417395)
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 2008 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 #include <sys/pci.h>
31 #include <fm/topo_mod.h>
32 #include <libdevinfo.h>
33 #include <libnvpair.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 typedef struct did did_t;
40 
41 extern did_t *did_create(topo_mod_t *, di_node_t, int, int, int,
42     int);
43 extern did_t *did_find(topo_mod_t *, di_node_t);
44 extern did_t *did_hash_lookup(topo_mod_t *, di_node_t);
45 extern void did_hash_insert(topo_mod_t *, di_node_t, did_t *);
46 extern void did_hash_fini(topo_mod_t *);
47 extern int did_hash_init(topo_mod_t *);
48 extern void did_link_set(topo_mod_t *, tnode_t *, did_t *);
49 extern void did_setspecific(topo_mod_t *, void *);
50 
51 extern topo_mod_t *did_mod(did_t *);
52 extern di_node_t did_dinode(did_t *);
53 extern void did_BDF(did_t *, int *, int *, int *);
54 extern void did_markrc(did_t *);
55 extern const char *did_label(did_t *, int);
56 extern int did_board(did_t *);
57 extern int did_bridge(did_t *);
58 extern int did_rc(did_t *);
59 extern int did_physslot(did_t *);
60 extern int did_inherit(did_t *, did_t *);
61 extern int did_excap(did_t *);
62 extern void did_excap_set(did_t *, int);
63 extern int did_bdf(did_t *);
64 extern did_t *did_link_get(did_t *);
65 extern did_t *did_chain_get(did_t *);
66 extern void did_destroy(did_t *);
67 extern void did_hold(did_t *);
68 extern void did_did_link_set(did_t *, did_t *);
69 extern void did_did_chain_set(did_t *, did_t *);
70 extern void did_rele(did_t *);
71 extern void did_settnode(did_t *, tnode_t *);
72 extern tnode_t *did_gettnode(did_t *);
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif /* _DID_H */
79