From dda32388ffd7fac359628cdf0bce5445e674794f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Tue, 2 Oct 2012 16:54:14 -0400 Subject: [PATCH] urbdrc: move USB redirection code --- channels/drdynvc/CMakeLists.txt | 20 - channels/drdynvc/client/drdynvc_types.h | 1 + channels/drdynvc/client/dvcman.h | 1 + channels/drdynvc/urbdrc/urbdrc_types.h | 355 ------------------ channels/urbdrc/CMakeLists.txt | 24 ++ channels/urbdrc/ChannelOptions.cmake | 15 + .../urbdrc => urbdrc/client}/CMakeLists.txt | 5 +- .../urbdrc => urbdrc/client}/data_transfer.c | 0 .../urbdrc => urbdrc/client}/data_transfer.h | 0 .../urbdrc => urbdrc/client}/isoch_queue.c | 0 .../urbdrc => urbdrc/client}/isoch_queue.h | 0 .../urbdrc => urbdrc/client}/searchman.c | 0 .../urbdrc => urbdrc/client}/searchman.h | 0 .../urbdrc => urbdrc/client}/urbdrc_main.c | 4 +- .../urbdrc => urbdrc/client}/urbdrc_main.h | 44 +-- channels/urbdrc/client/urbdrc_types.h | 337 +++++++++++++++++ .../urbdrc/libusb/CMakeLists.txt | 6 +- .../urbdrc/libusb/libusb_udevice.c | 0 .../urbdrc/libusb/libusb_udevice.h | 0 .../urbdrc/libusb/libusb_udevman.c | 0 .../urbdrc/libusb/request_queue.c | 0 .../urbdrc/libusb/request_queue.h | 0 22 files changed, 403 insertions(+), 409 deletions(-) delete mode 100644 channels/drdynvc/urbdrc/urbdrc_types.h create mode 100644 channels/urbdrc/CMakeLists.txt create mode 100644 channels/urbdrc/ChannelOptions.cmake rename channels/{drdynvc/urbdrc => urbdrc/client}/CMakeLists.txt (96%) rename channels/{drdynvc/urbdrc => urbdrc/client}/data_transfer.c (100%) rename channels/{drdynvc/urbdrc => urbdrc/client}/data_transfer.h (100%) rename channels/{drdynvc/urbdrc => urbdrc/client}/isoch_queue.c (100%) rename channels/{drdynvc/urbdrc => urbdrc/client}/isoch_queue.h (100%) rename channels/{drdynvc/urbdrc => urbdrc/client}/searchman.c (100%) rename channels/{drdynvc/urbdrc => urbdrc/client}/searchman.h (100%) rename channels/{drdynvc/urbdrc => urbdrc/client}/urbdrc_main.c (99%) rename channels/{drdynvc/urbdrc => urbdrc/client}/urbdrc_main.h (94%) create mode 100644 channels/urbdrc/client/urbdrc_types.h rename channels/{drdynvc => }/urbdrc/libusb/CMakeLists.txt (96%) rename channels/{drdynvc => }/urbdrc/libusb/libusb_udevice.c (100%) rename channels/{drdynvc => }/urbdrc/libusb/libusb_udevice.h (100%) rename channels/{drdynvc => }/urbdrc/libusb/libusb_udevman.c (100%) rename channels/{drdynvc => }/urbdrc/libusb/request_queue.c (100%) rename channels/{drdynvc => }/urbdrc/libusb/request_queue.h (100%) diff --git a/channels/drdynvc/CMakeLists.txt b/channels/drdynvc/CMakeLists.txt index 9637fdac0..676de4e85 100644 --- a/channels/drdynvc/CMakeLists.txt +++ b/channels/drdynvc/CMakeLists.txt @@ -15,27 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(DRDYNVC_SRCS - drdynvc_main.c - drdynvc_main.h - drdynvc_types.h - dvcman.c - dvcman.h -) - -add_library(drdynvc ${DRDYNVC_SRCS}) -set_target_properties(drdynvc PROPERTIES PREFIX "") - -target_link_libraries(drdynvc freerdp-utils) - -install(TARGETS drdynvc DESTINATION ${FREERDP_PLUGIN_PATH}) - -add_subdirectory(tsmf) -add_subdirectory(audin) -add_subdirectory(urbdrc) - if(WITH_CLIENT_CHANNELS) add_subdirectory(client) endif() - diff --git a/channels/drdynvc/client/drdynvc_types.h b/channels/drdynvc/client/drdynvc_types.h index e19d0d1b5..1591f4766 100644 --- a/channels/drdynvc/client/drdynvc_types.h +++ b/channels/drdynvc/client/drdynvc_types.h @@ -36,3 +36,4 @@ #endif #endif + diff --git a/channels/drdynvc/client/dvcman.h b/channels/drdynvc/client/dvcman.h index 679243f30..0e0bb9ce2 100644 --- a/channels/drdynvc/client/dvcman.h +++ b/channels/drdynvc/client/dvcman.h @@ -33,3 +33,4 @@ int dvcman_receive_channel_data_first(IWTSVirtualChannelManager* pChannelMgr, ui int dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelId, uint8* data, uint32 data_size); #endif + diff --git a/channels/drdynvc/urbdrc/urbdrc_types.h b/channels/drdynvc/urbdrc/urbdrc_types.h deleted file mode 100644 index 38fbb4e1a..000000000 --- a/channels/drdynvc/urbdrc/urbdrc_types.h +++ /dev/null @@ -1,355 +0,0 @@ -/** - * FreeRDP: A Remote Desktop Protocol client. - * RemoteFX USB Redirection - * - * Copyright 2012 Atrust corp. - * Copyright 2012 Alfred Liu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -#ifndef __URBDRC_TYPES_H -#define __URBDRC_TYPES_H - - -#include "config.h" -#include -#include -#include -#include -#include -#include "drdynvc_types.h" - -#include -#include -#include - -#define CAPABILITIES_NEGOTIATOR 0x00000000 -#define CLIENT_DEVICE_SINK 0x00000001 -#define SERVER_CHANNEL_NOTIFICATION 0x00000002 -#define CLIENT_CHANNEL_NOTIFICATION 0x00000003 -#define BASE_USBDEVICE_NUM 0x00000005 - -#define RIMCALL_RELEASE 0x00000001 -#define RIM_EXCHANGE_CAPABILITY_REQUEST 0x00000100 -#define CHANNEL_CREATED 0x00000100 -#define ADD_VIRTUAL_CHANNEL 0x00000100 -#define ADD_DEVICE 0x00000101 - - -#define INIT_CHANNEL_IN 1 -#define INIT_CHANNEL_OUT 0 - - -/* InterfaceClass */ -#define CLASS_RESERVE 0x00 -#define CLASS_AUDIO 0x01 -#define CLASS_COMMUNICATION_IF 0x02 -#define CLASS_HID 0x03 -#define CLASS_PHYSICAL 0x05 -#define CLASS_IMAGE 0x06 -#define CLASS_PRINTER 0x07 -#define CLASS_MASS_STORAGE 0x08 -#define CLASS_HUB 0x09 -#define CLASS_COMMUNICATION_DATA_IF 0x0a -#define CLASS_SMART_CARD 0x0b -#define CLASS_CONTENT_SECURITY 0x0d -#define CLASS_VIDEO 0x0e -#define CLASS_PERSONAL_HEALTHCARE 0x0f -#define CLASS_DIAGNOSTIC 0xdc -#define CLASS_WIRELESS_CONTROLLER 0xe0 -#define CLASS_ELSE_DEVICE 0xef -#define CLASS_DEPENDENCE 0xfe -#define CLASS_VENDOR_DEPENDENCE 0xff - - -/* usb version */ -#define USB_v1_0 0x100 -#define USB_v1_1 0x110 -#define USB_v2_0 0x200 -#define USB_v3_0 0x300 - -#define STREAM_ID_NONE 0x0 -#define STREAM_ID_PROXY 0x1 -#define STREAM_ID_STUB 0x2 - -#define CANCEL_REQUEST 0x00000100 -#define REGISTER_REQUEST_CALLBACK 0x00000101 -#define IO_CONTROL 0x00000102 -#define INTERNAL_IO_CONTROL 0x00000103 -#define QUERY_DEVICE_TEXT 0x00000104 -#define TRANSFER_IN_REQUEST 0x00000105 -#define TRANSFER_OUT_REQUEST 0x00000106 -#define RETRACT_DEVICE 0x00000107 - - -#define IOCONTROL_COMPLETION 0x00000100 -#define URB_COMPLETION 0x00000101 -#define URB_COMPLETION_NO_DATA 0x00000102 - -/* The USB device is to be stopped from being redirected because the - * device is blocked by the server's policy. */ -#define UsbRetractReason_BlockedByPolicy 0x00000001 - - - -enum device_text_type { - DeviceTextDescription = 0, - DeviceTextLocationInformation = 1, -}; - -enum device_descriptor_table { - B_LENGTH = 0, - B_DESCRIPTOR_TYPE = 1, - BCD_USB = 2, - B_DEVICE_CLASS = 4, - B_DEVICE_SUBCLASS = 5, - B_DEVICE_PROTOCOL = 6, - B_MAX_PACKET_SIZE0 = 7, - ID_VENDOR = 8, - ID_PRODUCT = 10, - BCD_DEVICE = 12, - I_MANUFACTURER = 14, - I_PRODUCT = 15, - I_SERIAL_NUMBER = 16, - B_NUM_CONFIGURATIONS = 17 -}; - - -#define PIPE_CANCEL 0 -#define PIPE_RESET 1 - -#define IOCTL_INTERNAL_USB_SUBMIT_URB 0x00220003 -#define IOCTL_INTERNAL_USB_RESET_PORT 0x00220007 -#define IOCTL_INTERNAL_USB_GET_PORT_STATUS 0x00220013 -#define IOCTL_INTERNAL_USB_CYCLE_PORT 0x0022001F -#define IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION 0x00220027 - - - -#define URB_FUNCTION_SELECT_CONFIGURATION 0x0000 -#define URB_FUNCTION_SELECT_INTERFACE 0x0001 -#define URB_FUNCTION_ABORT_PIPE 0x0002 -#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003 -#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004 -#define URB_FUNCTION_GET_FRAME_LENGTH 0x0005 -#define URB_FUNCTION_SET_FRAME_LENGTH 0x0006 -#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007 -#define URB_FUNCTION_CONTROL_TRANSFER 0x0008 -#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009 -#define URB_FUNCTION_ISOCH_TRANSFER 0x000A -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B -#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C -#define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D -#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E -#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F -#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010 -#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011 -#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012 -#define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013 -#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014 -#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015 -#define URB_FUNCTION_RESERVED_0X0016 0x0016 -#define URB_FUNCTION_VENDOR_DEVICE 0x0017 -#define URB_FUNCTION_VENDOR_INTERFACE 0x0018 -#define URB_FUNCTION_VENDOR_ENDPOINT 0x0019 -#define URB_FUNCTION_CLASS_DEVICE 0x001A -#define URB_FUNCTION_CLASS_INTERFACE 0x001B -#define URB_FUNCTION_CLASS_ENDPOINT 0x001C -#define URB_FUNCTION_RESERVE_0X001D 0x001D -#define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL 0x001E -#define URB_FUNCTION_CLASS_OTHER 0x001F -#define URB_FUNCTION_VENDOR_OTHER 0x0020 -#define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021 -#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022 -#define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023 -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024 -#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025 -#define URB_FUNCTION_GET_CONFIGURATION 0x0026 -#define URB_FUNCTION_GET_INTERFACE 0x0027 -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028 -#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029 -#define URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR 0x002A -#define URB_FUNCTION_RESERVE_0X002B 0x002B -#define URB_FUNCTION_RESERVE_0X002C 0x002C -#define URB_FUNCTION_RESERVE_0X002D 0x002D -#define URB_FUNCTION_RESERVE_0X002E 0x002E -#define URB_FUNCTION_RESERVE_0X002F 0x002F -// USB 2.0 calls start at 0x0030 -#define URB_FUNCTION_SYNC_RESET_PIPE 0x0030 -#define URB_FUNCTION_SYNC_CLEAR_STALL 0x0031 -#define URB_FUNCTION_CONTROL_TRANSFER_EX 0x0032 - - - - -#define USBD_STATUS_SUCCESS 0x0 -#define USBD_STATUS_PENDING 0x40000000 -#define USBD_STATUS_CANCELED 0xC0010000 - -#define USBD_STATUS_CRC 0xC0000001 -#define USBD_STATUS_BTSTUFF 0xC0000002 -#define USBD_STATUS_DATA_TOGGLE_MISMATCH 0xC0000003 -#define USBD_STATUS_STALL_PID 0xC0000004 -#define USBD_STATUS_DEV_NOT_RESPONDING 0xC0000005 -#define USBD_STATUS_PID_CHECK_FAILURE 0xC0000006 -#define USBD_STATUS_UNEXPECTED_PID 0xC0000007 -#define USBD_STATUS_DATA_OVERRUN 0xC0000008 -#define USBD_STATUS_DATA_UNDERRUN 0xC0000009 -#define USBD_STATUS_RESERVED1 0xC000000A -#define USBD_STATUS_RESERVED2 0xC000000B -#define USBD_STATUS_BUFFER_OVERRUN 0xC000000C -#define USBD_STATUS_BUFFER_UNDERRUN 0xC000000D - -/* unknow */ -#define USBD_STATUS_NO_DATA 0xC000000E - -#define USBD_STATUS_NOT_ACCESSED 0xC000000F -#define USBD_STATUS_FIFO 0xC0000010 -#define USBD_STATUS_XACT_ERROR 0xC0000011 -#define USBD_STATUS_BABBLE_DETECTED 0xC0000012 -#define USBD_STATUS_DATA_BUFFER_ERROR 0xC0000013 - -#define USBD_STATUS_NOT_SUPPORTED 0xC0000E00 -#define USBD_STATUS_BUFFER_TOO_SMALL 0xC0003000 -#define USBD_STATUS_TIMEOUT 0xC0006000 -#define USBD_STATUS_DEVICE_GONE 0xC0007000 - -#define USBD_STATUS_NO_MEMORY 0x80000100 -#define USBD_STATUS_INVALID_URB_FUNCTION 0x80000200 -#define USBD_STATUS_INVALID_PARAMETER 0x80000300 -#define USBD_STATUS_REQUEST_FAILED 0x80000500 -#define USBD_STATUS_INVALID_PIPE_HANDLE 0x80000600 -#define USBD_STATUS_ERROR_SHORT_TRANSFER 0x80000900 - -// Values for URB TransferFlags Field -// - -/* - Set if data moves device->host -*/ -#define USBD_TRANSFER_DIRECTION 0x00000001 -/* - This bit if not set indicates that a short packet, and hence, - a short transfer is an error condition -*/ -#define USBD_SHORT_TRANSFER_OK 0x00000002 -/* - Subit the iso transfer on the next frame -*/ -#define USBD_START_ISO_TRANSFER_ASAP 0x00000004 -#define USBD_DEFAULT_PIPE_TRANSFER 0x00000008 - - -#define USBD_TRANSFER_DIRECTION_FLAG(flags) ((flags) & USBD_TRANSFER_DIRECTION) - -#define USBD_TRANSFER_DIRECTION_OUT 0 -#define USBD_TRANSFER_DIRECTION_IN 1 - -#define VALID_TRANSFER_FLAGS_MASK USBD_SHORT_TRANSFER_OK | \ - USBD_TRANSFER_DIRECTION | \ - USBD_START_ISO_TRANSFER_ASAP | \ - USBD_DEFAULT_PIPE_TRANSFER) - - - - -#define ENDPOINT_HALT 0x00 -#define DEVICE_REMOTE_WAKEUP 0x01 - - -/* transfer type */ -#define CONTROL_TRANSFER 0x00 -#define ISOCHRONOUS_TRANSFER 0x01 -#define BULK_TRANSFER 0x02 -#define INTERRUPT_TRANSFER 0x03 - - - -#define ClearHubFeature (0x2000 | LIBUSB_REQUEST_CLEAR_FEATURE) -#define ClearPortFeature (0x2300 | LIBUSB_REQUEST_CLEAR_FEATURE) -#define GetHubDescriptor (0xa000 | LIBUSB_REQUEST_GET_DESCRIPTOR) -#define GetHubStatus (0xa000 | LIBUSB_REQUEST_GET_STATUS) -#define GetPortStatus (0xa300 | LIBUSB_REQUEST_GET_STATUS) -#define SetHubFeature (0x2000 | LIBUSB_REQUEST_SET_FEATURE) -#define SetPortFeature (0x2300 | LIBUSB_REQUEST_SET_FEATURE) - - - -#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 -#define USBD_PF_SHORT_PACKET_OPT 0x00000002 -#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 -#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 - -/* feature request */ -#define URB_SET_FEATURE 0x00 -#define URB_CLEAR_FEATURE 0x01 - -#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 -#define USBD_PF_SHORT_PACKET_OPT 0x00000002 -#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 -#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 - - -#define URB_CONTROL_TRANSFER_EXTERNAL 0x1 -#define URB_CONTROL_TRANSFER_NONEXTERNAL 0x0 - - -#define USBFS_URB_SHORT_NOT_OK 0x01 -#define USBFS_URB_ISO_ASAP 0x02 -#define USBFS_URB_BULK_CONTINUATION 0x04 -#define USBFS_URB_QUEUE_BULK 0x10 - - -#define URBDRC_DEVICE_INITIALIZED 0x01 -#define URBDRC_DEVICE_NOT_FOUND 0x02 -#define URBDRC_DEVICE_SIGNAL_END 0x04 -#define URBDRC_DEVICE_CHANNEL_CLOSED 0x08 -#define URBDRC_DEVICE_ALREADY_SEND 0x10 -#define URBDRC_DEVICE_DETACH_KERNEL 0x20 - - -#define UDEVMAN_FLAG_ADD_BY_VID_PID 0x01 -#define UDEVMAN_FLAG_ADD_BY_ADDR 0x02 -#define UDEVMAN_FLAG_ADD_BY_AUTO 0x04 -#define UDEVMAN_FLAG_DEBUG 0x08 - - -#define MAX_URB_REQUSET_NUM 0x80 - - -#define LOG_LEVEL 1 -#define LLOG(_level, _args) \ - do { if (_level < LOG_LEVEL) { printf _args ; } } while (0) -#define LLOGLN(_level, _args) \ - do { if (_level < LOG_LEVEL) { printf _args ; printf("\n"); } } while (0) - - -#define dummy_wait_obj(void) do{ sleep(5); } while(0) -#define dummy_wait_s_obj(_s) do{ sleep(_s); } while(0) - -#define ISOCH_FIFO 1 -#define WAIT_COMPLETE_SLEEP 10000 /* for cpu high loading */ - -#define urbdrc_get_mstime(_t) do { \ - struct timeval _tp; \ - gettimeofday(&_tp, 0); \ - _t = (_tp.tv_sec * 1000) + (_tp.tv_usec / 1000); \ -} while (0) - - -extern int urbdrc_debug; - -#endif /* __URBDRC_TYPES_H */ diff --git a/channels/urbdrc/CMakeLists.txt b/channels/urbdrc/CMakeLists.txt new file mode 100644 index 000000000..f49c8bedc --- /dev/null +++ b/channels/urbdrc/CMakeLists.txt @@ -0,0 +1,24 @@ +# FreeRDP: A Remote Desktop Protocol Client +# FreeRDP cmake build script +# +# Copyright 2012 Marc-Andre Moreau +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +add_subdirectory(libusb) + +if(WITH_CLIENT_CHANNELS) + add_subdirectory(client) +endif() + + diff --git a/channels/urbdrc/ChannelOptions.cmake b/channels/urbdrc/ChannelOptions.cmake new file mode 100644 index 000000000..78a631eed --- /dev/null +++ b/channels/urbdrc/ChannelOptions.cmake @@ -0,0 +1,15 @@ + +set(CHANNEL_TYPE "dynamic") +set(CHANNEL_SHORT_NAME "urbdrc") +set(CHANNEL_LONG_NAME "USB Devices Virtual Channel Extension") +set(CHANNEL_SPECIFICATIONS "[MS-RDPEUSB]") + +string(TOUPPER "WITH_${CHANNEL_SHORT_NAME}" CHANNEL_OPTION) + +if(WIN32) + option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" OFF) +else() + option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" ON) +endif() + + diff --git a/channels/drdynvc/urbdrc/CMakeLists.txt b/channels/urbdrc/client/CMakeLists.txt similarity index 96% rename from channels/drdynvc/urbdrc/CMakeLists.txt rename to channels/urbdrc/client/CMakeLists.txt index 627bf8704..ce8087e8c 100644 --- a/channels/drdynvc/urbdrc/CMakeLists.txt +++ b/channels/urbdrc/client/CMakeLists.txt @@ -25,8 +25,7 @@ set(URBDRC_SRCS data_transfer.h urbdrc_main.c urbdrc_main.h - urbdrc_types.h -) + urbdrc_types.h) include_directories(..) @@ -41,5 +40,3 @@ target_link_libraries(urbdrc freerdp-utils) install(TARGETS urbdrc DESTINATION ${FREERDP_PLUGIN_PATH}) -add_subdirectory(libusb) - diff --git a/channels/drdynvc/urbdrc/data_transfer.c b/channels/urbdrc/client/data_transfer.c similarity index 100% rename from channels/drdynvc/urbdrc/data_transfer.c rename to channels/urbdrc/client/data_transfer.c diff --git a/channels/drdynvc/urbdrc/data_transfer.h b/channels/urbdrc/client/data_transfer.h similarity index 100% rename from channels/drdynvc/urbdrc/data_transfer.h rename to channels/urbdrc/client/data_transfer.h diff --git a/channels/drdynvc/urbdrc/isoch_queue.c b/channels/urbdrc/client/isoch_queue.c similarity index 100% rename from channels/drdynvc/urbdrc/isoch_queue.c rename to channels/urbdrc/client/isoch_queue.c diff --git a/channels/drdynvc/urbdrc/isoch_queue.h b/channels/urbdrc/client/isoch_queue.h similarity index 100% rename from channels/drdynvc/urbdrc/isoch_queue.h rename to channels/urbdrc/client/isoch_queue.h diff --git a/channels/drdynvc/urbdrc/searchman.c b/channels/urbdrc/client/searchman.c similarity index 100% rename from channels/drdynvc/urbdrc/searchman.c rename to channels/urbdrc/client/searchman.c diff --git a/channels/drdynvc/urbdrc/searchman.h b/channels/urbdrc/client/searchman.h similarity index 100% rename from channels/drdynvc/urbdrc/searchman.h rename to channels/urbdrc/client/searchman.h diff --git a/channels/drdynvc/urbdrc/urbdrc_main.c b/channels/urbdrc/client/urbdrc_main.c similarity index 99% rename from channels/drdynvc/urbdrc/urbdrc_main.c rename to channels/urbdrc/client/urbdrc_main.c index e2e1e8efb..4b269015a 100644 --- a/channels/drdynvc/urbdrc/urbdrc_main.c +++ b/channels/urbdrc/client/urbdrc_main.c @@ -25,10 +25,10 @@ #include #include +#include #include #include "urbdrc_types.h" -#include "dvcman.h" #include "urbdrc_main.h" #include "data_transfer.h" #include "searchman.h" @@ -479,7 +479,7 @@ urbdrc_search_usb_device(void * arg) udev_monitor_enable_receiving(mon); /* Get the file descriptor (fd) for the monitor. This fd will get passed to select() */ - mon_fd = wait_obj_new_with_fd((void *)udev_monitor_get_fd(mon)); + mon_fd = wait_obj_new_with_fd((void*) (size_t) udev_monitor_get_fd(mon)); while (1) { diff --git a/channels/drdynvc/urbdrc/urbdrc_main.h b/channels/urbdrc/client/urbdrc_main.h similarity index 94% rename from channels/drdynvc/urbdrc/urbdrc_main.h rename to channels/urbdrc/client/urbdrc_main.h index 146e8a4fe..ff71869be 100644 --- a/channels/drdynvc/urbdrc/urbdrc_main.h +++ b/channels/urbdrc/client/urbdrc_main.h @@ -27,11 +27,10 @@ #include "isoch_queue.h" #define DEVICE_HARDWARE_ID_SIZE 32 -#define DEVICE_COMPATIBILITY_ID_SIZE 36 +#define DEVICE_COMPATIBILITY_ID_SIZE 36 #define DEVICE_INSTANCE_STR_SIZE 37 #define DEVICE_CONTAINER_STR_SIZE 39 - typedef struct _IUDEVICE IUDEVICE; typedef struct _IUDEVMAN IUDEVMAN; @@ -42,40 +41,41 @@ typedef struct _IUDEVMAN IUDEVMAN; _type (*get_##_arg) (IUDEVMAN *udevman); \ void (*set_##_arg) (IUDEVMAN *udevman, _type _arg) - typedef struct _URBDRC_LISTENER_CALLBACK URBDRC_LISTENER_CALLBACK; + struct _URBDRC_LISTENER_CALLBACK { IWTSListenerCallback iface; - IWTSPlugin * plugin; - IWTSVirtualChannelManager * channel_mgr; + IWTSPlugin* plugin; + IWTSVirtualChannelManager* channel_mgr; }; typedef struct _URBDRC_CHANNEL_CALLBACK URBDRC_CHANNEL_CALLBACK; + struct _URBDRC_CHANNEL_CALLBACK { IWTSVirtualChannelCallback iface; - IWTSPlugin * plugin; - IWTSVirtualChannelManager * channel_mgr; - IWTSVirtualChannel * channel; + IWTSPlugin* plugin; + IWTSVirtualChannelManager* channel_mgr; + IWTSVirtualChannel* channel; }; typedef struct _URBDRC_PLUGIN URBDRC_PLUGIN; + struct _URBDRC_PLUGIN { IWTSPlugin iface; - URBDRC_LISTENER_CALLBACK * listener_callback; + URBDRC_LISTENER_CALLBACK* listener_callback; - IUDEVMAN * udevman; - USB_SEARCHMAN * searchman; + IUDEVMAN* udevman; + USB_SEARCHMAN* searchman; uint32 first_channel_id; uint32 vchannel_status; }; - #define URBDRC_UDEVMAN_EXPORT_FUNC_NAME "FreeRDPUDEVMANEntry" typedef void (*PREGISTERURBDRCSERVICE)(IWTSPlugin* plugin, IUDEVMAN* udevman); @@ -91,21 +91,18 @@ typedef FREERDP_URBDRC_SERVICE_ENTRY_POINTS* PFREERDP_URBDRC_SERVICE_ENTRY_POINT typedef int (*PFREERDP_URBDRC_DEVICE_ENTRY)(PFREERDP_URBDRC_SERVICE_ENTRY_POINTS pEntryPoints); - - - typedef struct _TRANSFER_DATA TRANSFER_DATA; + struct _TRANSFER_DATA { - URBDRC_CHANNEL_CALLBACK * callback; - URBDRC_PLUGIN * urbdrc; - IUDEVMAN * udevman; - uint8 * pBuffer; - uint32 cbSize; - uint32 UsbDevice; + URBDRC_CHANNEL_CALLBACK* callback; + URBDRC_PLUGIN* urbdrc; + IUDEVMAN* udevman; + uint8* pBuffer; + uint32 cbSize; + uint32 UsbDevice; }; - struct _IUDEVICE { /* Transfer */ @@ -228,8 +225,6 @@ struct _IUDEVICE }; - - struct _IUDEVMAN { /* Standard */ @@ -265,5 +260,4 @@ struct _IUDEVMAN void (*wait_urb) (IUDEVMAN * idevman); }; - #endif /* __URBDRC_MAIN_H */ diff --git a/channels/urbdrc/client/urbdrc_types.h b/channels/urbdrc/client/urbdrc_types.h new file mode 100644 index 000000000..b392b9ddd --- /dev/null +++ b/channels/urbdrc/client/urbdrc_types.h @@ -0,0 +1,337 @@ +/** + * FreeRDP: A Remote Desktop Protocol client. + * RemoteFX USB Redirection + * + * Copyright 2012 Atrust corp. + * Copyright 2012 Alfred Liu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __URBDRC_TYPES_H +#define __URBDRC_TYPES_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef WITH_DEBUG_DVC +#define DEBUG_DVC(fmt, ...) DEBUG_CLASS(DVC, fmt, ## __VA_ARGS__) +#else +#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__) +#endif + +#define CAPABILITIES_NEGOTIATOR 0x00000000 +#define CLIENT_DEVICE_SINK 0x00000001 +#define SERVER_CHANNEL_NOTIFICATION 0x00000002 +#define CLIENT_CHANNEL_NOTIFICATION 0x00000003 +#define BASE_USBDEVICE_NUM 0x00000005 + +#define RIMCALL_RELEASE 0x00000001 +#define RIM_EXCHANGE_CAPABILITY_REQUEST 0x00000100 +#define CHANNEL_CREATED 0x00000100 +#define ADD_VIRTUAL_CHANNEL 0x00000100 +#define ADD_DEVICE 0x00000101 + +#define INIT_CHANNEL_IN 1 +#define INIT_CHANNEL_OUT 0 + +/* InterfaceClass */ +#define CLASS_RESERVE 0x00 +#define CLASS_AUDIO 0x01 +#define CLASS_COMMUNICATION_IF 0x02 +#define CLASS_HID 0x03 +#define CLASS_PHYSICAL 0x05 +#define CLASS_IMAGE 0x06 +#define CLASS_PRINTER 0x07 +#define CLASS_MASS_STORAGE 0x08 +#define CLASS_HUB 0x09 +#define CLASS_COMMUNICATION_DATA_IF 0x0a +#define CLASS_SMART_CARD 0x0b +#define CLASS_CONTENT_SECURITY 0x0d +#define CLASS_VIDEO 0x0e +#define CLASS_PERSONAL_HEALTHCARE 0x0f +#define CLASS_DIAGNOSTIC 0xdc +#define CLASS_WIRELESS_CONTROLLER 0xe0 +#define CLASS_ELSE_DEVICE 0xef +#define CLASS_DEPENDENCE 0xfe +#define CLASS_VENDOR_DEPENDENCE 0xff + +/* usb version */ +#define USB_v1_0 0x100 +#define USB_v1_1 0x110 +#define USB_v2_0 0x200 +#define USB_v3_0 0x300 + +#define STREAM_ID_NONE 0x0 +#define STREAM_ID_PROXY 0x1 +#define STREAM_ID_STUB 0x2 + +#define CANCEL_REQUEST 0x00000100 +#define REGISTER_REQUEST_CALLBACK 0x00000101 +#define IO_CONTROL 0x00000102 +#define INTERNAL_IO_CONTROL 0x00000103 +#define QUERY_DEVICE_TEXT 0x00000104 +#define TRANSFER_IN_REQUEST 0x00000105 +#define TRANSFER_OUT_REQUEST 0x00000106 +#define RETRACT_DEVICE 0x00000107 + + +#define IOCONTROL_COMPLETION 0x00000100 +#define URB_COMPLETION 0x00000101 +#define URB_COMPLETION_NO_DATA 0x00000102 + +/* The USB device is to be stopped from being redirected because the + * device is blocked by the server's policy. */ +#define UsbRetractReason_BlockedByPolicy 0x00000001 + +enum device_text_type +{ + DeviceTextDescription = 0, + DeviceTextLocationInformation = 1, +}; + +enum device_descriptor_table +{ + B_LENGTH = 0, + B_DESCRIPTOR_TYPE = 1, + BCD_USB = 2, + B_DEVICE_CLASS = 4, + B_DEVICE_SUBCLASS = 5, + B_DEVICE_PROTOCOL = 6, + B_MAX_PACKET_SIZE0 = 7, + ID_VENDOR = 8, + ID_PRODUCT = 10, + BCD_DEVICE = 12, + I_MANUFACTURER = 14, + I_PRODUCT = 15, + I_SERIAL_NUMBER = 16, + B_NUM_CONFIGURATIONS = 17 +}; + +#define PIPE_CANCEL 0 +#define PIPE_RESET 1 + +#define IOCTL_INTERNAL_USB_SUBMIT_URB 0x00220003 +#define IOCTL_INTERNAL_USB_RESET_PORT 0x00220007 +#define IOCTL_INTERNAL_USB_GET_PORT_STATUS 0x00220013 +#define IOCTL_INTERNAL_USB_CYCLE_PORT 0x0022001F +#define IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION 0x00220027 + + + +#define URB_FUNCTION_SELECT_CONFIGURATION 0x0000 +#define URB_FUNCTION_SELECT_INTERFACE 0x0001 +#define URB_FUNCTION_ABORT_PIPE 0x0002 +#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003 +#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004 +#define URB_FUNCTION_GET_FRAME_LENGTH 0x0005 +#define URB_FUNCTION_SET_FRAME_LENGTH 0x0006 +#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007 +#define URB_FUNCTION_CONTROL_TRANSFER 0x0008 +#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009 +#define URB_FUNCTION_ISOCH_TRANSFER 0x000A +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B +#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C +#define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D +#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E +#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F +#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010 +#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011 +#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012 +#define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013 +#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014 +#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015 +#define URB_FUNCTION_RESERVED_0X0016 0x0016 +#define URB_FUNCTION_VENDOR_DEVICE 0x0017 +#define URB_FUNCTION_VENDOR_INTERFACE 0x0018 +#define URB_FUNCTION_VENDOR_ENDPOINT 0x0019 +#define URB_FUNCTION_CLASS_DEVICE 0x001A +#define URB_FUNCTION_CLASS_INTERFACE 0x001B +#define URB_FUNCTION_CLASS_ENDPOINT 0x001C +#define URB_FUNCTION_RESERVE_0X001D 0x001D +#define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL 0x001E +#define URB_FUNCTION_CLASS_OTHER 0x001F +#define URB_FUNCTION_VENDOR_OTHER 0x0020 +#define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021 +#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022 +#define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023 +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024 +#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025 +#define URB_FUNCTION_GET_CONFIGURATION 0x0026 +#define URB_FUNCTION_GET_INTERFACE 0x0027 +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028 +#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029 +#define URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR 0x002A +#define URB_FUNCTION_RESERVE_0X002B 0x002B +#define URB_FUNCTION_RESERVE_0X002C 0x002C +#define URB_FUNCTION_RESERVE_0X002D 0x002D +#define URB_FUNCTION_RESERVE_0X002E 0x002E +#define URB_FUNCTION_RESERVE_0X002F 0x002F +// USB 2.0 calls start at 0x0030 +#define URB_FUNCTION_SYNC_RESET_PIPE 0x0030 +#define URB_FUNCTION_SYNC_CLEAR_STALL 0x0031 +#define URB_FUNCTION_CONTROL_TRANSFER_EX 0x0032 + +#define USBD_STATUS_SUCCESS 0x0 +#define USBD_STATUS_PENDING 0x40000000 +#define USBD_STATUS_CANCELED 0xC0010000 + +#define USBD_STATUS_CRC 0xC0000001 +#define USBD_STATUS_BTSTUFF 0xC0000002 +#define USBD_STATUS_DATA_TOGGLE_MISMATCH 0xC0000003 +#define USBD_STATUS_STALL_PID 0xC0000004 +#define USBD_STATUS_DEV_NOT_RESPONDING 0xC0000005 +#define USBD_STATUS_PID_CHECK_FAILURE 0xC0000006 +#define USBD_STATUS_UNEXPECTED_PID 0xC0000007 +#define USBD_STATUS_DATA_OVERRUN 0xC0000008 +#define USBD_STATUS_DATA_UNDERRUN 0xC0000009 +#define USBD_STATUS_RESERVED1 0xC000000A +#define USBD_STATUS_RESERVED2 0xC000000B +#define USBD_STATUS_BUFFER_OVERRUN 0xC000000C +#define USBD_STATUS_BUFFER_UNDERRUN 0xC000000D + +/* unknown */ +#define USBD_STATUS_NO_DATA 0xC000000E + +#define USBD_STATUS_NOT_ACCESSED 0xC000000F +#define USBD_STATUS_FIFO 0xC0000010 +#define USBD_STATUS_XACT_ERROR 0xC0000011 +#define USBD_STATUS_BABBLE_DETECTED 0xC0000012 +#define USBD_STATUS_DATA_BUFFER_ERROR 0xC0000013 + +#define USBD_STATUS_NOT_SUPPORTED 0xC0000E00 +#define USBD_STATUS_BUFFER_TOO_SMALL 0xC0003000 +#define USBD_STATUS_TIMEOUT 0xC0006000 +#define USBD_STATUS_DEVICE_GONE 0xC0007000 + +#define USBD_STATUS_NO_MEMORY 0x80000100 +#define USBD_STATUS_INVALID_URB_FUNCTION 0x80000200 +#define USBD_STATUS_INVALID_PARAMETER 0x80000300 +#define USBD_STATUS_REQUEST_FAILED 0x80000500 +#define USBD_STATUS_INVALID_PIPE_HANDLE 0x80000600 +#define USBD_STATUS_ERROR_SHORT_TRANSFER 0x80000900 + +// Values for URB TransferFlags Field +// + +/* + Set if data moves device->host +*/ +#define USBD_TRANSFER_DIRECTION 0x00000001 +/* + This bit if not set indicates that a short packet, and hence, + a short transfer is an error condition +*/ +#define USBD_SHORT_TRANSFER_OK 0x00000002 +/* + Subit the iso transfer on the next frame +*/ +#define USBD_START_ISO_TRANSFER_ASAP 0x00000004 +#define USBD_DEFAULT_PIPE_TRANSFER 0x00000008 + + +#define USBD_TRANSFER_DIRECTION_FLAG(flags) ((flags) & USBD_TRANSFER_DIRECTION) + +#define USBD_TRANSFER_DIRECTION_OUT 0 +#define USBD_TRANSFER_DIRECTION_IN 1 + +#define VALID_TRANSFER_FLAGS_MASK USBD_SHORT_TRANSFER_OK | \ + USBD_TRANSFER_DIRECTION | \ + USBD_START_ISO_TRANSFER_ASAP | \ + USBD_DEFAULT_PIPE_TRANSFER) + +#define ENDPOINT_HALT 0x00 +#define DEVICE_REMOTE_WAKEUP 0x01 + +/* transfer type */ +#define CONTROL_TRANSFER 0x00 +#define ISOCHRONOUS_TRANSFER 0x01 +#define BULK_TRANSFER 0x02 +#define INTERRUPT_TRANSFER 0x03 + +#define ClearHubFeature (0x2000 | LIBUSB_REQUEST_CLEAR_FEATURE) +#define ClearPortFeature (0x2300 | LIBUSB_REQUEST_CLEAR_FEATURE) +#define GetHubDescriptor (0xa000 | LIBUSB_REQUEST_GET_DESCRIPTOR) +#define GetHubStatus (0xa000 | LIBUSB_REQUEST_GET_STATUS) +#define GetPortStatus (0xa300 | LIBUSB_REQUEST_GET_STATUS) +#define SetHubFeature (0x2000 | LIBUSB_REQUEST_SET_FEATURE) +#define SetPortFeature (0x2300 | LIBUSB_REQUEST_SET_FEATURE) + +#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 +#define USBD_PF_SHORT_PACKET_OPT 0x00000002 +#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 +#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 + +/* feature request */ +#define URB_SET_FEATURE 0x00 +#define URB_CLEAR_FEATURE 0x01 + +#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 +#define USBD_PF_SHORT_PACKET_OPT 0x00000002 +#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 +#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 + +#define URB_CONTROL_TRANSFER_EXTERNAL 0x1 +#define URB_CONTROL_TRANSFER_NONEXTERNAL 0x0 + +#define USBFS_URB_SHORT_NOT_OK 0x01 +#define USBFS_URB_ISO_ASAP 0x02 +#define USBFS_URB_BULK_CONTINUATION 0x04 +#define USBFS_URB_QUEUE_BULK 0x10 + +#define URBDRC_DEVICE_INITIALIZED 0x01 +#define URBDRC_DEVICE_NOT_FOUND 0x02 +#define URBDRC_DEVICE_SIGNAL_END 0x04 +#define URBDRC_DEVICE_CHANNEL_CLOSED 0x08 +#define URBDRC_DEVICE_ALREADY_SEND 0x10 +#define URBDRC_DEVICE_DETACH_KERNEL 0x20 + +#define UDEVMAN_FLAG_ADD_BY_VID_PID 0x01 +#define UDEVMAN_FLAG_ADD_BY_ADDR 0x02 +#define UDEVMAN_FLAG_ADD_BY_AUTO 0x04 +#define UDEVMAN_FLAG_DEBUG 0x08 + +#define MAX_URB_REQUSET_NUM 0x80 + +#define LOG_LEVEL 1 +#define LLOG(_level, _args) \ + do { if (_level < LOG_LEVEL) { printf _args ; } } while (0) +#define LLOGLN(_level, _args) \ + do { if (_level < LOG_LEVEL) { printf _args ; printf("\n"); } } while (0) + +#define dummy_wait_obj(void) do{ sleep(5); } while(0) +#define dummy_wait_s_obj(_s) do{ sleep(_s); } while(0) + +#define ISOCH_FIFO 1 +#define WAIT_COMPLETE_SLEEP 10000 /* for cpu high loading */ + +#define urbdrc_get_mstime(_t) do { \ + struct timeval _tp; \ + gettimeofday(&_tp, 0); \ + _t = (_tp.tv_sec * 1000) + (_tp.tv_usec / 1000); \ +} while (0) + +extern int urbdrc_debug; + +#endif /* __URBDRC_TYPES_H */ diff --git a/channels/drdynvc/urbdrc/libusb/CMakeLists.txt b/channels/urbdrc/libusb/CMakeLists.txt similarity index 96% rename from channels/drdynvc/urbdrc/libusb/CMakeLists.txt rename to channels/urbdrc/libusb/CMakeLists.txt index f3ba9c242..cd874c1c7 100644 --- a/channels/drdynvc/urbdrc/libusb/CMakeLists.txt +++ b/channels/urbdrc/libusb/CMakeLists.txt @@ -21,10 +21,9 @@ set(LIBUSB_UDEVMAN_SRCS libusb_udevice.c libusb_udevice.h request_queue.c - request_queue.h -) + request_queue.h) -include_directories(..) +include_directories(../client) add_library(libusb_udevman ${LIBUSB_UDEVMAN_SRCS}) set_target_properties(libusb_udevman PROPERTIES PREFIX "") @@ -36,3 +35,4 @@ target_link_libraries(libusb_udevman usb-1.0) target_link_libraries(libusb_udevman freerdp-utils) install(TARGETS libusb_udevman DESTINATION ${FREERDP_PLUGIN_PATH}) + diff --git a/channels/drdynvc/urbdrc/libusb/libusb_udevice.c b/channels/urbdrc/libusb/libusb_udevice.c similarity index 100% rename from channels/drdynvc/urbdrc/libusb/libusb_udevice.c rename to channels/urbdrc/libusb/libusb_udevice.c diff --git a/channels/drdynvc/urbdrc/libusb/libusb_udevice.h b/channels/urbdrc/libusb/libusb_udevice.h similarity index 100% rename from channels/drdynvc/urbdrc/libusb/libusb_udevice.h rename to channels/urbdrc/libusb/libusb_udevice.h diff --git a/channels/drdynvc/urbdrc/libusb/libusb_udevman.c b/channels/urbdrc/libusb/libusb_udevman.c similarity index 100% rename from channels/drdynvc/urbdrc/libusb/libusb_udevman.c rename to channels/urbdrc/libusb/libusb_udevman.c diff --git a/channels/drdynvc/urbdrc/libusb/request_queue.c b/channels/urbdrc/libusb/request_queue.c similarity index 100% rename from channels/drdynvc/urbdrc/libusb/request_queue.c rename to channels/urbdrc/libusb/request_queue.c diff --git a/channels/drdynvc/urbdrc/libusb/request_queue.h b/channels/urbdrc/libusb/request_queue.h similarity index 100% rename from channels/drdynvc/urbdrc/libusb/request_queue.h rename to channels/urbdrc/libusb/request_queue.h