qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 25/26] usb: tag standalone uhci as hotpluggable
Date: Tue, 23 Sep 2014 14:13:36 +0200	[thread overview]
Message-ID: <1411474417-9704-26-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1411474417-9704-1-git-send-email-kraxel@redhat.com>

uhci hostadapters in companion setups can't be hotplugged.  So leave
hotplug disabled for all ich9 variants (which are already tagged with
unplug = true in the info struct).  For the other variants we'll enable
hotplug and remove the companion setup properties.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-uhci.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 3b3ebcd..5b88f30 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1279,13 +1279,18 @@ static void usb_uhci_exit(PCIDevice *dev)
     }
 }
 
-static Property uhci_properties[] = {
+static Property uhci_properties_companion[] = {
     DEFINE_PROP_STRING("masterbus", UHCIState, masterbus),
     DEFINE_PROP_UINT32("firstport", UHCIState, firstport, 0),
     DEFINE_PROP_UINT32("bandwidth", UHCIState, frame_bandwidth, 1280),
     DEFINE_PROP_UINT32("maxframes", UHCIState, maxframes, 128),
     DEFINE_PROP_END_OF_LIST(),
 };
+static Property uhci_properties_standalone[] = {
+    DEFINE_PROP_UINT32("bandwidth", UHCIState, frame_bandwidth, 1280),
+    DEFINE_PROP_UINT32("maxframes", UHCIState, maxframes, 128),
+    DEFINE_PROP_END_OF_LIST(),
+};
 
 static void uhci_class_init(ObjectClass *klass, void *data)
 {
@@ -1300,9 +1305,14 @@ static void uhci_class_init(ObjectClass *klass, void *data)
     k->device_id = info->device_id;
     k->revision  = info->revision;
     k->class_id  = PCI_CLASS_SERIAL_USB;
-    dc->hotpluggable = false;
     dc->vmsd = &vmstate_uhci;
-    dc->props = uhci_properties;
+    if (!info->unplug) {
+        /* uhci controllers in companion setups can't be hotplugged */
+        dc->hotpluggable = false;
+        dc->props = uhci_properties_companion;
+    } else {
+        dc->props = uhci_properties_standalone;
+    }
     set_bit(DEVICE_CATEGORY_USB, dc->categories);
     u->info = *info;
 }
-- 
1.8.3.1

  parent reply	other threads:[~2014-09-23 14:20 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 12:13 [Qemu-devel] [PULL 00/26] usb patch queue Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 01/26] usb-storage: Fix how legacy init handles option ID clash Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 02/26] usb-storage: fix possible memory leak and missing error message Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 03/26] ohci: Convert fprint/DPRINTF/print to traces Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 04/26] usb-bus: convert USBDeviceClass init to realize Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 05/26] usb-net: convert " Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 06/26] libusb: " Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 07/26] libusb: using error_report instead of fprintf Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 08/26] usb-hub: convert init to realize Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 09/26] dev-storage: " Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 10/26] dev-storage: usring error_report instead of fprintf/printf Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 11/26] dev-uas: convert init to realize Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 12/26] dev-uas: using error_report instead of fprintf Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 13/26] dev-bluetooth: convert init to realize Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 14/26] dev-serial: " Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 15/26] usb-ccid: " Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 16/26] dev-hid: " Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 17/26] dev-wacom: " Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 18/26] usb-audio: " Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 19/26] usb-redir: " Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 20/26] usb-mtp: " Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 21/26] usb-bus: remove "init" from USBDeviceClass struct Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 22/26] usb-bus: introduce a wrapper function to check speed Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 23/26] usb-serial: only check speed once at realize time Gerd Hoffmann
2014-09-23 12:13 ` [Qemu-devel] [PULL 24/26] usb: tag xhci as hotpluggable Gerd Hoffmann
2014-09-23 12:13 ` Gerd Hoffmann [this message]
2014-09-23 12:13 ` [Qemu-devel] [PULL 26/26] usb: tag standalone ehci " Gerd Hoffmann
2014-09-23 15:56 ` [Qemu-devel] [PULL 00/26] usb patch queue Peter Maydell

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=1411474417-9704-26-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).