http://mail-index.netbsd.org/tech-kern/2007/11/09/0001.html
sysmon_envsys_create() and sysmon_envsys_destroy() were added to
create/destroy sysmon_envsys objects (and its TAILQ/LIST for sensors/events).
sysmon_envsys_sensor_attach() and sysmon_envsys_sensor_detach() were
added to attach/detach sensors to a specified sysmon_envsys device.
The events framework is now per device and configurable via the
ENVSYS_SETDICTIONARY ioctl or /etc/envsys.conf and envstat(8).
Update all users and documentation to reflect these changes.
the limit in some LM chips.
- Add the lm_detach() function that stops/destroys the callout and
unregisters the driver from the sysmon_envsys(9) framework.
(Part 2: drivers)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
* For each supported chip, there's a struct lm_sensor array
that specifies the sensor data, like reg, bank, descr, rfact.
* Rather than having 3 functions to setup the voltage, temp and fan
sensors, just have one that will do all the three steps looking at
its struct lm_sensor members, simplifying a lot the code.
and more things that I can remember, our code now is synced with
OpenBSD, IMHO much better to understand and maintain in the future.
Supported chips added with the new code include:
* Winbond: W83627EHF, W83627DHG, W83637HF, W83783S, W83791D, W83791SD,
W83792D.
* Asus AS9912F.
My new mobo with the Winbond W83627DHG chip correctly reports
the values now:
lm0 at isa0 port 0x290-0x297: Winbond W83627DHG Hardware monitor
[juan@nocturno][~]> envstat -r
VCore: 1.232 V
+12V: 12.091 V
+3.3V: 3.264 V
+5V: 4.945 V
VBAT: 3.728 V
System Temp: 36.000 degC
CPU Temp: 29.500 degC
Aux Temp: 22.000 degC
CPU Fan: 1591 RPM
[juan@nocturno][~]>
Patch by Slava Semushin <slava.semushin@gmail.com>
Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
- Move lm_readreg/lm_writereg into the front-ends. Add/use function pointers
in the softc.
- Add a bank select function pointer to the softc and provide a generic
version. WinBond chips accessed over serial bus present three addresses,
two of which are used to access bank 1/2 registers.
- Mark TSENS2/3 sensor data as invalid if the the corresponding bank select
fails.
1. Fix setting of nominal fan speeds with ENVSYS_STREINFO.
2. Treat Winbond 83781D specially because it has a programmable divisor for
FAN3 unlike generic devices.
3. Set nominal RPMs.
4. Fix a typo in the code for setting FAN3's divisor for W83782 type
hardware monitors.