summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorphilip <philip@FreeBSD.org>2005-01-03 13:19:49 +0000
committerphilip <philip@FreeBSD.org>2005-01-03 13:19:49 +0000
commit7b194f5bb6367a22fc2f31752a2362d4dfb5145c (patch)
treef2897cc01443382feceada16fc93424122ffa783 /sys/dev
parent6ea7cec670073503257352c3158d36f47bcf0feb (diff)
downloadFreeBSD-src-7b194f5bb6367a22fc2f31752a2362d4dfb5145c.zip
FreeBSD-src-7b194f5bb6367a22fc2f31752a2362d4dfb5145c.tar.gz
Reduce diffs to work in progress before checking in serious changes.
o Move the sysctls under debug.psm.* and hw.psm.* making them a bit clearer and more consistent with other drivers. o Remove the debug.psm_soft_timeout sysctl. It was introduced many moons ago in r1.64 but never referenced anywhere. o Introduce hw.psm.tap_threshold and hw.psm.tap_timeout to control the behaviour of taps on touchpads. People might like to fiddle with these if tapping seems to slow or too fast for them. o Add debug.psm.loglevel as a tunable so that verbosity can be set easily at boot-time (to watch probes and such) without having to compile a kernel with options PSM_DEBUG=N.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/atkbdc/psm.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c
index c38a114..bd96dbc 100644
--- a/sys/dev/atkbdc/psm.c
+++ b/sys/dev/atkbdc/psm.c
@@ -237,6 +237,9 @@ static devclass_t psm_devclass;
static int synaptics_support = 0;
TUNABLE_INT("hw.psm.synaptics_support", &synaptics_support);
+static int verbose = PSM_DEBUG;
+TUNABLE_INT("debug.psm.loglevel", &verbose);
+
/* for backward compatibility */
#define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t)
#define OLD_MOUSE_GETMODE _IOR('M', 2, old_mousemode_t)
@@ -382,9 +385,6 @@ static struct cdevsw psm_cdevsw = {
.d_name = PSM_DRIVER_NAME,
};
-/* debug message level */
-static int verbose = PSM_DEBUG;
-
/* device I/O routines */
static int
enable_aux_dev(KBDC kbdc)
@@ -2009,28 +2009,29 @@ psmtimeout(void *arg)
sc->callout = timeout(psmtimeout, (void *)(uintptr_t)sc, hz);
}
-static int psmhz = 20;
-SYSCTL_INT(_debug, OID_AUTO, psmhz, CTLFLAG_RW, &psmhz, 0, "");
+/* Add all sysctls under the debug.psm and hw.psm nodes */
+SYSCTL_NODE(_debug, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse");
+SYSCTL_NODE(_hw, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse");
-static int psm_soft_timeout = 500000; /* 0.5 sec */
-SYSCTL_INT(_debug, OID_AUTO, psm_soft_timeout, CTLFLAG_RW,
- &psm_soft_timeout, 0, "");
+SYSCTL_INT(_debug_psm, OID_AUTO, loglevel, CTLFLAG_RW, &verbose, 0, "");
+static int psmhz = 20;
+SYSCTL_INT(_debug_psm, OID_AUTO, hz, CTLFLAG_RW, &psmhz, 0, "");
static int psmerrsecs = 2;
-SYSCTL_INT(_debug, OID_AUTO, psmerrsecs, CTLFLAG_RW, &psmerrsecs, 0, "");
+SYSCTL_INT(_debug_psm, OID_AUTO, errsecs, CTLFLAG_RW, &psmerrsecs, 0, "");
static int psmerrusecs = 0;
-SYSCTL_INT(_debug, OID_AUTO, psmerrusecs, CTLFLAG_RW, &psmerrusecs, 0, "");
+SYSCTL_INT(_debug_psm, OID_AUTO, errusecs, CTLFLAG_RW, &psmerrusecs, 0, "");
static int psmsecs = 0;
-SYSCTL_INT(_debug, OID_AUTO, psmsecs, CTLFLAG_RW, &psmsecs, 0, "");
+SYSCTL_INT(_debug_psm, OID_AUTO, secs, CTLFLAG_RW, &psmsecs, 0, "");
static int psmusecs = 500000;
-SYSCTL_INT(_debug, OID_AUTO, psmusecs, CTLFLAG_RW, &psmusecs, 0, "");
-
-static int psmpkterrthresh = 2;
-SYSCTL_INT(_debug, OID_AUTO, psmpkterrthresh, CTLFLAG_RW,
- &psmpkterrthresh, 0, "");
-
-SYSCTL_INT(_debug, OID_AUTO, psmloglevel, CTLFLAG_RW, &verbose, 0, "");
+SYSCTL_INT(_debug_psm, OID_AUTO, usecs, CTLFLAG_RW, &psmusecs, 0, "");
+static int pkterrthresh = 2;
+SYSCTL_INT(_debug_psm, OID_AUTO, pkterrthresh, CTLFLAG_RW, &pkterrthresh, 0, "");
+static int tap_threshold = PSM_TAP_THRESHOLD;
+SYSCTL_INT(_hw_psm, OID_AUTO, tap_threshold, CTLFLAG_RW, &tap_threshold, 0, "");
+static int tap_timeout = PSM_TAP_TIMEOUT;
+SYSCTL_INT(_hw_psm, OID_AUTO, tap_timeout, CTLFLAG_RW, &tap_timeout, 0, "");
static void
psmintr(void *arg)
@@ -2095,7 +2096,7 @@ psmintr(void *arg)
++sc->syncerrors;
sc->lastinputerr = now;
if (sc->syncerrors >= sc->mode.packetsize * 2 ||
- sc->pkterrors >= psmpkterrthresh) {
+ sc->pkterrors >= pkterrthresh) {
/*
* If we've failed to find a single sync byte in 2
OpenPOWER on IntegriCloud