Skip to content

Hide WakeAllowed when the adapter cannot wake the host

Matthew Schwartz linux-bluetooth 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3adapter: Add btd_adapter_may_wake()src/adapter.c src/adapter.h+71 -02 replies
2/3device: Hide WakeAllowed when adapter cannot wakesrc/device.c+4 -10 replies
3/3doc: Mark WakeAllowed as optionaldoc/org.bluez.Device.rst+5 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH BlueZ 0/3] Hide WakeAllowed when the adapter cannot wake the host

The WakeAllowed property is currently exposed on any device whose profile supports wake configuration (HID/HoG), regardless of whether the host controller is configured to wake the system. Clients may decide whether to offer a "wake the system by this device" toggle based on the presence of this property, and end up offering it on hardware where it won't work.

This series gates the property's existence on the adapter's current wakeup configuration, read from the power/wakeup attribute of the closest USB ancestor in sysfs. That is the same attribute btusb consults through device_may_wakeup() on the underlying USB device, and hci_suspend_sync() skips wakeup configuration entirely when that callback returns false. Only the USB case is handled, so controllers on other buses keep the current behavior.

Matthew Schwartz (3):
adapter: Add btd_adapter_may_wake()
device: Hide WakeAllowed when adapter cannot wake
doc: Mark WakeAllowed as optional

 doc/org.bluez.Device.rst |  7 ++--
 src/adapter.c            | 70 ++++++++++++++++++++++++++++++++++++++++
 src/adapter.h            |  1 +
 src/device.c             |  5 ++-
 4 files changed, 80 insertions(+), 3 deletions(-)
Signature · 1 line
2.55.0