[PATCH 6/8] PCI: added pci_msi_enabled which checks for pci=nomsi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PCI: added pci_msi_enabled which checks for pci=nomsi

The pci_msi_enabled() function is used to check whether pci=nomsi
is set on the kernel command-line.

Signed-off-by: Andrew Patterson <andrew.patterson@xxxxxx>
---

 drivers/pci/msi.c   |   12 ++++++++++++
 include/linux/pci.h |    5 +++++
 2 files changed, 17 insertions(+), 0 deletions(-)


diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index d281201..0e8dae1 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -755,6 +755,18 @@ void pci_no_msi(void)
 	pci_msi_enable = 0;
 }
 
+/**
+ * pci_msi_enabled - is MSI enabled?
+ *
+ * Returns true if MSI has not been disabled by the command-line option
+ * pci=nomsi.
+ **/
+int pci_msi_enabled(void)
+{
+	return pci_msi_enable;
+}
+EXPORT_SYMBOL(pci_msi_enabled);
+
 void pci_msi_init_pci_dev(struct pci_dev *dev)
 {
 	INIT_LIST_HEAD(&dev->msi_list);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 752def8..8d0513e 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -767,6 +767,10 @@ static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev)
 
 static inline void pci_restore_msi_state(struct pci_dev *dev)
 { }
+static inline int pci_msi_enabled(void)
+{
+	return 0;
+}
 #else
 extern int pci_enable_msi(struct pci_dev *dev);
 extern void pci_msi_shutdown(struct pci_dev *dev);
@@ -777,6 +781,7 @@ extern void pci_msix_shutdown(struct pci_dev *dev);
 extern void pci_disable_msix(struct pci_dev *dev);
 extern void msi_remove_pci_irq_vectors(struct pci_dev *dev);
 extern void pci_restore_msi_state(struct pci_dev *dev);
+extern int pci_msi_enabled(void);
 #endif
 
 #ifdef CONFIG_HT_IRQ

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux