NetBSD/sys/dev/cardbus
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
..
adv_cardbus.c struct device * -> device_t, no functional changes intended. 2009-05-12 14:16:35 +00:00
ahc_cardbus.c Make ahc_detach() take struct ahc_softc * as well as ahc_attach() 2009-05-16 06:44:05 +00:00
cardbus_exrom.c Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
cardbus_exrom.h Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
cardbus_map.c ansify function definitions 2009-03-15 15:40:33 +00:00
cardbus.c struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 12:10:29 +00:00
cardbusreg.h Cosmetic: use a name instead of a number for BAR0. 2007-08-30 02:39:11 +00:00
cardbusvar.h constify the pcmcia/cardbus method tables 2008-06-26 12:33:17 +00:00
cardslot.c Let us detach pcmcia0 and cardbus0 at cardslot0, and cardslot0 at 2009-05-21 17:32:32 +00:00
cardslotvar.h minor cleanup so that it can cope with a futute split pcmcia device/softc 2008-07-03 18:57:52 +00:00
com_cardbus.c clean up the cardbus interrupt stuff: 2008-06-24 19:44:51 +00:00
ehci_cardbus.c struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 12:10:29 +00:00
files.cardbus Support siisata@cardbus. 2009-07-19 06:28:08 +00:00
fwohci_cardbus.c struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 12:10:29 +00:00
if_ath_cardbus.c In pmf(9), improve the implementation of device self-suspension 2009-09-16 16:34:49 +00:00
if_atw_cardbus.c In pmf(9), improve the implementation of device self-suspension 2009-09-16 16:34:49 +00:00
if_ex_cardbus.c clean up the cardbus interrupt stuff: 2008-06-24 19:44:51 +00:00
if_fxp_cardbus.c Invert logic around nested pmf(9) registrations for readability. 2009-09-05 14:44:59 +00:00
if_ral_cardbus.c struct device * -> device_t, no functional changes intended. 2009-05-12 14:16:35 +00:00
if_re_cardbus.c Move pmf(9) calls to MI re_attach() and re_detach() from each backend. 2009-09-02 15:11:13 +00:00
if_rtk_cardbus.c Invert logic around nested pmf(9) registrations for readability. 2009-09-05 14:44:59 +00:00
if_rtw_cardbus.c In pmf(9), improve the implementation of device self-suspension 2009-09-16 16:34:49 +00:00
if_tlp_cardbus.c device_t/softc split. Tested with tlp at pci 2009-04-17 10:20:32 +00:00
njata_cardbus.c struct device * -> device_t, no functional changes intended. 2009-05-12 14:16:35 +00:00
njs_cardbus.c struct device * -> device_t, no functional changes intended. 2009-05-12 14:16:35 +00:00
ohci_cardbus.c struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 12:10:29 +00:00
rbus_ppb.c struct device * -> device_t, no functional changes intended. 2009-05-12 14:16:35 +00:00
rbus.c ANSIfy another 1261 function definitions. 2009-03-14 21:04:01 +00:00
rbus.h machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
siisata_cardbus.c Support siisata@cardbus. 2009-07-19 06:28:08 +00:00
uhci_cardbus.c struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 12:10:29 +00:00
usb_cardbus.h Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00