Re: /dev/psaux troubles with 2.2.2

Ralf Corsepius (corsepiu@faw.uni-ulm.de)
Wed, 17 Mar 1999 14:51:14 +0100


Vojtech Pavlik wrote:

> On Wed, Mar 17, 1999 at 12:57:40PM +0100, Ralf Corsepius wrote:
>
> > If somebody provides me with a piece of code, I would be willing to
> > help/try/test.
>
> Try this:
>
> --- pc_keyb.c.orig Wed Mar 17 12:58:51 1999
> +++ pc_keyb.c Wed Mar 17 13:01:07 1999
> @@ -753,11 +753,8 @@
> outb(0x5a, KBD_DATA_REG); /* 0x5a is a random dummy value. */
>
> do {
> - unsigned char status = inb(KBD_STATUS_REG);
> -
> - if (status & KBD_STAT_OBF) {
> - (void) inb(KBD_DATA_REG);
> - if (status & KBD_STAT_MOUSE_OBF) {
> + if (inb(KBD_STATUS_REG) & KBD_STAT_OBF) {
> + if (inb(KBD_DATA_REG) == 0x5a) {
> printk(KERN_INFO "Detected PS/2 Mouse Port.\n");
> retval = 1;
> }
>

Nope, this doesn't work.

As I wrote in one of my previous mails, after the first call to
inb(KBD_STATUS_REG),

"status" = 0x16 (==KBD_STAT_UNLOCKED | KDB_STAT_SELFTEST | KDB_STAT_IBF)

Subsequent calls to inb(KBD_STATUS_REG) within the while(--loops)-loop return
"status" = 0x14 (==KBD_STAT_UNLOCKED | KDB_STAT_SELFTEST )

=> KDB_STAT_OBF is set, therefore all subsequent checks are never reached.

Perhaps this gives some insight on is going wrong.

Ralf.

--
Ralf Corsepius
Forschungsinstitut fuer Anwendungsorientierte Wissensverarbeitung (FAW)
Helmholtzstr. 16, 89081 Ulm, Germany     Tel: +49/731/501-8690
mailto:corsepiu@faw.uni-ulm.de           FAX: +49/731/501-999
http://www.faw.uni-ulm.de

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/