HomeFreeBSD

LinuxKPI: pm: add SET_SYSTEM_SLEEP_PM_OPS() and device_can_wakeup()

Description

LinuxKPI: pm: add SET_SYSTEM_SLEEP_PM_OPS() and device_can_wakeup()

Add the SET_SYSTEM_SLEEP_PM_OPS() by factoring some other macro code
out in order to set the suspend/resume functions when the struct is
already given. Such is the case in iwlwifi d3.

Also add an initial implementation of device_can_wakeup(). Though
this is likely all we need we have no way of setting the flag for it
yet so leave a pr_debug() and a comment there as well. Until we want
to support WoWLAN this is likely not needed for wireless.
Doing it the proper way checking a bool in 'struct dev_pm_info' would
change 'struct device' and with that 'struct pci_dev' and break the
KBI. In favour of mergeability this version does not implement the
full functionality yet.

Both help to make an updated iwlwifi d3 compile.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D45358

Details