diff options
author | Michael Hanselmann <hansmi@gentoo.org> | 2004-06-14 22:07:47 +0000 |
---|---|---|
committer | Michael Hanselmann <hansmi@gentoo.org> | 2004-06-14 22:07:47 +0000 |
commit | c84bdc45bbdbac5f029b65f9c35fcd4c777fd389 (patch) | |
tree | 0022d6a4920e583362c9ac24cc0cfa1d76cf3735 /sys-apps/usbutils/files | |
parent | Added a patch for the FPU-lockup issue; please see bug #58304 for details. (M... (diff) | |
download | gentoo-2-c84bdc45bbdbac5f029b65f9c35fcd4c777fd389.tar.gz gentoo-2-c84bdc45bbdbac5f029b65f9c35fcd4c777fd389.tar.bz2 gentoo-2-c84bdc45bbdbac5f029b65f9c35fcd4c777fd389.zip |
Fixed a big-endian-issue.
Diffstat (limited to 'sys-apps/usbutils/files')
-rw-r--r-- | sys-apps/usbutils/files/0.11/lsusb-endian.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sys-apps/usbutils/files/0.11/lsusb-endian.patch b/sys-apps/usbutils/files/0.11/lsusb-endian.patch new file mode 100644 index 000000000000..0ea38c34ee38 --- /dev/null +++ b/sys-apps/usbutils/files/0.11/lsusb-endian.patch @@ -0,0 +1,45 @@ +--- lsusb.c.orig 2002-08-06 08:35:21.000000000 +0200 ++++ lsusb.c 2004-06-14 23:46:50.620570416 +0200 +@@ -69,6 +69,14 @@ + + #define VERBLEVEL_DEFAULT 0 /* 0 gives lspci behaviour; 1, lsusb-0.9 */ + ++/* Handle endian-ness */ ++#if __BYTE_ORDER == __BIG_ENDIAN || BYTE_ORDER == BIG_ENDIAN ++//#define SWAP(n) ((n << 24) | ((n&65280)<<8) | ((n&16711680)>>8) | (n>>24)) ++#define SWAP(n) (((n) & 0x00ff) << 8 | ((n) & 0xff00) >> 8) ++#else ++#define SWAP(n) (n) ++#endif ++ + static const char *procbususb = "/proc/bus/usb"; + static unsigned int verblevel = VERBLEVEL_DEFAULT; + static int do_report_desc = 1; +@@ -293,7 +301,8 @@ + " iSerial %5u %s\n" + " bNumConfigurations %5u\n", + buf[0], buf[1], buf[3], buf[2], buf[4], cls, buf[5], subcls, buf[6], proto, buf[7], +- vid, vendor, pid, product, buf[13], buf[12], buf[14], mfg, buf[15], prod, buf[16], serial, buf[17]); ++ SWAP(vid), vendor, SWAP(pid), product, buf[13], buf[12], buf[14], mfg, buf[15], ++ prod, buf[16], serial, buf[17]); + dump_junk(buf, " ", 18); + } + +@@ -1374,7 +1383,7 @@ + pid = buf[10] | (buf[11] << 8); + get_vendor_string(vendor, sizeof(vendor), vid); + get_product_string(product, sizeof(product), vid, pid); +- printf("Device: ID %04x:%04x %s %s\n", vid, pid, vendor, product); ++ printf("Device: ID %04x:%04x %s %s\n", SWAP(vid), SWAP(pid), vendor, product); + dumpdev(buf, fd, flags); + status=0; + err: +@@ -1432,7 +1441,7 @@ + get_product_string(product, sizeof(product), vid, pid); + if (verblevel > 0) + printf("\n"); +- printf("Bus %s Device %s: ID %04x:%04x %s %s\n", de->d_name, de2->d_name, vid, pid, vendor, product); ++ printf("Bus %s Device %s: ID %04x:%04x %s %s\n", de->d_name, de2->d_name, SWAP(vid), SWAP(pid), vendor, product); + if (verblevel > 0) + dumpdev(buf, fd, flags); + err: |