using devel/libusb to access USB

Toni Andjelkovic toni at soth.at
Tue Nov 25 01:53:34 PST 2003


On Mon, Nov 24 2003 (09:25:52 -0500), Dan Langille wrote:
> We have been looking at the devel/libusb port and experimenting with 
> testlibusb which is a part of that port.  We have noticed that 
> usb_find_devices() does not find any devices.  Looking at the usb.c 
> code within libusb, we found that usb_os_find_devices() does not 
> return any devices, and therefore the while loop is never entered.
> 
> We tracked the problem down to usb_os_find_devices() (within bsd.c) 
> and found that various things were preventing the list from being 
> created.

I have experienced a similar problem a few months ago. I've tracked
it to ugenopen() in sys/dev/usb/ugen.c, which returned EBUSY if
the control endpoint /dev/ugen0 was already open. Consequently,
usb_find_devices() failed to return anything useful.

However, as Bernd Walter suggested in a recent posting to hackers@,
this could be avoided by using interface specific endpoints (/dev/ugen?.?)
instead of the control endpoint (/dev/ugen?) for communication.

Cheers,
Toni


More information about the freebsd-hackers mailing list