2 Copyright © 2015, The AROS Development Team. All rights reserved.
5 Desc: Virtual USB host controller
9 #ifndef VUSBHCI_BRIDGE_H
10 #define VUSBHCI_BRIDGE_H
12 #include <libusb-1.0/libusb.h>
14 static const char *libusb_func_names
[] = {
17 "libusb_has_capability",
18 "libusb_hotplug_register_callback",
19 "libusb_handle_events",
20 "libusb_get_device_descriptor",
23 "libusb_submit_transfer",
24 "libusb_alloc_transfer",
25 "libusb_free_transfer",
26 "libusb_handle_events_completed",
27 "libusb_control_transfer",
28 "libusb_interrupt_transfer",
29 "libusb_bulk_transfer",
30 "libusb_set_auto_detach_kernel_driver",
31 "libusb_get_device_speed",
32 "libusb_claim_interface",
34 "libusb_set_configuration"
37 #define LIBUSB_NUM_FUNCS (sizeof(libusb_func_names) / sizeof(libusb_func_names[0]))
40 int (*libusb_init
)(libusb_context
**ctx
);
41 void (*libusb_exit
)(libusb_context
*ctx
);
42 int (*libusb_has_capability
)(uint32_t capability
);
43 int (*libusb_hotplug_register_callback
)(libusb_context
*ctx
,
44 libusb_hotplug_event events
,
45 libusb_hotplug_flag flags
,
49 libusb_hotplug_callback_fn cb_fn
,
51 libusb_hotplug_callback_handle
*handle
);
52 int (*libusb_handle_events
)(libusb_context
*ctx
);
53 int (*libusb_get_device_descriptor
)(libusb_device
*dev
,
54 struct libusb_device_descriptor
*desc
);
55 int (*libusb_open
)(libusb_device
*dev
, libusb_device_handle
**handle
);
56 void (*libusb_close
)(libusb_device_handle
*dev_handle
);
57 int (*libusb_submit_transfer
)(struct libusb_transfer
*transfer
);
58 struct libusb_transfer
* (*libusb_alloc_transfer
)(int iso_packets
);
59 void (*libusb_free_transfer
)(struct libusb_transfer
*transfer
);
60 int (*libusb_handle_events_completed
)(libusb_context
*ctx
, int *completed
);
62 int (*libusb_control_transfer
)(libusb_device_handle
*dev_handle
,
63 uint8_t request_type
, uint8_t bRequest
, uint16_t wValue
, uint16_t wIndex
,
64 unsigned char *data
, uint16_t wLength
, unsigned int timeout
);
66 int (*libusb_interrupt_transfer
)(libusb_device_handle
*dev_handle
,
67 unsigned char endpoint
, unsigned char *data
, int length
,
68 int *actual_length
, unsigned int timeout
);
70 int (*libusb_bulk_transfer
)(libusb_device_handle
*dev_handle
,
71 unsigned char endpoint
, unsigned char *data
, int length
,
72 int *actual_length
, unsigned int timeout
);
74 int (*libusb_set_auto_detach_kernel_driver
)(libusb_device_handle
*dev
, int enable
);
76 int (*libusb_get_device_speed
)(libusb_device
*dev
);
77 int (*libusb_claim_interface
)(libusb_device_handle
*dev
, int interface_number
);
78 void (*libusb_set_debug
)(libusb_context
*ctx
, int level
);
79 int (*libusb_set_configuration
)(libusb_device_handle
*dev
, int configuration
);
82 //extern struct libusb_func libusb_func;
84 #define LIBUSBCALL(func,...) (libusb_func.func(__VA_ARGS__))
86 #endif /* VUSBHCI_BRIDGE_H */