Bug 199885 - Bluetooth HID devices do not report idVendor/idProduct values to sysfs (while USB HID devices do)
Summary: Bluetooth HID devices do not report idVendor/idProduct values to sysfs (while...
Status: RESOLVED INVALID
Alias: None
Product: Drivers
Classification: Unclassified
Component: Bluetooth (show other bugs)
Hardware: All Linux
: P1 low
Assignee: linux-bluetooth@vger.kernel.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-30 10:47 UTC by Hanno Zulla
Modified: 2018-05-31 10:04 UTC (History)
0 users

See Also:
Kernel Version: 4.15.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Hanno Zulla 2018-05-30 10:47:36 UTC
Hello,

this is in reference to [1].

udev rules are based on the content of sysfs.

The PS3 gamepad will connect with a Linux computer either via USB [2] or via Bluetooth [3] - the kernel driver hid-sony.c for this device uses the same HID idVendor/idProduct combination to identify it.

I would thus expect a udev rule with ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0268" to match this device when connected with USB or Bluetooth.

But this only works for USB connections, since the USB stack exposes these values to sysfs, while Bluetooth does not.

Meanwhile the Bluetooth only reports back the full device "name" ("%s %s", manufacturer, product). This is unfortunate, as that name is not specific enough. There are devices out there using the same generic name but different idVendor/idProduct combinations.

It would be very beneficial if Bluetooth HID devices could export the same values to sysfs as USB HID devices already do, e.g. at least

- manufacturer
- product
- idVendor
- idProduct
- version

To review the problem, here are the outputs of

udevadm info -a -n /dev/input/js0

for the same PS3 gamepad

- connected via USB [4]
- connected via Bluetooth [5]

Thanks!

[1] https://github.com/systemd/systemd/issues/9101
[2] https://github.com/torvalds/linux/blob/7fbb6157630f2ba6ee355689061f9596b84373ef/drivers/hid/hid-sony.c#L3038
[3] https://github.com/torvalds/linux/blob/7fbb6157630f2ba6ee355689061f9596b84373ef/drivers/hid/hid-sony.c#L3048
[4] https://github.com/systemd/systemd/files/2044163/udev-sony-usb.txt
[5] https://github.com/systemd/systemd/files/2044164/udev-sony-bluetooth.txt
Comment 1 Hanno Zulla 2018-05-31 10:04:57 UTC
Found out about the "id/" subdirectory in input driver's sysfs entry.

Note You need to log in before you can comment on or make changes to this bug.