libusb patch for FreeBSD

This patch to libusb and the kernel makes it possible for the FreeBSD USB stack to communicate with digital cameras using the "Sierra protocol" (see this page for more information). This protocol is not used in any new devices manufactured after 2001.  But, if you are like me and own a nice camera (mine is an Olympus) that was made before that, you might want this hack.

This is not pretty.  I do not expect this to ever be part of an official solution to this problem.  The real problem is that the camera driver is not speaking official USB.  It expects a major USB error recovery operation ("clear endpoint halt") as part of the normal protocol.

I do not support this. I'll ignore your questions on this code.  Don't try it unless you know what you are doing.  If you are not sure, then you do not know what you are doing.

The patches below add an ioctl to the ugen driver, which sets a condition in the driver that will fire a "clear endpoint stall" operation on the next read(2) operation, rather than transferring data.  This can be used by libusb to correctly implement the usb_clear_halt() function of libusb.

patch for libusb-0.1.7
patch for FreeBSD 4.7 kernel (should also work on later 4.X and 5.X kernels)