summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/ksensor_impl.h
blob: 7407a264a26b41eb5514308f9653f9634a480903 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * This file and its contents are supplied under the terms of the
 * Common Development and Distribution License ("CDDL"), version 1.0.
 * You may only use this file in accordance with the terms of version
 * 1.0 of the CDDL.
 *
 * A full copy of the text of the CDDL should have accompanied this
 * source.  A copy of the CDDL is also available via the Internet at
 * http://www.illumos.org/license/CDDL.
 */

/*
 * Copyright 2020 Oxide Computer Company
 */

#ifndef _SYS_KSENSOR_IMPL_H
#define	_SYS_KSENSOR_IMPL_H

/*
 * ksensor implementation glue.
 */

#include <sys/sensors.h>

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Routine for the kernel to initalize the subsystem.
 */
extern void ksensor_init(void);

/*
 * Operations vectors.
 */
extern int ksensor_op_kind(id_t, sensor_ioctl_kind_t *);
extern int ksensor_op_scalar(id_t, sensor_ioctl_scalar_t *);

/*
 * Registration callbacks.
 */
typedef int (*ksensor_create_f)(id_t, const char *, const char *);
typedef void (*ksensor_remove_f)(id_t, const char *);
extern int ksensor_register(dev_info_t *, ksensor_create_f, ksensor_remove_f);
extern void ksensor_unregister(dev_info_t *);

#ifdef __cplusplus
}
#endif

#endif /* _SYS_KSENSOR_IMPL_H */