NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/60652: pms(4) misdetects Perixx PS/2 wheel mouse as 5-button protocol



The following reply was made to PR kern/60652; it has been noted by GNATS.

From: netbsd.6u9%lmigfernandes.addymail.com@localhost
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/60652: pms(4) misdetects Perixx PS/2 wheel mouse as
 5-button protocol
Date: Fri, 28 Aug 2026 06:10:51 +0000

 --UjRj1rES
 Content-Type: multipart/alternative; boundary=Ux5EO852
 
 --Ux5EO852
 Content-Type: text/plain; charset=utf-8
 Content-Transfer-Encoding: quoted-printable
 
 I was able to find a working fix to the mouse problem.
 
 As already ment=
 ioned above, the mouse is reporting device ID 0x04 during the standard 200/=
 200/80 probe by NetBSD, so it seems that PMS_SCROLL5 detection is performed=
  successfully.
 
 However, NetBSD just starts normal PMS_SCROLL5 operatio=
 n without the extra initialization, which Linux uses for =E2=80=9CIntelliMo=
 use Explorer devices=E2=80=9D.
 
 The sequence of commands that was misse=
 d is found in the Linux source code in drivers/input/mouse/psmouse-base.c, =
 in function im_explorer_detect(). After detecting device ID 0x04 Linux send=
 s:
 =C2=A0=C2=A0 200
 =C2=A0=C2=A0 80
 =C2=A0=C2=A0 40
 And this sequen=
 ce is commented in the source code as:
 =E2=80=9CMagic to enable horizonta=
 l scrolling on IntelliMouse 4.0.=E2=80=9D
 
 I have added the same 200/80=
 /40 sequence after PMS_SCROLL5 detection in NetBSD.
 
 After this patch, =
 the mouse works correctly using the existing NetBSD's 4-byte PMS_SCROLL5 ha=
 ndler:
 
 During investigation I tried different packet-parser and synchr=
 onization patches. The forced 3-byte framing worked with movement but not w=
 ith the wheel, while the normal 4-byte PMS_SCROLL5 and 200/80/40 initializa=
 tion patch fixed the mouse problem.
 
 This works only for my Perixx PS/2=
  mouse so far. I have not tried whether this affects other hardware devices=
  with ID 0x04.
 
 Please note that the patch file I attached below includ=
 es only the initialization change of 200/80/40.
 
 
 Aug 26, 2026, 19:50=
  by netbsd.6u9%lmigfernandes.addymail.com@localhost:
 
 > Thank you very much for y=
 our problem report.
 > It has the internal identification `kern/60652'.
 =
 > The individual assigned to look at your
 > report is: kern-bug-people. =
 
 >
 > >Category:       kern
 > >Responsible:    kern-bug-people
 > >Sy=
 nopsis:       pms(4) misdetects Perixx PS/2 wheel mouse as 5-button protoco=
 l
 > >Arrival-Date:   Wed Aug 26 18:50:00 +0000 2026
 >
 >
 >
 
 
 --Ux5EO852
 Content-Type: text/html; charset=utf-8
 Content-Transfer-Encoding: quoted-printable
 
 <html>
   <head>
     <meta http-equiv=3D"content-type" content=3D"text/h=
 tml; charset=3DUTF-8">
   </head>
   <body>
 <div dir=3D"auto">I was abl=
 e to find a working fix to the mouse problem.<br></div><div dir=3D"auto"><b=
 r></div><div dir=3D"auto">As already mentioned above, the mouse is reportin=
 g device ID 0x04 during the standard 200/200/80 probe by NetBSD, so it seem=
 s that PMS_SCROLL5 detection is performed successfully.<br></div><div dir=
 =3D"auto"><br></div><div dir=3D"auto">However, NetBSD just starts normal PM=
 S_SCROLL5 operation without the extra initialization, which Linux uses for =
 =E2=80=9CIntelliMouse Explorer devices=E2=80=9D.<br></div><div dir=3D"auto"=
 ><br></div><div dir=3D"auto">The sequence of commands that was missed is fo=
 und in the Linux source code in drivers/input/mouse/psmouse-base.c, in func=
 tion im_explorer_detect(). After detecting device ID 0x04 Linux sends:<br><=
 /div><div dir=3D"auto">&nbsp;&nbsp; 200<br></div><div dir=3D"auto">&nbsp;&n=
 bsp; 80<br></div><div dir=3D"auto">&nbsp;&nbsp; 40<br></div><div dir=3D"aut=
 o">And this sequence is commented in the source code as:<br></div><div dir=
 =3D"auto">=E2=80=9CMagic to enable horizontal scrolling on IntelliMouse 4.0=
 .=E2=80=9D<br></div><div dir=3D"auto"><br></div><div dir=3D"auto">I have ad=
 ded the same 200/80/40 sequence after PMS_SCROLL5 detection in NetBSD.<br><=
 /div><div dir=3D"auto"><br></div><div dir=3D"auto">After this patch, the mo=
 use works correctly using the existing NetBSD's 4-byte PMS_SCROLL5 handler:=
 <br></div><div dir=3D"auto"><br></div><div dir=3D"auto">During investigatio=
 n I tried different packet-parser and synchronization patches. The forced 3=
 -byte framing worked with movement but not with the wheel, while the normal=
  4-byte PMS_SCROLL5 and 200/80/40 initialization patch fixed the mouse prob=
 lem.<br></div><div dir=3D"auto"><br></div><div dir=3D"auto">This works only=
  for my Perixx PS/2 mouse so far. I have not tried whether this affects oth=
 er hardware devices with ID 0x04.<br></div><div dir=3D"auto"><br></div><div=
  dir=3D"auto">Please note that the patch file I attached below includes onl=
 y the initialization change of 200/80/40.<br></div><div dir=3D"auto"><br></=
 div><div dir=3D"auto"><br></div><div dir=3D"auto">Aug 26, 2026, 19:50 by ne=
 tbsd.6u9%lmigfernandes.addymail.com@localhost:<br></div><blockquote class=3D"tutanota=
 _quote" style=3D"border-left: 1px solid #93A3B8; padding-left: 10px; margin=
 -left: 5px;"><div dir=3D"auto">Thank you very much for your problem report.=
 <br></div><div dir=3D"auto">It has the internal identification `kern/60652'=
 .<br></div><div dir=3D"auto">The individual assigned to look at your<br></d=
 iv><div dir=3D"auto">report is: kern-bug-people. <br></div><div dir=3D"auto=
 "><br></div><div dir=3D"auto">&gt;Category:       kern<br></div><div dir=3D=
 "auto">&gt;Responsible:    kern-bug-people<br></div><div dir=3D"auto">&gt;S=
 ynopsis:       pms(4) misdetects Perixx PS/2 wheel mouse as 5-button protoc=
 ol<br></div><div dir=3D"auto">&gt;Arrival-Date:   Wed Aug 26 18:50:00 +0000=
  2026<br></div><div dir=3D"auto"><br></div><div dir=3D"auto"><br></div></bl=
 ockquote><div dir=3D"auto"><br></div>  </body>
 </html>
 
 --Ux5EO852--
 
 --UjRj1rES
 Content-Type: text/x-patch; name=netbsd-pms-fix.patch
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment; name=netbsd-pms-fix.patch;
  filename=netbsd-pms-fix.patch
 
 LS0tIC91c3Ivc3JjL3N5cy9kZXYvcGNrYnBvcnQvcG1zLmMub3JpZworKysgL3Vzci9zcmMvc3lz
 L2Rldi9wY2ticG9ydC9wbXMuYwpAQCAtMTI4LDYgKzEyOCwzMSBAQAogCQlpZiAocmVzcFswXSA9
 PSBwLT5yZXNwb25zZSkgewogCQkJRFBSSU5URigoInBtc19wcm90b2NvbDogZm91bmQgbW91c2Ug
 cHJvdG9jb2wgJWRcbiIsCiAJCQkJdHJpZXNbal0pKTsKKworCQkJaWYgKHRyaWVzW2pdID09IFBN
 U19TQ1JPTEw1KSB7CisJCQkJdV9jaGFyIGluaXRbMl07CisKKwkJCQlpbml0WzBdID0gUE1TX1NF
 VF9TQU1QTEU7CisKKwkJCQlpbml0WzFdID0gMjAwOworCQkJCXJlcyA9IHBja2Jwb3J0X2VucXVl
 dWVfY21kKHRhZywgc2xvdCwgaW5pdCwKKwkJCQkgICAgMiwgMCwgMSwgMCk7CisJCQkJaWYgKHJl
 cykKKwkJCQkJcmV0dXJuIFBNU19VTktOT1dOOworCisJCQkJaW5pdFsxXSA9IDgwOworCQkJCXJl
 cyA9IHBja2Jwb3J0X2VucXVldWVfY21kKHRhZywgc2xvdCwgaW5pdCwKKwkJCQkgICAgMiwgMCwg
 MSwgMCk7CisJCQkJaWYgKHJlcykKKwkJCQkJcmV0dXJuIFBNU19VTktOT1dOOworCisJCQkJaW5p
 dFsxXSA9IDQwOworCQkJCXJlcyA9IHBja2Jwb3J0X2VucXVldWVfY21kKHRhZywgc2xvdCwgaW5p
 dCwKKwkJCQkgICAgMiwgMCwgMSwgMCk7CisJCQkJaWYgKHJlcykKKwkJCQkJcmV0dXJuIFBNU19V
 TktOT1dOOworCQkJfQorCiAJCQlyZXR1cm4gdHJpZXNbal07CiAJCX0KIAl9Cg==
 --UjRj1rES--
 




Home | Main Index | Thread Index | Old Index