PCI/MSI: Add pci_msi_vec_count()

Device drivers can use this interface to obtain the maximum number of MSI
interrupts the device supports and use that number, e.g., in a subsequent
call to pci_enable_msi_block().

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Tejun Heo <tj@kernel.org>
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 7c34c39..6691de0 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1154,6 +1154,11 @@
 
 
 #ifndef CONFIG_PCI_MSI
+static inline int pci_msi_vec_count(struct pci_dev *dev)
+{
+	return -ENOSYS;
+}
+
 static inline int pci_enable_msi_block(struct pci_dev *dev, int nvec)
 {
 	return -ENOSYS;
@@ -1195,6 +1200,7 @@
 	return 0;
 }
 #else
+int pci_msi_vec_count(struct pci_dev *dev);
 int pci_enable_msi_block(struct pci_dev *dev, int nvec);
 int pci_enable_msi_block_auto(struct pci_dev *dev, int *maxvec);
 void pci_msi_shutdown(struct pci_dev *dev);