2014-08-06 7:34 GMT+02:00 Akshay Jaggi <akshay1994.leo@xxxxxxxxx>: > I greped for device_address in libusb code. Yes, its basically for > information purposes only, though it might be used by some programs to take > device input from user (for example libusb/examples/fxload.c). But then > again, they also have the usual method of vid:pid. > Just to satisfy the requirement, I can add the integers in path of device > file descriptor, and store that value here. We could eventually add a more generic B_USB_RAW_COMMAND_GET_PROPERTY. > > This IOCTL only handles usb_generic_descriptor. You should probably > > > Don't we have B_USB_RAW_COMMAND_GET_GENERIC_DESCRIPTOR for generic > descriptors? Sure, it's just wTotalLength isn't generic, it's only usable for configuration descriptors. > > use B_USB_RAW_COMMAND_GET_CONFIGURATION_DESCRIPTOR instead, and patch > it to use "total_length": > * if the provided buffer is exactly the size of > usb_configuration_descriptor, then just copy that length and return > OK. > * if the provided buffer is bigger but too small, then copy that > length and return B_BUFFER_OVERFLOW. > The USBKit can eventually be extended later. > > > We do not get the size of the buffer in > B_USB_RAW_COMMAND_GET_CONFIGURATION_DESCRIPTOR. We have this information in > B_USB_RAW_COMMAND_GET_DESCRIPTOR. You mean the command descriptor buffer? The size of the descriptor is in the descriptor itself. As I wrote, retrieving the full configuration descriptor would require two calls, one to get the standard part "length", one for the total length. Bye, Jérôme