aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-04-28 20:50:42 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-05-16 12:45:26 -0400
commita06f2109917e19f41af4d19144ce993247b4eff2 (patch)
tree7a61fe23754e28821421a5e7a288a620ffece466 /drivers
parent00bcda400434039db38fbfd26aef6090129d8c2c (diff)
brcmsmac: read PCI vendor and device id only for PCI devices
If brcmsmac is used on non PCI(s) devices it should not try to access bus->host_pci. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Tested-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 479cb17c5ba1..19db4052c44c 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -4434,9 +4434,14 @@ static int brcms_b_attach(struct brcms_c_info *wlc, struct bcma_device *core,
4434 struct pci_dev *pcidev = core->bus->host_pci; 4434 struct pci_dev *pcidev = core->bus->host_pci;
4435 struct ssb_sprom *sprom = &core->bus->sprom; 4435 struct ssb_sprom *sprom = &core->bus->sprom;
4436 4436
4437 BCMMSG(wlc->wiphy, "wl%d: vendor 0x%x device 0x%x\n", unit, 4437 if (core->bus->hosttype == BCMA_HOSTTYPE_PCI)
4438 pcidev->vendor, 4438 BCMMSG(wlc->wiphy, "wl%d: vendor 0x%x device 0x%x\n", unit,
4439 pcidev->device); 4439 pcidev->vendor,
4440 pcidev->device);
4441 else
4442 BCMMSG(wlc->wiphy, "wl%d: vendor 0x%x device 0x%x\n", unit,
4443 core->bus->boardinfo.vendor,
4444 core->bus->boardinfo.type);
4440 4445
4441 wme = true; 4446 wme = true;
4442 4447
@@ -4462,7 +4467,8 @@ static int brcms_b_attach(struct brcms_c_info *wlc, struct bcma_device *core,
4462 } 4467 }
4463 4468
4464 /* verify again the device is supported */ 4469 /* verify again the device is supported */
4465 if (!brcms_c_chipmatch(pcidev->vendor, pcidev->device)) { 4470 if (core->bus->hosttype == BCMA_HOSTTYPE_PCI &&
4471 !brcms_c_chipmatch(pcidev->vendor, pcidev->device)) {
4466 wiphy_err(wiphy, "wl%d: brcms_b_attach: Unsupported " 4472 wiphy_err(wiphy, "wl%d: brcms_b_attach: Unsupported "
4467 "vendor/device (0x%x/0x%x)\n", 4473 "vendor/device (0x%x/0x%x)\n",
4468 unit, pcidev->vendor, pcidev->device); 4474 unit, pcidev->vendor, pcidev->device);
@@ -4470,8 +4476,13 @@ static int brcms_b_attach(struct brcms_c_info *wlc, struct bcma_device *core,
4470 goto fail; 4476 goto fail;
4471 } 4477 }
4472 4478
4473 wlc_hw->vendorid = pcidev->vendor; 4479 if (core->bus->hosttype == BCMA_HOSTTYPE_PCI) {
4474 wlc_hw->deviceid = pcidev->device; 4480 wlc_hw->vendorid = pcidev->vendor;
4481 wlc_hw->deviceid = pcidev->device;
4482 } else {
4483 wlc_hw->vendorid = core->bus->boardinfo.vendor;
4484 wlc_hw->deviceid = core->bus->boardinfo.type;
4485 }
4475 4486
4476 wlc_hw->d11core = core; 4487 wlc_hw->d11core = core;
4477 wlc_hw->corerev = core->id.rev; 4488 wlc_hw->corerev = core->id.rev;