summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-03-12 20:24:16 +0000
committerderaadt <deraadt@openbsd.org>2015-03-12 20:24:16 +0000
commite6c97730e0b6d8f2edf008a6171ed2f078bd45c9 (patch)
tree0bdce29b00199aca8e3644d6a3265ba3cbd03d89
parentUse poll(2) instead of select(2). A pointer to the struct pollfd (diff)
downloadwireguard-openbsd-e6c97730e0b6d8f2edf008a6171ed2f078bd45c9.tar.xz
wireguard-openbsd-e6c97730e0b6d8f2edf008a6171ed2f078bd45c9.zip
If while attaching pckbdc device slots, we find a slot has failed to
attach and it happens to be the AUX port, aha: we are a kernel without the pms driver. In that case, we should reset that pms back into 'stupid mode'. It seems some BIOS initialize newer-style nubbins/touchpads into strange (advanced) modes, which can muddle up the pckbc pipe. This is experienced as 10-second typing pauses and strange repeat behaviour on the RAMDISK, but was eventually tied to "lightly brushing" the touchpad... work done at s2k15 with jcs
-rw-r--r--sys/dev/ic/pckbc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c
index bbdec9ddb04..471d5fbcbc1 100644
--- a/sys/dev/ic/pckbc.c
+++ b/sys/dev/ic/pckbc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pckbc.c,v 1.43 2014/12/19 07:23:57 deraadt Exp $ */
+/* $OpenBSD: pckbc.c,v 1.44 2015/03/12 20:24:16 deraadt Exp $ */
/* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */
/*
@@ -41,6 +41,7 @@
#include <dev/ic/i8042reg.h>
#include <dev/ic/pckbcvar.h>
+#include <dev/pckbc/pmsreg.h>
#include "pckbd.h"
@@ -277,6 +278,12 @@ pckbc_attach_slot(struct pckbc_softc *sc, pckbc_slot_t slot, int force)
if (t->t_slotdata[slot] == NULL)
return 0;
pckbc_init_slotdata(t->t_slotdata[slot]);
+ } else if (!found && slot == PCKBC_AUX_SLOT) {
+ u_char cmd[1] = { PMS_RESET };
+
+ (void) pckbc_poll_cmd(t, PCKBC_AUX_SLOT, cmd, sizeof cmd,
+ 0, NULL, 1);
+ pckbc_slot_enable(t, PCKBC_AUX_SLOT, 0);
}
return (found);
}