xref: /illumos-gate/usr/src/uts/common/sys/ksensor_impl.h (revision 7c34a79b137bcbd26ee8292e08e8bf031e93089f)
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 2026 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_open(id_t);
38 extern int ksensor_op_kind(id_t, sensor_ioctl_kind_t *);
39 extern int ksensor_op_scalar(id_t, sensor_ioctl_scalar_t *);
40 extern int ksensor_op_close(id_t);
41 
42 /*
43  * Registration callbacks.
44  */
45 typedef int (*ksensor_create_f)(id_t, const char *, const char *);
46 typedef void (*ksensor_remove_f)(id_t, const char *);
47 extern int ksensor_register(dev_info_t *, ksensor_create_f, ksensor_remove_f);
48 extern void ksensor_unregister(dev_info_t *);
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 
54 #endif /* _SYS_KSENSOR_IMPL_H */
55