From 3a367aec99e7d0d46f5d53eae634f589bae95fd7 Mon Sep 17 00:00:00 2001 From: "Ithamar R. Adema" Date: Sat, 21 Feb 2009 20:50:08 +0000 Subject: [PATCH] Fix problem in BUSBInterface::OtherDescriptorAt(). It will now correctly return available non-standard descriptors. This makes listusb useful again with usb audio & video devices... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29275 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/device/USBInterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kits/device/USBInterface.cpp b/src/kits/device/USBInterface.cpp index a242466878..f9497c655f 100644 --- a/src/kits/device/USBInterface.cpp +++ b/src/kits/device/USBInterface.cpp @@ -127,7 +127,7 @@ status_t BUSBInterface::OtherDescriptorAt(uint32 index, usb_descriptor *descriptor, size_t length) const { - if (length > 0 && descriptor == NULL) + if (length <= 0 && descriptor == NULL) return B_BAD_VALUE; usb_raw_command command; @@ -137,7 +137,7 @@ BUSBInterface::OtherDescriptorAt(uint32 index, usb_descriptor *descriptor, command.generic_etc.alternate_index = fAlternate; command.generic_etc.generic_index = index; command.generic_etc.length = length; - if (ioctl(fRawFD, B_USB_RAW_COMMAND_GET_GENERIC_DESCRIPTOR, &command, + if (ioctl(fRawFD, B_USB_RAW_COMMAND_GET_GENERIC_DESCRIPTOR_ETC, &command, sizeof(command)) || command.generic.status != B_USB_RAW_STATUS_SUCCESS) return B_ERROR;