[Libusbx-devel] Linux patches for 1.0.9 release

Xiaofan Chen xiaofanc at gmail.com
Thu Mar 29 10:05:38 EDT 2012


On Thu, Mar 29, 2012 at 9:12 PM, Hans de Goede <hdegoede at redhat.com> wrote:
>> More details here. Nathan did not like the idea
>> and closed the ticket as invalid.
>> http://www.libusb.org/ticket/33
>>
>> Also here.
>> http://www.libusb.org/wiki/FAQ#CanIcreateadriverlessdeviceusingHIDclass
>> "On Mac OS X you must install a codeless kext kernel driver and
>> then reboot, before you can communicate with the device."
>>
>> On certain Mac OS X version, the code-less kext may
>> not work well.
>
>
> AFAIK Mac OS X does have a call to ask the driver to release
> the device, but the driver may refuse ...

Yes that is true. Unfortunately the Mac OS X HID
driver is one of the OS X driver which does not support
this feature.
http://libusb.6.n5.nabble.com/OpenUSB-LibUSB-on-Mac-OS-X-td5444418.html
http://stackoverflow.com/questions/3368008/reading-and-writing-to-usb-hid-interrupt-endpoints-on-mac

>>> I believe it is not true for OpenBSD either. You may
>>> have to rebuild the kernel to disable HID (but enable
>>> mouse and keyboard).  That was needed for older
>>> version of FreeBSD to access HID device using
>>> libusb. FreeBsd 8/9 may change that already but
>>> I am not that sure now.
>>
>>
>> For OpenBSD the price you pay is to lose your
>> USB mouse and keyboard in order to use libusb
>> (based on ugen driver).
>>
>> http://www.apcupsd.com/manual/manual.html#platform-support
>> ++++++
>> OpenBSD
>> (you will lose use of USB keyboard and mouse):
>> Disable: uhidev, ums, wsmouse, ukbd, wskbd, uhid
>> Enable: ugen
>> +++++
>
>
> Suck, time to fix OpenBSD?
>

Get the other Hans (HPS, Hans Peter Selasky, FreeBSD new
USB stack developer) to work on a new USB stack for
OpenBSD? :-)
http://www.youtube.com/watch?v=QGF2FJbiJ7A (HPS' video)

And maybe also for NetBSD if someone comes out with
a libusb-1.0 backend for NetBSD (should be quite similar
to OpenBSD, both will be based on ugen driver).


FreeBSD's solution to the problem: it seems to bind two driver
(ugen and uhid) to the same generic HID device. Therefore I
can use libusb based program for FreeBSD 9 with USB HID
device, without doing anything.

An example: Microchip PICkit 2 USB HID device.
http://www.microchip.com/pickit2

[mcuee at FreeBSD9VM ~/Desktop/build/pk2cmdv1.20LinuxMacSource] dmesg
...
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

[mcuee at FreeBSD9VM ~/Desktop/build/pk2cmdv1.20LinuxMacSource]$ sudo ./pk2cmd -?V

Executable Version:    1.20.00
Device File Version:   1.55.00
OS Firmware Version:   2.32.00


Operation Succeeded



-- 
Xiaofan



More information about the libusbx mailing list