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 (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
24  */
25 
26 #ifndef _DID_H
27 #define	_DID_H
28 
29 #include <sys/pci.h>
30 #include <fm/topo_mod.h>
31 #include <libdevinfo.h>
32 #include <libnvpair.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 typedef struct did did_t;
39 
40 extern did_t *did_create(topo_mod_t *, di_node_t, int, int, int,
41     int);
42 extern did_t *did_find(topo_mod_t *, di_node_t);
43 extern did_t *did_hash_lookup(topo_mod_t *, di_node_t);
44 extern void did_hash_insert(topo_mod_t *, di_node_t, did_t *);
45 extern void did_hash_fini(topo_mod_t *);
46 extern int did_hash_init(topo_mod_t *);
47 extern void did_link_set(topo_mod_t *, tnode_t *, did_t *);
48 extern void did_setspecific(topo_mod_t *, void *);
49 
50 extern topo_mod_t *did_mod(did_t *);
51 extern di_node_t did_dinode(did_t *);
52 extern void did_BDF(did_t *, int *, int *, int *);
53 extern void did_markrc(did_t *);
54 extern const char *did_physlot_name(did_t *, int);
55 extern int did_board(did_t *);
56 extern int did_bridge(did_t *);
57 extern int did_rc(did_t *);
58 extern int did_physlot(did_t *);
59 extern int did_physlot_exists(did_t *);
60 extern char *did_slot_label_get(did_t *);
61 extern void did_slot_label_set(did_t *, char *);
62 extern int did_excap(did_t *);
63 extern void did_excap_set(did_t *, int);
64 
65 extern int did_bdf(did_t *);
66 extern did_t *did_link_get(did_t *);
67 extern did_t *did_chain_get(did_t *);
68 extern void did_destroy(did_t *);
69 extern void did_hold(did_t *);
70 extern void did_did_link_set(did_t *, did_t *);
71 extern void did_did_chain_set(did_t *, did_t *);
72 extern void did_rele(did_t *);
73 extern void did_settnode(did_t *, tnode_t *);
74 extern tnode_t *did_gettnode(did_t *);
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif /* _DID_H */
81