[gpm]Bug with IMPS/2 w/ Microsoft Intellimouse 1.3A on Linux

Shawn Starr spstarr@sh0n.net
17 Jun 2002 11:16:01 -0400


Not totally, I still had this error pop up but much less.

On Sat, 2002-06-15 at 20:48, Pozsar Balazs wrote:
> 
> Hi!
> 
> I had the same problem, and I figured out two things:
> - Sometimes the mouse is confused and imps2 init will fail if I do not
> send a reset to it.
> - moving the mouse before, or during initialization will make it fail.
> 
> The attached patch solved all my problems, so can try it, but this is not
> official :)
> 
> I didn't want to send it yet to the list, but you asked for it :).
> 
> On Sat, 15 Jun 2002, Shawn Starr wrote:
> 
> >
This message
> > === ERROR ===: [/usr/src/other/gpm-1.20.0/src/mice.c(1727)]:
> > imps2: PS/2 mouse failed init
> > === ERROR ===: [/usr/src/other/gpm-1.20.0/src/mice.c(1727)]:
> >
> > When loading gpm and moving the mouse the driver bombs on load. Also,
> > sometimes it will fail with:
> >
--------------------
*NOT* This message
> > === ERROR ===: [/usr/src/other/gpm-1.20.0/src/mice.c(1755)]:
> > imps2: Auto-detected unknown mouse type 250, assuming standard PS/2
> >
> > Options used to load gpm:
> >
> > gpm -m /dev/psaux -t imps2 -b 9600"
> >
> > * Note: For some reason I have to specify baud rate (?)
> >
> > Any ideas? :)
> >
> > Thanks,
> >
> > Shawn Starr, sh0n.net, <spstarr@sh0n.net>
> > Maintainer: -shawn kernel patches: http://xfs.sh0n.net/2.4/
> > Developer Support Engineer
> > Datawire Communication Networks Inc.
> > 10 Carlson Court, Suite 300
> > Toronto, ON, M9W 6L2
> > T: 416.213.2001 ext 179 F: 416.213.2008
> >
> > _______________________________________________
> > gpm mailing list
> > gpm@lists.linux.it
> > http://lists.linux.it/listinfo/gpm
> >
> 
> -- 
> pozsy
> ----
> 

> diff -Naur gpm-1.20.0/src/mice.c gpm-1.20.0-mod/src/mice.c
> --- gpm-1.20.0/src/mice.c	Sat Feb 23 15:42:23 2002
> +++ gpm-1.20.0-mod/src/mice.c	Fri Jun 14 08:22:09 2002
> @@ -1715,9 +1747,17 @@
>                                                         int argc, char **argv)
>  {
>     int id;
> -   static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 };
> +   static unsigned char reset[] = { GPM_AUX_RESET };
> +   static unsigned char basic_init[] = { GPM_AUX_SET_SAMPLE, 100 };
>     static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, };
> -   static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, };
> +   static unsigned char ps2_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, };
> +   unsigned char tmp;
> +
> +   /* Do a reset as some mice seem to need it sometimes
> +      -- hope it doesn't break others */
> +   write(fd, reset, sizeof (reset));
> +   usleep (30000);
> +   do { read(fd, &tmp, 1); } while (tmp != 0x00); // Wait for 0x00
>  
>     /* Do a basic init in case the mouse is confused */
>     write_to_mouse(fd, basic_init, sizeof (basic_init));
-- 
Shawn Starr, sh0n.net, <spstarr@sh0n.net>
Maintainer: -shawn kernel patches: http://xfs.sh0n.net/2.4/
Developer Support Engineer
Datawire Communication Networks Inc.
10 Carlson Court, Suite 300
Toronto, ON, M9W 6L2
T: 416.213.2001 ext 179 F: 416.213.2008