diff --git a/adb/adb.h b/adb/adb.h index 8064c175c..2797f6b54 100644 --- a/adb/adb.h +++ b/adb/adb.h @@ -202,7 +202,7 @@ void usb_kick(usb_handle *h); // USB device detection. #if ADB_HOST -int is_adb_interface(int vid, int pid, int usb_class, int usb_subclass, int usb_protocol); +int is_adb_interface(int usb_class, int usb_subclass, int usb_protocol); #endif ConnectionState connection_state(atransport *t); diff --git a/adb/transport_usb.cpp b/adb/transport_usb.cpp index d05d9285c..d054601ec 100644 --- a/adb/transport_usb.cpp +++ b/adb/transport_usb.cpp @@ -94,7 +94,7 @@ void init_usb_transport(atransport *t, usb_handle *h, ConnectionState state) } #if ADB_HOST -int is_adb_interface(int vid, int pid, int usb_class, int usb_subclass, int usb_protocol) +int is_adb_interface(int usb_class, int usb_subclass, int usb_protocol) { return (usb_class == ADB_CLASS && usb_subclass == ADB_SUBCLASS && usb_protocol == ADB_PROTOCOL); } diff --git a/adb/usb_linux.cpp b/adb/usb_linux.cpp index 500898a70..3e5028d32 100644 --- a/adb/usb_linux.cpp +++ b/adb/usb_linux.cpp @@ -205,9 +205,8 @@ static void find_usb_device(const std::string& base, interface->bInterfaceProtocol, interface->bNumEndpoints); if (interface->bNumEndpoints == 2 && - is_adb_interface(vid, pid, interface->bInterfaceClass, - interface->bInterfaceSubClass, interface->bInterfaceProtocol)) { - + is_adb_interface(interface->bInterfaceClass, interface->bInterfaceSubClass, + interface->bInterfaceProtocol)) { struct stat st; char pathbuf[128]; char link[256]; diff --git a/adb/usb_osx.cpp b/adb/usb_osx.cpp index adcbb3e66..2ee2aae5d 100644 --- a/adb/usb_osx.cpp +++ b/adb/usb_osx.cpp @@ -345,7 +345,7 @@ CheckInterface(IOUSBInterfaceInterface190 **interface, UInt16 vendor, UInt16 pro //* check to make sure interface class, subclass and protocol match ADB //* avoid opening mass storage endpoints - if (!is_adb_interface(vendor, product, interfaceClass, interfaceSubClass, interfaceProtocol)) { + if (!is_adb_interface(interfaceClass, interfaceSubClass, interfaceProtocol)) { goto err_bad_adb_interface; } diff --git a/adb/usb_windows.cpp b/adb/usb_windows.cpp index 464945443..755f07ef0 100644 --- a/adb/usb_windows.cpp +++ b/adb/usb_windows.cpp @@ -553,10 +553,9 @@ int recognized_device(usb_handle* handle) { return 0; } - if (is_adb_interface(device_desc.idVendor, device_desc.idProduct, - interf_desc.bInterfaceClass, interf_desc.bInterfaceSubClass, interf_desc.bInterfaceProtocol)) { - - if(interf_desc.bInterfaceProtocol == 0x01) { + if (is_adb_interface(interf_desc.bInterfaceClass, interf_desc.bInterfaceSubClass, + interf_desc.bInterfaceProtocol)) { + if (interf_desc.bInterfaceProtocol == 0x01) { AdbEndpointInformation endpoint_info; // assuming zero is a valid bulk endpoint ID if (AdbGetEndpointInformation(handle->adb_interface, 0, &endpoint_info)) {