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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220530094215.646432cd@ultrarare.space>
Date:   Mon, 30 May 2022 09:42:15 +0800
From:   Hilton Chain <hako@...rarare.space>
To:     José Expósito <jose.exposito89@...il.com>
Cc:     bryancain3@...il.com, jikos@...nel.org,
        benjamin.tissoires@...hat.com, linux-kernel@...r.kernel.org,
        linux-input@...r.kernel.org
Subject: [PATCH] HID: apple: Properly handle function keys on misset
 non-apple keyboards

This commit extends fa33382c7f74 ("HID: apple: Properly handle function
keys on Keychron keyboards") to support all misset non-apple keyboards.

Signed-off-by: Hilton Chain <hako@...rarare.space>
---

 drivers/hid/hid-apple.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
index 42a568902f49..3b15753be467 100644
--- a/drivers/hid/hid-apple.c
+++ b/drivers/hid/hid-apple.c
@@ -36,7 +36,7 @@
 #define APPLE_NUMLOCK_EMULATION	BIT(8)
 #define APPLE_RDESC_BATTERY	BIT(9)
 #define APPLE_BACKLIGHT_CTL	BIT(10)
-#define APPLE_IS_KEYCHRON	BIT(11)
+#define APPLE_IS_BAD_APPLE	BIT(11)

 #define APPLE_FLAG_FKEY		0x01

@@ -363,7 +363,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
 	}

 	if (fnmode == 3) {
-		real_fnmode = (asc->quirks & APPLE_IS_KEYCHRON) ? 2 : 1;
+		real_fnmode = (asc->quirks & APPLE_IS_BAD_APPLE) ? 2 : 1;
 	} else {
 		real_fnmode = fnmode;
 	}
@@ -669,9 +669,9 @@ static int apple_input_configured(struct hid_device *hdev,
 		asc->quirks &= ~APPLE_HAS_FN;
 	}

-	if (strncmp(hdev->name, "Keychron", 8) == 0) {
-		hid_info(hdev, "Keychron keyboard detected; function keys will default to fnmode=2 behavior\n");
-		asc->quirks |= APPLE_IS_KEYCHRON;
+	if (strncmp(hdev->name, "Apple", 5)) {
+		hid_info(hdev, "Non-apple keyboard detected; function keys will default to fnmode=2 behavior\n");
+		asc->quirks |= APPLE_IS_BAD_APPLE;
 	}

 	return 0;

base-commit: b00ed48bb0a7c295facf9036135a573a5cdbe7de
--
2.36.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ