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
35extern "C" {
36#endif
37
38typedef struct did did_t;
39
40extern did_t *did_create(topo_mod_t *, di_node_t, int, int, int,
41    int);
42extern did_t *did_find(topo_mod_t *, di_node_t);
43extern did_t *did_hash_lookup(topo_mod_t *, di_node_t);
44extern void did_hash_insert(topo_mod_t *, di_node_t, did_t *);
45extern void did_hash_fini(topo_mod_t *);
46extern int did_hash_init(topo_mod_t *);
47extern void did_link_set(topo_mod_t *, tnode_t *, did_t *);
48extern void did_setspecific(topo_mod_t *, void *);
49
50extern topo_mod_t *did_mod(did_t *);
51extern di_node_t did_dinode(did_t *);
52extern void did_BDF(did_t *, int *, int *, int *);
53extern void did_markrc(did_t *);
54extern const char *did_physlot_name(did_t *, int);
55extern int did_board(did_t *);
56extern int did_bridge(did_t *);
57extern int did_rc(did_t *);
58extern int did_physlot(did_t *);
59extern int did_physlot_exists(did_t *);
60extern char *did_slot_label_get(did_t *);
61extern void did_slot_label_set(did_t *, char *);
62extern int did_excap(did_t *);
63extern void did_excap_set(did_t *, int);
64
65extern int did_bdf(did_t *);
66extern did_t *did_link_get(did_t *);
67extern did_t *did_chain_get(did_t *);
68extern void did_destroy(did_t *);
69extern void did_hold(did_t *);
70extern void did_did_link_set(did_t *, did_t *);
71extern void did_did_chain_set(did_t *, did_t *);
72extern void did_rele(did_t *);
73extern void did_settnode(did_t *, tnode_t *);
74extern tnode_t *did_gettnode(did_t *);
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif /* _DID_H */
81