[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 18:48:16 +0200

philippe.houdoin@xxxxxxxxx wrote:
> Author: phoudoin
> Date: 2011-10-09 17:15:15 +0200 (Sun, 09 Oct 2011)
> New Revision: 42812
> Changeset: https://dev.haiku-os.org/changeset/42812
>
> Log:
> Expand usb_raw ioctl to support retrieving full usb configuration 
> descriptor from userland, not only the header part.
> I try to keep UBSConfiguration binary compatibility, but proofreading 
> is welcome.

Could you please expain what you are trying to solve? The configuration 
descriptor is supposed to only consist of interface descriptors that 
then contain endpoint and generic descriptors. All of those can be 
enumerated via the corresponding BUSBConfiguration/BUSBInterface members 
(BUSBInterface::OtherDescriptorAt() would be for enumerating generic 
descriptors). This is also true for non-active configuration/interface 
descriptors.

> Modified: haiku/trunk/src/add-ons/kernel/drivers/bus/usb/usb_raw.cpp
>                       const usb_configuration_info *configurationInfo =
> ...
> +                     const usb_configuration_descriptor* descriptor 

Please keep the pointer style consistent with the rest of the file. 
Especially when it's obvious as in this case where the next pointer is 
just a few lines up.

> Modified: haiku/trunk/src/add-ons/kernel/drivers/bus/usb/usb_raw.h
> ===================================================================
>       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, 
which up until now was still compatible (i.e. stuff built with USBKit.a 
under BeOS would work due to the fixed ioctl interface against 
usb_raw).

Regards
Michael

Other related posts: