From: Knut Omang <knut.omang@oracle.com>
To: qemu-devel@nongnu.org
Cc: Marcel Apfelbaum <marcel.a@redhat.com>,
Alexey Kardashevskiy <aik@ozlabs.ru>,
Juan Quintela <quintela@redhat.com>,
Knut Omang <knut.omang@oracle.com>,
Markus Armbruster <armbru@redhat.com>,
"Gonglei (Arei)" <arei.gonglei@huawei.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH v2 2/4] pcie: Rename the pcie_cap_ari_* functions to pcie_cap_arifwd_*
Date: Sun, 24 Aug 2014 15:32:18 +0200 [thread overview]
Message-ID: <1408887140-3320-3-git-send-email-knut.omang@oracle.com> (raw)
In-Reply-To: <1408887140-3320-1-git-send-email-knut.omang@oracle.com>
Rename helper functions to make a clearer distinction between
the PCIe capability/control register feature ARI forwarding and a
device that supports the ARI feature via an ARI extended PCIe capability.
Signed-off-by: Knut Omang <knut.omang@oracle.com>
---
hw/pci-bridge/ioh3420.c | 1 +
hw/pci-bridge/xio3130_downstream.c | 4 ++--
hw/pci/pcie.c | 11 ++++++-----
include/hw/pci/pcie.h | 7 ++++---
4 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c
index 7cd87fc..aed2bf1 100644
--- a/hw/pci-bridge/ioh3420.c
+++ b/hw/pci-bridge/ioh3420.c
@@ -118,6 +118,7 @@ static int ioh3420_initfn(PCIDevice *d)
if (rc < 0) {
goto err_msi;
}
+
pcie_cap_deverr_init(d);
pcie_cap_slot_init(d, s->slot);
pcie_chassis_create(s->chassis);
diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
index 51f20d7..b3a6479 100644
--- a/hw/pci-bridge/xio3130_downstream.c
+++ b/hw/pci-bridge/xio3130_downstream.c
@@ -50,7 +50,7 @@ static void xio3130_downstream_reset(DeviceState *qdev)
pcie_cap_deverr_reset(d);
pcie_cap_slot_reset(d);
- pcie_cap_ari_reset(d);
+ pcie_cap_arifwd_reset(d);
pci_bridge_reset(qdev);
}
@@ -91,7 +91,7 @@ static int xio3130_downstream_initfn(PCIDevice *d)
if (rc < 0) {
goto err_pcie_cap;
}
- pcie_cap_ari_init(d);
+ pcie_cap_arifwd_init(d);
rc = pcie_aer_init(d, XIO3130_AER_OFFSET);
if (rc < 0) {
goto err;
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index de0e967..6cb6e0c 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -497,9 +497,10 @@ void pcie_cap_flr_write_config(PCIDevice *dev,
}
}
-/* Alternative Routing-ID Interpretation (ARI) */
-/* ari forwarding support for down stream port */
-void pcie_cap_ari_init(PCIDevice *dev)
+/* Alternative Routing-ID Interpretation (ARI)
+ * forwarding support for root and downstream ports
+ */
+void pcie_cap_arifwd_init(PCIDevice *dev)
{
uint32_t pos = dev->exp.exp_cap;
pci_long_test_and_set_mask(dev->config + pos + PCI_EXP_DEVCAP2,
@@ -508,13 +509,13 @@ void pcie_cap_ari_init(PCIDevice *dev)
PCI_EXP_DEVCTL2_ARI);
}
-void pcie_cap_ari_reset(PCIDevice *dev)
+void pcie_cap_arifwd_reset(PCIDevice *dev)
{
uint8_t *devctl2 = dev->config + dev->exp.exp_cap + PCI_EXP_DEVCTL2;
pci_long_test_and_clear_mask(devctl2, PCI_EXP_DEVCTL2_ARI);
}
-bool pcie_cap_is_ari_enabled(const PCIDevice *dev)
+bool pcie_cap_is_arifwd_enabled(const PCIDevice *dev)
{
if (!pci_is_express(dev)) {
return false;
diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h
index 7fe81f3..d139d58 100644
--- a/include/hw/pci/pcie.h
+++ b/include/hw/pci/pcie.h
@@ -103,9 +103,10 @@ void pcie_cap_flr_init(PCIDevice *dev);
void pcie_cap_flr_write_config(PCIDevice *dev,
uint32_t addr, uint32_t val, int len);
-void pcie_cap_ari_init(PCIDevice *dev);
-void pcie_cap_ari_reset(PCIDevice *dev);
-bool pcie_cap_is_ari_enabled(const PCIDevice *dev);
+/* ARI forwarding capability and control */
+void pcie_cap_arifwd_init(PCIDevice *dev);
+void pcie_cap_arifwd_reset(PCIDevice *dev);
+bool pcie_cap_is_arifwd_enabled(const PCIDevice *dev);
/* PCI express extended capability helper functions */
uint16_t pcie_find_capability(PCIDevice *dev, uint16_t cap_id);
--
1.9.0
next prev parent reply other threads:[~2014-08-24 13:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-24 13:32 [Qemu-devel] [PATCH v2 0/4] q35: Minor fixes/enhancements to improve usability of root ports Knut Omang
2014-08-24 13:32 ` [Qemu-devel] [PATCH v2 1/4] pcie: Fix incorrect write to the ari capability next function field Knut Omang
2014-08-24 13:32 ` Knut Omang [this message]
2014-08-24 13:32 ` [Qemu-devel] [PATCH v2 3/4] ioh3420: Remove obsoleted, unused ioh3420_init function Knut Omang
2014-08-25 7:47 ` Gonglei (Arei)
2014-08-25 9:15 ` Knut Omang
2014-08-24 13:32 ` [Qemu-devel] [PATCH v2 4/4] ioh3420: Enable ARI forwarding Knut Omang
2014-08-24 22:52 ` Michael S. Tsirkin
2014-08-25 6:09 ` Gonglei (Arei)
2014-08-25 9:13 ` Knut Omang
2014-08-25 19:57 ` Michael S. Tsirkin
2014-08-24 20:44 ` [Qemu-devel] [PATCH v2 0/4] q35: Minor fixes/enhancements to improve usability of root ports Michael S. Tsirkin
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=1408887140-3320-3-git-send-email-knut.omang@oracle.com \
--to=knut.omang@oracle.com \
--cc=aik@ozlabs.ru \
--cc=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=imammedo@redhat.com \
--cc=marcel.a@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/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).