All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunyan Liu <cyliu@suse.com>
To: xen-devel@lists.xen.org
Cc: lars.kurth@citrix.com, ian.campbell@citrix.com,
	george.dunlap@eu.citrix.com, Chunyan Liu <cyliu@suse.com>,
	ian.jackson@citrix.com, caobosimon@gmail.com
Subject: [PATCH RFC V2 1/5] libxl: add pvusb definitions
Date: Mon, 19 Jan 2015 16:28:47 +0800	[thread overview]
Message-ID: <1421656131-19366-2-git-send-email-cyliu@suse.com> (raw)
In-Reply-To: <1421656131-19366-1-git-send-email-cyliu@suse.com>

To attach a usb device, a virtual usb controller should be created first.
This patch defines usbctrl and usbdevice related structs.

Signed-off-by: Chunyan Liu <cyliu@suse.com>
Signed-off-by: Simon Cao <caobosimon@gmail.com>
---
 tools/libxl/libxl_types.idl          | 58 +++++++++++++++++++++++++++++++++++-
 tools/libxl/libxl_types_internal.idl |  1 +
 2 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 1214d2e..0639434 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -111,6 +111,16 @@ libxl_nic_type = Enumeration("nic_type", [
     (2, "VIF"),
     ])
 
+libxl_usbctrl_type = Enumeration("usbctrl_type",[
+    (0, "AUTO"),
+    (1, "PV"),
+    (2, "DEVICEMODEL"),
+    ])
+
+libxl_usb_type = Enumeration("device_usb_type", [
+    (1, "HOSTDEV"),
+    ])
+
 libxl_action_on_shutdown = Enumeration("action_on_shutdown", [
     (1, "DESTROY"),
 
@@ -394,7 +404,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("ioports",          Array(libxl_ioport_range, "num_ioports")),
     ("irqs",             Array(uint32, "num_irqs")),
     ("iomem",            Array(libxl_iomem_range, "num_iomem")),
-    ("claim_mode",	     libxl_defbool),
+    ("claim_mode",       libxl_defbool),
     ("event_channels",   uint32),
     ("kernel",           string),
     ("cmdline",          string),
@@ -521,6 +531,27 @@ libxl_device_pci = Struct("device_pci", [
     ("seize", bool),
     ])
 
+libxl_device_usbctrl = Struct("device_usbctrl", [
+    ("name", string),
+    ("type", libxl_usbctrl_type),
+    ("backend_domid", libxl_domid),
+    ("backend_domname", string),
+    ("devid", libxl_devid),
+    ("usb_version", uint8),
+    ("num_ports", uint8),
+    ])
+
+libxl_device_usb = Struct("device_usb", [
+    ("ctrl", integer),
+    ("port", integer),
+    ("intf", string),
+    ("u", KeyedUnion(None, libxl_usb_type, "type",
+        [("hostdev", Struct(None, [
+            ("hostbus",   integer),
+            ("hostaddr",  integer) ]))
+        ]))
+    ])
+
 libxl_device_vtpm = Struct("device_vtpm", [
     ("backend_domid",    libxl_domid),
     ("backend_domname",  string),
@@ -547,6 +578,7 @@ libxl_domain_config = Struct("domain_config", [
     ("disks", Array(libxl_device_disk, "num_disks")),
     ("nics", Array(libxl_device_nic, "num_nics")),
     ("pcidevs", Array(libxl_device_pci, "num_pcidevs")),
+    ("usbs", Array(libxl_device_usb, "num_usbs")),
     ("vfbs", Array(libxl_device_vfb, "num_vfbs")),
     ("vkbs", Array(libxl_device_vkb, "num_vkbs")),
     ("vtpms", Array(libxl_device_vtpm, "num_vtpms")),
@@ -595,6 +627,30 @@ libxl_vtpminfo = Struct("vtpminfo", [
     ("uuid", libxl_uuid),
     ], dir=DIR_OUT)
 
+libxl_usbctrlinfo = Struct("usbctrlinfo", [
+    ("backend", string),
+    ("backend_id", uint32),
+    ("frontend", string),
+    ("frontend_id", uint32),
+    ("devid", libxl_devid),
+    ("state", integer),
+    ("evtch", integer),
+    ("version", integer),
+    ("type", string),
+    ("ref_urb", integer),
+    ("ref_conn", integer),
+    ("num_ports", integer),
+    ], dir=DIR_OUT)
+
+libxl_usbinfo = Struct("usbinfo", [
+    ("bus", integer),
+    ("devnum", integer),
+    ("idVendor", integer),
+    ("idProduct", integer),
+    ("prod", string),
+    ("manuf", string),
+    ], dir=DIR_OUT)
+
 libxl_vcpuinfo = Struct("vcpuinfo", [
     ("vcpuid", uint32),
     ("cpu", uint32),
diff --git a/tools/libxl/libxl_types_internal.idl b/tools/libxl/libxl_types_internal.idl
index 5e55685..696f5f8 100644
--- a/tools/libxl/libxl_types_internal.idl
+++ b/tools/libxl/libxl_types_internal.idl
@@ -22,6 +22,7 @@ libxl__device_kind = Enumeration("device_kind", [
     (6, "VKBD"),
     (7, "CONSOLE"),
     (8, "VTPM"),
+    (9, "VUSB"),
     ])
 
 libxl__console_backend = Enumeration("console_backend", [
-- 
1.8.4.5

  reply	other threads:[~2015-01-19  8:28 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19  8:28 [PATCH RFC V2 0/5] pvusb toolstack work Chunyan Liu
2015-01-19  8:28 ` Chunyan Liu [this message]
2015-03-03 11:10   ` [PATCH RFC V2 1/5] libxl: add pvusb definitions Ian Campbell
2015-03-03 16:45     ` George Dunlap
2015-03-04  7:26     ` Chun Yan Liu
2015-03-04 10:00       ` Ian Campbell
2015-03-04 12:26         ` George Dunlap
2015-03-04 12:33           ` Ian Campbell
2015-03-05  5:04             ` Chun Yan Liu
2015-03-03 17:15   ` George Dunlap
2015-03-04  8:28     ` Chun Yan Liu
2015-03-04 14:41       ` George Dunlap
2015-03-05  6:07         ` Chun Yan Liu
2015-01-19  8:28 ` [PATCH RFC V2 2/5] libxl: export some functions for pvusb use Chunyan Liu
2015-03-03 11:10   ` Ian Campbell
2015-01-19  8:28 ` [PATCH RFC V2 3/5] libxl: add pvusb API Chunyan Liu
2015-01-28 15:54   ` Ian Campbell
2015-01-29  3:24     ` Chun Yan Liu
2015-02-10 10:08   ` Jürgen Groß
2015-02-10 16:01   ` Jürgen Groß
2015-03-03 11:38   ` Ian Campbell
2015-03-04  7:47     ` Chun Yan Liu
2015-03-06 16:50   ` George Dunlap
2015-03-09  9:39     ` Ian Campbell
2015-03-09 10:17       ` George Dunlap
2015-03-09 10:41         ` Ian Campbell
2015-03-20  9:37     ` Chun Yan Liu
2015-03-17 14:03   ` Juergen Gross
2015-01-19  8:28 ` [PATCH RFC V2 4/5] xl: add pvusb commands Chunyan Liu
2015-02-10  6:25   ` Jürgen Groß
2015-03-03 11:43   ` Ian Campbell
2015-03-04  7:48     ` Chun Yan Liu
2015-03-06 17:25   ` George Dunlap
2015-03-20  9:02     ` Chun Yan Liu
2015-01-19  8:28 ` [PATCH RFC V2 5/5] domcreate: support pvusb in configuration file Chunyan Liu
2015-03-03 11:44   ` Ian Campbell
2015-01-28 15:51 ` [PATCH RFC V2 0/5] pvusb toolstack work Ian Campbell
2015-01-28 16:07   ` Pasi Kärkkäinen
2015-01-28 16:17     ` Ian Campbell
2015-01-29  3:22   ` Chun Yan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421656131-19366-2-git-send-email-cyliu@suse.com \
    --to=cyliu@suse.com \
    --cc=caobosimon@gmail.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@citrix.com \
    --cc=lars.kurth@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.