From owner-freebsd-hardware@FreeBSD.ORG Wed Jun 9 22:58:18 2004 Return-Path: Delivered-To: freebsd-hardware@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C6E316A4CE for ; Wed, 9 Jun 2004 22:58:18 +0000 (GMT) Received: from crumpet.united-ware.com (ddsl-66-42-172-210.fuse.net [66.42.172.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id 993CA43D39 for ; Wed, 9 Jun 2004 22:58:17 +0000 (GMT) (envelope-from mistry.7@osu.edu) Received: from [192.168.0.6] (adsl-64-108-97-232.dsl.wotnoh.ameritech.net [64.108.97.232]) (authenticated bits=0)i59MpfQr000994 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Wed, 9 Jun 2004 18:51:43 -0400 (EDT) (envelope-from mistry.7@osu.edu) From: Anish Mistry To: freebsd-hardware@freebsd.org Date: Wed, 9 Jun 2004 18:58:00 -0400 User-Agent: KMail/1.6.2 References: <200406091838.i59Icugc063061@smsgw.vianetworks.ch> In-Reply-To: <200406091838.i59Icugc063061@smsgw.vianetworks.ch> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200406091858.34042.mistry.7@osu.edu> X-Spam-Status: No, hits=-4.9 required=5.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE, QUOTED_EMAIL_TEXT,RCVD_IN_ORBS,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_KMAIL version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: Markus Wild Subject: Re: Fix for Logitech DiNovo cordless mouse X-BeenThere: freebsd-hardware@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: General discussion of FreeBSD hardware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2004 22:58:18 -0000 =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 09 June 2004 02:38 pm, Markus Wild wrote: > Since yesterday I'm a happy owner of a Logitech dinovo > cordless USB keyboard/mouse. The keyboard works fine, however > the mouse didn't move a bit. I saw that other people had similar > "luck", so I enabled a bit of debugging. This is with FreeBSD-current, > btw. > > The result of the quest was: the hid.c:hid_report_size() function returns= a > bogus iid value: > > Jun 9 19:37:06 mothra kernel: ums0: Logitech USB Receiver, rev 1.10/24.0= 4, > addr 3, iclass 3/1 > Jun 9 19:37:06 mothra kernel: ums_attach: bLength=3D7 bDescriptorType=3D5 > bEndpoint Address=3D2-in bmAttributes=3D3 wMaxPacketSize=3D8 bInterval=3D= 10 > Jun 9 19:37:06 mothra kernel: ums0: 7 buttons and Z dir. > Jun 9 19:37:06 mothra kernel: ums_attach: sc=3D0xc23a1800 > Jun 9 19:37:06 mothra kernel: ums_attach: X 8/12 > Jun 9 19:37:06 mothra kernel: ums_attach: Y 20/12 > Jun 9 19:37:06 mothra kernel: ums_attach: Z 32/8 > Jun 9 19:37:06 mothra kernel: ums_attach: B1 0/1 > Jun 9 19:37:06 mothra kernel: ums_attach: B2 1/1 > Jun 9 19:37:06 mothra kernel: ums_attach: B3 2/1 > Jun 9 19:37:06 mothra kernel: ums_attach: B4 3/1 > Jun 9 19:37:06 mothra kernel: ums_attach: B5 4/1 > Jun 9 19:37:06 mothra kernel: ums_attach: B6 5/1 > Jun 9 19:37:06 mothra kernel: ums_attach: B7 6/1 > Jun 9 19:37:06 mothra kernel: ums_attach: size=3D36, id=3D17 > > Since actual interrupt reports are issed with id 2: > Jun 9 18:42:10 mothra kernel: ums_intr: sc=3D0xc23a1800 status=3D0 > Jun 9 18:42:10 mothra kernel: ums_intr: data =3D 02 00 fa > > So I added a bit of debugging to the id setting for-loop. It > looks like the ID cycles thru the following values at attach() time: > Jun 9 19:40:57 mothra kernel: hid_report_size: 00 -> 02 > Jun 9 19:40:57 mothra kernel: hid_report_size: 02 -> 03 > Jun 9 19:40:57 mothra kernel: hid_report_size: 03 -> 04 > Jun 9 19:40:57 mothra kernel: hid_report_size: 04 -> 10 > Jun 9 19:40:57 mothra kernel: hid_report_size: 10 -> 11 > (numbers are hex here) > > With this, my current fix is simple: only set id if it's not > set already: > diff -u -r1.23 hid.c > --- hid.c 24 Aug 2003 17:55:54 -0000 1.23 > +++ hid.c 9 Jun 2004 18:34:23 -0000 > @@ -374,9 +374,10 @@ > int size, id; > > id =3D 0; > + bzero (&h, sizeof (h)); > for (d =3D hid_start_parse(buf, len, 1< - if (h.report_ID !=3D 0) > - id =3D h.report_ID; > + if (h.report_ID !=3D 0 && !id) > + id =3D h.report_ID; > hid_end_parse(d); > size =3D h.loc.pos; > if (id !=3D 0) { > > I don't know whether this is any more correct or buggy than the > previous version, and I don't know whether it will break currently > working configurations, but it did get mine working. If your mouse > is currently of not much use, you might give it a try. > I just checked the NetBSD sources, and this has been fixed in revision 1.18= ,=20 which is over 2 years old and still hasn't been imported :(. I'm going to= =20 see if I can work up a big patch tonight. According to the NetBSD sources you need to have the following initilizatio= n: h.report_ID =3D 0; =2D --=20 Anish Mistry =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAx5YNxqA5ziudZT0RAljPAKDH0SMzK3al1i2+E42VAwc4OMdGQgCfb20E gqaGoDFGn6PtSJkgW+4cwsM=3D =3Dv+S2 =2D----END PGP SIGNATURE-----