Subject: wsmux inject
To: None <>
From: Iain Hibbert <>
List: tech-kern
Date: 03/13/2006 22:07:35
  looking to inject events into wsmux from userland - have opened
"/dev/wsconsctl0" (wsmouse) and "/dev/wsconsctl1" (wskbd) for writing, and
injecting mouse events works fine, but keyboard events are vanishing in
the kernel. After enabling wsmux_debug, I get this:

wsmux_do_ioctl: wsmux1: enter sc=0xc091d100, cmd=80105760
wsmux1: inject
wsmux_do_ioctl: event ignored

which seems to be because

		/* Inject an event, e.g., from moused. */
		DPRINTF(("%s: inject\n", sc->sc_base.me_dv.dv_xname));

		evar = sc->sc_base.me_evp;
		if (evar == NULL) {
			/* No event sink, so ignore it. */
			DPRINTF(("wsmux_do_ioctl: event ignored\n"));
			return (0);

So, how can I make this event sink, is it somehow related to wscons
configuration?  I have tried a few things but no joy.. relevant parts of
dmesg seem to be:

wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
ums0 at uhidev0: 3 buttons and Z dir.
wsmouse1 at ums0 mux 0
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)

and X is running on screen 5.  I have tried a few variations on the theme
in my kernel config, the relevant parts of which seem to be:

pckbc0		at isa?			# pc keyboard controller
pckbd*		at pckbc?		# PC keyboard
pms*		at pckbc?		# PS/2 mouse for wsmouse
wsdisplay*	at vga? console ? kbdmux 1
wskbd* 		at pckbd? console ? mux 1
wsmouse*	at pms? mux 0
ums*		at uhidev? reportid ?
wsmouse*	at ums? mux 0
ukbd*		at uhidev? reportid ?
wskbd*		at ukbd? console ? mux 1
pseudo-device	wsmux			# mouse & keyboard multiplexor
pseudo-device	wsfont

..any clues there?