NetBSD/sys/dev/acpi
dyoung 36fffd8d02 In pmf(9), improve the implementation of device self-suspension
and make suspension by self, by drvctl(8), and by ACPI system sleep
play nice together.  Start solidifying some temporary API changes.

1. Extract a new header file, <sys/device_if.h>, from <sys/device.h> and
   #include it from <sys/pmf.h> instead of <sys/device.h> to break the
   circular dependency between <sys/device.h> and <sys/pmf.h>.

2. Introduce pmf_qual_t, an aggregate of qualifications on a PMF
   suspend/resume call.  Start to replace instances of PMF_FN_PROTO,
   PMF_FN_ARGS, et cetera, with a pmf_qual_t.

3. Introduce the notion of a "suspensor," an entity that holds a
   device in suspension.  More than one suspensor may hold a device
   at once.  A device stays suspended as long as at least one
   suspensor holds it.  A device resumes when the last suspensor
   releases it.

   Currently, the kernel defines three suspensors,

   3a the system-suspensor: for system suspension, initiated
      by 'sysctl -w machdep.sleep_state=3', by lid closure, by
      power-button press, et cetera,

   3b the drvctl-suspensor: for device suspension by /dev/drvctl
      ioctl, e.g., drvctl -S sip0.

   3c the system self-suspensor: for device drivers that suspend
      themselves and their children.  Several drivers for network
      interfaces put the network device to sleep while it is not
      administratively up, that is, after the kernel calls if_stop(,
      1).  The self-suspensor should not be used directly.  See
      the description of suspensor delegates, below.

   A suspensor can have one or more "delegates".  A suspensor can
   release devices that its delegates hold suspended.  Right now,
   only the system self-suspensor has delegates.  For each device
   that a self-suspending driver attaches, it creates the device's
   self-suspensor, a delegate of the system self-suspensor.

   Suspensors stop a system-wide suspend/resume cycle from waking
   devices that the operator put to sleep with drvctl before the cycle.
   They also help self-suspension to work more simply, safely, and in
   accord with expectations.

4. Add the notion of device activation level, devact_level_t,
   and a routine for checking the current activation level,
   device_activation().  Current activation levels are DEVACT_LEVEL_BUS,
   DEVACT_LEVEL_DRIVER, and DEVACT_LEVEL_CLASS, which respectively
   indicate that the device's bus is active, that the bus and device are
   active, and that the bus, device, and the functions of the device's
   class (network, audio) are active.

   Suspend/resume calls can be qualified with a devact_level_t.
   The power-management framework treats a devact_level_t that
   qualifies a device suspension as the device's current activation
   level; it only runs hooks to reduce the activation level from
   the presumed current level to the fully suspended state.  The
   framework treats a devact_level_t qualifying device resumption
   as the target activation level; it only runs hooks to raise the
   activation level to the target.

5. Use pmf_qual_t, devact_level_t, and self-suspensors in several
   drivers.

6. Temporarily add an unused power-management workqueue that I will
   remove or replace, soon.
2009-09-16 16:34:49 +00:00
..
acpica fix undefined return values of Read/WriteMemory, found by clang 2009-09-15 19:41:30 +00:00
acpi_acad.c PR# kern/41179: Incorrect return values from AcpiOsExecute() 2009-08-25 10:34:08 +00:00
acpi_apm.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
acpi_bat.c Allow for 'options ACPI_DEBUG' by providing module declarations 2009-09-16 10:47:54 +00:00
acpi_button.c PR# kern/41179: Incorrect return values from AcpiOsExecute() 2009-08-25 10:34:08 +00:00
acpi_ec.c Allow for 'options ACPI_DEBUG' by providing module declarations 2009-09-16 10:47:54 +00:00
acpi_ecvar.h Add acpiec_bus_{read,write} and acpiec_get_handle, for use in other 2007-12-21 21:22:54 +00:00
acpi_lid.c PR# kern/41179: Incorrect return values from AcpiOsExecute() 2009-08-25 10:34:08 +00:00
acpi_madt.c Make the ACPI_MADT_DEBUG code compile again. 2008-01-07 06:04:07 +00:00
acpi_madt.h Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
acpi_osd.h When ACPI is not present, free any resources used by the ACPICA. Also, 2009-08-23 15:16:16 +00:00
acpi_pci_link.c Allow for 'options ACPI_DEBUG' by providing module declarations 2009-09-16 10:47:54 +00:00
acpi_powerres.c Allow for 'options ACPI_DEBUG' by providing module declarations 2009-09-16 10:47:54 +00:00
acpi_quirks.c PR/40471: Pierre Pronchery: ASUS CUR-DLS board found on HP NetServer E800 box 2009-01-25 02:26:30 +00:00
acpi_resource.c Allow for 'options ACPI_DEBUG' by providing module declarations 2009-09-16 10:47:54 +00:00
acpi_timer.c Add acpitimer_detach() to eventually support acpi(4) detachment. 2009-04-08 00:15:45 +00:00
acpi_timer.h Add acpitimer_detach() to eventually support acpi(4) detachment. 2009-04-08 00:15:45 +00:00
acpi_tz.c Allow for 'options ACPI_DEBUG' by providing module declarations 2009-09-16 10:47:54 +00:00
acpi_wakedev.c remove extra semicolon, spotted by snj 2009-08-04 17:06:10 +00:00
acpi_wakedev.h add hw.wake.* sysctl subtree for toggling which devices are allowed to 2009-08-04 14:20:40 +00:00
acpi.c In pmf(9), improve the implementation of device self-suspension 2009-09-16 16:34:49 +00:00
acpica.h Switch to ACPICA 20090730, and update for API changes. 2009-08-18 16:41:02 +00:00
acpidevs add a comment explaining how to regenerate acpidevs_data.h 2009-01-21 14:15:43 +00:00
acpidevs_data.h
acpireg.h Allow for 'options ACPI_DEBUG' by providing module declarations 2009-09-16 10:47:54 +00:00
acpivar.h struct device * -> device_t, no functional changes intended. 2009-05-12 09:50:28 +00:00
aiboost.c Allow for 'options ACPI_DEBUG' by providing module declarations 2009-09-16 10:47:54 +00:00
asus_acpi.c Allow for 'options ACPI_DEBUG' by providing module declarations 2009-09-16 10:47:54 +00:00
atppc_acpi.c Cut the amount of spam from acpi devices in roughly half by printing 2009-02-17 12:46:01 +00:00
attimer_acpi.c During shutdown, detach attimer at acpi. 2009-04-07 17:59:18 +00:00
com_acpi.c com@acpi supports memory space. 2009-07-13 12:57:04 +00:00
dalb_acpi.c Allow for 'options ACPI_DEBUG' by providing module declarations 2009-09-16 10:47:54 +00:00
devlist2h.awk Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
fdc_acpi.c Allow for 'options ACPI_DEBUG' by providing module declarations 2009-09-16 10:47:54 +00:00
fdc_acpireg.h
files.acpi Don't reference files that don't exist, and cvs diff before commit. 2009-08-31 14:48:41 +00:00
hpet_acpi.c Cut the amount of spam from acpi devices in roughly half by printing 2009-02-17 12:46:01 +00:00
hpqlb_acpi.c Sprinkle a teeny bit of KNF goodness.. 2008-05-02 01:53:33 +00:00
joy_acpi.c Cut the amount of spam from acpi devices in roughly half by printing 2009-02-17 12:46:01 +00:00
lpt_acpi.c Cut the amount of spam from acpi devices in roughly half by printing 2009-02-17 12:46:01 +00:00
Makefile.acpidevs Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands. 2008-10-19 22:05:19 +00:00
mpu_acpi.c Cut the amount of spam from acpi devices in roughly half by printing 2009-02-17 12:46:01 +00:00
pckbc_acpi.c PR# port-i386/39671: panic while booting with an acpi kernel on a 790GX board 2009-08-29 19:17:44 +00:00
pcppi_acpi.c Cut the amount of spam from acpi devices in roughly half by printing 2009-02-17 12:46:01 +00:00
sony_acpi.c Allow for 'options ACPI_DEBUG' by providing module declarations 2009-09-16 10:47:54 +00:00
spic_acpi.c spic has moved. 2009-08-09 19:36:28 +00:00
thinkpad_acpi.c struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 09:29:46 +00:00
TODO
ug_acpi.c Cut the amount of spam from acpi devices in roughly half by printing 2009-02-17 12:46:01 +00:00
wss_acpi.c with new ACPICA, idstr may be NULL. 2009-08-18 21:33:29 +00:00
ym_acpi.c Adapt for ACPICA API changes. 2009-08-19 00:31:16 +00:00