[haiku-commits] Re: r42812 - in haiku/trunk: headers/os/device src/add-ons/kernel/drivers/bus/usb src/kits/device

  • From: "Michael Lotz" <mmlr@xxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 09 Oct 2011 22:07:58 +0200

Philippe Houdoin <philippe.houdoin@xxxxxxxxx> wrote:
>> Could you please expain what you are trying to solve?
>
> Well, libusb requires to be able to return the *whole* descriptor,
> and
> applications using this API expect to find the whole one.
> Because they parse it themselves, something libusb don't really wrap.
>
> ...

I see. Since you actually need something unparsed, you could've instead
simply used the normal BUSBDevice::GetDescriptor() to request the
configuration
descriptor though. The other calls only use specific ioctls because
they request the parsed data from the USB module. You could either
still provide that through BUSBConfiguration (using BUSBDevice::
GetDescriptor() internally) or you could simply use BUSBDevice::
GetDescriptor() from libusb directly.

> >>       B_USB_RAW_COMMAND_GET_ALT_INTERFACE_COUNT,
> >>       B_USB_RAW_COMMAND_GET_ACTIVE_ALT_INTERFACE_INDEX,
> >> +     B_USB_RAW_COMMAND_GET_CONFIGURATION_DESCRIPTOR_ETC,
> >
> > Adding that there will break the old-USBKit <-> usb_raw interface,
>
> Are you sure?

I didn't look that closely at first and thought you added it inbetween.
I see now that you added it to the Haiku additions, so yeah, that's
fine.

Regards
Michael

Other related posts: