On Thu, May 31, 2012 at 9:34 AM, Xiaofan Chen <xiaof...@gmail.com> wrote: > In case you do not notice this, libusb-1.0.9 release > support OpenBSD thanks to the great work of Martin Pieuchot. > You are welcome to try it. > http://www.libusb.org/wiki/libusb-1.0 > http://git.libusb.org/?p=libusb.git;a=tree;f=libusb/os > libusb-1.0 and libusb-compat should be in OpenBSD port system > as well now. > > libusbx is a fork of libusb-1.0 and it has more active development > activities. libusb-1.0.11 supports OpenBSD as well. > http://www.libusbx.org/ > http://www.phoronix.com/scan.php?page=news_item&px=MTEwNTY > > But right now the OpenBSD codes are a bit behind the other OS > (Linux, Mac OS X and Windows) since it does not support some > target features for the upcoming 1.0.12 release, eg, the topology API. > http://sourceforge.net/apps/trac/libusbx/roadmap > http://libusbx.git.sourceforge.net/git/gitweb.cgi?p=libusbx/libusbx;a=commit;h=cfb8610242394d532778a483570089c2bed52c84 > > Hopefully those who are interested in libusbx can subscribe to > libusb and libusbx mailing list and help improve the codes for > OpenBSD. Thanks. >
libusb-1.0/libusbx under BSDa use ugen, so only ugen device are supported. One of the problems with libusb under BSD is that it is not possible to detach and attach ugen. So if uhid has attached, you are stuck with it. The kernel detaching and attaching function of libusb is only implemented under Linux where the usbfs driver can be the fall back driver if you detach the existing device driver and usbfs is what libusb is based on under Linux. For Windows, it is possible to switching driver manually or using program but it is an expensive operation and thus it is out of libusb. I am not so sure if NetBSD can borrow the idea from FreeBSD's USB stack written by HPS. It is a very nice feature that FreeBSD 9 loads ugen along with uhid for generic USB HID device like my Microchip PICKit 2. With that, I can use libusb based program on generic HID device without the need to do anything. ugen0.2: <Microchip Technology Inc.> at usbus0 uhid0: <Microchip Technology Inc. PICkit 2 Microcontroller Programmer, class 0/0, rev 2.00/0.02, addr 2> on usbus0 uhid0: at uhub0, port 1, addr 2 (disconnected) But of course this will be quite a bit of work since it involve kernel modification. The other possibility is to learn from Mac OS X where you can use a code-less kext to prevent the existing kernel driver from attaching to a device (or a class of device) based on certain criteria. -- Xiaofan ( non-developer admin of libusx, libusb-win32 and libusbk)