From nobody@FreeBSD.org  Wed Dec 12 16:04:07 2007
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 86E1B16A420
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 12 Dec 2007 16:04:07 +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 6D23A13C4D1
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 12 Dec 2007 16:04:07 +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 lBCG41oY050210
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 12 Dec 2007 16:04:01 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id lBCG41iH050209;
	Wed, 12 Dec 2007 16:04:01 GMT
	(envelope-from nobody)
Message-Id: <200712121604.lBCG41iH050209@www.freebsd.org>
Date: Wed, 12 Dec 2007 16:04:01 GMT
From: Yarodin <yarodin@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: All A4Tech X-7xx mices are doesn't work throught ps2 jack
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         118578
>Category:       kern
>Synopsis:       [psm] [patch] All A4Tech X-7xx mice don't work through ps2 jack
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    rink
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 12 16:10:02 UTC 2007
>Closed-Date:    Tue Apr 01 08:06:31 UTC 2008
>Last-Modified:  Thu Apr 17 14:10:01 UTC 2008
>Originator:     Yarodin
>Release:        6.3-PRERELEASE
>Organization:
>Environment:
FreeBSD home.bsd 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #3: Wed Dec 12 19:00:47 YEKT 2007     root@home.bsd:/usr/obj/usr/src/sys/CUSTOM  i386
>Description:
I'm tested two mouses A4Tech X-750BF and X-750MF.
When they plug throught ps/2 jack they absolutely doesn't work neither
under moused nor under x.org. When plugged throuth usb all works fine.

For example X-750BF:

ps/2:
Dec 12 19:13:02 home kernel: psm0: current command byte:0065
Dec 12 19:13:02 home kernel: psm0: <PS/2 Mouse> irq 12 on atkbdc0
Dec 12 19:13:02 home kernel: psm0: [GIANT-LOCKED]
Dec 12 19:13:02 home kernel: psm0: model Generic PS/2 mouse, device ID 0-00, 2 buttons
Dec 12 19:13:02 home kernel: psm0: config:00000000, flags:00000008, packet size:3
Dec 12 19:13:02 home kernel: psm0: syncmask:c0, syncbits:00

No any activity for all possible moused/xorg options (including -f 200
for moused)

usb:
Dec 12 19:17:12 home kernel: ums0: A4Tech PS/2+USB Mouse, rev 1.10/0.01, addr 2, iclass 3/1
Dec 12 19:17:12 home kernel: ums0: 8 buttons and Z dir.

All work fine.

Brief Specs: http://www.a4tech.com/EN/product2.asp?CID=102&SCID=103&MNO=X-750BF

Same mices on same pc works fine through ps/2 plug under Windows.

I'think it deal with wrong detection of this mices as model Generic PS/2,
may be it closer to intellimouse?

Same problems of other users: 
http://forums.pcbsd.org/viewtopic.php?f=23&t=5811 (eng)
http://bsdportal.ru/viewtopic.php?p=74892 (rus)
>How-To-Repeat:
Plug any A4Tech mice from X-7xx series throught it own ps/2 jack.
>Fix:


>Release-Note:
>Audit-Trail:

From: Andriy Gapon <avg@icyb.net.ua>
To: bug-followup@FreeBSD.org, yarodin@gmail.com
Cc:  
Subject: Re: kern/118578: [psm] All A4Tech X-7xx mice don't work through ps2
 jack
Date: Thu, 07 Feb 2008 17:22:55 +0200

 This is a multi-part message in MIME format.
 --------------040401050608030600020700
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 7bit
 
 
 Could you please check if a patch described in the following email helps
 you?
 http://docs.freebsd.org/cgi/getmsg.cgi?fetch=256010+0+current/freebsd-stable
 
 I am also attaching the patch to this message.
 
 -- 
 Andriy Gapon
 
 --------------040401050608030600020700
 Content-Type: text/x-patch;
  name="psm.c.patch"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="psm.c.patch"
 
 --- psm.c.orig	2008-02-04 18:07:34.000000000 +0200
 +++ psm.c	2008-02-04 18:08:14.000000000 +0200
 @@ -3109,6 +3109,8 @@ enable_msexplorer(struct psm_softc *sc)
      int id;
      int i;
  
 +    enable_msintelli(sc);
 +
      /* the special sequence to enable the extra buttons and the roller. */
      for (i = 0; i < sizeof(rate1)/sizeof(rate1[0]); ++i) {
          if (set_mouse_sampling_rate(kbdc, rate1[i]) != rate1[i])
 
 --------------040401050608030600020700--

From: Andriy Gapon <avg@icyb.net.ua>
To: bug-followup@FreeBSD.org, yarodin@gmail.com
Cc:  
Subject: Re: kern/118578: [psm] All A4Tech X-7xx mice don't work through ps2
 jack
Date: Thu, 07 Feb 2008 17:46:10 +0200

 Also, just for the PR track record I am including information from the
 mailing list discussion.
 
 on 01/02/2008 11:38  said the following:
 [Andriy Gapon wrote]
 I compared FreeBSD and Linux sources more thoroughly and found the
 following:
 http://lxr.linux.no/linux+v2.6.24/drivers/input/mouse/psmouse-base.c#L464
 static int im_explorer_detect(struct psmouse *psmouse, int set_properties)
 {
 struct ps2dev *ps2dev = &psmouse->ps2dev;
 unsigned char param[2];
 
 intellimouse_detect(psmouse, 0);
 
 I.e., first thing the explorer probe does is massaging a mouse with
 IntelliMouse magic commands.
 
 I did the same in FreeBSD psm.c, i.e., added a call to
 enable_msintelli() at the very start of enable_msexplorer(). And voilà -
 everything is perfect, correct ID is returned, probing succeeds, the
 mouse works great.
 
 I think that this change is quite safe to make in FreeBSD, because with
 Linux user-base we can be 99% percent sure that this change won't break
 anything.
 
 [Vojtech Pavlik wrote]
 It is even correct: A mouse isn't required to be able to jump straight
 into the Explorer mode, it is supposed to always go through the
 IntelliMouse mode.
 
 A side note: Vojtech is an active Linux developer, a maintainer of their
 psm driver.
 
 And a final authority on this matter:
 http://www.microsoft.com/whdc/device/input/5b_wheel.mspx
 
 
 -- 
 Andriy Gapon
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Thu Feb 7 17:12:28 UTC 2008 
State-Changed-Why:  
Note that submitter has been asked for feedback. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118578 

From: Yar Odin <yarodin@gmail.com>
To: bug-followup@freebsd.org,
 yarodin@gmail.com
Cc: Andriy Gapon <avg@icyb.net.ua>
Subject: Re: kern/118578: [psm] All A4Tech X-7xx mice don't work through ps2 jack
Date: Sat, 9 Feb 2008 22:07:18 +0500

 Thank you, very much. With this patch all my A4 X-7xx mices starts to work 
 now.
 psm0: <PS/2 Mouse> irq 12 on atkbdc0
 psm0: [GIANT-LOCKED]
 psm0: model IntelliMouse Explorer, device ID 4
Responsible-Changed-From-To: freebsd-bugs->rink 
Responsible-Changed-By: rink 
Responsible-Changed-When: Mon Feb 25 13:39:42 UTC 2008 
Responsible-Changed-Why:  
I'll deal with this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118578 
State-Changed-From-To: feedback->patched 
State-Changed-By: rink 
State-Changed-When: Mon Feb 25 13:58:55 UTC 2008 
State-Changed-Why:  
I've committed the patch to CURRENT, thanks! Since this is a pretty 
delicate area, I'll MFC it after one month if no problems show up... 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118578 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/118578: commit references a PR
Date: Mon, 25 Feb 2008 13:57:33 +0000 (UTC)

 rink        2008-02-25 13:57:18 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/dev/atkbdc       psm.c 
   Log:
   Some PS/2 mice (at least the A4Tech X-7xx) need to be set to Intelli mode
   first before they can be set to Explorer mode.
   
   PR:             kern/118578
   Submitted by:   Andriy Gapon <avg@icyb.net.ua> (I added some comments)
   Reviewed by:    philip
   MFC after:      1 month
   
   Revision  Changes    Path
   1.94      +7 -0      src/sys/dev/atkbdc/psm.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: rink 
State-Changed-When: Tue Apr 1 08:06:07 UTC 2008 
State-Changed-Why:  
MFC completed - thanks for the reminder! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118578 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/118578: commit references a PR
Date: Tue,  1 Apr 2008 08:05:37 +0000 (UTC)

 rink        2008-04-01 08:05:31 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sys/dev/atkbdc       psm.c 
   Log:
   MFC:
     Some PS/2 mice (at least the A4Tech X-7xx) need to be set to Intelli mode
     first before they can be set to Explorer mode.
   
     PR:             kern/118578
     Submitted by:   Andriy Gapon <avg@icyb.net.ua> (I added some comments)
     Reviewed by:    philip
   
   Revision  Changes    Path
   1.93.2.1  +7 -0      src/sys/dev/atkbdc/psm.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: Igor Sysoev <is@rambler-co.ru>
To: bug-followup@FreeBSD.org, Andriy Gapon <avg@icyb.net.ua>
Cc:  
Subject: kern/118578: [psm] [patch] All A4Tech X-7xx mice don't work through ps2 jack
Date: Tue, 15 Apr 2008 21:54:26 +0400

 After revision 1.93.2.1 of src/sys/dev/atkbdc/psm.c touchpad on my
 ThinkPad T42 has stopped working.
 
 psm0: <PS/2 Mouse> irq 12 on atkbdc0
 psm0: [GIANT-LOCKED]
 psm0: [ITHREAD]
 psm0: model Synaptics Touchpad, device ID 0
 
 
 -- 
 Igor Sysoev
 http://sysoev.ru/en/

From: Andriy Gapon <avg@icyb.net.ua>
To: Igor Sysoev <is@rambler-co.ru>
Cc: bug-followup@FreeBSD.org, rink@FreeBSD.org
Subject: Re: kern/118578: [psm] [patch] All A4Tech X-7xx mice don't work through
 ps2 jack
Date: Tue, 15 Apr 2008 21:52:35 +0300

 on 15/04/2008 20:54 Igor Sysoev said the following:
 > After revision 1.93.2.1 of src/sys/dev/atkbdc/psm.c touchpad on my
 > ThinkPad T42 has stopped working.
 > 
 > psm0: <PS/2 Mouse> irq 12 on atkbdc0
 > psm0: [GIANT-LOCKED]
 > psm0: [ITHREAD]
 > psm0: model Synaptics Touchpad, device ID 0
 > 
 > 
 
 Thank you for the report.
 Could you please try the following:
 1. put into loader.conf
 debug.psm.loglevel="2"
 and compare output before and after the change
 
 2. in function enable_msexplorer(): instead of calling
 enable_msintelli() just call the magic sequence from the latter;
 something like the following:
 
 for (i = 0; i < sizeof(rate0)/sizeof(rate0[0]); ++i) {
     if (set_mouse_sampling_rate(kbdc, rate0[i]) != rate0[i])
         return FALSE;
 }
 
 (note: rate0[] in enable_msexplorer is exactly the same as rate[] in
 enable_msintelli)
 
 
 I am a little bit puzzled that this affects Synaptics Touchpad,
 especially when it is still recognized as such.
 
 -- 
 Andriy Gapon

From: Igor Sysoev <is@rambler-co.ru>
To: Andriy Gapon <avg@icyb.net.ua>
Cc: bug-followup@FreeBSD.org, rink@FreeBSD.org
Subject: Re: kern/118578: [psm] [patch] All A4Tech X-7xx mice don't work through ps2 jack
Date: Thu, 17 Apr 2008 18:05:35 +0400

 On Tue, Apr 15, 2008 at 09:52:35PM +0300, Andriy Gapon wrote:
 
 > on 15/04/2008 20:54 Igor Sysoev said the following:
 > > After revision 1.93.2.1 of src/sys/dev/atkbdc/psm.c touchpad on my
 > > ThinkPad T42 has stopped working.
 > > 
 > > psm0: <PS/2 Mouse> irq 12 on atkbdc0
 > > psm0: [GIANT-LOCKED]
 > > psm0: [ITHREAD]
 > > psm0: model Synaptics Touchpad, device ID 0
 > > 
 > > 
 > 
 > Thank you for the report.
 > Could you please try the following:
 > 1. put into loader.conf
 > debug.psm.loglevel="2"
 > and compare output before and after the change
 > 
 > 2. in function enable_msexplorer(): instead of calling
 > enable_msintelli() just call the magic sequence from the latter;
 > something like the following:
 > 
 > for (i = 0; i < sizeof(rate0)/sizeof(rate0[0]); ++i) {
 >     if (set_mouse_sampling_rate(kbdc, rate0[i]) != rate0[i])
 >         return FALSE;
 > }
 > 
 > (note: rate0[] in enable_msexplorer is exactly the same as rate[] in
 > enable_msintelli)
 > 
 > 
 > I am a little bit puzzled that this affects Synaptics Touchpad,
 > especially when it is still recognized as such.
 
 Sorry, this was my mistake.
 
 I usually use USB mouse, so after recent FreeBSD upgrade I did not notice
 that touchpad is still working. I needed to use touchpad once after notebook
 resume and touchpad did not work because (as I discovered later) resume
 failure:
 
 t42 kernel: psm0: failed to reset the aux device.
 t42 kernel: psm0: the aux device has gone! (reinitialize).
 
 I remembered that there was some fix in src/sys/dev/atkbdc/psm.c
 so I had backed it out, rebuilt kernel, and rebooted. This was the first
 reboot since I found that my touchpad stopped working, so I had thought
 that the backout fixed the problem but not simple reboot.
 
 
 -- 
 Igor Sysoev
 http://sysoev.ru/en/
>Unformatted:
