From 8ca187b01405d789c2e1c6c885e3e071097db4a7 Mon Sep 17 00:00:00 2001
From: Hector Martin <hector@marcansoft.com>
Date: Wed, 25 Aug 2010 03:21:57 +0200
Subject: [PATCH] Linux: Fix endian handling for usbfs/sysfs
usbfs endian-swaps, sysfs doesn't, not the other way around. This fixes
configurator descriptors in big-endian systems when using sysfs. usbfs
is untested.
Signed-off-by: Hector Martin <hector@marcansoft.com>
---
libusb/os/linux_usbfs.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
index d0db7e2..ed1ce13 100644
|
a
|
b
|
static int sysfs_get_active_config_descriptor(struct libusb_device *dev, |
| 484 | 484 | if (off < 0) |
| 485 | 485 | return LIBUSB_ERROR_IO; |
| 486 | 486 | |
| 487 | | r = seek_to_next_config(DEVICE_CTX(dev), fd, 1); |
| | 487 | r = seek_to_next_config(DEVICE_CTX(dev), fd, 0); |
| 488 | 488 | if (r < 0) |
| 489 | 489 | return r; |
| 490 | 490 | } |
| … |
… |
static int get_config_descriptor(struct libusb_context *ctx, int fd, |
| 539 | 539 | /* might need to skip some configuration descriptors to reach the |
| 540 | 540 | * requested configuration */ |
| 541 | 541 | while (config_index > 0) { |
| 542 | | r = seek_to_next_config(ctx, fd, 0); |
| | 542 | r = seek_to_next_config(ctx, fd, 1); |
| 543 | 543 | if (r < 0) |
| 544 | 544 | return r; |
| 545 | 545 | config_index--; |