Re: [PATCH] vt: Add virtual console keyboard mode OFF

From: Greg KH
Date: Mon Jan 31 2011 - 12:50:24 EST


On Sun, Jan 30, 2011 at 12:36:22AM -0800, Arthur Taylor wrote:
> Add a new mode for the virtual console keyboard OFF to compliment RAW
> in which all key events are ignored. New mode prevents vt input
> buffers from overflowing when a program opens but doesn't read from a
> tty, like Xorg using only evdev for input.
>
> The new mode is available by the ioctl KDSKBMODE with argument K_OFF
> from linux/kd.h. Does not effect sysrq behaviour.

Care to document this somewhere (i.e. Documentation/ABI?)

> Cc: Greg Kroah-Hartman <gregkh@xxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Alan Cox <alan@xxxxxxxxxx>
> Signed-off-by: Arthur Taylor <art@xxxxxxxx>
> ---
> drivers/tty/vt/keyboard.c | 5 +++--
> drivers/tty/vt/vt_ioctl.c | 3 +++
> include/linux/kbd_kern.h | 3 ++-
> include/linux/kd.h | 1 +
> 4 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
> index e95d787..6dd3c68 100644
> --- a/drivers/tty/vt/keyboard.c
> +++ b/drivers/tty/vt/keyboard.c
> @@ -654,7 +654,8 @@ static void k_spec(struct vc_data *vc, unsigned
> char value, char up_flag)

Your patch is line-wrapped and can not be applied :(

> @@ -50,11 +50,12 @@ struct kbd_struct {
> #define VC_CAPSLOCK 2 /* capslock mode */
> #define VC_KANALOCK 3 /* kanalock mode */
>
> - unsigned char kbdmode:2; /* one 2-bit value */
> + unsigned char kbdmode:3; /* one 3-bit value */

Are you sure you can change the size of this structure and no one is
going to have problems?

Also, what userspace code is going to use this new feature? Has it been
tested to work properly?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/