diff options
author | des <des@FreeBSD.org> | 2004-01-27 15:40:30 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2004-01-27 15:40:30 +0000 |
commit | 58a1b901a48dccc815bfbd085b4cc8daa118b51a (patch) | |
tree | 9fff8518ed9e918100890130782bc4b54687ec4f /sys/dev/kbd | |
parent | bcac35718827d251af051ed5c70fee3d96ea4688 (diff) | |
download | FreeBSD-src-58a1b901a48dccc815bfbd085b4cc8daa118b51a.zip FreeBSD-src-58a1b901a48dccc815bfbd085b4cc8daa118b51a.tar.gz |
While USB keyboards attach as ukbd[0-9]+, the device node created by
kbd_attach() is called kbd[0-9]+, with a different unit number. This
makes it impossible to write a devd rule which will automatically
switch to a USB keyboard when one is attached, because there is no way
to guess the correct device node to pass to kbdcontrol.
Therefore, change kbd_attach() to create a device node using the
keyboard device's real name (atkbd0, ukbd0...), and create the
kbd[0-9]+ node as an alias for backward compatibility.
Diffstat (limited to 'sys/dev/kbd')
-rw-r--r-- | sys/dev/kbd/kbd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/kbd/kbd.c b/sys/dev/kbd/kbd.c index f5dd583..f4910e1 100644 --- a/sys/dev/kbd/kbd.c +++ b/sys/dev/kbd/kbd.c @@ -454,7 +454,8 @@ kbd_attach(keyboard_t *kbd) return EINVAL; kbd->kb_dev = make_dev(&kbd_cdevsw, kbd->kb_index, UID_ROOT, GID_WHEEL, 0600, - "kbd%r", kbd->kb_index); + "%s%r", kbd->kb_name, kbd->kb_unit); + make_dev_alias(kbd->kb_dev, "kbd%r", kbd->kb_index); kbd->kb_dev->si_drv1 = malloc(sizeof(genkbd_softc_t), M_DEVBUF, M_WAITOK | M_ZERO); printf("kbd%d at %s%d\n", kbd->kb_index, kbd->kb_name, kbd->kb_unit); |