summaryrefslogtreecommitdiff
path: root/libusb/os/haiku_usb_raw.cpp
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2020-04-28 12:08:08 -0700
committerChris Dickens <christopher.a.dickens@gmail.com>2020-04-28 12:08:08 -0700
commitd21956dc3357bb40cde6d47eaf2497caf8d0a2de (patch)
tree246da844ea27ccf20b25f2e91d3e7e24e88e398e /libusb/os/haiku_usb_raw.cpp
parenta157b55656e7130c4ea118abcb1dfad21db428b8 (diff)
downloadlibusb-d21956dc3357bb40cde6d47eaf2497caf8d0a2de.tar.gz
core: Kill backend get_device_descriptor() function
Simplify the library by moving device descriptor initialization to the backend, while the device is being set up. This removes the duplication of essentially the same code in every backend. Add some missing calls to libusb_le16_to_cpu() when reading multi-byte fields from the "raw" device descriptor. It has worked thus far because the platforms not using the calls happen to be the same endianness as the USB bus. While here, throw in some static assertions to ensure there is no mismatch between the libusb device descriptor structure and any device descriptor structure provided by the platform headers. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Diffstat (limited to 'libusb/os/haiku_usb_raw.cpp')
-rw-r--r--libusb/os/haiku_usb_raw.cpp9
1 files changed, 0 insertions, 9 deletions
diff --git a/libusb/os/haiku_usb_raw.cpp b/libusb/os/haiku_usb_raw.cpp
index b4348e2..f48c507 100644
--- a/libusb/os/haiku_usb_raw.cpp
+++ b/libusb/os/haiku_usb_raw.cpp
@@ -75,14 +75,6 @@ haiku_close(struct libusb_device_handle *dev_handle)
}
static int
-haiku_get_device_descriptor(struct libusb_device *device, void *buffer, int *host_endian)
-{
- USBDevice *dev = *((USBDevice **)usbi_get_device_priv(device));
- memcpy(buffer, dev->Descriptor(), LIBUSB_DT_DEVICE_SIZE);
- return LIBUSB_SUCCESS;
-}
-
-static int
haiku_get_active_config_descriptor(struct libusb_device *device, void *buffer, size_t len)
{
USBDevice *dev = *((USBDevice **)usbi_get_device_priv(device));
@@ -198,7 +190,6 @@ const struct usbi_os_backend usbi_backend = {
/*.open =*/ haiku_open,
/*.close =*/ haiku_close,
- /*.get_device_descriptor =*/ haiku_get_device_descriptor,
/*.get_active_config_descriptor =*/ haiku_get_active_config_descriptor,
/*.get_config_descriptor =*/ haiku_get_config_descriptor,
/*.get_config_descriptor_by_value =*/ NULL,