All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Marcel Apfelbaum <marcel@redhat.com>
Subject: [Qemu-devel] [PATCH v9 03/13] usb xhci: change msi/msix property type
Date: Mon, 20 Jun 2016 14:13:34 +0800	[thread overview]
Message-ID: <1466403224-16604-4-git-send-email-caoj.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <1466403224-16604-1-git-send-email-caoj.fnst@cn.fujitsu.com>

>From bit to enum OnOffAuto

cc: Gerd Hoffmann <kraxel@redhat.com>
cc: Michael S. Tsirkin <mst@redhat.com>
cc: Markus Armbruster <armbru@redhat.com>
cc: Marcel Apfelbaum <marcel@redhat.com>

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
 hw/usb/hcd-xhci.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 43ba615..0a5510f 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -461,6 +461,8 @@ struct XHCIState {
     uint32_t numslots;
     uint32_t flags;
     uint32_t max_pstreams_mask;
+    OnOffAuto msi;
+    OnOffAuto msix;
 
     /* Operational Registers */
     uint32_t usbcmd;
@@ -498,9 +500,7 @@ typedef struct XHCIEvRingSeg {
 } XHCIEvRingSeg;
 
 enum xhci_flags {
-    XHCI_FLAG_USE_MSI = 1,
-    XHCI_FLAG_USE_MSI_X,
-    XHCI_FLAG_SS_FIRST,
+    XHCI_FLAG_SS_FIRST = 1,
     XHCI_FLAG_FORCE_PCIE_ENDCAP,
     XHCI_FLAG_ENABLE_STREAMS,
 };
@@ -3648,10 +3648,12 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp)
         assert(ret >= 0);
     }
 
-    if (xhci_get_flag(xhci, XHCI_FLAG_USE_MSI)) {
+    if (xhci->msi != ON_OFF_AUTO_OFF) {
+        /* TODO check for errors */
         msi_init(dev, 0x70, xhci->numintrs, true, false);
     }
-    if (xhci_get_flag(xhci, XHCI_FLAG_USE_MSI_X)) {
+    if (xhci->msix != ON_OFF_AUTO_OFF) {
+        /* TODO check for errors */
         msix_init(dev, xhci->numintrs,
                   &xhci->mem, 0, OFF_MSIX_TABLE,
                   &xhci->mem, 0, OFF_MSIX_PBA,
@@ -3872,8 +3874,8 @@ static const VMStateDescription vmstate_xhci = {
 };
 
 static Property xhci_properties[] = {
-    DEFINE_PROP_BIT("msi",      XHCIState, flags, XHCI_FLAG_USE_MSI, true),
-    DEFINE_PROP_BIT("msix",     XHCIState, flags, XHCI_FLAG_USE_MSI_X, true),
+    DEFINE_PROP_ON_OFF_AUTO("msi", XHCIState, msi, ON_OFF_AUTO_AUTO),
+    DEFINE_PROP_ON_OFF_AUTO("msix", XHCIState, msix, ON_OFF_AUTO_AUTO),
     DEFINE_PROP_BIT("superspeed-ports-first",
                     XHCIState, flags, XHCI_FLAG_SS_FIRST, true),
     DEFINE_PROP_BIT("force-pcie-endcap", XHCIState, flags,
-- 
2.1.0

  parent reply	other threads:[~2016-06-20  6:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20  6:13 [Qemu-devel] [PATCH v9 00/13] Add param Error ** for msi_init()--part2 Cao jin
2016-06-20  6:13 ` [Qemu-devel] [PATCH v9 01/13] change pvscsi_init_msi() type to void Cao jin
2016-06-20  6:13 ` [Qemu-devel] [PATCH v9 02/13] mptsas: change .realize function name Cao jin
2016-07-06  3:02   ` Cao jin
2016-09-14  7:57   ` Michael Tokarev
2016-06-20  6:13 ` Cao jin [this message]
2016-06-20  6:13 ` [Qemu-devel] [PATCH v9 04/13] intel-hda: change msi property type Cao jin
2016-06-20  6:13 ` [Qemu-devel] [PATCH v9 05/13] mptsas: " Cao jin
2016-06-20  6:13 ` [Qemu-devel] [PATCH v9 06/13] megasas: change msi/msix " Cao jin
2016-06-20  6:12   ` Hannes Reinecke
2016-06-20  6:13 ` [Qemu-devel] [PATCH v9 07/13] pci bridge dev: change msi " Cao jin
2016-06-20  6:13 ` [Qemu-devel] [PATCH v9 08/13] pci: Convert msi_init() to Error and fix callers to check it Cao jin
2016-06-20  6:14   ` Hannes Reinecke
2016-06-20  6:13 ` [Qemu-devel] [PATCH v9 09/13] megasas: remove unnecessary megasas_use_msi() Cao jin
2016-06-20  6:13 ` [Qemu-devel] [PATCH v9 10/13] mptsas: remove unnecessary internal msi state flag Cao jin
2016-06-20  6:13 ` [Qemu-devel] [PATCH v9 11/13] vmxnet3: " Cao jin
2016-06-20  6:13 ` [Qemu-devel] [PATCH v9 12/13] e1000e: " Cao jin
2016-06-29 13:42   ` Markus Armbruster
2016-06-20  6:13 ` [Qemu-devel] [PATCH v9 13/13] vmw_pvscsi: " Cao jin
2016-06-29 13:44   ` Markus Armbruster
2016-06-28 11:19 ` [Qemu-devel] [PATCH v9 00/13] Add param Error ** for msi_init()--part2 Cao jin
2016-06-29  1:24   ` Cao jin

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=1466403224-16604-4-git-send-email-caoj.fnst@cn.fujitsu.com \
    --to=caoj.fnst@cn.fujitsu.com \
    --cc=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcel@redhat.com \
    --cc=mst@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.