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