All of lore.kernel.org
 help / color / mirror / Atom feed
From: BALATON Zoltan <balaton@eik.bme.hu>
To: qemu-devel@nongnu.org
Cc: Huacai Chen <chenhuacai@kernel.org>,
	Gerd Hoffmann <kraxel@redhat.com>, Philippe M-D <f4bug@amsat.org>
Subject: [PATCH v2 2/4] usb/uhci: Disallow user creating a vt82c686-uhci-pci device
Date: Mon, 25 Oct 2021 13:33:49 +0200	[thread overview]
Message-ID: <e6abf1f19ca72bbc2d8a5a6aa941edbf87a9845f.1635161629.git.balaton@eik.bme.hu> (raw)
In-Reply-To: <cover.1635161629.git.balaton@eik.bme.hu>

Because this device only works as part of VIA superio chips set user
creatable to false. Since the class init method is common for UHCI
variants introduce a flag in UHCIInfo for this.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-uhci.c          | 3 +++
 hw/usb/hcd-uhci.h          | 1 +
 hw/usb/vt82c686-uhci-pci.c | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index c557566ec2..7d26e35194 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1282,6 +1282,9 @@ void uhci_data_class_init(ObjectClass *klass, void *data)
     } else {
         device_class_set_props(dc, uhci_properties_standalone);
     }
+    if (info->notuser) {
+        dc->user_creatable = false;
+    }
     u->info = *info;
 }
 
diff --git a/hw/usb/hcd-uhci.h b/hw/usb/hcd-uhci.h
index e61d8fcb19..316693f80b 100644
--- a/hw/usb/hcd-uhci.h
+++ b/hw/usb/hcd-uhci.h
@@ -85,6 +85,7 @@ typedef struct UHCIInfo {
     uint8_t    irq_pin;
     void       (*realize)(PCIDevice *dev, Error **errp);
     bool       unplug;
+    bool       notuser; /* disallow user_creatable */
 } UHCIInfo;
 
 void uhci_data_class_init(ObjectClass *klass, void *data);
diff --git a/hw/usb/vt82c686-uhci-pci.c b/hw/usb/vt82c686-uhci-pci.c
index b109c21603..ea262e6d70 100644
--- a/hw/usb/vt82c686-uhci-pci.c
+++ b/hw/usb/vt82c686-uhci-pci.c
@@ -25,6 +25,8 @@ static UHCIInfo uhci_info[] = {
         .irq_pin   = 3,
         .realize   = usb_uhci_vt82c686b_realize,
         .unplug    = true,
+        /* Reason: only works as USB function of VT82xx superio chips */
+        .notuser   = true,
     }
 };
 
-- 
2.21.4



  parent reply	other threads:[~2021-10-25 11:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 11:33 [PATCH v2 0/4] hw/usb/vt82c686-uhci-pci: Use ISA instead of PCI interrupts BALATON Zoltan
2021-10-25 11:33 ` [PATCH v2 4/4] " BALATON Zoltan
2021-10-25 11:33 ` [PATCH v2 3/4] usb/uhci: Replace pci_set_irq with qemu_set_irq BALATON Zoltan
2021-10-25 11:33 ` BALATON Zoltan [this message]
2021-10-25 11:33 ` [PATCH v2 1/4] usb/uhci: Misc clean up BALATON Zoltan
2021-10-25 12:20 ` [PATCH v2 0/4] hw/usb/vt82c686-uhci-pci: Use ISA instead of PCI interrupts Philippe Mathieu-Daudé
2021-11-02 10:53   ` BALATON Zoltan
2021-11-02 11:53     ` Philippe Mathieu-Daudé
2021-11-02 12:36     ` Gerd Hoffmann
2021-11-02 12:42       ` BALATON Zoltan
2021-11-02 13:51         ` Philippe Mathieu-Daudé

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=e6abf1f19ca72bbc2d8a5a6aa941edbf87a9845f.1635161629.git.balaton@eik.bme.hu \
    --to=balaton@eik.bme.hu \
    --cc=chenhuacai@kernel.org \
    --cc=f4bug@amsat.org \
    --cc=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 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.