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

Unified Diff: third_party/libusb/src/libusb/os/openbsd_usb.c

Issue 19490008: Recommit: Update libusb 1.0.9 to libusbx 1.0.16 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months 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
« no previous file with comments | « third_party/libusb/src/libusb/os/linux_usbfs.c ('k') | third_party/libusb/src/libusb/os/poll_posix.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libusb/src/libusb/os/openbsd_usb.c
diff --git a/third_party/libusb/src/libusb/os/openbsd_usb.c b/third_party/libusb/src/libusb/os/openbsd_usb.c
index e31941bfecb5c9275525baea566258968d84c817..f4fd4543a63661a33dc0814178ff4dde76e7113e 100644
--- a/third_party/libusb/src/libusb/os/openbsd_usb.c
+++ b/third_party/libusb/src/libusb/os/openbsd_usb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
+ * Copyright © 2011 Martin Pieuchot <mpi@openbsd.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -89,15 +89,18 @@ static int _access_endpoint(struct libusb_transfer *);
const struct usbi_os_backend openbsd_backend = {
"Synchronous OpenBSD backend",
+ 0,
NULL, /* init() */
NULL, /* exit() */
obsd_get_device_list,
+ NULL, /* hotplug_poll */
obsd_open,
obsd_close,
obsd_get_device_descriptor,
obsd_get_active_config_descriptor,
obsd_get_config_descriptor,
+ NULL, /* get_config_descriptor_by_value() */
obsd_get_configuration,
obsd_set_configuration,
@@ -158,7 +161,9 @@ obsd_get_device_list(struct libusb_context * ctx,
session_id = (di.udi_bus << 8 | di.udi_addr);
dev = usbi_get_device_by_session_id(ctx, session_id);
- if (dev == NULL) {
+ if (dev) {
+ dev = libusb_ref_device(dev);
+ } else {
dev = usbi_alloc_device(ctx, session_id);
if (dev == NULL)
return (LIBUSB_ERROR_NO_MEM);
@@ -189,6 +194,8 @@ obsd_get_device_list(struct libusb_context * ctx,
if (discovered_devs_append(*discdevs, dev) == NULL)
return (LIBUSB_ERROR_NO_MEM);
+
+ libusb_unref_device(dev);
}
return (LIBUSB_SUCCESS);
@@ -268,7 +275,7 @@ obsd_get_active_config_descriptor(struct libusb_device *dev,
*host_endian = 0;
- return (LIBUSB_SUCCESS);
+ return len;
}
int
@@ -306,7 +313,7 @@ obsd_get_config_descriptor(struct libusb_device *dev, uint8_t idx,
*host_endian = 0;
- return (LIBUSB_SUCCESS);
+ return len;
}
int
@@ -634,7 +641,7 @@ _sync_control_transfer(struct usbi_transfer *itransfer)
req.ucr_request.bmRequestType = setup->bmRequestType;
req.ucr_request.bRequest = setup->bRequest;
- /* Don't use USETW, libusb already deals with the endianness */
+ /* Don't use USETW, libusbx already deals with the endianness */
(*(uint16_t *)req.ucr_request.wValue) = setup->wValue;
(*(uint16_t *)req.ucr_request.wIndex) = setup->wIndex;
(*(uint16_t *)req.ucr_request.wLength) = setup->wLength;
« no previous file with comments | « third_party/libusb/src/libusb/os/linux_usbfs.c ('k') | third_party/libusb/src/libusb/os/poll_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698