From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 20 04:36:46 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4196616A41F for ; Thu, 20 Oct 2005 04:36:46 +0000 (GMT) (envelope-from bsdaemon@comcast.net) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDE3543D64 for ; Thu, 20 Oct 2005 04:36:45 +0000 (GMT) (envelope-from bsdaemon@comcast.net) Received: from fw.home (pcp05405355pcs.norstn01.pa.comcast.net[68.81.66.212]) by comcast.net (rwcrmhc12) with SMTP id <20051020043645014006t16be>; Thu, 20 Oct 2005 04:36:45 +0000 Received: (qmail 7020 invoked from network); 20 Oct 2005 04:36:44 -0000 Received: from kris.home (f193b53bfd7ee2cfdc610ac00f3441d5@192.168.0.251) by fw.home with SMTP; 20 Oct 2005 04:36:44 -0000 Received: (qmail 49220 invoked by uid 1000); 20 Oct 2005 04:36:44 -0000 Date: Thu, 20 Oct 2005 00:36:44 -0400 From: Kris Maglione To: freebsd-hackers@freebsd.org Message-ID: <20051020043644.GB38525@kris.home> Mail-Followup-To: freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Subject: USB mouse problem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2005 04:36:46 -0000 I've had a Gyration USB keyboard/mouse combo for a few years, and haven't used the mouse, simply because it didn't work with FreeBSD. I've finally gotten around to trying to do something about that. Both the mouse and keyboard are recognized. The problem is that all input is ignored unless the middle mouse button is depressed. In that case, though, the input is garbled... There are spurious button events and the x/y/z axes seemingly random values. y/z tend to stay around the same number, though those numbers change each time that ums is attached. I've found where the input is disguarded, in ums.c:447 (RELENG_5 tag) ibuf = sc->sc_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. * Currently it's the only user of UMS_T so use it as an identifier. * We probably should switch to some more official quirk. */ if (sc->flags & UMS_T) { if (sc->sc_iid) { if (*ibuf++ == 0x02) return; } } else { if (sc->sc_iid) { if (*ibuf++ != sc->sc_iid) // Returns here return; } } It returns in the else block as labeled by the comment. The value of *ibuf (i.e. sc->sc_ibuf[0]) is always 0x00 and sc->sc_iid is always 0x04. With the wheel down, they're both 0x04. If I comment out the return line, I get the same garbled data that I get with the wheel button down. In that case, though, the x access movement values are more or less accurate. This seems to me like the problems caused by setting the wrong protocol for ps/2/serial mice, but you can't choose the protocol for USB mice. Any help on the matter would be appreciated. I have debugging output also, if that would help. Here's what I get on ums attach: > ums0: Gyration GyroPoint RF Technology Receiver, rev 1.10/1.20, addr 2, iclass > 3 > /1 > ums0: 7 buttons and Z dir. > ums_attach: sc=0xc1faa000 > ums_attach: X 8/8 > ums_attach: Y 16/8 > ums_attach: Z 24/8 > ums_attach: B1 0/1 > ums_attach: B2 1/1 > ums_attach: B3 2/1 > ums_attach: B4 3/1 > ums_attach: B5 4/1 > ums_attach: B6 32/1 > ums_attach: B7 33/1 > ums_attach: size=15, id=4 Thanks -- Kris Maglione If you are already in a hole, there's no use to continue digging.