PERFORCE change 173847 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Thu Jan 28 16:42:39 UTC 2010
http://p4web.freebsd.org/chv.cgi?CH=173847
Change 173847 by hselasky at hselasky_laptop001 on 2010/01/28 16:42:37
USB input:
- fix for leftover key-presses after polling
- patch by: HPS
PR: usb/143286, kern/141011
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/input/ukbd.c#41 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/input/ukbd.c#41 (text+ko) ====
@@ -283,7 +283,8 @@
static int ukbd_enable(keyboard_t *);
static int ukbd_disable(keyboard_t *);
static void ukbd_interrupt(struct ukbd_softc *);
-static int ukbd_is_polling(struct ukbd_softc *sc);
+static int ukbd_is_polling(struct ukbd_softc *);
+static void ukbd_event_keyinput(struct ukbd_softc *);
static device_probe_t ukbd_probe;
static device_attach_t ukbd_attach;
@@ -395,7 +396,6 @@
uint32_t o_mod;
uint32_t now = sc->sc_time_ms;
uint32_t dtime;
- uint32_t c;
uint8_t key;
uint8_t i;
uint8_t j;
@@ -482,6 +482,17 @@
if (sc->sc_inputs == 0)
goto done;
+ ukbd_event_keyinput(sc);
+
+done:
+ return;
+}
+
+static void
+ukbd_event_keyinput(struct ukbd_softc *sc)
+{
+ int c;
+
if (KBD_IS_ACTIVE(&sc->sc_kbd) &&
KBD_IS_BUSY(&sc->sc_kbd)) {
/* let the callback function process the input */
@@ -493,8 +504,6 @@
c = ukbd_read_char(&sc->sc_kbd, 0);
} while (c != NOKEY);
}
-done:
- return;
}
static void
@@ -509,6 +518,9 @@
ukbd_interrupt(sc);
if (ukbd_any_key_pressed(sc)) {
+ if (ukbd_is_polling(sc) == 0)
+ ukbd_event_keyinput(sc);
+
ukbd_start_timer(sc);
} else {
sc->sc_flags &= ~UKBD_FLAG_TIMER_RUNNING;
More information about the p4-projects
mailing list