[Nut-upsdev] ups_set_altinterface() breaks tripplite_usb on Mac OS X
Charles Lepple
clepple at gmail.com
Thu Sep 3 12:52:58 UTC 2009
On Thu, Sep 3, 2009 at 5:05 AM, Arnaud Quette<aquette.dev at gmail.com> wrote:
>
> 2009/9/3 Charles Lepple <clepple at gmail.com>
>>
>> Is there a particular reason why we are setting the alternate
>> interface to 0 in drivers/libusb.c?
>>
>> I have seen some documentation which indicates that this should
>> already done by the OS when the device is enumerated. If that is the
>> case, then there is no reason why we should hardcode the alternate
>> interface to 0.
>
> iirc, this is indeed done automatically on Linux (and possibly OSX) when
> there's only one interface (the same goes for the config). but it's not the
> case on windows.
Stephan of libusb-win32 seems to disagree:
http://osdir.com/ml/lib.libusb.devel.windows/2005/msg00093.html
>> If I remove the following code, tripplite_usb seems to work*:
>>
>> /* set default interface */
>> usb_set_altinterface(udev, 0);
>
> prefer to flag it for windows (#ifdef WIN32...) so that we don't face a
> problem when porting to windows.
I might put a comment in there, but if that call is needed, it should
be pretty obvious during porting.
>> Any objections to removing this? Can I get some volunteers to try this
>> out on their non-OS X systems?
>>
>> I am using libusb-0.1.12 on Mac OS X 10.5.8.
>>
>> * I did have to monkey with a codeless kext in order to allow libusb
>> to claim the device. However, it doesn't seem like OS X allows you to
>> bypass the claim operation anymore.
>
> I'll be interested in the result since usbhid-ups, bcmxcp_usb and richcomm
> are in the same case.
> I'll try to make an OS X test on usbhid-ups with an Eaton...
The codeless kext stuff is not too complicated - we could probably
generate them the same way as the udev configuration files. The only
trick is that the USB VID, PID, bConfigurationValue, bInterfaceNumber
and bcdDevice values need to be included, in decimal (and the latter
probably needs to be extracted from lsusb output that users have
posted to the mailing lists).
--
- Charles Lepple
More information about the Nut-upsdev
mailing list