Exemplo n.º 1
0
static libusb20_get_port_path_t ugen20_get_port_path;
static libusb20_get_power_usage_t ugen20_get_power_usage;
static libusb20_kernel_driver_active_t ugen20_kernel_driver_active;
static libusb20_detach_kernel_driver_t ugen20_detach_kernel_driver;
static libusb20_do_request_sync_t ugen20_do_request_sync;
static libusb20_process_t ugen20_process;

/* USB transfer specific */
static libusb20_tr_open_t ugen20_tr_open;
static libusb20_tr_close_t ugen20_tr_close;
static libusb20_tr_clear_stall_sync_t ugen20_tr_clear_stall_sync;
static libusb20_tr_submit_t ugen20_tr_submit;
static libusb20_tr_cancel_async_t ugen20_tr_cancel_async;

static const struct libusb20_device_methods libusb20_ugen20_device_methods = {
	LIBUSB20_DEVICE(LIBUSB20_DECLARE, ugen20)
};

static const char *
ugen20_get_backend_name(void)
{
	return ("FreeBSD UGEN 2.0");
}

static uint32_t
ugen20_path_convert_one(const char **pp)
{
	const char *ptr;
	uint32_t temp = 0;

	ptr = *pp;
Exemplo n.º 2
0
#define	dummy_get_power_usage (void *)dummy_int
#define	dummy_kernel_driver_active (void *)dummy_int
#define	dummy_detach_kernel_driver (void *)dummy_int
#define	dummy_do_request_sync (void *)dummy_int
#define	dummy_tr_open (void *)dummy_int
#define	dummy_tr_close (void *)dummy_int
#define	dummy_tr_clear_stall_sync (void *)dummy_int
#define	dummy_process (void *)dummy_int
#define	dummy_dev_info (void *)dummy_int
#define	dummy_dev_get_iface_driver (void *)dummy_int

#define	dummy_tr_submit (void *)dummy_void
#define	dummy_tr_cancel_async (void *)dummy_void

static const struct libusb20_device_methods libusb20_dummy_methods = {
	LIBUSB20_DEVICE(LIBUSB20_DECLARE, dummy)
};

void
libusb20_tr_callback_wrapper(struct libusb20_transfer *xfer)
{
	;				/* style fix */

repeat:

	if (!xfer->is_pending) {
		xfer->status = LIBUSB20_TRANSFER_START;
	} else {
		xfer->is_pending = 0;
	}