Sort sections. Sort SEE ALSO. Use HTML escapes. Remove superfluous .Pp.

Other cleanups.
This commit is contained in:
wiz 2007-09-11 22:31:35 +00:00
parent 57fffb5f82
commit 974c81fdf9
1 changed files with 75 additions and 78 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: envsys.4,v 1.33 2007/09/04 17:19:51 xtraeme Exp $ .\" $NetBSD: envsys.4,v 1.34 2007/09/11 22:31:35 wiz Exp $
.\" .\"
.\" .\"
.\" Copyright (c) 2007 The NetBSD Foundation, Inc. .\" Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -44,7 +44,6 @@
.Sh SYNOPSIS .Sh SYNOPSIS
.In sys/envsys.h .In sys/envsys.h
.Sh DESCRIPTION .Sh DESCRIPTION
.Pp
The The
.Nm .Nm
framework provides support to handle hardware monitor sensors. framework provides support to handle hardware monitor sensors.
@ -59,7 +58,7 @@ framework consists of two parts:
.It .It
the userland part, to receive the current sensor data and the userland part, to receive the current sensor data and
to set some properties on sensors: to set some properties on sensors:
.Xr envsys 4 . .Nm .
.It .It
the kernel part that is able to talk to the drivers providing sensor the kernel part that is able to talk to the drivers providing sensor
data: data:
@ -93,49 +92,49 @@ with one sensor
and all available properties set on it: and all available properties set on it:
.Pp .Pp
.Bd -literal .Bd -literal
\&<key\&>device0\&<\&/key\&> \&\*[Lt]key\&\*[Gt]device0\&\*[Lt]\&/key\&\*[Gt]
\&<array\&> \&\*[Lt]array\&\*[Gt]
\&<dict\&> \&\*[Lt]dict\&\*[Gt]
\&<key\&>avg-value\&<\&/key\&> \&\*[Lt]key\&\*[Gt]avg-value\&\*[Lt]\&/key\&\*[Gt]
\&<integer\&>36400\&<\&/integer\&> \&\*[Lt]integer\&\*[Gt]36400\&\*[Lt]\&/integer\&\*[Gt]
\&<key\&>critical-capacity\&<\&/key\&> \&\*[Lt]key\&\*[Gt]critical-capacity\&\*[Lt]\&/key\&\*[Gt]
\&<integer\&>21417\&<\&/integer\&> \&\*[Lt]integer\&\*[Gt]21417\&\*[Lt]\&/integer\&\*[Gt]
\&<key\&>critical-max-limit\&<\&/key\&> \&\*[Lt]key\&\*[Gt]critical-max-limit\&\*[Lt]\&/key\&\*[Gt]
\&<integer\&>343150000\&<\&/integer\&> \&\*[Lt]integer\&\*[Gt]343150000\&\*[Lt]\&/integer\&\*[Gt]
\&<key\&>critical-min-limit\&<\&/key\&> \&\*[Lt]key\&\*[Gt]critical-min-limit\&\*[Lt]\&/key\&\*[Gt]
\&<integer\&>288150000\&<\&/integer\&> \&\*[Lt]integer\&\*[Gt]288150000\&\*[Lt]\&/integer\&\*[Gt]
\&<key\&>cur-value\&<\&/key\&> \&\*[Lt]key\&\*[Gt]cur-value\&\*[Lt]\&/key\&\*[Gt]
\&<integer\&>406000\&<\&/integer\&> \&\*[Lt]integer\&\*[Gt]406000\&\*[Lt]\&/integer\&\*[Gt]
\&<key\&>description\&<\&/key\&> \&\*[Lt]key\&\*[Gt]description\&\*[Lt]\&/key\&\*[Gt]
\&<string\&>sensor0\&<\&/string\&> \&\*[Lt]string\&\*[Gt]sensor0\&\*[Lt]\&/string\&\*[Gt]
\&<key\&>generic-state-string\&<\&/key\&> \&\*[Lt]key\&\*[Gt]generic-state-string\&\*[Lt]\&/key\&\*[Gt]
\&<string\&>NORMAL\&<\&/string\&> \&\*[Lt]string\&\*[Gt]NORMAL\&\*[Lt]\&/string\&\*[Gt]
\&<key\&>max-value\&<\&/key\&> \&\*[Lt]key\&\*[Gt]max-value\&\*[Lt]\&/key\&\*[Gt]
\&<integer\&>3894000\&<\&/integer\&> \&\*[Lt]integer\&\*[Gt]3894000\&\*[Lt]\&/integer\&\*[Gt]
\&<key\&>min-value\&<\&/key\&> \&\*[Lt]key\&\*[Gt]min-value\&\*[Lt]\&/key\&\*[Gt]
\&<integer\&>2894000\&<\&/integer\&> \&\*[Lt]integer\&\*[Gt]2894000\&\*[Lt]\&/integer\&\*[Gt]
\&<key\&>monitoring-state-critical\&<\&/key\&> \&\*[Lt]key\&\*[Gt]monitoring-state-critical\&\*[Lt]\&/key\&\*[Gt]
\&<true\&/\&> \&\*[Lt]true\&/\&\*[Gt]
\&<key\&>monitoring-state-critover\&<\&/key\&> \&\*[Lt]key\&\*[Gt]monitoring-state-critover\&\*[Lt]\&/key\&\*[Gt]
\&<true\&/\&> \&\*[Lt]true\&/\&\*[Gt]
\&<key\&>monitoring-state-critunder\&<\&/key\&> \&\*[Lt]key\&\*[Gt]monitoring-state-critunder\&\*[Lt]\&/key\&\*[Gt]
\&<true\&/\&> \&\*[Lt]true\&/\&\*[Gt]
\&<key\&>monitoring-state-state-changed\&<\&/key\&> \&\*[Lt]key\&\*[Gt]monitoring-state-state-changed\&\*[Lt]\&/key\&\*[Gt]
\&<true\&/\&> \&\*[Lt]true\&/\&\*[Gt]
\&<key\&>monitoring-state-warnover\&<\&/key\&> \&\*[Lt]key\&\*[Gt]monitoring-state-warnover\&\*[Lt]\&/key\&\*[Gt]
\&<true\&/\&> \&\*[Lt]true\&/\&\*[Gt]
\&<key\&>monitoring-state-warnunder\&<\&/key\&> \&\*[Lt]key\&\*[Gt]monitoring-state-warnunder\&\*[Lt]\&/key\&\*[Gt]
\&<true\&/\&> \&\*[Lt]true\&/\&\*[Gt]
\&<key\&>monitoring-supported\&<\&/key\&> \&\*[Lt]key\&\*[Gt]monitoring-supported\&\*[Lt]\&/key\&\*[Gt]
\&<true\&/\&> \&\*[Lt]true\&/\&\*[Gt]
\&<key\&>state\&<\&/key\&> \&\*[Lt]key\&\*[Gt]state\&\*[Lt]\&/key\&\*[Gt]
\&<string\&>valid\&<\&/string\&> \&\*[Lt]string\&\*[Gt]valid\&\*[Lt]\&/string\&\*[Gt]
\&<key\&>type\&<\&/key\&> \&\*[Lt]key\&\*[Gt]type\&\*[Lt]\&/key\&\*[Gt]
\&<string\&>Ampere hour\&<\&/string\&> \&\*[Lt]string\&\*[Gt]Ampere hour\&\*[Lt]\&/string\&\*[Gt]
\&<key\&>want-percentage\&<\&/key\&> \&\*[Lt]key\&\*[Gt]want-percentage\&\*[Lt]\&/key\&\*[Gt]
\&<true\&/\&> \&\*[Lt]true\&/\&\*[Gt]
\&<\&/dict\&> \&\*[Lt]\&/dict\&\*[Gt]
\&<\&/array\&> \&\*[Lt]\&/array\&\*[Gt]
.Ed .Ed
.Pp .Pp
Let's explain some more about those objects: Let's explain some more about those objects:
@ -214,28 +213,28 @@ framework. Only a set of predefined keywords are recognized by
the kernel part. The following is the property list representation the kernel part. The following is the property list representation
of a dictionary with all recognized and required keywords: of a dictionary with all recognized and required keywords:
.Bd -literal .Bd -literal
\&<dict\&> \&\*[Lt]dict\&\*[Gt]
\&<key\&>driver-name\&<\&/key\&> \&\*[Lt]key\&\*[Gt]driver-name\&\*[Lt]\&/key\&\*[Gt]
\&<string\&>driver0\&<\&/string\&> \&\*[Lt]string\&\*[Gt]driver0\&\*[Lt]\&/string\&\*[Gt]
\&<key\&>sensor-name\&<\&/key\&> \&\*[Lt]key\&\*[Gt]sensor-name\&\*[Lt]\&/key\&\*[Gt]
\&<string\&>sensor0\&<\&/string\&> \&\*[Lt]string\&\*[Gt]sensor0\&\*[Lt]\&/string\&\*[Gt]
\&<key\&>new-description\&<\&/key\&> \&\*[Lt]key\&\*[Gt]new-description\&\*[Lt]\&/key\&\*[Gt]
\&<string\&>mysensor0\&<\&/string\&> \&\*[Lt]string\&\*[Gt]mysensor0\&\*[Lt]\&/string\&\*[Gt]
\&<key\&>new-rfact\&<\&/key\&> \&\*[Lt]key\&\*[Gt]new-rfact\&\*[Lt]\&/key\&\*[Gt]
\&<integer\&>56000\&<\&/integer\&> \&\*[Lt]integer\&\*[Gt]56000\&\*[Lt]\&/integer\&\*[Gt]
\&<key\&>critical-capacity\&<\&/key\&> \&\*[Lt]key\&\*[Gt]critical-capacity\&\*[Lt]\&/key\&\*[Gt]
\&<integer\&>10\&<\&/integer\&> \&\*[Lt]integer\&\*[Gt]10\&\*[Lt]\&/integer\&\*[Gt]
\&<key\&>critical-max-limit\&<\&/key\&> \&\*[Lt]key\&\*[Gt]critical-max-limit\&\*[Lt]\&/key\&\*[Gt]
\&<integer\&>3400\&<\&/integer\&> \&\*[Lt]integer\&\*[Gt]3400\&\*[Lt]\&/integer\&\*[Gt]
\&<key\&>critical-min-limit\&<\&/key\&> \&\*[Lt]key\&\*[Gt]critical-min-limit\&\*[Lt]\&/key\&\*[Gt]
\&<integer\&>2800\&<\&/integer\&> \&\*[Lt]integer\&\*[Gt]2800\&\*[Lt]\&/integer\&\*[Gt]
\&<key\&>remove-critical-cap\&<\&/key\&> \&\*[Lt]key\&\*[Gt]remove-critical-cap\&\*[Lt]\&/key\&\*[Gt]
\&<true\&/\&> \&\*[Lt]true\&/\&\*[Gt]
\&<key\&>remove-cmax-limit\&<\&/key\&> \&\*[Lt]key\&\*[Gt]remove-cmax-limit\&\*[Lt]\&/key\&\*[Gt]
\&<true\&/\&> \&\*[Lt]true\&/\&\*[Gt]
\&<key\&>remove-cmin-limit\&<\&/key\&> \&\*[Lt]key\&\*[Gt]remove-cmin-limit\&\*[Lt]\&/key\&\*[Gt]
\&<true\&/\&> \&\*[Lt]true\&/\&\*[Gt]
\&<\&/dict\&> \&\*[Lt]\&/dict\&\*[Gt]
.Ed .Ed
.Pp .Pp
A dictionary sent to the kernel with this A dictionary sent to the kernel with this
@ -252,7 +251,7 @@ and the
.Sy sensor .Sy sensor
that we want to set a property for. that we want to set a property for.
.Pp .Pp
.Em NOTE: .Em NOTE :
Only one of the following objects must be added into the dictionary Only one of the following objects must be added into the dictionary
at a time: at a time:
.Ar new-description , .Ar new-description ,
@ -294,7 +293,6 @@ rfact (voltage sensors) or critical/capacity limits,
.Er ENOTSUP .Er ENOTSUP
will be returned. will be returned.
.El .El
.Pp
.Sh NOTES .Sh NOTES
When setting a critical max or min limit with the When setting a critical max or min limit with the
.Em ENVSYS_SETDICTIONARY .Em ENVSYS_SETDICTIONARY
@ -312,7 +310,6 @@ proper value to
is the following: is the following:
.Em value = (value / 100) * max value . .Em value = (value / 100) * max value .
The max value is available in the sensor's dictionary. The max value is available in the sensor's dictionary.
.Pp
.Sh EXAMPLES .Sh EXAMPLES
The following example illustrates how to receive the dictionary The following example illustrates how to receive the dictionary
and to print it in raw XML/plist format: and to print it in raw XML/plist format:
@ -328,7 +325,7 @@ int main(void)
if ((fd = open(_DEV_SYSMON, O_RDONLY)) == -1) if ((fd = open(_DEV_SYSMON, O_RDONLY)) == -1)
err(EXIT_FAILURE, "open") err(EXIT_FAILURE, "open")
if (prop_dictionary_recv_ioctl(fd, ENVSYS_GETDICTIONARY, &dict)) { if (prop_dictionary_recv_ioctl(fd, ENVSYS_GETDICTIONARY, \*[Am]dict)) {
(void)close(fd); (void)close(fd);
err(EINVAL, "prop_dictionary_recv_ioctl"); err(EINVAL, "prop_dictionary_recv_ioctl");
} }
@ -391,6 +388,10 @@ main(void)
return error; return error;
} }
.Ed .Ed
.Sh SEE ALSO
.Xr envstat 8 ,
.Xr powerd 8 ,
.Xr sysmon_envsys 9
.Sh AUTHORS .Sh AUTHORS
The The
.Nm .Nm
@ -401,7 +402,3 @@ for
Many useful comments for this framework were from Many useful comments for this framework were from
Jason R. Thorpe, Tim Rightnour and Michael Lorenz. Previous Jason R. Thorpe, Tim Rightnour and Michael Lorenz. Previous
framework was implemented by Tim Rightnour and Bill Squier. framework was implemented by Tim Rightnour and Bill Squier.
.Sh SEE ALSO
.Xr envstat 8 ,
.Xr powerd 8 ,
.Xr sysmon_envsys 9