summaryrefslogtreecommitdiffstats
path: root/fastboot/usb_linux.c
diff options
context:
space:
mode:
authormgross <mark.gross@intel.com>2011-07-07 17:08:10 -0700
committerMark D Horn <mark.d.horn@intel.com>2012-01-23 13:12:23 -0800
commitc840653efd8d05a33778d3e73c3521977564bde3 (patch)
tree1f55e4debeb2b9e0210f5c504946806762a93045 /fastboot/usb_linux.c
parentf60e8638282d66c108f1e1dea030856312f65892 (diff)
downloadsystem_core-c840653efd8d05a33778d3e73c3521977564bde3.zip
system_core-c840653efd8d05a33778d3e73c3521977564bde3.tar.gz
system_core-c840653efd8d05a33778d3e73c3521977564bde3.tar.bz2
fastboot: set the language local string
Set the language local string to 0x409 (English US / en-us) such that fastboot will successfully read the usb descriptor serial number string. The usbdevfs ioctl fails when the wIndex is not initialized with the local for the unicode of the usb descriptor string. usbdevfs is an obsolete interface and fastboot probably needs a re-write to use libusb like what is in adb. Change-Id: I3687f84643f53c736f14b3ae7793185d9b5cccc0 Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
Diffstat (limited to 'fastboot/usb_linux.c')
-rw-r--r--fastboot/usb_linux.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fastboot/usb_linux.c b/fastboot/usb_linux.c
index 1ba87e6..cbc64e4 100644
--- a/fastboot/usb_linux.c
+++ b/fastboot/usb_linux.c
@@ -139,10 +139,11 @@ static int filter_usb_device(int fd, char *ptr, int len, int writable,
ctrl.bRequestType = USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE;
ctrl.bRequest = USB_REQ_GET_DESCRIPTOR;
ctrl.wValue = (USB_DT_STRING << 8) | dev->iSerialNumber;
- ctrl.wIndex = 0;
+ //language ID (en-us) for serial number string
+ ctrl.wIndex = 0x0409;
ctrl.wLength = sizeof(buffer);
ctrl.data = buffer;
- ctrl.timeout = 50;
+ ctrl.timeout = 50;
result = ioctl(fd, USBDEVFS_CONTROL, &ctrl);
if (result > 0) {