Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Aug 2008 15:55:25 +0200
From:      "Rene Ladan" <r.c.ladan@gmail.com>
To:        usb@freebsd.org
Subject:   Fwd: Patch for libusb
Message-ID:  <e890cae60808250655g18e073bp6e9b6eb91bef589c@mail.gmail.com>
In-Reply-To: <48B1AEB5.7050903@gmx.de>
References:  <48B11C77.3060708@gmx.de> <48B1A73F.7070301@gmail.com> <48B1AEB5.7050903@gmx.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <votdev@gmx.de>
Date: 2008/8/24
Subject: Re: Patch for libusb
To: Rene Ladan <r.c.ladan@gmail.com>


-----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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e890cae60808250655g18e073bp6e9b6eb91bef589c>