Lines Matching defs:device

74     struct usb_device *device = usb_device_new(deviceName, fd);
75 if (!device) {
83 usb_descriptor_iter_init(device, &iter);
93 char* manufacturerName = usb_device_get_manufacturer_name(device,
95 char* productName = usb_device_get_product_name(device,
103 char* interfaceName = usb_device_get_string(device, interface->iInterface,
113 // Looks like an android style MTP device
114 char* manufacturerName = usb_device_get_manufacturer_name(device,
116 char* productName = usb_device_get_product_name(device,
118 ALOGD("Found MTP device: \"%s\" \"%s\"\n", manufacturerName, productName);
126 uint16_t vendor = usb_device_get_vendor_id(device);
127 uint16_t product = usb_device_get_product_id(device);
129 // not an MTP or PTP device
136 int ret = usb_device_control_transfer(device,
143 ret = usb_device_control_transfer(device,
156 // if we got here, then we have a likely MTP or PTP device
175 usb_device_close(device);
191 usb_device_close(device);
195 int ret = usb_device_claim_interface(device, interface->bInterfaceNumber);
198 usb_device_connect_kernel_driver(device, interface->bInterfaceNumber, false);
199 ret = usb_device_claim_interface(device, interface->bInterfaceNumber);
203 usb_device_close(device);
207 MtpDevice* mtpDevice = new MtpDevice(device, interface->bInterfaceNumber,
214 usb_device_close(device);
215 ALOGE("device not found");
219 MtpDevice::MtpDevice(struct usb_device* device, int interface,
223 : mDevice(device),
239 mRequestIn1 = usb_request_new(device, ep_in);
240 mRequestIn2 = usb_request_new(device, ep_in);
241 mRequestOut = usb_request_new(device, ep_out);
242 mRequestIntr = usb_request_new(device, ep_intr);
708 // If object size 0 byte, the remote device may reply a response packet without sending any data
733 // According to the MTP spec, the responder (MTP device) can choose two ways of sending