diff options
author | kstailey <kstailey@cvs.openbsd.org> | 1997-08-29 22:49:07 +0000 |
---|---|---|
committer | kstailey <kstailey@cvs.openbsd.org> | 1997-08-29 22:49:07 +0000 |
commit | 95a317397f8879d49460fad2b249928eaf4041e0 (patch) | |
tree | db134fa4f68f6b0332b490dadee9b411254558cb | |
parent | 4ae4ca31d118046952c54279bc6b91a188b9cdde (diff) |
Print "IntelliMouse" at probe time if "option INTELLIMOUSE" is in da house.
Move init code to pmsopen() since pmsclose() clobbers it.
-rw-r--r-- | sys/arch/i386/isa/pms.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/sys/arch/i386/isa/pms.c b/sys/arch/i386/isa/pms.c index 18997ff763a..acaaf291f4a 100644 --- a/sys/arch/i386/isa/pms.c +++ b/sys/arch/i386/isa/pms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pms.c,v 1.16 1997/08/29 22:40:16 kstailey Exp $ */ +/* $OpenBSD: pms.c,v 1.17 1997/08/29 22:49:06 kstailey Exp $ */ /* $NetBSD: pms.c,v 1.29 1996/05/12 23:12:42 mycroft Exp $ */ /*- @@ -222,30 +222,17 @@ pmsattach(parent, self, aux) int irq = self->dv_cfdata->cf_loc[0]; isa_chipset_tag_t ic = aux; /* XXX */ - printf(" irq %d\n", irq); + printf(" irq %d", irq); +#ifdef INTELLIMOUSE + printf(": IntelliMouse"); +#endif + printf("\n"); /* Other initialization was done by pmsprobe. */ sc->sc_state = 0; sc->sc_ih = isa_intr_establish(ic, irq, IST_EDGE, IPL_TTY, pmsintr, sc, sc->sc_dev.dv_xname); - -#ifdef INTELLIMOUSE - /* The Micro$oft IntelliMouse has a wheel that you can turn or - * click stuck in between the left and right buttons. - * By default this mouse acts like a two-button PS/2 mouse. - * If you set the sampling rate to 200, then 100, then 80 - * it changes to a 4-byte-per-packet format and the wheel - * acts like a middle button if you click it. Turing the - * wheel modifies the fourth byte in the packet. - */ - pms_dev_cmd(PMS_SET_SAMPLE); - pms_dev_cmd(200); /* 200 samples/sec */ - pms_dev_cmd(PMS_SET_SAMPLE); - pms_dev_cmd(100); /* 100 samples/sec */ - pms_dev_cmd(PMS_SET_SAMPLE); - pms_dev_cmd(80); /* 80 samples/sec */ -#endif } int @@ -286,6 +273,22 @@ pmsopen(dev, flag, mode, p) pms_dev_cmd(100); /* 100 samples/sec */ pms_dev_cmd(PMS_SET_STREAM); #endif +#ifdef INTELLIMOUSE + /* The Micro$oft IntelliMouse has a wheel that you can turn or + * click stuck in between the left and right buttons. + * By default this mouse acts like a two-button PS/2 mouse. + * If you set the sampling rate to 200, then 100, then 80 + * it changes to a 4-byte-per-packet format and the wheel + * acts like a middle button if you click it. Turing the + * wheel modifies the fourth byte in the packet. + */ + pms_dev_cmd(PMS_SET_SAMPLE); + pms_dev_cmd(200); /* 200 samples/sec */ + pms_dev_cmd(PMS_SET_SAMPLE); + pms_dev_cmd(100); /* 100 samples/sec */ + pms_dev_cmd(PMS_SET_SAMPLE); + pms_dev_cmd(80); /* 80 samples/sec */ +#endif pms_pit_cmd(PMS_INT_ENABLE); return 0; |