From owner-freebsd-usb@FreeBSD.ORG Fri Nov 9 11:30:01 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A679D16A46B for ; Fri, 9 Nov 2007 11:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6652113C4B6 for ; Fri, 9 Nov 2007 11:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lA9BU123012394 for ; Fri, 9 Nov 2007 11:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lA9BU1Cf012391; Fri, 9 Nov 2007 11:30:01 GMT (envelope-from gnats) Resent-Date: Fri, 9 Nov 2007 11:30:01 GMT Resent-Message-Id: <200711091130.lA9BU1Cf012391@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Nikos Ntarmos Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B8D016A421 for ; Fri, 9 Nov 2007 11:21:16 +0000 (UTC) (envelope-from ntarmos@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 6BEF513C494 for ; Fri, 9 Nov 2007 11:21:15 +0000 (UTC) (envelope-from ntarmos@ceid.upatras.gr) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id B56EAEB4AD3 for ; Fri, 9 Nov 2007 12:54:47 +0200 (EET) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 3800D158C82 for ; Fri, 9 Nov 2007 12:54:47 +0200 (EET) Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b+RF9hdHJiAg for ; Fri, 9 Nov 2007 12:54:47 +0200 (EET) Received: from ace.netcins.ceid.upatras.gr (csisgroup13.ceid.upatras.gr [150.140.143.227]) by mail.ceid.upatras.gr (Postfix) with ESMTP id D41B9158C6E for ; Fri, 9 Nov 2007 12:54:46 +0200 (EET) Received: by ace.netcins.ceid.upatras.gr (Postfix, from userid 1001) id 32B4D3F410; Fri, 9 Nov 2007 09:59:38 +0200 (EET) Message-Id: <20071109075938.32B4D3F410@ace.netcins.ceid.upatras.gr> Date: Fri, 9 Nov 2007 09:59:38 +0200 (EET) From: Nikos Ntarmos To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: usb/117938: [Patch] Adding support for MS WL Natural and MS WL Optical (1008) mice X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Nikos Ntarmos List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2007 11:30:01 -0000 >Number: 117938 >Category: usb >Synopsis: [Patch] Adding support for MS WL Natural and MS WL Optical (1008) mice >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Nov 09 11:30:00 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Nikos Ntarmos >Release: FreeBSD 7.0-BETA1 i386 >Organization: NetCInS Lab., C.E.I.D., U. of Patras, Greece >Environment: System: FreeBSD ace.netcins.ceid.upatras.gr 7.0-BETA1 FreeBSD 7.0-BETA1 #2: Wed Oct 31 23:48:50 EET 2007 ntarmos@ace.netcins.ceid.upatras.gr:/opt/src/sys/i386/compile/ACE i386 >Description: Some of the newer MS keyboard/mouse bundles act in even more mysterious ways than their predecessors; they connect to the system via a composite usb device and although both devices register as HID-class devices, the keyboard presents a KEYBOARD protocol but the corresponding mouse has its protocol and subclass fields zeroed-out. Due to this oddity, ukbd succesfully attaches to the keyboard port but the mouse is claimed by uhid and is therefore rendered unusable. This holds for (at least) the MS Natural Desktop Pro and the MS Optical Desktop (v1008) bundles. >How-To-Repeat: Plug in any of teh two above bundles. The keyboard is succesfully claimed by ukbd but you only get a uhid device for the mouse. >Fix: --- more-ms-mice.patch begins here --- 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 --- more-ms-mice.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: