diff options
author | Vladimir Kondratyev <wulf@FreeBSD.org> | 2018-08-13 19:05:53 +0000 |
---|---|---|
committer | Vladimir Kondratyev <wulf@FreeBSD.org> | 2018-08-13 19:05:53 +0000 |
commit | 48f2b006486019a1a238238ba32875a2c1ce16a0 (patch) | |
tree | 4f6588852eec9128bcf6be3014baa737f7935c65 /sys/dev/kbdmux | |
parent | 911aed94fa3a6b7c99aae26c48c0724ada8ab787 (diff) | |
download | src-48f2b006486019a1a238238ba32875a2c1ce16a0.tar.gz src-48f2b006486019a1a238238ba32875a2c1ce16a0.zip |
evdev: Remove evdev.ko linkage dependency on kbd driver
Move evdev_ev_kbd_event() helper from evdev to kbd.c as otherwise evdev
unconditionally requires all keyboard and console stuff to be compiled
into the kernel. This dependency happens as evdev_ev_kbd_event() helper
references kbdsw global variable defined in kbd.c through use of
kbdd_ioctl() macro.
While here make all keyboard drivers respect evdev_rcpt_mask while setting
typematic rate and LEDs with evdev interface.
Requested by: Milan Obuch <bsd@dino.sk>
Reviewed by: hselasky, gonzo
Differential Revision: https://reviews.freebsd.org/D16614
Notes
Notes:
svn path=/head/; revision=337721
Diffstat (limited to 'sys/dev/kbdmux')
-rw-r--r-- | sys/dev/kbdmux/kbdmux.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index 4c6381dc850d..f17634c8879b 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -384,8 +384,10 @@ static keyboard_switch_t kbdmuxsw = { }; #ifdef EVDEV_SUPPORT +static evdev_event_t kbdmux_ev_event; + static const struct evdev_methods kbdmux_evdev_methods = { - .ev_event = evdev_ev_kbd_event, + .ev_event = kbdmux_ev_event, }; #endif @@ -1390,6 +1392,22 @@ kbdmux_poll(keyboard_t *kbd, int on) return (0); } +#ifdef EVDEV_SUPPORT +static void +kbdmux_ev_event(struct evdev_dev *evdev, uint16_t type, uint16_t code, + int32_t value) +{ + keyboard_t *kbd = evdev_get_softc(evdev); + + if (evdev_rcpt_mask & EVDEV_RCPT_KBDMUX && + (type == EV_LED || type == EV_REP)) { + mtx_lock(&Giant); + kbd_ev_event(kbd, type, code, value); + mtx_unlock(&Giant); + } +} +#endif + /***************************************************************************** ***************************************************************************** ** Module |