NetBSD-Bugs archive

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

Re: kern/50701: The MS Comfort Mouse 6000 reports wrong locator bytes



* martijn.van.buul%gmail.com@localhost:
>>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.

I am a fool, and added the two files I did NOT want to add, and forgot to
attach the two files that I wanted to..

Index: ums.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ums.c,v
retrieving revision 1.87
diff -u -r1.87 ums.c
--- ums.c	25 Jan 2014 00:03:14 -0000	1.87
+++ ums.c	24 Jan 2016 10:27:19 -0000
@@ -314,6 +314,20 @@
 			sc->sc_loc_w.pos = sc->sc_loc_z.pos + 8;
 	}
 
+	/*
+	 * The Microsoft Comfort Mouse v2.0 also reports a bad position
+	 * for the wheel and tilt controls - should be in bytes 5 & 6
+	 * of the report. Fix this if necessary.
+	 */
+
+	if (uha->uaa->vendor == USB_VENDOR_MICROSOFT &&
+	     uha->uaa->product == USB_PRODUCT_MICROSOFT_CM6000) {
+		if ((sc->flags & UMS_Z) && sc->sc_loc_z.pos == 0)
+			sc->sc_loc_z.pos = 40;
+		if ((sc->flags & UMS_W) && sc->sc_loc_w.pos == 0)
+			sc->sc_loc_w.pos = sc->sc_loc_z.pos + 8;
+	}
+
 	/* figure out the number of buttons */
 	for (i = 1; i <= MAX_BUTTONS; i++)
 		if (!hid_locate(desc, size, HID_USAGE2(HUP_BUTTON, i),
Index: usbdevs
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usbdevs,v
retrieving revision 1.680.2.4
diff -u -r1.680.2.4 usbdevs
--- usbdevs	18 Oct 2015 09:01:58 -0000	1.680.2.4
+++ usbdevs	24 Jan 2016 10:27:20 -0000
@@ -2169,6 +2169,7 @@
 product MICROSOFT XBOX_CONTROLLER_S12	0x0289	Xbox Controller S (1.2)
 product MICROSOFT 24GHZ_XCVR10		0x071d  2.4GHz Transceiver V1.0
 product MICROSOFT 24GHZ_XCVR20		0x071f  2.4GHz Transceiver V2.0
+product MICROSOFT CM6000		0x077d  Comfort Mouse 6000
 
 /* Microtech products */
 product MICROTECH SCSIDB25	0x0004	USB-SCSI-DB25

-- 
Martijn van Buul - pino%dohd.org@localhost 



Home | Main Index | Thread Index | Old Index