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

Unified Diff: third_party/libusb/composite-hid-close.patch

Issue 1032563002: libusb: Fix composite_close to close HID handles as well. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/README.chromium ('k') | third_party/libusb/src/libusb/os/windows_usb.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libusb/composite-hid-close.patch
diff --git a/third_party/libusb/composite-hid-close.patch b/third_party/libusb/composite-hid-close.patch
new file mode 100644
index 0000000000000000000000000000000000000000..d6749cf931ae3a984132fc3fd8fff356840242d1
--- /dev/null
+++ b/third_party/libusb/composite-hid-close.patch
@@ -0,0 +1,32 @@
+diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
+index 9ae11b1..259897e 100644
+--- a/libusb/os/windows_usb.c
++++ b/libusb/os/windows_usb.c
+@@ -4236,6 +4236,7 @@ static void composite_close(int sub_api, struct libusb_device_handle *dev_handle
+ struct windows_device_priv *priv = _device_priv(dev_handle->dev);
+ uint8_t i;
+ bool available[SUB_API_MAX];
++ bool has_hid = false;
+
+ for (i = 0; i<SUB_API_MAX; i++) {
+ available[i] = false;
+@@ -4245,6 +4246,8 @@ static void composite_close(int sub_api, struct libusb_device_handle *dev_handle
+ if ( (priv->usb_interface[i].apib->id == USB_API_WINUSBX)
+ && (priv->usb_interface[i].sub_api != SUB_API_NOTSET) ) {
+ available[priv->usb_interface[i].sub_api] = true;
++ } else if (priv->usb_interface[i].apib->id == USB_API_HID) {
++ has_hid = true;
+ }
+ }
+
+@@ -4253,6 +4256,10 @@ static void composite_close(int sub_api, struct libusb_device_handle *dev_handle
+ usb_api_backend[USB_API_WINUSBX].close(i, dev_handle);
+ }
+ }
++
++ if (has_hid) {
++ usb_api_backend[USB_API_HID].close(sub_api, dev_handle);
++ }
+ }
+
+ static int composite_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)
« no previous file with comments | « third_party/libusb/README.chromium ('k') | third_party/libusb/src/libusb/os/windows_usb.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698