NetBSD Problem Report #50701

From www@NetBSD.org  Sun Jan 24 10:31:56 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.NetBSD.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id EF9BB7A21B
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 24 Jan 2016 10:31:56 +0000 (UTC)
Message-Id: <20160124103155.DD5187ACCD@mollari.NetBSD.org>
Date: Sun, 24 Jan 2016 10:31:55 +0000 (UTC)
From: martijn.van.buul@gmail.com
Reply-To: martijn.van.buul@gmail.com
To: gnats-bugs@NetBSD.org
Subject: The MS Comfort Mouse 6000 reports wrong locator bytes
X-Send-Pr-Version: www-1.0

>Number:         50701
>Category:       kern
>Synopsis:       The MS Comfort Mouse 6000 reports wrong locator bytes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 24 10:35:00 +0000 2016
>Closed-Date:    Tue Jun 19 23:26:46 +0000 2018
>Last-Modified:  Tue Jun 19 23:26:46 +0000 2018
>Originator:     Martijn van Buul
>Release:        NetBSD 7.0_STABLE
>Organization:
>Environment:
System: NetBSD tinkerbell 7.0_STABLE NetBSD 7.0_STABLE (GENERIC) #3: Sun Jan 24 10:33:49 CET 2016 root@tinkerbell:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64

>Description:
The Microsoft Comfort Mouse 6000 reports the wrong location for the scroll wheel and the (unimplemented!) tilt control. The reported locations overlap with the X coordinate, resulting in spurious tilt- and scrollwheel events (and a nonfunctional scrollwheel), resulting in an almost unusable mouse.

The ums driver already contains a similar fix for other Microsoft mice (The Wireless Laser Mouse 6000, the number must be jinxed), but the correct location is different.

>How-To-Repeat:
Attach a Microsoft Comfort Mouse 6000, monitor the output (e.g. by starting an X server and running xev, or by reading the appropriate /dev/wsmouse? device), observe.

>Fix:
The following patch fixes the problem. This requires usbdevs.h and usbdevs_data.h to be regenerated; since they depend on the correct RCS tag I have omitted these.

As stated, ums.c already contains a very similar fix; however the *correct* locations are different; it seems that the wireless mouse has 8-bit indicators for X and Y, whereas the wired mouse has 16-bit indicators.

These fixes can probably combined into a universal fix by correcting z.pos to be "y.pos + y.size" rather than a constant, but since I don't own the "Wireless Mouse 6000" I cannot confirm that its y-axis is in fact at byte 2, which is why I opted to keep these fixes  separated.

Index: usbdevs.h
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usbdevs.h,v
retrieving revision 1.672.2.4
diff -u -r1.672.2.4 usbdevs.h
--- usbdevs.h   18 Oct 2015 09:03:22 -0000      1.672.2.4
+++ usbdevs.h   24 Jan 2016 10:27:20 -0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdevs.h,v 1.672.2.4 2015/10/18 09:03:22 martin Exp $ */
+/*     $NetBSD$        */

 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -2176,6 +2176,7 @@
 #define        USB_PRODUCT_MICROSOFT_XBOX_CONTROLLER_S12       0x0289          /* Xbox Controller S (1.2) */
 #define        USB_PRODUCT_MICROSOFT_24GHZ_XCVR10      0x071d          /* 2.4GHz Transceiver V1.0 */
 #define        USB_PRODUCT_MICROSOFT_24GHZ_XCVR20      0x071f          /* 2.4GHz Transceiver V2.0 */
+#define        USB_PRODUCT_MICROSOFT_CM6000    0x077d          /* Comfort Mouse 6000 */

 /* Microtech products */
 #define        USB_PRODUCT_MICROTECH_SCSIDB25  0x0004          /* USB-SCSI-DB25 */
Index: usbdevs_data.h
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usbdevs_data.h,v
retrieving revision 1.673.2.4
diff -u -r1.673.2.4 usbdevs_data.h
--- usbdevs_data.h      18 Oct 2015 09:03:22 -0000      1.673.2.4
+++ usbdevs_data.h      24 Jan 2016 10:27:20 -0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdevs_data.h,v 1.673.2.4 2015/10/18 09:03:22 martin Exp $    */
+/*     $NetBSD$        */

 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -6751,6 +6751,10 @@
            "2.4GHz Transceiver V2.0",
        },
        {
+           USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_CM6000,
+           "Comfort Mouse 6000",
+       },
+       {
            USB_VENDOR_MICROTECH, USB_PRODUCT_MICROTECH_SCSIDB25,
            "USB-SCSI-DB25",
        },
@@ -10203,4 +10207,4 @@
            "Prestige",
        },
 };
-const int usb_nproducts = 2010;
+const int usb_nproducts = 2011;

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50701 CVS commit: src/sys/dev/usb
Date: Sun, 24 Jan 2016 10:02:52 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Sun Jan 24 15:02:52 UTC 2016

 Modified Files:
 	src/sys/dev/usb: usbdevs

 Log Message:
 PR/50701: Martijn van Buul: Add MS Confort Mouse 6000


 To generate a diff of this commit:
 cvs rdiff -u -r1.709 -r1.710 src/sys/dev/usb/usbdevs

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50701 CVS commit: src/sys/dev/usb
Date: Mon, 25 Jan 2016 13:37:39 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Mon Jan 25 18:37:38 UTC 2016

 Modified Files:
 	src/sys/dev/usb: ums.c

 Log Message:
 PR/50701: Martijn van Buul: Adjust MS Confort Mouse 6000


 To generate a diff of this commit:
 cvs rdiff -u -r1.87 -r1.88 src/sys/dev/usb/ums.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 19 Jun 2018 23:26:46 +0000
State-Changed-Why:
Applied, thanks for the report.
It will be in netbsd-8, not backporting because it isn't super small and doesn't apply cleanly.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.