git: 17bde9cbc6fc - main - LinuxKPI: pci: update struct msi_desc

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Thu, 08 Jun 2023 18:05:19 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=17bde9cbc6fc3ac219aa11243c0b75025786f628

commit 17bde9cbc6fc3ac219aa11243c0b75025786f628
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-05-20 00:48:28 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-06-08 18:04:35 +0000

    LinuxKPI: pci: update struct msi_desc
    
    It seems struct msi_desc is setup differently (or was changed) compared
    to how we added it a while ago.  Catch up in order to keep drivers
    directly accessing fields compiling.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      10 days
    Reviewed by:    emaste
    Differential Revision: https://reviews.freebsd.org/D40175
---
 sys/compat/linuxkpi/common/include/linux/pci.h | 8 ++++++--
 sys/compat/linuxkpi/common/src/linux_pci.c     | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h
index 263dc41377cc..6891f8878534 100644
--- a/sys/compat/linuxkpi/common/include/linux/pci.h
+++ b/sys/compat/linuxkpi/common/include/linux/pci.h
@@ -295,13 +295,17 @@ struct msi_msg {
 	uint32_t			data;
 };
 
-struct msi_desc {
-	struct msi_msg			msg;
+struct pci_msi_desc {
 	struct {
 		bool			is_64;
 	} msi_attrib;
 };
 
+struct msi_desc {
+	struct msi_msg			msg;
+	struct pci_msi_desc		pci;
+};
+
 /*
  * If we find drivers accessing this from multiple KPIs we may have to
  * refcount objects of this structure.
diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c
index 0d9b2827365f..5f4ce077a011 100644
--- a/sys/compat/linuxkpi/common/src/linux_pci.c
+++ b/sys/compat/linuxkpi/common/src/linux_pci.c
@@ -1009,7 +1009,7 @@ lkpi_pci_msi_desc_alloc(int irq)
 
 	desc = malloc(sizeof(*desc), M_DEVBUF, M_WAITOK | M_ZERO);
 
-	desc->msi_attrib.is_64 =
+	desc->pci.msi_attrib.is_64 =
 	   (msi->msi_ctrl & PCIM_MSICTRL_64BIT) ? true : false;
 	desc->msg.data = msi->msi_data;