SWSENSOR(4) | Device Drivers Manual | SWSENSOR(4) |
swsensor
—
pseudo-device swsensor
swsensor
driver provides a software environmental
sensor that works with sysctl(8)
and envstat(8). The driver is
intended to be loaded as a kernel module. One can, however, include the
swsensor
driver directly in a kernel using the
configuration from the synopsis. By default, the sensor is of type
ENVSYS_UNITS_INTEGER
.
The following values can be specified in the
modload(8) command when
loading the swsensor
module to alter the driver's
behavior.
mode
swsensor
provides
internally-maintained limits and limit checking
limit
mode
is set to 1 or 2)value_max
value_min
ENVSYS_FVALID_MAX
and
ENVSYS_FVALID_MIN
flags are implicitly set.percentage
ENVSYS_FPERCENT
flag.type
Temperature | Fan | Voltage AC |
Voltage DC | Ohms | Watts |
Ampere | Watt hour | Ampere hour |
Indicator | Integer | Drive |
Battery capacity | Battery charge |
value
For example,
modload -s
type=Voltage\ DC swsensor
ENVSYS_UNITS_SVOLTS_DC
,
while
modload -i mode=1 -i
limit=50 swsensor
The sensor's raw value and state can be manually updated by modifying the sysctl(8) variables “hw.swsensor.cur_value” and “hw.swsensor.state” variables respectively.
swsensor
driver was written by Paul
Goyette and first appeared in NetBSD 6.0.
swsensor
driver emulates a device with only a single
sensor.
The swsensor
driver can only emulate one
hardware-managed limit; this is assumed to be the
critical-min
limit.
June 1, 2016 | NetBSD 9.4 |