From owner-freebsd-usb@FreeBSD.ORG Sun Sep 4 11:26:55 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6935916A41F for ; Sun, 4 Sep 2005 11:26:55 +0000 (GMT) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.swip.net [212.247.154.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55EB243D46 for ; Sun, 4 Sep 2005 11:26:53 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: Y1QAsIk9O44SO+J/q9KNyQ== Received: from mp-216-89-246.daxnet.no ([193.216.89.246] verified) by mailfe01.swip.net (CommuniGate Pro SMTP 4.3.4) with ESMTP id 54644590; Sun, 04 Sep 2005 13:26:50 +0200 From: Hans Petter Selasky To: jpandrusky@gmail.com, freebsd-usb@freebsd.org Date: Sun, 4 Sep 2005 13:27:42 +0200 User-Agent: KMail/1.7 References: <200508261423.46583.hselasky@c2i.net> <1125777448.9511.7.camel@localhost> In-Reply-To: <1125777448.9511.7.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509041327.45054.hselasky@c2i.net> Cc: Subject: Re: Problems with uhid device. X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: hselasky@c2i.net List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Sep 2005 11:26:55 -0000 On Saturday 03 September 2005 21:57, John-Paul Andrusky wrote: > Hi, > > Sorry for the long silence. I tried both of the alternatives below with > no success with either (does exactly the same thing). I've tried to > isolate the dmesg with hw.usb.uhci.debug=15 (please see bellow). As for > the version of FreeBSD (I guess I should have mentioned it before), I'm > running STABLE. > > Sep 3 07:58:52 sol kernel: uhci_non_isoc_done: xfer=0xc1cf7800 > pipe=0xc1a8717c transfer done > Sep 3 07:58:52 sol kernel: uhci_dump_td: TD(0xc1cf79e0) at 1802b9e4 = > link=0x1802ba04 status=0x1c000004 token=0x00817c69 buffer=0x1802b9d0 > Sep 3 07:58:52 sol kernel: uhci_dump_td: 1802ba04 > 1c000004,errcnt=3,actlen=5 pid=69,addr=124,endpt=2,D=0,maxlen=5 > Sep 3 07:58:52 sol kernel: uhci_dump_td: TD(0xc1cf7a00) at 1802ba04 = > link=0x00000001 status=0x1d500000 token=0x00097c69 buffer=0x1802b9d5 > Sep 3 07:58:52 sol kernel: uhci_dump_td: 1 > 1d500000,errcnt=3,actlen=1 > pid=69,addr=124,endpt=2,D=1,maxlen=1 I think the problem here is that the uhid driver sets up a too large packet for the interrupt endpoint. The above shows that the first packet is 5 bytes and the last packet is 1 byte, which makes up the 6 bytes of the interrupt structure. The size of the interrupt packet comes from the function: "hid_report_size()". "cat /sys/dev/usb/*hid* | more" if (id != 0) { size += 8; ^^^ maybe this is wrong, hence we are already adding 7 to the size below ? *idp = id; /* XXX wrong */ } else *idp = 0; return ((size + 7) / 8); A temporary patch might be to add something to the file "/sys/dev/usb/uhid.c" Where you find: sc->sc_isize = hid_report_size(desc, size, hid_input, &sc->sc_iid); sc->sc_osize = hid_report_size(desc, size, hid_output, &sc->sc_oid); sc->sc_fsize = hid_report_size(desc, size, hid_feature, &sc->sc_fid); Add here: if(sc->sc_isize > ed->wMaxPacketSize) sc->sc_isize = ed->wMaxPacketSize; Then try again. You should now only see a single interrupt packet with "maxlen=5". --HPS