From owner-freebsd-hardware@FreeBSD.ORG Wed Jun 9 18:38:59 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 8F2CF16A4E6 for ; Wed, 9 Jun 2004 18:38:59 +0000 (GMT) Received: from smsgw.vianetworks.ch (smsgw.vianetworks.ch [146.228.10.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE5A743D49 for ; Wed, 9 Jun 2004 18:38:58 +0000 (GMT) (envelope-from mw@smsgw.vianetworks.ch) Received: from smsgw.vianetworks.ch (localhost.kpnqwest.ch [127.0.0.1]) by smsgw.vianetworks.ch (8.12.10/8.12.6) with ESMTP id i59Icuhm063062 for ; Wed, 9 Jun 2004 20:38:56 +0200 (CEST) (envelope-from mw@smsgw.vianetworks.ch) Received: (from mw@localhost) by smsgw.vianetworks.ch (8.12.10/8.12.6/Submit) id i59Icugc063061 for freebsd-hardware@freebsd.org; Wed, 9 Jun 2004 20:38:56 +0200 (CEST) Message-Id: <200406091838.i59Icugc063061@smsgw.vianetworks.ch> To: freebsd-hardware@freebsd.org Date: Wed, 9 Jun 2004 20:38:56 +0200 (CEST) Sender: mw@smsgw.vianetworks.ch From: Markus Wild X-NCC-RegID: ch.vianetworks X-Mailer: ELM [version 2.4ME+ PL99b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Subject: 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 18:38:59 -0000 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.04, addr 3, iclass 3/1 Jun 9 19:37:06 mothra kernel: ums_attach: bLength=7 bDescriptorType=5 bEndpoint Address=2-in bmAttributes=3 wMaxPacketSize=8 bInterval=10 Jun 9 19:37:06 mothra kernel: ums0: 7 buttons and Z dir. Jun 9 19:37:06 mothra kernel: ums_attach: sc=0xc23a1800 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=36, id=17 Since actual interrupt reports are issed with id 2: Jun 9 18:42:10 mothra kernel: ums_intr: sc=0xc23a1800 status=0 Jun 9 18:42:10 mothra kernel: ums_intr: data = 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 = 0; + bzero (&h, sizeof (h)); for (d = hid_start_parse(buf, len, 1<