[Pkg-gpm-devel] Bug#306950: gpm: incorrect mouse setup/detection

temnota@kmv.ru "temnota@kmv.ru" <temnota@kmv.ru>, 306950@bugs.debian.org
Fri, 29 Apr 2005 19:28:54 +0400


--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: gpm
Version: 1.19.6-19
Severity: important
Tags: patch

Hello.
Currently, gpm incorrectly setup mouse sample rate and this affected to 
mouse type detection.

Long description:
When mouse type set to 'autops2' gpm attempt to detect mouse type. Before
request identification from mice, gpm try set sample rate, but incorrectly.
gpm write two byte command and read ONLY one ACK from mice but when command
is two byte length - should read two ACK's (one from command, one from data).
Missed (unreaded) ACK stay in mice buffer and read_mouse_id() read ACK (0x0FA)
instead of mice ident (0x04) byte.

Attached patch fix this problem.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.30
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)

Versions of packages gpm depends on:
ii  debconf [debconf-2.0]       1.4.30.11    Debian configuration management sy
ii  debianutils                 2.8.4        Miscellaneous utilities specific t
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an
ii  libncurses5                 5.4-4        Shared libraries for terminal hand
ii  ucf                         1.13         Update Configuration File: preserv

-- debconf information:
* gpm/responsiveness: 15
* gpm/repeat_type: ms3
* gpm/append:
* gpm/restart: true
* gpm/sample_rate: 200
* gpm/device: /dev/psaux
* gpm/restart_default: true
* gpm/type: exps2

--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="gpm-mice-fix.diff"

--- gpm-1.19.6/src/mice.c.orig	2005-04-29 17:21:52.000000000 +0400
+++ gpm-1.19.6/src/mice.c	2005-04-29 19:02:32.000000000 +0400
@@ -1855,7 +1921,7 @@
     rate = 100;
   }
 
-  if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, 1, -1)) {
+  if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, 2, -1)) { 
     gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate.");
     return (NULL);
   }

--T4sUOijqQbZv57TR--