in UKC; found the hard way by jakemsr@ on an old Tecra laptop.
-.\" $OpenBSD: pckbc.4,v 1.15 2007/08/01 21:23:26 miod Exp $
+.\" $OpenBSD: pckbc.4,v 1.16 2010/07/21 20:10:14 miod Exp $
.\" $NetBSD: pckbc.4,v 1.2 2000/06/16 06:42:31 augustss Exp $
.\"
.\" Copyright (c) 1999
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: August 1 2007 $
+.Dd $Mdocdate: July 21 2010 $
.Dt PCKBC 4
.Os
.Sh NAME
.Nm pckbc
.Nd PC (ISA) keyboard controller driver
.Sh SYNOPSIS
-.Cd "pckbc* at isa? " Pq "alpha, amd64, i386"
-.Cd "pckbc* at ebus? " Pq "sparc64"
+.Cd "pckbc* at isa? flags 0x00 " Pq "alpha, amd64, i386, loongson"
+.Cd "pckbc* at ebus? " Pq "sparc64"
.Cd "pckbd* at pckbc?"
.Cd "pms* at pckbc?"
.Cd "pmsi* at pckbc?"
.\" logical slots.
.\" This feature is for experimentation only, it will not be
.\" useful in normal operation.
+.Pp
+To avoid attaching a phantom PS/2 keyboard device, the
+.Nm
+driver will attempt to detect USB legacy keyboard emulation on amd64 and i386
+systems.
+Unfortunately, the detection heuristics may fail on older systems with a real
+PS/2 keyboard.
+The keyboard can be forced to attach on these systems, by changing the
+device flags to 1.
.Sh SEE ALSO
.Xr ebus 4 ,
.Xr intro 4 ,
.Xr isa 4 ,
.Xr pckbd 4 ,
.Xr pms 4 ,
-.Xr pmsi 4
+.Xr pmsi 4 ,
+.Xr ukc 8
-# $OpenBSD: GENERIC,v 1.292 2010/07/03 03:59:16 krw Exp $
+# $OpenBSD: GENERIC,v 1.293 2010/07/21 20:10:17 miod Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
option WSDISPLAY_DEFAULTSCREENS=6 # initial number of text consoles
option WSDISPLAY_COMPAT_PCVT # emulate some ioctls; needed for X11
-pckbc0 at isa? # PC keyboard controller
+pckbc0 at isa? flags 0x00 # PC keyboard controller
pckbd* at pckbc? # PC keyboard
pms* at pckbc? # PS/2 mouse for wsmouse
pmsi* at pckbc? # PS/2 "Intelli"mouse for wsmouse
-# $OpenBSD: GENERIC,v 1.688 2010/07/05 22:20:22 tedu Exp $
+# $OpenBSD: GENERIC,v 1.689 2010/07/21 20:10:17 miod Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
option WSDISPLAY_DEFAULTSCREENS=6 # initial number of text consoles
option WSDISPLAY_COMPAT_PCVT # emulate some ioctls; needed for X11
-pckbc0 at isa? # PC keyboard controller
+pckbc0 at isa? flags 0x00 # PC keyboard controller
pckbd* at pckbc? # PC keyboard
pms* at pckbc? # PS/2 mouse for wsmouse
pmsi* at pckbc? # PS/2 "Intelli"mouse for wsmouse
-/* $OpenBSD: pckbc_ebus.c,v 1.10 2008/07/29 04:20:35 miod Exp $ */
+/* $OpenBSD: pckbc_ebus.c,v 1.11 2010/07/21 20:10:17 miod Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
psc->id = t;
printf("\n");
- pckbc_attach(psc);
+ pckbc_attach(psc, 0);
}
int
-/* $OpenBSD: pckbc.c,v 1.21 2010/01/12 20:31:22 drahn Exp $ */
+/* $OpenBSD: pckbc.c,v 1.22 2010/07/21 20:10:17 miod Exp $ */
/* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */
/*
}
void
-pckbc_attach(sc)
+pckbc_attach(sc, flags)
struct pckbc_softc *sc;
+ int flags;
{
struct pckbc_internal *t;
bus_space_tag_t iot;
haskbd = 1;
}
#endif /* 0 */
- if (haskbd == 0) {
#if defined(__i386__) || defined(__amd64__)
+ if (haskbd == 0 && !ISSET(flags, PCKBCF_FORCE_KEYBOARD_PRESENT)) {
/*
* If there is no keyboard present, yet we are the console,
* we might be on a legacy-free PC where the PS/2 emulated
pckbc_console = 0;
wscn_input_init(1);
}
-#endif
}
+#endif
/*
* Check aux port ok.
-/* $OpenBSD: pckbcvar.h,v 1.7 2008/07/29 04:20:37 miod Exp $ */
+/* $OpenBSD: pckbcvar.h,v 1.8 2010/07/21 20:10:17 miod Exp $ */
/* $NetBSD: pckbcvar.h,v 1.4 2000/06/09 04:58:35 soda Exp $ */
/*
int pckbc_xt_translation(pckbc_tag_t, pckbc_slot_t, int);
void pckbc_slot_enable(pckbc_tag_t, pckbc_slot_t, int);
-void pckbc_attach(struct pckbc_softc *);
+void pckbc_attach(struct pckbc_softc *, int);
int pckbc_cnattach(bus_space_tag_t, bus_addr_t, bus_size_t,
pckbc_slot_t, int);
int pckbc_is_console(bus_space_tag_t, bus_addr_t);
int pckbcintr(void *);
+/*
+ * Device configuration flags (cf_flags).
+ */
+
+#define PCKBCF_FORCE_KEYBOARD_PRESENT 0x0001
+
#endif /* _DEV_IC_PCKBCVAR_H_ */
-/* $OpenBSD: pckbc_isa.c,v 1.5 2007/10/01 15:34:48 krw Exp $ */
+/* $OpenBSD: pckbc_isa.c,v 1.6 2010/07/21 20:10:17 miod Exp $ */
/* $NetBSD: pckbc_isa.c,v 1.2 2000/03/23 07:01:35 thorpej Exp $ */
/*
{
struct pckbc_isa_softc *isc = (void *)self;
struct pckbc_softc *sc = &isc->sc_pckbc;
+ struct cfdata *cf = self->dv_cfdata;
struct isa_attach_args *ia = aux;
struct pckbc_internal *t;
bus_space_tag_t iot;
printf("\n");
/* Finish off the attach. */
- pckbc_attach(sc);
+ pckbc_attach(sc, cf->cf_flags);
}
void
-/* $OpenBSD: pckbd.c,v 1.25 2010/07/08 19:29:25 deraadt Exp $ */
+/* $OpenBSD: pckbd.c,v 1.26 2010/07/21 20:10:17 miod Exp $ */
/* $NetBSD: pckbd.c,v 1.24 2000/06/05 22:20:57 sommerfeld Exp $ */
/*-
* be no PS/2 connector at all; in that case, do not
* even try to attach; ukbd will take over as console.
*/
- if (res == ENXIO)
- return 0;
+ if (res == ENXIO) {
+ /* check cf_flags from parent */
+ struct cfdata *cf = parent->dv_cfdata;
+ if (!ISSET(cf->cf_flags, PCKBCF_FORCE_KEYBOARD_PRESENT))
+ return 0;
+ }
#endif
return (pckbd_is_console(pa->pa_tag, pa->pa_slot) ? 1 : 0);
}