Since the version 1.95 of ums.c the mouse is recognized as a keyboard. more information can be found in this thread: http://lists.freebsd.org/pipermail/freebsd-usb/2007-July/003768.html How-To-Repeat: Connect a Razer Copperhead Laser Mouse to any USB-Port. ;)
The Razer Copperhead is a compound device having both a mouse and programmable keyboard component (so that mouse buttons can be programmed to emulate keypresses), hence it previously attaching to both ums and ukbd. The problem with it no longer attaching to ums is due to changes made in ums.c version 1.94 - specifically (snippet taken from ums.c v1.97) : 201: if (id->bInterfaceClass == UICLASS_HID && 202: id->bInterfaceSubClass == UISUBCLASS_BOOT && 203: id->bInterfaceProtocol == UIPROTO_MOUSE) 204: ret = UMATCH_IFACECLASS; 205: else 206: ret = UMATCH_NONE; As the mouse device is Class 3 (HID), SubClass 0 (No SubClass), Protocol 2 (Mouse), it fails to match and hence will not attach. The attached patch, which applies against ums.c v1.97, changes the check to match either SubClass 0 (No SubClass) or SubClass 1 (Boot device) and defines the appropriate identifier in usb.h . After applying the patch, the mouse attaches successfully and works correctly. This shouldn't affect any mice that use the Boot subclass - it will just allow mice that have no subclass to work correctly. I would love to see this committed before 7.0-RELEASE is cut, but I understand if it's not, as it is rather late in the testing cycle.
Sorry, the patch got munged with my previous follow-up. For reference in this PR, the patch can be downloaded from http://beastie.beardz.net/~bazerka/fbsd/copperhead.patch-1.diff Also, a slight correction to my previous follow-up, the patch applies to ums.c,v 1.96 2007/07/25 06:43:06 imp (which is the latest version of ums.c in RELENG_7, as of posting). Regards, Jase.
Hi, I tried your patch on my FreeBSD-Current and it works great for me, although the file-version differs from the fbsd7 one. :) Thanks, -- Uwe Grohnwaldt Max-Planck-Str 2A, 1.03.2 18059 Rostock E-Mail : Uwe@Grohnwaldt.de ICQ : 149348486 * Skype : lando_calr * nur nach vorheriger Vereinbarung
Patch doesn't work anymore at FreeBSD 7 (RELENG_7).
Patch doesn't work anymore in FreeBSD 7 (RELENG_7 of today).
Sorry, used the wrong patch. Mea cupla, now the Copperhead is fully functional. Thanks.
According to the USB spec, the protocol field is only defined if the subclass is 1. So a subclass of 0 is really a violation of the spec. I think a better fix is to put back the old hid_is_collection() test first and then directly check the descriptor if that fails: Index: ums.c =================================================================== RCS file: /usr/cvs/src/sys/dev/usb/ums.c,v retrieving revision 1.97 diff -u -r1.97 ums.c --- ums.c 26 Dec 2007 14:31:16 -0000 1.97 +++ ums.c 27 Feb 2008 21:40:48 -0000 @@ -198,7 +198,10 @@ if (err) return (UMATCH_NONE); - if (id->bInterfaceClass == UICLASS_HID && + if (hid_is_collection(desc, size, + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) + ret = UMATCH_IFACECLASS; + else if (id->bInterfaceClass == UICLASS_HID && id->bInterfaceSubClass == UISUBCLASS_BOOT && id->bInterfaceProtocol == UIPROTO_MOUSE) ret = UMATCH_IFACECLASS; -- John Baldwin
Hi http://lists.freebsd.org/pipermail/freebsd-stable/2008-February/040754.html as I said there, the patch does work but to some degree only. Cheers, Oliver -- If you don't know what game you're playing, don't ask what the score is.
I think the X problems you have are a separate issue. -- John Baldwin
jhb 2008-03-12 20:20:36 UTC FreeBSD src repository Modified files: sys/dev/usb ums.c Log: Partially revert 1.95. It changed the probe for a mouse device to only accept a mouse using the boot subclass. Instead, restore the original hid_is_collection() test and fallback to testing the interface class, subclass, and protocol if that fails. MFC after: 1 week PR: usb/118670 Revision Changes Path 1.98 +4 -1 src/sys/dev/usb/ums.c _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->patched Fixed in HEAD.
Responsible Changed From-To: freebsd-usb->jhb Fixed in HEAD.
State Changed From-To: patched->closed Fix merged to RELENG_7.