Page MenuHomeFreeBSD

Enable usbhid by default
ClosedPublic

Authored by emaste on Jun 20 2024, 8:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Sep 20, 5:38 AM
Unknown Object (File)
Tue, Sep 16, 1:02 AM
Unknown Object (File)
Sat, Sep 13, 9:33 PM
Unknown Object (File)
Sat, Sep 13, 12:18 PM
Unknown Object (File)
Sat, Sep 13, 5:47 AM
Unknown Object (File)
Fri, Sep 12, 3:41 PM
Unknown Object (File)
Sep 10 2025, 12:09 AM
Unknown Object (File)
Sep 8 2025, 9:19 PM

Details

Summary

Use usbhid by default and not the old HID stack.
This should be a no functional changes for most users, just the
devices name will change.
If you use fido/u2f keys it's known to not work so you can disable this
by setting hw.usbhid.enable=0 in loader.conf
For users using old touchscreen (like some ELO ones) this avoid using webcamd
as hmt(4) will work fine on them.

Sponsored by: Beckhoff Automation GmbH & Co. KG

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

manu requested review of this revision.Jun 20 2024, 8:11 AM
This revision is now accepted and ready to land.Jun 21 2024, 12:14 PM

LGTM.

But there are still 2 known regressions

  1. Some FIDO/U2f keys does not works stable. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265528 and https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263995. I Did a fix D41639 but I still think that it can be improved.
  2. USB mices will not work in VT as moused does not support evdev protocol. I made evdev-awared version of moused. It works (and supports touchpads) but it is not ready to replace our basesystem daemon yet. May be I need just create a port for beginning?

LGTM.

But there are still 2 known regressions

  1. Some FIDO/U2f keys does not works stable. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265528 and https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263995. I Did a fix D41639 but I still think that it can be improved.
  2. USB mices will not work in VT as moused does not support evdev protocol. I made evdev-awared version of moused. It works (and supports touchpads) but it is not ready to replace our basesystem daemon yet. May be I need just create a port for beginning?

Thanks, I wasn't aware of those two issues, I'll have a look at those in the next few (working) days. For now I'll hold on on commiting this.

sys/amd64/conf/GENERIC
328 ↗(On Diff #140024)

Why not add hkbd, rather than change ukbd to hkbd?

I made evdev-awared version of moused. It works (and supports touchpads) but it is not ready to replace our basesystem daemon yet. May be I need just create a port for beginning?

I forgot about link: https://github.com/wulf7/moused

sys/amd64/conf/GENERIC
328 ↗(On Diff #140024)

Why not add hkbd, rather than change ukbd to hkbd?

That makes sense. To not burn bridges for binary images for some time.

sys/amd64/conf/GENERIC
328 ↗(On Diff #140024)

I'll try to boot this kernel with the sysctl to 0 to check if ukbd still works correctly (it should), if that's the case yes that's probably better, at least at the beginning.

sys/amd64/conf/GENERIC
328 ↗(On Diff #140024)

It's the usual conservative approach. This will also let people file bug reports more easily.

manu edited the summary of this revision. (Show Details)
This revision now requires review to proceed.Jun 24 2024, 4:59 AM
sys/dev/usb/input/usbhid.c
81

from SYSCTL(9)

/*
 * Example of a variable integer value.  Notice that the control
 * flags are CTLFLAG_RW, the variable pointer is set, and the
 * value is 0.
 */
static int      doingcache = 1;         /* 1 => enable the cache */
SYSCTL_INT(_debug, OID_AUTO, vfscache, CTLFLAG_RW, &doingcache, 0,
    "Enable name cache");
emaste requested changes to this revision.May 20 2025, 3:25 PM

Default text in share/man/man4/usbhid.4 needs to be updated too

This revision now requires changes to proceed.May 20 2025, 3:25 PM
emaste edited reviewers, added: manu; removed: emaste.
This revision now requires review to proceed.May 20 2025, 6:11 PM

Change default in man page

There are some regressions still (e.g. fido/u2f as noted). This change will need relnotes, an updating entry, and a heads-up mail.

IMO we can go forward and commit this change before code slush..
FIDO/U2F driver is under review. And moused is in a good enough shape to be widely tested. Both of them are minor changes and i think can be committed after August 8.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 30 2025, 6:32 PM
This revision was automatically updated to reflect the committed changes.