From owner-cvs-all@FreeBSD.ORG Sun Dec 12 14:11:28 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B2AEE16A4D4; Sun, 12 Dec 2004 14:11:28 +0000 (GMT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 28D4743D2F; Sun, 12 Dec 2004 14:11:27 +0000 (GMT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 12 Dec 2004 14:11:26 +0000 (GMT) To: Scott Mitchell In-Reply-To: Your message of "Sun, 12 Dec 2004 13:37:52 GMT." <20041212133752.GE68019@tuatara.fishballoon.org> Date: Sun, 12 Dec 2004 14:11:22 +0000 From: Ian Dowse Message-ID: <200412121411.aa89799@salmon.maths.tcd.ie> cc: src-committers@freebsd.org cc: cvs-src@freebsd.org cc: Scott Long cc: cvs-all@freebsd.org cc: Ceri Davies cc: Julian Elischer Subject: Re: cvs commit: src/sys/sys mouse.h src/sys/dev/usb ums.c usbhid.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2004 14:11:28 -0000 In message <20041212133752.GE68019@tuatara.fishballoon.org>, Scott Mitchell wri tes: >On Sun, Dec 12, 2004 at 12:23:05PM +0000, Ceri Davies wrote: >> On Sat, Dec 11, 2004 at 10:39:10PM -0700, Scott Long wrote: >> > Julian Elischer wrote: >> > > Add support for USB Microsoft Intellimouse >> > > >> > > PR: kern/70607 >> > > Submitted by: Matt Wright >> > > MFC after: 1 week >> > >> > What 'support' does this add? >> >> They have another axis on the wheel: you can tilt it from left to right. >> >> Ceri > >Apart from that, the device in question (wireless Intellimouse 2.0) didn't >work as any kind of mouse without this patch. > > Scott As pointed out in the PR though, it doesn't seem necessary to change struct mousestatus and the MOUSE_GETSTATUS ioctl API just to make the device work. All other mouse drivers in the tree will need to be updated to initialise the new `dt' field. There's also one part of the patch that looks as if it could easily break other devices: ibuf = sc->sc_ibuf; if (sc->sc_iid) { - if (*ibuf++ != sc->sc_iid) - return; + ibuf++; } + /* The M$ Wireless Intellimouse 2.0 sends 1 extra leading byte of + * data compared to most USB mice. This byte frequently switches + * from 0x01 (usual state) to 0x02. I assume it is to allow + * extra, non-standard, reporting (say battery-life). However + * at the same time it generates a left-click message on the button + * byte which causes spurious left-click's where there shouldn't be. + * This should sort that. */ + if ((sc->sc_ibuf != ibuf) && (sc->sc_ibuf[0] == 0x02)) + return; + dx = hid_get_data(ibuf, &sc->sc_loc_x); dy = -hid_get_data(ibuf, &sc->sc_loc_y); dz = -hid_get_data(ibuf, &sc->sc_loc_z); BTW, Anish Mistry has been looking at porting a more recent version of NetBSD's HID fremework to FreeBSD, which I believe may fix the real bugs that the above code just tries to work around. Ian