goto err;
}
+ host_endian = 0;
r = usbi_backend->get_config_descriptor(dev, config_index, buf,
_config->wTotalLength, &host_endian);
if (r < 0)
* included as of Linux 2.6.26.
*/
+/* endianness for multi-byte fields:
+ *
+ * Descriptors exposed by usbfs have the multi-byte fields in the device
+ * descriptor as host endian. Multi-byte fields in the other descriptors are
+ * bus-endian. The kernel documentation says otherwise, but it is wrong.
+ */
+
static const char *usbfs_path = NULL;
/* do we have a busnum to relate devices? this also implies that we can read
if (sysfs_has_descriptors) {
return sysfs_get_active_config_descriptor(dev, buffer, len);
} else {
- *host_endian = 1;
return usbfs_get_active_config_descriptor(dev, buffer, len);
}
}
r = get_config_descriptor(DEVICE_CTX(dev), fd, config_index, buffer, len);
close(fd);
- *host_endian = 1;
return r;
}