xref: /illumos-gate/usr/src/lib/fm/topo/libtopo/common/topo_mod.h (revision dd23d762c65e503874085a3893fbd3df9688da30)
17aec1d6eScindi /*
27aec1d6eScindi  * CDDL HEADER START
37aec1d6eScindi  *
47aec1d6eScindi  * The contents of this file are subject to the terms of the
57aec1d6eScindi  * Common Development and Distribution License (the "License").
67aec1d6eScindi  * You may not use this file except in compliance with the License.
77aec1d6eScindi  *
87aec1d6eScindi  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97aec1d6eScindi  * or http://www.opensolaris.org/os/licensing.
107aec1d6eScindi  * See the License for the specific language governing permissions
117aec1d6eScindi  * and limitations under the License.
127aec1d6eScindi  *
137aec1d6eScindi  * When distributing Covered Code, include this CDDL HEADER in each
147aec1d6eScindi  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157aec1d6eScindi  * If applicable, add the following below this CDDL HEADER, with the
167aec1d6eScindi  * fields enclosed by brackets "[]" replaced with your own identifying
177aec1d6eScindi  * information: Portions Copyright [yyyy] [name of copyright owner]
187aec1d6eScindi  *
197aec1d6eScindi  * CDDL HEADER END
207aec1d6eScindi  */
217aec1d6eScindi 
227aec1d6eScindi /*
23f6e214c7SGavin Maltby  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
247aec1d6eScindi  */
256d65bee7SRob Johnston /*
26c5591576SRob Johnston  * Copyright 2020 Joyent, Inc.
27*dd23d762SRobert Mustacchi  * Copyright 2023 Oxide Computer Company
286d65bee7SRob Johnston  */
297aec1d6eScindi 
307aec1d6eScindi #ifndef _TOPO_MOD_H
317aec1d6eScindi #define	_TOPO_MOD_H
327aec1d6eScindi 
337aec1d6eScindi #include <fm/libtopo.h>
340eb822a1Scindi #include <fm/topo_hc.h>
352eeaed14Srobj #include <libipmi.h>
367aec1d6eScindi #include <libnvpair.h>
370eb822a1Scindi #include <libdevinfo.h>
38738c43b5SEric Schrock #include <smbios.h>
3966d05358SRob Johnston #include <pcidb.h>
409c994d58SRobert Mustacchi #include <stdarg.h>
417aec1d6eScindi 
427aec1d6eScindi #ifdef __cplusplus
437aec1d6eScindi extern "C" {
447aec1d6eScindi #endif
457aec1d6eScindi 
467aec1d6eScindi /*
477aec1d6eScindi  * Enumerator and method supplier module API
487aec1d6eScindi  */
497aec1d6eScindi typedef struct topo_mod topo_mod_t;
507aec1d6eScindi 
517aec1d6eScindi typedef int topo_method_f(topo_mod_t *, tnode_t *, topo_version_t, nvlist_t *,
527aec1d6eScindi     nvlist_t **);
537aec1d6eScindi typedef int topo_enum_f(topo_mod_t *, tnode_t *, const char *, topo_instance_t,
540eb822a1Scindi     topo_instance_t, void *, void *);
557aec1d6eScindi typedef void topo_release_f(topo_mod_t *, tnode_t *);
567aec1d6eScindi 
577aec1d6eScindi typedef struct topo_method {
587aec1d6eScindi 	const char *tm_name;			/* Method name */
597aec1d6eScindi 	const char *tm_desc;			/* Method description */
607aec1d6eScindi 	const topo_version_t tm_version;	/* Method version */
617aec1d6eScindi 	const topo_stability_t tm_stability;	/* Attributes of method */
627aec1d6eScindi 	topo_method_f *tm_func;			/* Method function */
637aec1d6eScindi } topo_method_t;
647aec1d6eScindi 
650eb822a1Scindi typedef struct topo_modops {
660eb822a1Scindi 	topo_enum_f *tmo_enum;		/* enumeration op */
670eb822a1Scindi 	topo_release_f *tmo_release;	/* resource release op */
680eb822a1Scindi } topo_modops_t;
690eb822a1Scindi 
707aec1d6eScindi typedef struct topo_mod_info {
710eb822a1Scindi 	const char *tmi_desc;		/* module description */
720eb822a1Scindi 	const char *tmi_scheme;		/* enumeration scheme type  */
730eb822a1Scindi 	topo_version_t tmi_version;	/* module version */
740eb822a1Scindi 	const topo_modops_t *tmi_ops;	/* module ops vector */
757aec1d6eScindi } topo_modinfo_t;
767aec1d6eScindi 
770eb822a1Scindi extern topo_mod_t *topo_mod_load(topo_mod_t *, const char *, topo_version_t);
787aec1d6eScindi extern void topo_mod_unload(topo_mod_t *);
790eb822a1Scindi extern int topo_mod_register(topo_mod_t *, const topo_modinfo_t *,
800eb822a1Scindi     topo_version_t);
817aec1d6eScindi extern void topo_mod_unregister(topo_mod_t *);
827aec1d6eScindi extern int topo_mod_enumerate(topo_mod_t *, tnode_t *, const char *,
830eb822a1Scindi     const char *, topo_instance_t, topo_instance_t, void *);
840eb822a1Scindi extern int topo_mod_enummap(topo_mod_t *mod, tnode_t *, const char *,
850eb822a1Scindi     const char *);
86317c37f3SRob Johnston extern char *topo_mod_product(topo_mod_t *);
877aec1d6eScindi extern void topo_mod_release(topo_mod_t *, tnode_t *);
880eb822a1Scindi extern void topo_mod_setspecific(topo_mod_t *, void *);
890eb822a1Scindi extern void *topo_mod_getspecific(topo_mod_t *);
900eb822a1Scindi 
910eb822a1Scindi extern nvlist_t *topo_mod_cpufmri(topo_mod_t *, int, uint32_t, uint8_t,
920eb822a1Scindi     const char *);
930eb822a1Scindi extern nvlist_t *topo_mod_devfmri(topo_mod_t *, int, const char *,
940eb822a1Scindi     const char *);
950eb822a1Scindi extern nvlist_t *topo_mod_hcfmri(topo_mod_t *, tnode_t *, int, const char *,
960eb822a1Scindi     topo_instance_t, nvlist_t *, nvlist_t *, const char *, const char *,
970eb822a1Scindi     const char *);
980eb822a1Scindi extern nvlist_t *topo_mod_memfmri(topo_mod_t *, int, uint64_t, uint64_t,
990eb822a1Scindi     const char *, int);
1000eb822a1Scindi extern nvlist_t *topo_mod_modfmri(topo_mod_t *, int, const char *);
1010eb822a1Scindi extern nvlist_t *topo_mod_pkgfmri(topo_mod_t *, int, const char *);
102f6e214c7SGavin Maltby extern nvlist_t *topo_mod_swfmri(topo_mod_t *, int,
103f6e214c7SGavin Maltby     char *, char *, nvlist_t *,
104f6e214c7SGavin Maltby     char *, char *, char *, char *, int64_t,
105f6e214c7SGavin Maltby     char *, char *, int64_t, char *, int64_t, char **, uint_t);
1060eb822a1Scindi extern int topo_mod_nvl2str(topo_mod_t *, nvlist_t *, char **);
1070eb822a1Scindi extern int topo_mod_str2nvl(topo_mod_t *, const char *,  nvlist_t **);
108825ba0f2Srobj extern int topo_prop_setmutable(tnode_t *node, const char *pgname,
109825ba0f2Srobj     const char *pname, int *err);
110e5dcf7beSRobert Johnston extern int topo_prop_setnonvolatile(tnode_t *node, const char *pgname,
111e5dcf7beSRobert Johnston     const char *pname, int *err);
1120eb822a1Scindi /*
113c40d7343Scindi  * Snapshot walker support
114c40d7343Scindi  */
115c40d7343Scindi typedef int (*topo_mod_walk_cb_t)(topo_mod_t *, tnode_t *, void *);
116c40d7343Scindi 
117c40d7343Scindi extern topo_walk_t *topo_mod_walk_init(topo_mod_t *, tnode_t *,
118c40d7343Scindi     topo_mod_walk_cb_t, void *, int *);
119c40d7343Scindi 
120c40d7343Scindi /*
1210eb822a1Scindi  * Flags for topo_mod_memfmri
1220eb822a1Scindi  */
1230eb822a1Scindi #define	TOPO_MEMFMRI_PA		0x0001	/* Valid physical address */
1240eb822a1Scindi #define	TOPO_MEMFMRI_OFFSET	0x0002	/* Valid offset */
1257aec1d6eScindi 
1267aec1d6eScindi extern int topo_method_register(topo_mod_t *, tnode_t *, const topo_method_t *);
1277aec1d6eScindi extern void topo_method_unregister(topo_mod_t *, tnode_t *, const char *);
1287aec1d6eScindi extern void topo_method_unregister_all(topo_mod_t *, tnode_t *);
1297aec1d6eScindi 
1300eb822a1Scindi extern di_node_t topo_mod_devinfo(topo_mod_t *);
1310b1b4412SEric Schrock extern ipmi_handle_t *topo_mod_ipmi_hold(topo_mod_t *);
1320b1b4412SEric Schrock extern void topo_mod_ipmi_rele(topo_mod_t *);
133738c43b5SEric Schrock extern smbios_hdl_t *topo_mod_smbios(topo_mod_t *);
13466d05358SRob Johnston extern pcidb_hdl_t *topo_mod_pcidb(topo_mod_t *);
1350eb822a1Scindi extern di_prom_handle_t topo_mod_prominfo(topo_mod_t *);
1360eb822a1Scindi extern nvlist_t *topo_mod_auth(topo_mod_t *, tnode_t *);
1370eb822a1Scindi 
138e5dcf7beSRobert Johnston extern int topo_method_sensor_failure(topo_mod_t *, tnode_t *, topo_version_t,
139e5dcf7beSRobert Johnston     nvlist_t *, nvlist_t **);
140e5dcf7beSRobert Johnston 
1417aec1d6eScindi /*
1427aec1d6eScindi  * FMRI methods
1437aec1d6eScindi  */
1447aec1d6eScindi #define	TOPO_METH_LABEL			"topo_label"
145c40d7343Scindi #define	TOPO_METH_LABEL_DESC		"label constructor"
1460eb822a1Scindi #define	TOPO_METH_LABEL_VERSION0	0
1470eb822a1Scindi #define	TOPO_METH_LABEL_VERSION		TOPO_METH_LABEL_VERSION0
1480eb822a1Scindi #define	TOPO_METH_LABEL_ARG_NVL		"label-specific"
1497aec1d6eScindi #define	TOPO_METH_LABEL_RET_STR		"label-string"
1507aec1d6eScindi 
1510eb822a1Scindi #define	TOPO_METH_PRESENT		"topo_present"
152c40d7343Scindi #define	TOPO_METH_PRESENT_DESC		"presence indicator"
1530eb822a1Scindi #define	TOPO_METH_PRESENT_VERSION0	0
1540eb822a1Scindi #define	TOPO_METH_PRESENT_VERSION	TOPO_METH_PRESENT_VERSION0
1550eb822a1Scindi #define	TOPO_METH_PRESENT_RET		"present-ret"
1560eb822a1Scindi 
15725c6ff4bSstephh #define	TOPO_METH_REPLACED		"topo_replaced"
15825c6ff4bSstephh #define	TOPO_METH_REPLACED_DESC		"replaced indicator"
15925c6ff4bSstephh #define	TOPO_METH_REPLACED_VERSION0	0
16025c6ff4bSstephh #define	TOPO_METH_REPLACED_VERSION	TOPO_METH_REPLACED_VERSION0
16125c6ff4bSstephh #define	TOPO_METH_REPLACED_RET		"replaced-ret"
16225c6ff4bSstephh 
163dd566498Svn83148 #define	TOPO_METH_UNUSABLE		"topo_unusable"
164c40d7343Scindi #define	TOPO_METH_UNUSABLE_DESC		"unusable indicator"
165dd566498Svn83148 #define	TOPO_METH_UNUSABLE_VERSION0	0
166dd566498Svn83148 #define	TOPO_METH_UNUSABLE_VERSION	TOPO_METH_UNUSABLE_VERSION0
167dd566498Svn83148 #define	TOPO_METH_UNUSABLE_RET		"unusable-ret"
168dd566498Svn83148 
16925c6ff4bSstephh #define	TOPO_METH_SERVICE_STATE		"topo_service_state"
17025c6ff4bSstephh #define	TOPO_METH_SERVICE_STATE_DESC	"service_state indicator"
17125c6ff4bSstephh #define	TOPO_METH_SERVICE_STATE_VERSION0	0
17225c6ff4bSstephh #define	TOPO_METH_SERVICE_STATE_VERSION	TOPO_METH_SERVICE_STATE_VERSION0
17325c6ff4bSstephh #define	TOPO_METH_SERVICE_STATE_RET	"service_state-ret"
17425c6ff4bSstephh 
175e4b86885SCheng Sean Ye #define	TOPO_METH_RETIRE		"topo_retire"
176e4b86885SCheng Sean Ye #define	TOPO_METH_RETIRE_DESC		"retire action"
177e4b86885SCheng Sean Ye #define	TOPO_METH_RETIRE_VERSION0	0
178e4b86885SCheng Sean Ye #define	TOPO_METH_RETIRE_VERSION	TOPO_METH_RETIRE_VERSION0
179e4b86885SCheng Sean Ye #define	TOPO_METH_RETIRE_RET		"retire-ret"
180e4b86885SCheng Sean Ye 
181e4b86885SCheng Sean Ye #define	TOPO_METH_UNRETIRE		"topo_unretire"
182e4b86885SCheng Sean Ye #define	TOPO_METH_UNRETIRE_DESC		"unretire action"
183e4b86885SCheng Sean Ye #define	TOPO_METH_UNRETIRE_VERSION0	0
184e4b86885SCheng Sean Ye #define	TOPO_METH_UNRETIRE_VERSION	TOPO_METH_UNRETIRE_VERSION0
185e4b86885SCheng Sean Ye #define	TOPO_METH_UNRETIRE_RET		"unretire-ret"
186e4b86885SCheng Sean Ye 
187dd566498Svn83148 #define	TOPO_METH_EXPAND		"topo_expand"
188dd566498Svn83148 #define	TOPO_METH_EXPAND_DESC		"expand FMRI"
189dd566498Svn83148 #define	TOPO_METH_EXPAND_VERSION0	0
190dd566498Svn83148 #define	TOPO_METH_EXPAND_VERSION	TOPO_METH_EXPAND_VERSION0
191dd566498Svn83148 
19270818f58Stsien #define	TOPO_METH_CONTAINS		"topo_contains"
19370818f58Stsien #define	TOPO_METH_CONTAINS_DESC		"FMRI contains sub-FMRI"
19470818f58Stsien #define	TOPO_METH_CONTAINS_VERSION0	0
19570818f58Stsien #define	TOPO_METH_CONTAINS_VERSION	TOPO_METH_CONTAINS_VERSION0
19670818f58Stsien #define	TOPO_METH_CONTAINS_RET		"contains-return"
19770818f58Stsien #define	TOPO_METH_FMRI_ARG_FMRI		"fmri"
19870818f58Stsien #define	TOPO_METH_FMRI_ARG_SUBFMRI	"sub-fmri"
19970818f58Stsien 
2000eb822a1Scindi #define	TOPO_METH_ASRU_COMPUTE		"topo_asru_compute"
2010eb822a1Scindi #define	TOPO_METH_ASRU_COMPUTE_VERSION	0
2020eb822a1Scindi #define	TOPO_METH_ASRU_COMPUTE_DESC	"Dynamic ASRU constructor"
2030eb822a1Scindi 
2040eb822a1Scindi #define	TOPO_METH_FRU_COMPUTE		"topo_fru_compute"
2050eb822a1Scindi #define	TOPO_METH_FRU_COMPUTE_VERSION	0
2060eb822a1Scindi #define	TOPO_METH_FRU_COMPUTE_DESC	"Dynamic FRU constructor"
2070eb822a1Scindi 
20824db4641Seschrock #define	TOPO_METH_DISK_STATUS		"topo_disk_status"
20924db4641Seschrock #define	TOPO_METH_DISK_STATUS_VERSION	0
21024db4641Seschrock #define	TOPO_METH_DISK_STATUS_DESC	"Disk status"
21124db4641Seschrock 
212e5dcf7beSRobert Johnston #define	TOPO_METH_SENSOR_FAILURE	"topo_sensor_failure"
213e5dcf7beSRobert Johnston #define	TOPO_METH_SENSOR_FAILURE_VERSION	0
214e5dcf7beSRobert Johnston #define	TOPO_METH_SENSOR_FAILURE_DESC	"Sensor failure state"
215e5dcf7beSRobert Johnston 
216825ba0f2Srobj #define	TOPO_PROP_METH_DESC		"Dynamic Property method"
217825ba0f2Srobj 
218825ba0f2Srobj #define	TOPO_METH_IPMI_ENTITY		"ipmi_entity"
219825ba0f2Srobj #define	TOPO_METH_FAC_ENUM_DESC		"Facility Enumerator"
220825ba0f2Srobj 
2217aec1d6eScindi extern void *topo_mod_alloc(topo_mod_t *, size_t);
2227aec1d6eScindi extern void *topo_mod_zalloc(topo_mod_t *, size_t);
2237aec1d6eScindi extern void topo_mod_free(topo_mod_t *, void *, size_t);
2247aec1d6eScindi extern char *topo_mod_strdup(topo_mod_t *, const char *);
2257aec1d6eScindi extern void topo_mod_strfree(topo_mod_t *, char *);
226e2336878SRob Johnston extern void topo_mod_strfreev(topo_mod_t *, char **, uint_t);
2277aec1d6eScindi extern int topo_mod_nvalloc(topo_mod_t *, nvlist_t **, uint_t);
2287aec1d6eScindi extern int topo_mod_nvdup(topo_mod_t *, nvlist_t *, nvlist_t **);
2299c994d58SRobert Mustacchi extern int topo_mod_vasprintf(topo_mod_t *, char **, const char *,
2309c994d58SRobert Mustacchi     va_list) __VPRINTFLIKE(3);
2319c994d58SRobert Mustacchi extern int topo_mod_asprintf(topo_mod_t *, char **, const char *,
2329c994d58SRobert Mustacchi     ...) __PRINTFLIKE(3);
2337aec1d6eScindi 
2347aec1d6eScindi extern void topo_mod_clrdebug(topo_mod_t *);
2350eb822a1Scindi extern void topo_mod_setdebug(topo_mod_t *);
2366597d6fcSRobert Mustacchi extern void topo_mod_dprintf(topo_mod_t *, const char *, ...) __PRINTFLIKE(2);
2377aec1d6eScindi extern const char *topo_mod_errmsg(topo_mod_t *);
2387aec1d6eScindi extern int topo_mod_errno(topo_mod_t *);
2396d65bee7SRob Johnston extern char *topo_mod_clean_str(topo_mod_t *, const char *);
2409c994d58SRobert Mustacchi extern char *topo_mod_clean_strn(topo_mod_t *, const char *, size_t);
2417aec1d6eScindi 
2427aec1d6eScindi /*
2437aec1d6eScindi  * Topo node utilities: callable from module enumeration, topo_mod_enumerate()
2447aec1d6eScindi  */
2457aec1d6eScindi extern int topo_node_range_create(topo_mod_t *, tnode_t *, const char *,
2467aec1d6eScindi     topo_instance_t, topo_instance_t);
2477aec1d6eScindi extern void topo_node_range_destroy(tnode_t *, const char *);
2487aec1d6eScindi extern tnode_t *topo_node_bind(topo_mod_t *, tnode_t *, const char *,
2490eb822a1Scindi     topo_instance_t, nvlist_t *);
250825ba0f2Srobj extern tnode_t *topo_node_facbind(topo_mod_t *, tnode_t *, const char *,
251825ba0f2Srobj     const char *);
2527aec1d6eScindi extern void topo_node_unbind(tnode_t *);
2530eb822a1Scindi extern void topo_node_setspecific(tnode_t *, void *);
2540eb822a1Scindi extern void *topo_node_getspecific(tnode_t *);
2550eb822a1Scindi extern int topo_node_asru_set(tnode_t *node, nvlist_t *, int, int *);
2560eb822a1Scindi extern int topo_node_fru_set(tnode_t *node, nvlist_t *, int, int *);
257672fc84aSRobert Mustacchi extern int topo_node_label_set(tnode_t *node, const char *, int *);
2580eb822a1Scindi 
2590eb822a1Scindi #define	TOPO_ASRU_COMPUTE	0x0001	/* Compute ASRU dynamically */
2600eb822a1Scindi #define	TOPO_FRU_COMPUTE	0x0002	/* Compute FRU dynamically */
2617aec1d6eScindi 
262c40d7343Scindi extern int topo_prop_inherit(tnode_t *, const char *, const char *, int *);
263c40d7343Scindi extern int topo_pgroup_create(tnode_t *, const topo_pgroup_info_t *, int *);
264c40d7343Scindi 
265c40d7343Scindi /*
266*dd23d762SRobert Mustacchi  * Conveience property group and property creation.
267*dd23d762SRobert Mustacchi  */
268*dd23d762SRobert Mustacchi extern int topo_create_props(topo_mod_t *, tnode_t *, int,
269*dd23d762SRobert Mustacchi     const topo_pgroup_info_t *, ...);
270*dd23d762SRobert Mustacchi 
271*dd23d762SRobert Mustacchi /*
272c40d7343Scindi  * Topo property method registration
273c40d7343Scindi  */
274c40d7343Scindi extern int topo_prop_method_register(tnode_t *, const char *, const char *,
275c40d7343Scindi     topo_type_t, const char *, const nvlist_t *, int *);
276c40d7343Scindi extern void topo_prop_method_unregister(tnode_t *, const char *, const char *);
277c40d7343Scindi 
278744642a2SRobert Mustacchi extern tnode_t *topo_mod_create_ufm(topo_mod_t *, tnode_t *, topo_instance_t,
279744642a2SRobert Mustacchi     const char *, topo_ufm_slot_info_t *);
280508a0e8cSRob Johnston extern tnode_t *topo_mod_create_ufm_slot(topo_mod_t *, tnode_t *,
281508a0e8cSRob Johnston     topo_ufm_slot_info_t *);
282508a0e8cSRob Johnston 
283c40d7343Scindi /*
2847aec1d6eScindi  * This enum definition is used to define a set of error tags associated with
2850eb822a1Scindi  * the module api error conditions.  The shell script mkerror.sh is
2867aec1d6eScindi  * used to parse this file and create a corresponding topo_error.c source file.
2877aec1d6eScindi  * If you do something other than add a new error tag here, you may need to
2887aec1d6eScindi  * update the mkerror shell script as it is based upon simple regexps.
2897aec1d6eScindi  */
2907aec1d6eScindi typedef enum topo_mod_errno {
2917aec1d6eScindi     EMOD_UNKNOWN = 2000, /* unknown libtopo error */
2927aec1d6eScindi     EMOD_NOMEM,			/* module memory limit exceeded */
2937aec1d6eScindi     EMOD_PARTIAL_ENUM,		/* module completed partial enumeration */
2947aec1d6eScindi     EMOD_METHOD_INVAL,		/* method arguments invalid */
2957aec1d6eScindi     EMOD_METHOD_NOTSUP,		/* method not supported */
2967aec1d6eScindi     EMOD_FMRI_NVL,		/* nvlist allocation failure for FMRI */
2977aec1d6eScindi     EMOD_FMRI_VERSION,		/* invalid FMRI scheme version */
2987aec1d6eScindi     EMOD_FMRI_MALFORM,		/* malformed FMRI */
299825ba0f2Srobj     EMOD_NODE_BOUND,		/* node already bound */
300825ba0f2Srobj     EMOD_NODE_DUP,		/* duplicate node */
301825ba0f2Srobj     EMOD_NODE_NOENT,		/* node not found */
302825ba0f2Srobj     EMOD_NODE_RANGE,		/* invalid node range */
3030eb822a1Scindi     EMOD_VER_ABI,		/* registered with invalid ABI version */
3040eb822a1Scindi     EMOD_VER_OLD,		/* attempt to load obsolete module */
3050eb822a1Scindi     EMOD_VER_NEW,		/* attempt to load a newer module */
3067aec1d6eScindi     EMOD_NVL_INVAL,		/* invalid nvlist */
3077aec1d6eScindi     EMOD_NONCANON,		/* non-canonical component name requested */
3080eb822a1Scindi     EMOD_MOD_NOENT,		/* module lookup failed */
3090eb822a1Scindi     EMOD_UKNOWN_ENUM,		/* unknown enumeration error */
310c5591576SRob Johnston     EMOD_DIGRAPH_MAXSZ,		/* max digraph size exceeded */
3117aec1d6eScindi     EMOD_END			/* end of mod errno list (to ease auto-merge) */
3127aec1d6eScindi } topo_mod_errno_t;
3137aec1d6eScindi 
3147aec1d6eScindi extern int topo_mod_seterrno(topo_mod_t *, int);
3157aec1d6eScindi 
316672fc84aSRobert Mustacchi /*
317672fc84aSRobert Mustacchi  * Function used by a module to try and open a file based on FM's search path.
318672fc84aSRobert Mustacchi  */
319672fc84aSRobert Mustacchi extern int topo_mod_file_search(topo_mod_t *, const char *file, int oflags);
320672fc84aSRobert Mustacchi 
3218abca89fSRob Johnston extern topo_method_f topo_mod_hc_occupied;
3228abca89fSRob Johnston 
323c5591576SRob Johnston /*
324c5591576SRob Johnston  * Directed Graph topology interfaces
325c5591576SRob Johnston  */
326c5591576SRob Johnston extern topo_digraph_t *topo_digraph_new(topo_hdl_t *, topo_mod_t *,
327c5591576SRob Johnston     const char *);
328c5591576SRob Johnston extern void topo_digraph_destroy(topo_digraph_t *);
329c5591576SRob Johnston 
330c5591576SRob Johnston extern topo_vertex_t *topo_vertex_new(topo_mod_t *, const char *,
331c5591576SRob Johnston     topo_instance_t);
332c5591576SRob Johnston extern void topo_vertex_destroy(topo_mod_t *mod, topo_vertex_t *vtx);
333c5591576SRob Johnston 
334c5591576SRob Johnston extern int topo_edge_new(topo_mod_t *, topo_vertex_t *, topo_vertex_t *);
335c5591576SRob Johnston 
3367aec1d6eScindi #ifdef	__cplusplus
3377aec1d6eScindi }
3387aec1d6eScindi #endif
3397aec1d6eScindi 
3407aec1d6eScindi #endif	/* _TOPO_MOD_H */
341