| 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.
modeswsensor provides
internally-maintained limits and limit checking
limitmode is set to 1 or 2)value_maxvalue_minENVSYS_FVALID_MAX and
ENVSYS_FVALID_MIN flags are implicitly set.percentageENVSYS_FPERCENT flag.type| Temperature | Fan | Voltage AC |
| Voltage DC | Ohms | Watts |
| Ampere | Watt hour | Ampere hour |
| Indicator | Integer | Drive |
| Battery capacity | Battery charge |
valueFor example,
modload -s
type=Voltage\ DC swsensorENVSYS_UNITS_SVOLTS_DC,
while
modload -i mode=1 -i
limit=50 swsensorThe 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.0 |