Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Unified Diff: src/libopenusb1-glue.c

Issue 11358153: Update libmtp from pre 1.1.4 git to 1.1.5 release. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libmtp/
Patch Set: disable mptz Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« config.h ('K') | « src/libmtp.h.in ('k') | src/libusb-glue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/libopenusb1-glue.c
===================================================================
--- src/libopenusb1-glue.c (revision 166547)
+++ src/libopenusb1-glue.c (working copy)
@@ -3,7 +3,7 @@
* Low-level USB interface glue towards libusb.
*
* Copyright (C) 2005-2007 Richard A. Low <richard@wentnet.com>
- * Copyright (C) 2005-2011 Linus Walleij <triad@df.lth.se>
+ * Copyright (C) 2005-2012 Linus Walleij <triad@df.lth.se>
* Copyright (C) 2006-2011 Marcus Meissner
* Copyright (C) 2007 Ted Bullock
* Copyright (C) 2008 Chris Bagwell <chris@cnpbagwell.com>
@@ -93,7 +93,9 @@
static void init_usb();
static void close_usb(PTP_USB* ptp_usb);
static int find_interface_and_endpoints(openusb_dev_handle_t *dev,
+ uint8_t *conf,
uint8_t *interface,
+ uint8_t *altsetting,
int* inep,
int* inep_maxpacket,
int* outep,
@@ -1948,13 +1950,16 @@
* Self-explanatory?
*/
static int find_interface_and_endpoints(openusb_dev_handle_t *dev,
+ uint8_t *conf,
uint8_t *interface,
+ uint8_t *altsetting,
int* inep,
int* inep_maxpacket,
int* outep,
int *outep_maxpacket,
int* intep) {
- int i, ret;
+ uint8_t i;
+ int ret;
struct usb_device_desc desc;
ret = openusb_parse_device_desc(libmtp_openusb_handle, *dev, NULL, 0, &desc);
@@ -1967,6 +1972,7 @@
ret = openusb_parse_config_desc(libmtp_openusb_handle, *dev, NULL, 0, i, &config);
if (ret != OPENUSB_SUCCESS) continue;
+ *conf = desc.bConfigurationValue;
// Loop over each configurations interfaces
for (j = 0; j < config.bNumInterfaces; j++) {
uint8_t k;
@@ -1983,6 +1989,7 @@
if (no_ep != 3)
continue;
*interface = ifcdesc.bInterfaceNumber;
+ *altsetting = ifcdesc.bAlternateSetting;
// Loop over the three endpoints to locate two bulk and
// one interrupt endpoint and FAIL if we cannot, and continue.
for (k = 0; k < no_ep; k++) {
@@ -2087,7 +2094,9 @@
/* Assign interface and endpoints to usbinfo... */
err = find_interface_and_endpoints(ldevice,
+ &ptp_usb->conf,
&ptp_usb->interface,
+ &ptp_usb->altsetting,
&ptp_usb->inep,
&ptp_usb->inep_maxpacket,
&ptp_usb->outep,
« config.h ('K') | « src/libmtp.h.in ('k') | src/libusb-glue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698