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: <4e37c7b2-85bc-459e-b2ea-2e362c16e9aa@redhat.com>
Date: Mon, 17 Mar 2025 12:04:59 +0100
From: Hans de Goede <hdegoede@...hat.com>
To: Werner Sembach <wse@...edocomputers.com>,
 Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] Input: atkbd - Map FN-key for TongFang barebones

Hi Werner,

Thank you for your patches / your work on this.

On 11-Mar-25 19:06, Werner Sembach wrote:
> TongFangs firmware sends scancode 0xe0 0x78 upon pressing the FN key.
> 
> This patch maps this scancode to avoid a dmesg warning printed every FN-keypress
> and to enable userspace to use they key in other shortcuts than the firmware
> builtin ones.
> 
> Signed-off-by: Werner Sembach <wse@...edocomputers.com>

This laptop specific mapping really belongs in hwdb, 0xe0 0x78
translates to KEYBOARD_KEY_f8 in hwdb and if you look for that in:

/lib/udev/hwdb.d/60-keyboard.hwdb

You already find several entries, e.g. :

evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pn*:*
...
 KEYBOARD_KEY_f8=fn

And e.g. also for some Clevo models:

 KEYBOARD_KEY_f8=f21                                    # Touchpad Toggle

and:

# HP Elite x2 1013 G3
evdev:atkbd:dmi:bvn*:bvr*:svnHP*:pnHPElitex21013G3:*
 KEYBOARD_KEY_f8=unknown                               # rfkill is also reported by HP Wireless hotkeys

these first couple of hits show that 0xf8 is not
universally mapped to Fn, so putting this mapping in the kernel's
default key table is wrong IMHO.

Regards,

Hans



> ---
>  drivers/input/keyboard/atkbd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
> index adf0f311996c9..3598a21d9d014 100644
> --- a/drivers/input/keyboard/atkbd.c
> +++ b/drivers/input/keyboard/atkbd.c
> @@ -98,7 +98,7 @@ static const unsigned short atkbd_set2_keycode[ATKBD_KEYMAP_SIZE] = {
>  	173,114,  0,113,  0,  0,  0,126,128,  0,  0,140,  0,  0,  0,127,
>  	159,  0,115,  0,164,  0,  0,116,158,  0,172,166,  0,  0,  0,142,
>  	157,  0,  0,  0,  0,  0,  0,  0,155,  0, 98,  0,  0,163,  0,  0,
> -	226,  0,  0,  0,  0,  0,  0,  0,  0,255, 96,  0,  0,  0,143,  0,
> +	226,  0,  0,464,  0,  0,  0,  0,  0,255, 96,  0,  0,  0,143,  0,
>  	  0,  0,  0,  0,  0,  0,  0,  0,  0,107,  0,105,102,  0,  0,112,
>  	110,111,108,112,106,103,  0,119,  0,118,109,  0, 99,104,119,  0,
>  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ