xref: /illumos-gate/usr/src/uts/common/sys/ksensor_impl.h (revision ed093b41a93e8563e6e1e5dae0768dda2a7bcc27)
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 Oxide Computer Company
14  */
15 
16 #ifndef _SYS_KSENSOR_IMPL_H
17 #define	_SYS_KSENSOR_IMPL_H
18 
19 /*
20  * ksensor implementation glue.
21  */
22 
23 #include <sys/sensors.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /*
30  * Routine for the kernel to initalize the subsystem.
31  */
32 extern void ksensor_init(void);
33 
34 /*
35  * Operations vectors.
36  */
37 extern int ksensor_op_kind(id_t, sensor_ioctl_kind_t *);
38 extern int ksensor_op_scalar(id_t, sensor_ioctl_scalar_t *);
39 
40 /*
41  * Registration callbacks.
42  */
43 typedef int (*ksensor_create_f)(id_t, const char *, const char *);
44 typedef void (*ksensor_remove_f)(id_t, const char *);
45 extern int ksensor_register(dev_info_t *, ksensor_create_f, ksensor_remove_f);
46 extern void ksensor_unregister(dev_info_t *);
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif /* _SYS_KSENSOR_IMPL_H */
53