Index: ums.c =================================================================== RCS file: /opt/freebsd/cvs/src/sys/dev/usb/ums.c,v retrieving revision 1.96 diff -u -r1.96 ums.c --- ums.c 25 Jul 2007 06:43:06 -0000 1.96 +++ ums.c 9 Nov 2007 07:50:12 -0000 @@ -197,9 +197,19 @@ if (err) return (UMATCH_NONE); + /** + * Some of the newer Microsoft keyborad-mouse bundles use a composite USB + * approach, where both devices have an interface class of HID, but then + * only the keyboard presents a KEYBOARD protocol, while the mouse has the + * coresponding fields zeroed-out. AFAIK all such devices need the + * UQ_MS_BAD_CLASS quirk to function correctly, while that quirk is solely + * in use by mice, so I'm using it to identify such devices and have ums + * attach to them. + */ if (id->bInterfaceClass == UICLASS_HID && - id->bInterfaceSubClass == UISUBCLASS_BOOT && - id->bInterfaceProtocol == UIPROTO_MOUSE) + ((id->bInterfaceSubClass == UISUBCLASS_BOOT && + id->bInterfaceProtocol == UIPROTO_MOUSE) || + usbd_get_quirks(uaa->device)->uq_flags & UQ_MS_BAD_CLASS)) ret = UMATCH_IFACECLASS; else ret = UMATCH_NONE; @@ -487,6 +497,12 @@ * UPDATE: This problem affects the M$ Wireless Notebook Optical Mouse, * too. However, the leading byte for this mouse is normally 0x11, * and the phantom mouse click occurs when its 0x14. + * + * UPDATE: This problem also affects the MS Wireless Optical Mouse + * (Model 1008) and MS Wireless Natural Mouse 4000, only that the bogus + * byte alternates between 0x11 (normal mode) and 0x05. For these mice the + * bogus byte translates to an x-axis movement as oppose to a phantom + * click as above. */ if (sc->flags & UMS_T) { if (sc->sc_iid) { @@ -495,7 +511,7 @@ } } else if (sc->flags & UMS_SPUR_BUT_UP) { DPRINTFN(5, ("ums_intr: #### ibuf[0] =3D %d ####\n", *ibuf)); - if (*ibuf == 0x14 || *ibuf == 0x15) + if (*ibuf == 0x05 || *ibuf == 0x14 || *ibuf == 0x15) return; } else { if (sc->sc_iid) { Index: usb_quirks.c =================================================================== RCS file: /opt/freebsd/cvs/src/sys/dev/usb/usb_quirks.c,v retrieving revision 1.63 diff -u -r1.63 usb_quirks.c --- usb_quirks.c 22 Jul 2007 15:59:45 -0000 1.63 +++ usb_quirks.c 8 Nov 2007 15:56:33 -0000 @@ -84,6 +84,10 @@ { USB_VENDOR_HP, USB_PRODUCT_HP_1220C, ANY, { UQ_BROKEN_BIDIR }}, { USB_VENDOR_XEROX, USB_PRODUCT_XEROX_WCM15, ANY, { UQ_BROKEN_BIDIR }}, /* MS keyboards do weird things */ + { USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLNATMOUSE, + ANY, { UQ_MS_BAD_CLASS | UQ_MS_LEADING_BYTE }}, + { USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLOPTMOUSE, + ANY, { UQ_MS_BAD_CLASS | UQ_MS_LEADING_BYTE }}, { USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLNOTEBOOK, ANY, { UQ_MS_BAD_CLASS | UQ_MS_LEADING_BYTE }}, { USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLNOTEBOOK2, Index: usbdevs =================================================================== RCS file: /opt/freebsd/cvs/src/sys/dev/usb/usbdevs,v retrieving revision 1.328 diff -u -r1.328 usbdevs --- usbdevs 5 Oct 2007 07:26:39 -0000 1.328 +++ usbdevs 8 Nov 2007 15:57:15 -0000 @@ -1637,6 +1637,8 @@ product MICROSOFT MN510 0x006e MN510 Wireless product MICROSOFT MN110 0x007a 10/100 USB NIC product MICROSOFT WLINTELLIMOUSE 0x008c Wireless Optical IntelliMouse +product MICROSOFT WLNATMOUSE 0x071d Wireless Natural Mouse 4000 +product MICROSOFT WLOPTMOUSE 0x00f9 Wireless Optical Mouse (Model 1008) product MICROSOFT WLNOTEBOOK 0x00b9 Wireless Optical Mouse (Model 1023) product MICROSOFT WLNOTEBOOK2 0x00e1 Wireless Optical Mouse 3000 (Model 1056) product MICROSOFT WLUSBMOUSE 0x00b9 Wireless USB Mouse