lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-d31eb342409b24e3d2e1989c775f3361e93acc08@git.kernel.org>
Date:	Sun, 23 Nov 2014 10:08:48 -0800
From:	tip-bot for Jiang Liu <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	jiang.liu@...ux.intel.com, tglx@...utronix.de, bhelgaas@...gle.com,
	matthias.bgg@...il.com, marc.zyngier@....com,
	wangyijing@...wei.com, hpa@...or.com, tony.luck@...el.com,
	bp@...en8.de, linux-kernel@...r.kernel.org, mingo@...nel.org,
	yingjoe.chen@...iatek.com, agordeev@...hat.com,
	grant.likely@...aro.org
Subject: [tip:irq/irqdomain] PCI/MSI:
  Introduce helpers to hide struct msi_desc implementation details

Commit-ID:  d31eb342409b24e3d2e1989c775f3361e93acc08
Gitweb:     http://git.kernel.org/tip/d31eb342409b24e3d2e1989c775f3361e93acc08
Author:     Jiang Liu <jiang.liu@...ux.intel.com>
AuthorDate: Sat, 15 Nov 2014 22:24:03 +0800
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Sun, 23 Nov 2014 13:01:45 +0100

PCI/MSI: Introduce helpers to hide struct msi_desc implementation details

Introduce helpers to hide struct msi_desc implementation details,
so we could easily support non-PCI-compliant MSI devices later by
moving msi_list into struct device.

Signed-off-by: Jiang Liu <jiang.liu@...ux.intel.com>
Cc: Tony Luck <tony.luck@...el.com>
Cc: linux-arm-kernel@...ts.infradead.org
Cc: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Grant Likely <grant.likely@...aro.org>
Cc: Marc Zyngier <marc.zyngier@....com>
Cc: Yijing Wang <wangyijing@...wei.com>
Cc: Yingjoe Chen <yingjoe.chen@...iatek.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Matthias Brugger <matthias.bgg@...il.com>
Cc: Alexander Gordeev <agordeev@...hat.com>
Link: http://lkml.kernel.org/r/1416061447-9472-6-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
 include/linux/msi.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/include/linux/msi.h b/include/linux/msi.h
index 1dcad0c..e0d0851 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -43,6 +43,25 @@ struct msi_desc {
 	struct msi_msg msg;
 };
 
+/* Helpers to hide struct msi_desc implementation details */
+#define msi_desc_to_dev(desc)		(&(desc)->dev.dev)
+#define dev_to_msi_list(dev)		(&to_pci_dev((dev))->msi_list)
+#define first_msi_entry(dev)		\
+	list_first_entry(dev_to_msi_list((dev)), struct msi_desc, list)
+#define for_each_msi_entry(desc, dev)	\
+	list_for_each_entry((desc), dev_to_msi_list((dev)), list)
+
+#ifdef CONFIG_PCI_MSI
+#define first_pci_msi_entry(pdev)	first_msi_entry(&(pdev)->dev)
+#define for_each_pci_msi_entry(desc, pdev)	\
+	for_each_msi_entry((desc), &(pdev)->dev)
+
+static inline struct pci_dev *msi_desc_to_pci_dev(struct msi_desc *desc)
+{
+	return desc->dev;
+}
+#endif /* CONFIG_PCI_MSI */
+
 void __pci_read_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
 void __pci_write_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
 void pci_write_msi_msg(unsigned int irq, struct msi_msg *msg);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ