diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-09-29 20:40:18 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-19 15:52:59 -0400 |
commit | dfae714361ba75323914da19eb411aaae53d6af0 (patch) | |
tree | ab36b15dca4e8d17f87f86f9f5ad03e0eafc9b68 /drivers/bcma/main.c | |
parent | 017c4c3bdeb4e6c38094eb2330a57370f68f4853 (diff) | |
download | op-kernel-dev-dfae714361ba75323914da19eb411aaae53d6af0.zip op-kernel-dev-dfae714361ba75323914da19eb411aaae53d6af0.tar.gz |
bcma: add an extra pcie core struct
The BCM4706 has two PCIe host controller on the bcma bus. For PCIe
client mode it is assumed that there is only one PCIe controller so the
PCIe driver, like b43 and brcmsmac are accessing the first PCIe
controller when they want to issue a operation on the host controller.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma/main.c')
-rw-r--r-- | drivers/bcma/main.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index d6b5c4c..7f473cf 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c @@ -81,6 +81,18 @@ struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid) } EXPORT_SYMBOL_GPL(bcma_find_core); +static struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid, + u8 unit) +{ + struct bcma_device *core; + + list_for_each_entry(core, &bus->cores, list) { + if (core->id.id == coreid && core->core_unit == unit) + return core; + } + return NULL; +} + static void bcma_release_core_dev(struct device *dev) { struct bcma_device *core = container_of(dev, struct bcma_device, dev); @@ -211,10 +223,17 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) } /* Init PCIE core */ - core = bcma_find_core(bus, BCMA_CORE_PCIE); + core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 0); + if (core) { + bus->drv_pci[0].core = core; + bcma_core_pci_init(&bus->drv_pci[0]); + } + + /* Init PCIE core */ + core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 1); if (core) { - bus->drv_pci.core = core; - bcma_core_pci_init(&bus->drv_pci); + bus->drv_pci[1].core = core; + bcma_core_pci_init(&bus->drv_pci[1]); } /* Init GBIT MAC COMMON core */ |