Merge "Remove useless arguments from is_adb_interface."
This commit is contained in:
commit
bd6c6eb0e4
5 changed files with 8 additions and 10 deletions
|
|
@ -202,7 +202,7 @@ void usb_kick(usb_handle *h);
|
||||||
|
|
||||||
// USB device detection.
|
// USB device detection.
|
||||||
#if ADB_HOST
|
#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
|
#endif
|
||||||
|
|
||||||
ConnectionState connection_state(atransport *t);
|
ConnectionState connection_state(atransport *t);
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ void init_usb_transport(atransport *t, usb_handle *h, ConnectionState state)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ADB_HOST
|
#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);
|
return (usb_class == ADB_CLASS && usb_subclass == ADB_SUBCLASS && usb_protocol == ADB_PROTOCOL);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -205,9 +205,8 @@ static void find_usb_device(const std::string& base,
|
||||||
interface->bInterfaceProtocol, interface->bNumEndpoints);
|
interface->bInterfaceProtocol, interface->bNumEndpoints);
|
||||||
|
|
||||||
if (interface->bNumEndpoints == 2 &&
|
if (interface->bNumEndpoints == 2 &&
|
||||||
is_adb_interface(vid, pid, interface->bInterfaceClass,
|
is_adb_interface(interface->bInterfaceClass, interface->bInterfaceSubClass,
|
||||||
interface->bInterfaceSubClass, interface->bInterfaceProtocol)) {
|
interface->bInterfaceProtocol)) {
|
||||||
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char pathbuf[128];
|
char pathbuf[128];
|
||||||
char link[256];
|
char link[256];
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,7 @@ CheckInterface(IOUSBInterfaceInterface190 **interface, UInt16 vendor, UInt16 pro
|
||||||
|
|
||||||
//* check to make sure interface class, subclass and protocol match ADB
|
//* check to make sure interface class, subclass and protocol match ADB
|
||||||
//* avoid opening mass storage endpoints
|
//* 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;
|
goto err_bad_adb_interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -553,10 +553,9 @@ int recognized_device(usb_handle* handle) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_adb_interface(device_desc.idVendor, device_desc.idProduct,
|
if (is_adb_interface(interf_desc.bInterfaceClass, interf_desc.bInterfaceSubClass,
|
||||||
interf_desc.bInterfaceClass, interf_desc.bInterfaceSubClass, interf_desc.bInterfaceProtocol)) {
|
interf_desc.bInterfaceProtocol)) {
|
||||||
|
if (interf_desc.bInterfaceProtocol == 0x01) {
|
||||||
if(interf_desc.bInterfaceProtocol == 0x01) {
|
|
||||||
AdbEndpointInformation endpoint_info;
|
AdbEndpointInformation endpoint_info;
|
||||||
// assuming zero is a valid bulk endpoint ID
|
// assuming zero is a valid bulk endpoint ID
|
||||||
if (AdbGetEndpointInformation(handle->adb_interface, 0, &endpoint_info)) {
|
if (AdbGetEndpointInformation(handle->adb_interface, 0, &endpoint_info)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue