1.\" $NetBSD: swsensor.4,v 1.5 2010/12/16 14:33:30 pgoyette Exp $ 2.\" 3.\" Copyright (c) 2010 The NetBSD Foundation 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Paul Goyette. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd December 16, 2010 31.Dt SWSENSOR 4 32.Os 33.Sh NAME 34.Nm swsensor 35.Nd software environmental sensor 36.Sh SYNOPSIS 37.Cd "pseudo-device swsensor" 38.Sh DESCRIPTION 39The 40.Nm 41driver provides a software environmental sensor that works with 42.Xr sysctl 8 43and 44.Xr envstat 8 . 45The driver is intended to be loaded as a kernel module. 46One can, however, include the 47.Nm 48driver directly in a kernel using the configuration from the synopsis. 49By default, the sensor is of type 50.Dv ENVSYS_UNITS_INTEGER . 51.Pp 52The following integer values can be specified in the 53.Xr modload 8 54command when loading the 55.Nm 56module to alter the driver's behavior. 57.Pp 58.Bl -tag -width "variable" 59.It Sy "Variable" Sy "Usage" 60.It Li "mode" 61Controls whether or not 62.Nm 63provides internally-maintained limits and limit checking 64.Bl -tag -width "Value" 65.It Sy "Value" Sy "Meaning" 66.It Li "0" 67sensor has no internally-maintained limits 68.It Li "1" 69sensor provides its own internal limit value 70.It Li "2" 71sensor maintains an internal adjustable limit and performs its own 72comparison between the sensor's limit and its current value 73.El 74.It Li "limit" 75The initial limit value, if limit emulation is selected (ie, if 76.Dv mode 77is set to 1 or 2) 78.It Li "type" 79Override the sensor's unit/type. 80.It Li "value" 81Provide an initial value for the sensor. 82If this is omitted, the sensor's initial value is set to zero. 83.El 84.Pp 85For example, 86.Dl Ic modload -i type=1 swsensor 87will create a sensor of type 88.Dv ENVSYS_UNITS_SFANRPM , 89while 90.Dl Ic modload -i mode=1 -i limit=50 swsensor 91will create a sensor which has an initial, device-provided limit of 50. 92.Pp 93The sensor's raw value can be manually updated by modifying the 94.Xr sysctl 8 95variable 96.Dq hw.swsensor.cur_value . 97.Sh SEE ALSO 98.Xr modctl 2 , 99.Xr envstat 8 , 100.Xr sysctl 8 101.Sh HISTORY 102The 103.Nm 104driver was written by 105.An Paul Goyette 106and first appeared in 107.Nx 6.0 . 108.Sh BUGS 109The 110.Nm 111driver emulates a device with only a single sensor. 112.Pp 113The 114.Nm 115driver can only emulate one hardware-managed limit; this is assumed to 116be the 117.Dv critical-min 118limit. 119