From owner-freebsd-usb@FreeBSD.ORG Mon Aug 25 14:26:13 2008 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5A72106567B for ; Mon, 25 Aug 2008 14:26:13 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.190]) by mx1.freebsd.org (Postfix) with ESMTP id 855AC8FC21 for ; Mon, 25 Aug 2008 14:26:13 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: by rn-out-0910.google.com with SMTP id j71so368822rne.12 for ; Mon, 25 Aug 2008 07:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=C8bUPkw/BMDrB+QxNLPXoKsd/xWc8KDHPM23WX4obK4=; b=MZX6MW+cfqIeK7e1pV3VtFvrPLWUezMyQLtxlb0LJcGbfglsZz+dhQIYSPWsWuc30y IDgU5pyFSc4knCs+xT2rSZ9My+4HYRsfd1Rn0un0DyMUlKSvUnHYc2Dgjiw+bksEOAFQ eLN6cMlqjxWnU61peuUqydXMHPYzsuxn4fH3o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=aDqayPA6Ks8P7dvgoANxWl6NM5a0RPbZ3CPlEOmXOZzKXMWYz0JIwdwcqI/D5e0srp uy7yz/axv6Cgl/kt08IXtJPSPzWg6/MFQelKeAd9x6vHfn05su7rgY2dMRecFLFBXTqj SMsc5dMuxQ3ZSObjhJhiraCpY1MPJHEXXxyVw= Received: by 10.114.25.3 with SMTP id 3mr3341589way.22.1219672525812; Mon, 25 Aug 2008 06:55:25 -0700 (PDT) Received: by 10.115.94.8 with HTTP; Mon, 25 Aug 2008 06:55:25 -0700 (PDT) Message-ID: Date: Mon, 25 Aug 2008 15:55:25 +0200 From: "Rene Ladan" To: usb@freebsd.org In-Reply-To: <48B1AEB5.7050903@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48B11C77.3060708@gmx.de> <48B1A73F.7070301@gmail.com> <48B1AEB5.7050903@gmx.de> Cc: Subject: Fwd: Patch for libusb 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: Mon, 25 Aug 2008 14:26:14 -0000 Hi, this is about a one-line patch for libusb-0.1.12 which is available in the ports tree as devel/libusb. Is it ok to send a problem report for this? Regards, Rene ---------- Forwarded message ---------- From: Volker Theile Date: 2008/8/24 Subject: Re: Patch for libusb To: Rene Ladan -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Rene Ladan wrote: | Volker Theile schreef: |> Hello, |> |> i had to modify the bsd.c patch to get NUT (Network UPS tools) working correctly when i attach an UPS via USB to my FreeBSD machine. Without the patch the communication breaks every few seconds because of an full read buffer. NUT checks the input buffer too fast, so the kernel or something else blocks which will cause an communication break to the UPS. Don't know if i have explained it correctly, but it works. |> | The only difference between this patch and the one in devel/libusb/files is | that the fd is opened in non-blocking mode, right? | | Regards, | Rene Yes, that's correct. I've found the origin article where i've read about that patch for NetBSD. http://wiki.botka.homeunix.org/bin/view/Main/NetworkUpsToolsUsb - ------ cut -------------------------------- ~ todo: ~ 1. upsmon section ~ 2. Install libusb 0.1.12 ,0.1.11 includes a bug fix for *BSD to allow short reads. Without thisvarious status is not returned from UPS. ~ 3. Problem with libusb on netBSD in that the Function usb_interrupt_read() calls read() which blocks on read from usb until buffer is full. Change bsd.c in libusb Fd = ensure_ep_open(dev, ep, 0, O_RDONLY) To Fd = ensure_ep_open(dev, ep, 0, O_RDONLY | O_NONBLOCK) - ------ cut -------------------------------- I don't know whether this fix has any consequences for other applications, but for NUT it helps and now i can use my UPS via USB. Regards Volker -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkixrrQACgkQzsRXLGDcg0pMugCeKg2BtXAx+PjneOUKRhp+j5Bk +kAAn3DabDmqu9OSLrG1zoO0tupgeqqZ =ksxG -----END PGP SIGNATURE----- -- http://www.rene-ladan.nl/ GPG fingerprint = E738 5471 D185 7013 0EE0 4FC8 3C1D 6F83 12E1 84F6 (subkeys.pgp.net)