Merge "Remove useless arguments from is_adb_interface." am: bd6c6eb0e4
am: db50d1d6ef
Change-Id: I4a21f8296643bbe185ac79df8888eec07c88ca78
This commit is contained in:
commit
0a629b4bdd
5 changed files with 8 additions and 10 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue