[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/31] usb: documentation update
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 18/31] usb: documentation update |
Date: |
Mon, 6 Jun 2011 14:39:09 +0200 |
Add some more informations to docs/usb2.txt about using usb2 (also usb1)
devices.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
docs/usb2.txt | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 85 insertions(+), 0 deletions(-)
diff --git a/docs/usb2.txt b/docs/usb2.txt
index b283c13..5950c71 100644
--- a/docs/usb2.txt
+++ b/docs/usb2.txt
@@ -31,6 +31,91 @@ a complete example:
This attaches a usb tablet to the UHCI adapter and a usb mass storage
device to the EHCI adapter.
+
+More USB tips & tricks
+======================
+
+Recently the usb pass through driver (also known as usb-host) and the
+qemu usb subsystem gained a few capabilities which are available only
+via qdev properties, i,e. when using '-device'.
+
+
+physical port addressing
+------------------------
+
+First you can (for all usb devices) specify the physical port where
+the device will show up in the guest. This can be done using the
+"port" property. UHCI has two root ports (1,2). EHCI has four root
+ports (1-4), the emulated (1.1) USB hub has eight ports.
+
+Plugging a tablet into UHCI port 1 works like this:
+
+ -device usb-tablet,bus=usb.0,port=1
+
+Plugging a hub into UHCI port 2 works like this:
+
+ -device usb-hub,bus=usb.0,port=2
+
+Plugging a virtual usb stick into port 4 of the hub just plugged works
+this way:
+
+ -device usb-storage,bus=usb.0,port=2.4,drive=...
+
+You can do basically the same in the monitor using the device_add
+command. If you want to unplug devices too you should specify some
+unique id which you can use to refer to the device ...
+
+ (qemu) device_add usb-tablet,bus=usb.0,port=1,id=my-tablet
+ (qemu) device_del my-tablet
+
+... when unplugging it with device_del.
+
+
+USB pass through hints
+----------------------
+
+The usb-host driver has a bunch of properties to specify the device
+which should be passed to the guest:
+
+ hostbus=<nr> -- Specifies the bus number the device must be attached
+ to.
+
+ hostaddr=<nr> -- Specifies the device address the device got
+ assigned by the guest os.
+
+ hostport=<str> -- Specifies the physical port the device is attached
+ to.
+
+ vendorid=<hexnr> -- Specifies the vendor ID of the device.
+ productid=<hexnr> -- Specifies the product ID of the device.
+
+In theory you can combine all these properties as you like. In
+practice only a few combinations are useful:
+
+ (1) vendorid+productid -- match for a specific device, pass it to
+ the guest when it shows up somewhere in the host.
+
+ (2) hostbus+hostport -- match for a specific physical port in the
+ host, any device which is plugged in there gets passed to the
+ guest.
+
+ (3) hostbus+hostaddr -- most useful for ad-hoc pass through as the
+ hostaddr isn't stable, the next time you plug in the device it
+ gets a new one ...
+
+Note that USB 1.1 devices are handled by UHCI/OHCI and USB 2.0 by
+EHCI. That means a device plugged into the very same physical port
+may show up on different busses depending on the speed. The port I'm
+using for testing is bus 1 + port 1 for 2.0 devices and bus 3 + port 1
+for 1.1 devices. Passing through any device plugged into that port
+and also assign them to the correct bus can be done this way:
+
+ qemu -M pc ${otheroptions} \
+ -usb \
+ -device usb-ehci,id=ehci \
+ -device usb-host,bus=usb.0,hostbus=3,hostport=1 \
+ -device usb-host,bus=ehci.0,hostbus=1,hostport=1
+
enjoy,
Gerd
--
1.7.1
- Re: [Qemu-devel] [PATCH 13/31] usb-ehci: drop EXECUTING checks., (continued)
[Qemu-devel] [PATCH 12/31] usb: cancel async packets on unplug, Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 06/31] usb-ehci: trace buffer copy, Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 09/31] usb-ehci: fix offset writeback in ehci_buffer_rw, Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 10/31] usb-ehci: fix error handling., Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 05/31] usb-ehci: improve mmio tracing, Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 08/31] usb-ehci: multiqueue support, Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 18/31] usb: documentation update,
Gerd Hoffmann <=
[Qemu-devel] [PATCH 19/31] usb-linux: Get speed from sysfs rather then from the connectinfo ioctl, Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 07/31] usb-ehci: add queue data struct, Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 23/31] usb-linux: Don't try to open the same device twice, Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 22/31] usb-linux: Ensure devep != 0, Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 21/31] usb-linux: Don't do perror when errno is not set, Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 20/31] usb-linux: Teach about super speed, Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 16/31] usb-ehci: itd handling fixes., Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 25/31] usb: don't call usb_host_device_open from vl.c, Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 28/31] usb-bus: Don't detach non attached devices on device exit, Gerd Hoffmann, 2011/06/06
[Qemu-devel] [PATCH 24/31] usb-linux: only cleanup in host_close when host_open was successful., Gerd Hoffmann, 2011/06/06