Page MenuHomeFreeBSD

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

Authored by bz on Sat, May 25, 12:07 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 7, 11:49 PM
Unknown Object (File)
Mon, Jun 3, 12:49 PM
Unknown Object (File)
Thu, May 30, 2:24 AM
Unknown Object (File)
Mon, May 27, 5:59 PM

Details

Summary

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 thi is likely not needed for wireless.

Both help to make an updated iwlwifi d3 compile.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Sat, May 25, 12:08 AM
sys/compat/linuxkpi/common/include/linux/pm.h
61

This looks odd here but :set list in vi shows tabs.

I was about to commit that but then realized I probably cannot? This is needed. I need to bump priority here.
Otherwise I'll change the return into a false, leave the pr_debug() message (adding the review) and remove the struct field for now?

sys/compat/linuxkpi/common/include/linux/pm.h
52

@imp @manu @wulf ; I know Warner has fixed allocations of these changes in the past to get KBI for older versions back.

Here's the problem: struct dev_pm_info is embedded at the end of struct device so this would only "append at the end". Fine.
BUT struct pci_dev has struct device embedded right at the top so all of struct pci_dev is changed.

HOW do we deal with this? How are we ever supposed to change the size of the structs without breaking (external) kmods?

This revision was not accepted when it landed; it landed in state Needs Review.Fri, Jun 7, 11:49 PM
This revision was automatically updated to reflect the committed changes.