2 * PCI Frontend Operations - ensure only one PCI frontend runs at a time
4 * Author: Ryan Wilson <hap9@epoch.ncsc.mil>
7 #include <linux/spinlock.h>
10 DEFINE_SPINLOCK(pcifront_dev_lock);
11 static struct pcifront_device *pcifront_dev = NULL;
13 int pcifront_connect(struct pcifront_device *pdev)
17 spin_lock(&pcifront_dev_lock);
20 dev_info(&pdev->xdev->dev, "Installing PCI frontend\n");
24 dev_err(&pdev->xdev->dev, "PCI frontend already installed!\n");
28 spin_unlock(&pcifront_dev_lock);
33 void pcifront_disconnect(struct pcifront_device *pdev)
35 spin_lock(&pcifront_dev_lock);
37 if (pdev == pcifront_dev) {
38 dev_info(&pdev->xdev->dev,
39 "Disconnecting PCI Frontend Buses\n");
43 spin_unlock(&pcifront_dev_lock);