xref: /illumos-gate/usr/src/lib/fm/topo/modules/common/ufm/topo_ufm.h (revision de27825976aef9b5a7b956ede505fc9bab8acfd2)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2023 Oxide Computer Company
14  */
15 
16 #ifndef _TOPO_UFM_H
17 #define	_TOPO_UFM_H
18 
19 /*
20  * The ufm module provides the ability for callers to enumerate ufm subtrees
21  * beneath them. The module will create all required ranges. To invoke this, one
22  * should use the topo_hc.h UFM definition as the name. The enumerator requires
23  * an argument that describes how the UFM should be found. There are different
24  * structures for each type, the first argument is always a topo_ufm_method_t.
25  *
26  * Currently the only supported method is to use a devinfo path (i.e.
27  * di_devfs_path()). This has been designed so that way as we have more complex
28  * cases where we need to create the UFMs manually and through the kernel UFM
29  * subsystem they can leverage the same topo logic and just use an additional
30  * method.
31  *
32  * For simple cases, it is ok to still use topo_mod_create_ufm() for the time
33  * being.
34  */
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 #define	TOPO_MOD_UFM	"ufm"
41 #define	TOPO_MOD_UFM_VERS	1
42 
43 typedef enum {
44 	/*
45 	 * Enumerate a series of UFM nodes
46 	 */
47 	TOPO_UFM_M_DEVINFO
48 } topo_ufm_method_t;
49 
50 typedef struct {
51 	topo_ufm_method_t tud_method;
52 	const char *tud_path;
53 } topo_ufm_devinfo_t;
54 
55 #ifdef __cplusplus
56 }
57 #endif
58 
59 #endif /* _TOPO_UFM_H */
60