From 61745d2bb8b5f534278db49faf8e2cdb7e894529 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Thu, 11 Feb 2021 16:39:13 +0100 Subject: sixaxis: Fix Bluetooth PS3 clone joypad being named like the original When cable pairing a PS3 clone device, we should try and keep the USB device name to create a new btd_device so that the joypad is named after its USB name when connecting through Bluetooth. If that isn't done, "Shanwan" clone joypads are named like the genuine joypads, and kernel Bluetooth quirks aren't applied. gh-issue: https://github.com/bluez/bluez/issues/46 --- plugins/sixaxis.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c index d693a86c0..517cecc47 100644 --- a/plugins/sixaxis.c +++ b/plugins/sixaxis.c @@ -387,6 +387,7 @@ get_pairing_type_for_device(struct udev_device *udevice, uint16_t *bus, char **sysfs_path) { struct udev_device *hid_parent; + const char *hid_name; const char *hid_id; const struct cable_pairing *cp; uint16_t vid, pid; @@ -401,7 +402,9 @@ get_pairing_type_for_device(struct udev_device *udevice, uint16_t *bus, if (!hid_id || sscanf(hid_id, "%hx:%hx:%hx", bus, &vid, &pid) != 3) return NULL; - cp = get_pairing(vid, pid); + hid_name = udev_device_get_property_value(hid_parent, "HID_NAME"); + + cp = get_pairing(vid, pid, hid_name); *sysfs_path = g_strdup(udev_device_get_syspath(udevice)); return cp; -- cgit v1.2.1