Ticket #51 (closed defect: fixed)
[PATCH] Descriptor endian parsing is backwards on big-endian hosts
| Reported by: | marcan | Owned by: | marcan |
|---|---|---|---|
| Component: | libusb-1.0 | Keywords: | |
| Cc: | Blocked By: | ||
| Blocks: |
Description
Commit 9bea500b attempted to fix descriptor handling by using a flag to determine whether endianness is pre-swapped or not, since apparently usbfs descriptors are in host-endian order, while sysfs descriptors are always in bus-endian order. However, it got it backwards, parsing sysfs descriptors as host-endian order and usbfs descriptors as bus-endian.
The attached patch fixes the issue and solves issues getting configuration descriptors on big-endian targets. It has been tested on sysfs, but going by what information I've been able to find, it should be the correct behavior for usbfs too.
This does not affect little-endian hosts where host endian == bus endian and descriptor parsing never actually switches endianness.
Attachments
Change History
Changed 18 months ago by marcan
- Attachment 0001-Linux-Fix-endian-handling-for-usbfs-sysfs.patch added
comment:1 Changed 18 months ago by marcan
- Summary changed from Descriptor endian parsing is backwards on big-endian hosts to [PATCH] Descriptor endian parsing is backwards on big-endian hosts