summaryrefslogtreecommitdiffstats
path: root/sys/dev/atkbdc/atkbdcreg.h
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2010-04-29 06:16:00 +0000
committersobomax <sobomax@FreeBSD.org>2010-04-29 06:16:00 +0000
commit06a2ddb54d82ea81b21f69d0d0944d15949d6be3 (patch)
tree583264584a4cf4664197248680ba013d4951e4f0 /sys/dev/atkbdc/atkbdcreg.h
parenta101ef6559ba33feff4e60757b06a186082bc97d (diff)
downloadFreeBSD-src-06a2ddb54d82ea81b21f69d0d0944d15949d6be3.zip
FreeBSD-src-06a2ddb54d82ea81b21f69d0d0944d15949d6be3.tar.gz
On certain chipsets AT keyboard controller isn't present and is
emulated by BIOS using SMI interrupt. On those chipsets reading from the status port may be thousand times slower than usually. Sometimes this emilation is not working properly resulting in commands timing out and since we assume that inb() operation takes very little time to complete we need to adjust number of retries to keep waiting time within a designed limits (100ms). Measure time it takes to make read_status() call and adjust number of retries accordingly. To keep it simple, use TSC to measure inb() performance and keep it to amd64-only, since TSC may not available on older CPUs. Also enable detection of the AT controller absence on amd64. Reviewed by: jhb MFC after: 1 month
Diffstat (limited to 'sys/dev/atkbdc/atkbdcreg.h')
-rw-r--r--sys/dev/atkbdc/atkbdcreg.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/dev/atkbdc/atkbdcreg.h b/sys/dev/atkbdc/atkbdcreg.h
index 0715d9e..7ea26a6 100644
--- a/sys/dev/atkbdc/atkbdcreg.h
+++ b/sys/dev/atkbdc/atkbdcreg.h
@@ -200,6 +200,7 @@ typedef struct atkbdc_softc {
int lock; /* FIXME: XXX not quite a semaphore... */
kqueue kbd; /* keyboard data queue */
kqueue aux; /* auxiliary data queue */
+ int retry;
} atkbdc_softc_t;
enum kbdc_device_ivar {
OpenPOWER on IntegriCloud