Re: [PATCH v20] tty: Fix the keyboard led light display problem

From: Dan Carpenter
Date: Mon Dec 13 2021 - 08:21:39 EST


"the keyboard led light display problem" is pretty vague. Perhaps say
"Fix incorrect "Num Lock" LED indicator"

On Mon, Dec 13, 2021 at 02:12:44PM +0800, lianzhi chang wrote:
> Use the "ctrl+alt+Fn" key combination to switch the system from tty to
> desktop or switch the system from desktop to tty. After the switch is
> completed, it is found that the state of the keyboard lock is

Is this one of those fancy gaming keyboards with LEDs under the keys or
are we talking about Num Lock?


> +int vt_do_kdgkbledctl(unsigned int console)
> +{
> + struct kbd_struct *kb = &kbd_table[console];
> + /* This is a spot read so needs no locking */
> + switch (kb->kbdledctl) {
> + case VC_LEDCTL_ON:
> + return K_LEDCTL_ON;
> + case VC_LEDCTL_OFF:
> + return K_LEDCTL_OFF;
> + }

Extra tab.

> +}
> +

> +#define VC_LEDCTL_ON 0 /* VT can set the keyboard light */
> +#define VC_LEDCTL_OFF 1 /* Prohibit VT to set the keyboard light */

> +#define K_LEDCTL_ON 0x00
> +#define K_LEDCTL_OFF 0x01

It's weird that ON is zero and OFF one. Really, it's unfortunate that
we need a new ioctl to fix this bug...

regards,
dan carpenter