diff options
author | 2020-03-18 22:38:10 +0000 | |
---|---|---|
committer | 2020-03-18 22:38:10 +0000 | |
commit | db8ad24e0aed4adc522504d2686c8f779fe42428 (patch) | |
tree | 65840f0ec5a89acaed1d3526f683fe3811363d01 | |
parent | Add 'ikectl reset id <ID>' command to reset all SAs from policies with (diff) | |
download | wireguard-openbsd-db8ad24e0aed4adc522504d2686c8f779fe42428.tar.xz wireguard-openbsd-db8ad24e0aed4adc522504d2686c8f779fe42428.zip |
1. Run Synaptics touchpads in plain W-mode. 2. Update the AGM-check.
Enabling extended W-mode is unnecessary as long as pms does not process
the additional packets properly.
Thanks to David Demelier for his reports and tests.
ok anton@ mpi@
-rw-r--r-- | sys/dev/pckbc/pms.c | 31 | ||||
-rw-r--r-- | sys/dev/pckbc/pmsreg.h | 6 |
2 files changed, 24 insertions, 13 deletions
diff --git a/sys/dev/pckbc/pms.c b/sys/dev/pckbc/pms.c index fadf658bfde..a1a68c54c5d 100644 --- a/sys/dev/pckbc/pms.c +++ b/sys/dev/pckbc/pms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pms.c,v 1.91 2020/01/22 14:52:14 mpi Exp $ */ +/* $OpenBSD: pms.c,v 1.92 2020/03/18 22:38:10 bru Exp $ */ /* $NetBSD: psm.c,v 1.11 2000/06/05 22:20:57 sommerfeld Exp $ */ /*- @@ -1186,25 +1186,32 @@ pms_enable_synaptics(struct pms_softc *sc) nitems(synaptics_params))) goto err; - printf("%s: Synaptics %s, firmware %d.%d, 0x%x 0x%x\n", + printf("%s: Synaptics %s, firmware %d.%d, " + "0x%x 0x%x 0x%x 0x%x 0x%x\n", DEVNAME(sc), (syn->ext_capabilities & SYNAPTICS_EXT_CAP_CLICKPAD ? "clickpad" : "touchpad"), SYNAPTICS_ID_MAJOR(syn->identify), SYNAPTICS_ID_MINOR(syn->identify), - syn->model, syn->ext_model); + syn->model, syn->ext_model, syn->modes, + syn->capabilities, syn->ext_capabilities); } + /* + * Enable absolute mode, plain W-mode and "advanced gesture mode" + * (AGM), if possible. AGM, which seems to be a prerequisite for the + * extended W-mode, might not always be necessary here, but at least + * some older Synaptics models do not report finger counts without it. + */ mode = SYNAPTICS_ABSOLUTE_MODE | SYNAPTICS_HIGH_RATE; - if (SYNAPTICS_ID_MAJOR(syn->identify) >= 4) - mode |= SYNAPTICS_DISABLE_GESTURE; if (syn->capabilities & SYNAPTICS_CAP_EXTENDED) mode |= SYNAPTICS_W_MODE; + else if (SYNAPTICS_ID_MAJOR(syn->identify) >= 4) + mode |= SYNAPTICS_DISABLE_GESTURE; if (synaptics_set_mode(sc, mode)) goto err; - /* enable advanced gesture mode if supported */ - if ((syn->ext_capabilities & SYNAPTICS_EXT_CAP_ADV_GESTURE) && + if (SYNAPTICS_SUPPORTS_AGM(syn->ext_capabilities) && (pms_spec_cmd(sc, SYNAPTICS_QUE_MODEL) || pms_set_rate(sc, SYNAPTICS_CMD_SET_ADV_GESTURE_MODE))) goto err; @@ -1294,17 +1301,17 @@ pms_proc_synaptics(struct pms_softc *sc) } - if ((syn->capabilities & SYNAPTICS_CAP_PASSTHROUGH) && w == 3) { - synaptics_sec_proc(sc); + if (w == 3) { + if (syn->capabilities & SYNAPTICS_CAP_PASSTHROUGH) + synaptics_sec_proc(sc); return; } if ((sc->sc_dev_enable & PMS_DEV_PRIMARY) == 0) return; - /* XXX ignore advanced gesture packet, not yet supported */ - if ((syn->ext_capabilities & SYNAPTICS_EXT_CAP_ADV_GESTURE) && w == 2) - return; + if (w == 2) + return; /* EW-mode packets are not expected here. */ x = ((sc->packet[3] & 0x10) << 8) | ((sc->packet[1] & 0x0f) << 8) | sc->packet[4]; diff --git a/sys/dev/pckbc/pmsreg.h b/sys/dev/pckbc/pmsreg.h index 07b5da6ab3f..39dd656e276 100644 --- a/sys/dev/pckbc/pmsreg.h +++ b/sys/dev/pckbc/pmsreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmsreg.h,v 1.17 2019/09/20 21:21:47 bru Exp $ */ +/* $OpenBSD: pmsreg.h,v 1.18 2020/03/18 22:38:10 bru Exp $ */ /* $NetBSD: psmreg.h,v 1.1 1998/03/22 15:41:28 drochner Exp $ */ #ifndef SYS_DEV_PCKBC_PMSREG_H @@ -140,8 +140,12 @@ #define SYNAPTICS_EXT_CAP_ADV_GESTURE (1 << 19) #define SYNAPTICS_EXT_CAP_MAX_COORDS (1 << 17) #define SYNAPTICS_EXT_CAP_MIN_COORDS (1 << 13) +#define SYNAPTICS_EXT_CAP_REPORTS_V (1 << 11) #define SYNAPTICS_EXT_CAP_CLICKPAD_2BTN (1 << 8) +#define SYNAPTICS_SUPPORTS_AGM(extcaps) ((extcaps) & \ + (SYNAPTICS_EXT_CAP_ADV_GESTURE | SYNAPTICS_EXT_CAP_REPORTS_V)) + /* Coordinate Limits */ #define SYNAPTICS_X_LIMIT(d) ((((d) & 0xff0000) >> 11) | \ (((d) & 0xf00) >> 7)) |