From owner-freebsd-questions@FreeBSD.ORG Tue Nov 4 17:02:09 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D7C1106567C for ; Tue, 4 Nov 2008 17:02:09 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe10.swipnet.se [212.247.155.33]) by mx1.freebsd.org (Postfix) with ESMTP id AE3398FC17 for ; Tue, 4 Nov 2008 17:02:08 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=d6BVkb5LuPPVEe4iNQMLyA==:17 a=SvBKbF2r-Qai6NR0jUYA:9 a=fwipAer_VuWxVy2JeHUA:7 a=DERtoPPVWl7d8ENQQxKiokMogH0A:4 a=LY0hPdMaydYA:10 Received: from [62.113.135.6] (account mc467741@c2i.net [62.113.135.6] verified) by mailfe10.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 969535923; Tue, 04 Nov 2008 17:02:05 +0100 From: Hans Petter Selasky To: Bruce Cran Date: Tue, 4 Nov 2008 17:04:08 +0100 User-Agent: KMail/1.9.7 References: <80794437@bs1.sp34.ru> <20081104074623.25f51f27@tau.draftnet> In-Reply-To: <20081104074623.25f51f27@tau.draftnet> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811041704.09463.hselasky@c2i.net> Cc: Boris Samorodov , Alfred Perlstein , freebsd-questions@freebsd.org Subject: Re: garmin forerunner 305 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 17:02:09 -0000 On Tuesday 04 November 2008, Bruce Cran wrote: > On Tue, 04 Nov 2008 14:57:14 +0300 > > Boris Samorodov wrote: > > Bruce Cran writes: > > > I don't know if it'll work with the usb stack that's in shipping > > > version of FreeBSD though, and even with the new stack I had to > > > make a change to libgpsusb.c in gpsbabel to get it working. > > > > Can you submit a patch? Thanks! > > Having just read about endpoint addresses I'm not sure who's wrong. > gpsbabel truncates the address to the first 4 bytes using > USB_ENDPOINT_ADDRESS_MASK from libusb20 while > the stack clearly wants the rest, including the top 'direction' bit. In > fact in /sys/dev/usb2/core/usb2_device.c line 114 it masks out the > reserved bits but still keeps the direction bit. usb2_get_pipe_by_addr > was failing when passed address 1 because the full endpoint address is > 0x81 (endpoint 1, direction IN). It looks as though by changing EA_MASK > to be just the endpoint number would fix the problem, but I'm not > sure if that's correct. Hi, I'm going to fix this in libusb20. In the callbacks in libusb20 we know the direction and I will simply just fix it there. The applications I tested so far passed the correct endpoint value. --HPS int usb_bulk_write(usb_dev_handle * dev, int ep, char *bytes, int size, int timeout) { return (usb_std_io(dev, ep, bytes, size, timeout, 0)); } int usb_bulk_read(usb_dev_handle * dev, int ep, char *bytes, int size, int timeout) { return (usb_std_io(dev, ep, bytes, size, timeout, 0)); } int usb_interrupt_write(usb_dev_handle * dev, int ep, char *bytes, int size, int timeout) { return (usb_std_io(dev, ep, bytes, size, timeout, 1)); } int usb_interrupt_read(usb_dev_handle * dev, int ep, char *bytes, int size, int timeout) { return (usb_std_io(dev, ep, bytes, size, timeout, 1)); }