From: Pakrohk <rhpcir@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Pakrohk <rhpcir@gmail.com>
Subject: [PATCH BlueZ 0/1] input: HID gamepad quirk system for broken SDP records
Date: Wed, 22 Jul 2026 12:22:36 +0330 [thread overview]
Message-ID: <20260722090246.212017-1-rhpcir@gmail.com> (raw)
Some Bluetooth gamepads (like DualShock 4 v2) have incomplete or malformed
HID SDP records, causing BlueZ to fail with -ENOENT. Windows and Android
handle this gracefully; Linux does not.
This patch adds a minimal quirk system that only activates for specifically
matched devices. When extract_hid_record() fails, the dispatcher tries
built-in quirks before giving up. The quirk injects the correct BT HID
report descriptor so the kernel's hid-playstation driver can create an
input device.
The patch includes one quirk (TG170W / DualShock 4 v2) as an example.
The system is modular -- new quirks can be added as separate files in
quirks/.
I previously included an external quirk profile system (JSON + HMAC
signatures) and a crypto extension to bt_crypto. Based on your feedback,
I've stripped those out. The core quirk system works without them.
Questions:
1. Is this approach acceptable for upstream?
2. For external quirk profiles (user-installable via JSON), what crypto
approach does BlueZ prefer? The existing bt_crypto uses AF_ALG which
is being deprecated. Should I wait for an upstream decision, use a
different library, or skip signatures entirely?
Pakrohk (1):
input: add HID gamepad quirk system for broken SDP records
profiles/input/quirk.c | 77 +++++++++++
profiles/input/quirk.h | 37 ++++++
profiles/input/quirks/tg170w.c | 232 +++++++++++++++++++++++++++++++++
3 files changed, 346 insertions(+)
create mode 100644 profiles/input/quirk.c
create mode 100644 profiles/input/quirk.h
create mode 100644 profiles/input/quirks/tg170w.c
--
2.54.0
next reply other threads:[~2026-07-22 9:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 8:52 Pakrohk [this message]
2026-07-22 8:52 ` [PATCH BlueZ 1/1] input: add HID gamepad quirk system for broken SDP records Pakrohk
-- strict thread matches above, loose matches on Subject: below --
2026-07-22 9:03 [PATCH BlueZ 0/1] input: " Pakrohk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260722090246.212017-1-rhpcir@gmail.com \
--to=rhpcir@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox