Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Sep 2025 07:55:26 GMT
From:      Vladimir Kondratyev <wulf@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e43fbf27976d - main - u2f(4): Invert U2F_MAKE_UHID_ALIAS kernel build option
Message-ID:  <202509250755.58P7tQoP060960@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=e43fbf27976df17991d32c72c41e43fda66fb262

commit e43fbf27976df17991d32c72c41e43fda66fb262
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2025-09-25 07:54:19 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2025-09-25 07:54:19 +0000

    u2f(4): Invert U2F_MAKE_UHID_ALIAS kernel build option
    
    This makes non-GENERIC kernel configs easier to maintain.
    
    Requested by:   glebius
    MFC after:      2 days
---
 sys/amd64/conf/GENERIC       | 1 -
 sys/arm/conf/GENERIC         | 1 -
 sys/arm64/conf/std.dev       | 1 -
 sys/conf/NOTES               | 3 ++-
 sys/conf/options             | 2 +-
 sys/dev/hid/u2f.c            | 8 ++++----
 sys/i386/conf/GENERIC        | 1 -
 sys/powerpc/conf/GENERIC64   | 1 -
 sys/powerpc/conf/GENERIC64LE | 1 -
 sys/riscv/conf/GENERIC       | 1 -
 10 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC
index d5a1adb2dc65..2e41ed26403a 100644
--- a/sys/amd64/conf/GENERIC
+++ b/sys/amd64/conf/GENERIC
@@ -386,7 +386,6 @@ options 	HID_DEBUG		# enable debug msgs
 device		hid			# Generic HID support
 device		hidbus			# Generic HID Bus
 options 	IICHID_SAMPLING		# Workaround missing GPIO INTR support
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
 
 # EFI devices
 device		efidev			# EFI pseudo-device
diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC
index 26b0c7bf0294..7394f3842d43 100644
--- a/sys/arm/conf/GENERIC
+++ b/sys/arm/conf/GENERIC
@@ -261,7 +261,6 @@ device		aw_thermal	# Allwinner Thermal Sensor Controller
 # HID support
 device		hid		# Generic HID support
 device		hidbus		# Generic HID Bus
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
 
 # Flattened Device Tree
 options 	FDT			# Configure using FDT/DTB data
diff --git a/sys/arm64/conf/std.dev b/sys/arm64/conf/std.dev
index 719f272426dd..c5c364ffda04 100644
--- a/sys/arm64/conf/std.dev
+++ b/sys/arm64/conf/std.dev
@@ -115,7 +115,6 @@ device		mmcsd			# mmc/sd flash cards
 options 	HID_DEBUG		# enable debug msgs
 device		hid			# Generic HID support
 device		hidbus			# Generic HID Bus
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
 
 # Firmware
 device		mmio_sram		# Generic on-chip SRAM
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index c7a8862fb906..ea9b2667607e 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -2447,7 +2447,8 @@ device		hpen		# Generic pen driver
 device		hsctrl		# System controls
 device		ps4dshock	# Sony PS4 DualShock 4 gamepad driver
 device		u2f		# FIDO/U2F authenticator
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
+options 	U2F_DROP_UHID_ALIAS	# Do not install /dev/uhid alias for
+				# /dev/u2f/ and rename driver from uhid to u2f
 device		xb360gp		# XBox 360 gamepad driver
 
 #####################################################################
diff --git a/sys/conf/options b/sys/conf/options
index 66f7f2ee2d7e..b48ad1cf42cf 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -1004,7 +1004,7 @@ IICHID_DEBUG	opt_hid.h
 IICHID_SAMPLING	opt_hid.h
 HKBD_DFLT_KEYMAP	opt_hkbd.h
 HIDRAW_MAKE_UHID_ALIAS	opt_hid.h
-U2F_MAKE_UHID_ALIAS	opt_hid.h
+U2F_DROP_UHID_ALIAS	opt_hid.h
 
 # kenv options
 # The early kernel environment (loader environment, config(8)-provided static)
diff --git a/sys/dev/hid/u2f.c b/sys/dev/hid/u2f.c
index 39610845c5fb..08f1a5ceedba 100644
--- a/sys/dev/hid/u2f.c
+++ b/sys/dev/hid/u2f.c
@@ -193,7 +193,7 @@ u2f_attach(device_t dev)
 		u2f_detach(dev);
 		return (error);
 	}
-#ifdef U2F_MAKE_UHID_ALIAS
+#ifndef U2F_DROP_UHID_ALIAS
 	(void)make_dev_alias(sc->dev, "uhid%d", device_get_unit(dev));
 #endif
 
@@ -587,10 +587,10 @@ static device_method_t u2f_methods[] = {
 };
 
 static driver_t u2f_driver = {
-#ifdef U2F_MAKE_UHID_ALIAS
-	"uhid",
+#ifdef U2F_DROP_UHID_ALIAS
+	"uf2",
 #else
-	"u2f",
+	"uhid",
 #endif
 	u2f_methods,
 	sizeof(struct u2f_softc)
diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC
index ac0cc4ba74e7..06738a7ed506 100644
--- a/sys/i386/conf/GENERIC
+++ b/sys/i386/conf/GENERIC
@@ -343,4 +343,3 @@ options 	HID_DEBUG		# enable debug msgs
 device		hid			# Generic HID support
 device		hidbus			# Generic HID Bus
 options 	IICHID_SAMPLING		# Workaround missing GPIO INTR support
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64
index 48f9df5b7e38..91c91d58d058 100644
--- a/sys/powerpc/conf/GENERIC64
+++ b/sys/powerpc/conf/GENERIC64
@@ -293,4 +293,3 @@ device          virtio_balloon          # VirtIO Memory Balloon device
 options 	HID_DEBUG		# enable debug msgs
 device		hid			# Generic HID support
 device		hidbus			# Generic HID Bus
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE
index 9af71f30626d..5fb9715de655 100644
--- a/sys/powerpc/conf/GENERIC64LE
+++ b/sys/powerpc/conf/GENERIC64LE
@@ -274,4 +274,3 @@ device          virtio_balloon          # VirtIO Memory Balloon device
 options 	HID_DEBUG		# enable debug msgs
 device		hid			# Generic HID support
 device		hidbus			# Generic HID Bus
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC
index 2ff711e80127..a8500fe80019 100644
--- a/sys/riscv/conf/GENERIC
+++ b/sys/riscv/conf/GENERIC
@@ -132,7 +132,6 @@ device		umass			# Disks/Mass storage - Requires scbus and da
 options 	HID_DEBUG	# enable debug msgs
 device		hid		# Generic HID support
 device		hidbus		# Generic HID Bus
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
 
 # Serial (COM) ports
 device		uart		# Generic UART driver



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202509250755.58P7tQoP060960>