summaryrefslogtreecommitdiff
path: root/usr/src/lib/fm/topo/modules/common/pcibus/did.h
blob: 61e08150d8b7cb72fd81d557cc550efdf30ab6c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */

/*
 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 */

#ifndef _DID_H
#define	_DID_H

#include <sys/pci.h>
#include <fm/topo_mod.h>
#include <libdevinfo.h>
#include <libnvpair.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct did did_t;

extern did_t *did_create(topo_mod_t *, di_node_t, int, int, int,
    int);
extern did_t *did_find(topo_mod_t *, di_node_t);
extern did_t *did_hash_lookup(topo_mod_t *, di_node_t);
extern void did_hash_insert(topo_mod_t *, di_node_t, did_t *);
extern void did_hash_fini(topo_mod_t *);
extern int did_hash_init(topo_mod_t *);
extern void did_link_set(topo_mod_t *, tnode_t *, did_t *);
extern void did_setspecific(topo_mod_t *, void *);

extern topo_mod_t *did_mod(did_t *);
extern di_node_t did_dinode(did_t *);
extern void did_BDF(did_t *, int *, int *, int *);
extern void did_markrc(did_t *);
extern const char *did_physlot_name(did_t *, int);
extern int did_board(did_t *);
extern int did_bridge(did_t *);
extern int did_rc(did_t *);
extern int did_physlot(did_t *);
extern int did_physlot_exists(did_t *);
extern char *did_slot_label_get(did_t *);
extern void did_slot_label_set(did_t *, char *);
extern int did_excap(did_t *);
extern void did_excap_set(did_t *, int);

extern int did_bdf(did_t *);
extern did_t *did_link_get(did_t *);
extern did_t *did_chain_get(did_t *);
extern void did_destroy(did_t *);
extern void did_hold(did_t *);
extern void did_did_link_set(did_t *, did_t *);
extern void did_did_chain_set(did_t *, did_t *);
extern void did_rele(did_t *);
extern void did_settnode(did_t *, tnode_t *);
extern tnode_t *did_gettnode(did_t *);

#ifdef __cplusplus
}
#endif

#endif /* _DID_H */