diff mbox series

[BlueZ,v1] input/device: Fix not sending virtual cable unplug

Message ID 20250502165821.2753353-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v1] input/device: Fix not sending virtual cable unplug | expand

Commit Message

Luiz Augusto von Dentz May 2, 2025, 4:58 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

When using udev HIDP_CTRL_VIRTUAL_CABLE_UNPLUG must be sent directly
since it is not handled internally like when utilizing kernel hidp
module.

Fixes: https://github.com/bluez/bluez/issues/1173
---
 profiles/input/device.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

patchwork-bot+bluetooth@kernel.org May 9, 2025, 2 p.m. UTC | #1
Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri,  2 May 2025 12:58:21 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> When using udev HIDP_CTRL_VIRTUAL_CABLE_UNPLUG must be sent directly
> since it is not handled internally like when utilizing kernel hidp
> module.
> 
> Fixes: https://github.com/bluez/bluez/issues/1173
> 
> [...]

Here is the summary with links:
  - [BlueZ,v1] input/device: Fix not sending virtual cable unplug
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ab6ce0c8f3e0

You are awesome, thank you!
diff mbox series

Patch

diff --git a/profiles/input/device.c b/profiles/input/device.c
index 3642cc3267be..f21a69f57529 100644
--- a/profiles/input/device.c
+++ b/profiles/input/device.c
@@ -1154,8 +1154,13 @@  static int connection_disconnect(struct input_device *idev, uint32_t flags)
 		shutdown(sock, SHUT_WR);
 	}
 
-	if (flags & (1 << HIDP_VIRTUAL_CABLE_UNPLUG))
+	if (flags & (1 << HIDP_VIRTUAL_CABLE_UNPLUG)) {
 		idev->virtual_cable_unplug = true;
+		if (idev->uhid)
+			hidp_send_ctrl_message(idev, HIDP_TRANS_HID_CONTROL |
+						HIDP_CTRL_VIRTUAL_CABLE_UNPLUG,
+						NULL, 0);
+	}
 
 	if (idev->uhid)
 		return uhid_disconnect(idev, false);