| PMF(9) | Kernel Developer's Manual | PMF(9) | 
PMF, pmf_device_register,
  pmf_device_register1,
  pmf_device_deregister,
  pmf_device_suspend,
  pmf_device_resume,
  pmf_device_recursive_suspend,
  pmf_device_recursive_resume,
  pmf_device_resume_subtree,
  pmf_class_network_register,
  pmf_class_input_register,
  pmf_class_display_register,
  pmf_system_suspend,
  pmf_system_resume,
  pmf_system_shutdown,
  pmf_event_register,
  pmf_event_deregister,
  pmf_event_inject,
  pmf_set_platform,
  pmf_get_platform —
#include <sys/device.h>
bool
  
  pmf_device_register(device_t
    dev, bool
    (*suspend)(device_t dev, const pmf_qual_t *qual),
    bool (*resume)(device_t dev,
    const pmf_qual_t *qual));
bool
  
  pmf_device_register1(device_t
    dev, bool
    (*suspend)(device_t dev, const pmf_qual_t *qual),
    bool (*resume)(device_t dev,
    const pmf_qual_t *qual),
    bool (*shutdown)(device_t dev,
    int how));
void
  
  pmf_device_deregister(device_t
    dev);
bool
  
  pmf_device_suspend(device_t
    dev, const pmf_qual_t
    *qual);
bool
  
  pmf_device_resume(device_t
    dev, const pmf_qual_t
    *qual);
bool
  
  pmf_device_recursive_suspend(device_t
    dev, const pmf_qual_t
    *qual);
bool
  
  pmf_device_recursive_resume(device_t
    dev, const pmf_qual_t
    *qual);
bool
  
  pmf_device_subtree_resume(device_t
    dev, const pmf_qual_t
    *qual);
void
  
  pmf_class_network_register(device_t
    dev, struct ifnet
    *ifp);
bool
  
  pmf_class_input_register(device_t
    dev);
bool
  
  pmf_class_display_register(device_t
    dev);
bool
  
  pmf_system_suspend(const
    pmf_qual_t *qual);
bool
  
  pmf_system_resume(const
    pmf_qual_t *qual);
void
  
  pmf_system_shutdown(int);
bool
  
  pmf_event_register(device_t
    dev, pmf_generic_event_t
    ev, void
    (*handler)(device_t dev),
    bool global);
void
  
  pmf_event_deregister(device_t
    dev, pmf_generic_event_t
    ev, void
    (*handler)(device_t dev),
    bool global);
bool
  
  pmf_event_inject(device_t
    dev, pmf_generic_event_t
    ev);
bool
  
  pmf_set_platform(const
    char *key, const char
    *value);
const char *
  
  pmf_get_platform(const
    char *key);
PMF framework provides power
  management and inter-driver messaging support for device drivers.
PMF may make use of the
  following data type:
PMF
      suspend or resume call.pmf_device_register(dev,
    suspend, resume)true on success and
      false on failure. If either
      suspend or resume is
      NULL then it is assumed that device state does not
      need to be captured and resumed on a power transition. Bus and class-level
      power management will still be performed. Returns
      false if there was an error.pmf_device_register1(dev,
    suspend, resume,
    shutdown)pmf_device_register(), but additionally
      registers a shutdown handler. During system shutdown,
      pmf_system_shutdown() calls
      shutdown on dev with the
      reboot(2)
      “howto” in the second argument.
      shutdown should return true
      on success and false on failure.pmf_device_deregister(dev)pmf_device_suspend(dev,
    qual)pmf_device_resume(dev,
    qual)pmf_device_recursive_suspend(dev,
    qual)pmf_device_suspend(), but ensures that all
      child devices of dev are suspended.pmf_device_recursive_resume(dev,
    qual)pmf_device_resume(), but ensures that all
      parent devices of dev are resumed.pmf_device_subtree_resume(dev,
    qual)pmf_device_resume(), but ensures that all child
      devices of dev are resumed.pmf_class_network_register(dev,
    ifp)pmf_class_input_register(dev)pmf_class_display_register(dev)pmf_system_suspend(qual)pmf_system_resume(qual)pmf_system_shutdown(int)pmf_event_register(dev,
    ev, handler,
    global)true,
      handler accepts anonymous events from
      pmf_event_inject().pmf_event_deregister(dev,
    ev, handler,
    global)pmf_event_register().pmf_event_inject(dev,
    ev)NULL, the event is
      considered to be anonymous and one or more drivers may handle this event,
      otherwise the event is delivered directly to the callback registered by
      dev.pmf_set_platform(key,
    value)pmf_get_platform(key)NULL if the key is
      not present.PMF framework appeared in NetBSD
  5.0.
| April 2, 2012 | NetBSD 9.4 |