From nobody Mon Feb 27 03:33:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PQ5gm1XTyz3tFwL for ; Mon, 27 Feb 2023 03:33:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PQ5gl5RrFz3P31 for ; Mon, 27 Feb 2023 03:33:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b=dmwaaxry; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::52f) smtp.mailfrom=wlosh@bsdimp.com; dmarc=none Received: by mail-ed1-x52f.google.com with SMTP id f13so20246081edz.6 for ; Sun, 26 Feb 2023 19:33:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QnYUdSbTLNSpQZ7UXdHIpEDLfYp6CtiRnYffJ4rDCn0=; b=dmwaaxry2vJoilclfxW3Q5PQB8mk970V95exn9KOJYU8zA/mX6df3sc6xLLq8tzOg3 W3ekaZziVdVsQGxn4S/534nEdSaIt9wur+H1pDjftlFpuvD9Dr2tsekakPSTHDVckkkF oOQvF1fgaUzH94ZEAxYXwzziuqrcjtAIOvrQ2dy8lwN0ypQOqc+vNbE4YvI7OHaLqIpl uvCOeQFR750Y/0rali2ukEi6aGRZg0TcY1bEaHAtjpkG+CVMGIqMt6b3NYje8tj6mEPe dxIyImQQs/e/X+s6NRaR34P9CxmRI+LzzFhvV1IIqh7aclfxZVNdvENES122Fy/jEC+C DCAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QnYUdSbTLNSpQZ7UXdHIpEDLfYp6CtiRnYffJ4rDCn0=; b=xVDWqrFb3JW1jr+8sGWgbADUlGuG6eOBCliBaq+ajdHta0iOqszarJ8vUGqgajk8QX bMOyXA0YHHeVNC2CPRyasK9xQtQ4200koQr9FdOZuOmGzC70ClpRVdU8atqZAsiToUID alvFgNqZUX1fODatF/CHbJUJaOqPHPJRsy2OQG1QI7pj8AI/0dd9avm/QtVreIM1qjyE p/b+mX/awRz+Ci3ioPTtUA4pjigyjiW/6ZRySq28ZHuL9zkiyNi0GsgQKV/DNO7Yyxcv rOlgQPTf20+D8FLvXYeX5jLBG+NeNVSOuBSz8+KsSzYW3qeTO/gE9ftJVvsz09IdlfXP dOHw== X-Gm-Message-State: AO0yUKW0hp8w2BFbZJVgp5K8iljtry7xzR/Bwo6Sspk6U5i7A3BGTX2Q QC5JOI7+1qojkZD72p3D/ZrIKPxFXPfUdr+gjLiN9JLLWrYFLg== X-Google-Smtp-Source: AK7set9qcXk5GZyxLnVxaU6ddxDIF9W5YePf+585QMghg1pd+DHwTLQHM0MmJXfE+wD2jZZpJSA5suWxNdIvHk2vDPU= X-Received: by 2002:a17:906:4ecb:b0:895:58be:964 with SMTP id i11-20020a1709064ecb00b0089558be0964mr15411123ejv.2.1677468817644; Sun, 26 Feb 2023 19:33:37 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <66452C86-02AA-4604-B65C-5E32EEBAFCC3.ref@yahoo.com> <66452C86-02AA-4604-B65C-5E32EEBAFCC3@yahoo.com> In-Reply-To: <66452C86-02AA-4604-B65C-5E32EEBAFCC3@yahoo.com> From: Warner Losh Date: Sun, 26 Feb 2023 20:33:31 -0700 Message-ID: Subject: Re: git: c51978f4b2f0 - main - kbd: add KBD_DELAY1 and KBD_DELAY2 To: Mark Millard Cc: imp@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000ff705805f5a624ac" X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20210112.gappssmtp.com:s=20210112]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FREEMAIL_TO(0.00)[yahoo.com]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; R_SPF_NA(0.00)[no SPF record]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::52f:from]; DKIM_TRACE(0.00)[bsdimp-com.20210112.gappssmtp.com:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[bsdimp.com]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4PQ5gl5RrFz3P31 X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N --000000000000ff705805f5a624ac Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Feb 25, 2023 at 10:03=E2=80=AFAM Mark Millard w= rote: > Warner Losh wrote on > Date: Sat, 25 Feb 2023 06:26:00 UTC : > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dc51978f4b2f080c80ddc891c24b151d= 35acb8ba4 > > > > commit c51978f4b2f080c80ddc891c24b151d35acb8ba4 > > Author: Michael Paepcke > > AuthorDate: 2023-02-18 09:11:37 +0000 > > Commit: Warner Losh > > CommitDate: 2023-02-25 06:19:05 +0000 > > > > 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 > > --- > > sys/conf/options | 3 ++- > > sys/dev/kbd/kbd.c | 4 ++-- > > sys/dev/kbd/kbdreg.h | 8 ++++++-- > > 3 files changed, 10 insertions(+), 5 deletions(-) > > > > 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 > > > > # 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 on= ly > */ > > - kbd->kb_delay2 =3D KB_DELAY2; > > + kbd->kb_delay1 =3D KBD_DELAY1; /* these values are advisory on= ly > */ > > + 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? > If we include them in the wrong order, then the compiler will complain, and that's likely sufficient. I'll double check NOTES to make sure that the values there are different than the defaults. Warner > > 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 > > --000000000000ff705805f5a624ac Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, Feb 25, 2023 at 10:03=E2=80= =AFAM Mark Millard <marklmi@yahoo.c= om> wrote:
https://= cgit.FreeBSD.org/src/commit/?id=3Dc51978f4b2f080c80ddc891c24b151d35acb8ba4<= /a>
>
> commit c51978f4b2f080c80ddc891c24b151d35acb8ba4
> Author:=C2=A0 =C2=A0 =C2=A0Michael Paepcke <git@paepcke.de>
> AuthorDate: 2023-02-18 09:11:37 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2023-02-25 06:19:05 +0000
>
>=C2=A0 =C2=A0 =C2=A0kbd: add KBD_DELAY1 and KBD_DELAY2
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Allow to configure KBD_DELAY* via KERNCONF for user= -land less embedded
>=C2=A0 =C2=A0 =C2=A0and security appliances
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Reviewed by: imp (folded)
>=C2=A0 =C2=A0 =C2=A0Pull Request: https://github.= com/freebsd/freebsd-src/pull/649
> ---
>=C2=A0 sys/conf/options=C2=A0 =C2=A0 =C2=A0| 3 ++-
>=C2=A0 sys/dev/kbd/kbd.c=C2=A0 =C2=A0 | 4 ++--
>=C2=A0 sys/dev/kbd/kbdreg.h | 8 ++++++--
>=C2=A0 3 files changed, 10 insertions(+), 5 deletions(-)
>
> 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=C2=A0 opt_kbd.h
>=C2=A0 KBD_MAXRETRY=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0opt_kbd.h
>=C2=A0 KBD_MAXWAIT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 opt_kbd.h
>=C2=A0 KBD_RESETDELAY=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0opt_kbd.h
> +KBD_DELAY1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0opt_kbd.h
> +KBD_DELAY2=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0opt_kbd.h
>=C2=A0 KBDIO_DEBUG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 opt_kbd.h
> -
>=C2=A0 KBDMUX_DFLT_KEYMAP=C2=A0 =C2=A0opt_kbdmux.h
>=C2=A0
>=C2=A0 # 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 t= ype, int unit, int config,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0kbd->kb_accentmap =3D NULL;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0kbd->kb_fkeytab =3D NULL;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0kbd->kb_fkeytab_size =3D 0;
> -=C2=A0 =C2=A0 =C2=A0kbd->kb_delay1 =3D KB_DELAY1;=C2=A0 =C2=A0 =C2= =A0/* these values are advisory only */
> -=C2=A0 =C2=A0 =C2=A0kbd->kb_delay2 =3D KB_DELAY2;
> +=C2=A0 =C2=A0 =C2=A0kbd->kb_delay1 =3D KBD_DELAY1;=C2=A0 =C2=A0 /*= these values are advisory only */
> +=C2=A0 =C2=A0 =C2=A0kbd->kb_delay2 =3D KBD_DELAY2;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0kbd->kb_count =3D 0L;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0bzero(kbd->kb_lastact, sizeof(kbd->kb_= lastact));
>=C2=A0 }
> 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 {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0void=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 *kb_data;=C2=A0 =C2=A0 =C2=A0 =C2=A0/* the driver's private data */=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0int=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0kb_delay1;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0int=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0kb_delay2;
> -#define KB_DELAY1=C2=A0 =C2=A0 500
> -#define KB_DELAY2=C2=A0 =C2=A0 100
> +#ifndef KBD_DELAY1
> +#define KBD_DELAY1=C2=A0 =C2=A0500
> +#endif
> +#ifndef KBD_DELAY2
> +#define KBD_DELAY2=C2=A0 =C2=A0100
> +#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?

If we include them in the wrong order, then the compiler will complain,
and that's likely sufficient. I'll double check NOTES to ma= ke sure that the
values there are different than the defaults.

Warner
=C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned long=C2=A0 =C2=A0kb_count;=C2=A0 = =C2=A0 =C2=A0 =C2=A0/* # of processed key strokes */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0u_char=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kb_= lastact[NUM_KEYS/2];
>=C2=A0 =C2=A0 =C2=A0 =C2=A0struct cdev *kb_dev;

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

--000000000000ff705805f5a624ac--