From owner-freebsd-usb@FreeBSD.ORG Fri Aug 4 07:39:15 2006 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 824A116A4E0 for ; Fri, 4 Aug 2006 07:39:15 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by mx1.FreeBSD.org (Postfix) with ESMTP id C971B43D46 for ; Fri, 4 Aug 2006 07:39:14 +0000 (GMT) (envelope-from r.c.ladan@gmail.com) Received: by nf-out-0910.google.com with SMTP id n15so1350044nfc for ; Fri, 04 Aug 2006 00:39:13 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding; b=fhM0GI3j2lpFavZqf9fL1k5xmzvWsfD3VLuGRYNiLnr6WT83SpWPQjgLlSDsFEGQHzXDC8djecjjGAjc6knEqD4zU3w0fmXaMFeltQ6vg+RQRp2tUGwUkMpKGK/jVA9pJDE0AswekPbAuo0VXYFjHlXeXSB+eO8BWBMpjs6bbPQ= Received: by 10.49.10.3 with SMTP id n3mr4929074nfi; Fri, 04 Aug 2006 00:39:13 -0700 (PDT) Received: from ?131.155.68.207? ( [131.155.68.207]) by mx.gmail.com with ESMTP id l27sm2167646nfa.2006.08.04.00.39.12; Fri, 04 Aug 2006 00:39:13 -0700 (PDT) Message-ID: <44D2F99D.80306@gmail.com> Date: Fri, 04 Aug 2006 09:39:09 +0200 From: Rene Ladan User-Agent: Thunderbird 1.5.0.5 (X11/20060729) MIME-Version: 1.0 To: Konrad.Jankowski@master.ether.net References: <200608031759.k73Hxi40002311@master.ether.net> In-Reply-To: <200608031759.k73Hxi40002311@master.ether.net> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: libusb-devel@lists.sourceforge.net, freebsd-usb@freebsd.org Subject: Re: [Libusb-devel] [PATCH] FreeBSD fix for usb_control_msg() X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2006 07:39:15 -0000 Konrad.Jankowski@master.ether.net schreef: > I don't know how Net- or Open- handle this, but > FreeBSD returns the number of transmited bytes in > req.ucr_actlen, not in req.ucr_request.wLength. > (/usr/include/dev/usb/usb.h:544: > int ucr_actlen; /* actual length transferred */ > > So then: > --- bsd.c Sat Mar 4 03:52:46 2006 > +++ ../../bsd.c Thu Aug 3 19:19:15 2006 > @@ -476,8 +476,11 @@ > if (ret < 0) > USB_ERROR_STR(-errno, "error sending control message: %s", > strerror(errno)); > - > +#ifdef __FreeBSD_kernel__ > + return req.ucr_actlen; > +#else > return UGETW(req.ucr_request.wLength); > +#endif > } > > int usb_os_find_busses(struct usb_bus **busses) > This seems correct, wLength is a uWord defined in usb_device_request_t (usb/usb.h:112). usb_device_request_t is included in usb_ctl_request (usb/usb.h:542), which is the structure in which ucr_actlen (int) is defined (usb/usb.h:546) I am cc'ing freebsd-usb@ since I'm not sure about this patch... Regards, Rene -- GPG fingerprint = E738 5471 D185 7013 0EE0 4FC8 3C1D 6F83 12E1 84F6 (subkeys.pgp.net) "It won't fit on the line." -- me, 2001