kbd: add KBD_DELAY1 and KBD_DELAY2

Allow to configure KBD_DELAY* via KERNCONF for user-land less embedded
and security appliances

Reviewed by: imp (folded)
Pull Request: https://github.com/freebsd/freebsd-src/pull/649
This commit is contained in:
Michael Paepcke 2023-02-18 09:11:37 +00:00 committed by Warner Losh
parent 49e3972afc
commit c51978f4b2
3 changed files with 10 additions and 5 deletions

View File

@ -803,8 +803,9 @@ KBD_INSTALL_CDEV opt_kbd.h
KBD_MAXRETRY opt_kbd.h
KBD_MAXWAIT opt_kbd.h
KBD_RESETDELAY opt_kbd.h
KBD_DELAY1 opt_kbd.h
KBD_DELAY2 opt_kbd.h
KBDIO_DEBUG opt_kbd.h
KBDMUX_DFLT_KEYMAP opt_kbdmux.h
# options for the Atheros driver

View File

@ -143,8 +143,8 @@ kbd_init_struct(keyboard_t *kbd, char *name, int type, int unit, int config,
kbd->kb_accentmap = NULL;
kbd->kb_fkeytab = NULL;
kbd->kb_fkeytab_size = 0;
kbd->kb_delay1 = KB_DELAY1; /* these values are advisory only */
kbd->kb_delay2 = KB_DELAY2;
kbd->kb_delay1 = KBD_DELAY1; /* these values are advisory only */
kbd->kb_delay2 = KBD_DELAY2;
kbd->kb_count = 0L;
bzero(kbd->kb_lastact, sizeof(kbd->kb_lastact));
}

View File

@ -151,8 +151,12 @@ struct keyboard {
void *kb_data; /* the driver's private data */
int kb_delay1;
int kb_delay2;
#define KB_DELAY1 500
#define KB_DELAY2 100
#ifndef KBD_DELAY1
#define KBD_DELAY1 500
#endif
#ifndef KBD_DELAY2
#define KBD_DELAY2 100
#endif
unsigned long kb_count; /* # of processed key strokes */
u_char kb_lastact[NUM_KEYS/2];
struct cdev *kb_dev;