From nobody@FreeBSD.org  Thu Jun  5 12:27:11 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DDBB21065679
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  5 Jun 2008 12:27:11 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id C5D4D8FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  5 Jun 2008 12:27:11 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m55CRBND006118
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 5 Jun 2008 12:27:11 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m55CRBsO006117;
	Thu, 5 Jun 2008 12:27:11 GMT
	(envelope-from nobody)
Message-Id: <200806051227.m55CRBsO006117@www.freebsd.org>
Date: Thu, 5 Jun 2008 12:27:11 GMT
From: Marcin Kucharczyk <marcinkk@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Some mice from A4Tech are not properly recognized and initialized
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         124299
>Category:       kern
>Synopsis:       Some mice from A4Tech are not properly recognized and initialized
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 05 12:30:02 UTC 2008
>Closed-Date:    Thu Jun 05 21:04:59 UTC 2008
>Last-Modified:  Thu Jun 05 21:04:59 UTC 2008
>Originator:     Marcin Kucharczyk
>Release:        6.2 RELEASE, 7.0-RELEASE
>Organization:
>Environment:
>Description:
I have FreeBSD installed and the mouse A4-TECH OP-620D connected to PS/2 port of the machine. The mouse works on Windows XP, Fedora 6 and 9, Vista and Debian 4.0 but doesn't work on FreeBSD.


>How-To-Repeat:
Try to use A4Tech OP-620D with FreeBSD. As I found, some other A4Tech mice have described problem...
>Fix:
First I saw that mouse is identified as "Microsoft IntelliMouse Explorer", and other mice, which works, are identified as "Microsoft IntelliMouse".

Some time later, I've read this message:

http://groups.google.com/group/mailing.freebsd.hardware/browse_thread/thread/27f818b03049e546

And I've made the author's advice: 

"I did the same in FreeBSD psm.c, i.e., added a call to enable_msintelli() at the very start of enable_msexplorer()."

I'm not a good programer, so I've copied initialization code of InteliMouse to InteliMouse Explorer before original lines. Now the mouse works ok. Tested on FreeBSD 6.2 and on 7.0 too. I don't have original Microsoft InteliMouse Explorer to test if it works...

First I've just copied InteliMouse initialization procedure to InteliMouse Explorer and the mouse works also. Is it mean than the mouse is not properly detected by FreeBSD?

Patch attached with submission follows:

--- psm.c.orig	Thu Jun  5 14:09:28 2008
+++ psm.c	Thu Jun  5 14:20:29 2008
@@ -3103,11 +3103,26 @@
 static int
 enable_msexplorer(struct psm_softc *sc)
 {
-    static unsigned char rate0[] = { 200, 100, 80, };
-    static unsigned char rate1[] = { 200, 200, 80, };
+    static unsigned char rate[] = { 200, 100, 80, };
     KBDC kbdc = sc->kbdc;
     int id;
     int i;
+
+    /* the special sequence to enable the third button and the roller. */
+    for (i = 0; i < sizeof(rate)/sizeof(rate[0]); ++i) {
+        if (set_mouse_sampling_rate(kbdc, rate[i]) != rate[i])
+	    return FALSE;
+    }
+    /* the device will give the genuine ID only after the above sequence */
+    id = get_aux_id(kbdc);
+    if (id != PSM_INTELLI_ID)
+	return FALSE;
+
+    sc->hw.hwid = id;
+    sc->hw.buttons = 3;
+    
+    static unsigned char rate0[] = { 200, 100, 80, };
+    static unsigned char rate1[] = { 200, 200, 80, };
 
     /* the special sequence to enable the extra buttons and the roller. */
     for (i = 0; i < sizeof(rate1)/sizeof(rate1[0]); ++i) {


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: gavin 
State-Changed-When: Thu Jun 5 21:01:27 UTC 2008 
State-Changed-Why:  
Close as a duplicate of kern/118578.  This has already been 
fixed in -CURRENT and RELENG_7, so will be fixed in 7.1 or if 
you update to 7-STABLE.  Thanks for your submission! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=124299 
>Unformatted:
