summaryrefslogtreecommitdiffstats
path: root/drivers/bcma/driver_pci.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-06-08 13:44:21 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-06-08 13:44:21 -0400
commitc0c33addcba2ce753b4e2746db99feaae2f82a85 (patch)
treedab480183ac0e64bfe9250e1f294705d1a424c78 /drivers/bcma/driver_pci.c
parentffbc03bc75b39c7bd412e7cc6d2185c11b0ffedd (diff)
parent931749bf78b969c54de9bbc67cf29b13a40bb73b (diff)
downloadlinux-c0c33addcba2ce753b4e2746db99feaae2f82a85.tar.bz2
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Diffstat (limited to 'drivers/bcma/driver_pci.c')
-rw-r--r--drivers/bcma/driver_pci.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index e757e4e3c7e2..789d68b4858b 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -161,3 +161,26 @@ void bcma_core_pci_init(struct bcma_drv_pci *pc)
{
bcma_pcicore_serdes_workaround(pc);
}
+
+int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
+ bool enable)
+{
+ struct pci_dev *pdev = pc->core->bus->host_pci;
+ u32 coremask, tmp;
+ int err;
+
+ err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp);
+ if (err)
+ goto out;
+
+ coremask = BIT(core->core_index) << 8;
+ if (enable)
+ tmp |= coremask;
+ else
+ tmp &= ~coremask;
+
+ err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp);
+
+out:
+ return err;
+}