lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210703220202.5637-4-maxtram95@gmail.com>
Date:   Sun,  4 Jul 2021 01:01:59 +0300
From:   Maxim Mikityanskiy <maxtram95@...il.com>
To:     Jiri Kosina <jikos@...nel.org>,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Daniel Kurtz <djkurtz@...omium.org>,
        Oliver Neukum <oneukum@...e.de>
Cc:     linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        Maxim Mikityanskiy <maxtram95@...il.com>
Subject: [PATCH 3/6] HID: plantronics: Expose headset LEDs

hid-plantronics uses a custom input mapping, where unhandled usages get
ignored. Although these headsets have LEDs, they aren't handled in
plantronics_input_mapping, hence not exposed to the userspace. This
commit fixes it by adding a case for HID_UP_LED.

Tested with Plantronics Blackwire 3220 Series (047f:c056).

Signed-off-by: Maxim Mikityanskiy <maxtram95@...il.com>
---
 drivers/hid/hid-plantronics.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/hid/hid-plantronics.c b/drivers/hid/hid-plantronics.c
index e81b7cec2d12..ea056235a591 100644
--- a/drivers/hid/hid-plantronics.c
+++ b/drivers/hid/hid-plantronics.c
@@ -61,6 +61,10 @@ static int plantronics_input_mapping(struct hid_device *hdev,
 	if (field->application == HID_GD_JOYSTICK)
 		goto defaulted;
 
+	/* expose LEDs */
+	if ((usage->hid & HID_USAGE_PAGE) == HID_UP_LED)
+		goto defaulted;
+
 	/* handle volume up/down mapping */
 	/* non-standard types or multi-HID interfaces - plt_type is PID */
 	if (!(plt_type & HID_USAGE_PAGE)) {
-- 
2.32.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ