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
Differential Revision: https://reviews.freebsd.org/D45358

(cherry picked from commit 3753988c5d22393fbdefb6aa16b5a5a699d05642)

Details

Provenance
bzAuthored on Apr 6 2024, 9:15 PM
Differential Revision
D45358: LinuxKPI: pm: add SET_SYSTEM_SLEEP_PM_OPS() and device_can_wakeup()
Parents
rG323d4a20bd20: LinuxKPI: remove extern from function declarations
Branches
Unknown
Tags
Unknown