From owner-freebsd-usb@FreeBSD.ORG Sat Mar 8 18:24:54 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 931DD1065676 for ; Sat, 8 Mar 2008 18:24:54 +0000 (UTC) (envelope-from dorian.buettner@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 00EFC8FC1D for ; Sat, 8 Mar 2008 18:24:53 +0000 (UTC) (envelope-from dorian.buettner@gmx.de) Received: (qmail invoked by alias); 08 Mar 2008 17:58:12 -0000 Received: from port-92-192-81-142.dynamic.qsc.de (EHLO zock.doris.net) [92.192.81.142] by mail.gmx.net (mp040) with SMTP; 08 Mar 2008 18:58:12 +0100 X-Authenticated: #1682771 X-Provags-ID: V01U2FsdGVkX19wXdInIwZwob05yYf3Aj+wswF+Ewq3MdVvCM2Ubu +NNVWSDcsZ7uF4 From: Dorian =?iso-8859-1?q?B=FCttner?= To: freebsd-usb@freebsd.org, John Baldwin Date: Sat, 8 Mar 2008 18:58:11 +0100 User-Agent: KMail/1.9.7 References: <200802272200.m1RM03tS058913@freefall.freebsd.org> In-Reply-To: <200802272200.m1RM03tS058913@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803081858.12199.dorian.buettner@gmx.de> X-Y-GMX-Trusted: 0 Cc: Subject: Re: usb/118670: [ums] [patch] Razer Copperhead Laser Mouse shows up as keyboard X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2008 18:24:54 -0000 On Wednesday 27 February 2008 23:00:03 John Baldwin wrote: > The following reply was made to PR usb/118670; it has been noted by GNATS. > > From: John Baldwin > To: bug-followup@freebsd.org, Uwe@grohnwaldt.eu > Cc: imp@freebsd.org > Subject: Re: usb/118670: [ums] [patch] Razer Copperhead Laser Mouse shows > up as keyboard Date: Wed, 27 Feb 2008 16:41:13 -0500 > > 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 > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" For me, this patch also works with X!