Skip to content

Commit a06f210

Browse files
haukelinvjw
authored andcommitted
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>
1 parent 00bcda4 commit a06f210

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

  • drivers/net/wireless/brcm80211/brcmsmac

‎drivers/net/wireless/brcm80211/brcmsmac/main.c‎

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4434,9 +4434,14 @@ static int brcms_b_attach(struct brcms_c_info *wlc, struct bcma_device *core,
44344434
struct pci_dev *pcidev = core->bus->host_pci;
44354435
struct ssb_sprom *sprom = &core->bus->sprom;
44364436

4437-
BCMMSG(wlc->wiphy, "wl%d: vendor 0x%x device 0x%x\n", unit,
4438-
pcidev->vendor,
4439-
pcidev->device);
4437+
if (core->bus->hosttype == BCMA_HOSTTYPE_PCI)
4438+
BCMMSG(wlc->wiphy, "wl%d: vendor 0x%x device 0x%x\n", unit,
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);
44404445

44414446
wme = true;
44424447

@@ -4462,16 +4467,22 @@ static int brcms_b_attach(struct brcms_c_info *wlc, struct bcma_device *core,
44624467
}
44634468

44644469
/* 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)) {
44664472
wiphy_err(wiphy, "wl%d: brcms_b_attach: Unsupported "
44674473
"vendor/device (0x%x/0x%x)\n",
44684474
unit, pcidev->vendor, pcidev->device);
44694475
err = 12;
44704476
goto fail;
44714477
}
44724478

4473-
wlc_hw->vendorid = pcidev->vendor;
4474-
wlc_hw->deviceid = pcidev->device;
4479+
if (core->bus->hosttype == BCMA_HOSTTYPE_PCI) {
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+
}
44754486

44764487
wlc_hw->d11core = core;
44774488
wlc_hw->corerev = core->id.rev;

0 commit comments

Comments
 (0)