Subject: Re: envsys version 2 API
To: Juan RP <juan@xtrarom.org>
From: Nicolas Joly <njoly@pasteur.fr>
List: tech-kern
Date: 04/20/2007 19:37:43
On Fri, Apr 20, 2007 at 06:26:23PM +0200, Juan RP wrote:
> 
> Hi, I want to implement envsys version 2 and I need to make the API
> before starting to modify the existing code.
> 
> My current idea is to remove envsys_basic_info_t and just use
> a single struct to set/get values for a specific device sensor:
[...]
> IMHO we need only two ioctls ENVSYS_GRANGE and ENVSYS_GETDATA (which uses
> a struct plistref), the code will be simplified a lot.

ENVSYS_GRANGE must be changed too ... It's currently useless when
sensors of one type are ditributed across multiple devices, by example
on my Tyan s2885 amd64 workstation.

amdpm0 at pci0 dev 7 function 3: Advanced Micro Devices AMD8111 ACPI Controller (rev. 0x05)
iic0 at amdpm0: I2C bus
adt7463c0 at iic0 addr 0x2e
[...]
lm0 at isa0 port 0x290-0x297: Winbond W83627HF Hardware monitor

For now, ENVSYS_GRANGE return ranges for the 1st registered device.

njoly@lanfeust [tmp/sysmon]> ./sysmon
27 sensors
5-7 -> 0 (degC)
8-11 -> 1 (RPM)
1-0 -> 2 (VAC)
0-4 -> 3 (V)
1-0 -> 4 (Ohms)
1-0 -> 5 (W)
1-0 -> 6 (A)
1-0 -> 7 (Wh)
1-0 -> 8 (Ah)
1-0 -> 9 (bool)
1-0 -> 10 (integer)


ADT7463:
   2.5V:      2.600 V
   VCCP:      1.299 V
    VCC:      3.300 V
     5V:      5.018 V
    12V:     11.938 V
 Temp-1:     48.000 degC
 Temp-2:     46.000 degC
 Temp-3:     50.000 degC
  Fan-1:         82 RPM
  Fan-2:         82 RPM
  Fan-3:       2612 RPM
  Fan-4:       2512 RPM

W83627HF:
VCore A:      1.552 V
VCore B:      1.568 V
  +3.3V:      3.328 V
    +5V:      5.080 V
   +12V:      5.046 V
   -12V:     -1.337 V
    -5V:     -3.540 V
   5VSB:      5.066 V
   VBAT:      0.000 V
  Temp0:     44.000 degC
  Temp1:     37.500 degC

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.