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