FreeRDP
libusb_udevice.h
1 
21 #ifndef FREERDP_CHANNEL_URBDRC_CLIENT_LIBUSB_UDEVICE_H
22 #define FREERDP_CHANNEL_URBDRC_CLIENT_LIBUSB_UDEVICE_H
23 
24 #include <winpr/windows.h>
25 #include <libusb.h>
26 
27 #include "urbdrc_types.h"
28 #include "urbdrc_main.h"
29 
30 typedef struct libusb_device LIBUSB_DEVICE;
31 typedef struct libusb_device_handle LIBUSB_DEVICE_HANDLE;
32 typedef struct libusb_device_descriptor LIBUSB_DEVICE_DESCRIPTOR;
33 typedef struct libusb_config_descriptor LIBUSB_CONFIG_DESCRIPTOR;
34 typedef struct libusb_interface LIBUSB_INTERFACE;
35 typedef struct libusb_interface_descriptor LIBUSB_INTERFACE_DESCRIPTOR;
36 typedef struct libusb_endpoint_descriptor LIBUSB_ENDPOINT_DESCEIPTOR;
37 
38 typedef struct
39 {
40  IUDEVICE iface;
41 
42  void* udev;
43  void* prev;
44  void* next;
45 
46  UINT32 UsbDevice; /* An unique interface ID */
47  UINT32 ReqCompletion; /* An unique interface ID */
48  IWTSVirtualChannelManager* channelManager;
49  UINT32 channelID;
50  UINT16 status;
51  BYTE bus_number;
52  BYTE dev_number;
53  char path[17];
54  int port_number;
55  int isCompositeDevice;
56 
57  LIBUSB_DEVICE_HANDLE* libusb_handle;
58  LIBUSB_DEVICE_HANDLE* hub_handle;
59  LIBUSB_DEVICE* libusb_dev;
60  LIBUSB_DEVICE_DESCRIPTOR* devDescriptor;
61  MSUSB_CONFIG_DESCRIPTOR* MsConfig;
62  LIBUSB_CONFIG_DESCRIPTOR* LibusbConfig;
63 
64  wArrayList* request_queue;
65 
66  URBDRC_PLUGIN* urbdrc;
67 } UDEVICE;
68 typedef UDEVICE* PUDEVICE;
69 
70 size_t udev_new_by_id(URBDRC_PLUGIN* urbdrc, libusb_context* ctx, UINT16 idVendor, UINT16 idProduct,
71  IUDEVICE*** devArray);
72 IUDEVICE* udev_new_by_addr(URBDRC_PLUGIN* urbdrc, libusb_context* context, BYTE bus_number,
73  BYTE dev_number);
74 const char* usb_interface_class_to_string(uint8_t class);
75 
76 #endif /* FREERDP_CHANNEL_URBDRC_CLIENT_LIBUSB_UDEVICE_H */