[gpm]Driver for Vivanco AGM5420X Mouse

Gerrit Riessen gerrit.riessen@web.de
Thu, 22 May 2003 13:49:48 +0200


This is a MIME encoded message.
--STEFAN3eccb95c6b08
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hello,

i've written a driver for my vivanco mouse which was having
problems running under all ps/2 mouses.

in the end, the problem was that the mouse wasn't consistently
sending 4 byte packets and the driver (M_viv) keeps a copy
of old packets and uses new packets to complete the old
ones ....

it seems to work, i.e. the mouse does not spring around the place :-),
also works with the ms3 repeater (the imps2 repeater worked for a
while, then suddenly decided not to work [mouse stayed put in the
top right hand corner]) under XFree v3.3.6a.

The patch is for the 1.20.1 release of gpm.

ciao, Gerrit


______________________________________________________________________________
UNICEF bittet um Spenden fur die Kinder im Irak! Hier online an
UNICEF spenden: https://spenden.web.de/unicef/special/?mc=021101
--STEFAN3eccb95c6b08
Content-Type: application/octet-stream; name="vivanco.patch"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="vivanco.patch"

KioqIC93d3cvZGV2ZWxvcG1lbnQvc3JjL2dwbS0xLjIwLjEvc3JjL21pY2UuYwlTYXQgTWF5
IDE3IDIwOjUwOjI5IDIwMDMKLS0tIHNyYy9taWNlLmMJVHVlIERlYyAyNCAyMzo1NzoxNiAy
MDAyCioqKioqKioqKioqKioqKgoqKiogNjI3LDk5OCAqKioqCiAgfQogIAotIAotIHN0YXRp
YyBpbnQgTV92aXYoIEdwbV9FdmVudCAqc3RhdGUsIHVuc2lnbmVkIGNoYXIgKmRhdGEgKSAK
LSB7Ci0gICAgLyoqIAotICAgICAgIFNwZWNpZmljIGhhbmRsZXIgZm9yIFZpdmFuY28gbW91
c2UgQUdNNTQyMFguIAotIAotICAgICAgIC0tIEdlcnJpdCBSaWVzc2VuIDxnZXJyaXQucmll
c3NlbkBvcGVuLXNvdXJjZS1jb25zdWx0YW50cy5kZT4KLSAgICAqKi8KLSAKLSAgIC8qKgot
ICAgICAgVGhlIFZpdmFuY28gZ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GFzc3VtZSBkYXRhWzBdIG9yIGRhdGFbMV0gaXMgdGhlIGNv
cnJlY3QgY29udHJvbCBieXRlICoqLwotICAgICAgICAgICAgIGNiX2xvYyA9ICggSVNfQ0Io
ZGF0YVswXSkgPyAwIDogMSApOwotICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgIGNh
c2UgMjoKLSAgICAgICAgICAgICAvKiogYXNzdW1lIHRoYXQgZGF0YVsyXSBpcyBjb3JyZWN0
IGNvbnRyb2wgYnl0ZSwgdGhpcyBtZWFucwotICAgICAgICAgICAgICAgICB3ZSdyZSBnb2lu
ZyBmcm9tIDIgdG8gMiAqKi8KLSAgICAgICAgICAgICBjYl9sb2MgPSAyOwotICAgICAgICAg
ICAgIGJyZWFrOwotICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICBjYl9sb2MgPSAy
OyAvKiogZ29pbmcgZnJvbSAzIHRvIDIsIHRoaXMgaXMgYW4gRVJST1IgYnV0Ci0gICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIHdlIGNhbid0IHByZXZlbnQgaXQgKiovCi0gICAgICAg
ICAgfQotICAgICAgICAgIGJyZWFrOwotIAotICAgICAgIGNhc2UgMzogLyoqIGRhdGFbM10g
aXMgb25lIGNvbnRyb2wgYnl0ZSwgdGhlIG90aGVyIGlzIHVua25vd24gKiovCi0gICAgICAg
ICAgc3dpdGNoICggb2xkX2NiX2xvYyApIHsKLSAgICAgICAgICBjYXNlIC0xOgotICAgICAg
ICAgIGNhc2UgMDoKLSAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgaWYgKCBJU19D
QiggZGF0YVswXSApICkgewotICAgICAgICAgICAgICAgIGNiX2xvYyA9IDA7Ci0gICAgICAg
ICAgICAgfSBlbHNlIGlmICggSVNfQ0IoIGRhdGFbMV0gKSApIHsKLSAgICAgICAgICAgICAg
ICBjYl9sb2MgPSAxOwotICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAg
Ly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m8gKiovCi0gICAgICAgLyoq
IGdvaW5nIGZyb20gMCwxLDIsMyB0byAwICoqLwotICAgICAgIC8qIG5ldyBjYiBsb2NhdGlv
biBpcyB6ZXJvLCBpLmUuIG5vcm1hbCBwYWNrZXQsIHRoZW4gaWdub3JlIAotICAgICAgICAg
IGFueSBwZW5kaW5nIHBhY2tldCAqLwotICAgICAgIGNiID0gZGF0YVswXTsKLSAgICAgICBj
b29yZF94ID0gZGF0YVsxXTsKLSAgICAgICBjb29yZF95ID0gZGF0YVsyXTsKLSAgICAgICB3
aGVlbF9kaXIgPSBkYXRhWzNdOwotICAgICAgIG9sZF9jYl9sb2MgPSAwOwotICAgICAgIGJy
ZWFrOwotIAotICAgIGNhc2UgMTogLyoqIENCIGxvY2F0aW9uIG9uZSAqKi8KLSAgICAgICBz
d2l0Y2ggKCBvbGRfY2JfbG9jICkgewotICAgICAgIGNhc2UgMTogLyoqIGdvaW5nIGZyb20g
MSB0byAxICoqLwotICAgICAgICAgIGNiID0gb2xkX2NiOwotICAgICAgICAgIGNvb3JkX3gg
PSBvbGRfY29vcmRfeDsKLSAgICAgICAgICBjb29yZF95ID0gb2xkX2Nvb3JkX3k7Ci0gICAg
ICAgICAgd2hlZWxfZGlyID0gZGF0YVswXTsKLSAgICAgICAgICBvbGRfY2IgPSBkYXRhWzFd
OwotICAgICAgICAgIG9sZF9jb29yZF94ID0gZGF0YVsyXTsKLSAgICAgICAgICBvbGRfY29v
cmRfeSA9IGRhdGFbM107Ci0gICAgICAgICAgb2xkX2NiX2xvYyA9IDE7Ci0gICAgICAgICAg
YnJlYWs7Ci0gICAgICAgY2FzZSAtMTogLyoqIG5vbmUgcGVuZGluZyB0byAxICoqLwotICAg
ICAgIGNhc2UgMDogLyoqIGdvaW5nIGZyb20gMCB0byAxICoqLwotICAgICAgIGNhc2UgMjog
LyoqIGdvaW5nIGZyb20gMiB0byAxICoqLwotICAgICAgIGNhc2UgMzogLyoqIGdvaW5nIGZy
b20gMyB0byAxICoqL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gICAgICAgb2xkX2NiX2xvYywgY2Jf
bG9jICk7Ci0gCi0gICAgICAgICAgb2xkX2NiX2xvYyA9IDI7Ci0gICAgICAgICAgcmV0dXJu
IC0xOwotICAgICAgIGNhc2UgMTogLyoqIGdvaW5nIGZyb20gMSB0byAyICoqLwotICAgICAg
ICAgIGNiID0gb2xkX2NiOwotICAgICAgICAgIG9sZF9jYiA9IGRhdGFbMl07Ci0gICAgICAg
ICAgY29vcmRfeCA9IG9sZF9jb29yZF94OwotICAgICAgICAgIGNvb3JkX3kgPSBvbGRfY29v
cmRfeTsKLSAgICAgICAgICB3aGVlbF9kaXIgPSBkYXRhWzFdOwotICAgICAgICAgIG9sZF9j
b29yZF94ID0gZGF0YVszXTsKLSAgICAgICAgICBvbGRfY2JfbG9jID0gMjsKLSAgICAgICAg
ICAvKiogaWdub3JlIGRhdGFbMF0gYmVjYXVzZSBpdCBzZWVtcyB0byBiZSBleHRyYSAqKi8K
LSAgICAgICAgICBicmVhazsKLSAgICAgICBjYXNlIDI6IC8qKiBnb2luZyBmcm9tIDIgdG8g
MiAqKi8KLSAgICAgICAgICBjYiA9IG9sZF9jYjsKLSAgICAgICAgICBvbGRfY2IgPSBkYXRh
WzJdOwotICAgICAgICAgIGNvb3JkX3ggPSBvbGRfY29vcmRfeDsKLSAgICAgICAgICBjb29y
ZF95ID0gZGF0YVswXTsKLSAgICAgICAgICB3aGVlbF9kaXIgPSBkYXRhWzFdOwotICAgICAg
ICAgIG9sZF9jb29yZF94ID0gZGF0YVszXTsKLSAgICAgICAgICBvbGRfY2JfbG9jID0gMjsK
LSAgICAgICAgICBicmVhazsKLSAgICAgICB9Ci0gICAgICAgYnJlYWs7Ci0gCi0gICAgY2Fz
ZSAzOiAvKiogQ0IgbG9jYXRpb24gdGhyZWUgKiovCi0gCi0gICAgICAgc3dpdGNoICggb2xk
X2NiX2xvYyApIHsKLSAgICAgICBjYXNlIC0xOiAvKiogbm9uZSBwZW5kaW5nIHRvIDMgKiov
Ci0gICAgICAgY2FzZSAwOiAvKiogZ29pbmcgZnJvbSAwIHRvIDMgKiovCi0gICAgICAgICAg
b2xkX2NiID0gZGF0YVszXTsKLSAKLSAgICAgICAgICBncG1fcmVwb3J0KCBfX0xJTkVfXyxf
X0ZJTEVfXyxHUE1fU1RBVF9ERUJVRywgCi0gICAgICAgICAgICAgICAgICAgICAgIlZpdjog
REFUQSBFUlJPUjogZ29pbmcgZnJvbSAlZCB0byAlZCIsCi0gICAgICAgICAgICAgICAgICAg
ICAgb2xkX2NiX2xvYywgY2JfbG9jICk7Ci0gCi0gICAgICAgICAgb2xkX2NiX2xvYyA9IDM7
Ci0gICAgICAgICAgcmV0dXJuIC0xOwotICAgICAgIGNhc2UgMTogLyoqIGdvaW5nIGZyb20g
MSB0byAzICoqLwotICAgICAgICAgIGNiID0gb2xkX2NiOwotICAgICAgICAgIG9sZF9jYiA9
IGRhdGFbM107Ci0gICAgICAgICAgY29vcmRfeCA9IG9sZF9jb29yZF94OwotICAgICAgICAg
IGNvb3JkX3kgPSBvbGRfY29vcmRfeTsKLSAgICAgICAgICB3aGVlbF9kaXIgPSBkYXRhWzBd
OwotICAgICAgICAgIG9sZF9jYl9sb2MgPSAzOwotICAgICAgICAgIGJyZWFrOwotICAgICAg
IGNhc2UgMjogLyoqIGdvaW5nIGZyb20gMiB0byAzICoqLwotICAgICAgICAgIGNiID0gb2xk
X2NiOwotICAgICAgICAgIG9sZF9jYiA9IGRhdGFbM107Ci0gICAgICAgICAgY29vcmRfeCA9
IG9sZF9jb29yZF94OwotICAgICAgICAgIGNvb3JkX3kgPSBkYXRhWzBdOwotICAgICAgICAg
IHdoZWVsX2RpciA9IGRhdGFbMV07Ci0gICAgICAgICAgb2xkX2NiX2xvYyA9IDM7Ci0gICAg
ICAgICAgYnJlYWs7Ci0gICAgICAgY2FzZSAzOiAvKiogZ29pbmcgZnJvbSAzIHRvIDMgKiov
Ci0gICAgICAgICAgY2IgPSBvbGRfY2I7Ci0gICAgICAgICAgb2x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