Fwd: Patch for libusb
Rene Ladan
r.c.ladan at gmail.com
Mon Aug 25 14:26:14 UTC 2008
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 at gmx.de>
Date: 2008/8/24
Subject: Re: Patch for libusb
To: Rene Ladan <r.c.ladan at 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)
More information about the freebsd-usb
mailing list