2 * PCI Frontend Operations - ensure only one PCI frontend runs at a time
4 * Author: Ryan Wilson <hap9@epoch.ncsc.mil>
6 #include <linux/module.h>
7 #include <linux/init.h>
9 #include <linux/spinlock.h>
12 DEFINE_SPINLOCK(pcifront_dev_lock);
13 static struct pcifront_device *pcifront_dev = NULL;
15 int pcifront_connect(struct pcifront_device *pdev)
19 spin_lock(&pcifront_dev_lock);
22 dev_info(&pdev->xdev->dev, "Installing PCI frontend\n");
26 dev_err(&pdev->xdev->dev, "PCI frontend already installed!\n");
30 spin_unlock(&pcifront_dev_lock);
35 void pcifront_disconnect(struct pcifront_device *pdev)
37 spin_lock(&pcifront_dev_lock);
39 if (pdev == pcifront_dev) {
40 dev_info(&pdev->xdev->dev,
41 "Disconnecting PCI Frontend Buses\n");
45 spin_unlock(&pcifront_dev_lock);