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 _TOPO_MOD_H
27 #define _TOPO_MOD_H
28
29 #include <fm/libtopo.h>
30 #include <fm/topo_hc.h>
31 #include <libipmi.h>
32 #include <libnvpair.h>
33 #include <libdevinfo.h>
34 #include <smbios.h>
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /*
41 * Enumerator and method supplier module API
42 */
43 typedef struct topo_mod topo_mod_t;
44
198 #define TOPO_METH_FRU_COMPUTE_DESC "Dynamic FRU constructor"
199
200 #define TOPO_METH_DISK_STATUS "topo_disk_status"
201 #define TOPO_METH_DISK_STATUS_VERSION 0
202 #define TOPO_METH_DISK_STATUS_DESC "Disk status"
203
204 #define TOPO_METH_SENSOR_FAILURE "topo_sensor_failure"
205 #define TOPO_METH_SENSOR_FAILURE_VERSION 0
206 #define TOPO_METH_SENSOR_FAILURE_DESC "Sensor failure state"
207
208 #define TOPO_PROP_METH_DESC "Dynamic Property method"
209
210 #define TOPO_METH_IPMI_ENTITY "ipmi_entity"
211 #define TOPO_METH_FAC_ENUM_DESC "Facility Enumerator"
212
213 extern void *topo_mod_alloc(topo_mod_t *, size_t);
214 extern void *topo_mod_zalloc(topo_mod_t *, size_t);
215 extern void topo_mod_free(topo_mod_t *, void *, size_t);
216 extern char *topo_mod_strdup(topo_mod_t *, const char *);
217 extern void topo_mod_strfree(topo_mod_t *, char *);
218 extern int topo_mod_nvalloc(topo_mod_t *, nvlist_t **, uint_t);
219 extern int topo_mod_nvdup(topo_mod_t *, nvlist_t *, nvlist_t **);
220
221 extern void topo_mod_clrdebug(topo_mod_t *);
222 extern void topo_mod_setdebug(topo_mod_t *);
223 extern void topo_mod_dprintf(topo_mod_t *, const char *, ...);
224 extern const char *topo_mod_errmsg(topo_mod_t *);
225 extern int topo_mod_errno(topo_mod_t *);
226
227 /*
228 * Topo node utilities: callable from module enumeration, topo_mod_enumerate()
229 */
230 extern int topo_node_range_create(topo_mod_t *, tnode_t *, const char *,
231 topo_instance_t, topo_instance_t);
232 extern void topo_node_range_destroy(tnode_t *, const char *);
233 extern tnode_t *topo_node_bind(topo_mod_t *, tnode_t *, const char *,
234 topo_instance_t, nvlist_t *);
235 extern tnode_t *topo_node_facbind(topo_mod_t *, tnode_t *, const char *,
236 const char *);
237 extern void topo_node_unbind(tnode_t *);
|
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 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
27 */
28
29 #ifndef _TOPO_MOD_H
30 #define _TOPO_MOD_H
31
32 #include <fm/libtopo.h>
33 #include <fm/topo_hc.h>
34 #include <libipmi.h>
35 #include <libnvpair.h>
36 #include <libdevinfo.h>
37 #include <smbios.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 /*
44 * Enumerator and method supplier module API
45 */
46 typedef struct topo_mod topo_mod_t;
47
201 #define TOPO_METH_FRU_COMPUTE_DESC "Dynamic FRU constructor"
202
203 #define TOPO_METH_DISK_STATUS "topo_disk_status"
204 #define TOPO_METH_DISK_STATUS_VERSION 0
205 #define TOPO_METH_DISK_STATUS_DESC "Disk status"
206
207 #define TOPO_METH_SENSOR_FAILURE "topo_sensor_failure"
208 #define TOPO_METH_SENSOR_FAILURE_VERSION 0
209 #define TOPO_METH_SENSOR_FAILURE_DESC "Sensor failure state"
210
211 #define TOPO_PROP_METH_DESC "Dynamic Property method"
212
213 #define TOPO_METH_IPMI_ENTITY "ipmi_entity"
214 #define TOPO_METH_FAC_ENUM_DESC "Facility Enumerator"
215
216 extern void *topo_mod_alloc(topo_mod_t *, size_t);
217 extern void *topo_mod_zalloc(topo_mod_t *, size_t);
218 extern void topo_mod_free(topo_mod_t *, void *, size_t);
219 extern char *topo_mod_strdup(topo_mod_t *, const char *);
220 extern void topo_mod_strfree(topo_mod_t *, char *);
221 extern char *topo_mod_strsplit(topo_mod_t *, const char *, const char *,
222 char **);
223 extern int topo_mod_nvalloc(topo_mod_t *, nvlist_t **, uint_t);
224 extern int topo_mod_nvdup(topo_mod_t *, nvlist_t *, nvlist_t **);
225
226 extern void topo_mod_clrdebug(topo_mod_t *);
227 extern void topo_mod_setdebug(topo_mod_t *);
228 extern void topo_mod_dprintf(topo_mod_t *, const char *, ...);
229 extern const char *topo_mod_errmsg(topo_mod_t *);
230 extern int topo_mod_errno(topo_mod_t *);
231
232 /*
233 * Topo node utilities: callable from module enumeration, topo_mod_enumerate()
234 */
235 extern int topo_node_range_create(topo_mod_t *, tnode_t *, const char *,
236 topo_instance_t, topo_instance_t);
237 extern void topo_node_range_destroy(tnode_t *, const char *);
238 extern tnode_t *topo_node_bind(topo_mod_t *, tnode_t *, const char *,
239 topo_instance_t, nvlist_t *);
240 extern tnode_t *topo_node_facbind(topo_mod_t *, tnode_t *, const char *,
241 const char *);
242 extern void topo_node_unbind(tnode_t *);
|