0727d3
From 7998e8aa78caa35c2ab2da44f9e29e21d7548c61 Mon Sep 17 00:00:00 2001
0727d3
From: Jon Maloy <jmaloy@redhat.com>
0727d3
Date: Wed, 23 Mar 2022 13:21:40 -0400
0727d3
Subject: [PATCH 05/18] pci: expose TYPE_XIO3130_DOWNSTREAM name
0727d3
0727d3
RH-Author: Jon Maloy <jmaloy@redhat.com>
0727d3
RH-MergeRequest: 134: pci: expose TYPE_XIO3130_DOWNSTREAM name
0727d3
RH-Commit: [1/2] f09ddcaf686f22b545bf269f87787ebfc33fccda (jmaloy/qemu-kvm)
0727d3
RH-Bugzilla: 2062610
0727d3
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
0727d3
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
0727d3
0727d3
BZ: https://bugzilla.redhat.com/2062610
0727d3
UPSTREAM: merged
0727d3
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=44038138
0727d3
0727d3
commit c41481af9a5d0d463607cc45b45c510875570817
0727d3
Author: Igor Mammedov <imammedo@redhat.com>
0727d3
Date:   Tue Mar 1 10:11:58 2022 -0500
0727d3
0727d3
    pci: expose TYPE_XIO3130_DOWNSTREAM name
0727d3
0727d3
    Type name will be used in followup patch for cast check
0727d3
    in pcihp code.
0727d3
0727d3
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
0727d3
    Message-Id: <20220301151200.3507298-2-imammedo@redhat.com>
0727d3
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
0727d3
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
0727d3
0727d3
(cherry picked from commit c41481af9a5d0d463607cc45b45c510875570817)
0727d3
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
0727d3
---
0727d3
 hw/pci-bridge/xio3130_downstream.c         |  3 ++-
0727d3
 include/hw/pci-bridge/xio3130_downstream.h | 15 +++++++++++++++
0727d3
 2 files changed, 17 insertions(+), 1 deletion(-)
0727d3
 create mode 100644 include/hw/pci-bridge/xio3130_downstream.h
0727d3
0727d3
diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
0727d3
index 04aae72cd6..b17cafd359 100644
0727d3
--- a/hw/pci-bridge/xio3130_downstream.c
0727d3
+++ b/hw/pci-bridge/xio3130_downstream.c
0727d3
@@ -28,6 +28,7 @@
0727d3
 #include "migration/vmstate.h"
0727d3
 #include "qapi/error.h"
0727d3
 #include "qemu/module.h"
0727d3
+#include "hw/pci-bridge/xio3130_downstream.h"
0727d3
 
0727d3
 #define PCI_DEVICE_ID_TI_XIO3130D       0x8233  /* downstream port */
0727d3
 #define XIO3130_REVISION                0x1
0727d3
@@ -173,7 +174,7 @@ static void xio3130_downstream_class_init(ObjectClass *klass, void *data)
0727d3
 }
0727d3
 
0727d3
 static const TypeInfo xio3130_downstream_info = {
0727d3
-    .name          = "xio3130-downstream",
0727d3
+    .name          = TYPE_XIO3130_DOWNSTREAM,
0727d3
     .parent        = TYPE_PCIE_SLOT,
0727d3
     .class_init    = xio3130_downstream_class_init,
0727d3
     .interfaces = (InterfaceInfo[]) {
0727d3
diff --git a/include/hw/pci-bridge/xio3130_downstream.h b/include/hw/pci-bridge/xio3130_downstream.h
0727d3
new file mode 100644
0727d3
index 0000000000..1d10139aea
0727d3
--- /dev/null
0727d3
+++ b/include/hw/pci-bridge/xio3130_downstream.h
0727d3
@@ -0,0 +1,15 @@
0727d3
+/*
0727d3
+ * TI X3130 pci express downstream port switch
0727d3
+ *
0727d3
+ * Copyright (C) 2022 Igor Mammedov <imammedo@redhat.com>
0727d3
+ *
0727d3
+ * SPDX-License-Identifier: GPL-2.0-or-later
0727d3
+ */
0727d3
+
0727d3
+#ifndef HW_PCI_BRIDGE_XIO3130_DOWNSTREAM_H
0727d3
+#define HW_PCI_BRIDGE_XIO3130_DOWNSTREAM_H
0727d3
+
0727d3
+#define TYPE_XIO3130_DOWNSTREAM "xio3130-downstream"
0727d3
+
0727d3
+#endif
0727d3
+
0727d3
-- 
0727d3
2.27.0
0727d3