Subject: Re: FYI: ENVSYS 2 ready
To: None <tech-kern@netbsd.org>
From: Juan RP <juan@xtrarom.org>
List: tech-kern
Date: 06/14/2007 17:16:42
On Thu, 14 Jun 2007 16:55:59 +0200
Juan RP <juan@xtrarom.org> wrote:

> Hi,
> 
> I want to inform you that my branch is 95% finished, so let's explain
> what does it provide:
> 
> - The code has been proplib(3)ified.
> - Detachable sensors now really work, when a device is unregistered
> with sysmon_envsys_unregister(), it's removed from the linked list
> and its dictionary is removed from the global dictionary.
> - Each device uses an array of dictionaries, one per sensor.
> - envstat(8) rewritten from scratch with support to specify your
>   critical limits, descriptions, rfact in /etc/envsys.conf.
> - /etc/rc.d/envsys. A script to start/stop monitoring functions and/or
>   changing other aspects of envstat(8) -m.
> - Support to set critical max/min/capacity limits on sensors, directly
>   using the new API features or via envstat(8).
> - Support to change sensor's description on the fly, via envstat.
> - Support to change rfact on the fly in voltage sensors (if enabled on
>   the driver).
> - sysmon_power/powerd(8) has been extended to support the new events
>   used by envsys2. The following scripts are available:
> 
> /etc/powerd/scripts/sensor_battery (for battery sensors)
> /etc/powerd/scripts/sensor_drive (for drive sensors, mfi(4))
> /etc/powerd/scripts/sensor_fan
> /etc/powerd/scripts/sensor_power (Watts/Ampere)
> /etc/powerd/scripts/sensor_resistency (Ohms)
> /etc/powerd/scripts/sensor_temperature
> /etc/powerd/scripts/sensor_voltage
> 
> - There's a linked list for the sysmon envsys events, when the first
>   one is added, a workqueue(9) is created and a callout(9) runs every
>   10 seconds looking if the condition is triggered and sends a
>   critical/warning event. If the state after coming from
>   critical/warning is normal, a "normal" event is sent to userland to
>   notify powerd(8) that all it's ok again.
> - acpibat(4) has been adapted to send critical/critunder and warnunder
>   events when battery capacity is critical, warncap or lowcap
>   respectively.
> - acpitz(4) has been modified to send critical/critover events, when
>   the thermal zone is critical or hot.
> 
> All drivers were adapted to the new branch, and 60% of them
> were tested by some developers/users (Manuel Bouyer, Nicolas Joly,
> Brett Lymn, Mihai Chelaru, Joerg Sonnenberger, etc).
> 
> Also I fixed the n^2 gtredata bug on many drivers, all this stuff is
> explained in the README file. I'm only missing to write the
> documentation (sysmon_envsys(9) and sysmon_power(9)).
> 
> You can see all the code here: http://www.xtrarom.org/repos/

More things I wanted to say:

- Support for the old ENVSYS_GTREDATA and ENVSYS_GTREINFO ioctls
  is implemented, so old envstat(8) and other apps using the old
  framework work perfectly.
- If there are no items on the sysmon envsys events linked list, the
  workqueue(9) is destroyed and the callout(9) stopped.
- Old powerd(8) won't work anymore because POWER_EVENT_MSG_SIZE
  is now 128 bytes, where previously it used 32 bytes. There's no easy
  way to support the old powerd.

-- 
Juan Romero Pardines	- The NetBSD Project
http://plog.xtrarom.org/	- NetBSD/pkgsrc news in Spanish