The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a424fb3519ebf8fb972e7ba45ba19df322992b00
commit a424fb3519ebf8fb972e7ba45ba19df322992b00 Author: Bjoern A. Zeeb <[email protected]> AuthorDate: 2026-08-16 22:05:42 +0000 Commit: Bjoern A. Zeeb <[email protected]> CommitDate: 2026-09-14 19:06:01 +0000 LinuxKPI: add can_wakeup option and accessor functions We can implement device_set_wakeup_capable() in the !CONFIG_PM_SLEEP case; we do not have the infrastructure in place for the CONFIG_PM_SLEEP case so leave a pr_debug TODO. Needed by an upcoming wireless driver. MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D58883 --- sys/compat/linuxkpi/common/include/linux/pm.h | 17 +++++++++++++++++ sys/compat/linuxkpi/common/src/linux_compat.c | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pm.h b/sys/compat/linuxkpi/common/include/linux/pm.h index 932697e0eda8..baf1c152a310 100644 --- a/sys/compat/linuxkpi/common/include/linux/pm.h +++ b/sys/compat/linuxkpi/common/include/linux/pm.h @@ -49,6 +49,7 @@ struct dev_pm_domain { struct dev_pm_info { atomic_t usage_count; + bool can_wakeup; }; #define PM_EVENT_FREEZE 0x0001 @@ -111,4 +112,20 @@ pm_vt_switch_unregister(struct device *dev __unused) { } +#ifdef CONFIG_PM_SLEEP +static inline void +device_set_wakeup_capable(struct device *dev __unused, bool capable __unused) +{ + pr_debug("%s: TODO\n", __func__); +} +#else +void linuxkpi_device_set_wakeup_capable(struct device *, bool); + +static inline void +device_set_wakeup_capable(struct device *dev, bool capable) +{ + linuxkpi_device_set_wakeup_capable(dev, capable); +} +#endif + #endif /* _LINUXKPI_LINUX_PM_H */ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 12e5852c8dc9..8fb09d5914fb 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -2833,6 +2833,12 @@ device_can_wakeup(struct device *dev) return (false); } +void +linuxkpi_device_set_wakeup_capable(struct device *dev, bool capable) +{ + dev->power.can_wakeup = capable; +} + static void devm_device_group_remove(struct device *dev, void *p) {
