Commit Graph

76 Commits

Author SHA1 Message Date
jruoho
8eae6f006a Bump WARNS to 4. 2010-10-26 04:37:33 +00:00
jruoho
9fad28a567 Add support for module(9). 2010-10-25 17:06:58 +00:00
jruoho
2052593844 Now that we have 1:1 mapping between handles and nodes, use the former for
all power resource operations. Eliminates the wrapper functions.
2010-06-07 17:28:17 +00:00
plunky
6d4cc93fdf adjust autoconfig output: this item is part of a verbose line 2010-06-01 19:20:43 +00:00
plunky
31555cd112 fix up autoconfig output 2010-05-31 17:41:24 +00:00
jruoho
f04ee53053 Use ACPICA's standard notify values from <actypes.h> and move the
device-specific notify constants to the device-specific files.
2010-04-27 05:57:43 +00:00
jruoho
80e5813055 Remove retrieving the zone name via something called "REGN".
We really should not add code that aims to satisfy some oddball firmware,
not in the generic drivers that aim to comply with the specifications.
In the long-term this is even worse than quirk tables.
2010-04-24 19:16:10 +00:00
jruoho
ac93d6907f Some purely cosmetic editing in the name of readability: clean up the softc
and remove unused variables therein, remove unused constants, use
ACPI_DEBUG_PRINT, add more detailed comments, et cetera.
2010-04-24 19:11:48 +00:00
jruoho
1b81a62b62 Now that we are able to remove references to power resources, provide a
detachment routine for acpitz(4). Add comments explaining the relationship
between power resources and active cooling. Also some improvements to code
readability.
2010-04-24 06:31:44 +00:00
jruoho
9ddf2c5165 Merge new code for ACPI power resources.
The old code served us well, but a major overhaul would have been needed for
it to cope with the increased demands of the code -- and the specifications.

ok jmcneill@, pgoyette@
2010-04-22 18:40:09 +00:00
christos
b62024a026 fix dmesg printing. 2010-04-16 01:52:54 +00:00
jruoho
55052eca77 As discussed with jmcneill@, install a global "bus notification handler"
that receives all notifications and deliver notifications to drivers via it.
2010-04-15 07:02:24 +00:00
jruoho
fb53d8ceed No need to spread the ACPICA type system any more than is necessary:
UINT8 -> uint8_t and UINT32 -> uint32_t.
2010-04-14 19:27:28 +00:00
jruoho
2786f7261b Silence errors from the integer evaluations in case the objects are not found.
(This was too verbose even for ACPI_DEBUG.) Also fit the status messages to
one line during boot by using aprint_verbose() for extra information.
2010-03-17 20:29:32 +00:00
pgoyette
89bf6ebb9f Remove setting of edata->monitor since that member no longer exists. 2010-03-14 18:05:07 +00:00
jruoho
5a425210a3 Remove <dev/acpi/acpica.h> from all files. It is included from
<dev/acpi/acpivar.h>. Ditto for <dev/sysmon/sysmonvar.h>, <sys/bus.h>,
<dev/pci/pcivar.h>, and <dev/isa/isavar.h>.

Also nuke a lot of unused and invalid headers. Some of these are audibly
provided by standard headers (namely <sys/param.h> and <sys/device.h>), some
have nothing to do with ACPI devices (e.g. <sys/syslog.h>), and some are
nonexistent local includes (e.g. "mpu_ym.h"). Moreoever, try to group the
includes into their respective blocks.

Tested with GENERIC and ALL (i386). No functional change.
2010-03-05 14:00:16 +00:00
pgoyette
e1fc7f5215 As pointed out by Rhialto, "degrees Kelvin" is redundant. So fix a
couple of comments related to converstion between Kelvin and degC.
2010-03-05 12:44:16 +00:00
pgoyette
fe9cd1c415 Print correct temperature value, and properly display negative temperatures.
Resolves PR kern/36615
2010-02-18 14:10:15 +00:00
pgoyette
52af77f5e8 Adapt to changes in sysmon's limit structure. 2010-02-14 23:06:58 +00:00
jruoho
4d0db25236 Fix incorrect notify handler type (ACPI_SYSTEM_NOTIFY -> ACPI_DEVICE_NOTIFY). 2010-02-01 09:45:04 +00:00
jruoho
e5a9d901c0 Use acpi_eval_reference_handle() to simplify code. No functional change.
ok jmcneill@, pgoyette@
2010-01-18 18:36:49 +00:00
jruoho
517e16fb9b Fix a minor bug where a reference handle is used for error reporting even
though it may not be present. While here, convert few lines to aprint_*().

ok pgoyette@
2010-01-18 17:09:17 +00:00
jruoho
57bb616085 Fix a memory leak/corruption by commenting out the evaluation of the _PSL
control method. If it is needed in the future, the output buffer must be
freed after use.

ok pgoyette@, jmcneill@
2010-01-05 13:47:52 +00:00
pgoyette
390d022573 Don't set sensor state to SWARNOVER here. Doing so based only on the
device's active cooling levels prevents the user from overriding these
limits with his own values.

XXX We should probably also change setting SCRITOVER state to SCRITICAL,
XXX but right now that just confuses things.  We currently don't have a
XXX way for a sensor to be both SCRITICAL and SCRITOVER.
2010-01-01 15:55:30 +00:00
pgoyette
5c06b9862c In ATZ_F_VERBOSE mode, log a message whenever the active cooling level
changes, even when the new level is ATZ_ACTIVE_NONE
2009-12-24 00:26:28 +00:00
pgoyette
07dad0134f Since we're using the active cooling levels as warning threshold, we
should store the value in the correct location.  We're already setting
the correct flag bit.

Should resolve problem reported by Frank Wille on current-users...
2009-12-23 02:29:46 +00:00
uebayasi
c197134fb4 Remove a debug printf(). 2009-11-29 18:08:22 +00:00
cegger
6f85be6a06 By reading the ACPI dump I figured out that my
HP Pavillion dv9700 laptop features a fan sensor
in the ACPI Thermal Zone which is beyond of the ACPI
Spec.

envstat shows
[acpitz0]
  Processor Thermal Zone:     56.000   95.000                       degC
                     FAN:       2840                                 RPM

envstat -W shows the limits
[acpitz0]
  Processor Thermal Zone:     55.000                                degC
                     FAN:       2570     4500     2000               RPM

Patch presented on tech-kern@.

No comments.
2009-11-25 13:54:23 +00:00
cegger
29e2a7eb92 evaluate _RTV as preparation for passive cooling. 2009-11-23 14:42:39 +00:00
mlelstv
23ab96a36b Allow for 'options ACPI_DEBUG' by providing module declarations
and using memory allocation macros instead of calling AcpiOs* stubs
directly.
2009-09-16 10:47:54 +00:00
jmcneill
80adfeb08d PR# kern/41179: Incorrect return values from AcpiOsExecute()
ACPICA functions return ACPI_STATUS instead of int, so use it for
consistency.
2009-08-25 10:34:08 +00:00
pgoyette
de4ed96bf9 Use a macro to define the conversion between ACPI temperatures and those
used by sysmon_envsys(4).

No functional change.
2009-07-04 13:36:49 +00:00
pgoyette
caff4fea85 Remove an unused mutex. This was left-over from two years ago when
driver was updated to sysmon_envsys V2;  a simple_lock was turned into
a mutex.  But the only code that ever used the simple_lock was removed
so the mutex can also be removed.

Noticed by njoly@
2009-07-03 21:18:40 +00:00
pgoyette
2d29649a47 Properly convert ACPI zone values to uKelvins.
Patch from njoly@
2009-07-03 15:34:10 +00:00
pgoyette
5de2729099 Change acpi_tz sensor behavior as follows:
1. ENVSYS_WARNOVER event is generated whenever any active cooling level
   is exceeded.

2. ENVSYS_CRITOVER event is generated whenever _HOT limit is exceeded;
   if the _HOT limit is not defined, then ENVSYS_CRITOVER will be
   generated when the _CRT limit is exceeded.

3. For Passive Cooling Only mode, there will be no change in behavior.

Additionally, since there are specific actions taken at each of the Active
Cooling Levels (powering parts of a zone on or off), and the limits are not
user-programmable,

4. The {warn,crit}{min,max} threshold levels will be specified only
   by the device itself;  event reporting thresholds may not be set
   from userland.

No comments received for two weeks after proposing these changes on both
current-users@ and tech-kern@
2009-06-30 16:14:49 +00:00
pgoyette
7c25ce0d52 Explicitly set sensor's units to ENVSYS_STEMP rather than having
it work only because ENVSYS_STEMP is #defined to 0
2009-06-03 22:34:18 +00:00
pgoyette
5a84f3060e Since we no longer have individual events for each sensor value limit,
we don't need individual flag bits.  Clean up extra bit definitions.
Bump kernel version - welcome to 5.99.13
2009-06-01 20:08:44 +00:00
pgoyette
7355d18b97 Leave the task of displaying sensor states to envsys_sysmon() unless we
are in debug mode.
2008-11-09 13:54:06 +00:00
pgoyette
18913ef363 Temp sensor should report a critical-overtemp condition (ENVSYS_SCRITOVER)
not a simple critical (ENVSYS_SCRITICAL) condition.
2008-11-09 03:36:04 +00:00
jmcneill
25b0c73dd3 Clarify some printfs in error cases so we at least know what subsystem
reported them.
2008-07-28 12:20:35 +00:00
jmcneill
76fcb78d00 Compatibility with ACPICA 20080321; from the release notes:
All Reference Objects returned via the AcpiEvaluateObject interface are now
marked as type "REFERENCE" instead of "ANY". The type ANY is now reserved for
NULL objects - either NULL package elements or unresolved named references.
2008-04-14 00:30:30 +00:00
jmcneill
2529ffb3cf Fix printf in ACPI_DEBUG case, pointed out by mlelstv@ 2008-03-29 13:33:12 +00:00
xtraeme
678337ef71 acpitz_get_zone expects now a device_t not a softc. 2008-03-26 16:48:53 +00:00
xtraeme
2be2546b16 Split device_t/softc and related cosmetic changes. 2008-03-26 15:31:59 +00:00
jmcneill
4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
jmcneill
0273402379 kern/37501: cosmetic error in acpi_tz probe messages 2007-12-08 23:01:30 +00:00
ad
598ab03ad0 Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
2007-12-05 07:06:50 +00:00
jmcneill
61d5fb95a4 No need to waste more than one line of output at attach time. 2007-12-02 06:26:40 +00:00
jmcneill
4fbe23fdd0 aprintify 2007-12-01 04:50:50 +00:00
xtraeme
31962fc6e5 Extend the envsys2 API (one more time, sorry) as defined in:
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.
2007-11-16 08:00:11 +00:00