Commit Graph

20 Commits

Author SHA1 Message Date
xtraeme 68bb919d1f Fix the old ENVSYS_GTREDATA ioctl if there are sensors with invalid
state. Enable all sensors by default as valid and current valid data and
if there is one that is in invalid state, mark current data as not valid.

This matches the behaviour with the old API. Also, this fixes the problem
with ipmi(4) reporting bogus values with sensors in invalid state using
the old envstat(8).

Note that this only happened when using the old envstat(8).
2007-07-04 16:30:18 +00:00
xtraeme 6a9b572563 Add PENVSYS_TYPE_INDICATOR to handle events on Indicator sensors.
ipmi(4) uses this for the Intrussion and Power Supply sensors.
2007-07-02 15:18:30 +00:00
xtraeme bf4558f8cf Imported envsys 2, a brief description of the new features:
(Part 1: API)

* 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).
2007-07-01 07:36:39 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
ad 3a91cc8a3b Back out previous for now. There isn't currently an easy way to set up
shared state before these get attached or used.

From xtraeme@.
2007-02-19 06:08:37 +00:00
xtraeme 0bb6833f55 Replace SYSMON_ENVSYS_{LOCK,UNLOCK} with mutex_{enter,exit}. 2007-02-19 00:36:12 +00:00
xtraeme 406b5ff314 * Replace simple_locks and exclusive locks with adaptive mutexes.
* Replace ltsleep/wakeup pairs with condition variables
  (cv_init/cv_wait/cv_broadcast).

Reviewed by ad@.
2007-02-18 23:38:11 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
christos 3c00d4c7e1 expose the ioctl internal function now used by the acpi_apm code. 2006-07-08 20:26:06 +00:00
lukem 35f57c3fc9 Don't attempt to call (*sme->sme_gtredata)() or (*sme->sme_streinfo)()
if those members are NULL.
As discussed on tech-kern in October/November 2005.
2006-03-20 03:23:35 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt 44d0d57217 do wakeup() only when someone is waiting for us. 2003-08-11 15:07:14 +00:00
yamt 104f2a80df introduce SME_FLAG_BUSY and set it during operations
instead of keeping sysmon_envsys_list_slock spinlock held
because some drivers might sleep in sysmon_envsys ops,

XXX sysmon_envsys_lock is now redundant
2003-08-11 14:24:41 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
explorer 59e0238f99 add envsys support to acpi A/C adapter and batteries. This is still a work
in progress, much like the rest of ACPI.
2002-12-31 05:26:56 +00:00
jdolecek 57b53bc9a8 The device close routine is called when _last_ descriptor to the
device file is closed, rather on every descriptor close. Instead of
getting the exclusive lock on open and releasing on close, get
the lock only when needed in sysmonioctl_envsys().
Fixes kern/14368 by Anthony Mallet. Okayed by Jason Thorpe.

While here, also inline sysmon_envsys_init() to sysmonopen_envsys(),
and g/c sysmonioctl_wdog() prototype.
2002-01-03 22:35:53 +00:00
lukem 640249d1e9 add RCSIDs 2001-11-13 06:28:55 +00:00
thorpej e67f5e66bc Split the envsys and watchdog parts of sysmon into their own
files.
2000-11-05 04:06:13 +00:00