NetBSD-Bugs archive

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

kern/44980: Z-axis not working for Microsoft Comfort Mouse 6000 (includes fix)



>Number:         44980
>Category:       kern
>Synopsis:       ums(4): Z-axis not working for Microsoft Comfort Mouse 
>6000(+fix)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 17 21:35:00 +0000 2011
>Originator:     martijn.van.buul%gmail.com@localhost
>Release:        NetBSD 5.99.51
>Organization:
        
>Environment:
        
        
System: NetBSD atlas.pienjo.invalid 5.99.51 NetBSD 5.99.51 (GENERIC) #4: Tue 
May 17 22:05:46 CEST 2011 
martijnb@atlas.pienjo.invalid:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
        The "Microsoft Comfort Mouse 6000" (5 buttons, scroll wheel) reports
        to have a Z- and W-axis, but these aren't working properly. The 
        location of these controls in the report is wrong.

        Additionally, the mouse reports to have a W-axis, but there's no
        physical wheel tilt control.

        From dmesg:

uhidev0: Microsoft Comfort Mouse 6000, rev 2.00/0.44, addr 4, iclass 3/1
uhidev0: 28 report ids
ums0 at uhidev0 reportid 16: 5 buttons, W and Z dirs
   
        Usbdevs:

port 4 addr 4: low speed, power 100 mA, config 1, Comfort Mouse 6000(0x077d), 
Microsoft(0x045e), rev 0.44

>How-To-Repeat:
        Connect a Microsoft Comfort Mouse, notice how the Z-axis reports bogus
        data, while the scrollwheel is ignored.

>Fix:
        Apparently, a sibling of this mouse (the "Wireless Laser Mouse 6000")
        has similar problems, and a workaround was already present in 
        sys/dev/usb/ums.c. I have continued that pattern.

        The mouse sends out 7-byte records. Buttons are mapped on bits 0-5
        of the first byte; X axis (16 bits) is mapped on bytes 1 and 2;
        Y axis is mapped on bytes 3 and 4. Byte 5 corresponds to wheel
        up/down movements, byte 6 is always zero on my mouse, and assumed
        to be scroll wheel tilt on models supporting this.

        The product ID of this mouse (0x077d) wasn't present in usbdevs
        yet, and should probably be added.

        Patch with -current:

Index: ums.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ums.c,v
retrieving revision 1.81
diff -u -r1.81 ums.c
--- ums.c       3 Nov 2010 22:34:24 -0000       1.81
+++ ums.c       17 May 2011 20:11:54 -0000
@@ -295,6 +295,22 @@
                        sc->sc_loc_w.pos = sc->sc_loc_z.pos + 8;
        }
 
+       /*
+        * The Microsoft Comfort Mouse 6000 reports bad positions for
+        * the wheel and wheel tilt controls. Wheel control is confirmed
+        * to be at byte 5, tilt is assumed to be at byte 6. Fix this 
+        * if necessary.
+        */
+
+        /* XXX: Using hardcoded product ID, mouse is not in usbdevs yet */
+       if (uha->uaa->vendor == USB_VENDOR_MICROSOFT &&
+           uha->uaa->product == 0x77d) {
+               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),

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index