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 2019 Joyent, Inc.
14 */
15
16 #ifndef _SYS_DDI_UFM_H
17 #define _SYS_DDI_UFM_H
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 #ifdef _KERNEL
24 #include <sys/cred.h>
25 #include <sys/dditypes.h>
26 #include <sys/nvpair.h>
27 #include <sys/param.h>
28 #else
29 #include <sys/nvpair.h>
30 #include <sys/param.h>
31 #include <sys/types.h>
32 #endif /* _KERNEL */
33
34 #define DDI_UFM_DEV "/dev/ufm"
35 #define DDI_UFM_CURRENT_VERSION 1
36 #define DDI_UFM_VERSION_ONE 1
37
38 #define UFM_IOC ('u' << 24) | ('f' << 16) | ('m' << 8)
39 #define UFM_IOC_GETCAPS (UFM_IOC | 1)
40 #define UFM_IOC_REPORTSZ (UFM_IOC | 2)
41 #define UFM_IOC_REPORT (UFM_IOC | 3)
42 #define UFM_IOC_MAX UFM_IOC_REPORT
43
44 /*
45 * Bitfield enumerating the DDI UFM capabilities supported by this device
46 * instance. Currently there is only a single capability of being able to
47 * report UFM information. Future UFM versions may add additional capabilities
48 * such as the ability to obtain a raw dump the firmware image or ability to
49 * upgrade the firmware. When support for new capabilties are added to the DDI
50 * UFM subsystem, it should be reflected in this enum and the implementation of
51 * the UFM_IOC_GETCAPS should be extended appropriately.
52 */
53 typedef enum {
54 DDI_UFM_CAP_REPORT = 1 << 0,
55 } ddi_ufm_cap_t;
56
57 /*
58 * This struct defines the input/output data for the UFM_IOC_GETCAPS ioctl.
59 * Callers should specify the ufmg_version and ufmg_devpath fields. On success
60 * the ufmg_caps field will be filled in with a value indicating the supported
61 * UFM capabilities of the device specified in ufmg_devpath.
62 */
63 typedef struct ufm_ioc_getcaps {
64 uint_t ufmg_version; /* DDI_UFM_VERSION */
65 uint_t ufmg_caps; /* UFM Caps */
66 char ufmg_devpath[MAXPATHLEN];
67 } ufm_ioc_getcaps_t;
68
69 /*
70 * This struct defines the input/output data for the UFM_IOC_REPORTSZ ioctl.
71 * Callers should specify the ufbz_version and ufbz_devpath fields. On success
72 * the ufmg_size field will be filled in with the amount of space (in bytes)
73 * required to hold the UFM data for this device instance. This should be used
74 * to allocate a sufficiently size buffer for the UFM_IOC_REPORT ioctl.
|
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 2020 Joyent, Inc.
14 */
15
16 #ifndef _SYS_DDI_UFM_H
17 #define _SYS_DDI_UFM_H
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 #ifdef _KERNEL
24 #include <sys/cred.h>
25 #include <sys/dditypes.h>
26 #include <sys/nvpair.h>
27 #include <sys/param.h>
28 #else
29 #include <sys/nvpair.h>
30 #include <sys/param.h>
31 #include <sys/types.h>
32 #endif /* _KERNEL */
33
34 #define DDI_UFM_DEV "/dev/ufm"
35 #define DDI_UFM_CURRENT_VERSION 1
36 #define DDI_UFM_VERSION_ONE 1
37
38 #define UFM_IOC ('u' << 24) | ('f' << 16) | ('m' << 8)
39 #define UFM_IOC_GETCAPS (UFM_IOC | 1)
40 #define UFM_IOC_REPORTSZ (UFM_IOC | 2)
41 #define UFM_IOC_REPORT (UFM_IOC | 3)
42 #define UFM_IOC_MAX UFM_IOC_REPORT
43
44 /*
45 * Bitfield enumerating the DDI UFM capabilities supported by this device
46 * instance. Currently there is only a single capability of being able to
47 * report UFM information. Future UFM versions may add additional capabilities
48 * such as the ability to obtain a raw dump the firmware image or ability to
49 * upgrade the firmware. When support for new capabilties are added to the DDI
50 * UFM subsystem, it should be reflected in this enum and the implementation of
51 * the UFM_IOC_GETCAPS should be extended appropriately.
52 */
53 typedef enum {
54 DDI_UFM_CAP_REPORT = 1 << 0
55 } ddi_ufm_cap_t;
56
57 /*
58 * This struct defines the input/output data for the UFM_IOC_GETCAPS ioctl.
59 * Callers should specify the ufmg_version and ufmg_devpath fields. On success
60 * the ufmg_caps field will be filled in with a value indicating the supported
61 * UFM capabilities of the device specified in ufmg_devpath.
62 */
63 typedef struct ufm_ioc_getcaps {
64 uint_t ufmg_version; /* DDI_UFM_VERSION */
65 uint_t ufmg_caps; /* UFM Caps */
66 char ufmg_devpath[MAXPATHLEN];
67 } ufm_ioc_getcaps_t;
68
69 /*
70 * This struct defines the input/output data for the UFM_IOC_REPORTSZ ioctl.
71 * Callers should specify the ufbz_version and ufbz_devpath fields. On success
72 * the ufmg_size field will be filled in with the amount of space (in bytes)
73 * required to hold the UFM data for this device instance. This should be used
74 * to allocate a sufficiently size buffer for the UFM_IOC_REPORT ioctl.
|