Home | History | Annotate | Download | only in adb

Lines Matching refs:handle

258         usb_handle* handle = CheckInterface((IOUSBInterfaceInterface**)iface,
260 if (handle == NULL) {
267 register_usb_transport(handle, (serial[0] ? serial : NULL), devpath, 1);
276 handle,
277 &handle->usbNotification);
288 usb_handle *handle = (usb_handle *)refCon;
291 if (!handle) {
292 DBG("ERR: NULL handle\n");
296 IOObjectRelease(handle->usbNotification);
297 usb_kick(handle);
306 usb_handle* handle = NULL;
341 handle = calloc(1, sizeof(usb_handle));
360 handle->bulkIn = endpoint;
363 handle->bulkOut = endpoint;
365 handle->zero_mask = maxPacketSize - 1;
372 handle->interface = interface;
373 return handle;
376 free(handle);
452 int usb_write(usb_handle *handle, const void *buf, int len)
459 if (!handle)
462 if (NULL == handle->interface) {
467 if (0 == handle->bulkOut) {
473 (*handle->interface)->WritePipe(
474 handle->interface, handle->bulkOut, (void *)buf, len);
476 if ((result == 0) && (handle->zero_mask)) {
478 if(!(len & handle->zero_mask)) {
480 (*handle->interface)->WritePipe(
481 handle->interface, handle->bulkOut, (void *)buf, 0);
492 int usb_read(usb_handle *handle
501 if (!handle) {
505 if (NULL == handle->interface) {
510 if (0 == handle->bulkIn) {
516 (*handle->interface)->ReadPipe(handle->interface,
517 handle->bulkIn, buf, &numBytes);
528 int usb_close(usb_handle *handle)
533 void usb_kick(usb_handle *handle)
536 if (!handle)
539 if (handle->interface)
541 (*handle->interface)->USBInterfaceClose(handle->interface);
542 (*handle->interface)->Release(handle->interface);
543 handle->interface = 0;