Skip to contentSkip to conversation

usb: update docs

PATCH In review Gerd Hoffmann 2 participants 3 messages May 25, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: update docs

xhci is rock solid meanwhile. So move it up in the docs and feature it as prefered usb host adapter, instead of the old shy version saying "you might want try ...".

Also a minor text update for the companion controller setup.

---
 docs/usb2.txt | 44 +++++++++++++++++++++++++-------------------
 1 file changed, 25 insertions(+), 19 deletions(-)
docs/usb2.txt +25 -19
index 09df45b5b1..1b0e62d187 100644
@@ -1,6 +1,26 @@
 
-USB 2.0 Quick Start
-===================
+USB Quick Start
+===============
+
+xhci controller support
+-----------------------
+
+Qemu has xhci host adapter support.  The xhci hardware design is much
+more virtualization-friendly when compared to ehci and uhci, thus xhci
+emulation uses less resources (especially cpu).  So if your guest
+supports xhci (which should be the case for any operating system
+released in recent years) I recommend using it:
+
+    qemu -device qemu-xhci
+
+xhci supports USB 1.1, USB 2.0 and USB 3.0 devices, so this is the
+only controller you need.  With only a single usb controller (and
+therefore only a single usb bus) being present in the system there is
+no need to use the bus= parameter when adding usb devices.
+
+
+ehci controller support
+-----------------------
 
 The QEMU EHCI Adapter can be used with and without companion
 controllers.  See below for the companion controller mode.
@@ -47,29 +67,15 @@ specifies the first port the controller should attach to, which is
 needed as usually one ehci controller with six ports has three uhci
 companion controllers with two ports each.
 
-There is a config file in docs which will do all this for you, just
-try ...
+Result is a single usb bus which supports both USB 1.1 and USB 2.0
+devices.  There is a config file in docs which will do all this for
+you, just try ...
 
     qemu -readconfig docs/config/ich9-ehci-uhci.cfg
 
 ... then use "bus=ehci.0" to assign your usb devices to that bus.
 
 
-xhci controller support
------------------------
-
-There is also xhci host controller support available.  It got a lot
-less testing than ehci and there are a bunch of known limitations, so
-ehci may work better for you.  On the other hand the xhci hardware
-design is much more virtualization-friendly, thus xhci emulation uses
-less resources (especially cpu).  If you want to give xhci a try
-use this to add the host controller ...
-
-    qemu -device nec-usb-xhci,id=xhci
-
-... then use "bus=xhci.0" when assigning usb devices.
-
-
 More USB tips & tricks
 ======================
 
Signature · 1 line
2.9.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Gerd Hoffmann

xhci is rock solid meanwhile. So move it up in the docs and feature it as prefered usb host adapter, instead of the old shy version saying "you might want try ...".

Also a minor text update for the companion controller setup.

---
 docs/usb2.txt | 44 +++++++++++++++++++++++++-------------------
 1 file changed, 25 insertions(+), 19 deletions(-)
docs/usb2.txt +0 -0
index 09df45b5b1..1b0e62d187 100644

docs/usb2.txt line 2

Quoted 4 lines
docs/usb2.txt +1 -2
@@ -1,6 +1,26 @@
 
-USB 2.0 Quick Start
-===================
+USB Quick Start

Would you like to renamed the file from usb2.txt to usb.txt, too?

docs/usb2.txt line 12

Quoted 10 lines
docs/usb2.txt +10 -0
+===============
+
+xhci controller support
+-----------------------
+
+Qemu has xhci host adapter support.  The xhci hardware design is much
+more virtualization-friendly when compared to ehci and uhci, thus xhci
+emulation uses less resources (especially cpu).  So if your guest
+supports xhci (which should be the case for any operating system
+released in recent years) I recommend using it:

I'm afraid "recent years" won't age gracefully. Perhaps "after 2011 or so"?

docs/usb2.txt specifies the first port the controller should attach to, which is

Quoted 18 lines
docs/usb2.txt +11 -0
+
+    qemu -device qemu-xhci
+
+xhci supports USB 1.1, USB 2.0 and USB 3.0 devices, so this is the
+only controller you need.  With only a single usb controller (and
+therefore only a single usb bus) being present in the system there is
+no need to use the bus= parameter when adding usb devices.
+
+
+ehci controller support
+-----------------------
 
 The QEMU EHCI Adapter can be used with and without companion
 controllers.  See below for the companion controller mode.
@@ -47,29 +67,15 @@ specifies the first port the controller should attach to, which is

Companion controller support
----------------------------

Companion controller support has been added recently. The operational

For a value of "recently" :) Rephrase the first sentence?

model described above with two completely separate busses still works fine. Additionally the UHCI and OHCI controllers got the ability to attach to a usb bus created by EHCI as companion controllers. This is done by specifying the masterbus and firstport properties. masterbus specifies the bus name the controller should attach to. firstport specifies the first port the controller should attach to, which is

Quoted 21 lines
docs/usb2.txt +3 -9
 needed as usually one ehci controller with six ports has three uhci
 companion controllers with two ports each.
 
-There is a config file in docs which will do all this for you, just
-try ...
+Result is a single usb bus which supports both USB 1.1 and USB 2.0
+devices.  There is a config file in docs which will do all this for
+you, just try ...
 
     qemu -readconfig docs/config/ich9-ehci-uhci.cfg
 
 ... then use "bus=ehci.0" to assign your usb devices to that bus.
 
 
-xhci controller support
------------------------
-
-There is also xhci host controller support available.  It got a lot
-less testing than ehci and there are a bunch of known limitations, so
-ehci may work better for you.  On the other hand the xhci hardware
-design is much more virtualization-friendly, thus xhci emulation uses

docs/usb2.txt specifies the first port the controller should attach to, which is · line 80

Quoted 10 lines
docs/usb2.txt +0 -8
-less resources (especially cpu).  If you want to give xhci a try
-use this to add the host controller ...
-
-    qemu -device nec-usb-xhci,id=xhci
-
-... then use "bus=xhci.0" when assigning usb devices.
-
-
 More USB tips & tricks
 ======================

Even without additional improvements:

#2 lore raw
Quoted 11 lines

docs/usb2.txt line 2

Quoted 9 lines
docs/usb2.txt +1 -2
index 09df45b5b1..1b0e62d187 100644
@@ -1,6 +1,26 @@
 
-USB 2.0 Quick Start
-===================
+USB Quick Start

Would you like to renamed the file from usb2.txt to usb.txt, too?

Good question. At least I link to qemu cgit now and then when refering to qemu documentation. Renaming the file would break the links ...

Quoted 5 lines
Quoted 5 lines
docs/usb2.txt +5 -0
+===============
+
+xhci controller support
+-----------------------
+
Quoted 8 lines

docs/usb2.txt line 12

Quoted 5 lines
docs/usb2.txt +5 -0
+Qemu has xhci host adapter support.  The xhci hardware design is much
+more virtualization-friendly when compared to ehci and uhci, thus xhci
+emulation uses less resources (especially cpu).  So if your guest
+supports xhci (which should be the case for any operating system
+released in recent years) I recommend using it:

I'm afraid "recent years" won't age gracefully. Perhaps "after 2011 or so"?

Makes sense.

Quoted 7 lines

docs/usb2.txt specifies the first port the controller should attach to, which is

Quoted 1 line
docs/usb2.txt +0 -0
@@ -47,29 +67,15 @@ specifies the first port the controller should attach to, which is

Companion controller support
----------------------------

Companion controller support has been added recently. The operational

For a value of "recently" :) Rephrase the first sentence?

Well, to be exact pretty much all ehci/uhci text could use a major rework. Left that for another day ...

cheers,
Gerd