Lines Matching refs:h
386 usb_handle h; in init_usb() local
388 h.success = 0; in init_usb()
389 h.callback = callback; in init_usb()
427 if (try_device(device, &h) != 0) { in init_usb()
433 if (h.success) { in init_usb()
435 memcpy(*handle, &h, sizeof(usb_handle)); in init_usb()
465 int usb_close(usb_handle *h) { in usb_close() argument
470 int usb_read(usb_handle *h, void *data, int len) { in usb_read() argument
478 if (h == NULL) { in usb_read()
482 if (h->interface == NULL) { in usb_read()
487 if (h->bulkIn == 0) { in usb_read()
492 result = (*h->interface)->ReadPipe( in usb_read()
493 h->interface, h->bulkIn, data, &numBytes); in usb_read()
504 int usb_write(usb_handle *h, const void *data, int len) { in usb_write() argument
511 if (h == NULL) { in usb_write()
515 if (h->interface == NULL) { in usb_write()
520 if (h->bulkOut == 0) { in usb_write()
526 result = (*h->interface)->WritePipe( in usb_write()
527 h->interface, h->bulkOut, (void *)data, len); in usb_write()
540 result = (*h->interface)->WritePipe( in usb_write()
541 h->interface, h->bulkOut, (void *)data, lenToSend); in usb_write()
550 if ((result == 0) && (h->zero_mask)) { in usb_write()
552 if(!(len & h->zero_mask)) { in usb_write()
553 result = (*h->interface)->WritePipe( in usb_write()
554 h->interface, h->bulkOut, (void *)data, 0); in usb_write()