Hi, This series extends USB/IP support in Kernel by adding an emulated USB Device Controller. This allows to virtually connect USB gadget created on a server to some remote machine as if it would be a fully functional USB device. -------------- Current design: -------------- ------------ ------------- ------ | USB Device |---USB---> | Stub Driver | ---Ethernet---> | vHCI | ------------ ------------- ------ Currently USB/IP protocol allows to pass some real USB device connected to one computer to another one over the net. ----------------- New possibilities: ----------------- ------------ ------------- ------ | USB Device |---USB---> | Stub Driver | ---Ethernet---> | vHCI | ------------ ------------- ------ ^ ------------ ------ | | USB Gadget |----> | vUDC | --------------Ethernet-------- ------------ ------ This series extends USB/IP abilities with possibility to pass not only the physical device connected to some computer but also some USB gadget composed on that machine. New interface is fully compatible with the USB/IP itself. ---------------- Why is it useful? ---------------- First of all this allows us to improve phone emulation in qemu environment. Such an emulated phone can be now connected to developer's machine or another virtual machine as if it would be a physical phone. Of course this is suitable for any emulated linux machine not only for mobile systems. This also provides additional help in testing USB functions and drivers. We may say that it's the next step of testing between dummy_hcd and real hardware as it allows to split device and host software and check how they are working in independent environment with some latencies, emulated connection and disconnection etc. It is also worth mention that if there are some problems they can be easily analyzed using usbmon (dump USB traffic) or Wireshark (dump usbip traffic) instead of buying expensive USB sniffers. vUDC is also very useful for educational purposes. It allows to create a two virtual machine (called host and device) and emulate that they are connected with USB cable. This is much more easier to understand than dummy_hcd and having both host and device on the same machine. ------------------------------- Why not dummy_hcd + stub driver? ------------------------------- It is possible to achieve quite similar functionality using dummy_hcd and a stub driver. So we get something like this: ------------ ----------- ----------- | USB Gadget | ---> | dummy_udc | ---> | dummy_hcd | ---emulated--- ------------ ----------- ----------- ------------- ------ ---USB---> | Stub Driver | ---Ethernet---> | vHCI | ------------- ------ But there is another unnecessary abstraction layer which makes this setup more complex and generates some noise as there is a moment in which our device is connected to the same system via dummy_hcd. This may be very annoying esp when debugging. Thanks to vUDC we eliminate this step and connect directly to a remote host without any additional noise on device system. Moreover in this setup it is impossible to easily emulate USB cable connection and disconnection as dummy_udc is always connected to dummy_hcd. In addition vUDC should be also a little bit more resource efficient. ------------------------ University Collaboration ------------------------ This driver has been created mostly by students from The Open Operating Systems Student Society at University of Warsaw with my support. The whole suff is a part of collaboration between Samsung R&D Institute Poland and mentioned students society. The goal of this collaboration is to learn and encourage young people to contribute to Linux kernel and other open source project. To achieve this the whole process consist of two parts: In first part, Samsung as a company provides some additional lectures for university students which are conducted by chosen employees. They are mostly related to open source contribution process, kernel programing and topics closely related to chosen project (for example USB). In second part students implement a project chosen from Samsung's proposals. In this part company ensures cotinuous (of course not full time but as a side task) spupport for students by one of employees. Below students took a part in creating this driver: Igor Kotrasinski <ikotrasinsk@xxxxxxxxx> Karol Kosik <karo9@xxxxxxxxxx> Ewelina Kosmider <3w3lfin@xxxxxxxxx> Dawid Lazarczyk <lazarczyk.dawid@xxxxxxxxx> Piotr Szulc <ps347277@xxxxxxxxxxxxxxxxxxxxx> >From Samsung's side I'm theirs tutor and I have also done some final preparation and fixing before sending this driver. I have to also credit Igor Kotrasinski for doing the commit split and a lot of cleanups in this driver during his internship in the summer. -- Best regards, Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics --- Igor Kotrasinski (10): usbip: vudc: Add header for USB/IP UDC usbip: vudc: Make usbip_common vudc-aware usbip: vudc: Add VUDC main file usbip: vudc: Add vudc_rx usbip: vudc: Add vudc_transfer usbip: vudc: Add vudc_tx usbip: vudc: Add UDC specific ops usbip: vudc: Add SysFS infrastructure for VUDC usbip: tools: Start using VUDC backend in usbip tools usbip: vudc: Add vudc to Kconfig Krzysztof Opasiak (2): usbip: tools: Extract generic code to be shared with vudc backend usbip: tools: Add vudc backend to usbip tools drivers/usb/usbip/Kconfig | 11 + drivers/usb/usbip/Makefile | 3 + drivers/usb/usbip/usbip_common.c | 10 +- drivers/usb/usbip/usbip_common.h | 10 + drivers/usb/usbip/vudc.h | 190 ++++++++ drivers/usb/usbip/vudc_dev.c | 662 ++++++++++++++++++++++++++ drivers/usb/usbip/vudc_main.c | 113 +++++ drivers/usb/usbip/vudc_rx.c | 234 +++++++++ drivers/usb/usbip/vudc_sysfs.c | 221 +++++++++ drivers/usb/usbip/vudc_transfer.c | 506 ++++++++++++++++++++ drivers/usb/usbip/vudc_tx.c | 289 +++++++++++ tools/usb/usbip/libsrc/Makefile.am | 4 +- tools/usb/usbip/libsrc/usbip_common.h | 3 + tools/usb/usbip/libsrc/usbip_device_driver.c | 163 +++++++ tools/usb/usbip/libsrc/usbip_device_driver.h | 34 ++ tools/usb/usbip/libsrc/usbip_host_common.c | 273 +++++++++++ tools/usb/usbip/libsrc/usbip_host_common.h | 104 ++++ tools/usb/usbip/libsrc/usbip_host_driver.c | 269 ++--------- tools/usb/usbip/libsrc/usbip_host_driver.h | 27 +- tools/usb/usbip/src/usbip_attach.c | 10 +- tools/usb/usbip/src/usbip_list.c | 96 +++- tools/usb/usbip/src/usbipd.c | 42 +- 22 files changed, 2986 insertions(+), 288 deletions(-) create mode 100644 drivers/usb/usbip/vudc.h create mode 100644 drivers/usb/usbip/vudc_dev.c create mode 100644 drivers/usb/usbip/vudc_main.c create mode 100644 drivers/usb/usbip/vudc_rx.c create mode 100644 drivers/usb/usbip/vudc_sysfs.c create mode 100644 drivers/usb/usbip/vudc_transfer.c create mode 100644 drivers/usb/usbip/vudc_tx.c create mode 100644 tools/usb/usbip/libsrc/usbip_device_driver.c create mode 100644 tools/usb/usbip/libsrc/usbip_device_driver.h create mode 100644 tools/usb/usbip/libsrc/usbip_host_common.c create mode 100644 tools/usb/usbip/libsrc/usbip_host_common.h -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html