60061b
From 5f5208c1d41477645b2707cfac206d24d86b9254 Mon Sep 17 00:00:00 2001
60061b
From: Igor Mammedov <imammedo@redhat.com>
60061b
Date: Tue, 1 Mar 2022 10:11:58 -0500
60061b
Subject: [PATCH 5/6] pci: expose TYPE_XIO3130_DOWNSTREAM name
60061b
60061b
RH-Author: Igor Mammedov <imammedo@redhat.com>
60061b
RH-MergeRequest: 125: RHEL-8.6 Fix broken PCIe device after migration
60061b
RH-Commit: [1/2] 703782ce00f067c811056d5765a8b2094e585b4f
60061b
RH-Bugzilla: 2054597
60061b
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
60061b
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
60061b
RH-Acked-by: MST <None>
60061b
60061b
Type name will be used in followup patch for cast check
60061b
in pcihp code.
60061b
60061b
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
60061b
Message-Id: <20220301151200.3507298-2-imammedo@redhat.com>
60061b
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
60061b
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
60061b
(cherry picked from commit c41481af9a5d0d463607cc45b45c510875570817)
60061b
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
60061b
---
60061b
 hw/pci-bridge/xio3130_downstream.c         |  3 ++-
60061b
 include/hw/pci-bridge/xio3130_downstream.h | 15 +++++++++++++++
60061b
 2 files changed, 17 insertions(+), 1 deletion(-)
60061b
 create mode 100644 include/hw/pci-bridge/xio3130_downstream.h
60061b
60061b
diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
60061b
index 04aae72cd6..b17cafd359 100644
60061b
--- a/hw/pci-bridge/xio3130_downstream.c
60061b
+++ b/hw/pci-bridge/xio3130_downstream.c
60061b
@@ -28,6 +28,7 @@
60061b
 #include "migration/vmstate.h"
60061b
 #include "qapi/error.h"
60061b
 #include "qemu/module.h"
60061b
+#include "hw/pci-bridge/xio3130_downstream.h"
60061b
 
60061b
 #define PCI_DEVICE_ID_TI_XIO3130D       0x8233  /* downstream port */
60061b
 #define XIO3130_REVISION                0x1
60061b
@@ -173,7 +174,7 @@ static void xio3130_downstream_class_init(ObjectClass *klass, void *data)
60061b
 }
60061b
 
60061b
 static const TypeInfo xio3130_downstream_info = {
60061b
-    .name          = "xio3130-downstream",
60061b
+    .name          = TYPE_XIO3130_DOWNSTREAM,
60061b
     .parent        = TYPE_PCIE_SLOT,
60061b
     .class_init    = xio3130_downstream_class_init,
60061b
     .interfaces = (InterfaceInfo[]) {
60061b
diff --git a/include/hw/pci-bridge/xio3130_downstream.h b/include/hw/pci-bridge/xio3130_downstream.h
60061b
new file mode 100644
60061b
index 0000000000..1d10139aea
60061b
--- /dev/null
60061b
+++ b/include/hw/pci-bridge/xio3130_downstream.h
60061b
@@ -0,0 +1,15 @@
60061b
+/*
60061b
+ * TI X3130 pci express downstream port switch
60061b
+ *
60061b
+ * Copyright (C) 2022 Igor Mammedov <imammedo@redhat.com>
60061b
+ *
60061b
+ * SPDX-License-Identifier: GPL-2.0-or-later
60061b
+ */
60061b
+
60061b
+#ifndef HW_PCI_BRIDGE_XIO3130_DOWNSTREAM_H
60061b
+#define HW_PCI_BRIDGE_XIO3130_DOWNSTREAM_H
60061b
+
60061b
+#define TYPE_XIO3130_DOWNSTREAM "xio3130-downstream"
60061b
+
60061b
+#endif
60061b
+
60061b
-- 
60061b
2.27.0
60061b