From owner-freebsd-stable@FreeBSD.ORG Thu Feb 28 20:13:49 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14DAF1065670; Thu, 28 Feb 2008 20:13:49 +0000 (UTC) (envelope-from bazerka@beardz.net) Received: from svr03-temp.btshosting.co.uk (svr03-temp.btshosting.co.uk [87.117.208.48]) by mx1.freebsd.org (Postfix) with ESMTP id 7688A8FC14; Thu, 28 Feb 2008 20:13:48 +0000 (UTC) (envelope-from bazerka@beardz.net) Received: from [192.168.1.65] (host86-139-98-128.range86-139.btcentralplus.com [86.139.98.128]) (authenticated bits=0) by svr03-temp.btshosting.co.uk (8.14.1/8.14.1) with ESMTP id m1SKDjde047530; Thu, 28 Feb 2008 20:13:45 GMT (envelope-from bazerka@beardz.net) Message-ID: <47C715EC.9020603@beardz.net> Date: Thu, 28 Feb 2008 20:13:32 +0000 From: Jase Thew User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: bazerka@beardz.net References: <20080223120658.GA30178@asgard.home> <47C082E9.5000608@bsdforen.de> <200802271641.42450.jhb@freebsd.org> <47C712D2.3040302@beardz.net> In-Reply-To: <47C712D2.3040302@beardz.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.92.1, clamav-milter version 0.92.1 on 87.117.208.49 X-Virus-Status: Clean Cc: Dominic Fandrey , Oliver Herold , imp@freebsd.org, freebsd-stable@freebsd.org, John Baldwin Subject: Re: FreeBSD 7, Razer Copperhead mouse patch X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bazerka@beardz.net List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2008 20:13:49 -0000 Jase Thew wrote: > John Baldwin wrote: >> On Saturday 23 February 2008 03:32:41 pm Dominic Fandrey wrote: >>> Oliver Herold wrote: >>>> Hi >>>> >>>> the Razer Copperhead mouse did work in FreeBSD 7 (current) for a long >>>> time, but after some period it stopped working. This patch from Uwe >>>> Grohnwaldt: >>>> >>>> http://www.freebsd.org/cgi/query-pr.cgi?pr=usb/118670 >>>> >>>> fixes this wrong behaviour (it's detected as keyboard) and makes the >>>> mouse work in FreeBSD 7 again. Would be imho a nice addition for >>>> RELENG_7 (stable) or even Release. >>>> >>>> Cheers, Oliver >>> Being a Razer fan and user I totally agree. >> Can you try this patch instead? >> >> 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; >> > > Hi, > > Out of curiosity, what was wrong with the way I did it in my patch? > > Regards, > > Jase. > _______________________________________________ Ah, I see John has described why in the PR. As the hid collection test doesn't seem to be working fully, what would be the downside of testing the descriptor directly but removing the SubClass test, as the spec defines only two available values - 1 for using Boot Protocol and 2 for Unknown. As we can't test for a SubClass of 0 (due to the reason you mention above), removing the SubClass test will reintroduce full support for mice that report as not using boot protocol (such as the various Razor mice). Regards, Jase.