[PATCH 06/11] crypto: ccp - Specify a single CCP via PCI device ID

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

 



Some processors contain multiple CCPs with differing device IDs. Enable
the selection of specific devices based on ID. The parameter value is
a single PCI ID.

Signed-off-by: Gary R Hook <gary.hook@xxxxxxx>
---
 drivers/crypto/ccp/sp-pci.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c
index 29177d113c90..b024b92fb749 100644
--- a/drivers/crypto/ccp/sp-pci.c
+++ b/drivers/crypto/ccp/sp-pci.c
@@ -36,6 +36,9 @@
 /*
  * Limit CCP use to a specifed number of queues per device.
  */
+static unsigned int pcidev;
+module_param(pcidev, uint, 0444);
+MODULE_PARM_DESC(pcidev, "Device number for a specific CCP");
 
 static struct mutex devcount_mutex ____cacheline_aligned;
 static unsigned int devcount = 0;
@@ -204,6 +207,10 @@ static int sp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (maxdev && (devcount >= maxdev)) /* Too many devices? */
 		return 0;
 
+	/* If a specific device ID has been specified, filter for it */
+        if (pcidev && (pdev->device != pcidev))
+                        return 0;
+
 	ret = -ENOMEM;
 	sp = sp_alloc_struct(dev);
 	if (!sp)





[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux