Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Feb 2023 09:03:06 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        imp@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   RE: git: c51978f4b2f0 - main - kbd: add KBD_DELAY1 and KBD_DELAY2
Message-ID:  <66452C86-02AA-4604-B65C-5E32EEBAFCC3@yahoo.com>
References:  <66452C86-02AA-4604-B65C-5E32EEBAFCC3.ref@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Warner Losh <imp_at_FreeBSD.org> wrote on
Date: Sat, 25 Feb 2023 06:26:00 UTC :

> The branch main has been updated by imp:
>=20
> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3Dc51978f4b2f080c80ddc891c24b151d3=
5acb8ba4
>=20
> commit c51978f4b2f080c80ddc891c24b151d35acb8ba4
> Author:     Michael Paepcke <git@paepcke.de>
> AuthorDate: 2023-02-18 09:11:37 +0000
> Commit:     Warner Losh <imp@FreeBSD.org>
> CommitDate: 2023-02-25 06:19:05 +0000
>=20
>     kbd: add KBD_DELAY1 and KBD_DELAY2
>    =20
>     Allow to configure KBD_DELAY* via KERNCONF for user-land less =
embedded
>     and security appliances
>    =20
>     Reviewed by: imp (folded)
>     Pull Request: https://github.com/freebsd/freebsd-src/pull/649
> ---
>  sys/conf/options     | 3 ++-
>  sys/dev/kbd/kbd.c    | 4 ++--
>  sys/dev/kbd/kbdreg.h | 8 ++++++--
>  3 files changed, 10 insertions(+), 5 deletions(-)
>=20
> diff --git a/sys/conf/options b/sys/conf/options
> index 7855a2f3f20e..42529a90a54e 100644
> --- a/sys/conf/options
> +++ b/sys/conf/options
> @@ -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
> =20
>  # options for the Atheros driver
> diff --git a/sys/dev/kbd/kbd.c b/sys/dev/kbd/kbd.c
> index 205d76639e0f..ebc779de4073 100644
> --- a/sys/dev/kbd/kbd.c
> +++ b/sys/dev/kbd/kbd.c
> @@ -143,8 +143,8 @@ kbd_init_struct(keyboard_t *kbd, char *name, int =
type, int unit, int config,
>  	kbd->kb_accentmap =3D NULL;
>  	kbd->kb_fkeytab =3D NULL;
>  	kbd->kb_fkeytab_size =3D 0;
> -	kbd->kb_delay1 =3D KB_DELAY1;	/* these values are advisory =
only */
> -	kbd->kb_delay2 =3D KB_DELAY2;
> +	kbd->kb_delay1 =3D KBD_DELAY1;	/* these values are advisory =
only */
> +	kbd->kb_delay2 =3D KBD_DELAY2;
>  	kbd->kb_count =3D 0L;
>  	bzero(kbd->kb_lastact, sizeof(kbd->kb_lastact));
>  }
> diff --git a/sys/dev/kbd/kbdreg.h b/sys/dev/kbd/kbdreg.h
> index 15b7e5183f35..2839e259420d 100644
> --- a/sys/dev/kbd/kbdreg.h
> +++ b/sys/dev/kbd/kbdreg.h
> @@ -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

[Just reporting Ximalas's Discord note.]

So opt_kbd.h must be included before kbdreg.h in
order to avoid: macro redefined in opt_kbd.h ?

Should something force the right order?

>  	unsigned long	kb_count;	/* # of processed key strokes */
>  	u_char		kb_lastact[NUM_KEYS/2];
>  	struct cdev *kb_dev;

=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?66452C86-02AA-4604-B65C-5E32EEBAFCC3>